/* StoneCreek Zero design system. Near-black, monochrome, numerals and hairlines.
   One accent: the white pill (black pill in light). One signal: red, only for overdue and failed, always with a word and a shape.
   System fonts only, rem sizes so Dynamic Type scales everything, safe areas on every edge, transform and opacity motion only. */

/* ---------- tokens ---------- */
:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #0b0b0c;
  --raise: #141416;
  --raise-2: #1c1c1e;
  --fill: rgba(255, 255, 255, 0.08);
  --fill-2: rgba(255, 255, 255, 0.14);
  --text: #f5f5f7;
  --text-2: #a1a1a6;
  --text-3: #8e8e93;
  --rule: rgba(255, 255, 255, 0.10);
  --rule-2: rgba(255, 255, 255, 0.18);
  --accent: #ffffff;
  --on-accent: #000000;
  --signal: #ff453a;
  --hold: #8e8e93;
  --nc: rgba(255, 255, 255, 0.18);
  --glass: rgba(12, 12, 14, 0.72);
  --glass-2: rgba(28, 28, 30, 0.82);
  --scrim: rgba(0, 0, 0, 0.55);
  --shadow-sheet: 0 -18px 48px rgba(0, 0, 0, 0.65);
  --focus: #ffffff;

  --f-sans: -apple-system, "SF Pro Text", system-ui, "Helvetica Neue", Arial, sans-serif;
  --f-display: -apple-system, "SF Pro Display", system-ui, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --fs-hero: 5rem;
  --fs-xl: 3rem;
  --fs-lg: 2rem;
  --fs-title: 1.75rem;
  --fs-h2: 1.25rem;
  --fs-row: 1.0625rem;
  --fs-body: 1rem;
  --fs-meta: 0.875rem;
  --fs-mini: 0.8125rem;
  --fs-label: 0.6875rem;

  --hair: 1px;
  --g: 16px;
  --rhythm: 20px;
  --row: 52px;
  --tap: 44px;
  --radius: 14px;
  --top: 44px;
  --tab: 49px;
  --rail: 248px;
  --pill-h: 44px;
  --sa-t: env(safe-area-inset-top, 0px);
  --sa-r: env(safe-area-inset-right, 0px);
  --sa-b: env(safe-area-inset-bottom, 0px);
  --sa-l: env(safe-area-inset-left, 0px);

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --t-fast: 160ms;
  --t: 200ms;
  --t-sheet: 280ms;
}
@media (min-resolution: 2dppx) { :root { --hair: 0.5px; } }

/* light: same structure, inverted; the pill turns black */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --surface: #ffffff; --raise: #f2f2f7; --raise-2: #e5e5ea;
  --fill: rgba(0, 0, 0, 0.05); --fill-2: rgba(0, 0, 0, 0.09);
  --text: #000000; --text-2: #48484a; --text-3: #636366;
  --rule: rgba(0, 0, 0, 0.12); --rule-2: rgba(0, 0, 0, 0.22);
  --accent: #000000; --on-accent: #ffffff; --signal: #d70015; --hold: #6e6e73; --nc: rgba(0, 0, 0, 0.22);
  --glass: rgba(255, 255, 255, 0.78); --glass-2: rgba(242, 242, 247, 0.9); --scrim: rgba(0, 0, 0, 0.28);
  --shadow-sheet: 0 -12px 40px rgba(0, 0, 0, 0.14); --focus: #000000;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light;
    --bg: #ffffff; --surface: #ffffff; --raise: #f2f2f7; --raise-2: #e5e5ea;
    --fill: rgba(0, 0, 0, 0.05); --fill-2: rgba(0, 0, 0, 0.09);
    --text: #000000; --text-2: #48484a; --text-3: #636366;
    --rule: rgba(0, 0, 0, 0.12); --rule-2: rgba(0, 0, 0, 0.22);
    --accent: #000000; --on-accent: #ffffff; --signal: #d70015; --hold: #6e6e73; --nc: rgba(0, 0, 0, 0.22);
    --glass: rgba(255, 255, 255, 0.78); --glass-2: rgba(242, 242, 247, 0.9); --scrim: rgba(0, 0, 0, 0.28);
    --shadow-sheet: 0 -12px 40px rgba(0, 0, 0, 0.14); --focus: #000000;
  }
}
:root[data-density="compact"] { --row: 44px; --rhythm: 14px; }
:root[data-role="belle"] { --row: 56px; --tap: 52px; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  font-size: 100%;
  font: -apple-system-body;          /* Safari: rem follows the Dynamic Type setting */
  font-family: var(--f-sans);
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
  background: var(--bg); color: var(--text);
  font-family: var(--f-sans); font-size: var(--fs-body); line-height: 1.4;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern";
}
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { touch-action: manipulation; cursor: pointer; background: none; border: 0; padding: 0; margin: 0; -webkit-user-select: none; user-select: none; }
a { color: inherit; }
svg { display: block; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
/* headings and sheets take focus only so VoiceOver starts there; they are not controls, so no ring */
[data-route-focus]:focus, h1[tabindex="-1"]:focus, .z-welcome-t:focus, .z-sheet:focus, .z-main:focus { outline: none; }
::selection { background: var(--fill-2); }
.z-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.z-tab { font-variant-numeric: tabular-nums; }
.z-mono { font-family: var(--f-mono); font-size: 0.75rem; letter-spacing: 0; }
.z-legacy { display: none !important; }

/* ---------- app frame ---------- */
#boardUI { position: fixed; inset: 0; }
.z-app { position: fixed; inset: 0; background: var(--bg); }
.z-main {
  position: absolute; inset: 0;
  overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding: calc(var(--top) + var(--sa-t)) 0 calc(var(--tab) + var(--sa-b) + 28px);
  scroll-padding-top: calc(var(--top) + var(--sa-t) + 8px);
}
.z-view { min-height: 100%; padding: 0 0 var(--rhythm); }
.z-view.is-entering { animation: z-enter var(--t) var(--ease) both; }
@keyframes z-enter { from { opacity: 0; transform: translate3d(0, 8px, 0); } to { opacity: 1; transform: none; } }
.z-pad { padding-left: calc(var(--g) + var(--sa-l)); padding-right: calc(var(--g) + var(--sa-r)); }

/* top status strip */
.z-top {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  height: calc(var(--top) + var(--sa-t)); padding: var(--sa-t) calc(8px + var(--sa-r)) 0 calc(8px + var(--sa-l));
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; column-gap: 4px;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  -webkit-user-select: none; user-select: none;
}
.z-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: var(--hair); background: var(--rule); opacity: 0; transition: opacity var(--t) var(--ease); }
.z-top.is-scrolled::after { opacity: 1; }
.z-top-l { display: flex; align-items: center; min-width: 0; }
.z-top-title { min-width: 0; height: var(--top); line-height: var(--top); text-align: center; pointer-events: none;
  font-size: var(--fs-body); font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  opacity: 0; transform: translate3d(0, 4px, 0); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.z-top.has-title .z-top-title { opacity: 1; transform: none; }
.z-top-r { display: flex; justify-content: flex-end; align-items: center; gap: 0; }
.z-back { display: inline-flex; align-items: center; gap: 2px; min-height: var(--tap); padding: 0 8px 0 2px; color: var(--text); font-size: var(--fs-body); border-radius: 10px; }
.z-back svg { width: 22px; height: 22px; }

.z-status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; min-height: var(--tap); padding: 0 6px; border-radius: 999px; color: var(--text-2); font-size: var(--fs-mini); }
.z-status .z-mono { font-family: var(--f-sans); font-size: 0.8125rem; font-weight: 500; font-variant-numeric: tabular-nums; text-align: left; }
.z-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.z-dot.is-live { color: var(--text); }
.z-dot.is-stale { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; color: var(--text-2); }
.z-dot.is-off { background: transparent; color: var(--signal); width: 10px; height: 10px; position: relative; }
.z-dot.is-off::before, .z-dot.is-off::after { content: ""; position: absolute; left: 50%; top: 0; width: 1.5px; height: 10px; background: currentColor; transform: translateX(-50%) rotate(45deg); }
.z-dot.is-off::after { transform: translateX(-50%) rotate(-45deg); }
.z-dot.is-sync { animation: z-breathe 1.2s ease-in-out infinite; }
@keyframes z-breathe { 50% { opacity: 0.35; } }
/* the systems word: small and quiet (GO, HOLD); only NO-GO takes the signal colour, with its cross so colour is never the only cue */
.z-go { display: inline-flex; align-items: center; gap: 5px; min-height: var(--tap); min-width: var(--tap); justify-content: center; padding: 0 6px; }
.z-go span { white-space: nowrap; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-2); }
.z-go::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--text-2); flex: none; }
.z-go[data-word="HOLD"]::before { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-2); }
.z-go[data-word="NO-GO"] span { color: var(--signal); }
.z-go[data-word="NO-GO"]::before { width: 8px; height: 8px; border-radius: 0; background: var(--signal);
  clip-path: polygon(20% 0, 50% 30%, 80% 0, 100% 20%, 70% 50%, 100% 80%, 80% 100%, 50% 70%, 20% 100%, 0 80%, 30% 50%, 0 20%); }

.z-strip { position: fixed; z-index: 19; left: 0; right: 0; top: calc(var(--top) + var(--sa-t)); padding: 8px calc(var(--g) + var(--sa-r)) 8px calc(var(--g) + var(--sa-l));
  display: flex; align-items: center; gap: 10px; font-size: var(--fs-mini); color: var(--text-2); background: var(--glass-2);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.z-strip .z-btn { margin-left: auto; }

/* bottom tab bar */
.z-tabbar {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  height: calc(var(--tab) + var(--sa-b)); padding: 0 var(--sa-r) var(--sa-b) var(--sa-l);
  display: flex; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  -webkit-user-select: none; user-select: none;
}
.z-tabbar::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: var(--hair); background: var(--rule); }

.z-tabbtn { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); position: relative;
  font-size: 0.625rem; font-weight: 500; letter-spacing: 0.01em; transition: color var(--t-fast) var(--ease); }
.z-tabbtn svg { width: 25px; height: 25px; }
.z-tabbtn[aria-current="page"] { color: var(--text); }
.z-tabbtn:active svg { transform: scale(0.92); }
.z-tabbtn svg { transition: transform 90ms var(--ease); }
.z-badge { position: absolute; top: 4px; left: calc(50% + 7px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--on-accent);
  font-size: 0.6875rem; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* search and commands: a magnifier in the top bar, the same place on every screen */
.z-pill { width: var(--tap); height: var(--tap); flex: none; display: grid; place-items: center; border-radius: 50%; color: var(--text); }
.z-pill svg { width: 21px; height: 21px; }
.z-pill:active { background: var(--fill); }
kbd, .z-kbd { font-family: var(--f-sans); font-size: 0.6875rem; font-weight: 600; color: var(--text-3); padding: 2px 6px; border-radius: 5px; box-shadow: inset 0 0 0 var(--hair) var(--rule-2); }

/* desktop rail */
.z-rail { display: none; }
@media (min-width: 900px) {
  .z-tabbar, .z-top-r .z-pill { display: none; }
  .z-rail { display: flex; flex-direction: column; position: fixed; z-index: 20; top: 0; bottom: 0; left: 0; width: calc(var(--rail) + var(--sa-l));
    padding: calc(20px + var(--sa-t)) 12px calc(16px + var(--sa-b)) calc(12px + var(--sa-l)); background: var(--bg); -webkit-user-select: none; user-select: none; }
  .z-rail::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: var(--hair); background: var(--rule); }
  .z-main { left: calc(var(--rail) + var(--sa-l)); padding-bottom: calc(40px + var(--sa-b)); }
  .z-top { left: calc(var(--rail) + var(--sa-l)); }
  .z-strip { left: calc(var(--rail) + var(--sa-l)); }
  .z-view { max-width: 920px; }
  .z-top-r .z-status, .z-top-r .z-go { display: none; }
}
.z-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; }
.z-brand svg { width: 26px; height: 26px; }
.z-brand b { font-family: var(--f-display); font-size: 0.9375rem; font-weight: 600; letter-spacing: 0.32em; }
.z-railpill { display: flex; align-items: center; gap: 10px; min-height: var(--tap); padding: 0 12px; margin: 0 0 14px; border-radius: 10px; background: var(--fill); color: var(--text-2); font-size: var(--fs-meta); }
.z-railpill svg { width: 16px; height: 16px; }
.z-railpill kbd { margin-left: auto; }
.z-railnav { display: flex; flex-direction: column; gap: 2px; }
.z-railbtn { display: flex; align-items: center; gap: 12px; min-height: var(--tap); padding: 0 12px; border-radius: 10px; color: var(--text-2); font-size: 0.9375rem; font-weight: 500; text-align: left; }
.z-railbtn svg { width: 20px; height: 20px; flex: none; }
.z-railbtn:hover { background: var(--fill); color: var(--text); }
.z-railbtn[aria-current="page"] { color: var(--text); background: var(--fill); }
.z-railbtn .z-count { margin-left: auto; font-size: var(--fs-mini); color: var(--text-2); font-variant-numeric: tabular-nums; }
.z-railgap { height: 18px; }
.z-railfoot { margin-top: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 10px 0; font-size: var(--fs-mini); color: var(--text-3); }
.z-railfoot .z-status { padding: 0; min-height: var(--tap); justify-content: flex-start; }
.z-railfoot .z-go { padding: 0; min-height: var(--tap); justify-content: flex-start; }
.z-railfoot .z-me { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- type and screen header ---------- */
.z-head { padding: 6px calc(var(--g) + var(--sa-r)) var(--rhythm) calc(var(--g) + var(--sa-l)); }
.z-title { margin: 0; font-family: var(--f-display); font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.025em; line-height: 1.1; }
.z-sub { margin: 6px 0 0; color: var(--text-2); font-size: var(--fs-meta); }
.z-h2 { margin: 0; font-family: var(--f-display); font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.015em; }
.z-p { margin: 0 0 12px; color: var(--text-2); font-size: var(--fs-body); line-height: 1.5; }
.z-p b, .z-p strong { color: var(--text); font-weight: 600; }
.z-label { display: flex; align-items: baseline; gap: 8px; padding: calc(var(--rhythm) + 4px) calc(var(--g) + var(--sa-r)) 8px calc(var(--g) + var(--sa-l));
  margin: 0; font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.z-label .z-tab { color: var(--text-3); }
.z-label .z-label-r { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; }
.z-asof { display: block; font-family: var(--f-sans); font-size: 0.75rem; font-variant-numeric: tabular-nums; color: var(--text-3); }
.z-asof.is-late { color: var(--text-2); }
.z-asof.is-late::before { content: "Old data. "; font-family: var(--f-sans); font-weight: 600; }

/* numerals */
.z-num { display: flex; flex-direction: column; gap: 6px; }
.z-num-v { font-family: var(--f-display); font-weight: 200; letter-spacing: -0.04em; line-height: 0.92; font-variant-numeric: tabular-nums; font-size: var(--fs-xl); }
.z-num--hero .z-num-v { font-size: clamp(4.5rem, 22vw, 6rem); }
.z-num--lg .z-num-v { font-size: var(--fs-xl); }
.z-num--md .z-num-v { font-size: var(--fs-lg); font-weight: 300; letter-spacing: -0.03em; }
.z-num--sm .z-num-v { font-size: var(--fs-h2); font-weight: 400; letter-spacing: -0.01em; }
.z-num-u { font-size: 0.4em; font-weight: 300; letter-spacing: 0; margin-left: 0.12em; color: var(--text-2); }
.z-num-l { font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-2); }
.z-num-s { font-size: var(--fs-mini); color: var(--text-3); }
.z-num.is-unknown .z-num-v { color: var(--text-3); }
.z-num.is-signal .z-num-v { color: var(--signal); }

/* ---------- lists and rows ---------- */
.z-list { list-style: none; margin: 0; padding: 0; position: relative; }
.z-row { position: relative; list-style: none; overflow: hidden; contain: layout paint; }
.z-row + .z-row::before, .z-list > .z-item + .z-item::before { content: ""; position: absolute; z-index: 2; top: 0; right: 0; left: calc(var(--g) + var(--sa-l) + 40px); height: var(--hair); background: var(--rule); pointer-events: none; }
.z-row.no-glyph + .z-row::before { left: calc(var(--g) + var(--sa-l)); }
.z-row-under { position: absolute; inset: 0; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; background: var(--raise);
  font-size: var(--fs-meta); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-2); opacity: 0; }
.z-row.is-swiping .z-row-under { opacity: 1; }
.z-row-under .z-under-r { margin-left: auto; }
.z-row.is-armed .z-row-under { color: var(--text); }
.z-row.is-armed[data-dir="right"] .z-row-under { box-shadow: inset 2px 0 0 var(--text); }
.z-row.is-armed[data-dir="left"] .z-row-under { box-shadow: inset -2px 0 0 var(--text); }
.z-row-face { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; min-height: var(--row);
  padding: 10px calc(4px + var(--sa-r)) 10px calc(var(--g) + var(--sa-l)); background: var(--bg); will-change: transform; touch-action: pan-y; }
.z-row-hit { position: absolute; inset: 0; z-index: 0; width: 100%; border-radius: 0; }
.z-row-hit:focus-visible { outline-offset: -2px; border-radius: 0; }
.z-row-face > :not(.z-row-hit) { position: relative; z-index: 1; pointer-events: none; }
.z-row-face > .z-row-menu, .z-row-face > .z-row-act { pointer-events: auto; }
.z-row-glyph { width: 26px; height: 26px; flex: none; color: var(--text-2); display: grid; place-items: center; position: relative; }
.z-row-glyph svg { width: 22px; height: 22px; }
.z-row-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.z-row-title { font-size: var(--fs-row); font-weight: 500; letter-spacing: -0.01em; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.z-row-meta { font-size: var(--fs-meta); color: var(--text-2); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.z-row-trail { flex: none; display: flex; align-items: center; gap: 6px; font-size: var(--fs-mini); color: var(--text-3); font-variant-numeric: tabular-nums; }
.z-row-menu { flex: none; width: var(--tap); height: var(--tap); display: grid; place-items: center; color: var(--text-3); border-radius: 10px; opacity: 0; transition: opacity var(--t-fast); }
.z-row-menu svg { width: 18px; height: 18px; }
.z-row:hover .z-row-menu, .z-row-menu:focus-visible, .z-row.is-focused .z-row-menu { opacity: 1; }
@media (hover: none) { .z-row-menu { width: 28px; } }
.z-row-act { flex: none; }
.z-row.is-pressed .z-row-face, .z-row-face:active { background: var(--raise); }
.z-row.is-flash .z-row-face { animation: z-commit 260ms var(--ease); }
@keyframes z-commit { 0% { transform: scale(1); } 35% { transform: scale(0.98); } 100% { transform: scale(1); } }
.z-row.is-focused .z-row-face { box-shadow: inset 2px 0 0 var(--text); }
.z-row[data-unseen] .z-row-glyph::after { content: ""; position: absolute; top: 0; right: -2px; width: 7px; height: 7px; border-radius: 50%; background: var(--text); }
.z-row.is-signal .z-row-glyph { color: var(--signal); }
.z-row.is-held .z-row-title { color: var(--text-2); }
.z-row.is-leaving { transition: transform var(--t) var(--ease), opacity var(--t) var(--ease); opacity: 0; transform: translate3d(0, -4px, 0) scale(0.98); }
.z-row.is-selected .z-row-face { background: var(--raise); }
.z-check { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text-3); display: grid; place-items: center; color: var(--on-accent); }
.z-row.is-selected .z-check { background: var(--accent); box-shadow: none; }
.z-check svg { width: 14px; height: 14px; opacity: 0; }
.z-row.is-selected .z-check svg { opacity: 1; }
.z-row.is-open .z-row-title { -webkit-line-clamp: 4; font-size: 1.1875rem; font-weight: 600; }
.z-row-more { position: relative; z-index: 1; padding: 0 calc(var(--g) + var(--sa-r)) 16px calc(var(--g) + var(--sa-l) + 40px); background: var(--bg); }

/* a plain key/value or link row (settings, about) */
.z-cell { display: flex; align-items: center; gap: 12px; min-height: var(--row); padding: 10px calc(var(--g) + var(--sa-r)) 10px calc(var(--g) + var(--sa-l)); position: relative; width: 100%; text-align: left; font-size: var(--fs-body); }
.z-cell + .z-cell::before { content: ""; position: absolute; top: 0; right: 0; left: calc(var(--g) + var(--sa-l)); height: var(--hair); background: var(--rule); }
button.z-cell:active, a.z-cell:active { background: var(--raise); }
.z-cell svg { width: 20px; height: 20px; color: var(--text-2); flex: none; }
.z-cell-t { flex: 1; min-width: 0; }
.z-cell-t small { display: block; color: var(--text-2); font-size: var(--fs-meta); margin-top: 2px; }
.z-cell-v { color: var(--text-2); font-size: var(--fs-meta); text-align: right; font-variant-numeric: tabular-nums; }
.z-cell .z-chev { width: 16px; height: 16px; color: var(--text-3); }
.z-group { margin: 0 0 8px; }

/* ---------- buttons, chips, toggles, fields ---------- */
.z-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--tap); padding: 0 18px; border-radius: 999px;
  font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap; transition: transform 90ms var(--ease), opacity var(--t-fast);
  background: var(--fill-2); color: var(--text); }
/* large text (Dynamic Type) or a narrow phone: a long label wraps inside its button instead of running off the screen */
.z-btn { max-width: 100%; padding-top: 4px; padding-bottom: 4px; }
.z-btn > span { min-width: 0; white-space: normal; overflow-wrap: anywhere; text-align: center; line-height: 1.2; }
.z-btn:active { transform: scale(0.97); }
.z-btn svg { width: 18px; height: 18px; }
.z-btn--primary { background: var(--accent); color: var(--on-accent); }
.z-btn--ghost { background: transparent; color: var(--text); padding: 0 12px; }
.z-btn--quiet { background: transparent; color: var(--text-2); padding: 0 12px; font-weight: 500; }
.z-btn--danger { background: var(--fill); color: var(--signal); }
.z-btn--small { min-height: 34px; padding: 0 14px; font-size: var(--fs-meta); }
.z-btn--small::before { content: ""; position: absolute; inset: -5px -2px; }
.z-btn--wide { width: 100%; }
.z-btn--icon { width: var(--tap); padding: 0; background: transparent; }
.z-btn[aria-busy="true"] { opacity: 0.6; pointer-events: none; }
.z-btn kbd { margin-left: 2px; color: inherit; opacity: 0.55; box-shadow: inset 0 0 0 var(--hair) currentColor; }
.z-btns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.z-btns--bar { padding: 12px calc(var(--g) + var(--sa-r)) 12px calc(var(--g) + var(--sa-l)); }

.z-chips { display: flex; gap: 8px; overflow-x: auto; padding: 6px calc(var(--g) + var(--sa-r)) 8px calc(var(--g) + var(--sa-l)); margin-top: -2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.z-chips::-webkit-scrollbar { display: none; }
/* a chip row wider than the screen fades at the right edge, so a cut-off chip reads as "scroll for more" */
.z-chips { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 28px), transparent); }
.z-chips > :last-child { margin-right: 20px; }
.z-chip { position: relative; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 14px; border-radius: 999px; background: var(--fill); color: var(--text-2);
  font-size: var(--fs-meta); font-weight: 500; }
.z-chip::before { content: ""; position: absolute; inset: -5px -2px; }
.z-chip[aria-pressed="true"], .z-chip[aria-checked="true"], .z-chip[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
.z-chip .z-tab { color: var(--text-2); }
.z-chip[aria-pressed="true"] .z-tab, .z-chip[aria-checked="true"] .z-tab, .z-chip[aria-selected="true"] .z-tab { color: inherit; }
.z-seg { display: inline-flex; padding: 2px; border-radius: 10px; background: var(--fill); }
.z-seg button { min-height: 36px; padding: 0 14px; border-radius: 8px; font-size: var(--fs-meta); font-weight: 500; color: var(--text-2); position: relative; }
.z-seg button::before { content: ""; position: absolute; inset: -4px 0; }
.z-seg button[aria-checked="true"] { background: var(--raise-2); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }
:root[data-theme="light"] .z-seg button[aria-checked="true"] { background: #fff; }

.z-switch { position: relative; width: 51px; height: 31px; flex: none; border-radius: 999px; background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--rule-2); transition: background var(--t) var(--ease); }
.z-switch[aria-checked="true"] { box-shadow: none; }
.z-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: transform var(--t) var(--ease); }
.z-switch[aria-checked="true"] { background: var(--accent); }
:root:not([data-theme="light"]) .z-switch[aria-checked="true"]::after { background: #000; }
.z-switch[aria-checked="true"]::after { transform: translateX(20px); }

.z-field { display: flex; flex-direction: column; gap: 6px; }
.z-input, .z-textarea { width: 100%; min-height: var(--tap); padding: 12px 14px; border: 0; border-radius: 12px; background: var(--fill); color: var(--text); font-size: 1.0625rem; line-height: 1.4;
  -webkit-appearance: none; appearance: none; }
.z-textarea { min-height: 120px; resize: vertical; }
.z-input::placeholder, .z-textarea::placeholder { color: var(--text-3); }
.z-input:focus-visible, .z-textarea:focus-visible { outline: 1px solid var(--rule-2); outline-offset: 0; }
.z-count-l { align-self: flex-end; font-size: var(--fs-mini); color: var(--text-3); font-variant-numeric: tabular-nums; }
.z-count-l.is-over { color: var(--signal); }

/* ---------- states ---------- */
.z-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: calc(var(--rhythm) * 2) calc(var(--g) + var(--sa-r)) calc(var(--rhythm) * 2) calc(var(--g) + var(--sa-l)); }
.z-empty--center { align-items: center; text-align: center; justify-content: center; min-height: 52vh; }
.z-empty .z-num-v { font-size: clamp(5rem, 30vw, 8rem); }
.z-empty-t { margin: 0; font-family: var(--f-display); font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.015em; }
.z-empty-s { margin: 0; color: var(--text-2); font-size: var(--fs-meta); max-width: 36ch; line-height: 1.5; }
.z-empty .z-btns { margin-top: 8px; }
.z-nc { margin: 0 calc(var(--g) + var(--sa-r)) 12px calc(var(--g) + var(--sa-l)); padding: 16px; border-radius: var(--radius); outline: 1px dashed var(--nc); outline-offset: -1px; color: var(--text-3); }
.z-nc b { display: block; color: var(--text-2); font-weight: 600; font-size: var(--fs-meta); margin-bottom: 4px; }
.z-nc span { font-size: var(--fs-mini); }
.z-error { padding: var(--rhythm) calc(var(--g) + var(--sa-r)) var(--rhythm) calc(var(--g) + var(--sa-l)); }
.z-error .z-mark { margin-bottom: 10px; }
.z-dim { opacity: 0.8; }
.z-mark { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-mini); color: var(--text-2); font-weight: 500; }
.z-mark i { width: 9px; height: 9px; border-radius: 50%; background: var(--text); flex: none; position: relative; font-style: normal; }
.z-mark[data-s="stale"] i, .z-mark[data-s="held"] i { background: transparent; box-shadow: inset 0 0 0 1.5px var(--text-2); }
.z-mark[data-s="unverified"] i, .z-mark[data-s="nc"] i { background: transparent; outline: 1px dashed var(--text-2); outline-offset: -1px; border-radius: 2px; }
.z-mark[data-s="failed"] { color: var(--signal); }
.z-mark[data-s="failed"] i { background: transparent; }
.z-mark[data-s="failed"] i::before, .z-mark[data-s="failed"] i::after { content: ""; position: absolute; left: 4px; top: -1px; width: 1.5px; height: 11px; background: currentColor; transform: rotate(45deg); }
.z-mark[data-s="failed"] i::after { transform: rotate(-45deg); }
.z-skel { list-style: none; margin: 0; padding: 0; }
.z-skel li { display: flex; align-items: center; gap: 14px; min-height: var(--row); padding: 10px var(--g) 10px calc(var(--g) + var(--sa-l)); }
.z-skel i { display: block; border-radius: 6px; background: var(--fill); animation: z-pulse 1.4s ease-in-out infinite; }
.z-skel .a { width: 22px; height: 22px; border-radius: 50%; }
.z-skel .b { height: 14px; flex: 1; max-width: 70%; }
.z-skel .c { height: 10px; width: 42px; margin-left: auto; }
@keyframes z-pulse { 50% { opacity: 0.45; } }

/* ---------- sheets ---------- */
.z-layer { position: fixed; inset: 0; z-index: 40; pointer-events: none; }
.z-scrim { position: absolute; inset: 0; background: var(--scrim); opacity: 0; transition: opacity var(--t-sheet) var(--ease); pointer-events: auto; }
.z-layer.is-in .z-scrim { opacity: 1; }
.z-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: calc(100% - var(--sa-t) - 12px); display: flex; flex-direction: column;
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow-sheet); pointer-events: auto;
  transform: translate3d(0, 100%, 0); transition: transform var(--t-sheet) var(--ease); outline: none; }
.z-sheet[data-size="tall"] { height: 88%; }
.z-sheet[data-size="full"] { height: calc(100% - var(--sa-t) - 12px); }
.z-layer.is-in .z-sheet { transform: none; }
.z-layer.is-dragging .z-sheet { transition: none; }
.z-grab { flex: none; height: 22px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.z-grab::before { content: ""; width: 36px; height: 5px; border-radius: 3px; background: var(--rule-2); }
.z-sheet-head { flex: none; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 8px 4px calc(var(--g) + var(--sa-l)); touch-action: none; }
.z-sheet-title { flex: 1; min-width: 0; margin: 0; font-family: var(--f-display); font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.z-sheet-x { width: var(--tap); height: var(--tap); border-radius: 50%; display: grid; place-items: center; color: var(--text-2); flex: none; }
.z-sheet-x svg { width: 18px; height: 18px; }
.z-sheet-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 0 0 calc(16px + var(--sa-b)); }
.z-sheet-foot { flex: none; padding: 10px calc(var(--g) + var(--sa-r)) calc(10px + var(--sa-b)) calc(var(--g) + var(--sa-l)); background: var(--surface); position: relative; }
.z-sheet-foot::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: var(--hair); background: var(--rule); }
.z-sheet.has-foot .z-sheet-body { padding-bottom: 12px; }
@media (min-width: 900px) {
  .z-sheet[data-pane="true"] { left: auto; top: 0; width: min(460px, 46vw); max-height: none; height: 100% !important; border-radius: 0; transform: translate3d(100%, 0, 0);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.5); padding-top: var(--sa-t); }
  .z-sheet[data-pane="true"]::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: var(--hair); background: var(--rule); }
  .z-sheet[data-pane="true"] .z-grab { display: none; }
  .z-sheet[data-pane="true"] .z-sheet-head { padding-top: 14px; }
  .z-layer[data-pane="true"] .z-scrim { background: rgba(0, 0, 0, 0.25); }
  .z-sheet:not([data-pane="true"]) { left: 50%; right: auto; width: 560px; margin-left: -280px; bottom: auto; top: 50%; border-radius: var(--radius); max-height: 80%;
    transform: translate3d(0, -46%, 0) scale(0.98); opacity: 0; transition: transform var(--t) var(--ease), opacity var(--t) var(--ease); }
  .z-layer.is-in .z-sheet:not([data-pane="true"]) { transform: translate3d(0, -50%, 0); opacity: 1; }
  .z-sheet:not([data-pane="true"]) .z-grab { display: none; }
  .z-sheet:not([data-pane="true"]) .z-sheet-head { padding-top: 10px; }
  .z-sheet[data-size="full"]:not([data-pane="true"]) { height: auto; }
}

/* ---------- toast and undo bar ---------- */
.z-toasts { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--tab) + var(--sa-b) + 10px); width: min(calc(100% - 32px - var(--sa-l) - var(--sa-r)), 480px);
  transform: translateX(-50%); pointer-events: none; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 900px) { .z-toasts { bottom: calc(24px + var(--sa-b)); left: calc(50% + var(--rail) / 2); } }
.z-toast { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 6px 6px 18px; border-radius: 16px; pointer-events: auto;
  background: var(--glass-2); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: inset 0 0 0 var(--hair) var(--rule-2), 0 12px 36px rgba(0, 0, 0, 0.45);
  font-size: var(--fs-meta); color: var(--text); opacity: 0; transform: translate3d(0, 12px, 0) scale(0.98); transition: transform var(--t) var(--ease), opacity var(--t) var(--ease); }
.z-toast.is-in { opacity: 1; transform: none; }
.z-toast-t { flex: 1; min-width: 0; line-height: 1.35; padding: 8px 0; }
.z-toast[data-kind="error"] .z-toast-t::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--signal); margin-right: 8px; vertical-align: 1px; }
.z-toast .z-btn { min-height: 40px; padding: 0 16px; }
.z-toast-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--text-2); transform-origin: left; opacity: 0.6; }

/* ---------- command bar ---------- */
.z-cmd { display: flex; flex-direction: column; height: 100%; }
.z-cmd-field { display: flex; align-items: center; gap: 10px; margin: 0 calc(var(--g) + var(--sa-r)) 8px calc(var(--g) + var(--sa-l)); padding: 0 6px 0 14px; border-radius: 12px; background: var(--fill); }
.z-cmd-field svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.z-cmd-field input { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; font-size: 1.0625rem; color: var(--text); -webkit-appearance: none; appearance: none; }
.z-cmd-field input:focus-visible { outline: none; }
.z-cmd-field input::placeholder { color: var(--text-2); }
.z-cmd-hint { margin: 0 calc(var(--g) + var(--sa-r)) 4px calc(var(--g) + var(--sa-l)); font-size: var(--fs-mini); color: var(--text-3); }
.z-cmd-row[aria-selected="true"] .z-row-face { background: var(--raise); }
.z-cmd-plan { margin: 4px calc(var(--g) + var(--sa-r)) 8px calc(var(--g) + var(--sa-l)); padding: 14px 16px; border-radius: var(--radius); background: var(--raise); }
.z-cmd-plan.is-selected { box-shadow: inset 0 0 0 1px var(--rule-2); }
.z-cmd-plan p { margin: 0 0 10px; font-size: var(--fs-row); font-weight: 500; }
.z-cmd-plan .z-chips { padding: 0 0 10px; }
.z-cmd-plan.is-bad p { color: var(--text-2); }

/* ---------- welcome ---------- */
.z-welcome { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column;
  padding: calc(8px + var(--sa-t)) calc(var(--g) + var(--sa-r)) calc(16px + var(--sa-b)) calc(var(--g) + var(--sa-l)); opacity: 0; transition: opacity var(--t-sheet) var(--ease); }
.z-welcome.is-in { opacity: 1; }
.z-welcome-top { display: flex; justify-content: space-between; align-items: center; min-height: var(--tap); }
.z-steps { display: flex; gap: 6px; }
.z-steps i { width: 22px; height: 2px; border-radius: 1px; background: var(--rule-2); transition: background var(--t); }
.z-steps i.is-on { background: var(--text); }
.z-welcome-body { flex: 1; display: flex; flex-direction: column; justify-content: center; max-width: 520px; width: 100%; margin: 0 auto; }
.z-welcome-n { font-family: var(--f-display); font-weight: 200; font-size: clamp(4rem, 20vw, 6rem); letter-spacing: -0.04em; line-height: 1; color: var(--text-3); font-variant-numeric: tabular-nums; }
.z-welcome-t { margin: 16px 0 8px; font-family: var(--f-display); font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.z-welcome-s { margin: 0 0 32px; color: var(--text-2); font-size: var(--fs-body); line-height: 1.5; max-width: 34ch; }
.z-practice { border-radius: var(--radius); overflow: hidden; box-shadow: inset 0 0 0 var(--hair) var(--rule); }
.z-practice .z-row-face { background: var(--surface); }
.z-practice-ok { min-height: 22px; margin-top: 12px; font-size: var(--fs-meta); color: var(--text-2); }
.z-welcome-foot { max-width: 520px; width: 100%; margin: 0 auto; }
.z-ghost-hand { width: 28px; height: 28px; border-radius: 50%; background: var(--text); opacity: 0.0; position: absolute; top: 50%; margin-top: -14px; z-index: 3; pointer-events: none; }

/* ---------- auth (app.js sign-in markup, unchanged; styled here) ---------- */
.auth-wrap { position: fixed; inset: 0; z-index: 30; overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg); display: flex; align-items: center; justify-content: center;
  padding: calc(24px + var(--sa-t)) calc(var(--g) + var(--sa-r)) calc(24px + var(--sa-b)) calc(var(--g) + var(--sa-l)); }
.auth-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 12px; }
.auth-card::before { content: ""; display: block; width: 64px; height: 64px; margin: 0 0 18px; background: url("../assets/mark.svg") center / contain no-repeat; }
:root[data-theme="light"] .auth-card::before { filter: invert(1); }
.auth-logo { display: none; }
.auth-word { font-family: var(--f-display); font-size: var(--fs-label); font-weight: 600; letter-spacing: 0.28em; color: var(--text-2); }
.auth-sub { font-family: var(--f-display); font-size: var(--fs-lg); font-weight: 600; letter-spacing: -0.025em; margin: -6px 0 18px; }
.auth-card .who { display: flex; flex-direction: column; margin: 0 0 6px; border-radius: var(--radius); overflow: hidden; background: var(--fill); }
.auth-card .person { display: grid; grid-template-columns: 36px 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; min-height: 60px; padding: 10px 14px; position: relative; }
.auth-card .person + .person::before { content: ""; position: absolute; top: 0; left: 62px; right: 0; height: var(--hair); background: var(--rule); }
.auth-card .person .av { grid-row: 1 / 3; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); font-weight: 600; font-size: 0.9375rem; }
.auth-card .person b { font-weight: 600; font-size: var(--fs-body); }
.auth-card .person .em { font-size: var(--fs-mini); color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-card .person.sel .av { background: var(--accent); color: var(--on-accent); }
.auth-card .person.sel::after { content: ""; position: absolute; right: 16px; top: 50%; width: 7px; height: 12px; margin-top: -8px; border: solid var(--text); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.auth-card input[type="password"] { width: 100%; height: 52px; padding: 0 16px; border: 0; border-radius: 12px; background: var(--fill); color: var(--text); font-size: 1.0625rem; -webkit-appearance: none; appearance: none; }
.auth-card input::placeholder { color: var(--text-3); }
.auth-card button[type="submit"] { height: 52px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 1.0625rem; font-weight: 600; margin-top: 4px; }
.auth-card button[type="submit"]:disabled { opacity: 0.5; }
.auth-link { min-height: var(--tap); color: var(--text-2); font-size: var(--fs-meta); text-align: center; }
.auth-ok, .auth-err, .pw-hint { font-size: var(--fs-meta); line-height: 1.5; color: var(--text-2); margin: 0; }
.auth-err { color: var(--signal); }

/* ---------- misc ---------- */
.z-kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: var(--fs-meta); }
.z-kv dt { color: var(--text-3); }
.z-kv dd { margin: 0; color: var(--text); font-variant-numeric: tabular-nums; word-break: break-word; }
.z-keymap { columns: 2 220px; column-gap: 32px; padding: 0 calc(var(--g) + var(--sa-r)) 8px calc(var(--g) + var(--sa-l)); }
.z-keymap div { break-inside: avoid; display: flex; align-items: center; gap: 10px; min-height: 34px; font-size: var(--fs-meta); color: var(--text-2); }
.z-keymap kbd { min-width: 28px; text-align: center; color: var(--text); }
.z-keymap h3 { margin: 12px 0 4px; font-size: var(--fs-label); letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }
.z-icon-hero { width: 96px; height: 96px; border-radius: 22px; overflow: hidden; box-shadow: inset 0 0 0 var(--hair) var(--rule-2); }
.z-ptr { position: absolute; left: 0; right: 0; top: calc(var(--top) + var(--sa-t)); height: 0; display: flex; justify-content: center; pointer-events: none; z-index: 5; }
.z-ptr i { width: 22px; height: 22px; margin-top: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--text-2); opacity: 0; transform: scale(0.6); transition: opacity var(--t-fast); }
.z-ptr.is-armed i { box-shadow: inset 0 0 0 1.5px var(--text); }
.z-ptr.is-busy i { animation: z-breathe 1s ease-in-out infinite; opacity: 1; transform: none; }
.z-noselect { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.z-flash { animation: z-commit 200ms var(--ease); }

/* ---------- release pass: solid chrome, clear badges, visible focus, large text ---------- */
/* the top bar, tab bar, pill and strip are solid, so a scrolled row never shows through a label (and there is no seam on top) */
.z-top, .z-tabbar { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
.z-strip { background: var(--raise); -webkit-backdrop-filter: none; backdrop-filter: none; }
.z-toast { background: var(--raise-2); -webkit-backdrop-filter: none; backdrop-filter: none; }
.z0-selbar { background: var(--raise-2) !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* the screen moves down while the status strip shows; focus never lands under the top bar, the strip, the pill or the tabs */
.z-main { padding-top: calc(var(--top) + var(--sa-t) + var(--strip-h, 0px)); scroll-padding-top: calc(var(--top) + var(--sa-t) + var(--strip-h, 0px) + 8px);
  scroll-padding-bottom: calc(var(--tab) + var(--sa-b) + 16px); }
@media (min-width: 900px) { .z-main { scroll-padding-bottom: 24px; } }
/* skip link: first in the Tab order, shown only when it has focus */
.z-skip { position: fixed; z-index: 100; top: calc(var(--sa-t) + 4px); left: calc(var(--sa-l) + 8px); min-height: var(--tap); padding: 0 18px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: var(--fs-meta);
  transform: translate3d(0, calc(-100% - var(--sa-t) - 24px), 0); opacity: 0; pointer-events: none; }
.z-skip:focus, .z-skip:focus-visible { transform: none; opacity: 1; pointer-events: auto; outline: 2px solid var(--focus); outline-offset: 2px; }
/* tab badges sit off the icon's top-right corner, cut out of the bar colour; the queue tab shows a dot (the count is its hero) */
.z-badge { top: 1px; left: calc(50% + 9px); min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; line-height: 17px; font-size: 0.625rem; box-shadow: 0 0 0 2px var(--bg); }
.z-badge.is-dot { top: 5px; left: calc(50% + 12px); min-width: 0; width: 9px; height: 9px; padding: 0; border-radius: 50%; }
.z-tabbtn > span:not(.z-badge) { max-width: 100%; padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* text fields: a 2 px ring in the focus colour (3:1 and up on both themes) */
.z-input:focus-visible, .z-textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; }
/* keyboard hints are readable text, not ghosts, and only where a keyboard is: a fine pointer with hover, or a hardware key pressed
   (html.z-kb, set by ui/kit/keys.js). On a phone they are noise. The keyboard map itself always shows its keys. */
.z-btn kbd { opacity: 1; }
html:not(.z-kb) kbd:not(.z-keymap kbd):not(.zm-key kbd), html:not(.z-kb) .z-kbonly { display: none !important; }
/* hairlines inset the same on both sides */
.z-row + .z-row::before, .z-list > .z-item + .z-item::before { right: calc(var(--g) + var(--sa-r)); }
.z-cell + .z-cell::before { right: calc(var(--g) + var(--sa-r)); }
/* the row menu is a real, visible button on touch screens (never an invisible tap target) */
@media (hover: none) { .z-row-menu { opacity: 1; width: var(--tap); color: var(--text-3); } .zy-row.no-menu .z-row-trail { margin-right: var(--tap); } }
/* large text: the trailing word and time drop under the title instead of squeezing it to a letter */
.z-row-face { flex-wrap: wrap; row-gap: 4px; }
.z-row-text { flex: 1 1 11ch; }
.z-row-trail { max-width: 100%; }
html.z-bigtext .z-row-meta { white-space: normal; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
html.z-bigtext .z-row-trail { flex: 1 1 100%; justify-content: flex-start; padding-left: 40px; }
.z-cell-v, .z-cell-t, .z-kv dd, .z-p strong, .z-p b { overflow-wrap: anywhere; min-width: 0; }
/* the sheet header keeps clear of a notch in landscape */
.z-sheet-head { padding-right: calc(8px + var(--sa-r)); }
.z-sheet-body { padding-right: var(--sa-r); }

/* ---------- reduced motion: everything instant ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }

/* very narrow screens (zoomed text, 320 px phones): the connection time gives way to the title; the dot and the words for
   VoiceOver stay */
@media (max-width: 359px) { .z-top.has-title .z-status .z-mono { display: none; } }

/* verify fixes 2026-11-05: Done never wraps; rail scrolls on short screens; waiting primary has solid colors, not opacity */
.zi-primary .z-btn { white-space: nowrap; min-width: 4.5rem; }
.zi-primary .z-btn.is-waiting { opacity: 1; background: var(--raise-2, #1c1c1e); color: var(--text-2); }

/* =====================================================================================================================
   POLISH LAYER (11/5). Jacob: "Everything runs together. Hard to tell what is what. Everything is still plain."
   Structure: every list is a grouped card on a lifted surface; every item type has its own colour tile; every band has its own colour;
   status is shown as tinted tiles and pills, never as bare grey text. Same near-black base, same one white action pill.
   Rules are prefixed :root so they win over the per-screen styles that screens inject later.
   ===================================================================================================================== */
:root {
  --k-date: #ffb340; --k-question: #5aaaff; --k-draft: #a98bff; --k-decision: #3fdc98; --k-check: #35d3e6;
  --k-task: #93a6c9; --k-message: #ff7eb8; --k-request: #c5cad6; --k-answer: #3fdc98; --k-system: #ff6259; --k-deal: #ffb340;
  --c-now: #ff8a3d; --c-today: #5aaaff; --c-later: #8f95a6; --c-good: #3fdc98; --c-warn: #ffb340; --c-bad: #ff5f55;
  --card: #0f0f14; --card-2: #16161d; --card-3: #1e1e27;
  --card-line: rgba(255, 255, 255, 0.075); --card-hi: rgba(255, 255, 255, 0.15);
  --card-r: 22px; --inset: 12px;
  --glow-a: rgba(80, 120, 255, 0.17); --glow-b: rgba(167, 139, 250, 0.10);
}
:root[data-theme="light"] {
  --card: #f4f4f8; --card-2: #e9e9f0; --card-3: #dedee8; --card-line: rgba(0, 0, 0, 0.07); --card-hi: rgba(0, 0, 0, 0.14);
  --glow-a: rgba(80, 120, 255, 0.10); --glow-b: rgba(167, 139, 250, 0.06);
  --k-date: #c77700; --k-question: #0a6fd6; --k-draft: #6b45e0; --k-decision: #0a9a5c; --k-check: #0a8fa3; --k-task: #556a91; --k-message: #d4337f;
  --k-request: #596070; --k-answer: #0a9a5c; --k-system: #d70015; --k-deal: #c77700; --c-now: #d9560a; --c-today: #0a6fd6; --c-later: #6b7183;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --card: #f4f4f8; --card-2: #e9e9f0; --card-3: #dedee8; --card-line: rgba(0, 0, 0, 0.07); --card-hi: rgba(0, 0, 0, 0.14);
    --glow-a: rgba(80, 120, 255, 0.10); --glow-b: rgba(167, 139, 250, 0.06);
    --k-date: #c77700; --k-question: #0a6fd6; --k-draft: #6b45e0; --k-decision: #0a9a5c; --k-check: #0a8fa3; --k-task: #556a91; --k-message: #d4337f;
    --k-request: #596070; --k-answer: #0a9a5c; --k-system: #d70015; --k-deal: #c77700; --c-now: #d9560a; --c-today: #0a6fd6; --c-later: #6b7183;
  }
}

/* a lifted page, not a void: two soft colour pools behind everything */
:root .z-app {
  background:
    radial-gradient(110% 46% at 88% -6%, var(--glow-a), transparent 70%),
    radial-gradient(90% 40% at 0% 2%, var(--glow-b), transparent 70%),
    var(--bg);
}

/* ---------- kinds: one colour and one glyph per type of thing ---------- */
:root .z-row[data-kind="date"], :root .z-row[data-kind="deal"] { --k: var(--k-date); }
:root .z-row[data-kind="question"] { --k: var(--k-question); }
:root .z-row[data-kind="draft"] { --k: var(--k-draft); }
:root .z-row[data-kind="decision"] { --k: var(--k-decision); }
:root .z-row[data-kind="check"] { --k: var(--k-check); }
:root .z-row[data-kind="task"] { --k: var(--k-task); }
:root .z-row[data-kind="message"] { --k: var(--k-message); }
:root .z-row[data-kind="request"] { --k: var(--k-request); }
:root .z-row[data-kind="answer"] { --k: var(--k-answer); }
:root .z-row[data-kind="system"], :root .z-row.is-signal { --k: var(--k-system); }

/* ---------- grouped cards ---------- */
:root .z-main .z-view ul.z-list {
  margin: 0 calc(var(--inset) + var(--sa-r)) 6px calc(var(--inset) + var(--sa-l));
  border-radius: var(--card-r); overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0) 38%), var(--card);
  box-shadow: inset 0 0 0 1px var(--card-line), 0 10px 30px rgba(0, 0, 0, 0.35);
}
:root[data-theme="light"] .z-main .z-view ul.z-list { background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); }
:root .z-view .z-row-more ul.z-list, :root .z-sheet ul.z-list { margin: 0; border-radius: 0; box-shadow: none; background: none; }
:root .z-row + .z-row::before, :root .z-list > .z-item + .z-item::before { left: 68px; right: 14px; background: var(--card-line); }
:root .z-row.no-glyph + .z-row::before { left: 16px; }

:root .z-row-face { min-height: 66px; padding: 12px 14px 12px 14px; gap: 13px; }
:root .z-row.no-glyph .z-row-face { padding-left: 16px; }
:root .z-row-glyph {
  width: 40px; height: 40px; border-radius: 13px; background: var(--fill); color: var(--k, var(--text-2));
  box-shadow: inset 0 0 0 1px var(--card-line);
}
:root .z-row[data-kind] .z-row-glyph, :root .z-row.is-signal .z-row-glyph {
  background: color-mix(in srgb, var(--k) 17%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k) 26%, transparent);
}
:root .z-row-glyph svg { width: 21px; height: 21px; }
:root .z-row[data-unseen] .z-row-glyph::after { top: -3px; right: -3px; width: 11px; height: 11px; background: var(--c-now); box-shadow: 0 0 0 2.5px var(--card); }
:root .z-row-title { font-weight: 600; letter-spacing: -0.012em; }
:root .z-row-meta { font-size: 0.8125rem; color: var(--text-2); }
:root .z0 .z-row .z-row-trail { max-width: 36%; }
:root .z-row-trail > span, :root .z0 .z-row .z-row-trail span {
  padding: 4px 10px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: 0.75rem; font-weight: 600; line-height: 1.2;
}
:root .z-row[data-kind="date"] .z-row-trail > span { background: color-mix(in srgb, var(--k-date) 17%, transparent); color: var(--k-date); }
:root .z-row.is-signal .z-row-trail > span { background: color-mix(in srgb, var(--c-bad) 18%, transparent); color: var(--c-bad); }
:root .z-row.is-held .z-row-glyph { opacity: 0.6; }
:root .z-row.is-pressed .z-row-face, :root .z-row-face:active { background: var(--card-2); }
:root .z0 .z-row.is-current .z-row-face { background: var(--card-2); }
:root .z0 .z-row.is-current .z-row-face::before { display: none; }

/* the open row is the featured decision: tinted by its kind, bigger type */
:root .z0 .z0-openrow { background: linear-gradient(145deg, color-mix(in srgb, var(--k, #fff) 15%, transparent), transparent 62%); }
:root .z0 .z0-openrow .z-row-face { padding: 18px 16px 8px 16px; align-items: flex-start; }
:root .z0 .z0-openrow .z-row-glyph { color: var(--k, var(--text)); margin-top: 0; }
:root .z0 .z0-openrow .z-row-title { font-size: 1.4375rem; font-weight: 650; letter-spacing: -0.024em; }
:root .z0 .z0-openrow .z-row-more { padding: 0 16px 18px 69px; }
:root .z0 .z0-openrow + .z-row::before { left: 68px; }

/* ---------- headers: a colour dot, a name, a count in a pill ---------- */
:root .z-label {
  align-items: center; gap: 9px; padding: 22px calc(var(--inset) + var(--sa-r) + 6px) 10px calc(var(--inset) + var(--sa-l) + 6px);
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; color: var(--text);
}
:root .z-label .z-tab { padding: 2px 9px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-size: 0.6875rem; letter-spacing: 0.02em; font-weight: 700; }
:root .z0-band .z-label { padding-top: 22px; }
:root .z0-band .z-label span:first-child::before {
  content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 9px; vertical-align: 1px;
  background: var(--c-later); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-later) 20%, transparent);
}
:root .z0-band[data-b="now"] .z-label span:first-child { color: var(--c-now); }
:root .z0-band[data-b="now"] .z-label span:first-child::before { background: var(--c-now); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-now) 22%, transparent); }
:root .z0-band[data-b="today"] .z-label span:first-child { color: var(--c-today); }
:root .z0-band[data-b="today"] .z-label span:first-child::before { background: var(--c-today); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c-today) 22%, transparent); }
:root .z0-band[data-b="later"] .z-label span:first-child { color: var(--text-2); }

/* ---------- Zero hero: one card with the count, the bands as a bar, and the status tiles ---------- */
:root .z0-hero {
  margin: 8px calc(var(--inset) + var(--sa-r)) 4px calc(var(--inset) + var(--sa-l)); padding: 16px 18px 14px; border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.015) 55%), var(--card);
  box-shadow: inset 0 0 0 1px var(--card-hi), 0 18px 48px rgba(0, 0, 0, 0.45);
}
:root[data-theme="light"] .z0-hero { background: var(--card); box-shadow: inset 0 0 0 1px var(--card-hi); }
:root .z0-hero-top { margin-bottom: 4px; }
:root .z0 h1.z0-eyebrow { font-size: 0.75rem; letter-spacing: 0.24em; }
:root .z0-n { font-weight: 150; }
:root .z0-meter { display: flex; grid-column: 1 / -1; grid-row: 3; gap: 4px; height: 8px; margin: 14px 0 4px; }
:root .z0-meter i { flex: 1 1 0; min-width: 0; border-radius: 4px; background: var(--c-later); }
:root .z0-meter i[data-b="now"] { background: var(--c-now); }
:root .z0-meter i[data-b="today"] { background: var(--c-today); }
:root .z0-meter.is-zero { visibility: hidden; }   /* keeps its room while the first read is out, so nothing moves when the count arrives */
:root .z0-legend { padding-top: 0; }
:root .z0-legend::before { display: none; }
:root .z0-leg-n { font-weight: 500; font-size: 1.75rem; }
:root .z0-leg[data-b="now"] .z0-leg-n { color: var(--c-now); }
:root .z0-leg[data-b="today"] .z0-leg-n { color: var(--c-today); }
:root .z0-leg[data-b="later"] .z0-leg-n { color: var(--text); }
:root .z0-leg-l { color: var(--text-2); }
:root .z0-since { margin-top: 12px; min-height: 46px; padding: 0 14px; border-radius: 14px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--card-line); width: 100%; }
:root .z0-since::before { display: none; }
:root .z0-since.has-new .z0-since-dot { background: var(--c-now); }
:root .z0-tele { gap: 8px; margin-top: 10px; }
:root .z0-tele::before { display: none; }
:root .z0-cell { padding: 12px 12px 10px; border-radius: 16px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--card-line); min-height: 64px; justify-content: flex-start; }
:root .z0-cell + .z0-cell { padding-left: 12px; }
:root .z0-cell + .z0-cell::before { display: none; }
:root .z0-cell-l { color: var(--text-2); }
:root .z0-sys[data-word="NO-GO"] { background: color-mix(in srgb, var(--c-bad) 15%, var(--card-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-bad) 40%, transparent); }
:root .z0-sys[data-word="HOLD"] { background: color-mix(in srgb, var(--c-warn) 14%, var(--card-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-warn) 38%, transparent); }
:root .z0-sys[data-word="GO"] { background: color-mix(in srgb, var(--c-good) 13%, var(--card-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-good) 36%, transparent); }
:root .z0-sys[data-word="GO"] .z0-cell-v { color: var(--c-good); }
:root .z0-sys[data-word="HOLD"] .z0-cell-v { color: var(--c-warn); }

/* ---------- chips, buttons ---------- */
:root .z0-chips { background: linear-gradient(var(--bg) 55%, transparent); padding-top: 6px; }
:root .z-chip { min-height: 36px; padding: 0 15px; background: var(--card-2); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--card-line); font-weight: 600; }
:root .z-chip .z-tab { opacity: 0.8; }
:root .z-chip[aria-pressed="true"], :root .z-chip[aria-checked="true"], :root .z-chip[aria-selected="true"] { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 18px rgba(255, 255, 255, 0.14); }
:root .z-btn--primary { box-shadow: 0 8px 22px rgba(255, 255, 255, 0.13); font-weight: 650; }
:root .z-btn--ghost { background: var(--card-2); box-shadow: inset 0 0 0 1px var(--card-line); padding: 0 16px; font-weight: 600; }
:root .z-btn--quiet { font-weight: 600; }

/* ---------- navigation ---------- */
@media (max-width: 899px) {
  :root { --tab: 74px; }
  :root .z-tabbar {
    left: calc(12px + var(--sa-l)); right: calc(12px + var(--sa-r)); bottom: calc(8px + var(--sa-b)); height: 62px; padding: 6px; border-radius: 26px;
    background: rgba(22, 22, 30, 0.80); -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 16px 44px rgba(0, 0, 0, 0.6);
  }
  :root[data-theme="light"] .z-tabbar { background: rgba(250, 250, 255, 0.82); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1), 0 12px 34px rgba(0, 0, 0, 0.18); }
  :root .z-tabbar::before { display: none; }
  :root .z-tabbtn { border-radius: 20px; gap: 2px; font-size: 0.6875rem; font-weight: 600; }
  :root .z-tabbtn svg { width: 23px; height: 23px; }
  :root .z-tabbtn[aria-current="page"] { background: var(--fill-2); color: var(--text); }
  :root .z-tabbtn[aria-current="page"] svg { color: var(--c-now); }
  :root .z-badge { top: 2px; left: calc(50% + 6px); background: var(--c-now); color: #000; box-shadow: 0 0 0 2px rgba(22, 22, 30, 0.9); }
  :root .z0-selbar { bottom: calc(var(--tab) + var(--sa-b) + 4px); }
}
:root .z-top { background: linear-gradient(var(--glass), var(--glass)); }
:root .z-status { background: var(--fill); padding: 0 12px; min-height: 34px; margin: 5px 0; }

/* ---------- polish, part 2: stronger surfaces, the featured row, the item sheet, every other screen ---------- */
:root { --card: #181821; --card-2: #212130; --card-3: #2a2a3a; --card-line: rgba(255, 255, 255, 0.11); }
:root[data-theme="light"] { --card: #f4f4f8; --card-2: #e9e9f0; --card-3: #dedee8; --card-line: rgba(0, 0, 0, 0.07); }

/* featured row: glyph and the time pill share the top line, the title gets the full width under them */
:root .z0 .z0-openrow .z-row-face { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; row-gap: 14px; align-items: center; padding: 16px 16px 6px; }
:root .z0 .z0-openrow .z-row-glyph { grid-area: 1 / 1; }
:root .z0 .z0-openrow .z-row-trail { grid-area: 1 / 3; max-width: none; }
:root .z0 .z0-openrow .z-row-text { grid-area: 2 / 1 / 3 / 4; }
:root .z0 .z0-openrow .z-row-title { -webkit-line-clamp: 4; }
:root .z0 .z0-openrow .z-row-more { padding: 0 16px 16px; }
:root .z0-acts { gap: 8px; }
:root .z0-acts .z0-primary { flex: 1 1 100%; width: 100%; min-height: 52px; font-weight: 650; }
:root .z0-acts .z-btn:not(.z0-primary):not(.z-btn--icon) { flex: 1 1 0; background: var(--card-3); color: var(--text); font-weight: 600; }
:root .z0-explain { padding: 0 2px; }

/* page headings */
:root .z-head { padding-left: calc(var(--inset) + var(--sa-l) + 6px); padding-right: calc(var(--inset) + var(--sa-r) + 6px); }
:root .z-title { font-weight: 700; letter-spacing: -0.03em; }
:root .z-sub { color: var(--text-2); }

/* hero blocks on every screen share the Zero card look */
:root .zd-hero, :root .zt-hero, :root .zk-hero, :root .zy-hero, :root .zm-who, :root .zp-nc {
  margin: 8px calc(var(--inset) + var(--sa-r)) 6px calc(var(--inset) + var(--sa-l)); padding: 18px; border-radius: 26px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.012) 55%), var(--card);
  box-shadow: inset 0 0 0 1px var(--card-hi), 0 16px 44px rgba(0, 0, 0, 0.4);
}
:root[data-theme="light"] .zd-hero, :root[data-theme="light"] .zt-hero, :root[data-theme="light"] .zk-hero, :root[data-theme="light"] .zy-hero,
:root[data-theme="light"] .zm-who, :root[data-theme="light"] .zp-nc { background: var(--card); box-shadow: inset 0 0 0 1px var(--card-hi); }
:root .zd-stat, :root .zt-stat, :root .zk-stat, :root .zy-stat, :root .zm-stat {
  padding: 10px 12px; border-radius: 14px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--card-line);
}
:root .zd-asof, :root .zt-asof, :root .zk-asof, :root .zy-fresh, :root .zm-asof, :root .zc-asof { padding-left: calc(var(--inset) + var(--sa-l) + 6px); padding-right: calc(var(--inset) + var(--sa-r) + 6px); }

/* deals: the date rail as tiles, deal rows as cards */
:root .zd-rail { gap: 8px; padding: 4px calc(var(--inset) + var(--sa-r)) 8px calc(var(--inset) + var(--sa-l)); }
:root .zd-day { border-radius: 16px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--card-line); }
:root .zd-day.has-n { background: color-mix(in srgb, var(--k-deal) 16%, var(--card-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-deal) 40%, transparent); }
:root .zd-day.is-today { box-shadow: inset 0 0 0 2px var(--text); }
:root .zd-list, :root .zd-group {
  margin: 0 calc(var(--inset) + var(--sa-r)) 8px calc(var(--inset) + var(--sa-l)); padding: 0; list-style: none; border-radius: var(--card-r); overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 38%), var(--card); box-shadow: inset 0 0 0 1px var(--card-line), 0 10px 30px rgba(0, 0, 0, 0.35);
}
:root .zd-deal + .zd-deal, :root .zd-date + .zd-date { box-shadow: 0 -1px 0 var(--card-line); }
:root .zd-deal-face, :root .zd-date-face, :root .zd-watch-face { padding: 16px; }
:root .zd-name { font-weight: 650; }
:root .zd-tag { padding: 3px 9px; border-radius: 999px; background: color-mix(in srgb, var(--k-deal) 17%, transparent); color: var(--k-deal); font-weight: 700; }
:root .zd-cal { border-radius: 12px; background: color-mix(in srgb, var(--k-deal) 16%, transparent); color: var(--k-deal); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-deal) 30%, transparent); }
:root .zd-segs > * { border-radius: 4px; }

/* tasks and talk: boards, tabs and segmented controls */
:root .zt-col { margin-bottom: 4px; }
:root .zt-colhead { padding: 18px calc(var(--inset) + var(--sa-r) + 6px) 10px calc(var(--inset) + var(--sa-l) + 6px); font-weight: 700; }
:root .zt-n { padding: 2px 9px; border-radius: 999px; background: var(--fill); color: var(--text-2); font-weight: 700; font-size: 0.6875rem; }
:root .zt-bar { height: 8px; gap: 4px; border-radius: 4px; }
:root .zt-bar i { border-radius: 4px; }
:root .zt-addbox { border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); }
:root .zt-emptycol, :root .zk-hint, :root .zt-hint { margin: 0 calc(var(--inset) + var(--sa-r)) 6px calc(var(--inset) + var(--sa-l)); padding: 18px; border-radius: 18px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); color: var(--text-2); text-align: center; }
:root .z-seg { padding: 4px; border-radius: 16px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--card-line); }
:root .z-seg > * { border-radius: 12px; font-weight: 600; }
:root .z-seg [aria-selected="true"], :root .z-seg [aria-checked="true"], :root .z-seg [aria-pressed="true"], :root .z-seg .is-on { background: var(--card-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--card-hi), 0 4px 12px rgba(0, 0, 0, 0.35); }
:root .zk-pane, :root .zk-split { padding-left: 0; padding-right: 0; }

/* systems and portfolio */
:root .zy-word { padding: 6px 16px; border-radius: 999px; font-weight: 800; letter-spacing: 0.14em; }
:root .zy-verdict[data-word="NO-GO"] .zy-word, :root .zy-word[data-word="NO-GO"] { background: color-mix(in srgb, var(--c-bad) 18%, transparent); color: var(--c-bad); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-bad) 45%, transparent); }
:root .zy-word[data-word="GO"] { background: color-mix(in srgb, var(--c-good) 16%, transparent); color: var(--c-good); }
:root .zy-word[data-word="HOLD"] { background: color-mix(in srgb, var(--c-warn) 16%, transparent); color: var(--c-warn); }
:root .zp-switch { margin-left: calc(var(--inset) + var(--sa-l)); margin-right: calc(var(--inset) + var(--sa-r)); }
:root .zp-sec .z-label { padding-top: 20px; }

/* More: grouped settings-style cards */
:root .z-group { margin: 0 calc(var(--inset) + var(--sa-r)) 8px calc(var(--inset) + var(--sa-l)); border-radius: var(--card-r); overflow: hidden; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); }
:root .z-cell { min-height: 58px; padding-left: 16px; padding-right: 14px; }
:root .zm-ring { box-shadow: 0 0 0 2px var(--c-today), 0 0 24px color-mix(in srgb, var(--c-today) 40%, transparent); }

/* item sheet */
:root .zi-frame { padding-left: calc(var(--inset) + var(--sa-l)); padding-right: calc(var(--inset) + var(--sa-r)); }
:root .zi-eyebrow { gap: 12px; min-height: 40px; }
:root .zi-kind { width: 40px; height: 40px; justify-content: center; border-radius: 13px; color: var(--k-task); background: color-mix(in srgb, var(--k-task) 17%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-task) 28%, transparent); }
:root .zi-kind svg { width: 21px; height: 21px; }
:root .zi-eyebrow[data-kind="date"] .zi-kind, :root .zi-eyebrow[data-kind="deal"] .zi-kind { color: var(--k-date); background: color-mix(in srgb, var(--k-date) 17%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-date) 28%, transparent); }
:root .zi-eyebrow[data-kind="question"] .zi-kind { color: var(--k-question); background: color-mix(in srgb, var(--k-question) 17%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-question) 28%, transparent); }
:root .zi-eyebrow[data-kind="draft"] .zi-kind { color: var(--k-draft); background: color-mix(in srgb, var(--k-draft) 17%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-draft) 28%, transparent); }
:root .zi-eyebrow[data-kind="decision"] .zi-kind, :root .zi-eyebrow[data-kind="answer"] .zi-kind { color: var(--k-decision); background: color-mix(in srgb, var(--k-decision) 17%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-decision) 28%, transparent); }
:root .zi-eyebrow[data-kind="check"] .zi-kind { color: var(--k-check); background: color-mix(in srgb, var(--k-check) 17%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-check) 28%, transparent); }
:root .zi-eyebrow[data-kind="message"] .zi-kind { color: var(--k-message); background: color-mix(in srgb, var(--k-message) 17%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-message) 28%, transparent); }
:root .zi-eyebrow[data-kind="system"] .zi-kind { color: var(--k-system); background: color-mix(in srgb, var(--k-system) 17%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--k-system) 28%, transparent); }
:root .zi-title { font-weight: 700; font-size: 1.875rem; letter-spacing: -0.03em; }
:root .zi-band { height: 26px; padding: 0 12px; background: var(--fill); color: var(--c-later); box-shadow: none; font-weight: 800; }
:root .zi-band[data-band="now"] { background: color-mix(in srgb, var(--c-now) 18%, transparent); color: var(--c-now); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-now) 40%, transparent); }
:root .zi-band[data-band="today"] { background: color-mix(in srgb, var(--c-today) 18%, transparent); color: var(--c-today); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-today) 40%, transparent); }
:root .zi-reason { color: var(--text-2); }
:root .zi-kv, :root .zi-panel, :root .zi-callout, :root .zi-tlwrap, :root .zi-exin { padding-left: 16px; padding-right: 16px; border-radius: 20px; background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); }
:root .zi-kv { margin-top: 16px; padding-top: 2px; padding-bottom: 2px; }
:root .zi-panel { padding-top: 16px; padding-bottom: 16px; }
:root .zi-callout { padding-top: 14px; padding-bottom: 14px; }
:root .zi-l { margin: 24px 4px 10px; color: var(--text); font-weight: 700; }
:root .zi-nc { background: var(--card-2); outline: none; border-radius: 14px; }
:root .zi-verbs { gap: 8px; margin: 6px 0 0; }
:root .zi-verbs > * { min-height: 62px; border-radius: 18px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--card-line); font-weight: 600; }
:root .zi-verbs-more::before { display: none; }
:root .zi-primary .z-btn { min-height: 54px; }

/* ---------- polish, part 3: fixes after the first look ---------- */
:root .z-go { background: var(--fill); border-radius: 999px; padding: 0 12px; min-height: 34px; margin: 5px 2px 5px 0; }
:root .z-go[data-word="NO-GO"] { background: color-mix(in srgb, var(--c-bad) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-bad) 40%, transparent); }
:root .z-go[data-word="NO-GO"] span { color: var(--c-bad); }
:root .z-go[data-word="GO"] { background: color-mix(in srgb, var(--c-good) 16%, transparent); }
:root .z-go[data-word="GO"] span { color: var(--c-good); }
:root .z-go[data-word="HOLD"] { background: color-mix(in srgb, var(--c-warn) 16%, transparent); }
:root .z-go[data-word="HOLD"] span { color: var(--c-warn); }

:root .zm-read { gap: 8px; border: 0; margin-left: calc(var(--inset) + var(--sa-l)); margin-right: calc(var(--inset) + var(--sa-r)); }
:root .zm-stat, :root .zm-stat:first-child { min-height: 92px; padding: 14px 12px 12px; border-radius: 16px; }
:root .zm-stat + .zm-stat::before { display: none; }
:root .zm-stat i { font-weight: 300; }

:root .zy-hero { padding: 18px; }
:root .zy-stats { gap: 8px; border: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 16px; }
:root .zy-stat, :root .zy-stat:first-child { padding: 12px 14px; min-height: 66px; }
:root .zy-stat + .zy-stat::before { display: none; }
:root .zy-stat b { font-weight: 300; }
:root .zy-stat.is-signal { background: color-mix(in srgb, var(--c-bad) 14%, var(--card-2)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c-bad) 38%, transparent); }
:root .zy-bar { padding: 16px 0 0; }
:root .zy-fresh { padding-top: 14px; }

:root .zd-rail { grid-auto-columns: 54px; gap: 8px; }
:root .zd-day { min-height: 100px; padding: 24px 0 8px; border-radius: 16px; }
:root .zd-day::before { display: none; }
:root .zd-zl { left: 6px; top: 6px; }

/* ---------- polish, part 4: rows sit on the card, stat tiles keep their padding ---------- */
:root .z-main .z-view .z-row-face { background: var(--card); }
:root .z0 .z0-openrow .z-row-face { background: transparent; }
:root .z-main .z-view .z-row.is-pressed .z-row-face, :root .z-main .z-view .z-row-face:active, :root .z0 .z-row.is-current .z-row-face { background: var(--card-2); }
:root .zt-stats, :root .zk-stats { gap: 6px; padding-bottom: 0; }
:root .zt-stat, :root .zk-stat, :root .zt-stat:last-child, :root .zk-stat:last-child { align-items: center; border-bottom: 0; padding: 9px 14px; }

/* ---------- polish, part 5: Belle's home, expanded rows, sheets ---------- */
:root .z-row-more { background: transparent; }
:root .zb-hero {
  margin: 8px calc(var(--inset) + var(--sa-r)) 6px calc(var(--inset) + var(--sa-l)); padding: 16px 18px 14px; border-radius: 28px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.015) 55%), var(--card);
  box-shadow: inset 0 0 0 1px var(--card-hi), 0 18px 48px rgba(0, 0, 0, 0.45);
}
:root[data-theme="light"] .zb-hero { background: var(--card); box-shadow: inset 0 0 0 1px var(--card-hi); }
:root .zb-stats { gap: 8px; border: 0; margin-top: 14px; }
:root .zb-stats::before, :root .zb-stat + .zb-stat::before { display: none; }
:root .zb-stat, :root .zb-stat:first-child { padding: 10px 12px; border-radius: 14px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--card-line); min-height: 64px; }
:root .zb-since { margin-top: 10px; min-height: 46px; padding: 0 14px; border-radius: 14px; background: var(--card-2); box-shadow: inset 0 0 0 1px var(--card-line); }
:root .zb-since::before { display: none; }
:root .zb-fresh { padding: 0 4px; }
:root .zb-asks .z-btn { background: var(--card-3); box-shadow: inset 0 0 0 1px var(--card-hi); font-weight: 600; }
:root .zb-n { font-weight: 150; }

/* command sheet: the verbs as one grouped card with arrow tiles */
:root .z-sheet .z-list:not(.z-flat) { border-radius: 0; }
:root .z-sheet .z-list .z-row-face { background: transparent; }

/* ---------- polish, part 6: phone row width, Belle's tiles ---------- */
@media (max-width: 899px) {
  /* the three-dot menu stays reachable by keyboard and VoiceOver but no longer takes a column from the title */
  :root .z-row-face > .z-row-menu { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; pointer-events: none; opacity: 0; }
  :root .z-row-face > .z-row-menu:focus-visible { opacity: 1; pointer-events: auto; background: var(--card-3); }
  :root .zb-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

:root .z0-leg { min-height: 58px; }

/* wide screens: the band bar sits on its own line above the status tiles */
@media (min-width: 900px) {
  :root .z0-meter { grid-row: 3; }
  :root .z0-tele { grid-row: 4; }
  :root .z0-hero { margin-left: 24px; margin-right: 24px; }
  :root .z0-cell { min-height: 56px; }
}

/* ---------- detail layer: facts under every title, queue-at-a-glance, header notes ---------- */
:root [data-kind="date"], :root [data-kind="deal"] { --k: var(--k-date); }
:root [data-kind="question"] { --k: var(--k-question); }
:root [data-kind="draft"] { --k: var(--k-draft); }
:root [data-kind="decision"], :root [data-kind="answer"] { --k: var(--k-decision); }
:root [data-kind="check"] { --k: var(--k-check); }
:root [data-kind="task"] { --k: var(--k-task); }
:root [data-kind="message"] { --k: var(--k-message); }
:root [data-kind="request"] { --k: var(--k-request); }
:root [data-kind="system"] { --k: var(--k-system); }

:root .z0-facts { display: flex; align-items: center; gap: 8px; margin-top: 7px; min-width: 0; font-size: 0.6875rem; font-weight: 600; color: var(--text-3); white-space: nowrap; overflow: hidden; }
:root .z0-av { flex: none; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 0.5625rem; font-weight: 800; letter-spacing: 0;
  background: var(--card-3); color: var(--text-2); box-shadow: inset 0 0 0 1px var(--card-hi); }
:root .z0-av[data-o="tiger"] { background: color-mix(in srgb, var(--k-question) 24%, var(--card-3)); color: var(--k-question); }
:root .z0-av[data-o="belle"] { background: color-mix(in srgb, var(--k-message) 24%, var(--card-3)); color: var(--k-message); }
:root .z0-av[data-o="jacob"] { background: color-mix(in srgb, var(--text) 18%, var(--card-3)); color: var(--text); }
:root .z0-av[data-o="system"] { background: color-mix(in srgb, var(--k-system) 22%, var(--card-3)); color: var(--k-system); }
:root .z0-ent { flex: none; padding: 2px 7px; border-radius: 6px; background: var(--fill); color: var(--text-2); letter-spacing: 0.02em; }
:root .z0-ent[data-ent="Linden Park"] { background: color-mix(in srgb, var(--k-check) 16%, transparent); color: var(--k-check); }
:root .z0-ent[data-ent="Oak Hill"] { background: color-mix(in srgb, var(--k-date) 16%, transparent); color: var(--k-date); }
:root .z0-ent[data-ent="HOA"] { background: color-mix(in srgb, var(--k-draft) 18%, transparent); color: var(--k-draft); }
:root .z0-src { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
:root .z0-age { flex: none; margin-left: auto; width: 34px; height: 4px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
:root .z0-age i { display: block; height: 100%; border-radius: 2px; background: var(--c-good); }
:root .z0-age[data-lvl="mid"] i { background: var(--c-warn); }
:root .z0-age[data-lvl="hi"] i { background: var(--c-bad); }

:root .z-label .z-label-r { margin-left: auto; font-size: 0.6875rem; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--text-3); font-variant-numeric: tabular-nums; }

:root .z0-mix {
  display: block; min-height: 58px;
  margin: 10px calc(var(--inset) + var(--sa-r)) 6px calc(var(--inset) + var(--sa-l)); padding: 16px 18px 18px; border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 40%), var(--card); box-shadow: inset 0 0 0 1px var(--card-line), 0 10px 30px rgba(0, 0, 0, 0.35);
}
:root .z0-mix.is-empty { visibility: hidden; }
:root .z0-mix-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }
:root .z0-mix-h .z-tab { letter-spacing: 0; text-transform: none; font-weight: 600; color: var(--text-3); }
:root .z0-stack { display: flex; gap: 3px; height: 12px; }
:root .z0-stack i { min-width: 6px; border-radius: 4px; background: var(--k, var(--c-later)); }
:root .z0-keys { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 14px; }
:root .z0-keys li { display: inline-flex; align-items: center; gap: 6px; font-size: 0.75rem; color: var(--text-2); }
:root .z0-keys li i { width: 8px; height: 8px; border-radius: 3px; background: var(--k, var(--c-later)); }
:root .z0-keys li b { font-weight: 700; color: var(--text); }
:root .z0-bars { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; height: 112px; align-items: end; }
:root .z0-bar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; min-width: 0; }
:root .z0-bar b { font-size: 0.8125rem; font-weight: 700; color: var(--text); }
:root .z0-bar[data-zero] b { color: var(--text-3); font-weight: 500; }
:root .z0-bar i { display: block; width: 100%; min-height: 4px; border-radius: 6px 6px 3px 3px; background: var(--c-good); max-height: 74px; }
:root .z0-bar[data-lvl="mid"] i { background: var(--c-warn); }
:root .z0-bar[data-lvl="hi"] i { background: var(--c-bad); }
:root .z0-bar[data-zero] i { background: var(--fill-2); }
:root .z0-bar span { font-size: 0.625rem; font-weight: 600; color: var(--text-3); white-space: nowrap; }
@media (min-width: 900px) { :root .z0-mix { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; min-height: 0; margin-left: 24px; margin-right: 24px; } }

:root .z0-mix-t { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 26px; text-align: left; color: var(--text); }
:root .z0-mix-tl { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }
:root .z0-mix-ts { margin-left: auto; font-size: 0.75rem; color: var(--text-3); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root .z0-mix-chev { width: 16px; height: 16px; flex: none; color: var(--text-3); transition: transform var(--t-fast) var(--ease); }
:root .z0-mix.is-open .z0-mix-chev { transform: rotate(90deg); }
:root .z0-mix-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 16px; }
:root .z0-mix:not(.is-open) .z0-mix-body { display: none; }
@media (min-width: 900px) {
  :root .z0-mix-t { pointer-events: none; }
  :root .z0-mix-chev { display: none; }
  :root .z0-mix:not(.is-open) .z0-mix-body, :root .z0-mix .z0-mix-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; }
  :root .z0-mix { min-height: 0; }
}

/* =====================================================================================================================
   ROUND 3 (11/5, after Grok's critique and Jacob's "make it look like a large company's product"): color means state only,
   flatter surfaces, tighter radii, two-line rows on a phone, a one-line status, and the facts and charts where there is room.
   ===================================================================================================================== */
:root { --card-r: 16px; --inset: 12px; --glow-a: rgba(80, 120, 255, 0.06); --glow-b: rgba(167, 139, 250, 0.03); }
:root .z-main .z-view ul.z-list, :root .zd-list, :root .zd-group { background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); border-radius: var(--card-r); }
:root .z0-hero, :root .zd-hero, :root .zt-hero, :root .zk-hero, :root .zy-hero, :root .zm-who, :root .zb-hero { background: var(--card); box-shadow: inset 0 0 0 1px var(--card-line); border-radius: 20px; }
:root .z-group, :root .zi-kv, :root .zi-panel, :root .zi-callout { border-radius: 14px; }
:root .z0-cell, :root .zd-stat, :root .zt-stat, :root .zk-stat, :root .zy-stat, :root .zm-stat, :root .zb-stat, :root .z0-since, :root .zb-since { border-radius: 12px; }
:root .z-btn--primary { box-shadow: none; }
:root .z-chip[aria-pressed="true"], :root .z-chip[aria-checked="true"], :root .z-chip[aria-selected="true"] { box-shadow: none; }

/* rows: a plain glyph, not a coloured tile; type is told by the glyph and the word, colour is left for urgency */
:root .z-row-face { min-height: 58px; padding-top: 11px; padding-bottom: 11px; }
:root .z-row-glyph, :root .z-row[data-kind] .z-row-glyph { width: 28px; height: 28px; border-radius: 8px; background: transparent; box-shadow: none; color: var(--text-2); }
:root .z-row-glyph svg { width: 22px; height: 22px; }
:root .z-row.is-signal .z-row-glyph { color: var(--c-bad); }
:root .z-row + .z-row::before, :root .z-list > .z-item + .z-item::before { left: 56px; }
:root .z-row-trail > span, :root .z0 .z-row .z-row-trail span { background: transparent; padding: 0; color: var(--text-3); font-weight: 600; }
:root .z-row[data-kind="date"] .z-row-trail > span { background: transparent; color: var(--c-warn); }
:root .z-row.is-signal .z-row-trail > span { background: transparent; color: var(--c-bad); }
:root .z-row[data-unseen] .z-row-glyph::after { top: 0; right: 0; width: 8px; height: 8px; background: var(--text); box-shadow: 0 0 0 2px var(--card); }
:root .z0 .z0-openrow { background: transparent; }
:root .z0 .z0-openrow .z-row-glyph, :root .z0 .z0-openrow .z-row-glyph svg { width: 28px; height: 28px; }
:root .z0 .z0-openrow .z-row-title { font-size: 1.3125rem; font-weight: 650; }
:root .z0-acts .z0-primary { flex: 0 0 auto; width: auto; min-width: 0; padding: 0 22px; min-height: 46px; }
:root .z0-acts .z-btn:not(.z0-primary):not(.z-btn--icon) { flex: 0 0 auto; padding: 0 18px; min-height: 46px; background: var(--card-2); }

/* headers: neutral words, one small coloured dot */
:root .z0-band .z-label span:first-child, :root .z0-band[data-b="now"] .z-label span:first-child, :root .z0-band[data-b="today"] .z-label span:first-child { color: var(--text); }
:root .z0-band .z-label span:first-child::before, :root .z0-band[data-b="now"] .z-label span:first-child::before, :root .z0-band[data-b="today"] .z-label span:first-child::before { width: 7px; height: 7px; box-shadow: none; }

/* nav: flat and opaque */
@media (max-width: 899px) {
  :root .z-tabbar { background: var(--card); -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 18px; height: 58px; box-shadow: inset 0 0 0 1px var(--card-hi); }
  :root[data-theme="light"] .z-tabbar { background: var(--card); }
  :root .z-tabbtn { border-radius: 14px; }
  :root .z-tabbtn[aria-current="page"] svg { color: var(--text); }
  :root .z-badge { background: var(--text); color: var(--bg); box-shadow: 0 0 0 2px var(--card); }

  /* the phone header: the number, the bands, and ONE line of status. The charts and the three tiles belong to wider screens. */
  :root .z0-hero { padding: 14px 16px 10px; }
  :root .z0-n { font-weight: 300; }
  :root .z0-tele, :root .z0-mix, :root .z0-facts { display: none; }
  :root .z0-stat { display: flex; }
}
:root .z0-stat { display: none; align-items: center; gap: 10px; width: 100%; min-height: 44px; margin-top: 10px; padding: 0 12px; border-radius: 12px; background: var(--card-2); color: var(--text-2); font-size: 0.8125rem; font-weight: 500; text-align: left; box-shadow: inset 0 0 0 1px var(--card-line); }
:root .z0-stat-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--text-3); }
:root .z0-stat[data-word="NO-GO"] .z0-stat-dot { background: var(--c-bad); }
:root .z0-stat[data-word="HOLD"] .z0-stat-dot { background: var(--c-warn); }
:root .z0-stat[data-word="GO"] .z0-stat-dot { background: var(--c-good); }
:root .z0-stat[data-word="NO-GO"] { color: var(--text); }
:root .z0-stat-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (min-width: 900px) { :root .z0-stat { display: none; } }

/* the item sheet: tracking block */
:root .zi-track { margin-top: 14px; }
:root .zi-sla { font-weight: 700; font-variant-numeric: tabular-nums; }
:root .zi-sla.is-ok { color: var(--c-good); }
:root .zi-sla.is-warn { color: var(--c-warn); }
:root .zi-sla.is-bad { color: var(--c-bad); }
:root .zi-kind, :root .zi-eyebrow[data-kind] .zi-kind { background: transparent; box-shadow: none; color: var(--text-2); width: 28px; height: 28px; }
:root .zi-verbs > * { border-radius: 12px; }
:root .zi-band, :root .zi-band[data-band="now"], :root .zi-band[data-band="today"] { background: var(--fill); color: var(--text); box-shadow: none; }
@media (max-width: 899px) { :root .z0-stat { display: flex; } }
:root .z0-stat { grid-column: 1 / -1; min-width: 0; max-width: 100%; overflow: hidden; }
:root .z0-hero { grid-template-columns: auto minmax(0, 1fr); }
@media (min-width: 900px) { :root .z0-hero { grid-template-columns: minmax(200px, 1fr) minmax(0, 1.6fr); } }

/* ===== ROUND 4 (Grok's second critique): 12px corners, four sizes and two weights, no thin numerals, band headers without pills,
   the standing against target on the right of every row, a quieter two-row phone header ===== */
:root { --card-r: 12px; }
:root .z0-hero, :root .zd-hero, :root .zt-hero, :root .zk-hero, :root .zy-hero, :root .zm-who, :root .zb-hero { border-radius: 14px; }
:root .z-group, :root .zi-kv, :root .zi-panel, :root .zi-callout, :root .z0-mix, :root .zt-addbox { border-radius: 12px; }
:root .z0-cell, :root .zd-stat, :root .zt-stat, :root .zk-stat, :root .zy-stat, :root .zm-stat, :root .zb-stat, :root .z0-since, :root .zb-since, :root .z0-stat, :root .zd-day, :root .z-seg { border-radius: 10px; }
:root .z-chip { min-height: 34px; }
:root .z-num-v, :root .z0-n, :root .zy-n, :root .zd-count b, :root .z0-leg-n, :root .zy-stat b, :root .zm-stat i, :root .zt-stat b, :root .zk-stat b, :root .zb-n, :root .zb-stat-n, :root .z0-selbar-n { font-weight: 500; font-variant-numeric: tabular-nums; }
:root .z-row-title { font-weight: 500; font-size: 1.0625rem; }
:root .z-row-meta { font-size: 0.9375rem; line-height: 1.3; }
:root .z0 .z0-openrow .z-row-title, :root .zi-title { font-weight: 600; }
:root .z-row-trail { font-size: 0.8125rem; font-weight: 600; }
:root .z-row-trail > span.is-over, :root .z0 .z-row .z-row-trail span.is-over { color: var(--c-bad); }
:root .z-label { font-size: 0.8125rem; letter-spacing: 0.04em; color: var(--text-2); }
:root .z-label .z-tab { background: transparent; padding: 0; color: var(--text-2); font-size: 0.8125rem; font-weight: 600; }
:root .z0-band .z-label span:first-child, :root .z0-band[data-b] .z-label span:first-child { color: var(--text-2); }
:root .z0-band .z-label { padding-top: 24px; padding-bottom: 8px; }
@media (max-width: 899px) {
  :root .z0-meter { display: none; }
  :root .z0-n { font-size: 3.25rem; height: auto; line-height: 1; }
  :root .z0-hero { padding: 14px 16px 12px; row-gap: 0; }
  :root .z0-leg-n { font-size: 1.25rem; }
  :root .z0-stat { margin-top: 12px; min-height: 40px; }
}
@media (max-width: 899px) { :root .z0-n { min-height: 1em; display: block; } }

/* ===== ROUND 5: counts are the band filters, status line only when something is wrong, Dismiss last and red ===== */
:root .z0-stat[data-word="GO"] { display: none; }
:root .z0-leg { border-radius: 10px; padding: 6px 8px; margin: -6px -8px; }
:root .z0-leg[aria-pressed="true"] { background: var(--card-3); box-shadow: inset 0 0 0 1px var(--card-hi); }
:root .z-label .z-label-r.is-over { color: var(--c-bad); font-weight: 700; }
:root .zi-verb[data-verb="dismiss"] { color: var(--c-bad); }

/* ===== ROUND 6: filter summary, owner, dismiss reasons ===== */
:root .z0-active { display: flex; align-items: center; gap: 8px; margin: 8px var(--g, 16px) 0; padding: 9px 12px; background: var(--card); border: 1px solid var(--card-line); border-radius: var(--card-r); font-size: 13px; min-height: 40px; }
:root .z0-active[hidden] { display: none; }
:root .z0-active-k { color: var(--text-2); }
:root .z0-active-t { font-weight: 600; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
:root .z0-active-n { color: var(--text-2); margin-left: auto; white-space: nowrap; }
:root .z0-active-x { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 0 10px; border-radius: 8px; background: var(--card-3); color: var(--text); font-size: 12px; font-weight: 600; }
:root .z0-active-x svg { width: 12px; height: 12px; }
:root .z0-own { font-size: 11px; font-weight: 600; letter-spacing: 0.02em; padding: 1px 7px; border-radius: 99px; background: var(--card-2); color: var(--text-2); }
:root .z0-own[data-set="1"] { background: var(--card-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--card-line); }
:root .zi-own .z-seg { width: 100%; max-width: 280px; }
:root .zi-reasons { display: grid; gap: 8px; padding: 4px 0 10px; }
:root .zi-reasons .z-btn, :root .zi-reasons button { width: 100%; min-height: 48px; justify-content: center; }

/* ======================= LEDGER SKIN (Jacob 11/5: "revert the dashboard back to the prior design and layout as far as aesthetics go") =======================
   White ground, near-black ink, a double rule under the masthead, hairline tables, square corners, teal only for state, one font
   (Helvetica Neue) with tabular figures. Same tokens Zero already reads, so every screen follows. Light only. */
html:root, html:root[data-theme], html:root[data-theme="system"], html:root[data-theme="dark"], html:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff; --surface: #ffffff; --raise: #f4f6f6; --raise-2: #eaeeee;
  --fill: #f4f6f6; --fill-2: #e8ecec;
  --text: #10191b; --text-2: #34403f; --text-3: #5a6668;
  --rule: #d3d9da; --rule-2: #8a9597;
  --accent: #10191b; --on-accent: #ffffff; --paper: #ffffff; --mark-filter: brightness(0.55) contrast(1.15); --rail-bg: #f4f6f6; --signal: #a62f1d; --hold: #5a6668; --nc: #8a9597;
  --teal: #17666b; --teal-fill: #2e9aa0; --teal-wash: #e3f1f2; --red-wash: #fbebe8; --amber: #8a5700; --amber-wash: #fbf1de; --green: #2a6b3b; --green-wash: #e6f2e9;
  --glass: #ffffff; --glass-2: #ffffff; --scrim: rgba(16, 25, 27, 0.35);
  --shadow-sheet: 0 0 0 1px #10191b, 0 18px 40px rgba(16, 25, 27, 0.18); --focus: #10191b;
  --f-sans: "Helvetica Neue", Helvetica, Arial, sans-serif; --f-display: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 3px; --rail: 240px; --hair: 1px;
  --card: #ffffff; --card-2: #f4f6f6; --card-3: #e8ecec; --card-line: #d3d9da; --card-hi: #10191b; --card-r: 0px; --inset: 14px;
  --glow-a: transparent; --glow-b: transparent;
  --k-date: #8a5700; --k-question: #8a5700; --k-draft: #17666b; --k-decision: #10191b; --k-check: #5a6668; --k-task: #34403f; --k-message: #17666b;
  --k-request: #5a6668; --k-answer: #2a6b3b; --k-system: #a62f1d; --k-deal: #8a5700;
  --c-now: #a62f1d; --c-today: #8a5700; --c-later: #5a6668; --c-good: #2a6b3b; --c-warn: #8a5700; --c-bad: #a62f1d;
}
html:root body, html:root .z-app { font-family: var(--f-sans); font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }

/* ---- chrome ---- */
html:root .z-app { background: var(--bg); }
.z-brand { position: relative; padding: 16px 16px 20px; gap: 12px; align-items: center; margin: 0 0 8px; }
.z-brand::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 7px; border-top: 3px solid var(--text); border-bottom: 1px solid var(--text); }
.z-brand-mark { width: 36px; height: 36px; flex: none; background: url("../assets/mark.png") center / contain no-repeat; filter: var(--mark-filter); }
.z-brand-t { display: flex; flex-direction: column; min-width: 0; }
.z-brand-t b { font-family: var(--f-sans); font-size: 0.875rem; font-weight: 700; letter-spacing: 0.14em; white-space: nowrap; line-height: 1.15; }
.z-brand-t span { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.36em; color: var(--text-3); margin-top: 3px; }
.z-railgrp { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); padding: 18px 12px 6px; }
.z-railnav { padding: 0 10px; gap: 2px; }
.z-railbtn { border-radius: 3px; min-height: 40px; font-size: 0.875rem; font-weight: 500; color: var(--text-2); padding: 0 12px; }
.z-railbtn svg { width: 18px; height: 18px; stroke-width: 1.7; }
.z-railbtn:hover { background: var(--raise); color: var(--text); }
.z-railbtn[aria-current="page"] { background: var(--text); color: var(--on-accent); }
.z-railbtn .z-count { font-weight: 700; color: var(--text-3); }
.z-railbtn[aria-current="page"] .z-count { color: var(--on-accent); }
.z-railgap { height: 6px; }
.z-railpill { border-radius: 3px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); }
.z-rail { background: var(--rail-bg); }
.z-rail::after { background: var(--rule); }
.z-railfoot { border-top: 1px solid var(--rule); padding: 12px 18px 16px; }
.z-top, .z-tabbar { background: var(--paper); }
.z-top::after { opacity: 1; height: 7px; background: none; border-top: 3px solid var(--text); border-bottom: 1px solid var(--text); bottom: -6px; }
.z-tabbar::before { height: 3px; background: var(--text); }
.z-tabbtn { color: var(--text-3); font-weight: 600; }
.z-tabbtn[aria-current="page"] { color: var(--text); }
.z-badge { background: var(--text); color: var(--on-accent); border-radius: 99px; }
@media (min-width: 900px) {
  html:root .z-top { display: flex; left: var(--rail); height: 62px; padding: 0 24px; background: var(--paper); align-items: center; }
  html:root .z-top-l { display: none; }
  html:root .z-top-title { opacity: 1; transform: none; text-align: left; font-size: 1.25rem; font-weight: 700; height: auto; line-height: 1.2; flex: 1; }
  html:root .z-top-r .z-status, html:root .z-top-r .z-go { display: inline-flex; }
  html:root .z-top-r .z-pill { display: inline-flex; }
  html:root .z-railfoot .z-status, html:root .z-railfoot .z-go { display: none; }
  html:root .z-main { padding-top: 76px; }
}

/* ---- home: greeting, then a grid of ruled number cells ---- */
html:root .z0 { padding-top: 6px; }
html:root .z0-hero { background: var(--paper); box-shadow: none; border-radius: 0; border: 0; border-top: 3px solid var(--text); padding: 0; margin: 0 16px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
html:root .z0-hero-top { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: -3px 0 0; padding: 0 0 14px; border-top: 0; order: -3; }
html:root .z0-hero { border-top: 0; }
html:root .z0-hero::before { content: ""; grid-column: 1 / -1; order: -2; height: 0; border-top: 3px solid var(--text); }
html:root .z0-eyebrow { font-size: 1.75rem; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--text); margin: 0; }
html:root .z0-date { font-size: 0.8125rem; color: var(--text-3); }
html:root .z0-greet { flex-basis: 100%; margin: 6px 0 0; font-size: 1rem; color: var(--text); }
html:root .z0-hero-l, html:root .z0-hero-r, html:root .z0-legend, html:root .z0-tele { display: contents; }
html:root .z0-count, html:root .z0-leg, html:root .z0-cell { display: flex; flex-direction: column-reverse; justify-content: flex-end; align-items: flex-start; gap: 4px; padding: 14px 16px 16px; border: 0; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); border-radius: 0; background: var(--paper); box-shadow: none; text-align: left; min-height: 96px; }
html:root .z0-count { grid-column: 1; }
html:root .z0-n { font-size: 2.5rem; font-weight: 700; line-height: 1; letter-spacing: -0.01em; color: var(--text); }
html:root .z0-n-l, html:root .z0-leg-l, html:root .z0-cell-l { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
html:root .z0-leg-n { font-size: 2.5rem; font-weight: 700; line-height: 1; }
html:root .z0-leg[data-b="now"] .z0-leg-n { color: var(--c-now); } html:root .z0-leg[data-b="today"] .z0-leg-n { color: var(--c-today); } html:root .z0-leg[data-b="later"] .z0-leg-n { color: var(--text); }
html:root .z0-leg[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--text); }
html:root .z0-meter { grid-column: 1 / -1; order: 5; height: 6px; margin: 0; border-radius: 0; gap: 2px; }
html:root .z0-meter i { border-radius: 0; }
html:root .z0-cell { grid-column: span 1; min-height: 84px; }
html:root .z0-cell-v { font-size: 1.125rem; font-weight: 700; }
html:root .z0-sys { grid-column: span 2; }
html:root .z0-cell.z0-sys[data-word="bad"], html:root .z0-sys { background: var(--paper); }
html:root .z0-since { grid-column: 1 / -1; order: 6; border: 0; border-bottom: 1px solid var(--rule); padding: 12px 0; margin: 0; background: none; border-radius: 0; }
html:root .z0-stat { display: none; }
html:root .z0-tele .z0-cell:last-child { border-right: 0; }
@media (max-width: 899px) {
  html:root .z0-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html:root .z0-sys { grid-column: 1 / -1; }
}
/* grid placement, explicit */
html:root .z0-hero-top { grid-row: 1; grid-column: 1 / -1; order: 0; margin: 0; padding: 4px 0 12px; }
html:root .z0-hero::before { display: none; }
html:root .z0-since { grid-row: 2; grid-column: 1 / -1; order: 0; border-top: 1px solid var(--rule); border-bottom: 0; padding: 0; min-height: 44px; margin-bottom: 14px; }
html:root .z0-since::before { display: none; }
html:root .z0-count { grid-row: 3; grid-column: 1; border-top: 3px solid var(--text); }
html:root .z0-leg { grid-row: 3; border-top: 3px solid var(--text); }
html:root .z0-leg[data-b="now"] { grid-column: 2; } html:root .z0-leg[data-b="today"] { grid-column: 3; } html:root .z0-leg[data-b="later"] { grid-column: 4; border-right: 0; }
html:root .z0-meter { grid-row: 4; grid-column: 1 / -1; order: 0; margin: 0; border-bottom: 1px solid var(--rule); height: 8px; }
html:root .z0-cell { flex-direction: column; justify-content: flex-start; grid-row: 5; border-bottom: 1px solid var(--rule); }
html:root .z0-sys { grid-column: 1 / span 2; } html:root .z0-data { grid-column: 3; } html:root .z0-checked { grid-column: 4; border-right: 0; }
html:root .z0-cell-l { order: -1; }
html:root .z0-cell-s { font-size: 0.75rem; color: var(--text-3); font-weight: 400; }
html:root .z-mono, html:root .z0 .z-mono, html:root .z0-cell-v { font-family: var(--f-sans); }
html:root .z0-sys .z0-cell-v { color: var(--c-bad); }
html:root .z0-sys[data-word="ok"] .z0-cell-v, html:root .z0-sys[data-word="go"] .z0-cell-v { color: var(--c-good); }
@media (min-width: 900px) { html:root .z0-eyebrow { display: none; } }
@media (max-width: 899px) {
  html:root .z0-hero { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 16px; }
  html:root .z0-count { grid-column: 1 / -1; grid-row: 3; border-right: 0; flex-direction: row-reverse; align-items: baseline; justify-content: flex-end; gap: 12px; min-height: 0; }
  html:root .z0-leg { grid-row: 4; } html:root .z0-leg[data-b="now"] { grid-column: 1; } html:root .z0-leg[data-b="today"] { grid-column: 2; } html:root .z0-leg[data-b="later"] { grid-column: 3; }
  html:root .z0-meter { grid-row: 5; }
  html:root .z0-sys { grid-column: 1 / -1; grid-row: 6; border-right: 0; } html:root .z0-data { grid-column: 1 / span 2; grid-row: 7; } html:root .z0-checked { grid-column: 3; grid-row: 7; }
}
/* the queue at a glance and the filters */
html:root .z0-mix { background: var(--paper); box-shadow: none; border: 0; border-top: 3px solid var(--text); border-bottom: 1px solid var(--rule); border-radius: 0; }
html:root .z0-chips .z-chip, html:root .z0-chips button { border-radius: 3px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--rule); color: var(--text-2); }
html:root .z0-chips [aria-pressed="true"], html:root .z0-chips [aria-checked="true"], html:root .z0-chips .is-on { background: var(--text); color: var(--on-accent); box-shadow: none; }
/* hero refinements */
html:root .z0 h1.z0-eyebrow { font-size: 1.75rem; letter-spacing: 0; }
html:root .z0-hero .z0-sys, html:root .z0-hero .z0-sys[data-word] { background: var(--paper); box-shadow: none; }
html:root .z0-hero .z0-sys .z0-cell-v, html:root .z0-hero .z0-cell-v { letter-spacing: 0; text-transform: none; }
html:root .z0-count, html:root .z0-leg { border-top: 0; }
html:root .z0-since { border-bottom: 3px solid var(--text); margin-bottom: 0; padding-left: 8px; }
html:root .z0-meter { margin-top: 0; }
@media (min-width: 900px) { html:root .z0-hero, html:root .z0-mix { margin-left: 24px; margin-right: 24px; } }
html:root .z0-chips { padding-top: 14px; }

/* square corners everywhere except true circles (avatars, dots, badges, switches, checks) */
html:root *:not(.z0-av):not(.z-dot):not(.z-badge):not(.z-switch):not(.z-switch *):not(.z-check):not(.z-check *):not(i):not(.z-skel *):not(.z-ptr *):not(.z-icon-hero):not(.person .av):not(.z-mark *):not(.zi-tl-dot) { border-radius: 3px !important; }
/* bands: a heavy rule, a label bar, hairline rows */
html:root .z0-band { border-top: 3px solid var(--text); margin-top: 18px; background: var(--paper); }
html:root .z0-band .z-label { padding: 10px 16px; border-bottom: 1px solid var(--text); background: var(--paper); margin: 0; font-size: 0.6875rem; letter-spacing: 0.12em; }
html:root .z0-ul { background: var(--paper); box-shadow: none; border: 0; margin: 0; }
html:root .z-row { border-bottom: 1px solid var(--rule); background: var(--paper); }
html:root .z-row:hover, html:root .z-row[aria-current="true"], html:root .z-row.is-focus { background: var(--raise); }
html:root .z-group, html:root .zi-kv, html:root .zi-panel, html:root .zi-callout { background: var(--paper); box-shadow: none; border: 1px solid var(--rule); }
html:root .z-btn, html:root button.z-primary, html:root .zi-verb { border-radius: 3px !important; }
@media (min-width: 900px) { html:root .z0-grid { margin: 0 24px; } html:root .z0-chips, html:root .z0-active { margin-left: 24px; margin-right: 24px; } }
@media (max-width: 899px) { html:root .z0-grid, html:root .z0-chips, html:root .z0-active, html:root .z0-mix { margin-left: 16px; margin-right: 16px; } }
@media (max-width: 899px) {
  html:root { --tab: 64px; }
  html:root .z-tabbar { left: 0; right: 0; bottom: 0; height: calc(64px + var(--sa-b)); padding: 0 var(--sa-r) var(--sa-b) var(--sa-l); background: var(--paper); box-shadow: none; border-top: 3px solid var(--text); }
  html:root .z-tabbar::before { display: block; top: 3px; height: 1px; background: var(--text); }
  html:root .z-tabbtn { background: none; border-radius: 0 !important; }
  html:root .z-tabbtn[aria-current="page"] { background: none; color: var(--text); }
  html:root .z-tabbtn[aria-current="page"]::after { content: ""; position: absolute; left: 20%; right: 20%; bottom: 0; height: 3px; background: var(--text); }
  html:root .z-badge { box-shadow: 0 0 0 2px var(--paper); }
}
html:root .z0-greet { min-height: 1.5em; line-height: 1.5; }
html:root .z0-since { min-height: 44px; }
html:root .z0-n, html:root .z0-leg-n { display: block; min-height: 1em; }
html:root .z0-cell { min-height: 112px; }
html:root .z0-cell-v { min-height: 1.5em; }
html:root .z0-cell-s { min-height: 1.2em; }
html:root .z0-count, html:root .z0-leg { min-height: 100px; }

/* ---- sign-in: the previous card ---- */
html:root .auth-wrap { background: var(--raise); align-items: center; justify-content: center; padding: 20px; }
html:root .auth-card { position: relative; max-width: 420px; text-align: center; align-items: stretch; background: var(--paper); border: 1px solid var(--rule); border-top: 3px solid var(--text); padding: 30px 28px 24px; gap: 0; }
html:root .auth-card::after { content: ""; position: absolute; left: -1px; right: -1px; top: 3px; border-top: 1px solid var(--text); }
html:root .auth-card::before { width: 76px; height: 76px; margin: 6px auto 0; background: url("../assets/mark.png") center / contain no-repeat; filter: var(--mark-filter); }
html:root .auth-word { font-family: var(--f-sans); font-size: 1.25rem; font-weight: 700; letter-spacing: 0.3em; text-indent: 0.3em; color: var(--text); margin-top: 16px; }
html:root .auth-sub { font-family: var(--f-sans); font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.42em; text-indent: 0.42em; text-transform: uppercase; color: var(--text-3); margin: 5px 0 0; }
html:root .pw-hint { margin-top: 20px; color: var(--text-2); }
html:root .auth-card .who { flex-direction: row; gap: 10px; margin: 24px 0 14px; background: none; overflow: visible; }
html:root .auth-card .person { flex: 1; display: block; text-align: center; padding: 14px 8px 12px; background: var(--paper); border: 1px solid var(--rule); min-height: 44px; }
html:root .auth-card .person + .person::before { display: none; }
html:root .auth-card .person .av { margin: 0 auto 8px; background: var(--fill-2); color: var(--text); }
html:root .auth-card .person .em { display: block; margin-top: 3px; white-space: normal; overflow-wrap: anywhere; font-size: 0.65625rem; }
html:root .auth-card .person.sel { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
html:root .auth-card .person.sel::after { display: none; }
html:root .auth-card .person.sel .av { background: var(--text); color: var(--on-accent); }
html:root .auth-card input[type="password"] { height: 48px; border: 1px solid #8a9597; background: var(--paper); border-radius: 3px; }
html:root .auth-card button[type="submit"] { border-radius: 3px; height: 48px; font-weight: 700; }
@media (max-width: 430px) { html:root .auth-card .person .em { display: none; } }
html:root .z0-chips, html:root .z0-active { padding-left: 0; padding-right: 0; }
html:root .z0-band .z-row, html:root .z0-band .z-list > * { margin-left: 0; margin-right: 0; }

/* ---- dark: the same Ledger, inverted (Auto turns it on from 7 PM to 6 AM) ---- */
html:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1517; --surface: #0e1517; --raise: #151d1f; --raise-2: #1c2628; --paper: #0e1517; --rail-bg: #121a1c;
  --fill: #151d1f; --fill-2: #1f2a2c;
  --text: #e8eeee; --text-2: #c3cdce; --text-3: #8d9a9c;
  --rule: #2b3739; --rule-2: #51605f;
  --accent: #e8eeee; --on-accent: #0e1517; --signal: #ff7a66; --hold: #8d9a9c; --nc: #51605f;
  --teal: #5cc4c9; --teal-fill: #2e9aa0; --teal-wash: #12292b; --red-wash: #2d1713; --amber: #e0a63d; --amber-wash: #2a2010; --green: #5cc08a; --green-wash: #12261a;
  --glass: #0e1517; --glass-2: #0e1517; --scrim: rgba(0, 0, 0, 0.6);
  --shadow-sheet: 0 0 0 1px #51605f, 0 18px 40px rgba(0, 0, 0, 0.6); --focus: #e8eeee;
  --card: #0e1517; --card-2: #151d1f; --card-3: #1f2a2c; --card-line: #2b3739; --card-hi: #e8eeee;
  --k-date: #e0a63d; --k-question: #e0a63d; --k-draft: #5cc4c9; --k-decision: #e8eeee; --k-check: #8d9a9c; --k-task: #c3cdce; --k-message: #5cc4c9;
  --k-request: #8d9a9c; --k-answer: #5cc08a; --k-system: #ff7a66; --k-deal: #e0a63d;
  --c-now: #ff7a66; --c-today: #e0a63d; --c-later: #8d9a9c; --c-good: #5cc08a; --c-warn: #e0a63d; --c-bad: #ff7a66;
  --mark-filter: brightness(1.5);
}
html:root[data-theme="dark"] .z-brand::after, html:root[data-theme="dark"] .z-top::after { border-color: var(--text); }
html:root[data-theme="dark"] .z-railpill { box-shadow: inset 0 0 0 1px var(--rule); background: var(--paper); }
html:root[data-theme="dark"] .z0-meter, html:root[data-theme="dark"] .z-top-r .z-status { background: var(--raise); }

/* ---- phone: the queue must start on the first screen. Four number cells in one row, Systems as one line, Data and Checked live in the status chip ---- */
@media (max-width: 899px) {
  html:root .z0-hero { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  html:root .z0-hero-top { padding: 2px 0 6px; }
  html:root .z0-since { margin-bottom: 0; min-height: 40px; }
  html:root .z0-count { grid-column: 1; grid-row: 3; flex-direction: column-reverse; align-items: flex-start; justify-content: flex-end; border-right: 1px solid var(--rule); min-height: 78px; padding: 10px 10px 12px; }
  html:root .z0-leg { grid-row: 3; min-height: 78px; padding: 10px 10px 12px; }
  html:root .z0-leg[data-b="now"] { grid-column: 2; } html:root .z0-leg[data-b="today"] { grid-column: 3; } html:root .z0-leg[data-b="later"] { grid-column: 4; }
  html:root .z0-n, html:root .z0-leg-n { font-size: 2rem; }
  html:root .z0-meter { grid-row: 4; }
  html:root .z0-sys { grid-column: 1 / -1; grid-row: 5; min-height: 0; flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; padding: 10px 10px; border-right: 0; }
  html:root .z0-sys .z0-cell-v { min-height: 0; font-size: 1rem; }
  html:root .z0-sys .z0-cell-s { min-height: 0; }
  html:root .z0-data, html:root .z0-checked { display: none; }
  html:root .z0-mix { display: none; }
}
html:root[data-theme] .z0-hero, html:root[data-theme] .z0-mix, html:root[data-theme] .z0-since, html:root[data-theme] .z0-cell, html:root[data-theme] .z0-leg { box-shadow: none; }
html:root[data-theme] .z0-leg[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--text); }
@media (max-width: 899px) { html:root .z0-greet { min-height: 3em; } html:root .z0-sys { min-height: 44px; } }
@media (max-width: 899px) { html:root .z0-sys { min-height: 64px; align-content: center; } }

/* ---- audit fixes (UI audit on real data, 11/5 night) ---- */
@media (max-width: 899px) {
  /* the first card must leave room for its button: two lines of title, two of body */
  html:root .z0 .z0-openrow .z-row-title { -webkit-line-clamp: 2; font-size: 1.1875rem; line-height: 1.25; }
  html:root .z0 .z0-openrow .z0-body { -webkit-line-clamp: 2; }
  /* subpages: the title and the Back button get the bar; the status chip comes back when you scroll to the top */
  html:root .z-top.has-title .z-status, html:root .z-top.has-title .z-go { display: none; }
  /* Deals: the next-date card stacks, so a long deal name is not squeezed beside the tiles */
  html:root .zd-hero { grid-template-columns: 1fr; }
  html:root .zd-stats { flex-direction: row; justify-content: space-between; gap: 12px; }
  html:root .zd-hero-main * { overflow-wrap: anywhere; }
}
@media (max-width: 359px) {
  html:root .z0-n-l, html:root .z0-leg-l, html:root .z0-cell-l { letter-spacing: 0.02em; font-size: 0.625rem; }
  html:root .z0-count, html:root .z0-leg { padding-left: 6px; padding-right: 6px; }
  html:root .z0-n, html:root .z0-leg-n { font-size: 1.75rem; }
  html:root .zm-stat { min-width: 0; overflow-wrap: anywhere; padding-right: 4px; }
}
html:root .zm-stat { min-width: 0; }
html:root .z-tabbtn { font-size: 0.6875rem; color: var(--text-2); font-weight: 600; }
html:root .z-tabbtn[aria-current="page"] { color: var(--text); }
/* a primary button waiting for text is outlined, not grey on grey */
html:root .zi-primary .z-btn.is-waiting { background: var(--paper); color: var(--text); box-shadow: inset 0 0 0 1px var(--text); opacity: 1; }
/* desktop: keep the number grid and the glance panel compact so the first queue row shows without scrolling */
@media (min-width: 900px) {
  html:root .z0-cell, html:root .z0-count, html:root .z0-leg { min-height: 84px; padding-top: 10px; padding-bottom: 10px; }
  html:root .z0-sys, html:root .z0-data, html:root .z0-checked { min-height: 84px; }
}

/* ---- a fold of items that arrived in one batch ---- */
html:root .z0-clusterrow { list-style: none; border-bottom: 1px solid var(--rule); background: var(--raise); }
html:root .z0-cluster { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 16px; text-align: left; background: none; color: var(--text); }
html:root .z0-cluster-chev { width: 18px; height: 18px; flex: none; transition: transform 160ms; }
html:root .z0-cluster[aria-expanded="true"] .z0-cluster-chev { transform: rotate(90deg); }
html:root .z0-cluster-t { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
html:root .z0-cluster-t b { font-size: 1rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
html:root .z0-cluster-t span { font-size: 0.8125rem; color: var(--text-2); }
html:root .z0-cluster-n { font-size: 0.75rem; font-weight: 700; color: var(--text-2); white-space: nowrap; }
html:root .z0-cluster-n.is-over { color: var(--signal); }
/* ---- accessibility pass (11/5): edges, touch targets, narrow screens ----
   --edge is the line around a control that has no other outline (field, switch). It is 3:1 or better against the page, the raised
   surfaces and the grey fills in both themes; --rule and --rule-2 stay for hairlines, which are decoration. */
html:root { --edge: #6f7b7d; }
html:root[data-theme="dark"] { --edge: #74878a; }
html:root .z-input:not(.zk-addbox *):not(.zt-addbox *), html:root .z-textarea:not(.zk-addbox *) { box-shadow: inset 0 0 0 1px var(--edge); }
html:root .z-input:not(.zk-addbox *):not(.zt-addbox *):focus-visible, html:root .z-textarea:not(.zk-addbox *):focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
html:root .z-switch:not([aria-checked="true"]) { box-shadow: inset 0 0 0 1.5px var(--edge); }
html:root .z-switch::before { content: ""; position: absolute; inset: -7px -4px; }
/* the top bar's status and Go words are 34 px tall with 5 px of margin; the touch area is the full 44 */
.z-top .z-status, .z-top .z-go { position: relative; }
.z-top .z-status::after, .z-top .z-go::after { content: ""; position: absolute; inset: -5px -2px; }
html:root .zp-switch .z-seg button, html:root .zk-tabs .z-seg button { min-height: 44px; }
@media (max-width: 899px) {
  html:root .z0-since { min-height: 44px; }
  html:root .z-row-face > .z-row-menu { width: 44px; height: 44px; }
  /* Deals: a long next-date line shrinks and the stat tiles wrap, instead of pushing the page wider than a 320 px screen */
  html:root .zd-hero { grid-template-columns: minmax(0, 1fr); }
  html:root .zd-stats { flex-wrap: wrap; }
}
/* large text on a phone (html font 20 px or more): the four number cells would each be about 70 px wide, so the big count of items
   ran under the Now column. Two columns instead, count on its own line. */
@media (max-width: 899px) {
  html.z-bigtext:root .z0-hero { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html.z-bigtext:root .z0-count { grid-column: 1 / -1; grid-row: 3; border-right: 0; }
  html.z-bigtext:root .z0-leg[data-b="now"] { grid-column: 1; grid-row: 4; }
  html.z-bigtext:root .z0-leg[data-b="today"] { grid-column: 2; grid-row: 4; border-right: 0; }
  html.z-bigtext:root .z0-leg[data-b="later"] { grid-column: 1 / -1; grid-row: 5; border-right: 0; }
  html.z-bigtext:root .z0-meter { grid-row: 6; }
  html.z-bigtext:root .z0-sys { grid-row: 7; }
  html.z-bigtext:root .z0-n, html.z-bigtext:root .z0-leg-n { font-size: 2.5rem; }
}
/* a settings row that holds a segmented control: under large text the label keeps a readable width and the control drops to its own line */
html:root .z-cell:has(> .z-seg) { flex-wrap: wrap; }
html:root .z-cell:has(> .z-seg) > .z-cell-t { flex: 1 1 9rem; min-width: 9rem; }
html:root .z-cell:has(> .z-seg) > .z-seg { margin-left: auto; }
/* large text on a phone: the clock beside the status word gives way to the Back label (the status button keeps its spoken label) */
@media (max-width: 479px) { html.z-bigtext .z-top .z-status .z-mono { display: none; } }
html:root .z0-brief { grid-column: 1 / -1; order: 0; grid-row: auto; margin: 0; border-top: 0; border-bottom: 1px solid var(--rule); }
html:root .z0-brief[hidden] { display: none; }
html:root .z0-brieflink { display: inline; padding: 0; min-height: 0; background: none; color: var(--teal); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
html:root .z0-brieflink[hidden] { display: none; }
/* long context: first two sentences, then a Show all button */
html:root .zi-more { display: inline-flex; align-items: center; min-height: 44px; padding: 0; color: var(--teal); font-weight: 700; font-size: var(--fs-meta); text-decoration: underline; text-underline-offset: 3px; background: none; }
html:root .zi-short .zi-text { margin-bottom: 0; }
/* sheet title: three lines at most, so the facts under it are on the first screen */
html:root .zi-title { font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.015em; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 900px) { html:root .zi-title { font-size: 1.625rem; -webkit-line-clamp: 4; } }
/* the four number cells: labels on one line across the top, numbers on one line under them, no stray underline (the meter bar is the rule) */
html:root .z0-count, html:root .z0-leg { flex-direction: column; justify-content: flex-start; align-items: flex-start; gap: 2px; border-bottom: 0; }
html:root .z0-n-l, html:root .z0-leg-l { order: -1; margin-bottom: 4px; }
html:root .z0-count, html:root .z0-leg, html:root .z0-cell { margin: 0; }

/* ======================= SIMPLE VIEW (Jacob 11/6: "There is just way too much information ... simplify everything") =======================
   Today is a greeting, the one system warning if there is one, and the first seven things to do. Everything else is one tap away
   under "Show all" or "Switch to the full view". Turned on by default; More, Settings turns it off. */
.z0[data-simple] .z0-hero-l, .z0[data-simple] .z0-count, .z0[data-simple] .z0-leg, .z0[data-simple] .z0-meter, .z0[data-simple] .z0-tele, .z0[data-simple] .z0-since,
.z0[data-simple] .z0-mix, .z0[data-simple] .z0-chips, .z0[data-simple] .z0-active, .z0[data-simple] .z0-band .z-label, .z0[data-simple] .z0-facts,
.z0[data-simple] .z0-folds, .z0[data-simple] .z0-date { display: none !important; }
.z0[data-simple] .z0-hero { display: block; border-top: 0; padding: 0; margin-top: 0; }
.z0[data-simple] .z0-hero-top { padding: 0 0 8px; display: block; }
.z0[data-simple] .z0-eyebrow { display: block !important; font-size: 1.75rem; margin: 6px 0 4px; }
.z0[data-simple] .z0-greet { font-size: 1rem; color: var(--text-2); min-height: 0; margin: 0; }
.z0[data-simple] .z0-stat { display: flex !important; align-items: center; gap: 8px; width: 100%; margin: 10px 0 0; padding: 12px; min-height: 44px; background: var(--red-wash); border: 1px solid var(--rule); font-size: var(--fs-meta); color: var(--c-bad); font-weight: 700; text-align: left; }
.z0[data-simple] .z0-stat[data-word="GO"], .z0[data-simple] .z0-stat[data-word="OK"] { display: none !important; }
.z0[data-simple] .z0-band { margin-top: 12px; border-top: 3px solid var(--text); }
.z0[data-simple] .z0-band + .z0-band { border-top: 0; margin-top: 0; }
.z0[data-simple] .z-row { min-height: 64px; }
.z0[data-simple] .z-row-title { font-size: 1.0625rem; -webkit-line-clamp: 2; }
.z0[data-simple] .z-row-meta { font-size: 0.875rem; color: var(--text-2); }
.z0[data-simple] .z0-age { display: none; }
.z0[data-simple] .z0-grid { margin: 0 16px; }
.z0[data-simple] .z0-pane { display: none; }
.z0-showall, .z0-fullview { display: block; width: calc(100% - 32px); margin: 14px 16px 0; min-height: 48px; border: 1px solid var(--text); background: var(--paper); color: var(--text); font-weight: 700; font-size: 1rem; }
.z0-fullview { border: 0; background: none; color: var(--text-3); font-weight: 400; font-size: var(--fs-meta); text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.z0-showall[hidden], .z0-fullview[hidden] { display: none; }
@media (min-width: 900px) { .z0[data-simple] .z0-grid { grid-template-columns: minmax(0, 720px); } }
.z-app:has(.z0[data-simple]) .z-top .z-go { display: none; }

/* ---- simple view on every other screen: the list or the form, and nothing around it ---- */
html[data-simple] .zd-hero, html[data-simple] .zd-cal, html[data-simple] .zd-asof, html[data-simple] .zd-stats, html[data-simple] .zd-filter,
html[data-simple] .zt-hero, html[data-simple] .zt-asof, html[data-simple] .zt-stats, html[data-simple] .zt-bar,
html[data-simple] .zk-hero, html[data-simple] .zk-stats, html[data-simple] .zk-asof,
html[data-simple] .zm-hero-cap, html[data-simple] .zm-stat, html[data-simple] .zm-asof, html[data-simple] .zm-read,
html[data-simple] .zy-stats, html[data-simple] .zy-fresh, html[data-simple] .zp-asof, html[data-simple] .zp-dr-asof { display: none !important; }
html:root .zt-addbox, html:root .zk-addbox { background: var(--paper); box-shadow: inset 0 0 0 1px var(--edge, var(--rule-2)); color: var(--text); }
html:root .zt-addbox *, html:root .zk-addbox * { color: var(--text); }
html[data-simple] .zd-railwrap, html[data-simple] .zd-rail, html[data-simple] .zd-segs, html[data-simple] .zd-stage-t, html[data-simple] .zd-watch,
html[data-simple] .zd-src, html[data-simple] .zd-note, html[data-simple] .zt-tags, html[data-simple] .zd-closed { display: none !important; }
html[data-simple] .zd-lines .zd-line:nth-child(n+2):not(:has(.zd-tag)), html[data-simple] .zd-deal .zd-events, html[data-simple] .zd-deal .zd-why { display: none !important; }

/* "I don't need a ton of details on everything. I'm the one who created everything" (Jacob 11/6): in the simple view, no explaining text */
html[data-simple] .z-sub, html[data-simple] .zd-sub, html[data-simple] .zd-kicker, html[data-simple] .zd-note, html[data-simple] .zd-next-s,
html[data-simple] .zi-foot, html[data-simple] .zi-callout, html[data-simple] .zi-fresh, html[data-simple] .zi-reason, html[data-simple] .zi-explain,
html[data-simple] .zi-panel-s, html[data-simple] .zk-hint, html[data-simple] .zt-hint, html[data-simple] .zp-dr-note, html[data-simple] .zm-note,
html[data-simple] .zy-why, html[data-simple] .zs-why, html[data-simple] .z-cell-t small, html[data-simple] .zb-form-s, html[data-simple] .zp-nc-note,
html[data-simple] .zi-mono, html[data-simple] .zi-meta { display: none !important; }
html:root .z0-syslink { display: inline; padding: 0; min-height: 0; background: none; color: var(--c-bad); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
html:root .z0-syslink[hidden] { display: none; }
.z0[data-simple] .z0-stat { display: none !important; }
@media (max-width: 899px) { .z0[data-simple] .z0-greet { min-height: 4.5em; } }
.z0[data-simple] .z0-band { margin-top: 0; }
.z0[data-simple] .z0-grid { padding-top: 12px; }

/* 2026-11-06 (Jacob: shorten the text in the tasks and everywhere else, not the menu): in the simple view every row title holds to two lines. */
html[data-simple] .z-row-title { -webkit-line-clamp: 2; }
html[data-simple] .zt-col .z-row-title { -webkit-line-clamp: 2; }
/* the greeting's two links run into the sentence before them (a button drops its leading space): give them room */
.z0-brieflink, .z0-syslink { margin-left: 0.6em; }
html[data-simple] .zk-thread .z-row-title { -webkit-line-clamp: 1; }
html[data-simple] .zk-thread .z-row-meta { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
