/* Nanny Tracker - the E "Your mix" look (2026-10-04). Shared by every page; replaces family.css + app.css.
   Tokens: light on :root, dark under prefers-color-scheme (unless data-theme="light") and on [data-theme="dark"].
   One font: Geist for words AND numbers, always with tabular digits (his rule: no monospace for money/times/dates).
   Navy primary buttons (light ink in dark); teal only for status. No inline styles anywhere (CSP): classes, or
   el.style from JS. Page files (nanny.css, parent.css, today.css, pay.css, taxes.css, admin.css) add page rules.
   Mockups: Documents\nanny-design\canvas\project\E-*.dc.html. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/geist-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/geist-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
/* Geist SIL OFL 1.1: /static/fonts/OFL-Geist.txt */

:root {
  --bg: #f4f5f7; --surface: #ffffff; --surface2: #fafbfc; --side: #fbfbfc; --tile: #ffffff; --nav: #ffffff;
  --ink: #0d1321; --ink2: #4a5568; --muted: #5f6b7d; --line: #e4e7ec; --line2: #cfd4dc; --track: #eef0f4; --chip: #eef0f4;
  --goal: rgba(13, 19, 33, .30);
  --teal: #0f766e; --bar: #0d9488; --hatch: #c3ede7; --teal-soft: #e6f7f5; --teal-ring: rgba(13, 148, 136, .18);
  --teal-line: #2fb5a5; --teal-strip: #eaf8f6; --today-col: #f0faf8;
  --amber: #a84b08; --amber-fill: #f59e0b; --amber-soft: #fef6e4; --amber-line: #efb24a; --amber-strip: #fef6e4;
  --violet: #6d28d9; --violet-fill: #7c3aed; --violet-soft: #f3effe; --violet-line: #b49cf6; --violet-strip: #f5f1fe;
  --red: #c62828; --red-fill: #d64545; --red-soft: #fdecec;
  --bw: 1.5px;
  --glow-teal: 0 1px 2px rgba(13, 19, 33, .05); --glow-amber: 0 1px 2px rgba(13, 19, 33, .05); --glow-violet: 0 1px 2px rgba(13, 19, 33, .05);
  --card-shadow: 0 1px 2px rgba(13, 19, 33, .04); --pop-shadow: 0 16px 40px -12px rgba(13, 19, 33, .28);
  --cta: #0d1321; --on-cta: #ffffff; --cta-shadow: 0 10px 22px -12px rgba(13, 19, 33, .55);
  --logo: #0d9488; --on-logo: #ffffff; --scrim: rgba(13, 19, 33, .5);
  /* the one dark hero card (desk Payroll's Next payday, the nanny's Next payday): dark in both themes */
  --night: #0b1120; --night-line: #1c2537; --night-ink: #e2e8f0; --night-muted: #94a3b8; --night-accent: #2dd4bf;
  --font: "Geist", system-ui, "Segoe UI", sans-serif;
  /* legacy names still used by older page code; they point at E tokens */
  --plane: var(--bg); --hair: var(--line); --grid: var(--line); --axis: var(--line2); --wash: var(--chip);
  --ink-2: var(--ink2); --good: var(--teal); --bad: var(--red); --s1: var(--violet); --s2: var(--amber-fill); --s4: var(--amber-fill);
  --note: var(--amber-soft); --note-edge: var(--amber-line); --brand: var(--teal); --chip-ink: var(--on-cta);
  --sans: var(--font); --display: var(--font);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b12; --surface: #0e1524; --surface2: #0b1120; --side: #0a101c; --tile: #0a1120; --nav: #0a101c;
    --ink: #e6eaf2; --ink2: #a3adbf; --muted: #8b95a8; --line: #1c2537; --line2: #2b3650; --track: #162033; --chip: #18213a;
    --goal: rgba(230, 234, 242, .34);
    --teal: #2dd4bf; --bar: #2dd4bf; --hatch: #0f4a44; --teal-soft: #0b2a2a; --teal-ring: rgba(45, 212, 191, .22);
    --teal-line: rgba(45, 212, 191, .62); --teal-strip: rgba(45, 212, 191, .07); --today-col: rgba(45, 212, 191, .07);
    --amber: #fbbf24; --amber-fill: #fbbf24; --amber-soft: #2a210b; --amber-line: rgba(251, 191, 36, .58); --amber-strip: rgba(251, 191, 36, .07);
    --violet: #a78bfa; --violet-fill: #a78bfa; --violet-soft: #1d1736; --violet-line: rgba(167, 139, 250, .62); --violet-strip: rgba(167, 139, 250, .08);
    --red: #f87171; --red-fill: #f87171; --red-soft: #2a1215;
    --bw: 1px;
    --glow-teal: 0 0 40px -8px rgba(45, 212, 191, .38); --glow-amber: 0 0 40px -8px rgba(251, 191, 36, .30); --glow-violet: 0 0 40px -8px rgba(167, 139, 250, .36);
    --card-shadow: none; --pop-shadow: 0 18px 44px -10px rgba(0, 0, 0, .7);
    --cta: #e6eaf2; --on-cta: #070b12; --cta-shadow: 0 12px 28px -14px rgba(230, 234, 242, .30);
    --logo: #14b8a6; --on-logo: #ffffff; --scrim: rgba(2, 5, 10, .66);
    --night: #0b1120; --night-line: #22304a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070b12; --surface: #0e1524; --surface2: #0b1120; --side: #0a101c; --tile: #0a1120; --nav: #0a101c;
  --ink: #e6eaf2; --ink2: #a3adbf; --muted: #8b95a8; --line: #1c2537; --line2: #2b3650; --track: #162033; --chip: #18213a;
  --goal: rgba(230, 234, 242, .34);
  --teal: #2dd4bf; --bar: #2dd4bf; --hatch: #0f4a44; --teal-soft: #0b2a2a; --teal-ring: rgba(45, 212, 191, .22);
  --teal-line: rgba(45, 212, 191, .62); --teal-strip: rgba(45, 212, 191, .07); --today-col: rgba(45, 212, 191, .07);
  --amber: #fbbf24; --amber-fill: #fbbf24; --amber-soft: #2a210b; --amber-line: rgba(251, 191, 36, .58); --amber-strip: rgba(251, 191, 36, .07);
  --violet: #a78bfa; --violet-fill: #a78bfa; --violet-soft: #1d1736; --violet-line: rgba(167, 139, 250, .62); --violet-strip: rgba(167, 139, 250, .08);
  --red: #f87171; --red-fill: #f87171; --red-soft: #2a1215;
  --bw: 1px;
  --glow-teal: 0 0 40px -8px rgba(45, 212, 191, .38); --glow-amber: 0 0 40px -8px rgba(251, 191, 36, .30); --glow-violet: 0 0 40px -8px rgba(167, 139, 250, .36);
  --card-shadow: none; --pop-shadow: 0 18px 44px -10px rgba(0, 0, 0, .7);
  --cta: #e6eaf2; --on-cta: #070b12; --cta-shadow: 0 12px 28px -14px rgba(230, 234, 242, .30);
  --logo: #14b8a6; --on-logo: #ffffff; --scrim: rgba(2, 5, 10, .66);
  --night: #0b1120; --night-line: #22304a;
  color-scheme: dark;
}

/* ---------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.45;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
body { min-height: 100vh; min-height: 100dvh; -webkit-tap-highlight-color: transparent; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; font-family: var(--font); color: var(--ink); text-wrap: balance; }
h1 { font-size: 30px; line-height: 36px; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 16px; line-height: 22px; font-weight: 800; letter-spacing: -.01em; }
h3 { font-size: 11px; line-height: 16px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
::selection { background: var(--teal-ring); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line2); border-radius: 8px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-corner { background: transparent; }
.boot-text { padding: 56px 16px; text-align: center; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- app shell
   Desktop (>= 900px, parents): a 232px sidebar (brand, nav, a slot for the live clock card, account menu) + main.
   Phone (< 900px, and always for the nanny): a slim top bar (brand + account menu) + a bottom tab bar. */
/* align-content: start keeps the rows their natural height; without it a short page stretched the top bar's row
   and its brand sat halfway down the phone screen. */
.app { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.side { display: none; }
.content { display: grid; gap: 16px; min-width: 0; align-content: start; outline: none; width: 100%; margin: 0 auto;
  padding: 12px calc(env(safe-area-inset-right, 0px) + 20px) calc(env(safe-area-inset-bottom, 0px) + 96px) calc(env(safe-area-inset-left, 0px) + 20px); }
.page { display: grid; gap: 16px; min-width: 0; outline: none; align-content: start; }

.brand-tile { width: 36px; height: 36px; border-radius: 10px; background: var(--logo); color: var(--on-logo); display: grid; place-items: center; flex: none; }
.brand-tile svg { width: 20px; height: 20px; }
.brand-text { display: grid; gap: 1px; min-width: 0; }
.brand-name { font-size: 15px; line-height: 20px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-sub { font-size: 12px; line-height: 16px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; text-decoration: none; }

.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) calc(env(safe-area-inset-right, 0px) + 20px) 10px calc(env(safe-area-inset-left, 0px) + 20px);
  background: var(--bg); border-bottom: 1px solid transparent; }
.topbar.is-stuck { border-bottom-color: var(--line); }
.topbar .brand-tile { width: 32px; height: 32px; border-radius: 9px; }
.topbar .brand-tile svg { width: 18px; height: 18px; }
.tools { position: relative; display: flex; align-items: center; gap: 8px; flex: none; }

.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: var(--nav); border-top: 1px solid var(--line);
  padding: 6px calc(env(safe-area-inset-right, 0px) + 12px) calc(env(safe-area-inset-bottom, 0px) + 10px) calc(env(safe-area-inset-left, 0px) + 12px); }
.tabbar-in { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); max-width: 560px; margin: 0 auto; }
.tab-item { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); text-decoration: none; font-size: 11.5px; line-height: 14px; font-weight: 600; border-radius: 12px; touch-action: manipulation; }
.tab-ico { width: 56px; height: 28px; border-radius: 999px; display: grid; place-items: center; transition: background .15s ease; }
.tab-ico svg { width: 20px; height: 20px; }
.tab-item.is-current { color: var(--teal); font-weight: 800; }
.tab-item.is-current .tab-ico { background: var(--teal-soft); }

.side-nav { display: grid; gap: 2px; }
.side-item { height: 40px; display: flex; align-items: center; gap: 12px; padding: 0 12px; border-radius: 10px; color: var(--ink2);
  text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.side-item svg { width: 18px; height: 18px; flex: none; }
.side-item:hover { background: var(--chip); color: var(--ink); }
.side-item.is-current { background: var(--teal-soft); color: var(--teal); font-weight: 800; }
.side-item .count { margin-left: auto; min-width: 24px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--chip); color: var(--muted); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.side-slot:empty { display: none; }
.side-foot { display: flex; align-items: center; gap: 8px; padding: 12px 4px 0 8px; border-top: 1px solid var(--line); }
.side-foot .who { flex: 1; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The sidebar's account menu opens upward and spans the whole foot (anchored to .side-foot, not the ⋮ button):
   right-aligned to the button at 232px it ran off the left edge of the window. */
.side-foot { position: relative; }
.side-foot .menu-wrap.tools { position: static; }
.side-foot .menu { top: auto; bottom: calc(100% + 6px); left: 0; right: 0; min-width: 0; }

@media (min-width: 900px) {
  .app:not(.narrow) { grid-template-columns: 232px minmax(0, 1fr); }
  .app:not(.narrow) .side { display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; height: 100dvh;
    overflow-y: auto; background: var(--side); border-right: 1px solid var(--line); padding: 24px 16px 18px; }
  .app:not(.narrow) .side .brand { padding: 0 8px; }
  .app:not(.narrow) .side-slot { margin-top: auto; }
  .app:not(.narrow) .side-slot:empty + .side-foot { margin-top: auto; }
  .app:not(.narrow) .topbar, .app:not(.narrow) .tabbar { display: none; }
  .app:not(.narrow) .content { max-width: 1240px; margin: 0; padding: 32px 40px 56px; gap: 24px; }
  .app:not(.narrow) .page { gap: 24px; }
}
.app.narrow .content { max-width: 560px; }
.app.narrow .topbar-in, .app.narrow .topbar > * { max-width: 560px; }

/* ---------------------------------------------------------------- page header */
.section-head, .page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px 16px; }
.section-title, .page-title { display: grid; gap: 6px; min-width: 0; }
.title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; min-width: 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; color: var(--muted); font-size: 14px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.section { display: grid; gap: 12px; }
.sub { color: var(--ink2); font-size: 14px; max-width: 70ch; }
.small { font-size: 12.5px; color: var(--muted); }
.r { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 899px) {
  h1 { font-size: 22px; line-height: 28px; }
  .section-head, .page-head { align-items: center; }
}

/* ---------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--card-shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.card-head h2 { min-width: 0; }
.card-label { font-size: 11px; line-height: 16px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card.tint-teal { background: var(--teal-strip); border-color: var(--teal-line); }
.card.tint-amber { background: var(--amber-strip); border-color: var(--amber-line); }
.card.tint-violet { background: var(--violet-strip); border-color: var(--violet-line); }
.card.night { background: var(--night); border-color: var(--night-line); color: var(--night-ink); box-shadow: var(--cta-shadow); }
.card.night h2, .card.night h3 { color: var(--night-ink); }
@media (max-width: 899px) { .card { padding: 16px; border-radius: 16px; } }

/* ---------------------------------------------------------------- buttons */
.ctl { height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line2); background: var(--surface); color: var(--ink);
  font: 700 14px/1 var(--font); display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  cursor: pointer; text-decoration: none; touch-action: manipulation; }
.ctl:hover { background: var(--chip); }
.ctl.primary { background: var(--cta); color: var(--on-cta); border-color: var(--cta); box-shadow: var(--cta-shadow); }
.ctl.primary:hover { background: var(--cta); opacity: .9; }
.ctl.danger { background: var(--red-fill); border-color: var(--red-fill); color: #ffffff; }
.ctl.danger:hover { background: var(--red-fill); opacity: .9; }
.ctl.ghost { background: transparent; }
.ctl.sm { height: 32px; padding: 0 10px; font-size: 13px; border-radius: 9px; }
.ctl.big { width: 100%; min-height: 54px; height: auto; font-size: 16px; border-radius: 14px; }
.ctl svg, .ctl svg.icon { width: 16px; height: 16px; flex: none; }
.ctl:disabled, .toggle:disabled, .link:disabled, .icon-btn:disabled { opacity: .5; cursor: default; box-shadow: none; }
.ctl[aria-busy="true"], .toggle[aria-busy="true"] { opacity: .7; cursor: progress; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink2); cursor: pointer; flex: none; position: relative; touch-action: manipulation; }
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--ink); background: var(--chip); }
.icon-btn.bare { border-color: transparent; background: transparent; }
.icon-btn.bare:hover, .icon-btn.bare[aria-expanded="true"] { background: var(--chip); }
.icon-btn svg { width: 18px; height: 18px; }
svg.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.link { font: 700 13.5px/1.3 var(--font); color: var(--teal); text-decoration: none; border: 0; background: none; padding: 0; cursor: pointer; white-space: nowrap; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--red); }
@media (pointer: coarse) {
  .ctl { min-height: 44px; }
  .ctl.sm { min-height: 36px; }
  .icon-btn { width: 44px; height: 44px; border-radius: 12px; }
  .menu-item { min-height: 44px; }
  .link { min-height: 36px; display: inline-flex; align-items: center; }
}

/* ---------------------------------------------------------------- menu (account ⋮, card ⋮) */
.menu-wrap { position: relative; display: inline-flex; flex: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 232px; max-width: calc(100vw - 24px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--pop-shadow); padding: 6px; display: grid; gap: 1px; }
.menu-heading { font-size: 11px; line-height: 1; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 6px; }
.menu-item { display: flex; align-items: center; gap: 10px; min-height: 38px; font: 600 14px/1.2 var(--font); text-align: left; padding: 8px 10px;
  border: 0; border-radius: 9px; background: none; color: var(--ink); cursor: pointer; width: 100%; touch-action: manipulation; }
.menu-item svg { width: 16px; height: 16px; flex: none; color: var(--ink2); }
.menu-item:hover, .menu-item:focus-visible { background: var(--chip); }
.menu-item:focus-visible { outline-offset: -2px; }
.menu-item.danger, .menu-item.danger svg { color: var(--red); }
.menu-item:disabled { opacity: .5; cursor: default; }
.menu-item[aria-checked="true"], .menu-item.is-checked { font-weight: 800; color: var(--teal); }
.menu-item[aria-checked="true"] svg, .menu-item.is-checked svg { color: var(--teal); }
.menu-check { width: 16px; height: 16px; flex: none; visibility: hidden; margin-left: auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu-item[aria-checked="true"] .menu-check, .menu-item.is-checked .menu-check { visibility: visible; }
.menu-sep { height: 1px; background: var(--line); margin: 5px 4px; }
.menu-foot { font-size: 12px; color: var(--muted); padding: 6px 10px 4px; }
.menu-state { margin-left: auto; padding-left: 16px; font-size: 12.5px; font-weight: 600; color: var(--muted); }

/* ---------------------------------------------------------------- segmented control, chips, switch */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--chip); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { font: 700 13px/1 var(--font); color: var(--ink2); background: transparent; border: 0; border-radius: 8px; min-height: 32px; padding: 0 12px;
  cursor: pointer; display: inline-flex; gap: 6px; align-items: center; justify-content: center; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(13, 19, 33, .12); }
.seg.full { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); width: 100%; }
.seg .n { font-weight: 600; opacity: .7; }
.chip { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line2); background: var(--surface);
  color: var(--ink2); font: 700 12px/1 var(--font); cursor: pointer; white-space: nowrap; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--cta); border-color: var(--cta); color: var(--on-cta); }
.toggle { display: inline-flex; align-items: center; gap: 10px; font: 600 14px/1.2 var(--font); color: var(--ink); background: var(--surface);
  border: 1px solid var(--line2); border-radius: 10px; min-height: 40px; padding: 0 12px; cursor: pointer; text-align: left; }
.toggle:hover { background: var(--chip); }
.toggle.bare { background: none; border-color: transparent; min-height: 44px; padding: 0 6px; }
.sw { position: relative; flex: none; width: 36px; height: 22px; border-radius: 999px; background: var(--line2); transition: background .15s ease; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s ease; }
.toggle[aria-pressed="true"] .sw, [aria-pressed="true"] > .sw, [aria-checked="true"] > .sw { background: var(--bar); }
.toggle[aria-pressed="true"] .sw::after, [aria-pressed="true"] > .sw::after, [aria-checked="true"] > .sw::after { transform: translateX(14px); }

/* ---------------------------------------------------------------- notes, pills, tags, dots */
.note { background: var(--amber-soft); border: 1px solid var(--amber-line); border-radius: 14px; padding: 12px 16px; display: grid; gap: 4px; font-size: 14px; color: var(--ink); }
.note.teal { background: var(--teal-soft); border-color: var(--teal-line); }
.pill { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font: 700 12px/1 var(--font); white-space: nowrap; overflow: hidden; max-width: 100%; background: var(--chip); color: var(--ink2); }
.pill i { position: relative; width: 7px; height: 7px; border-radius: 50%; flex: none; background: currentColor; }
.pill .bar { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, currentColor 18%, transparent); }
.pill span { position: relative; }
.pill > span:last-child { overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.t-good { background: var(--teal-soft); color: var(--teal); }
.t-live { background: var(--teal-soft); color: var(--teal); }
.t-work { background: var(--amber-soft); color: var(--amber); }
.t-bad { background: var(--red-soft); color: var(--red); }
.t-wait { background: var(--chip); color: var(--ink2); }
.t-ink { background: var(--violet-soft); color: var(--violet); }
.t-faint { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line2); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--tone, var(--muted)); flex: none; }
.dot.t-good, .dot.t-live { --tone: var(--bar); background: var(--bar); }
.dot.t-work { background: var(--amber-fill); }
.dot.t-bad { background: var(--red-fill); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--bar); box-shadow: 0 0 0 4px var(--teal-ring); flex: none; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; background: var(--chip); font: 700 11.5px/1 var(--font); color: var(--ink2); white-space: nowrap; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.k1 { background: var(--violet-fill); }
.k2 { background: var(--amber-fill); }
.k0 { background: var(--muted); }

/* ---------------------------------------------------------------- KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 6px; }
.kpi .lbl { font-size: 12.5px; font-weight: 600; color: var(--ink2); }
.kpi .val { font-size: 22px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: var(--ink); }
.kpi .val.bad { color: var(--red); }
.kpi .row { display: grid; grid-template-columns: 12px 1fr auto; align-items: baseline; gap: 8px; font-size: 14px; color: var(--ink2); }

/* ---------------------------------------------------------------- form fields */
.field { display: grid; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink2); min-width: 0; }
.input { font: 600 15px/1.3 var(--font); color: var(--ink); background: var(--surface2); border: 1px solid var(--line2); border-radius: 10px;
  min-height: 44px; padding: 10px 14px; width: 100%; outline: none; }
.input:hover { border-color: var(--muted); }
.input:focus { border-color: var(--teal-line); box-shadow: 0 0 0 3px var(--teal-ring); }
.input::placeholder { color: var(--muted); font-weight: 500; }
.input:disabled { opacity: .6; }
.input.num { width: 96px; text-align: right; }
textarea.input { resize: vertical; line-height: 1.45; }
.select { position: relative; display: block; }
.select select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; }
.select::after { content: ""; box-sizing: content-box; position: absolute; right: 16px; top: 50%; width: 6px; height: 6px; border-right: 2px solid var(--ink2);
  border-bottom: 2px solid var(--ink2); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.select option { background: var(--surface); color: var(--ink); }
.hint { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.field-error { font-size: 13px; font-weight: 600; color: var(--red); }
.field .req { color: var(--red); }
.field .input[aria-invalid="true"] { border-color: var(--red); }
.field-check .check-row, .check-row { display: flex; align-items: center; gap: 12px; min-height: 44px; font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.check { width: 20px; height: 20px; flex: none; accent-color: var(--cta); margin: 0; }
@media (max-width: 760px) { .input, textarea.input, .select select { font-size: 16px; } }

/* ---------------------------------------------------------------- banner, notice */
.banner { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--amber-line); background: var(--amber-soft); border-radius: 14px; padding: 12px 16px; font-size: 14px; }
.banner .dot { margin-top: 7px; background: var(--amber-fill); }
.banner.error { border-color: var(--red); background: var(--red-soft); }
.banner.error .dot { background: var(--red-fill); }
.banner > :last-child { min-width: 0; overflow-wrap: anywhere; }
.notice { display: grid; gap: 10px; justify-items: start; }
.notice .ctl.big { justify-self: stretch; }
.boot-wrap { max-width: 560px; margin: 0 auto; padding: 48px 20px; }

/* ---------------------------------------------------------------- dialogs (formDialog, confirmBox) */
dialog.dlg { border: 1px solid var(--line); padding: 0; margin: auto; width: min(480px, calc(100% - 24px)); max-width: none;
  max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 18px; background: var(--surface); color: var(--ink);
  box-shadow: var(--pop-shadow); overflow: hidden; }
dialog.dlg[open] { display: flex; flex-direction: column; animation: dlg-in .16s ease-out; }
dialog.dlg::backdrop { background: var(--scrim); }
.dlg-form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; width: 100%; }
.dlg-head { padding: 20px 22px 4px; }
.dlg-head h2 { font-size: 19px; line-height: 26px; overflow-wrap: anywhere; }
.dlg-body { padding: 8px 22px 12px; overflow-y: auto; display: grid; gap: 14px; font-size: 14.5px; color: var(--ink2); min-height: 0; align-content: start; }
.dlg-body p { color: var(--ink2); }
.dlg-body strong { color: var(--ink); }
.dlg-lead { font-size: 14px; }
.dlg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 10px 22px calc(env(safe-area-inset-bottom, 0px) + 20px); }
.dlg-actions .ctl.big { min-height: 48px; font-size: 15px; border-radius: 12px; }
.dlg-error { padding: 0; }
@media (max-width: 600px) {
  dialog.dlg { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 22px 22px 0 0; border-width: 1px 0 0;
    max-height: calc(100vh - 12px); max-height: calc(100dvh - 12px); }
  dialog.dlg[open] { animation-name: dlg-up; }
  dialog.dlg .dlg-head::before { content: ""; display: block; width: 40px; height: 5px; border-radius: 999px; background: var(--line2); margin: -8px auto 14px; }
}
@keyframes dlg-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes dlg-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- sheet (Customize): right panel on desk, bottom sheet on phone */
.sheet-back { position: fixed; inset: 0; z-index: 70; background: var(--scrim); animation: fade-in .16s ease-out; }
.sheet { position: fixed; z-index: 71; background: var(--surface); color: var(--ink); display: flex; flex-direction: column; box-shadow: var(--pop-shadow);
  top: 0; right: 0; bottom: 0; width: min(380px, 100vw); border-left: 1px solid var(--line); animation: sheet-in .18s ease-out; }
.sheet-head { display: grid; gap: 12px; padding: 22px 22px 14px; border-bottom: 1px solid var(--line); }
.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 14px; }
.sheet-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 22px calc(env(safe-area-inset-bottom, 0px) + 18px); border-top: 1px solid var(--line); }
.sheet-grab { display: none; }
@media (max-width: 899px) {
  .sheet { top: auto; left: 0; width: 100%; height: min(64vh, 640px); height: min(64dvh, 640px); border-left: 0; border-top: 1px solid var(--line); border-radius: 22px 22px 0 0; animation-name: dlg-up; }
  .sheet-grab { display: block; width: 40px; height: 5px; border-radius: 999px; background: var(--line2); margin: 10px auto 0; }
  .sheet-head { padding: 12px 20px 12px; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes sheet-in { from { transform: translateX(24px); opacity: .6; } to { transform: none; opacity: 1; } }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom, 0px) + 92px); transform: translateX(-50%); z-index: 80; display: grid; gap: 8px;
  justify-items: center; width: min(520px, calc(100vw - 32px)); pointer-events: none; }
@media (min-width: 900px) { .has-side .toasts { bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); } }
.toast { pointer-events: auto; display: flex; align-items: flex-start; gap: 10px; background: var(--cta); color: var(--on-cta); border: 0; border-radius: 12px;
  box-shadow: var(--pop-shadow); padding: 12px 16px; font-size: 14px; font-weight: 600; max-width: 100%; overflow-wrap: anywhere; }
.toast .dot { margin-top: 6px; background: var(--on-cta); opacity: .55; }
.toast.t-good .dot { background: var(--bar); opacity: 1; }
.toast.t-work .dot { background: var(--amber-fill); opacity: 1; }
.toast.t-bad .dot { background: var(--red-fill); opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .sw, .sw::after, .tab-ico { transition: none; }
  dialog.dlg[open], .sheet, .sheet-back { animation: none; }
}
