/* Payclock styles. Layout: one phone column; live meter, three rings, a donut of where the money goes,
   then cards. Log, Side hustle, Payslip and Settings sit behind a bottom tab bar. */

/* IBM Plex Sans (OFL, fonts/LICENSE-OFL.txt) for Latin text and numbers only; Chinese falls back to the
   system font for the page's language. Plex has 400 / 500 / 600 only, so no other weights are used. */
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/plex-sans-400.woff2) format("woff2"); unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2190-21FF, U+2212; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url(fonts/plex-sans-500.woff2) format("woff2"); unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2190-21FF, U+2212; }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url(fonts/plex-sans-600.woff2) format("woff2"); unicode-range: U+0000-024F, U+2000-206F, U+20AC, U+2190-21FF, U+2212; }

:root {
  --bg: #f2f4f3;
  --surface: #ffffff;
  --sunken: #e9edeb;
  --track: #e2e7e4;
  --line: #d9dfdc;
  --ink: #111816;
  --muted: #5e6b66;
  --today: #10a36a;
  --month: #c97f08;
  --year: #6a55e3;
  --super: #2c7fc6;
  --tax: #a3aca8;
  --side: #e0612b;
  --job1: #10a36a;
  --job2: #2c7fc6;
  --job3: #c2418f;
  --job4: #8a6d1f;
  --job5: #0f8a8f;
  --job6: #6a55e3;
  --danger: #c0392b;
  --on-accent: #ffffff;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --num: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
/* Chinese text uses the system font made for that script; Simplified must not get Traditional glyph shapes. */
:root:lang(zh-Hant) { --font: "IBM Plex Sans", "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Microsoft JhengHei UI", "Microsoft JhengHei", system-ui, sans-serif; }
:root:lang(zh-Hans) { --font: "IBM Plex Sans", "PingFang SC", "Noto Sans SC", "Noto Sans CJK SC", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif; }
:root:lang(zh-Hant), :root:lang(zh-Hans) { --num: var(--font); }
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0f0e; --surface: #141a18; --sunken: #1b2320; --track: #232c29; --line: #26302c;
    --ink: #eef3f1; --muted: #8e9b96; --today: #3ddc97; --month: #ffb547; --year: #9d8dff;
    --super: #5db2ff; --tax: #56625e; --side: #ff8a57;
    --job1: #3ddc97; --job2: #5db2ff; --job3: #f27ac0; --job4: #d9b75a; --job5: #4fd3d8; --job6: #9d8dff;
    --danger: #f2827a; --on-accent: #08130e; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.5; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; overflow-wrap: break-word; line-break: strict; }
:root:lang(zh-Hant) body, :root:lang(zh-Hans) body { line-height: 1.6; }
p, li, dt, .hint { text-wrap: pretty; }
h1, h2 { text-wrap: balance; }
.nw { white-space: nowrap; }
.btn, .clock-btn, .tabbar button, th, .tag, .pill, .days span { white-space: nowrap; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--today); outline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font-size: 1.05rem; font-weight: 600; }
h3 { font-size: .95rem; font-weight: 600; }
p { margin: 0; }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.soft { font-weight: 500; font-size: .85em; }
.label { font-size: .75rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.c-today { color: var(--today); } .c-month, .c-ot { color: var(--month); } .c-super { color: var(--super); } .c-danger { color: var(--danger); }

/* ---------- controls ---------- */
.btn { border: 1px solid var(--line); background: var(--surface); padding: 10px 15px; border-radius: 11px; font-weight: 600; font-size: .95rem; min-height: 44px; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.small { padding: 6px 12px; font-size: .86rem; border-radius: 9px; min-height: 36px; justify-self: start; }
.btn.danger { color: var(--danger); }
input[type="text"], input[type="password"], input[type="number"], input[type="date"], input[type="time"], select {
  background: var(--sunken); border: 1px solid var(--line); border-radius: 11px; padding: 10px 12px; width: 100%; min-width: 0; font-size: 16px; min-height: 44px;
}
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: .85rem; color: var(--muted); }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--today); flex: none; }
.hint { font-size: .82rem; color: var(--muted); }
.notes { display: grid; gap: 2px; }
.err { color: var(--danger); font-size: .88rem; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: grid; gap: 12px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--sunken); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; justify-self: start; }
.seg.wide { display: grid; grid-template-columns: repeat(4, 1fr); justify-self: stretch; }
.seg button, .seg label { border: 0; background: none; padding: 7px 10px; border-radius: 9px; font-size: .86rem; font-weight: 600; color: var(--muted); position: relative; cursor: pointer; text-align: center; white-space: nowrap; }
.seg button[aria-pressed="true"], .seg label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .14); }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.lang { width: auto; min-height: 36px; padding: 6px 8px; font-size: .88rem; border-radius: 9px; background: var(--surface); }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; background: var(--track); position: relative; flex: none; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .2s; }
.switch:checked { background: var(--today); }
.switch:checked::after { transform: translateX(18px); }
.switch-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.switch-row .grow { flex: 1; min-width: 0; }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.sub-box { background: var(--sunken); border-radius: 12px; padding: 12px; display: grid; gap: 10px; }

/* ---------- lock ---------- */
.lock { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: max(24px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.lock-card { width: 100%; max-width: 380px; display: grid; gap: 10px; }
.lock-top { display: flex; justify-content: space-between; align-items: center; }
.lock-card img { width: 64px; height: 64px; border-radius: 16px; }
.lock-card h1 { font-size: 1.7rem; margin-top: 6px; }
.lock-card .primary { margin-top: 6px; font-size: 1rem; }

/* ---------- shell ---------- */
.app { max-width: 560px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); display: grid; gap: 14px; }
.mast h1 { font-size: 1.3rem; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.mast h1 img { width: 28px; height: 28px; border-radius: 8px; }
.view { display: grid; gap: 14px; min-width: 0; }
.view.tight { gap: 10px; }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)); }
.tabbar-in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.tabbar button { border: 0; background: none; padding: 6px 2px; border-radius: 12px; display: grid; justify-items: center; gap: 2px; font-size: .72rem; font-weight: 600; color: var(--muted); min-height: 50px; min-width: 0; }
.tabbar button span { white-space: nowrap; }
.tabbar button svg { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--ink); }
.tabbar button[aria-current="page"] svg { color: var(--today); }
.banner { background: var(--sunken); border-radius: 14px; padding: 11px 14px; font-size: .9rem; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- live meter ---------- */
.live { display: grid; gap: 6px; padding: 2px 2px 0; }
.pill { justify-self: start; display: inline-flex; align-items: center; gap: 7px; font-size: .82rem; font-weight: 600; padding: 4px 11px; border-radius: 999px; background: var(--sunken); color: var(--muted); }
.pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.pill.on { color: var(--today); } .pill.ot { color: var(--month); } .pill.leave { color: var(--super); }
.pill.on .dot, .pill.ot .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.big { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; font-size: clamp(2.5rem, 12.5vw, 3.9rem); line-height: 1.05; letter-spacing: -.03em; overflow-wrap: anywhere; }
.big .cur { font-size: .45em; color: var(--muted); font-weight: 600; margin-right: .12em; vertical-align: .75em; letter-spacing: 0; }
.big .dec { color: var(--muted); }
.live-sub { display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--muted); font-size: .92rem; }
.live-sub b { color: var(--ink); font-weight: 600; font-family: var(--num); font-variant-numeric: tabular-nums; }
.clock { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.clock select { width: auto; max-width: 46%; }
.clock-btn { border: 0; border-radius: 999px; padding: 13px 22px; min-height: 50px; font-weight: 600; font-size: 1rem; background: var(--today); color: var(--on-accent); display: inline-flex; align-items: center; gap: 8px; }
.clock-btn.out { background: var(--month); }
.clock-btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- rings ---------- */
.rings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.ring { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 12px 6px 10px; display: grid; justify-items: center; gap: 2px; color: inherit; text-align: center; min-width: 0; }
.ring[aria-pressed="true"] { border-color: var(--c); box-shadow: 0 0 0 1px var(--c) inset; }
.ring-svg { position: relative; width: 100%; max-width: 116px; aspect-ratio: 1; }
.ring-svg svg { width: 100%; height: 100%; display: block; transform: rotate(-90deg); overflow: visible; }
.ring-svg circle { fill: none; stroke-width: 11; }
.ring-svg .track { stroke: var(--track); }
.ring-svg .arc { stroke: var(--c); stroke-linecap: round; transition: stroke-dashoffset .9s linear, opacity .3s; }
.ring-svg .lap { filter: brightness(.72) saturate(1.2); }
.ring.sweep .arc { transition: stroke-dashoffset 1.6s cubic-bezier(.22, .9, .25, 1), opacity .3s; }
@media (prefers-color-scheme: dark) { .ring-svg .arc { filter: drop-shadow(0 0 4px color-mix(in srgb, var(--c) 55%, transparent)); } }
.ring-mid { position: absolute; inset: 0; display: grid; place-content: center; }
.ring-pct { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; font-size: clamp(1.05rem, 5.4vw, 1.45rem); line-height: 1.1; }
.ring-pct small { font-size: .6em; color: var(--muted); font-weight: 600; }
.ring-val { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: clamp(.72rem, 3vw, .82rem); color: var(--muted); }
.ring-name { font-weight: 600; font-size: .86rem; margin-top: 4px; color: var(--c); max-width: 100%; text-wrap: balance; }
.ring-target { font-size: .72rem; color: var(--muted); max-width: 100%; text-wrap: balance; }

/* ---------- donut + key/value lists ---------- */
.detail-body { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 16px; align-items: center; }
@media (max-width: 420px) { .detail-body { grid-template-columns: 1fr; justify-items: center; } .detail-body dl { width: 100%; } }
.donut { position: relative; width: 140px; aspect-ratio: 1; max-width: 100%; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.donut circle { fill: none; stroke-width: 20; }
.donut .seg-arc { transition: stroke-dasharray 1.3s cubic-bezier(.22, .9, .25, 1), stroke-dashoffset 1.3s cubic-bezier(.22, .9, .25, 1); }
.donut-mid { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.donut-mid b { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 1rem; }
.donut-mid span { font-size: .72rem; color: var(--muted); max-width: 84px; line-height: 1.25; margin: 0 auto; }
dl.kv { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 12px; font-size: .92rem; }
dl.kv dt { color: var(--muted); display: flex; align-items: center; gap: 7px; min-width: 0; }
dl.kv dd { margin: 0; text-align: right; font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
dl.kv .strong { color: var(--ink); font-weight: 600; }
dl.kv .sub { font-size: .84rem; padding-left: 12px; font-weight: 500; }
.src-list { display: grid; gap: 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.src { display: flex; align-items: center; gap: 8px; font-size: .92rem; }
.src-name { flex: 1; min-width: 0; overflow-wrap: break-word; }
.src-v { font-weight: 600; }

/* ---------- leave ---------- */
.leave-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.leave-box { background: var(--sunken); border-radius: 14px; padding: 12px; display: grid; gap: 6px; min-width: 0; }
.leave-box .label { overflow-wrap: break-word; }
.leave-box .n { font-family: var(--num); font-variant-numeric: tabular-nums; font-size: 1.5rem; font-weight: 600; line-height: 1.1; }
.leave-box .n small { font-size: .5em; color: var(--muted); font-weight: 600; margin-left: 3px; }
.bar { height: 6px; border-radius: 3px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--super); transition: width 1.2s cubic-bezier(.22, .9, .25, 1); }
.month-leave { font-size: .9rem; color: var(--muted); }
.month-leave b { color: var(--ink); }

/* ---------- tax brackets ---------- */
.bracket { position: relative; padding-bottom: 26px; }
.bk-row { display: flex; height: 26px; border-radius: 8px; overflow: hidden; background: var(--track); }
.bk { background: var(--year); display: grid; place-items: center; min-width: 0; border-right: 1px solid var(--surface); }
.bk em { font-style: normal; font-size: .72rem; font-weight: 600; color: var(--ink); white-space: nowrap; }
.bk-you { position: absolute; top: -4px; transform: translateX(-50%); display: grid; justify-items: center; }
.bk-you i { width: 3px; height: 34px; background: var(--ink); border-radius: 2px; }
.bk-you b { font-size: .72rem; }

/* ---------- details cards ---------- */
details.card > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; min-height: 28px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: "+"; font-size: 1.3rem; color: var(--muted); line-height: 1; }
details.card[open] > summary::after { content: "−"; }
.table-scroll { overflow-x: auto; margin: 0 -4px; }
table { border-collapse: collapse; width: 100%; font-size: .88rem; }
th, td { padding: 8px 5px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
th { font-size: .72rem; color: var(--muted); font-weight: 600; letter-spacing: .03em; }
td.num { font-family: var(--num); font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom: 0; }

/* ---------- lists ---------- */
.list { display: grid; }
.item { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .t { min-width: 0; }
.item .t b { font-weight: 600; }
.item .sub { color: var(--muted); font-size: .84rem; overflow-wrap: anywhere; }
.item .v { font-family: var(--num); font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.item.live .v { color: var(--month); }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 1px 7px; border-radius: 999px; background: var(--sunken); color: var(--muted); margin-left: 6px; vertical-align: 1px; }
.tag.paid { color: var(--today); } .tag.unpaid { color: var(--danger); }
.empty { color: var(--muted); font-size: .92rem; padding: 4px 0; }
form.inline { display: grid; gap: 10px; }

/* ---------- side hustle ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.kpi { background: var(--sunken); border-radius: 14px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.kpi b { font-size: 1.2rem; overflow-wrap: anywhere; }

/* ---------- payslip ---------- */
.ps-nav { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; }
.ps-title { display: grid; text-align: center; }
.ps-title b { font-size: .98rem; }
.cmp { display: grid; gap: 8px; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, .9fr) minmax(0, .8fr); gap: 8px; align-items: center; font-size: .88rem; }
.cmp-head { font-size: .72rem; color: var(--muted); font-weight: 600; }
.cmp-row input { min-height: 40px; padding: 8px; }
.cmp-row .num { text-align: right; }
.cmp-d { text-align: right; font-weight: 600; font-family: var(--num); font-variant-numeric: tabular-nums; font-size: .82rem; }
.cmp-d.ok { color: var(--today); } .cmp-d.off { color: var(--month); }

/* ---------- settings ---------- */
fieldset { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; margin: 0; padding: 14px 16px 16px; display: grid; gap: 12px; min-width: 0; }
legend { font-weight: 600; padding: 0 6px; font-size: 1.02rem; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days label { position: relative; }
.days input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.days span { display: inline-block; min-width: 44px; text-align: center; padding: 9px 6px; border-radius: 10px; border: 1px solid var(--line); font-size: .86rem; font-weight: 600; }
.days input:checked + span { background: var(--today); color: var(--on-accent); border-color: var(--today); }
.days input:focus-visible + span { outline: 2px solid var(--today); outline-offset: 2px; }
.minrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; }
.minrow .check { padding-bottom: 12px; white-space: nowrap; }
.summary-line { background: var(--sunken); border-radius: 10px; padding: 9px 12px; font-size: .9rem; }
.summary-line b { font-family: var(--num); font-variant-numeric: tabular-nums; }
.rates-edit { display: grid; gap: 8px; }
.rate-row { display: grid; grid-template-columns: minmax(0, 1fr) 80px auto; gap: 8px; align-items: center; }
.file-btn { display: inline-flex; align-items: center; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.acct { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.foot { font-size: .78rem; color: var(--muted); display: grid; gap: 4px; padding: 4px 2px 0; }
.foot b { color: var(--ink); font-weight: 600; }

/* ================= UI pass 2 (2026-11-05) ================= */
.btn.ghost { background: transparent; }
.btn.icon { width: 40px; padding: 0; font-size: 1.3rem; line-height: 1; }
.grow { flex: 1; min-width: 0; }

/* header */
.mast { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 2px; }
.mast-l { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mast-l img { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.mast h1 { font-size: 1.15rem; line-height: 1.15; display: block; }
.mast-date { font-size: .8rem; color: var(--muted); }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); font-weight: 600; font-size: .95rem; flex: none; }

/* notices */
.notice { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; font-size: .88rem; line-height: 1.45; }
.notice-i { width: 26px; height: 26px; border-radius: 50%; background: var(--sunken); color: var(--muted); display: grid; place-items: center; font-weight: 600; font-size: .8rem; flex: none; }
.notice .grow { flex: 1 1 200px; }

/* hero */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 16px 18px 18px; display: grid; gap: 4px; position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: -40% -30% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--today) 18%, transparent), transparent 70%); pointer-events: none; }
.hero > * { position: relative; }
.hero-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.clock { display: grid; gap: 8px; margin-top: 12px; }
.clock-sel { display: flex; gap: 8px; }
.clock-sel select { flex: 1; width: auto; max-width: none; }
.clock-sel:not(:has(select:not([hidden]))) { display: none; }
.clock-btn { width: 100%; justify-content: center; }
.clock .hint { text-align: center; }

/* period segments: short labels never truncate */
.seg.wide button { white-space: nowrap; }

/* folded cards on Home */
details.fold > summary { gap: 10px; }
.fold-sum { margin-left: auto; color: var(--muted); font-size: .88rem; font-weight: 600; white-space: nowrap; }
details.fold > summary::after { margin-left: 8px; }

/* settings sections */
details.section { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; }
details.section > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "t c" "s c"; gap: 0 10px; padding: 14px 16px; min-height: 56px; align-items: center; }
details.section > summary::-webkit-details-marker { display: none; }
details.section > summary::after { content: ""; grid-area: c; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
details.section[open] > summary::after { transform: rotate(-135deg); }
.sec-t { grid-area: t; font-weight: 600; font-size: 1rem; }
.sec-s { grid-area: s; color: var(--muted); font-size: .84rem; overflow-wrap: break-word; }
details.section[open] .sec-s { display: none; }
.sec-body { display: grid; gap: 12px; padding: 0 16px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.editing { background: var(--sunken); border-radius: 14px; padding: 10px 12px; }

/* add forms folded under lists */
details.add > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; }
details.add > summary::-webkit-details-marker { display: none; }
details.add > summary::before { content: "+"; font-size: 1.1rem; line-height: 1; }
details.add[open] > summary { margin-bottom: 12px; }
details.add[open] > summary::before { content: "−"; }

/* payslip compare: label on its own line, then three columns */
.cmp-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .9fr); gap: 8px; font-size: .72rem; color: var(--muted); font-weight: 600; }
.cmp-head span:nth-child(n+2) { text-align: right; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .9fr); grid-template-areas: "l l l" "i o d"; gap: 4px 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.cmp-row label { grid-area: l; font-size: .86rem; font-weight: 600; }
.cmp-row input { grid-area: i; }
.cmp-row .num { grid-area: o; }
.cmp-row .cmp-d { grid-area: d; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 12px); opacity: 0; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; font-size: .9rem; font-weight: 600; z-index: 30; max-width: calc(100% - 32px); text-align: center; transition: opacity .2s, transform .2s; box-shadow: 0 6px 20px rgb(0 0 0 / .2); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* footer: short points, folded formulas, copyright */
.foot { gap: 12px; line-height: 1.6; line-break: strict; text-wrap: pretty; }
.foot ul { margin: 4px 0 0; padding-left: 1.1em; display: grid; gap: 4px; }
.foot-calc > summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.legal b { color: var(--ink); }
.copy { border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 2px; }
.copy b { color: var(--ink); }

/* ================= Touch targets: at least 44 × 44 px (full diagnosis 2026-11-05) ================= */
.btn.small { min-height: 44px; }
.btn.icon { width: 44px; height: 44px; }
.seg button, .seg label { min-height: 44px; min-width: 44px; display: inline-grid; place-items: center; }
.seg.wide button { display: grid; }
.check { min-height: 44px; align-items: center; }
.check input { margin-top: 0; }
.days span { padding: 12px 6px; min-width: 44px; }
details.fold > summary, .foot-calc > summary { min-height: 44px; display: flex; align-items: center; }
.cmp-row input { min-height: 44px; }

/* ================= Text contrast (WCAG AA 4.5:1; axe-core 2026-11-05) =================
   The bright tokens stay for rings, bars and dots. Text and filled buttons use the -ink shades:
   darker in light mode, the same bright colour in dark mode (where it already passes). */
:root { --today-ink: #0b7a4f; --month-ink: #8f5a00; --super-ink: #1d68a8; --year-ink: #5a45d6; --side-ink: #b4461a; }
@media (prefers-color-scheme: dark) {
  :root { --today-ink: #3ddc97; --month-ink: #ffb547; --super-ink: #5db2ff; --year-ink: #9d8dff; --side-ink: #ff8a57; }
}
.c-today, .tag.paid, .cmp-d.ok, .pill.on { color: var(--today-ink); }
.c-month, .c-ot, .cmp-d.off, .pill.ot { color: var(--month-ink); }
.c-super, .pill.leave { color: var(--super-ink); }
.ring-name { color: var(--ci, var(--c)); }
.days input:checked + span { background: var(--today-ink); border-color: var(--today-ink); }
.clock-btn { background: var(--today-ink); }
.clock-btn.out { background: var(--month-ink); }
.item.live .v { color: var(--month-ink); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
