/* VOICE: an owner's console — calm, exact, warm. It answers "does anything need me?" in one glance, then gets out of the way.
   IDEA: the sun clock. Sunstead runs on clocks (hourly pass, 7/7 sweeps, quiet hours, SLA promises), so Today behaves like a day dial.
   PICTURE: a 24-hour dial, noon at the top: quiet hours as a night band, both sweeps marked, the day's events as dots, the sun at now.
   COLOUR and TYPE: Sunstead cream #FAF3E3, forest ink #16302B, Gulf teal for action only; red/orange/yellow/blue mean severity and nothing else. Inter Display 800 + Inter, tabular figures, self-hosted.
   LAYOUT: phone-first single column with a bottom bar; from 960px a left rail and two columns. */

@font-face { font-family: Inter; src: url(fonts/Inter-Regular.woff) format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/Inter-Medium.woff) format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(fonts/Inter-SemiBold.woff) format('woff'); font-weight: 600 700; font-display: swap; }
@font-face { font-family: 'Inter Display'; src: url(fonts/InterDisplay-ExtraBold.woff) format('woff'); font-weight: 800; font-display: swap; }

:root {
  color-scheme: light;
  --bg: #FAF3E3; --surface: #FFFCF5; --surface-2: #F2E8D0; --ink: #16302B; --ink-2: #4D605A;
  --line: #E3D6B8; --line-2: #B5A47A; --accent: #0E7C7A; --on-accent: #FFFFFF;
  --sun: #E39B2E; --night: #4A3823; --day: #EDE1C2;
  --red: #C0392B; --orange: #B5570A; --on-orange: #FFFFFF; --yellow: #B08900; --blue: #2D68A8; --green: #2E7D4F; --amber: #B7790A;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1); --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --r-s: 8px; --r-m: 14px; --r-l: 20px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme=light]) {
    color-scheme: dark;
    --bg: #20180F; --surface: #2B2113; --surface-2: #3A2C19; --ink: #F3EAD6; --ink-2: #BFAE8F;
    --line: #47371F; --line-2: #6E5836; --accent: #45C4BE; --on-accent: #0B1715;
    --sun: #F0B04A; --night: #17100A; --day: #38301E;
    --red: #FF7B6B; --orange: #FFA551; --on-orange: #1A1000; --yellow: #F2CB4C; --blue: #82B4EA; --green: #6FD39A; --amber: #F4B740;
  }
}
:root[data-theme=dark] {
  color-scheme: dark;
  --bg: #20180F; --surface: #2B2113; --surface-2: #3A2C19; --ink: #F3EAD6; --ink-2: #BFAE8F;
  --line: #47371F; --line-2: #6E5836; --accent: #45C4BE; --on-accent: #0B1715;
  --sun: #F0B04A; --night: #17100A; --day: #38301E;
  --red: #FF7B6B; --orange: #FFA551; --on-orange: #1A1000; --yellow: #F2CB4C; --blue: #82B4EA; --green: #6FD39A; --amber: #F4B740;
}

* { box-sizing: border-box; min-width: 0; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; scroll-padding-bottom: 92px; scrollbar-color: var(--line-2) transparent; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }
a, button, summary, select, input { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
input { caret-color: var(--accent); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.5 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; overflow-x: clip; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
#h1:focus-visible, main:focus-visible, .xstatus:focus-visible { outline: none; }
button { font: inherit; color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico-s { width: 14px; height: 14px; }

.skip { position: fixed; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: var(--r-s); }
.skip:focus { top: calc(env(safe-area-inset-top) + 10px); }

/* ---------- shell ---------- */
.top {
  position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0 12px;
  padding: calc(env(safe-area-inset-top) + 8px) max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 90%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 800 17px/1 'Inter Display', Inter, sans-serif; letter-spacing: -0.01em; min-height: 44px; }
.mark { width: 28px; height: 28px; flex: none; }
.mark-bg { fill: var(--ink); } .mark-sun { fill: var(--sun); } .mark-line { stroke: var(--bg); stroke-width: 2; stroke-linecap: round; }
.asof { grid-column: 1 / -1; grid-row: 2; margin: 2px 0 0; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pause {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px 0 12px; border-radius: 999px;
  border: 1.5px solid var(--ink); background: var(--surface); font-weight: 600; font-size: 14px; cursor: pointer;
  transition: transform 160ms var(--ease-out);
}
.pause:active { transform: scale(0.97); }
.pause-state { display: none; font-weight: 500; font-size: 13px; color: var(--ink-2); padding-left: 8px; border-left: 1px solid var(--line-2); }
.nav > .rail-brand { display: none; }
.brand span { white-space: nowrap; }

main { display: block; max-width: 1180px; margin: 0 auto; padding: 20px max(16px, env(safe-area-inset-right)) calc(100px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); outline: none; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--surface); border-top: 1px solid var(--line); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.nav > a, .nav > button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 56px; font-size: 13px; font-weight: 500; text-decoration: none; color: var(--ink-2);
  background: none; border: 0; cursor: pointer; transition: color 160ms ease;
}
.nav > a.extra { display: none; }
.nav > a[aria-current=page], .nav > button.on { color: var(--ink); }
.nav > a[aria-current=page]::before, .nav > button.on::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--accent); }
.badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px; background: var(--orange); color: var(--on-orange); font: 600 12px/20px Inter, sans-serif; text-align: center; }

/* ---------- type ---------- */
.head { margin: 4px 0 24px; }
h1 { font: 800 clamp(30px, 7vw, 44px)/1.06 'Inter Display', Inter, sans-serif; letter-spacing: -0.022em; margin: 0; text-wrap: balance; outline: none; }
.sub { margin: 12px 0 0; color: var(--ink-2); max-width: 62ch; text-wrap: pretty; }
h2 { font: 600 19px/1.3 Inter, sans-serif; margin: 0 0 12px; letter-spacing: -0.005em; }
h3 { font: 600 17px/1.35 Inter, sans-serif; margin: 8px 0; }
.meta { color: var(--ink-2); font-size: 13px; }
.fine { color: var(--ink-2); font-size: 13px; margin: 12px 0 0; max-width: 70ch; }
.k { color: var(--ink-2); }
.ref { font-weight: 600; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.none { color: var(--ink-2); }
.loading, .empty { color: var(--ink-2); padding: 12px 0; }
.sec { margin: 28px 0 0; }
.more-link { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.back { display: inline-flex; align-items: center; min-height: 44px; margin: -8px 0 4px; font-weight: 500; color: var(--ink-2); text-decoration: none; }

/* ---------- atoms ---------- */
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); flex: none; }
.sev-red, .st-red { background: var(--red); } .sev-orange { background: var(--orange); } .sev-yellow { background: var(--yellow); } .sev-blue { background: var(--blue); }
.sev-none { background: transparent; box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.st-green { background: var(--green); } .st-amber { background: var(--amber); }
.ev-you { background: var(--orange); } .ev-money { background: var(--green); } .ev-routine { background: var(--ink-2); opacity: .7; } .ev-sun { background: var(--sun); }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 28px; padding: 2px 12px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.chip.tier-now { background: color-mix(in srgb, var(--red) 16%, var(--surface)); }
.chip.st-stalled, .chip.st-prospect { background: color-mix(in srgb, var(--amber) 20%, var(--surface)); }
.chip.st-offboarding { background: color-mix(in srgb, var(--ink-2) 18%, var(--surface)); }
.chip.st-onboarding { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.chip.st-active { background: color-mix(in srgb, var(--green) 14%, var(--surface)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform 160ms var(--ease-out), background-color 160ms ease, border-color 160ms ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.wide { width: 100%; margin-top: 16px; }
@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover { border-color: var(--ink); }
  .btn.primary:not(:disabled):hover { filter: brightness(1.06); }
}
.confirm-mark { opacity: .8; }

/* ---------- rows ---------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.row .dot { align-self: center; }
.sys-n { font-weight: 600; min-width: 7.5em; }
.sys-d { color: var(--ink-2); flex: 1 1 14em; }
.row.decided > span:nth-child(2) { flex: 1 1 18em; }
.ev { display: grid; grid-template-columns: 4.6em minmax(0, 1fr); gap: 2px 12px; align-items: baseline; }
.ev-t { color: var(--ink-2); font-size: 13px; }
.ev-k { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13px; }
.ev-s { grid-column: 2; }
.ev-a { grid-column: 2; }

/* ---------- today ---------- */
.quiet { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.today-grid { display: grid; gap: 8px 40px; }
.dialbox { margin: 0; }
.dial { position: relative; width: min(100%, 380px); aspect-ratio: 1; margin: 0 auto; }
.dial-svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.dial-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.big { font: 800 clamp(56px, 18vw, 76px)/0.95 'Inter Display', Inter, sans-serif; letter-spacing: -0.03em; }
.dial-l { font-weight: 600; font-size: 15px; margin-top: 4px; }
.dial-s { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.d-band { fill: none; stroke: var(--day); stroke-width: 18; }
.d-night { fill: none; stroke: var(--night); stroke-width: 18; }
.d-tick { stroke: var(--bg); stroke-width: 1.5; }
.d-major { stroke: var(--ink-2); stroke-width: 1.5; }
.d-sweep { stroke: var(--accent); stroke-width: 3.5; stroke-linecap: round; }
.d-lab { fill: var(--ink-2); font: 500 12px Inter, sans-serif; }
.d-track { fill: none; stroke: var(--line-2); stroke-width: 1; stroke-dasharray: 1.5 5; }
.d-ev { stroke: var(--bg); stroke-width: 1.5; }
.d-ev.ev-you { fill: var(--orange); } .d-ev.ev-money { fill: var(--green); } .d-ev.ev-routine { fill: var(--ink-2); }
.d-now { transform-box: view-box; transform-origin: 160px 160px; transform: rotate(var(--a)); }
.d-now.enter { animation: sweep-in 900ms var(--ease-out) both; }
@keyframes sweep-in { from { transform: rotate(calc(var(--a) - 50deg)); opacity: 0; } }
.d-hand { stroke: var(--ink-2); stroke-width: 1.5; stroke-linecap: round; }
.d-sun { fill: var(--sun); stroke: var(--bg); stroke-width: 3.5; }
.legend { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; margin: 16px 0 0; padding: 0; font-size: 13px; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.key { display: inline-block; width: 16px; height: 6px; border-radius: 3px; }
.k-night { background: var(--night); } .k-sweep { background: var(--accent); width: 4px; height: 14px; }

.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 20px 0 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.stat { padding: 16px 16px 12px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat dt { font-size: 13px; color: var(--ink-2); }
.stat dd { margin: 0; }
.stat dd.num { font: 800 clamp(26px, 6vw, 32px)/1.15 'Inter Display', Inter, sans-serif; letter-spacing: -0.02em; margin-top: 2px; white-space: nowrap; }
.stat .note { font-size: 13px; color: var(--ink-2); }

.vstrip { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; margin-top: 16px; padding: 16px 16px; border-radius: var(--r-m); background: var(--ink); color: var(--bg); text-decoration: none; transition: transform 160ms var(--ease-out); }
.vstrip:active { transform: scale(0.99); }
.vstrip-t { font-weight: 600; }
.vstrip-s { grid-column: 1 / -1; font-size: 13px; opacity: .85; }
.vcounts { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.vcounts.lg { margin: 16px 0 0; font-size: 15px; gap: 8px 20px; }
.vcounts.lg .num { font-weight: 700; }
.vc { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.vstrip .dot { box-shadow: 0 0 0 1.5px var(--bg); }

/* ---------- queue ---------- */
.cards { display: grid; gap: 16px; }
.xcard { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px; }
.xcard.tier-now { border: 1.5px solid color-mix(in srgb, var(--red) 60%, var(--line)); background: color-mix(in srgb, var(--red) 4%, var(--surface)); }
.xmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; }
.xtitle { font: 600 19px/1.3 Inter, sans-serif; margin: 0 0 8px; }
.xclient { display: inline-flex; min-height: 32px; align-items: center; font-size: 14px; color: var(--ink-2); }
.xctx { margin: 8px 0 0; max-width: 70ch; }
.draft { margin: 12px 0 0; }
.draft summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; font-weight: 600; text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.draft blockquote { margin: 4px 0 0; padding: 12px 16px; border-radius: 6px; background: var(--surface-2); max-width: 66ch; }
.rec { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.rec b { color: var(--ink); }
.xacts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.xstatus { margin: 12px 0 0; font-size: 14px; font-weight: 500; outline: none; }
.xstatus:empty { display: none; }
.xstatus.pending { color: var(--ink-2); }
.xstatus.pending::before { content: ''; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 700ms linear infinite; vertical-align: -1px; }
.xstatus.ok { color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- clients ---------- */
.tools { display: grid; gap: 8px; margin-bottom: 16px; }
.tools.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.lab { font-size: 13px; color: var(--ink-2); display: block; margin-bottom: 4px; }
input[type=search], select { width: 100%; min-height: 48px; padding: 0 16px; font: 400 16px Inter, sans-serif; color: var(--ink); background: var(--surface); border: 1.5px solid var(--line-2); border-radius: 12px; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(-45deg, transparent 50%, var(--ink-2) 50%); background-position: right 18px center, right 13px center; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.seg { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 4px -2px 0; }
.seg-b { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; transition: transform 160ms var(--ease-out); }
.seg-b:active { transform: scale(0.97); }
.seg-b[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.clist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.crow { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; transition: background-color 160ms ease; }
@media (hover: hover) and (pointer: fine) { .crow:hover { background: var(--surface); } }
.cname { font-weight: 600; font-size: 16px; }
.cmeta, .cplan { font-size: 14px; color: var(--ink-2); }
.gf { color: var(--amber); font-weight: 600; }
.cside { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }
.count { font-size: 13px; font-weight: 600; color: var(--orange); }

/* ---------- dossier ---------- */
.callout { margin: 0 0 8px; padding: 12px 16px; border-radius: var(--r-m); background: color-mix(in srgb, var(--orange) 13%, var(--surface)); }
.callout .more-link { min-height: 32px; }
.dgrid { display: grid; gap: 8px 32px; margin-top: 20px; }
.dgroup { padding: 16px 0 8px; border-top: 2px solid var(--ink); }
.dgroup.ext { border-top-style: dashed; border-top-color: var(--line-2); }
.kv { margin: 0; }
.kvr { display: grid; grid-template-columns: minmax(0, 9.5em) minmax(0, 1fr); gap: 2px 16px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.kvr:last-child { border-bottom: 0; }
.kvr dt { color: var(--ink-2); font-size: 14px; }
.kvr dd { margin: 0; overflow-wrap: anywhere; }
.kv.tight .kvr { grid-template-columns: minmax(0, 10em) minmax(0, 1fr); }
.lock { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: var(--ink-2); }
.hist { margin: 0; padding-left: 1.1em; }
.hist li { margin: 2px 0; }
ul.hist:has(.req) { list-style: none; padding: 0; }
.req { display: flex; gap: 12px; align-items: center; }
.sla { width: 28px; height: 28px; flex: none; }
.sla-bg { fill: none; stroke: var(--line); stroke-width: 4; }
.sla-fg { fill: none; stroke-width: 4; stroke-linecap: round; }
.sla.ok .sla-fg { stroke: var(--accent); } .sla.warn .sla-fg { stroke: var(--orange); } .sla.late .sla-fg { stroke: var(--red); }

/* ---------- agents ---------- */
.agents { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.agent { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.agent p { margin: 3px 0 0; max-width: 72ch; }
.ag-h { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; }
.warn { color: var(--orange); font-weight: 600; }
.podhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.podhead h2 { margin: 0; }
.meter { width: 120px; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.meter-f { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.podclients { margin: 8px 0 12px; font-size: 14px; color: var(--ink-2); }

/* ---------- money ---------- */
.cols { display: grid; gap: 0 40px; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: minmax(0, 8.5em) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.bar { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar-f { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
.bar-v { font-weight: 600; }
.scroll { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th, .tbl td { padding: 12px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.tbl thead th { font-size: 13px; color: var(--ink-2); font-weight: 500; }
.tbl .r { text-align: right; }
.tbl tbody th { font-weight: 600; }

/* ---------- risk ---------- */
.livegrid { display: grid; gap: 12px; }
.live { background: color-mix(in srgb, var(--red) 4%, var(--surface)); border: 1.5px solid color-mix(in srgb, var(--red) 45%, var(--line)); border-radius: var(--r-m); padding: 16px; font-size: 15px; }
.live p { margin: 4px 0 0; }
.vlist { list-style: none; margin: 12px 0 0; padding: 0; border-top: 1px solid var(--line); }
.vrow { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.vrow p { margin: 3px 0 0 20px; max-width: 72ch; }
.vh { display: flex; align-items: center; gap: 12px; }
.vt { font-weight: 600; }
.ungraded { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 8px; }
.ungraded summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; }
.cols-list { list-style: none; padding: 0; margin: 4px 0 0; columns: 18em; column-gap: 32px; font-size: 14px; }
.cols-list li { padding: 4px 0; break-inside: avoid; }

/* ---------- sheet ---------- */
dialog {
  border: 0; padding: 0; overflow: auto; overscroll-behavior: contain; color: var(--ink); background: var(--surface); width: 100%; max-width: 560px; max-height: 88vh;
  margin: auto auto 0; border-radius: var(--r-l) var(--r-l) 0 0;
  transition: transform 300ms var(--ease-drawer), opacity 200ms ease, overlay 300ms allow-discrete, display 300ms allow-discrete;
}
dialog[open] { transform: translateY(0); opacity: 1; }
@starting-style { dialog[open] { transform: translateY(28px); opacity: 0; } }
dialog::backdrop { background: rgb(8 18 16 / .5); }
.sheet-in { padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); }
.sheet-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.sheet-h h2 { font: 800 24px/1.15 'Inter Display', Inter, sans-serif; letter-spacing: -0.015em; margin: 8px 0 4px; }
.x { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--surface-2); cursor: pointer; flex: none; }
.restate { font-size: 17px; line-height: 1.5; margin: 12px 0 0; }
.sheet-a { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.morelist { list-style: none; margin: 8px 0 0; padding: 0; }
.morelist a { display: grid; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); text-decoration: none; min-height: 56px; }
.sheet-in > p { max-width: 60ch; }

/* ---------- wider screens ---------- */
@media (min-width: 640px) {
  .top { display: flex; gap: 12px; }
  .asof { flex: 1; margin: 0; text-align: right; }
  .pause-state { display: inline; }
  .asof-pause { display: none; }
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .crow { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); column-gap: 20px; }
  .cname, .cmeta, .cplan { grid-column: 1; }
  .cside { grid-column: 2; grid-row: 1 / span 3; justify-content: flex-end; align-self: center; margin: 0; }
  .ev { grid-template-columns: 5em 9.5em minmax(0, 1fr); }
  .ev-s { grid-column: 3; grid-row: 1; }
  .ev-a { grid-column: 3; }
  .livegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tools { grid-template-columns: minmax(0, 1fr); }
  dialog { margin: auto; border-radius: var(--r-l); }
}
@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); grid-template-rows: auto 1fr; min-height: 100vh; }
  .top { grid-column: 2; }
  .top > .brand { display: none; }
  .asof { text-align: left; }
  .nav { position: sticky; top: 0; grid-row: 1 / 3; grid-column: 1; height: 100vh; display: flex; flex-direction: column; gap: 2px; padding: 16px 12px; border-top: 0; border-right: 1px solid var(--line); }
  .nav > a.rail-brand { display: inline-flex; margin: 0 8px 20px; padding: 0; color: var(--ink); font-size: 17px; gap: 12px; }
  .nav > a { flex-direction: row; justify-content: flex-start; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
  .nav > a.extra { display: flex; }
  .nav > .more { display: none; }
  .nav > a[aria-current=page] { background: var(--surface-2); font-weight: 600; }
  .nav > a[aria-current=page]::before { content: none; }
  .badge { position: static; margin-left: auto; }
  @media (hover: hover) { .nav > a:hover { color: var(--ink); } }
  main { grid-column: 2; padding: 28px 40px 64px; margin: 0; }
  .today-grid { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: start; }
  .today-a { position: sticky; top: 84px; }
  .vlist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; }
  .today-grid .btn.wide { max-width: 380px; margin-left: auto; margin-right: auto; display: flex; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .dgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .livegrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-property: opacity, background-color, color, border-color !important; }
  .d-now.enter { animation: none !important; }
  .xstatus.pending::before { border-top-color: var(--line-2); }
}
