/* ============================================================
   ChequeGuard design system v3 — matched to home-reference.html.
   Layered blue-slate dark by DEFAULT: canvas recedes, panels lift.
   Inter for body · Space Grotesk for display · JetBrains Mono for
   every number (tabular). Accent #5B9BFF is interaction/data only;
   good/warn/bad appear only when they mean something.
   Fonts are SELF-HOSTED (public/fonts) — offline never hangs.
   ============================================================ */

/* ---------- fonts (font-display swap: system fallback, never a hang) ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/Inter-400.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/Inter-500.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/Inter-600.woff2') format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/Inter-700.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/SpaceGrotesk-500.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/SpaceGrotesk-600.woff2') format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url('/fonts/SpaceGrotesk-700.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/JetBrainsMono-400.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/JetBrainsMono-500.woff2') format('woff2'); }
@font-face { font-family: 'JetBrains Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('/fonts/JetBrainsMono-600.woff2') format('woff2'); }

/* ---------- tokens: the reference values, verbatim ---------- */
:root {
  color-scheme: dark;
  --bg: #080A0F;
  --bg-2: #0B0E14;
  --panel: #121722;
  --panel-hi: #161C29;
  --inset: #0C0F16;
  --line: #1C222E;
  --line-2: #252D3B;
  --ink: #EEF2F8;
  --ink-2: #9BA7B8;
  --ink-3: #617082;
  --ink-4: #3D4757;
  --accent: #5B9BFF;
  --accent-2: #3D7DE8;
  --accent-soft: rgba(91, 155, 255, .13);
  --accent-line: rgba(91, 155, 255, .30);
  --good: #43C892;
  --good-soft: rgba(67, 200, 146, .12);
  --warn: #EBB04A;
  --warn-soft: rgba(235, 176, 74, .12);
  --bad: #FF6B6B;
  --bad-soft: rgba(255, 107, 107, .11);
  --bad-line: rgba(255, 107, 107, .34);
  --r: 14px;
  --r-sm: 10px;
  --disp: "Space Grotesk", sans-serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 2px 4px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.6);
  --shadow-sm: 0 1px 0 rgba(255,255,255,.025) inset, 0 1px 3px rgba(0,0,0,.35);
  --body-glow:
    radial-gradient(1200px 600px at 78% -8%, rgba(91,155,255,.05), transparent 60%),
    radial-gradient(900px 500px at 10% 110%, rgba(91,155,255,.03), transparent 55%);
  /* chart tokens — charts read these at render time so both themes draw right */
  --chart-accent: var(--accent);
  --chart-area-top: rgba(91, 155, 255, .28);
  --chart-area-bot: rgba(91, 155, 255, 0);
  --chart-buffer: #333d4d;
  --chart-short: var(--bad);
  --chart-short-label: #FF9D96;
  /* legacy aliases — every older screen keeps working, coherently */
  --canvas: var(--bg);
  --surface: var(--panel);
  --ink-muted: var(--ink-2);
  --action: var(--accent);
  --covered: var(--good);
  --attention: var(--warn);
  --short: var(--bad);
  --sheet-shadow: 0 12px 48px -8px rgba(0, 0, 0, .7);
  --tabbar-h: calc(60px + env(safe-area-inset-bottom, 0px));
}
/* ---------- light theme: its own considered treatment, not inverted dark.
   Warm off-white canvas, true-white cards lifting off it via SOFT shadows
   (no glows — they read as smudges on white), warm near-black ink, the same
   accent blue darkened to hold WCAG AA on white, semantics deepened so red
   reads serious rather than neon. Layout/spacing/type identical. ---------- */
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #FAF9F7; --bg-2: #F5F3EF; --panel: #FFFFFF; --panel-hi: #FFFFFF;
  --inset: #F3F1EC; --line: #E8E4DD; --line-2: #D9D3CA;
  --ink: #1A1712; --ink-2: #57524A; --ink-3: #746E63; --ink-4: #A29A8D;
  --accent: #2563C4; --accent-2: #1D51A8;
  --accent-soft: rgba(37, 99, 196, .09); --accent-line: rgba(37, 99, 196, .32);
  --good: #177A5B; --good-soft: rgba(23, 122, 91, .10);
  --warn: #9A6100; --warn-soft: rgba(154, 97, 0, .10);
  --bad: #B3261E; --bad-soft: rgba(179, 38, 30, .08); --bad-line: rgba(179, 38, 30, .35);
  --shadow: 0 1px 2px rgba(26, 23, 18, .05), 0 2px 6px rgba(26, 23, 18, .04), 0 12px 28px -18px rgba(26, 23, 18, .16);
  --shadow-sm: 0 1px 2px rgba(26, 23, 18, .06), 0 1px 4px rgba(26, 23, 18, .04);
  --body-glow: none;
  --sheet-shadow: 0 12px 48px -12px rgba(26, 23, 18, .25);
  --chart-area-top: rgba(37, 99, 196, .14);
  --chart-area-bot: rgba(37, 99, 196, 0);
  --chart-buffer: #B9B1A4;
  --chart-short-label: #B3261E;
}
/* one-shot 150ms cross-fade while the theme flips (class added by toggleTheme) */
:root.theme-anim, :root.theme-anim body, :root.theme-anim * {
  transition: background-color .15s ease, color .15s ease, border-color .15s ease,
    box-shadow .15s ease, fill .15s ease, stroke .15s ease !important;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--body-glow), var(--bg);
  color: var(--ink);
  font: 400 14.5px/1.45 var(--sans);
  letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
.num, .money { font-family: var(--mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; letter-spacing: -.02em; }
.disp { font-family: var(--disp); }

/* ---------- type helpers (legacy names, new voice) ---------- */
.t-verdict { font-family: var(--disp); font-size: 44px; font-weight: 700; line-height: 1.05; letter-spacing: -.025em; }
.t-title { font-family: var(--disp); font-size: 21px; font-weight: 600; letter-spacing: -.02em; line-height: 1.2; }
.t-body { font-size: 14.5px; }
.t-meta { font-size: 12.5px; }
.t-micro { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.strong { font-weight: 600; }
.muted { color: var(--ink-3); }
.is-covered { color: var(--good); }
.is-attention { color: var(--warn); }
.is-short { color: var(--bad); }

/* ---------- boot splash ---------- */
.boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; }
.boot-word { font-family: var(--disp); font-size: 17px; font-weight: 700; }
.boot-hint { color: var(--ink-3); font-size: 13px; min-height: 20px; }

/* ---------- app frame: rail (desktop) + top bar + tab bar (phone) ---------- */
.app-frame { display: flex; min-height: 100dvh; }
.rail { display: none; }
@media (min-width: 920px) {
  .rail {
    width: 60px; flex: none; background: linear-gradient(180deg, var(--bg-2), var(--bg));
    border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: center;
    padding: 16px 0; gap: 5px; position: sticky; top: 0; height: 100dvh;
  }
  .rail .logo {
    width: 34px; height: 34px; border-radius: 10px;
    background: linear-gradient(150deg, var(--accent), var(--accent-2));
    display: grid; place-items: center; margin-bottom: 18px; border: 0; cursor: pointer;
    box-shadow: 0 4px 14px -4px rgba(91,155,255,.5), 0 1px 0 rgba(255,255,255,.2) inset;
  }
  .rail .logo svg { width: 18px; height: 18px; color: #fff; }
  .rail a {
    width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
    color: var(--ink-4); position: relative; transition: .15s;
  }
  .rail a.active { background: var(--accent-soft); color: var(--accent); }
  .rail a.active::before { content: ""; position: absolute; left: -10px; top: 11px; bottom: 11px; width: 3px; border-radius: 2px; background: var(--accent); }
  .rail a:hover:not(.active) { color: var(--ink-2); background: #151b26; }
  .rail svg { width: 20px; height: 20px; }
  .rail .sp { flex: 1; }
  .rail .tab-badge { position: absolute; top: 2px; right: 2px; }
}

.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top {
  height: 56px; flex: none; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  position: sticky; top: 0; z-index: 5;
}
.top h1 { font-family: var(--disp); font-size: 15.5px; font-weight: 600; letter-spacing: -.02em; margin: 0; }
.top .sub { color: var(--ink-3); font-size: 12px; margin-top: 1px; }
.top .spacer { flex: 1; }
.pill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 13px;
  border: 1px solid var(--line-2); border-radius: 9px; color: var(--ink-2); font-size: 12.5px;
  background: var(--panel); box-shadow: var(--shadow-sm); white-space: nowrap;
}
.pill svg { width: 14px; height: 14px; }
.pill.acc {
  color: #fff; border: none; cursor: pointer; font-weight: 600;
  background: linear-gradient(150deg, var(--accent), var(--accent-2));
  box-shadow: 0 3px 12px -3px rgba(91,155,255,.5), 0 1px 0 rgba(255,255,255,.25) inset;
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 3px var(--good-soft); animation: pulse 2.4s ease-in-out infinite; }
.dot.off { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); animation: none; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 3px rgba(67,200,146,.16); } 50% { box-shadow: 0 0 0 5px rgba(67,200,146,.05); } }
@media (max-width: 919px) { .top .pill.live { display: none; } .top .pill.acc { display: none; } }

.page { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; padding: 18px 20px calc(var(--tabbar-h) + 72px); }
@media (min-width: 920px) { .page { padding: 22px 26px 48px; } }

/* phone tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: color-mix(in srgb, var(--bg-2) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px));
}
.tabbar a { position: relative; flex: 1; max-width: 120px; display: grid; justify-items: center; gap: 3px; padding: 4px 0; color: var(--ink-4); font-size: 11px; font-weight: 600; }
.tabbar a svg { width: 20px; height: 20px; }
.tabbar a.active { color: var(--accent); }
.tab-badge {
  position: absolute; top: 0; right: calc(50% - 20px);
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: var(--bad); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-content: center; line-height: 1;
}
@media (min-width: 920px) { .tabbar { display: none; } }

.fab {
  position: fixed; right: 18px; bottom: calc(var(--tabbar-h) + 14px); z-index: 25;
  width: 54px; height: 54px; border-radius: 15px; border: 0;
  background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: #fff;
  box-shadow: 0 6px 20px -6px rgba(91,155,255,.55), 0 1px 0 rgba(255,255,255,.25) inset;
  font-size: 26px; cursor: pointer; display: grid; place-content: center;
}
@media (min-width: 920px) { .fab { display: none; } }

/* ---------- cards (reference component — shared app-wide) ---------- */
.card {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel));
  border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 16px;
}
.card + .card { margin-top: 14px; }
.card.tight, .card.chrome { padding: 0; overflow: hidden; }
.card.chrome > header {
  display: flex; align-items: center; gap: 10px; padding: 13px 17px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,.014), transparent);
}
.card.chrome > header .t { font-size: 11.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
.card.chrome > header svg { width: 15px; height: 15px; color: var(--ink-3); }
.card.chrome > header .r { margin-left: auto; color: var(--ink-4); font-size: 11px; letter-spacing: .02em; }

.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px; }
.grid3 .c2 { grid-column: span 2; }
.grid3 .c3 { grid-column: span 3; }
@media (max-width: 919px) { .grid3 { grid-template-columns: 1fr; } .grid3 .c2, .grid3 .c3 { grid-column: span 1; } }

/* ---------- status band (reference) ---------- */
.status {
  display: flex; align-items: center; gap: 15px; padding: 15px 18px;
  border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  margin-bottom: 18px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  color: inherit; cursor: pointer;
}
.status.bad { border-color: var(--bad-line); }
.status.bad::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, var(--bad-soft), transparent 52%); pointer-events: none; }
.status.warn { border-color: rgba(235,176,74,.4); }
.status.warn::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, var(--warn-soft), transparent 52%); pointer-events: none; }
.status .ic {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; flex: none;
  background: var(--inset); color: var(--ink-2); border: 1px solid var(--line-2); position: relative; z-index: 1;
}
.status.bad .ic { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.status.warn .ic { background: var(--warn-soft); color: var(--warn); border-color: rgba(235,176,74,.4); }
.status.ok .ic { background: var(--good-soft); color: var(--good); border-color: rgba(67,200,146,.35); }
.status .ic svg { width: 20px; height: 20px; }
.status .big { font-size: 21px; font-weight: 600; letter-spacing: -.025em; font-family: var(--disp); position: relative; z-index: 1; }
.status .big .amt { color: var(--bad); }
.status .meta { color: var(--ink-2); font-size: 13px; margin-top: 2px; position: relative; z-index: 1; }
.status .go {
  margin-left: auto; color: var(--ink-2); display: flex; align-items: center; gap: 6px; font-size: 12.5px;
  padding: 8px 13px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--inset);
  position: relative; z-index: 1; flex: none;
}
.status .go svg { width: 15px; height: 15px; }
@media (max-width: 640px) { .status .go span { display: none; } .status .go { padding: 8px; } }
.status-sub { margin: -8px 0 18px; font-size: 12.5px; cursor: pointer; }

/* ---------- the horizon matrix (reference) ---------- */
.mxwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mx { width: 100%; border-collapse: collapse; min-width: 640px; }
.mx thead th {
  font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em;
  padding: 11px 16px; text-align: right; border-bottom: 1px solid var(--line); position: relative; white-space: nowrap;
}
.mx thead th:first-child { text-align: left; }
.mx thead th.today { color: var(--accent); }
.mx thead th.today::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: -1px; height: 2px; background: var(--accent); border-radius: 2px; }
.mx thead th.peak { color: var(--ink-2); }
.mx tbody td { padding: 13px 16px; text-align: right; font-size: 14.5px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mx tbody td:first-child { text-align: left; }
.mx td.col-today { background: linear-gradient(180deg, var(--accent-soft), transparent); }
.mx td.col-peak { background: rgba(255,107,107,.05); }
.mx td.cell { cursor: pointer; }
.rowlab { color: var(--ink) !important; font-weight: 600 !important; font-size: 12.5px !important; font-family: var(--sans); }
.rowlab small { display: block; color: var(--ink-4); font-weight: 400; font-size: 10.5px; letter-spacing: .01em; margin-top: 1px; }
.mx .net td { background: var(--inset); border-top: 1px solid var(--line-2); border-bottom: none; }
.mx .net td.col-peak { background: rgba(255,107,107,.08); }
.mx .net .rowlab { font-size: 13px !important; }
.neg { color: var(--bad); }
.barwrap { display: flex; justify-content: flex-end; margin-top: 7px; }
.bar { height: 3px; border-radius: 2px; background: linear-gradient(90deg, rgba(255,107,107,.4), var(--bad)); }
.bar.pos { background: var(--line-2); }
.foot-note { color: var(--ink-3); font-size: 11.5px; padding: 11px 17px; border-top: 1px solid var(--line); background: rgba(255,255,255,.008); }
.foot-note b { color: var(--accent); font-weight: 500; cursor: pointer; }
/* phone: keep every column, pin the row labels, scroll the rest */
@media (max-width: 919px) {
  .mx td:first-child, .mx th:first-child {
    position: sticky; left: 0; z-index: 2;
    background: var(--panel);
  }
  .mx .net td:first-child { background: var(--inset); }
}

/* ---------- needs-you (reference) ---------- */
.needs { display: flex; flex-direction: column; }
.need { display: flex; align-items: center; gap: 12px; padding: 13px 17px; border-bottom: 1px solid var(--line); cursor: pointer; transition: .12s; }
.need:hover { background: rgba(255,255,255,.014); }
.need:last-child { border-bottom: none; }
.need .nic { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--inset); color: var(--ink-2); border: 1px solid var(--line); }
.need .nic.a { background: var(--bad-soft); color: var(--bad); border-color: var(--bad-line); }
.need .nic svg { width: 15px; height: 15px; }
.need .txt { font-size: 13px; color: var(--ink-2); }
.need .txt b { font-weight: 600; color: var(--ink); }
.need .cta { margin-left: auto; color: var(--ink-4); }
.need .cta svg { width: 16px; height: 16px; }

/* ---------- small multiples (reference) ---------- */
.sm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
@media (max-width: 480px) { .sm-grid { grid-template-columns: 1fr; } }
.sm {
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px 14px;
  background: var(--inset); box-shadow: var(--shadow-sm); position: relative; overflow: hidden; cursor: pointer;
}
.sm .h { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; gap: 8px; }
.sm .nm { font-size: 12px; color: var(--ink-2); font-weight: 600; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sm .bal { font-size: 15px; font-weight: 600; font-family: var(--mono); letter-spacing: -.02em; flex: none; }
.sm .runway { font-size: 11px; margin-bottom: 8px; }
.sm .runway.ok { color: var(--good); } .sm .runway.low { color: var(--warn); } .sm .runway.short { color: var(--bad); }
.sm svg.chart { display: block; width: 100%; height: 48px; }
.sm .foot { display: flex; justify-content: space-between; color: var(--ink-4); font-size: 10px; margin-top: 6px; }
.sm.empty { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-height: 118px; gap: 2px; cursor: default; }
.sm.empty .nm2 { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }
.sm.empty .warnline { color: var(--warn); font-size: 12px; margin: 5px 0 10px; display: flex; align-items: center; gap: 6px; }
.sm.empty .warnline svg { width: 14px; height: 14px; }
.mini-btn { font-size: 11.5px; color: var(--accent); border: 1px solid var(--accent-line); background: var(--accent-soft); padding: 6px 12px; border-radius: 8px; cursor: pointer; font-weight: 500; }

/* ---------- ageing (reference) ---------- */
.age { padding: 17px; display: flex; flex-direction: column; gap: 18px; }
.age .lab { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; gap: 10px; }
.age .lab .who { color: var(--ink-2); font-weight: 600; font-size: 12.5px; }
.age .lab .tot { font-weight: 600; font-family: var(--mono); font-size: 13.5px; letter-spacing: -.02em; }
.stack { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--inset); gap: 2px; }
.stack i { display: block; height: 100%; border-radius: 2px; cursor: pointer; }
.s1 { background: #33415A; } .s2 { background: #45577A; } .s3 { background: #5F75A0; } .s4 { background: var(--bad); }
:root[data-theme="light"] .s1 { background: #C6D2E4; }
:root[data-theme="light"] .s2 { background: #9DB1CE; }
:root[data-theme="light"] .s3 { background: #6F8CB4; }
.age .key { display: flex; gap: 15px; margin-top: 6px; font-size: 11px; color: var(--ink-3); flex-wrap: wrap; }
.age .key span { display: flex; align-items: center; gap: 6px; }
.age .key i { width: 8px; height: 8px; border-radius: 2px; display: block; }

/* ---------- clearing table (reference ".rows" table, renamed .ctbl) ---------- */
.ctbl { width: 100%; border-collapse: collapse; }
.ctbl th { font-size: 11px; font-weight: 600; color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; padding: 10px 17px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ctbl th.n { text-align: right; }
.ctbl td { padding: 12px 17px; font-size: 13px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ctbl tr:last-child td { border-bottom: none; }
.ctbl tr { cursor: pointer; }
.ctbl tr:hover td { background: rgba(255,255,255,.014); }
.ctbl td.n { text-align: right; }
.ctbl .payee { font-weight: 550; color: var(--ink); }
.ctbl .cn { color: var(--ink-4); font-size: 11px; font-family: var(--mono); }
.ctbl .acct { color: var(--ink-3); font-size: 12px; }
.ctbl .risk { color: var(--bad); font-weight: 600; }
.ctbl .amt { font-family: var(--mono); font-size: 13px; letter-spacing: -.02em; color: var(--ink); }
.ctbl td.payee-cell { max-width: 0; width: 46%; overflow: hidden; text-overflow: ellipsis; }
.flag { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); margin-right: 8px; vertical-align: middle; box-shadow: 0 0 0 3px var(--bad-soft); }
.seeall { padding: 12px; text-align: center; color: var(--accent); font-size: 12px; border-top: 1px solid var(--line); cursor: pointer; background: rgba(255,255,255,.008); }
.seeall:hover { background: var(--accent-soft); }

/* ============================================================
   Legacy components — restyled onto the new tokens so every
   other screen (Cheques, Money, Timeline, More-land) is coherent.
   ============================================================ */

/* verdict block (Timeline) */
.verdict { display: block; padding: 24px 0 20px; color: inherit; }
.verdict .lead { margin-bottom: 10px; }
.verdict .big { font-family: var(--disp); font-size: 44px; font-weight: 700; line-height: 1.05; letter-spacing: -.025em; }
.verdict .under { margin-top: 10px; font-size: 15px; }
.verdict .whisper { margin-top: 8px; font-size: 12.5px; color: var(--ink-3); }

.instruction { padding: 15px 17px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.instruction .t-micro { display: block; margin-bottom: 4px; }

.rows .row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-top: 1px solid var(--line); cursor: pointer; min-height: 52px; }
.rows .row:first-child { border-top: 0; }
.row .main { flex: 1; min-width: 0; }
.row .p { font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .amt { text-align: right; flex: none; }
.row .amt .m { font-family: var(--mono); font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.row .amt .d { font-size: 12px; color: var(--ink-3); margin-top: 1px; }

.section-h { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 10px; }
.section-h .right { margin-left: auto; font-size: 12.5px; }

.strip {
  display: flex; align-items: center; gap: 12px; padding: 12px 16px;
  border-radius: var(--r); background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow-sm); font-size: 12.5px; cursor: pointer;
}
.strip .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.banner {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--r); margin: 0 0 16px;
  background: var(--warn-soft); border: 1px solid rgba(235, 176, 74, .35);
  color: var(--ink); font-size: 13px; line-height: 1.5;
}
.banner .mark { color: var(--warn); font-weight: 700; flex: none; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; border: 1px solid var(--line-2); color: var(--ink-2); background: transparent; white-space: nowrap; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 11px;
  border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
  font-weight: 600; font-size: 14px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.btn:active { opacity: .8; }
.btn.primary { background: linear-gradient(150deg, var(--accent), var(--accent-2)); border: none; color: #fff; box-shadow: 0 3px 12px -3px rgba(91,155,255,.5), 0 1px 0 rgba(255,255,255,.25) inset; }
.btn.danger { background: transparent; border-color: var(--bad-line); color: var(--bad); box-shadow: none; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-row { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-row .grow, .btn.grow { flex: 1; }
a.quiet { color: var(--ink-3); }

/* forms */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; min-height: 46px; padding: 12px 14px;
  border: 1px solid var(--line-2); border-radius: 11px;
  background: var(--inset); color: var(--ink); font: inherit;
}
textarea.input { min-height: 72px; resize: vertical; }
.input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.input.money { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.form-grid .span2 { grid-column: span 2; }
.hint { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }
.switch { display: flex; align-items: center; gap: 12px; padding: 10px 0; font-size: 14px; cursor: pointer; }
.switch input { width: 19px; height: 19px; accent-color: var(--accent); }

.seg { display: flex; gap: 4px; background: var(--inset); border: 1px solid var(--line); border-radius: 11px; padding: 4px; overflow-x: auto; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 14px; border-radius: 8px; font-weight: 600; font-size: 12.5px; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.seg button.active { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-sm); }

/* sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(2, 4, 8, .6); display: flex; align-items: flex-end; justify-content: center; animation: fade 150ms ease; }
.sheet {
  background: linear-gradient(180deg, var(--panel-hi), var(--panel)); width: 100%; max-width: 560px;
  border: 1px solid var(--line-2); border-bottom: none;
  border-radius: var(--r) var(--r) 0 0; max-height: 92dvh; overflow: auto;
  padding: 8px 20px calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: var(--sheet-shadow); animation: fade 150ms ease;
}
@media (min-width: 720px) { .sheet-backdrop { align-items: center; padding: 24px; } .sheet { border-radius: var(--r); border-bottom: 1px solid var(--line-2); max-height: 86dvh; } }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line-2); margin: 8px auto 12px; }
.sheet h2 { font-family: var(--disp); font-size: 16px; font-weight: 600; margin: 4px 0 16px; }
@keyframes fade { from { opacity: 0; } }

.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + 12px); z-index: 60; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--panel-hi); border: 1px solid var(--line-2); color: var(--ink); padding: 12px 20px; border-radius: 11px; font-size: 13px; font-weight: 600; max-width: 92vw; box-shadow: var(--shadow); animation: fade 150ms ease; }
.toast.err { background: #3A1214; border-color: var(--bad-line); color: #FFC9C9; }

/* generic tables */
.tbl-wrap { overflow-x: auto; }
table.tbl { border-collapse: collapse; width: 100%; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-3); padding: 8px 10px; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl td { padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td.r, .tbl th.r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* calendar */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal .dow { text-align: center; font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--ink-3); padding: 6px 0; text-transform: uppercase; }
.cal .day { min-height: 64px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; font-size: 11px; background: var(--panel); cursor: pointer; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.cal .day.dim { opacity: .4; }
.cal .day.today { border-color: var(--accent); }
.cal .day.shortday { border-color: var(--bad); border-width: 1.5px; }
.cal .day .n { font-weight: 600; color: var(--ink-3); }
.cal .day .flow { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; }
.cal .day .flow.neg { color: var(--ink-3); }
@media (min-width: 720px) { .cal .day { min-height: 84px; font-size: 12.5px; } }

/* misc */
.empty { text-align: center; padding: 44px 24px; color: var(--ink-3); font-size: 13px; }
.empty .big { font-size: 15px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.small { font-size: 12.5px; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.flex { display: flex; align-items: center; gap: 12px; }
.flex .grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.divider { height: 1px; background: var(--line); margin: 16px 0; }
.photo-thumb { width: 52px; height: 52px; border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--line-2); }
.photo-full { width: 100%; border-radius: var(--r-sm); border: 1px solid var(--line-2); }
.login-wrap { min-height: 100dvh; display: grid; place-content: center; padding: 24px; }
.login-card { width: min(92vw, 380px); background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; }
.skel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); animation: fade 150ms ease; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .input { min-height: 38px; }
.toolbar .search { flex: 1; min-width: 160px; }

/* Money-screen summary tiles */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpi { background: linear-gradient(180deg, var(--panel-hi), var(--panel)); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 11px 13px; box-shadow: var(--shadow-sm); cursor: pointer; min-width: 0; }
.kpi .k { color: var(--ink-2); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .v { font-family: var(--mono); font-size: 16px; font-weight: 600; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi.good .v { color: var(--good); } .kpi.warn .v { color: var(--warn); } .kpi.bad .v { color: var(--bad); } .kpi.brand .v { color: var(--accent); }

/* settings grid (legacy) */
.settings-grid { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
@media (min-width: 980px) { .settings-grid { grid-template-columns: 1fr 1fr; } }
.settings-grid .card { margin: 0; }

/* ---------- theme toggle (topbar pill + labeled More/Settings button) ---------- */
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.theme-toggle svg { display: block; }
.pill.theme-toggle { padding: 7px 10px; }
