/*
  Leadsler design system "Het bureau" (2026-10-17; docs/dashboard-redesign/DESIGN-SYSTEM.md) — a calm work tool in the
  materials of the public homepage (home.css v4): its navy-tinted palette, Bricolage Grotesque for the one page title,
  radii 12 · 8 · 5 and navy-tinted shadows. Tokens first, then the shell, then shared components. Domain workstreams
  own their own <domain>.css and only use the tokens and components defined here.

  Principles: one loud thing per page (the decision). Marigold (--mari) means only "waiting for your OK", green done,
  red broken; blue is the action colour, not a status. Zero is a sentence, not a headline. Sentence case everywhere —
  no all-caps labels. Provenance stays visible wherever a number is not measured (.pm marks); measured is the unmarked
  default and the page legend says so. Light is the default and dark follows prefers-color-scheme, as on the homepage.
  Same-origin fonts only (CSP).
*/
@font-face { font-family: "Bricolage Grotesque"; src: url("bricolage-800-latin.woff2") format("woff2"); font-weight: 800; font-style: normal; font-display: swap; }

/*
  Tokens. Colour tokens come in two sets (light is the default, dark under prefers-color-scheme); `.scheme-dark` /
  `.scheme-light` re-declare a set on any element so one page can show both (the /design style guide does).
  Scheme-independent tokens (type, spacing, radii, motion) live in :root.
*/
:root {
  /* ── type scale ── display numbers · page title · section title · card title · body · meta · small label */
  --fs-display: 44px;
  --fs-h1: clamp(24px, 0.8vw + 18px, 32px);
  --fs-h2: 16px;
  --fs-h3: 14px;
  --fs-body: 14px;
  --fs-meta: 13px;
  --fs-micro: 12px;
  --lh-tight: 1.15;
  --lh-body: 1.5;
  --track-caps: 0;
  /* ── spacing scale ── */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 48px;
  /* ── shape & motion (homepage radii and curves) ── */
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --radius-xs: 5px;
  --dur: 0.16s;
  --m-out: cubic-bezier(0.2, 0.8, 0.2, 1);
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI Variable Text', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --display: 'Bricolage Grotesque', -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Display', 'Segoe UI', Roboto, Arial, sans-serif;
  --sidebar-w: 232px;
  --bottombar-h: 60px;
}

/* light (default) — the homepage's paper */
:root, .scheme-light {
  --bg: #f3f4f7;
  --bg-2: #e9ecf2;
  --panel: #ffffff;
  --panel-2: #eef0f5;
  --line: #dde1ea;
  --line-2: #c6ccda;
  --text: #10182f;
  --text-2: #3a4460;
  --text-3: #5a6480;
  --accent: #2f55d4;
  --accent-2: #2f55d4;
  --accent-hover: #2446b8;
  --accent-ink: #ffffff;
  --good: #1f7a4d;
  --warn: #8a5300; /* marigold as text: ≥ 4.8:1 on every surface */
  --mari: #f2b43e; /* waiting for your OK — fills and dots only */
  --bad: #b4233c;
  --info: #2b6a9b;
  --violet: #5b4fa8;
  /* surface levels: 0 page · 1 rail · 2 panel · 3 raised (hover, inset) */
  --surface-0: #f3f4f7;
  --surface-1: #e9ecf2;
  --surface-2: #ffffff;
  --surface-3: #eef0f5;
  --line-soft: #e6e9f0;
  --shadow: none;
  /* elevation is reserved for things that float: dialogs, popovers, the desk card */
  --shadow-1: 0 1px 2px rgba(16, 24, 47, 0.06), 0 18px 48px -24px rgba(16, 24, 47, 0.34);
  --skeleton: #e6e9f0;
  --skeleton-2: #dde1ea;
  /* the desk band: the homepage's dark stage, the one loud element on a page */
  --stage: #0b1122;
  --stage-2: #121a31;
  --stage-ink: #f3f5fb;
  --stage-ink-2: #b9c2d8;
  --stage-muted: #8b95ae;
  --stage-line: rgba(255, 255, 255, 0.09);
  color-scheme: light;
}

/* dark */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c111e;
    --bg-2: #10172b;
    --panel: #151d33;
    --panel-2: #1b2440;
    --line: #232d48;
    --line-2: #34405f;
    --text: #eef1f8;
    --text-2: #b8c0d4;
    --text-3: #8f99b0;
    --accent: #8fb0ff;
    --accent-2: #3866ee;
    --accent-hover: #2f5bd8; /* white label stays ≥ 4.5:1 on hover too */
    --accent-ink: #ffffff;
    --good: #4fcf93;
    --warn: #f2c063;
    --mari: #f2b43e;
    --bad: #f0748a;
    --info: #7cb9e8;
    --violet: #b5a3f2;
    --surface-0: #0c111e;
    --surface-1: #10172b;
    --surface-2: #151d33;
    --surface-3: #1b2440;
    --line-soft: #1b2440;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 60px -28px rgba(0, 0, 0, 0.8);
    --skeleton: #1b2440;
    --skeleton-2: #232d48;
    --stage: #070b17;
    --stage-2: #1a2547;
    color-scheme: dark;
  }
}
.scheme-dark {
  --bg: #0c111e;
  --bg-2: #10172b;
  --panel: #151d33;
  --panel-2: #1b2440;
  --line: #232d48;
  --line-2: #34405f;
  --text: #eef1f8;
  --text-2: #b8c0d4;
  --text-3: #8f99b0;
  --accent: #8fb0ff;
  --accent-2: #3866ee;
  --accent-hover: #2f5bd8;
  --accent-ink: #ffffff;
  --good: #4fcf93;
  --warn: #f2c063;
  --mari: #f2b43e;
  --bad: #f0748a;
  --info: #7cb9e8;
  --violet: #b5a3f2;
  --surface-0: #0c111e;
  --surface-1: #10172b;
  --surface-2: #151d33;
  --surface-3: #1b2440;
  --line-soft: #1b2440;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 60px -28px rgba(0, 0, 0, 0.8);
  --skeleton: #1b2440;
  --skeleton-2: #232d48;
  --stage: #070b17;
  --stage-2: #1a2547;
  color-scheme: dark;
}
/* derived (scheme-agnostic): soft fills for semantic tones, categorical chart colours */
:root, .scheme-dark, .scheme-light {
  --good-soft: color-mix(in srgb, var(--good) 11%, transparent);
  --warn-soft: color-mix(in srgb, var(--warn) 11%, transparent);
  --bad-soft: color-mix(in srgb, var(--bad) 11%, transparent);
  --info-soft: color-mix(in srgb, var(--info) 11%, transparent);
  --accent-soft: color-mix(in srgb, var(--accent) 11%, transparent);
  --mari-soft: color-mix(in srgb, var(--mari) 18%, transparent);
  --chart-1: var(--accent);
  --chart-2: var(--violet);
  --chart-3: var(--good);
  --chart-4: var(--warn);
  --chart-5: var(--info);
  --chart-6: var(--bad);
  --chart-7: var(--text-3);
  --chart-8: var(--line-2);
}
.scheme-dark, .scheme-light { background: var(--bg); color: var(--text); }

/* ───────── base ───────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body) / var(--lh-body) var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
  -webkit-tap-highlight-color: color-mix(in srgb, var(--accent) 15%, transparent);
}
a, button, summary, label, .btn { touch-action: manipulation; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: var(--mono); font-size: 12.5px; }
pre { white-space: pre-wrap; word-break: break-word; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; margin: 0; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; line-height: 1.25; text-wrap: balance; }
h1 { font-family: var(--display); font-weight: 800; font-size: var(--fs-h1); letter-spacing: -0.028em; line-height: 1.08; }
h2 { font-size: var(--fs-h2); letter-spacing: -0.01em; }
h3 { font-size: 14px; }
p { margin: 0 0 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.meta { font-size: var(--fs-meta); color: var(--text-2); }
.nowrap { white-space: nowrap; }
.clip { max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash { color: var(--text-3); }
.kicker { font-size: var(--fs-meta); font-weight: 600; color: var(--text-3); }
.prov { font-size: 10px; font-weight: 600; letter-spacing: 0.07em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.prov.good { color: var(--good); }
.prov.warn { color: var(--warn); }
.prov.bad { color: var(--bad); }
/* Provenance mark (ui.tsx ProvTag): one quiet word after a number that is not measured; measured numbers carry none (the page legend says so). */
/* Labels are sentence case; strings that were written for the old caps style still start with a capital. */
.kicker::first-letter, .nav-label::first-letter, .stat .label::first-letter, th::first-letter, .fact .label::first-letter, .facts-grid dt::first-letter, .tree-head::first-letter, .filter-group .fl::first-letter { text-transform: uppercase; }
.pm { font-size: 12px; font-weight: 450; color: var(--text-3); text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, var(--text-3) 70%, transparent); text-underline-offset: 3px; white-space: nowrap; cursor: help; }
abbr.pm { border: 0; }
.pm.warn { color: var(--warn); }
.pm.measured { text-decoration: none; cursor: default; }
.page-legend { margin: 40px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12.5px; max-width: none; text-wrap: pretty; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 60; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--text); color: var(--bg); font-weight: 600; }
.skip:focus { top: 10px; text-decoration: none; }
main.content:focus-visible { outline: none; }
/* Focus: one ring everywhere — a 2px accent ring lifted off the element by the page colour. */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.btn:focus-visible, .seg a:focus-visible, .nav a:focus-visible, .subnav a:focus-visible, .tabs a:focus-visible { outline-offset: 1px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }

/* ───────── shell ─────────
   Sidebar (rail): the mark, four navigation groups with icons and counts, secondary links, the signed-in
   member. Top bar: global status, the kill switch, "Needs you" as the one call to action, account menu. */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; scrollbar-width: thin; overscroll-behavior: contain;
  background: var(--surface-1); border-right: 1px solid var(--line);
  padding: 16px 12px 14px; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 10px 16px; margin-bottom: 4px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; flex: none; border-radius: 7px; display: block; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 800 19px/1 var(--display); letter-spacing: -0.03em; }
.brand-sub { font-size: 11px; color: var(--text-3); line-height: 1.2; margin-top: 2px; letter-spacing: 0.02em; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-group { display: flex; flex-direction: column; gap: 1px; padding-top: 6px; }
.nav-group + .nav-group { margin-top: 8px; }
.nav-label { padding: 8px 10px 4px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.nav a {
  position: relative; display: flex; align-items: center; gap: 9px;
  min-height: 36px; padding: 6px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 14px; font-weight: 500; line-height: 1.3;
  transition: background-color var(--dur), color var(--dur);
}
.nav a .ico { width: 16px; height: 16px; color: var(--text-3); flex: none; transition: color var(--dur); }
.nav a .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav a:hover { background: var(--surface-3); color: var(--text); text-decoration: none; }
.nav a:hover .ico { color: var(--text-2); }
.nav a.active { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 0 0 1px var(--line); }
.nav a.active .ico { color: var(--accent); }
.nav a.active::before { content: ''; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; background: var(--accent); border-radius: 0 2px 2px 0; }
.nav .count {
  font-size: 12px; min-width: 22px; text-align: center; padding: 0 7px; border-radius: 10px;
  background: var(--mari-soft); color: var(--warn); line-height: 20px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none;
}
.nav .count.soft { background: var(--line-2); color: var(--text-2); }
.nav-secondary { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); }
.nav-secondary a { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.nav-secondary a .ico { width: 15px; height: 15px; }
.nav-secondary .who { display: flex; align-items: center; gap: 8px; padding: 10px 10px 2px; font-size: 11.5px; color: var(--text-3); min-width: 0; }
.nav-secondary .who .lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background: var(--accent-2); color: var(--accent-ink); font-size: 11px; font-weight: 600; letter-spacing: 0; line-height: 1;
}

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px;
  height: 52px; padding: 0 32px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.topbar .now { display: flex; gap: 8px; align-items: center; color: var(--text-2); font-size: 13.5px; flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.topbar .now .now-state { color: var(--text); font-weight: 600; flex: none; }
.topbar .now .now-sep { color: var(--text-3); flex: none; }
.topbar .now [data-now-text] { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.topbar .badge.bad { flex: none; }
/* account menu: a native <details> popover, no script needed */
.user-menu { position: relative; flex: none; }
.user-menu summary {
  list-style: none; display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 6px 0 4px; border-radius: 15px;
  color: var(--text-2); font-size: 12.5px; cursor: pointer; border: 1px solid transparent; max-width: 260px; min-width: 0; user-select: none;
  transition: border-color var(--dur), background-color var(--dur);
}
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover, .user-menu[open] summary { border-color: var(--line-2); background: var(--panel); color: var(--text); }
.user-menu summary .who { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.user-menu summary .ico { color: var(--text-3); }
.user-menu .menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 1px;
}
.user-menu .menu-who { padding: 6px 10px 8px; font-size: 12px; color: var(--text-3); border-bottom: 1px solid var(--line); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu .menu > a { display: block; padding: 7px 10px; border-radius: var(--radius-sm); color: var(--text-2); font-size: 13px; font-weight: 500; }
.user-menu .menu > a:hover { background: var(--panel-2); color: var(--text); text-decoration: none; }
.user-menu .menu-form { padding: 4px 4px 2px; border-top: 1px solid var(--line); margin-top: 4px; }
.user-menu .menu-form .btn { width: 100%; justify-content: flex-start; }
.overlay { display: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); flex: none; }
.dot.good { background: var(--good); }
.dot.warn { background: var(--mari); }
.dot.wait { background: var(--mari); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mari) 26%, transparent); }
.dot.bad { background: var(--bad); }
.dot.pulse { animation: pulse 1.8s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.3; } }
.subnav {
  display: flex; gap: 4px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--bg);
  overflow-x: auto; scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  display: inline-flex; align-items: center; gap: 6px; padding: 12px 10px 11px; margin-bottom: -1px;
  font-size: 14px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap;
  transition: color var(--dur);
}
.subnav a:hover { color: var(--text); text-decoration: none; }
.subnav a.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.subnav .count { font-size: 11px; padding: 0 5px; border-radius: 8px; background: var(--line-2); color: var(--text-2); line-height: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.subnav .count.hard { background: var(--mari-soft); color: var(--warn); }
.content { padding: 28px 32px 72px; max-width: 1344px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head .sub { color: var(--text-2); margin-top: 8px; max-width: 72ch; font-size: 14px; text-wrap: pretty; }
.page-head .kicker { margin-bottom: 4px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ───────── layout grid ───────── */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span3 { grid-column: span 3; }
.g12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.c3 { grid-column: span 3; }
.c4 { grid-column: span 4; }
.c5 { grid-column: span 5; }
.c6 { grid-column: span 6; }
.c7 { grid-column: span 7; }
.c8 { grid-column: span 8; }
.c12 { grid-column: span 12; }
.mb { margin-bottom: 16px; }
.mt { margin-top: 16px; }

/* ───────── panels ───────── */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); min-height: 46px; }
.card-head h2 { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; line-height: 1.4; }
.card-head .hint { color: var(--text-3); font-size: 12px; margin-top: 2px; text-wrap: pretty; }
.card-head .actions { flex: none; }
.card-body { padding: 14px 16px; }
.card-body.flush { padding: 0; overflow-x: auto; }
.card-foot { padding: 10px 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12px; text-wrap: pretty; }
.card > .empty:last-child, .card-body.flush > .empty { border-top: 0; }
.stat { padding: 14px 16px; }
.stat .label { color: var(--text-3); font-size: var(--fs-meta); font-weight: 500; }
.stat .value { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.stat .hint { color: var(--text-2); font-size: 12px; margin-top: 6px; }
.stat.good .value { color: var(--good); }
.stat.warn .value { color: var(--warn); }
.stat.bad .value { color: var(--bad); }
a.stat-link { color: inherit; display: block; }
a.stat-link:hover { text-decoration: none; }
a.stat-link:hover .card { border-color: var(--line-2); }

/* ───────── tables ───────── */
.table-wrap { overflow-x: auto; }
/* A tall wrap scrolls inside the card and keeps its header row visible. */
.table-wrap.tall { max-height: 60vh; overflow: auto; }
.table-wrap.tall table { border-collapse: separate; border-spacing: 0; } /* collapsed borders scroll away under a sticky header */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: var(--fs-micro); color: var(--text-3); font-weight: 600; background: var(--panel); border-bottom-color: var(--line-2); position: sticky; top: 0; z-index: 1; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--panel-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
th.center, td.center { text-align: center; }
td .sub { color: var(--text-3); font-size: 12px; margin-top: 2px; }
td.mid, tr.mid td { vertical-align: middle; }
/* A cell that takes the remaining width and truncates instead of widening the table. */
td.cell-clip { width: 100%; max-width: 0; }
td.cell-clip .clip, td.cell-clip a { max-width: 100%; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* density: compact (dense scanning) · default · comfortable (reading) */
table.dense th, table.dense td { padding: 6px 10px; font-size: 13px; }
table.comfortable th, table.comfortable td { padding: 12px 14px; }
/* A row that is one link: the whole row highlights, the first cell carries the link. */
tr.linkrow { cursor: pointer; }
tr.linkrow:hover td { background: var(--panel-2); }
td.actions-cell { text-align: right; white-space: nowrap; }
th.sortable a { color: inherit; display: inline-flex; align-items: center; gap: 4px; }
th.sortable a:hover { color: var(--text); text-decoration: none; }
th.sorted { color: var(--text); }
th .sort-mark { font-size: 9px; opacity: 0.8; }
tfoot td { background: var(--panel); border-top: 1px solid var(--line-2); border-bottom: 0; font-weight: 600; color: var(--text); }
td.neg, .neg-num { color: var(--bad); }
td.pos, .pos-num { color: var(--good); }

/* ───────── badges ───────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 0 7px; border-radius: var(--radius-xs); font-size: 12px; font-weight: 600;
  background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line-2); white-space: nowrap; line-height: 20px;
}
.badge.good { color: var(--good); border-color: color-mix(in srgb, var(--good) 35%, transparent); background: color-mix(in srgb, var(--good) 9%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: color-mix(in srgb, var(--warn) 9%, transparent); }
.badge.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: color-mix(in srgb, var(--bad) 9%, transparent); }
.badge.info { color: var(--info); border-color: color-mix(in srgb, var(--info) 35%, transparent); background: color-mix(in srgb, var(--info) 9%, transparent); }
.badge.violet { color: var(--violet); border-color: color-mix(in srgb, var(--violet) 35%, transparent); background: color-mix(in srgb, var(--violet) 9%, transparent); }
.badge.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); background: color-mix(in srgb, var(--accent) 9%, transparent); }
/* a badge with a leading status dot: <span class="badge good dotted">…</span> */
.badge.dotted::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge.lg { font-size: 12px; line-height: 22px; padding: 0 8px; }
/* a small count in a neutral pill (nav-style), used inline */
.count-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 9px; background: var(--line-2); color: var(--text-2); font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums; }
.count-pill.hard { background: var(--bad); color: #fff; }

/* ───────── forms & buttons ───────── */
form.inline { display: inline; }
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--line-2); background: var(--panel); color: var(--text);
  font: 600 13.5px var(--sans); cursor: pointer; white-space: nowrap; line-height: 1;
  transition: background-color var(--dur), border-color var(--dur), color var(--dur), transform var(--dur) var(--m-out);
}
.btn:hover { border-color: var(--text-3); text-decoration: none; background: var(--panel-2); transform: translateY(-1px); }
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; font-weight: 600; }
.btn.danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { border-color: transparent; color: var(--text); background: var(--panel-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 14.5px; border-radius: var(--radius); }
.btn.icon { width: 32px; padding: 0; }
.btn.icon.sm { width: 28px; }
.btn .ico { width: 15px; height: 15px; flex: none; }
.btn.sm .ico { width: 13px; height: 13px; }
.btn[disabled], .btn[aria-disabled=true] { opacity: 0.5; cursor: not-allowed; }
/* Busy: app.js adds .busy + aria-busy to the submitting button; a ring spinner replaces the label. */
.btn.busy { color: transparent !important; pointer-events: none; opacity: 1; }
.btn.busy::after {
  content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--text) 25%, transparent); border-top-color: var(--text);
  animation: spin 0.7s linear infinite;
}
.btn.primary.busy::after, .btn.good.busy::after, .btn.danger.busy::after { border-color: rgba(255, 255, 255, 0.35); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; background: var(--bg-2); color: var(--text); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 7px 10px; font: 13.5px var(--sans); transition: border-color var(--dur);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { min-height: 90px; resize: vertical; font-family: var(--sans); }
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 0; border-color: var(--accent); }
label { display: block; font-size: 12px; color: var(--text-2); margin: 10px 0 4px; font-weight: 600; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text); margin: 6px 0; font-weight: 500; }
input[type=checkbox], input[type=radio] { accent-color: var(--accent-2); width: 16px; height: 16px; margin: 0; }
@media (pointer: coarse) { input[type=checkbox], input[type=radio] { width: 22px; height: 22px; } }

/* ───────── empty states ───────── */
.empty { padding: 22px 16px; color: var(--text-2); font-size: 13px; max-width: 560px; }
.empty strong { display: block; color: var(--text); margin-bottom: 3px; font-weight: 600; }
.empty p { margin: 0 0 6px; text-wrap: pretty; }
.empty .next { margin-top: 10px; }
.empty.center { text-align: center; margin: 0 auto; }

/* ───────── misc shared ───────── */
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: 13px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.bar { height: 4px; border-radius: 2px; background: var(--line-2); overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--accent-2); border-radius: 2px; }
.bar.neg > span { background: var(--bad); }
.score-grid { display: grid; grid-template-columns: 170px 1fr 48px; gap: 6px 10px; align-items: center; font-size: 12.5px; }
.score-grid .why { grid-column: 1 / -1; color: var(--text-3); font-size: 11.5px; margin: -3px 0 5px; }
.alert { border-radius: var(--radius); padding: 12px 14px; border: 1px solid var(--line-2); background: var(--panel); margin-bottom: 16px; }
.alert.bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.alert.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.alert.good { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.flash { position: fixed; right: 20px; bottom: 20px; z-index: 20; max-width: 420px; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 9px 16px; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.row { display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 6px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 7px 10px; margin-bottom: -1px; color: var(--text-2); border-bottom: 2px solid transparent; font-weight: 500; font-size: 13px; }
.tabs a.active { color: var(--text); border-bottom-color: var(--accent-2); }
.tabs a:hover { text-decoration: none; color: var(--text); }
.action-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 16px 18px; }
.action-card + .action-card { margin-top: 12px; }
.action-card .kicker { color: var(--accent); }
.action-card h3 { font-size: 15px; margin: 4px 0 8px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 10px 0; }
.steps li { counter-increment: s; position: relative; padding-left: 30px; margin: 8px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: var(--radius-sm); background: var(--accent-2); color: var(--accent-ink); font-size: 11px; font-weight: 600; display: grid; place-items: center; }
.copy-block { position: relative; }
.copy-block button { position: absolute; top: 6px; right: 6px; }
.copy-block pre { padding-right: 76px; }
video { max-width: 100%; border-radius: var(--radius-sm); background: #000; }
.thumb { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--bg-2); }
.thumb.lg { width: 140px; height: 140px; }
.pipeline { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.pipeline .stage { background: var(--panel); padding: 8px 6px; text-align: center; min-width: 0; }
.pipeline .stage .n { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.2; }
.pipeline .stage .l { font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
.pipeline .stage.zero .n { color: var(--text-3); font-weight: 500; }
.pipeline .stage.hot .n { color: var(--accent); }
.login-wrap { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; }
.login-card { width: 100%; max-width: 400px; }
.spark { display: inline-block; vertical-align: middle; }
.spark polyline { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.spark .area { fill: color-mix(in srgb, var(--accent) 12%, transparent); stroke: none; }
.chart { width: 100%; height: auto; display: block; }
.chart .gridline { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--text-3); font-size: 10px; font-family: var(--sans); }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.chart .area { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.chart .pt { fill: var(--accent); }
details > summary { cursor: pointer; color: var(--text-2); font-weight: 500; }
.claim { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.claim:last-child { border-bottom: 0; }
.claim .ev { margin: 6px 0 0 0; padding-left: 14px; border-left: 2px solid var(--line-2); color: var(--text-2); font-size: 12.5px; }
.beat { display: grid; grid-template-columns: 90px 1fr; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.beat:last-child { border-bottom: 0; }
.beat .t { font-family: var(--mono); color: var(--text-3); font-size: 12px; }
.beat .sec { font-size: 12px; font-weight: 600; color: var(--accent); }

/* ───────── command center ───────── */
.cc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.cc-head .meta { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.cc-head .meta b { color: var(--text); font-weight: 600; }
.cc-hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; margin-bottom: 16px; }
.cc-revenue { padding: 20px 22px 18px; }
.cc-revenue .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.display { font-size: 46px; font-weight: 600; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; margin: 10px 0 6px; }
.display.zero { color: var(--text-3); font-weight: 500; font-size: 34px; }
.cc-revenue .sub { color: var(--text-2); font-size: 13px; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.facts.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fact .label { font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.fact .v { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; margin-top: 3px; letter-spacing: -0.01em; }
.fact .v.zero { color: var(--text-3); font-weight: 500; }
.milestones { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.milestones .row { align-items: baseline; }
.milestones .distance { font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.track { display: flex; gap: 4px; margin-top: 10px; }
.track .m { flex: 1; height: 4px; background: var(--line-2); border-radius: 2px; overflow: hidden; }
.track .m.done { background: var(--good); }
.track .m > span { display: block; height: 100%; background: var(--accent-2); }
.track-labels { display: flex; gap: 4px; margin-top: 6px; }
.track-labels span { flex: 1; font-size: 10.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.track-labels span.done { color: var(--good); }
.track-labels span.next { color: var(--text); font-weight: 600; }
.streams { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12.5px; color: var(--text-2); }
.streams b { color: var(--text); font-variant-numeric: tabular-nums; font-weight: 600; }
.route-line { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; align-items: baseline; }
.route-line .path { color: var(--text); }
.route-line .state { grid-column: 2; color: var(--text-2); }
.cc-next { border-left: 3px solid var(--accent-2); padding: 18px 20px; display: flex; flex-direction: column; }
.cc-next .kicker { color: var(--accent); }
.cc-next h2 { font-size: 17px; font-weight: 600; line-height: 1.3; margin: 6px 0 8px; letter-spacing: -0.012em; }
.cc-next .why { color: var(--text-2); font-size: 13px; }
.cc-next .meta { color: var(--text-3); font-size: 12px; margin-top: 8px; }
.cc-next .actions { margin-top: 14px; }
.cc-next .also { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.cc-next .also .kicker { color: var(--text-3); }
.cc-next .also .row a { font-size: 12px; white-space: nowrap; }
.cc-next .also .else { color: var(--text-3); font-size: 12.5px; }
.also-list { list-style: none; margin: 8px 0 0; padding: 0; }
.also-list li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; font-size: 13px; min-width: 0; border-bottom: 1px solid var(--line); }
.also-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.also-list a { color: var(--text-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.also-list a:hover { color: var(--text); }
.also-list .for { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }
.strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 16px; }
.strip > * { padding: 12px 16px; border-right: 1px solid var(--line); min-width: 0; color: inherit; }
.strip > a:hover { text-decoration: none; background: var(--panel-2); }
.strip > :last-child { border-right: 0; }
.strip .label { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--text-3); font-weight: 500; }
.strip .v { font-size: 15px; font-weight: 600; margin-top: 4px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.strip .hint { color: var(--text-3); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--line); font-size: 13px; align-items: center; }
.checks li:last-child { border-bottom: 0; }
.checks .mark { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--text-3); }
.checks .mark.met { background: var(--good); border-color: var(--good); }
.checks .mark.missed { background: var(--bad); border-color: var(--bad); }
.checks .actual { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.checks .actual b { color: var(--text); font-weight: 600; }
.checks .primary { font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 13px; min-width: 0; }
.feed li:last-child { border-bottom: 0; }
.feed .what { min-width: 0; }
.feed .what .sub { color: var(--text-3); font-size: 12px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed .t { color: var(--text-3); font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed .n { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: 12.5px; white-space: nowrap; }
.needs { list-style: none; margin: 0; padding: 0; }
.needs li { padding: 10px 16px; border-bottom: 1px solid var(--line); }
.needs li:last-child { border-bottom: 0; }
.needs .for { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--text-3); }
.needs .for > span:first-child { font-weight: 600; }
.needs .for b { color: var(--text-2); }
.needs .for .when { font-variant-numeric: tabular-nums; white-space: nowrap; }
.needs .title { font-weight: 500; font-size: 13.5px; margin-top: 3px; line-height: 1.35; }
.needs .title a { color: inherit; }
.needs .why { color: var(--text-3); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.health { list-style: none; margin: 0; padding: 0; }
.health li { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; align-items: start; padding: 9px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.health li:last-child { border-bottom: 0; }
.health .dot { margin-top: 5px; }
.health .sub { color: var(--text-3); font-size: 12px; margin-top: 1px; }
.route { list-style: none; margin: 0; padding: 0; }
.route li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 7px 0; font-size: 13px; align-items: start; }
.route .step { width: 20px; height: 20px; border-radius: var(--radius-sm); border: 1px solid var(--line-2); display: grid; place-items: center; font-size: 11px; font-weight: 600; color: var(--text-3); font-variant-numeric: tabular-nums; }
.route .step.done { background: var(--good); border-color: var(--good); color: #fff; }
.route .step.now { background: var(--accent-2); border-color: var(--accent-2); color: var(--accent-ink); }
.route li.now .what { font-weight: 600; }
.route .sub { color: var(--text-3); font-size: 12px; }
.brand-table td { vertical-align: middle; }
.brand-table .name { font-weight: 600; }
.brand-table .name a { color: inherit; }
.brand-table .sub { color: var(--text-3); font-size: 12px; }
.brand-table .hintcell { color: var(--text-3); font-size: 11.5px; white-space: nowrap; }

/* ───────── forms (labelled fields, grids, inline tool forms) ───────── */
.field { display: block; margin: 0 0 12px; font: 13.5px var(--sans); color: var(--text); }
.field > span { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 4px; font-weight: 600; }
.field .hint { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 4px; }
.field.span { grid-column: 1 / -1; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.inline-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; min-width: 180px; padding: 5px 9px; font-size: 13px; }
.card-section { padding: 12px 16px; border-top: 1px solid var(--line); }
.card-section > details > summary { font-size: 13px; }
.card-section > details[open] > summary { margin-bottom: 10px; color: var(--text); }
.card-body.flush > .empty + .card-section, .card-body.flush > table + .card-section, .card-body.flush > .accts + .card-section { border-top: 1px solid var(--line); }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; max-width: 100%; }
.seg a { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 9px; font-size: 12px; font-weight: 500; color: var(--text-2); border-right: 1px solid var(--line-2); white-space: nowrap; }
.seg a:last-child { border-right: 0; }
.seg a:hover { text-decoration: none; color: var(--text); background: var(--panel-2); }
.seg a.active { background: var(--panel-2); color: var(--text); }
.seg a.zero { color: var(--text-3); }
.seg .n { font-variant-numeric: tabular-nums; color: var(--text-3); }
.seg a.active .n { color: var(--text-2); }
.badges { display: inline-flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }

/* ───────── brands ───────── */
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; height: 28px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; background: var(--panel-2); }
.chip.done { color: var(--text-3); border-style: dashed; }
.proposal-act { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.tree { font-size: 13px; }
.tree.pad { padding: 4px 16px 8px; }
.tree-head { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0 6px; border-bottom: 1px solid var(--line-2); font-size: 12px; font-weight: 600; color: var(--text-3); }
.tree-row { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; padding: 7px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.tree-row:last-child { border-bottom: 0; }
.tree-row > :first-child { min-width: 0; }
.tree-row.lvl1 { padding-left: 16px; color: var(--text-2); }
.tree-row.lvl2 { padding-left: 32px; color: var(--text-3); font-size: 12.5px; }
.money-triple { display: inline-grid; grid-template-columns: repeat(3, 74px); gap: 8px; text-align: right; white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
.verdict { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.verdict strong { text-transform: capitalize; font-size: 15px; }
.verdict span { color: var(--text-2); }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.kpis .fact { color: inherit; }
.kpis .fact:hover { text-decoration: none; }
.kpis .fact:hover .label { color: var(--text-2); }
.accts { list-style: none; margin: 0; padding: 0; }
.acct { padding: 12px 16px 14px; border-bottom: 1px solid var(--line); }
.acct:last-child { border-bottom: 0; }
.acct-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.acct-platform { min-width: 180px; line-height: 1.3; }
.acct-platform strong { font-size: 13.5px; }
.acct-platform .sub { display: block; color: var(--text-3); font-size: 12px; margin-top: 1px; }
.acct-handle { font-size: 12.5px; }
.acct-url { margin-left: auto; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 8px 16px; margin: 10px 0 0; font-size: 12.5px; }
.facts-grid dt { font-size: 12px; color: var(--text-3); font-weight: 500; }
.facts-grid dd { margin: 1px 0 0; overflow-wrap: anywhere; }
.acct-line { font-size: 12.5px; margin-top: 7px; color: var(--text-2); }
.acct-line.muted { color: var(--text-3); }
.acct-line.bad { color: var(--bad); }
.acct-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: flex-start; }
.acct-tools details[open] { flex-basis: 100%; }
.acct-tools summary { display: inline-flex; align-items: center; height: 26px; padding: 0 9px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: var(--panel); color: var(--text-2); font-size: 12px; font-weight: 500; list-style: none; }
.acct-tools summary::-webkit-details-marker { display: none; }
.acct-tools summary:hover { color: var(--text); border-color: var(--text-3); }
.acct-tools details[open] summary { margin-bottom: 8px; }
.status-steps { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.step-pill { padding: 0 9px; height: 24px; line-height: 22px; border: 1px solid var(--line-2); border-radius: 12px; font-size: 12px; color: var(--text-3); }
.step-pill.done { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.step-pill.now { color: var(--text); border-color: var(--accent-2); background: color-mix(in srgb, var(--accent-2) 12%, transparent); font-weight: 600; }
.status-actions { gap: 8px; }

/* ═════════ design-system components (src/web/ds.tsx; showcase at /design) ═════════ */

/* ── icons: inline SVG, 1.5px stroke, currentColor ── */
.ico { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ico.sm { width: 14px; height: 14px; vertical-align: -2px; }
.ico.lg { width: 20px; height: 20px; vertical-align: -5px; }
.ico.xl { width: 24px; height: 24px; }
.ico.muted { color: var(--text-3); }
.ico.good { color: var(--good); }
.ico.warn { color: var(--warn); }
.ico.bad { color: var(--bad); }
.ico.accent { color: var(--accent); }

/* ── KPI tile: label · value · delta vs previous · provenance · hint · sparkline ── */
.kpi { padding: 14px 16px 13px; display: flex; flex-direction: column; gap: 4px; min-width: 0; container-type: inline-size; }
.kpi .kpi-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.kpi .label { display: inline-flex; align-items: flex-start; gap: 6px; color: var(--text-3); font-size: var(--fs-meta); font-weight: 500; min-width: 0; line-height: 1.35; }
.kpi .label .ico { color: var(--text-3); margin-top: 0.5px; }
.kpi .kpi-top .prov, .kpi .kpi-top .pm { margin-top: 2px; flex: none; } /* never squeezed over the label when the tile is narrow */
/* A value is never truncated with an ellipsis (a cut money figure misleads); it shrinks with the tile instead. */
.kpi .value { font-size: 28px; font-weight: 600; letter-spacing: -0.025em; font-variant-numeric: tabular-nums; line-height: 1.05; margin-top: 4px; white-space: nowrap; min-width: 0; }
@container (max-width: 230px) { .kpi .value { font-size: 24px; } }
@container (max-width: 170px) { .kpi .value { font-size: 20px; } }
/* zero is a sentence, not a headline: an empty value stays quiet */
.kpi .value.zero { color: var(--text-3); font-weight: 500; font-size: 20px; }
.kpi.good .value { color: var(--good); }
.kpi.warn .value { color: var(--warn); }
.kpi.bad .value { color: var(--bad); }
.kpi .kpi-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 18px; margin-top: 2px; }
.kpi .hint { color: var(--text-3); font-size: 12px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi .spark { margin-left: auto; }
a.kpi-link { color: inherit; display: block; min-width: 0; }
a.kpi-link:hover { text-decoration: none; }
a.kpi-link:hover .card { border-color: var(--line-2); }
a.kpi-link:hover .value { color: var(--accent); }
a.kpi-link:hover .kpi.good .value, a.kpi-link:hover .kpi.warn .value, a.kpi-link:hover .kpi.bad .value { filter: brightness(1.1); }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpi-grid.six { grid-template-columns: repeat(6, minmax(0, 1fr)); }
/* A KPI strip: tiles joined by 1px lines inside one card instead of separate cards. */
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); margin-bottom: 16px; overflow: hidden; }
.kpi-strip > * { border-right: 1px solid var(--line); }
.kpi-strip > :last-child { border-right: 0; }
.kpi-strip .kpi { padding: 12px 16px 11px; border: 0; border-radius: 0; background: transparent; height: 100%; }
.kpi-strip > a.kpi-link { display: block; height: 100%; }
.kpi-strip .kpi .value { font-size: 22px; }
.kpi-strip a.kpi-link:hover { background: var(--panel-2); }
/* delta vs previous period: arrow + sign + colour — never colour alone */
.delta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 2px; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-2); min-width: 0; }
.delta .ico { width: 12px; height: 12px; vertical-align: -1px; }
.delta.pos { color: var(--good); }
.delta.neg { color: var(--bad); }
.delta.flat { color: var(--text-3); }
.delta .vs { color: var(--text-3); font-weight: 500; margin-left: 3px; white-space: normal; }

/* ── section header: title · meta · actions ── */
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin: 28px 0 12px; flex-wrap: wrap; }
.sec-head:first-child, .card-body > .sec-head:first-child { margin-top: 0; }
.sec-head h2 { font-size: var(--fs-h2); font-weight: 600; letter-spacing: -0.012em; line-height: 1.3; display: flex; align-items: center; gap: 8px; }
.sec-head h2 .count-pill { font-size: 11px; }
.sec-head .meta { color: var(--text-2); font-size: var(--fs-meta); margin-top: 2px; text-wrap: pretty; }
.sec-head .kicker { margin-bottom: 3px; }
.sec-head .actions { flex: none; }
.sec-head.sm { margin: 18px 0 8px; }
.sec-head.sm h2 { font-size: var(--fs-h3); }

/* ── toolbar / filter bar: GET filters that work without JavaScript ── */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 14px; min-width: 0; }
.toolbar .grow { flex: 1 1 auto; }
.toolbar .spacer { flex: 1 1 0; }
.toolbar form { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; }
.toolbar select, .toolbar input[type=search], .toolbar input[type=text], .toolbar input[type=date] { width: auto; height: 28px; padding: 3px 9px; font-size: 12.5px; background: var(--panel); }
.toolbar select { min-width: 132px; padding-right: 24px; }
.toolbar input[type=search] { width: 220px; }
.toolbar .btn { height: 28px; }
.toolbar .seg a { height: 26px; }
.js .toolbar .apply { display: none; }
.filter-group { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.filter-group .fl { font-size: 12.5px; font-weight: 500; color: var(--text-3); white-space: nowrap; }
.fchips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.fchip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 13px;
  font-size: 12px; font-weight: 500; color: var(--text-2); background: transparent; white-space: nowrap; transition: border-color var(--dur), color var(--dur), background-color var(--dur);
}
.fchip:hover { color: var(--text); border-color: var(--text-3); text-decoration: none; }
.fchip.active { color: var(--text); background: var(--panel-2); border-color: var(--text-2); font-weight: 600; }
.fchip.active::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); flex: none; }
.fchip .n { color: var(--text-3); font-variant-numeric: tabular-nums; font-weight: 500; }
.fchip.active .n { color: var(--text-2); }
.fchip.zero { color: var(--text-3); }
.active-filters { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); margin-bottom: 14px; }
.active-filters a { color: var(--text-2); }
.active-filters a:not(.fchip) { color: var(--accent); margin-left: 4px; }
.toolbar .active-filters { margin-bottom: 0; }

/* ── status pill: LIVE · WORKING · IDLE · ERROR · PAUSED (shape + label, not colour alone) ── */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px 0 7px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--panel-2); color: var(--text-2); font-size: 11.5px; font-weight: 600; letter-spacing: 0.02em; white-space: nowrap; line-height: 1;
}
.status-pill svg { width: 10px; height: 10px; flex: none; }
.status-pill.live { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); background: var(--good-soft); }
.status-pill.working { color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); background: var(--info-soft); }
.status-pill.working svg { animation: spin 1.1s linear infinite; }
.status-pill.idle { color: var(--text-3); }
.status-pill.error { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); }
.status-pill.paused { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.status-pill.live .beat { animation: pulse 1.8s ease-in-out infinite; transform-origin: center; }
.status-pill.sm { height: 18px; font-size: 10.5px; padding: 0 6px 0 5px; gap: 5px; }
.status-pill.sm svg { width: 8px; height: 8px; }
.status-pill.bare { border: 0; background: transparent; padding: 0; height: auto; }

/* ── brand avatar: the mark when one exists, else a monogram on a deterministic hue ── */
.bavatar {
  --sz: 24px;
  display: inline-flex; align-items: center; justify-content: center; width: var(--sz); height: var(--sz); flex: none;
  border-radius: 27%; overflow: hidden; background: hsl(var(--h, 220) 34% 44%); color: #fff;
  font-weight: 600; font-size: calc(var(--sz) * 0.40); letter-spacing: -0.02em; line-height: 1; user-select: none;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--text) 12%, transparent);
}
.bavatar img { width: 100%; height: 100%; display: block; object-fit: cover; }
.bavatar.xs { --sz: 18px; border-radius: 25%; }
.bavatar.sm { --sz: 20px; }
.bavatar.md { --sz: 32px; }
.bavatar.lg { --sz: 40px; }
.bavatar.xl { --sz: 64px; }
.bavatar.round { border-radius: 50%; }
.brand-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-cell .bc-name { font-weight: 600; line-height: 1.25; }
.brand-cell .bc-name a { color: inherit; }
.brand-cell .bc-sub { color: var(--text-3); font-size: 12px; margin-top: 1px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bavatar-stack { display: inline-flex; }
.bavatar-stack .bavatar { box-shadow: 0 0 0 2px var(--panel); }
.bavatar-stack .bavatar + .bavatar { margin-left: -6px; }

/* ── bar list (ranked horizontal bars) ── */
.barlist { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.barlist li { padding: 6px 0; min-width: 0; }
.barlist li:first-child { padding-top: 0; }
.barlist li:last-child { padding-bottom: 0; }
.barlist .bl-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 4px; min-width: 0; }
.barlist .bl-label { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.barlist .bl-label a { color: inherit; }
.barlist .bl-label .rank { color: var(--text-3); font-size: 11px; font-variant-numeric: tabular-nums; width: 16px; text-align: right; flex: none; }
.barlist .bl-val { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.barlist .bl-share { color: var(--text-3); font-weight: 500; font-size: 12px; margin-left: 6px; }
.barlist .bl-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.barlist .bl-bar > span { display: block; height: 100%; min-width: 2px; border-radius: 3px; background: var(--c, var(--chart-1)); }
.barlist.tight li { padding: 4px 0; }
.barlist.tight .bl-bar { height: 4px; }

/* ── share bar (100 % stacked) + legend ── */
.sharebar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--line); }
.sharebar > span { display: block; height: 100%; background: var(--c, var(--chart-1)); min-width: 2px; }
.sharebar.lg { height: 12px; border-radius: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-2); margin-top: 8px; list-style: none; padding: 0; }
.legend li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { width: 8px; height: 8px; border-radius: 2px; background: var(--c, var(--chart-1)); flex: none; }
.legend b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.legend .pct { color: var(--text-3); font-variant-numeric: tabular-nums; }
.legend.stack { flex-direction: column; gap: 6px; }

/* ── donut / ring ── */
.donut { display: inline-flex; align-items: center; gap: 16px; }
.donut svg { flex: none; }
.donut .track { stroke: var(--line); }
.donut .seg { stroke: var(--c, var(--chart-1)); }
.donut .dn-v { fill: var(--text); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.donut .dn-l { fill: var(--text-3); font-size: 10px; font-weight: 600; }
.donut .legend { margin-top: 0; }
.ring { display: inline-block; vertical-align: middle; }
.ring .track { stroke: var(--line); }
.ring .seg { stroke: var(--c, var(--chart-1)); }

/* ── charts (shared with ui.tsx Spark / LineChart) ── */
.spark.good polyline { stroke: var(--good); }
.spark.good .area { fill: color-mix(in srgb, var(--good) 12%, transparent); }
.spark.bad polyline { stroke: var(--bad); }
.spark.bad .area { fill: color-mix(in srgb, var(--bad) 12%, transparent); }
.spark.muted polyline { stroke: var(--text-3); }
.spark.muted .area { fill: color-mix(in srgb, var(--text-3) 12%, transparent); }
.spark .end { fill: var(--accent); }
.spark.good .end { fill: var(--good); }
.spark.bad .end { fill: var(--bad); }
.spark.muted .end { fill: var(--text-3); }
.chart .baseline { stroke: var(--line-2); stroke-width: 1; }
.chart .last { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.chart .lastlabel { fill: var(--text); font-size: 10.5px; font-weight: 600; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.chart .axis.strong { fill: var(--text-2); }
.chart .line.good { stroke: var(--good); }
.chart .area.good { fill: color-mix(in srgb, var(--good) 10%, transparent); }
.chart .last.good { fill: var(--good); }
.chart .line.c2 { stroke: var(--chart-2); }
.chart .area.c2 { fill: color-mix(in srgb, var(--chart-2) 10%, transparent); }
.chart .cmp { fill: none; stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-wrap { min-width: 0; }
.chart-wrap .chart-meta { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--text-3); margin-bottom: 6px; }

/* ── modal: native <dialog>; app.js opens/closes, :target is the no-script fallback ── */
dialog.modal {
  padding: 0; margin: auto; border: 1px solid var(--line-2); border-radius: var(--radius-lg); background: var(--panel); color: var(--text);
  width: min(520px, calc(100vw - 32px)); max-height: min(85vh, 720px); box-shadow: var(--shadow-1); overflow: hidden; display: none; flex-direction: column;
}
dialog.modal[open], dialog.modal:target { display: flex; }
dialog.modal:target { position: fixed; inset: 0; z-index: 40; }
dialog.modal::backdrop { background: rgba(6, 8, 12, 0.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
dialog.modal.lg { width: min(760px, calc(100vw - 32px)); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.modal-head .hint { color: var(--text-3); font-size: 12px; margin-top: 2px; }
.modal-body { padding: 16px; overflow: auto; font-size: 13.5px; color: var(--text-2); }
.modal-body p { text-wrap: pretty; }
.modal-body strong { color: var(--text); }
.modal-foot { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; background: var(--panel); }
.modal-foot .left { margin-right: auto; color: var(--text-3); font-size: 12px; align-self: center; }
body.modal-open { overflow: hidden; }

/* ── loading: skeleton blocks ── */
.skeleton { display: block; height: 12px; border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-2) 45%, var(--skeleton) 90%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }
.skeleton.text { margin: 7px 0; }
.skeleton.text.short { width: 55%; }
.skeleton.title { height: 18px; width: 38%; margin: 4px 0 10px; }
.skeleton.value { height: 28px; width: 46%; margin: 8px 0 6px; }
.skeleton.block { height: 96px; }
.skeleton.row { height: 36px; margin: 0; border-radius: 0; }
.skeleton.circle { border-radius: 50%; }
.skeleton-rows > .skeleton.row + .skeleton.row { border-top: 1px solid var(--line); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── states: error · empty (icon + one-line why + one action) ── */
.state-box { display: flex; gap: 14px; align-items: flex-start; padding: 24px 20px; max-width: 640px; color: var(--text-2); font-size: 13px; }
.state-box .ico-wrap { width: 36px; height: 36px; border-radius: var(--radius); border: 1px solid var(--line-2); background: var(--bg-2); display: grid; place-items: center; color: var(--text-2); flex: none; }
.state-box .ico-wrap .ico { width: 18px; height: 18px; }
.state-box h3 { font-size: 14px; color: var(--text); font-weight: 600; margin: 8px 0 0; }
.state-box .why { margin-top: 3px; text-wrap: pretty; }
.state-box .detail { font-family: var(--mono); font-size: 12px; color: var(--text-3); margin-top: 8px; padding: 8px 10px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.state-box .acts { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.state-box .acts .alt { font-size: 12.5px; }
.state-box.error .ico-wrap { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, transparent); background: var(--bad-soft); }
.state-box.warn .ico-wrap { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.state-box.center { flex-direction: column; align-items: center; text-align: center; margin: 0 auto; padding: 36px 20px; }
.state-box.center .acts { justify-content: center; }
.state-box.compact { padding: 14px 16px; gap: 10px; }
.state-box.compact .ico-wrap { width: 28px; height: 28px; }
.state-box.compact .ico-wrap .ico { width: 15px; height: 15px; }
.state-box.compact h3 { font-size: 13px; margin-top: 4px; }

/* ── data table extras ── */
.dtable th .th-hint { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--text-3); margin-left: 4px; }
.dtable td.name { font-weight: 600; }
.dtable td.name a { color: inherit; }
.dtable .cell-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dtable .cell-stack .sub { margin-top: 0; }
.dtable td.mono { font-size: 12.5px; color: var(--text-2); }
.dtable-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12px; flex-wrap: wrap; }
.pager { display: inline-flex; gap: 4px; align-items: center; }
.pager a, .pager span { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: var(--radius-sm); border: 1px solid transparent; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.pager a:hover { border-color: var(--line-2); color: var(--text); text-decoration: none; }
.pager .active { border-color: var(--line-2); background: var(--panel-2); color: var(--text); font-weight: 600; }
.pager .gap { color: var(--text-3); }
.pager a[aria-disabled=true] { opacity: 0.4; pointer-events: none; }

/* ── misc: key/value strip, inline notice, kbd ── */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--panel); font-size: 13px; color: var(--text-2); }
.notice .ico { margin-top: 2px; flex: none; }
.notice.good { border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.notice.good .ico { color: var(--good); }
.notice.warn { border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.notice.warn .ico { color: var(--warn); }
.notice.bad { border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.notice.bad .ico { color: var(--bad); }
.notice.info .ico { color: var(--info); }
.notice b { color: var(--text); }
kbd { font-family: var(--mono); font-size: 11px; padding: 1px 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--bg-2); color: var(--text-2); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.stack-sm { display: flex; flex-direction: column; gap: 4px; }
.cluster { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* ───────── mobile bottom bar: Vandaag · Voor jou · Merken · Meer (the drawer); replaces the hamburger ───────── */
.bottombar {
  display: none; position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--panel) 94%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.bottombar a, .bottombar button {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px;
  border: 0; border-radius: 10px; background: transparent; color: var(--text-3); font: 600 11.5px var(--sans); cursor: pointer;
}
.bottombar a:hover { text-decoration: none; color: var(--text); }
.bottombar .active { color: var(--accent); }
.bottombar .ico { width: 22px; height: 22px; }
.bottombar .count { position: absolute; top: 3px; left: calc(50% + 5px); min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--mari); color: #3a2600; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }

/* ───────── responsive ───────── */
@media (max-width: 1100px) {
  .kpi-grid, .kpi-grid.five, .kpi-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .g4, .g6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: 1fr 1fr; }
  .cc-hero { grid-template-columns: 1fr; }
  .c3, .c4, .c5, .c6, .c7, .c8 { grid-column: span 12; }
  .strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .strip > * { border-bottom: 1px solid var(--line); }
  .strip > :nth-child(2n) { border-right: 0; }
  .strip > :nth-last-child(-n + 2) { border-bottom: 0; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: 272px; z-index: 30; transform: translateX(-100%); transition: transform 0.2s var(--m-out); }
  body.nav-open .sidebar { transform: none; }
  .overlay { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, 0.45); }
  body.nav-open .overlay { display: block; }
  .topbar { padding: 0 16px; gap: 8px; }
  .bottombar { display: grid; }
  .shell { padding-bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); }
  .topbar .who { display: none; }
  .topbar .now .now-state { display: none; }
  .topbar .now .now-sep { display: none; }
  .user-menu summary { padding: 0 3px; gap: 4px; }
  .user-menu summary .ico { display: none; }
  .subnav { padding: 0 16px; }
  .content { padding: 20px 16px 40px; }
  .g2, .g3, .g4, .g6 { grid-template-columns: 1fr; }
  .span2, .span3 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 6px; }
  .score-grid { grid-template-columns: 1fr 1fr 48px; }
  .clip { max-width: 240px; }
  .form-grid, .form-grid.three, .form-grid.four { grid-template-columns: 1fr; }
  .money-triple { grid-template-columns: repeat(3, 62px); gap: 6px; font-size: 12px; }
  .tree-row.lvl1 { padding-left: 10px; }
  .tree-row.lvl2 { padding-left: 20px; }
  .acct-url { margin-left: 0; flex-basis: 100%; }
  .card-head { flex-wrap: wrap; }
  .card-head .actions { flex: 1 1 100%; }
  .seg { flex-wrap: wrap; gap: 4px; border: 0; overflow: visible; }
  .seg a { border: 1px solid var(--line-2); border-radius: var(--radius-sm); }
  .kpi-grid, .kpi-grid.three, .kpi-grid.five, .kpi-grid.six { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi .value { font-size: 24px; }
  .kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-strip > * { border-bottom: 1px solid var(--line); }
  .kpi-strip > :nth-child(2n) { border-right: 0; }
  .kpi-strip > :nth-last-child(-n + 2) { border-bottom: 0; }
  .sec-head { align-items: flex-start; }
  .sec-head .actions { flex: 1 1 100%; }
  .toolbar input[type=search] { width: 100%; }
  .toolbar form { width: 100%; }
  .toolbar select { flex: 1 1 auto; }
  dialog.modal { width: calc(100vw - 24px); max-height: calc(100vh - 24px); }
  .state-box { padding: 20px 16px; }
  .donut { flex-wrap: wrap; }
  .topbar { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--bg); }
}
@media (max-width: 600px) {
  .strip { grid-template-columns: 1fr; }
  .strip > * { border-right: 0; border-bottom: 1px solid var(--line); }
  .strip > :last-child { border-bottom: 0; }
  .display { font-size: 38px; }
  .facts { gap: 8px; }
  .fact .label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
  .fact .v { font-size: 15px; }
  .milestones .row { flex-direction: column; align-items: flex-start; gap: 2px; }
  .route-line { grid-template-columns: 1fr; gap: 2px; }
  .route-line .state { grid-column: 1; }
  .cc-head .meta .fine { display: none; }
  .pipeline { grid-auto-columns: minmax(58px, 1fr); overflow-x: auto; }
  .track-labels span { font-size: 10.5px; }
  .cc-head h1, .page-head h1 { font-size: 26px; }
}
@media (max-width: 600px) {
  .kpi-grid, .kpi-grid.three, .kpi-grid.five, .kpi-grid.six { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kpi { padding: 12px 12px 11px; }
  .kpi .value { font-size: 22px; }
  .kpi-strip { grid-template-columns: 1fr; }
  .kpi-strip > * { border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi-strip > :last-child { border-bottom: 0; }
  .barlist .bl-label .rank { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
  .btn:hover, .btn:active { transform: none; }
  .dot.pulse, .status-pill.live .beat { animation: none; }
  .status-pill.working svg { animation: none; }
  .skeleton { animation: none; }
  .btn.busy::after { animation-duration: 1.4s; }
  * { transition-duration: 0s !important; }
}
