:root {
  --bg: #f7f7f7;
  --card: #ffffff;
  --ink: #121212;
  --muted: #5a5a5a;
  --line: #e5e5e5;
  --brand: #ac0d1f;
  --btn: #ac0d1f;
  --brand-soft: #fbe8ea;
  --green: #15a24a;
  --green-deep: #0f7f38;
  --green-soft: #e3f6ea;
  --red: #c8102e;
  --red-deep: #8a0a18;
  --red-soft: #fbe8ea;
  --amber: #b86e00;
  --amber-soft: #fff3de;
  --shadow: 0 1px 2px rgba(14, 27, 42, 0.06), 0 6px 20px rgba(14, 27, 42, 0.06);
  --radius: 16px;
  --tabs: 68px;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0b0b;
    --card: #1a1a1a;
    --ink: #f5f5f5;
    --muted: #a3a3a3;
    --line: #2e2e2e;
    --brand: #ef3b4f;
    --btn: #c8102e;
    --brand-soft: #2b1216;
    --green: #2ec866;
    --green-deep: #1faa52;
    --green-soft: #12301f;
    --red: #ff5d6e;
    --red-deep: #b3122a;
    --red-soft: #3a161b;
    --amber: #f3b24a;
    --amber-soft: #36290f;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 20px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font: 16px/1.4 var(--font-body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.015em; font-weight: 600; font-optical-sizing: auto; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.hide { display: none !important; }

/* ---------- buttons and fields ---------- */
.btn {
  appearance: none; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 650;
  background: var(--btn); color: #fff; min-height: 46px; transition: transform 0.08s, opacity 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); }
.btn.soft { background: var(--brand-soft); color: var(--brand); }
.btn.green { background: var(--green-deep); }
.btn.danger { background: var(--red-deep); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
.btn.block { width: 100%; }
.link { background: none; border: 0; color: var(--brand); padding: 6px 0; font-weight: 600; }
.link.red { color: var(--red); }

label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 650; color: var(--muted); margin: 0 0 6px; }
input[type='text'], input[type='password'], input[type='number'], input[type='datetime-local'], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); outline: none; appearance: none; -webkit-appearance: none;
}
select { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-weight: 600; }
.check input { width: 22px; height: 22px; accent-color: var(--brand); }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.chip { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.chip.green { background: var(--green-soft); color: var(--green-deep); }
.chip.red { background: var(--red-soft); color: var(--red-deep); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
.err { color: var(--red); font-weight: 600; font-size: 14px; min-height: 20px; margin: 0 0 8px; }

/* ---------- login ---------- */
.login { max-width: 400px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 40px) 22px 40px; }
.login .logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: var(--shadow); display: block; margin: 0 auto 18px; }
.login h1 { text-align: center; font-size: 26px; letter-spacing: -0.02em; }
.login .sub { text-align: center; color: var(--muted); margin: 6px 0 26px; }
.langs { display: flex; justify-content: center; gap: 6px; margin-top: 22px; }
.langs button, .pill { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 6px 14px; font-weight: 700; font-size: 13px; color: var(--muted); }
.langs button.on, .pill.on { background: var(--btn); border-color: var(--btn); color: #fff; }
.hint { background: var(--brand-soft); border-radius: 14px; padding: 12px 14px; font-size: 14px; display: flex; gap: 10px; align-items: flex-start; margin-top: 18px; }
.hint p { flex: 1; }
.hint .x { background: none; border: 0; font-size: 20px; line-height: 1; color: var(--muted); padding: 0 4px; }

/* ---------- worker ---------- */
.wrap { max-width: 520px; margin: 0 auto; padding: 0 18px calc(var(--tabs) + env(safe-area-inset-bottom) + 24px); }
.wtop { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: calc(env(safe-area-inset-top) + 18px) 0 8px; }
.wtop .hello { color: var(--muted); font-weight: 600; font-size: 15px; }
.wtop h1 { font-size: 30px; letter-spacing: -0.02em; line-height: 1.1; overflow-wrap: anywhere; }
.wtop .tools { display: flex; gap: 8px; align-items: center; padding-top: 4px; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); display: grid; place-items: center; color: var(--muted); padding: 0; }
.icon-btn svg { width: 20px; height: 20px; }

.clockmain { display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 10px; }
.state { font-weight: 650; color: var(--muted); min-height: 24px; }
.state.on { color: var(--green-deep); }
.timer { font-size: 54px; font-weight: 750; letter-spacing: -0.03em; margin: 2px 0 14px; font-variant-numeric: tabular-nums; }
.bigbtn {
  --c1: #22c55e; --c2: var(--green-deep);
  width: min(66vw, 264px); aspect-ratio: 1; border-radius: 50%; border: 0; color: #fff;
  font-size: 30px; font-weight: 800; letter-spacing: 0.01em; line-height: 1.1; padding: 20px;
  background: radial-gradient(circle at 32% 24%, var(--c1), var(--c2));
  box-shadow: 0 14px 36px color-mix(in srgb, var(--c2) 45%, transparent), inset 0 -6px 14px rgba(0, 0, 0, 0.18);
  position: relative; transition: transform 0.1s;
}
.bigbtn:active { transform: scale(0.96); }
.bigbtn.out { --c1: #e0243a; --c2: #ac0d1f; }
.bigbtn[disabled] { opacity: 0.7; pointer-events: none; }
.bigbtn.out::after {
  content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 3px solid var(--red); opacity: 0;
  animation: ring 2.4s ease-out infinite;
}
@keyframes ring { 0% { transform: scale(0.94); opacity: 0.55; } 100% { transform: scale(1.12); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bigbtn.out::after { animation: none; } }
.warn { background: var(--amber-soft); color: var(--amber); border-radius: 12px; padding: 10px 14px; margin-top: 22px; font-weight: 600; font-size: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; margin-top: 30px; }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; text-align: left; }
.stat .k { color: var(--muted); font-size: 13px; font-weight: 650; }
.stat .v { font-size: 26px; font-weight: 750; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .in { display: flex; width: 100%; max-width: 640px; }
.tab { flex: 1; height: var(--tabs); background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 12.5px; font-weight: 650; }
.tab svg { width: 26px; height: 26px; }
.tab.on { color: var(--brand); }

.weeknav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 14px 0 12px; }
.weeknav .mid { text-align: center; }
.weeknav .mid b { display: block; font-size: 17px; }
.weeknav .mid small { color: var(--muted); font-weight: 600; }
.weeknav button { width: 44px; height: 44px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-size: 22px; font-weight: 700; color: var(--brand); padding: 0; }
.weeknav button[disabled] { opacity: 0.3; }
.total { display: flex; align-items: center; justify-content: space-between; padding: 18px; margin-bottom: 14px; }
.total .big { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.total .lbl { color: var(--muted); font-weight: 650; font-size: 14px; }
.days { display: grid; gap: 10px; }
.day { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; background: var(--card); border-radius: 14px; padding: 13px 15px; box-shadow: var(--shadow); }
.day.today { outline: 2px solid var(--brand); }
.day.future, .day.empty { opacity: 0.55; }
.day .d { min-width: 74px; }
.day .d b { display: block; font-size: 16px; text-transform: capitalize; }
.day .d span { color: var(--muted); font-size: 13px; text-transform: capitalize; }
.day .shifts { flex: 1; text-align: right; }
.day .shifts div { font-variant-numeric: tabular-nums; }
.day .tot { font-weight: 750; margin-top: 2px; color: var(--brand); }
.day .live { color: var(--green-deep); font-weight: 700; }

/* ---------- owner ---------- */
.atop { position: sticky; top: 0; z-index: 15; background: var(--bg); }
.ahead { padding: calc(env(safe-area-inset-top) + 14px) 18px 8px; }
.ahead .in { max-width: 920px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ahead h1 { font-size: 22px; letter-spacing: -0.02em; }
.ahead small { color: var(--muted); font-weight: 600; display: block; }
.awrap { max-width: 920px; margin: 0 auto; padding: 8px 18px calc(var(--tabs) + env(safe-area-inset-bottom) + 28px); }
.sec { margin: 4px 0 12px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sec h2 { font-size: 19px; letter-spacing: -0.01em; }
.grid { display: grid; gap: 12px; }
@media (min-width: 720px) { .grid.cols2 { grid-template-columns: 1fr 1fr; } .grid.cols3 { grid-template-columns: repeat(3, 1fr); } }

.wcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px 16px; display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; align-items: center; border-left: 5px solid var(--line); }
.wcard.on { border-left-color: var(--green); }
.wcard.long { border-left-color: var(--amber); }
.wcard .nm { font-weight: 750; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; flex: none; }
.on .dot { background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
.wcard .tm { font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; color: var(--green-deep); }
.wcard .sub { color: var(--muted); font-size: 14px; }
.wcard .meta { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; }
.feed { display: grid; gap: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.feed div { display: flex; justify-content: space-between; gap: 10px; padding: 11px 15px; border-bottom: 1px solid var(--line); font-size: 15px; }
.feed div:last-child { border-bottom: 0; }
.feed .in { color: var(--green-deep); font-weight: 700; }
.feed .out { color: var(--red-deep); font-weight: 700; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; }
.tile .k { color: var(--muted); font-size: 12.5px; font-weight: 700; }
.tile .v { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile.hl { background: var(--btn); color: #fff; }
.tile.hl .k { color: rgba(255, 255, 255, 0.8); }
@media (max-width: 420px) { .tile .v { font-size: 17px; } }

.prow { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; width: 100%; text-align: left; background: var(--card); border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; }
.prow .nm { font-weight: 750; font-size: 17px; }
.prow .sub { color: var(--muted); font-size: 14px; }
.prow .tt { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; text-align: right; font-variant-numeric: tabular-nums; }
.prow .st { text-align: right; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.actions a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

.trow { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; background: var(--card); border: 0; border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 10px; }
.trow.off { opacity: 0.6; }
.trow .nm { font-weight: 750; font-size: 17px; }

.list-card { display: grid; gap: 14px; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-variant-numeric: tabular-nums; }
.kv:last-child { border-bottom: 0; }
.kv.tot { font-weight: 800; font-size: 18px; border-top: 2px solid var(--ink); border-bottom: 0; margin-top: 4px; padding-top: 10px; }
.kv .neg { color: var(--red-deep); }

/* ---------- sheet and modal ---------- */
.back { position: fixed; inset: 0; z-index: 40; background: rgba(8, 16, 26, 0.55); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.15s; }
@keyframes fade { from { opacity: 0; } }
.panel { background: var(--bg); width: 100%; max-width: 640px; max-height: 94dvh; overflow: auto; border-radius: 22px 22px 0 0; padding: 18px 18px calc(env(safe-area-inset-bottom) + 22px); animation: up 0.2s ease-out; overscroll-behavior: contain; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 720px) { .back { align-items: center; } .panel { border-radius: 22px; max-height: 90vh; } }
.panel .ph { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 14px; }
.panel .ph h2 { font-size: 22px; letter-spacing: -0.02em; }
.panel .ph small { color: var(--muted); font-weight: 600; }
.panel h3 { font-size: 15px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.banner { border-radius: 12px; padding: 10px 14px; font-weight: 650; font-size: 14px; margin-bottom: 10px; }
.banner.green { background: var(--green-soft); color: var(--green-deep); }
.banner.amber { background: var(--amber-soft); color: var(--amber); }
.dayrow { background: var(--card); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.dayrow .h { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-weight: 700; }
.dayrow .h span { color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.shift { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0 0; font-variant-numeric: tabular-nums; font-size: 15px; }
.shift button { background: var(--brand-soft); color: var(--brand); border: 0; border-radius: 9px; padding: 4px 11px; font-weight: 700; font-size: 13px; }
.adjrow { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.adjrow button { background: none; border: 0; color: var(--red); font-size: 20px; padding: 0 6px; line-height: 1; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: -6px 0 14px; }
.chips button { border: 1.5px solid var(--line); background: var(--card); border-radius: 99px; padding: 4px 11px; font-size: 13px; font-weight: 650; color: var(--muted); }

#toast { position: fixed; left: 50%; bottom: calc(var(--tabs) + env(safe-area-inset-bottom) + 18px); transform: translate(-50%, 20px); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 650; font-size: 15px; z-index: 60; opacity: 0; pointer-events: none; transition: 0.2s; max-width: min(92vw, 420px); text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--red-deep); color: #fff; }

.spin { display: grid; place-items: center; padding: 60px 0; color: var(--muted); }
.empty-note { text-align: center; color: var(--muted); padding: 26px 10px; }

/* owner on a wide screen: tabs go to the top */
@media (min-width: 900px) {
  .tabbar.owner { position: static; border: 0; background: var(--bg); backdrop-filter: none; padding: 0; }
  .tabbar.owner .in { max-width: 920px; padding: 0 18px; gap: 6px; }
  .tabbar.owner .tab { height: 44px; flex-direction: row; justify-content: center; gap: 8px; border-radius: 12px; font-size: 15px; }
  .tabbar.owner .tab.on { background: var(--brand-soft); }
  .tabbar.owner .tab svg { width: 20px; height: 20px; }
  .awrap { padding-bottom: 48px; }
  #toast { bottom: 28px; }
}

/* ---------- weekly chart ---------- */
.muted.tiny, .tiny { font-size: 13px; }
.center { text-align: center; }
.login .tiny { margin-top: 12px; }
.signout { margin-top: 34px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.link.quiet { color: var(--muted); font-weight: 600; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
#app.wide .ahead .in, #app.wide .tabbar.owner .in, #app.wide .awrap { max-width: 1240px; }
.gridcard { padding: 0; overflow: hidden; }
.gscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pgrid { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 880px; font-variant-numeric: tabular-nums; }
.pgrid th, .pgrid td { padding: 12px 8px; text-align: right; white-space: nowrap; }
.pgrid th:first-child, .pgrid td:first-child { text-align: left; position: sticky; left: 0; z-index: 1; background: var(--card); min-width: 140px; box-shadow: 1px 0 0 var(--line); }
.pgrid thead th { font-size: 12.5px; font-weight: 700; color: var(--muted); border-bottom: 2px solid var(--line); background: var(--card); }
.pgrid thead small { display: block; font-weight: 600; font-size: 11.5px; }
.pgrid tbody tr { cursor: pointer; }
.pgrid tbody td { border-bottom: 1px solid var(--line); }
.pgrid tbody tr:hover td { background: var(--brand-soft); }
.pgrid .today { background: color-mix(in srgb, var(--brand) 9%, var(--card)); }
.pgrid .tc { font-weight: 800; }
.pgrid tbody .tc { font-size: 16px; }
.pgrid .gn { font-weight: 750; font-size: 16px; }
.pgrid .gs { margin-top: 2px; }
.pgrid tfoot td { font-weight: 800; background: var(--brand-soft); border-top: 2px solid var(--ink); }
.pgrid tfoot td:first-child { background: var(--brand-soft); }
.pgrid tfoot .tc { font-size: 17px; }

/* ---------- year and month tabs, stacked weeks ---------- */
.ptabs { margin: 2px 0 14px; display: grid; gap: 10px; }
.yearnav { display: flex; align-items: center; gap: 10px; }
.yearnav b { font-size: 26px; letter-spacing: -0.02em; min-width: 66px; text-align: center; font-variant-numeric: tabular-nums; }
.yearnav button { width: 40px; height: 40px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); font-size: 22px; font-weight: 700; color: var(--brand); padding: 0; }
.yearnav button[disabled] { opacity: 0.3; }
.mchips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mchips::-webkit-scrollbar { display: none; }
.mchip { flex: none; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); border-radius: 12px; padding: 9px 14px; font-weight: 700; font-size: 14px; min-height: 40px; }
.mchip.later { color: var(--muted); opacity: 0.6; }
.mchip.on { background: var(--btn); border-color: var(--btn); color: #fff; opacity: 1; }
.mchip.year { margin-left: 8px; border-style: dashed; }
.mchip.year.on { border-style: solid; }
.wk { margin-bottom: 22px; }
.wkhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.wkhead h3 { font-size: 18px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; color: var(--ink); text-transform: none; }
.wkhead small { color: var(--muted); font-weight: 600; }
.wkbtns { display: flex; gap: 8px; align-items: center; }
.wkbtns a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.pgrid.slim { min-width: 0; }
.pgrid.slim th:first-child, .pgrid.slim td:first-child { min-width: 130px; }
.pgrid tr.nohover { cursor: default; }
.pgrid tbody tr.nohover:hover td { background: var(--card); }
.pgrid tr.dimrow { opacity: 0.55; }

/* ---------- simpler owner screens ---------- */
.ptop { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin: 2px 0 14px; }
.seg { display: inline-flex; background: var(--card); border: 1.5px solid var(--line); border-radius: 13px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; padding: 9px 16px; border-radius: 10px; font-weight: 700; font-size: 15px; color: var(--muted); min-height: 38px; }
.seg button.on { background: var(--btn); color: #fff; }
.seg.full { display: flex; }
.seg.full button { flex: 1; padding: 9px 6px; }
.wkhead.solo { justify-content: flex-end; }
.wcard2 { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin-bottom: 12px; }
.wcard2.off { opacity: 0.6; }
.wcard2 .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.wcard2 .nm { font-weight: 750; font-size: 18px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wcard2 .rate { text-align: right; }
.wcard2 .rate b { display: block; font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wcard2 .rate span { color: var(--muted); font-size: 13px; font-weight: 600; }
.wcard2 .btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.bigtotal { text-align: center; padding: 18px; margin-bottom: 12px; }
.bigtotal .lbl { color: var(--muted); font-weight: 650; font-size: 14px; }
.bigtotal .amt { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin: 2px 0; }
.twin { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.opts { display: grid; gap: 8px; }
.opt { display: flex; gap: 12px; align-items: flex-start; background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px; cursor: pointer; }
.opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opt input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.opt b { display: block; }
.opt small { display: block; color: var(--muted); font-weight: 600; margin-top: 1px; }
input[type='date'] { width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); outline: none; appearance: none; -webkit-appearance: none; }

/* pay by project */
form:has(input[name=paytype][value=project]:checked) .ratefield,
form:has(select[name=paytype] option[value=project]:checked) .ratefield { display: none; }
.wcard2 .rate b.proj { font-size: 18px; color: var(--brand); }

/* ---------- phone polish ---------- */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
button, a, [data-act], input, select, summary { touch-action: manipulation; }
button, .tab, .bigbtn, .pill, .chip { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.btn.sm { min-height: 42px; padding: 8px 14px; }
.seg button { min-height: 42px; }
.mchip { min-height: 42px; }
.link { padding: 10px 2px; }
.bigbtn { width: min(66vw, 264px, 38dvh); font-size: clamp(24px, 8vw, 30px); }
.inl { width: 1.15em; height: 1.15em; vertical-align: -0.2em; }

.a2h { margin-top: 26px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.a2h h2 { font-size: 17px; letter-spacing: -0.01em; }
.a2h .tiny { margin-top: 2px; }
.a2h details { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 4px; }
.a2h summary { font-weight: 700; padding: 10px 0; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.a2h summary::-webkit-details-marker { display: none; }
.a2h summary::after { content: '+'; font-size: 22px; color: var(--muted); font-weight: 500; }
.a2h details[open] summary::after { content: '\2212'; }
.a2h ol { margin: 0 0 6px; padding-left: 22px; display: grid; gap: 10px; font-size: 15px; }
.a2h li::marker { font-weight: 800; color: var(--brand); }

.pcards { display: none; }
.pc { width: 100%; text-align: left; border: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.pc.total { background: var(--brand-soft); box-shadow: none; }
.pc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pc .gn { font-weight: 750; font-size: 17px; }
.pc-total { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.pc-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; margin: 10px 0 8px; text-align: center; }
.pc-days > div { border-radius: 8px; padding: 5px 0; }
.pc-days small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }
.pc-days b { font-size: 13px; font-variant-numeric: tabular-nums; }
.pc-days .today { background: var(--brand-soft); }
.pc.total .pc-days .today { background: var(--card); }
.pc-sum { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.pc-sum b { color: var(--ink); }
@media (max-width: 719px) {
  .wide-only { display: none; }
  .pcards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .awrap { padding-left: 14px; padding-right: 14px; }
  .tiles { gap: 8px; }
  .ptop .btn { flex: 1; }
  .wkhead .wkbtns { width: 100%; }
  .wkhead .wkbtns .btn { flex: 1; }
  .panel { padding-left: 14px; padding-right: 14px; }
}
@media (max-height: 700px) { .timer { font-size: 44px; margin-bottom: 8px; } .stats { margin-top: 20px; } }

.rangebox { padding: 14px 14px 6px; margin-bottom: 14px; }
.rangebox .field { margin-bottom: 8px; }
.rangebox .mchips { padding-bottom: 8px; }

.pc, .pc > *, .wcard2, .wcard2 .top > div { min-width: 0; }
.pc-sum span { white-space: nowrap; }
.grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .grid.cols2 { grid-template-columns: 1fr 1fr; } .grid.cols3 { grid-template-columns: repeat(3, 1fr); } }

@media (max-width: 719px) {
  .pgrid.slim { font-size: 13.5px; }
  .pgrid.slim th, .pgrid.slim td { padding: 11px 5px; }
  .pgrid.slim th:first-child, .pgrid.slim td:first-child { min-width: 84px; max-width: 110px; white-space: normal; line-height: 1.2; padding-left: 10px; }
  .pgrid.slim .gn { font-size: 15px; }
}

/* add buttons on the payroll chart */
.plus { margin-left: 8px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 18px; line-height: 1; padding: 0; vertical-align: middle; }
.plus:hover { background: var(--btn); color: #fff; }
.pgrid td.ex { white-space: nowrap; }
.wkbtns { flex-wrap: wrap; }
.pc { cursor: pointer; }
.pc-add { width: 100%; margin-top: 12px; }

/* projects and bonuses list in the worker sheet */
.sechead { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 18px 0 8px; }
.sechead h3 { margin: 0; }
.entries { display: grid; gap: 0; padding: 4px 14px; }
.entry { padding: 12px 0; border-bottom: 1px solid var(--line); }
.entry:last-of-type { border-bottom: 0; }
.entry-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.entry-top b { font-size: 19px; letter-spacing: -0.01em; }
.entry-note { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.entry-btns { display: flex; gap: 8px; margin-top: 10px; }
.entry-btns .btn { flex: 1; }
.danger-t { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, var(--line)); }

/* forgot to clock out */
.wcard .meta2 { grid-column: 1 / -1; margin-top: 4px; }
.wcard .forgot { background: var(--amber-soft); color: var(--amber); font-weight: 650; font-size: 14px; border-radius: 10px; padding: 8px 12px; margin-bottom: 8px; }
.meta2-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.meta2-btns .btn { flex: 1; min-width: 130px; }
.banner .btn { display: block; }

/* Workers tab: pay is its own clear, tappable line */
.wcard2 .pinrow { margin-top: 6px; }
.paybox { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; margin-top: 14px; padding: 14px; text-align: left; background: var(--brand-soft); border: 1.5px solid color-mix(in srgb, var(--brand) 35%, transparent); border-radius: 14px; color: var(--ink); }
.paybox.static { cursor: default; margin: 0 0 14px; }
.paybox-l { display: grid; gap: 1px; min-width: 0; }
.paybox-l small { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.paybox-l b { font-size: 22px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.paybox-l b span { font-size: 14px; color: var(--muted); font-weight: 600; letter-spacing: 0; }
.paybox-l em { font-style: normal; color: var(--muted); font-size: 13px; }
.paybox-r { flex: none; background: var(--btn); color: #fff; font-weight: 700; padding: 10px 16px; border-radius: 11px; }

code { background: color-mix(in srgb, var(--ink) 10%, transparent); border-radius: 6px; padding: 2px 6px; font-size: 12.5px; overflow-wrap: anywhere; }

/* ---------- Jampacked brand ---------- */
.panel h3, .sechead h3 { font-family: var(--font-body); font-weight: 700; }
.login .logo { width: 104px; height: 104px; border-radius: 0; box-shadow: none; margin-bottom: 14px; }
.login h1 { font-weight: 600; }
.brandbar { display: flex; align-items: center; gap: 12px; }
.brandbar img { width: 40px; height: 40px; flex: none; }
.ahead h1 { font-size: 21px; line-height: 1.1; }
.bigbtn:not(.out) { --c1: #22c55e; }
.tile .v, .total .big, .bigtotal .amt, .timer, .stat .v, .pc-total, .prow .tt { font-family: var(--font-body); }
.chip { background: var(--brand-soft); color: var(--brand); }
.chip.green { background: var(--green-soft); color: var(--green-deep); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.amber { background: var(--amber-soft); color: var(--amber); }
