/* ==========================================================================
   Minutrix for PYC — design system, minimal ("like Ravera")
   White canvas, hairlines and whitespace instead of cards with shadows; Inter everywhere with tabular numerals;
   one blue primary; teal only for what the voice agent is doing; soft dot-pill statuses. Light is the default,
   [data-theme=dark] is a near-black version of the same layout. Spec: docs/UI-MINIMAL-BRIEF.md.

   Page CSS uses tokens only (var(--...)); no raw hex, no text below 13px.
   Cheat sheet with markup: docs/UI-COMPONENTS.md. Component index:
   shell .app .sb (sidebar) .topbar #page .page | page head .ph (.ph__kicker .ph__title .ph__sub .ph__actions)
   board .board .bgroup .bgroup__head .dt--board td.cell-status .status .battery
   widgets .wgs .wg (+ legacy .kpis .kpi, .stats .stat) | card .card (+__head __title __sub __actions __body __foot)
   views .tabs--views | tabs .tabs .tab [data-panel] | segmented .seg | link tab row .subnav | toolbar .toolbar
   buttons .btn--primary|secondary|ghost|danger|ai|sm|lg|xl|icon | chip .chip | tag .tag | badge .badge--*
   hue helpers .hue-indigo|violet|teal|blue|green|amber|red|pink|slate + .tile
   clinical .status--soft .sec-head .count .panel-head .facts .fact .pth (patient header)
   list .list .lrow | timeline .tl | feed .feed | key-value dl.kv | transcript .ts .bub--* | callout .callout
   disclosure details.disclosure | drawer (side panel) .drawer | modal .modal | menu .menu | palette .cmdk | toast .toasts
   form .field .input .select .textarea .switch | ring .ring | meter .meter | avatar .av | empty .empty | alert .alert
   motion .m-rise .m-fade .m-pop .m-stagger .m-pulse (prefers-reduced-motion aware)
   ========================================================================== */

/* ------------------------------------------------------------------ tokens: light (default) */
:root {
  color-scheme: light;
  /* surfaces: white on white, separated by hairlines */
  --bg: #FFFFFF;
  --surface-solid: #FFFFFF;
  --glass: #FFFFFF; --glass-strong: #FFFFFF; --glass-border: #EAECF0; --glass-hi: transparent; --blur: none;
  --bg-mesh-1: transparent; --bg-mesh-2: transparent; --bg-mesh-3: transparent;
  --hover: #F9FAFB; --active: #F2F4F7;
  /* text */
  --fg: #111827; --fg-2: #374151; --fg-3: #6B7280; --fg-inverse: #FFFFFF;
  /* accents: one blue primary; teal only for the voice agent */
  --brand: #2F6FEB; --brand-2: #2F6FEB; --brand-grad: #2F6FEB;
  --ai: #0E9384; --ai-glow: transparent;
  --glow: 0 0 0 0 transparent;
  /* status: text/dot colour, soft tint, hairline (dark readable text on light tints, 4.5:1+) */
  --st-done: #067647;    --st-done-bg: #ECFDF3;    --st-done-bd: #ABEFC6;
  --st-working: #B54708; --st-working-bg: #FFFAEB; --st-working-bd: #FEDF89;
  --st-stuck: #B42318;   --st-stuck-bg: #FEF3F2;   --st-stuck-bd: #FECDCA;
  --st-sched: #175CD3;   --st-sched-bg: #EFF8FF;   --st-sched-bd: #B2DDFF;
  --st-none: #475467;    --st-none-bg: #F2F4F7;    --st-none-bd: #EAECF0;
  --st-other: #5925DC;   --st-other-bg: #F4F3FF;   --st-other-bd: #D9D6FE;
  --st-off: #475467;     --st-off-bg: #F2F4F7;     --st-off-bd: #EAECF0;
  --st-brand: #1849A9;   --st-brand-bg: #EFF4FF;   --st-brand-bd: #C7D7FE;
  --st-ai: #107569;      --st-ai-bg: #F0FDF9;      --st-ai-bd: #99F6E0;
  --on-status: #FFFFFF;
  /* fonts: Inter, tabular numerals; --mono stays an alias so older page CSS keeps working */
  --font: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --mono: 'Inter', -apple-system, 'Segoe UI', system-ui, sans-serif;
  --code: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  /* radii */
  --r-xs: 6px; --r-sm: 8px; --r-md: 8px; --r: 10px; --r-lg: 12px; --r-xl: 16px; --r-pill: 999px;
  /* shadows: almost none; overlays only */
  --sh-1: 0 0 0 0 transparent;
  --sh-2: 0 1px 2px rgba(16, 24, 40, .05);
  --sh-3: 0 12px 32px -8px rgba(16, 24, 40, .14), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --sh-glow: 0 0 0 0 transparent;
  /* layout: --dock-h is the fixed chrome at the top (the 64px top bar), --sb-cur the sidebar width in use */
  --sb-w: 232px; --sb-mini: 72px; --sb-cur: var(--sb-w);
  --dock-h: 64px; --topbar-h: 64px; --dock-b: 0px; --page-max: 1440px; --gutter: 20px;
  /* the soft hairline pages use between rows and sections; --min-line is the older page-level name */
  --line-soft: color-mix(in srgb, var(--fg) 9%, transparent); --min-line: var(--line-soft);

  /* legacy aliases */
  --font-display: var(--font); --font-ui: var(--font);
  --canvas: var(--bg); --canvas-2: #F2F4F7;
  --surface: #FFFFFF; --surface-2: #F9FAFB; --sunken: #F9FAFB;
  --overlay: rgba(16, 24, 40, .4);
  --line: #EAECF0; --line-2: #F2F4F7; --line-strong: #D0D5DD;
  --avatar: #F2F4F7;
  --ink: var(--fg); --ink-2: var(--fg-2); --ink-3: var(--fg-3); --ink-4: #667085; --ink-inverse: var(--fg-inverse);
  --focus: #2F6FEB;
  --brand-hover: #1F5BD6; --brand-press: #1849A9; --brand-ink: #1F5BD6;
  --brand-soft: #EFF4FF; --brand-tint: #F5F8FF; --brand-line: #C7D7FE;
  --on-brand: #FFFFFF;
  --ai-ink: #107569; --ai-soft: #F0FDF9; --ai-line: #99F6E0;
  --good: var(--st-done);  --good-soft: var(--st-done-bg);  --good-line: var(--st-done-bd);
  --warn: var(--st-working); --warn-soft: var(--st-working-bg); --warn-line: var(--st-working-bd);
  --crit: var(--st-stuck); --crit-soft: var(--st-stuck-bg); --crit-line: var(--st-stuck-bd);
  --info: var(--st-sched); --info-soft: var(--st-sched-bg); --info-line: var(--st-sched-bd);
  --hue-indigo: #2F6FEB; --hue-violet: #6938EF; --hue-teal: #0E9384; --hue-blue: #1570EF; --hue-green: #079455;
  --hue-amber: #DC6803; --hue-red: #D92D20; --hue-pink: #DD2590; --hue-slate: #667085;
  --on-hue: #FFFFFF; --hue-soft-mix: 10%;
  --c1: #2F6FEB; --c2: #0E9384; --c3: #F79009; --c4: #7A5AF8; --c5: #EE46BC; --c6: #98A2B3;
  --chart-grid: #F2F4F7; --chart-axis: #667085;
  --rail: #FFFFFF; --rail-line: #EAECF0;
  --ring: 0 0 0 3px rgba(47, 111, 235, .16);

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 32px; --s8: 40px; --s9: 56px;
  --space-section: 32px; --pad-card: 20px;
  --fs: .84; /* type scale: every font size is multiplied by this (1 = original sizes) */
  --t-xs: calc(13px * var(--fs)); --t-sm: calc(14px * var(--fs)); --t-md: calc(15px * var(--fs)); --t-lg: calc(16px * var(--fs)); --t-xl: calc(18px * var(--fs)); --t-2xl: calc(20px * var(--fs)); --t-3xl: calc(24px * var(--fs)); --t-4xl: calc(28px * var(--fs)); --t-5xl: calc(32px * var(--fs));
  --t-label: var(--t-xs); --t-secondary: var(--t-sm); --t-body: var(--t-md); --t-card: var(--t-lg); --t-section: var(--t-xl);
  --t-page: calc(24px * var(--fs)); --t-number: calc(22px * var(--fs)); --t-hero: calc(32px * var(--fs));
  --measure: 70ch;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --spring: cubic-bezier(.2, .7, .2, 1);
  --d1: 120ms; --d2: 150ms; --d3: 180ms; --d4: 300ms;
}
html.sb-mini { --sb-cur: var(--sb-mini); }
@media (max-width: 720px) {
  :root, html.sb-mini { --space-section: 24px; --pad-card: 16px; --gutter: 12px; --t-page: calc(22px * var(--fs)); --dock-h: 56px; --topbar-h: 56px; --sb-cur: 0px; }
}

/* ------------------------------------------------------------------ tokens: dark (same layout, near-black) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0C0E12; --surface-solid: #111419;
  --glass: #111419; --glass-strong: #161A20; --glass-border: #22262E; --glass-hi: transparent;
  --hover: #161A20; --active: #1D2129;
  --fg: #F2F4F7; --fg-2: #CDD2DA; --fg-3: #98A1AE; --fg-inverse: #0C0E12;
  --brand: #4C86F5; --brand-2: #4C86F5; --brand-grad: #3D79EE;
  --ai: #2ED3B7;
  --st-done: #47CD89;    --st-done-bg: rgba(71, 205, 137, .12);  --st-done-bd: rgba(71, 205, 137, .3);
  --st-working: #FDB022; --st-working-bg: rgba(253, 176, 34, .12); --st-working-bd: rgba(253, 176, 34, .3);
  --st-stuck: #F97066;   --st-stuck-bg: rgba(249, 112, 102, .12); --st-stuck-bd: rgba(249, 112, 102, .3);
  --st-sched: #53B1FD;   --st-sched-bg: rgba(83, 177, 253, .12);  --st-sched-bd: rgba(83, 177, 253, .3);
  --st-none: #A4ACB9;    --st-none-bg: rgba(164, 172, 185, .1);   --st-none-bd: rgba(164, 172, 185, .24);
  --st-other: #A48AFB;   --st-other-bg: rgba(164, 138, 251, .12); --st-other-bd: rgba(164, 138, 251, .3);
  --st-off: #A4ACB9;     --st-off-bg: rgba(164, 172, 185, .1);    --st-off-bd: rgba(164, 172, 185, .24);
  --st-brand: #84ADFF;   --st-brand-bg: rgba(76, 134, 245, .14);  --st-brand-bd: rgba(76, 134, 245, .34);
  --st-ai: #5FE9D0;      --st-ai-bg: rgba(46, 211, 183, .12);     --st-ai-bd: rgba(46, 211, 183, .3);
  --on-status: #0C0E12;
  --sh-2: 0 1px 2px rgba(0, 0, 0, .3);
  --sh-3: 0 16px 40px -10px rgba(0, 0, 0, .7), 0 0 0 1px #22262E;
  --canvas-2: #1A1E25;
  --surface: #111419; --surface-2: #161A20; --sunken: #0F1216;
  --overlay: rgba(0, 0, 0, .6);
  --line: #22262E; --line-2: #1A1E25; --line-strong: #333944;
  --avatar: #1D2129;
  --ink-4: #8B94A3;
  --focus: #6A9BFF;
  --brand-hover: #5B92F7; --brand-press: #3D79EE; --brand-ink: #84ADFF;
  --brand-soft: rgba(76, 134, 245, .14); --brand-tint: rgba(76, 134, 245, .07); --brand-line: rgba(76, 134, 245, .4);
  --ai-ink: #5FE9D0; --ai-soft: rgba(46, 211, 183, .1); --ai-line: rgba(46, 211, 183, .3);
  --hue-indigo: #6A9BFF; --hue-violet: #A48AFB; --hue-teal: #2ED3B7; --hue-blue: #53B1FD; --hue-green: #47CD89;
  --hue-amber: #FDB022; --hue-red: #F97066; --hue-pink: #F670C7; --hue-slate: #98A1AE;
  --on-hue: #0C0E12; --hue-soft-mix: 14%;
  --c1: #4C86F5; --c2: #2ED3B7; --c3: #FDB022; --c4: #A48AFB; --c5: #F670C7; --c6: #6B7280;
  --chart-grid: #1A1E25; --chart-axis: #98A1AE;
  --rail: #0C0E12; --rail-line: #22262E;
  --ring: 0 0 0 3px rgba(76, 134, 245, .3);
}

/* hue helpers: set --hue for tiles, group bars, widget icons */
.hue-indigo { --hue: var(--hue-indigo); } .hue-violet { --hue: var(--hue-violet); } .hue-teal { --hue: var(--hue-teal); }
.hue-blue { --hue: var(--hue-blue); } .hue-green { --hue: var(--hue-green); } .hue-amber { --hue: var(--hue-amber); }
.hue-red { --hue: var(--hue-red); } .hue-pink { --hue: var(--hue-pink); } .hue-slate { --hue: var(--hue-slate); }

/* ------------------------------------------------------------------ base + aurora canvas */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; background: transparent; color: var(--fg);
  font-family: var(--font); font-size: var(--t-md); line-height: 1.55; letter-spacing: -0.006em;
  font-feature-settings: 'kern', 'ss01'; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
/* the aurora mesh: three huge blurred radials, fixed behind everything, drifting slowly */
body::before {
  content: ''; position: fixed; inset: -8vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42vmax 34vmax at 14% 14%, var(--bg-mesh-1), transparent 72%),
    radial-gradient(48vmax 36vmax at 86% 12%, var(--bg-mesh-2), transparent 72%),
    radial-gradient(46vmax 38vmax at 58% 96%, var(--bg-mesh-3), transparent 72%);
  animation: aurora-drift 38s ease-in-out infinite alternate; will-change: transform;
}
body::after { /* a soft vignette so the edges sink and the centre glows */
  content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background: radial-gradient(120% 80% at 50% -10%, transparent 40%, color-mix(in srgb, var(--bg) 70%, transparent) 100%);
}
@keyframes aurora-drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(3vmax, -2vmax, 0) scale(1.06); } 100% { transform: translate3d(-3vmax, 2vmax, 0) scale(1.02); } }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 600; letter-spacing: -0.02em; color: var(--fg); }
p { margin: 0; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; }
img, svg { display: block; }
.ic { flex: none; display: inline-block; vertical-align: middle; }
::selection { background: rgba(124, 131, 255, .35); color: var(--fg); }
:focus { outline: none; }
/* one visible focus ring for every interactive element, both themes */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px color-mix(in srgb, var(--focus) 22%, transparent); }
hr { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
code, kbd { font-family: var(--mono); font-size: .88em; }
code { overflow-wrap: anywhere; } /* long IDs wrap instead of widening the page on phones */
kbd {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px;
  border: 1px solid var(--line-strong); border-radius: 6px; background: var(--canvas-2);
  color: var(--fg-3); font-size: var(--t-xs); font-weight: 500; line-height: 1;
}
[hidden] { display: none !important; }
.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; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* typography utilities */
.serif { font-family: var(--font); letter-spacing: -0.02em; }
.display { font-family: var(--font); font-weight: 600; letter-spacing: -0.035em; line-height: 1.04; }
.mono, .num-mono { font-family: var(--mono); font-feature-settings: 'zero' 0; letter-spacing: -0.02em; }
.grad-text { background: linear-gradient(100deg, var(--fg) 10%, var(--brand) 55%, var(--ai) 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.t-xs { font-size: var(--t-xs); } .t-sm { font-size: var(--t-sm); } .t-md { font-size: var(--t-md); } .t-lg { font-size: var(--t-lg); } .t-xl { font-size: var(--t-xl); } .t-2xl { font-size: var(--t-2xl); }
.muted { color: var(--fg-3); } .faint { color: var(--ink-4); } .ink-2 { color: var(--fg-2); }
.strong, b, strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.tone-good { color: var(--good); } .tone-warn { color: var(--warn); } .tone-crit { color: var(--crit); } .tone-info { color: var(--info); } .tone-brand { color: var(--brand-ink); } .tone-ai { color: var(--ai-ink); }
.nowrap { white-space: nowrap; } .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.label { font-size: var(--t-sm); color: var(--fg-3); font-weight: 500; }

/* layout utilities */
.row { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.row--top { align-items: flex-start; } .row--between { justify-content: space-between; } .row--end { justify-content: flex-end; } .row--wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.stack--sm { gap: var(--s2); } .stack--lg { gap: var(--s5); } .stack--xl { gap: var(--s7); }
.grow { flex: 1 1 auto; min-width: 0; } .push { margin-left: auto; }
.grid { display: grid; gap: var(--gutter); min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) minmax(300px, .62fr); }
.span-2 { grid-column: span 2; } .span-3 { grid-column: span 3; } .span-all { grid-column: 1 / -1; }
.gap-1 { gap: var(--s1); } .gap-2 { gap: var(--s2); } .gap-3 { gap: var(--s3); } .gap-4 { gap: var(--s4); } .gap-6 { gap: var(--s6); }
.mt-2 { margin-top: var(--s2); } .mt-3 { margin-top: var(--s3); } .mt-4 { margin-top: var(--s4); } .mt-6 { margin-top: var(--s6); } .mt-8 { margin-top: var(--s8); }
.mb-2 { margin-bottom: var(--s2); } .mb-4 { margin-bottom: var(--s4); }
@media (max-width: 1180px) { .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) { .g-main, .g-side { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) { .g-2, .g-3, .g-4 { grid-template-columns: minmax(0, 1fr); } .span-2, .span-3 { grid-column: auto; } .row:not(.row--nowrap) { flex-wrap: wrap; } }

/* .glass: the frosted panel every surface is made of */
.glass {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-1);
}

/* ------------------------------------------------------------------ app shell: left sidebar + white top bar */
/* both are fixed; .main is offset by the sidebar, #page by the top bar (--dock-h) */
.app { min-height: 100vh; }
.main { min-width: 0; margin-left: var(--sb-cur); transition: margin-left var(--d3) var(--ease); }
.sb {
  position: fixed; z-index: 40; top: 0; bottom: 0; left: 0; width: var(--sb-cur); display: flex; flex-direction: column; gap: 2px;
  padding: 14px 12px 12px; background: var(--rail); border-right: 1px solid var(--line); overflow-y: auto; overflow-x: hidden; scrollbar-width: none;
  transition: width var(--d3) var(--ease), transform var(--d3) var(--ease); view-transition-name: sb;
}
.sb::-webkit-scrollbar { display: none; }
.sb__brand { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px; margin-bottom: 10px; color: var(--fg); text-decoration: none; white-space: nowrap; }
.sb__brand:hover { text-decoration: none; }
.sb__mark { width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center; background: var(--fg); color: var(--fg-inverse); }
.sb__name { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; line-height: 1.1; font-size: var(--t-lg); font-weight: 700; letter-spacing: -0.02em; }
.sb__name small { font-size: var(--t-xs); font-weight: 500; color: var(--fg-3); letter-spacing: 0; }
/* practice switcher at the top of the sidebar */
.sb__ws { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--fg); text-align: left; cursor: pointer; transition: background var(--d1); }
.sb__ws:hover, .sb__ws[aria-expanded="true"] { background: var(--hover); }
.sb__ws > .ic:first-child { color: var(--fg-3); }
.sb__ws-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.25; }
.sb__ws-txt span { font-size: var(--t-xs); color: var(--fg-3); }
.sb__ws-txt b { font-size: var(--t-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.sb__ws-txt b i { width: 7px; height: 7px; border-radius: 50%; background: var(--hue, var(--fg-3)); flex: none; }
.sb__ws > .ic:last-child { color: var(--fg-3); }
.sb__label { padding: 16px 10px 6px; font-size: calc(13px * var(--fs)); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-4); white-space: nowrap; }
.sb__group { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 0 10px; border-radius: var(--r-sm);
  color: var(--fg-2); font-size: var(--t-md); font-weight: 500; text-decoration: none; white-space: nowrap; transition: background var(--d1), color var(--d1);
}
.nav-item .ic { width: 19px; height: 19px; color: var(--fg-3); }
.nav-item:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.nav-item.is-active { background: var(--active); color: var(--fg); font-weight: 600; }
.nav-item.is-active .ic { color: var(--fg); }
.nav-item__label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.nav-item__count { margin-left: auto; font-size: calc(13px * var(--fs)); font-weight: 600; color: var(--fg-3); background: var(--canvas-2); padding: 1px 8px; border-radius: var(--r-pill); }
.nav-item__count--warn { color: var(--st-stuck); background: var(--st-stuck-bg); }
.nav-item__live { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--ai); flex: none; }
.sb__foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 2px; }
.sb__collapse { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg-3); font-size: var(--t-sm); cursor: pointer; white-space: nowrap; }
.sb__collapse:hover { background: var(--hover); color: var(--fg); }
.sb__collapse .ic { width: 19px; height: 19px; transition: transform var(--d3) var(--ease); }
.sb .sb__close { display: none; }
/* collapsed to icons (remembered as html.sb-mini) */
@media (min-width: 721px) {
  .sb-mini .sb { padding-left: 12px; padding-right: 12px; }
  .sb-mini .sb__name, .sb-mini .sb__ws-txt, .sb-mini .sb__ws > .ic:last-child, .sb-mini .nav-item__label, .sb-mini .nav-item__count, .sb-mini .sb__collapse .lbl { display: none; }
  .sb-mini .sb__brand { padding: 0 4px; }
  .sb-mini .sb__ws { justify-content: center; padding: 6px; }
  .sb-mini .sb__label { font-size: 0; padding: 10px 0 4px; } .sb-mini .sb__label::after { content: ''; display: block; height: 1px; margin: 0 8px; background: var(--line); }
  .sb-mini .nav-item, .sb-mini .sb__collapse { justify-content: center; padding: 0; }
  .sb-mini .nav-item__live { position: absolute; top: 8px; right: 10px; }
  .sb-mini .sb__collapse .ic { transform: rotate(180deg); }
}

/* top bar: menu (phones), the centred "Ask Minutrix" search, then live, notifications, theme, avatar */
.topbar {
  position: fixed; z-index: 30; top: 0; right: 0; left: var(--sb-cur); height: var(--dock-h); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: var(--s4);
  padding: 0 var(--s6); background: color-mix(in srgb, var(--bg) 92%, transparent); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px); transition: left var(--d3) var(--ease); view-transition-name: topbar;
}
.topbar__left { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar__right { display: flex; align-items: center; justify-content: flex-end; gap: 6px; flex-wrap: nowrap; }
.tb-search {
  display: flex; align-items: center; gap: 10px; width: clamp(240px, 30vw, 440px); height: 40px; padding: 0 8px 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); color: var(--fg-3); font-size: var(--t-sm); cursor: pointer; text-align: left; transition: border-color var(--d1), background var(--d1);
}
.tb-search:hover { border-color: var(--line-strong); background: var(--surface); }
.tb-search .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-search kbd { flex: none; height: 22px; font-size: calc(13px * var(--fs)); }
/* the small orb: the agent's mark, the only gradient left in the system */
.orb-ic { width: 20px; height: 20px; flex: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #FFFFFF 0, transparent 38%), conic-gradient(from 200deg, #2ED3B7, #2F6FEB, #7A5AF8, #2ED3B7); }
.tb-live { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: var(--r-pill); color: var(--fg-3); font-size: var(--t-sm); font-weight: 500; text-decoration: none; white-space: nowrap; }
.tb-live:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.tb-live i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--ai); flex: none; }
.tb-live.is-live { color: var(--ai-ink); background: var(--ai-soft); }
.tb-live.is-live i::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; border: 1.5px solid var(--ai); animation: live-ping 1.6s var(--ease-out) infinite; }
@keyframes live-ping { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(2.1); opacity: 0; } }
.tb-btn {
  position: relative; width: 40px; height: 40px; flex: none; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg-3);
  display: grid; place-items: center; cursor: pointer; text-decoration: none; transition: background var(--d1), color var(--d1);
}
.tb-btn:hover { background: var(--hover); color: var(--fg); text-decoration: none; }
.tb-btn[aria-expanded="true"] { background: var(--active); color: var(--fg); }
.tb-btn .ic { width: 20px; height: 20px; }
.tb-btn__badge { position: absolute; top: 3px; right: 2px; min-width: 19px; height: 18px; padding: 0 5px; border-radius: var(--r-pill); background: #D92D20; color: #FFFFFF; font-size: calc(12px * var(--fs)); font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--bg); }
.tb-btn__dot { position: absolute; top: 8px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: #D92D20; box-shadow: 0 0 0 2px var(--bg); }
.tb-theme .ic-sun { display: none; } :root[data-theme="dark"] .tb-theme .ic-sun { display: block; } :root[data-theme="dark"] .tb-theme .ic-moon { display: none; }
.tb-user { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 8px 0 4px; margin-left: 4px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--fg); cursor: pointer; text-align: left; }
.tb-user:hover, .tb-user[aria-expanded="true"] { background: var(--hover); }
.tb-user .av { width: 34px; height: 34px; font-size: calc(13px * var(--fs)); background: var(--active); color: var(--fg-2); box-shadow: none; }
.tb-user__txt { display: flex; flex-direction: column; line-height: 1.2; }
.tb-user__txt b { font-size: var(--t-sm); font-weight: 600; white-space: nowrap; }
.tb-user__txt span { font-size: calc(13px * var(--fs)); color: var(--fg-3); white-space: nowrap; }
.tb-user > .ic { color: var(--fg-3); }
.tb-menu { display: none; }
.tb-sep { width: 1px; height: 24px; background: var(--line); margin: 0 6px; }
.theme-toggle { display: inline-flex; padding: 3px; gap: 2px; border-radius: var(--r-sm); background: var(--canvas-2); }
.theme-toggle button { width: 36px; height: 32px; border: 0; background: transparent; border-radius: 6px; display: grid; place-items: center; color: var(--fg-3); cursor: pointer; }
.theme-toggle button:hover { color: var(--fg); }
.theme-toggle button.is-active { background: var(--surface); color: var(--fg); box-shadow: var(--sh-2); }
/* legacy shell bits some pages still reference */
.dock, .crumbs, .sb__practice, .sb__user { display: none; }
.clock { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--fg-3); white-space: nowrap; }

.page { width: 100%; max-width: var(--page-max); margin: 0; padding: calc(var(--dock-h) + 28px) var(--s8) var(--s9); }
.page--wide { max-width: none; }
.page--flush { padding: var(--dock-h) 0 0; max-width: none; }

@media (max-width: 1280px) { .tb-user__txt, .tb-live .lbl { display: none; } .tb-live { padding: 0 10px; } }
@media (max-width: 1100px) { .page { padding-left: var(--s6); padding-right: var(--s6); } .topbar { grid-template-columns: auto minmax(0, 1fr) auto; } .tb-search { width: 100%; max-width: 440px; justify-self: center; } }
/* the live label folds to its dot first, so the search stays near the centre */
@media (max-width: 1600px) { .tb-live .lbl { display: none; } .tb-live { padding: 0 12px; } }
/* phones: the sidebar becomes a drawer opened from the top bar's menu button */
@media (max-width: 720px) {
  .sb { width: min(300px, 86vw); z-index: 95; transform: translateX(-102%); box-shadow: var(--sh-3); }
  .sb-open .sb { transform: none; }
  .sb .sb__close { display: inline-flex; position: absolute; top: 14px; right: 10px; }
  .sb__collapse { display: none; }
  .sb-scrim { position: fixed; inset: 0; z-index: 90; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity var(--d3); }
  .sb-open .sb-scrim { opacity: 1; pointer-events: auto; }
  .topbar { padding: 0 var(--s2) 0 var(--s2); gap: 4px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .tb-menu { display: grid; }
  .tb-search { width: 40px; height: 40px; padding: 0; justify-content: center; border: 0; background: transparent; justify-self: end; }
  .tb-search .lbl, .tb-search kbd, .tb-live, .tb-theme, .tb-sep { display: none; }
  .tb-user { padding: 0 2px; margin-left: 0; } .tb-user > .ic { display: none; }
  .topbar__brand { display: flex !important; }
  .page { padding: calc(var(--dock-h) + 20px) var(--s4) var(--s8); }
}
.topbar__brand { display: none; align-items: center; gap: 8px; color: var(--fg); font-weight: 700; font-size: var(--t-md); text-decoration: none; min-width: 0; }
.topbar__brand .sb__mark { width: 28px; height: 28px; border-radius: 8px; }

/* ------------------------------------------------------------------ page head */
/* kicker / display title / one sentence; at most two actions on the right; the title morphs between pages */
.ph { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-auto-flow: row dense; column-gap: var(--s6); align-items: end; padding: var(--s5) 0 var(--s8); }
.ph__main { display: contents; }
.ph__main > * { grid-column: 1 / -1; }
.ph__main > .ph__title, .ph__main > h1 { grid-column: 1; }
.ph__kicker { display: inline-flex; align-items: center; gap: 8px; justify-self: start; font-size: var(--t-sm); font-weight: 500; color: var(--fg-2); margin-bottom: 16px; padding: 5px 12px 5px 10px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.ph__kicker .ic { color: var(--ai); }
.ph__title { font-family: var(--font); font-weight: 600; font-size: var(--t-page); line-height: 1.04; letter-spacing: -0.04em; color: var(--fg); text-wrap: balance; }
.ph__title em { font-style: normal; color: var(--fg-3); }
.ph__sub { margin-top: 14px; color: var(--fg-2); font-size: var(--t-lg); max-width: var(--measure); line-height: 1.5; }
.ph__actions { grid-column: 2; display: flex; align-items: center; justify-content: flex-end; gap: var(--s3); flex-wrap: wrap; }
@media (max-width: 720px) {
  .ph { grid-template-columns: minmax(0, 1fr); padding: var(--s3) 0 var(--s6); }
  .ph__main > .ph__title, .ph__main > h1, .ph__actions { grid-column: 1 / -1; }
  .ph__actions { justify-content: flex-start; margin-top: var(--s5); }
  .ph__sub { font-size: var(--t-md); }
}
.section-title { display: flex; align-items: baseline; gap: var(--s3); margin: var(--space-section) 0 var(--s4); flex-wrap: wrap; }
.section-title h2 { font-family: var(--font); font-weight: 600; font-size: var(--t-section); letter-spacing: -0.025em; line-height: 1.25; }
.section-title p { color: var(--fg-3); font-size: var(--t-md); }
.section-title .push { align-self: center; }
.prose { max-width: var(--measure); }

/* link tab row (e.g. the voice agent switcher): a glass segmented row of links; aria-current marks the page */
.subnav { display: inline-flex; align-items: center; gap: 4px; padding: 4px; max-width: 100%; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); overflow-x: auto; scrollbar-width: none; }
.subnav::-webkit-scrollbar { display: none; }
.subnav > a, .subnav > button { position: relative; flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: none; color: var(--fg-3); font: inherit; font-size: var(--t-sm); font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; transition: color var(--d1), background var(--d2); }
.subnav > a:hover, .subnav > button:hover { color: var(--fg); text-decoration: none; background: var(--canvas-2); }
.subnav > [aria-current], .subnav > .is-active { color: var(--fg); font-weight: 600; background: var(--surface-2); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--line), 0 0 18px -6px var(--brand); }
.subnav .ic { color: var(--fg-3); } .subnav > [aria-current] .ic, .subnav > .is-active .ic { color: var(--brand); }
.subnav > .subnav__label { display: inline-flex; align-items: center; padding: 0 8px 0 10px; color: var(--fg-3); font-size: var(--t-sm); white-space: nowrap; }

/* separated facts on one line (date | language | pace); separators hide where a line wraps */
.meta-row { display: flex; flex-wrap: wrap; align-items: center; row-gap: 6px; font-size: var(--t-sm); color: var(--fg-3); min-width: 0; margin-left: -25px; clip-path: inset(-4px -4px -4px 25px); }
.meta-row > * { position: relative; display: inline-flex; align-items: center; gap: 6px; margin-left: 25px; white-space: nowrap; }
.meta-row > *::before { content: ''; position: absolute; left: -13px; top: 50%; width: 1px; height: 14px; margin-top: -7px; background: var(--line-strong); }
.meta-row b { color: var(--fg-2); font-weight: 600; }

/* ------------------------------------------------------------------ cards (glass) */
.card, .board, .wg, .kpis, .stats, .kpi {
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.card { position: relative; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-1); min-width: 0; display: flex; flex-direction: column; }
.card__head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s5) var(--pad-card) 0; }
.card__head + .card__body { padding-top: var(--s3); }
.card__heading { flex: 1; min-width: 0; }
.card__title { font-size: var(--t-card); font-weight: 600; letter-spacing: -0.018em; line-height: 1.3; display: flex; align-items: center; gap: 10px; }
.card__title .ic { color: var(--fg-3); }
.card__sub { font-size: var(--t-sm); color: var(--fg-3); margin-top: 4px; }
.card__actions { display: flex; align-items: center; gap: var(--s2); margin-left: auto; }
.card__body { padding: var(--s5) var(--pad-card) var(--pad-card); flex: 1; min-width: 0; }
.card__body--flush { padding: 0; }
.card__foot { padding: var(--s4) var(--pad-card); border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: var(--s3); font-size: var(--t-sm); color: var(--fg-3); }
.card--flush > .card__body { padding: 0; }
.card--sunken { background: var(--sunken); box-shadow: none; }
.card--quiet { background: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.card--hero { border-radius: var(--r-xl); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-2); }
.card--ai { border-color: var(--ai-line); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 40px -16px var(--ai-glow); }
.card--brand { border-color: var(--brand-line); }
.card.is-selected, .card[aria-current], .card[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand), var(--glow); }
a.card, button.card { color: inherit; text-decoration: none; text-align: left; font: inherit; cursor: pointer; transition: border-color var(--d2) var(--ease), box-shadow var(--d2) var(--ease), transform var(--d2) var(--ease); }
a.card:hover, button.card:hover { border-color: var(--line-strong); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-2), 0 0 0 1px var(--brand-line), 0 12px 40px -18px var(--brand); transform: translateY(-2px); }
a.card.is-selected:hover, button.card.is-selected:hover { border-color: var(--brand); }
.card-link { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: var(--t-sm); font-weight: 600; color: var(--brand-ink); }
.card-link .ic { transition: transform var(--d1) var(--ease); }
.card-link:hover { text-decoration: none; } .card-link:hover .ic { transform: translateX(3px); }

/* ------------------------------------------------------------------ KPI tiles (legacy row) */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-1); overflow: hidden; }
.kpis > .kpi { border-radius: 0; border: 0; box-shadow: none; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.kpis--8 > .kpi:nth-child(4n) { border-right: 0; }
.kpis--8 > .kpi:nth-last-child(-n+4) { border-bottom: 0; }
.kpis--4 > .kpi { border-bottom: 0; } .kpis--4 > .kpi:last-child { border-right: 0; }
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .kpis--3 > .kpi { border-bottom: 0; } .kpis--3 > .kpi:last-child { border-right: 0; }
.kpis--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); } .kpis--5 > .kpi { border-bottom: 0; } .kpis--5 > .kpi:last-child { border-right: 0; }
.kpi { position: relative; display: flex; flex-direction: column; gap: 10px; padding: var(--s5) var(--pad-card); background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-1); color: inherit; text-decoration: none; min-width: 0; transition: background var(--d2) var(--ease); }
a.kpi:hover { background: var(--surface-2); text-decoration: none; }
a.kpi::after { content: ''; position: absolute; top: 22px; right: 22px; width: 7px; height: 7px; border-top: 1.5px solid var(--fg-3); border-right: 1.5px solid var(--fg-3); transform: rotate(45deg); opacity: 0; transition: opacity var(--d1), transform var(--d2) var(--ease); }
a.kpi:hover::after { opacity: 1; transform: translateX(2px) rotate(45deg); }
.kpi__label { font-size: var(--t-sm); color: var(--fg-3); font-weight: 500; display: flex; align-items: center; gap: 6px; padding-right: 14px; }
.kpi__value { display: flex; align-items: baseline; gap: 6px; font-family: var(--mono); font-weight: 500; font-size: clamp(34px, 2.8vw, 44px); line-height: 1; letter-spacing: -0.045em; color: var(--fg); font-variant-numeric: lining-nums tabular-nums; }
.kpi__unit { font-family: var(--font); font-size: var(--t-md); color: var(--fg-3); font-weight: 500; letter-spacing: 0; }
.kpi__foot { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); color: var(--fg-3); flex-wrap: wrap; min-height: 22px; }

/* stat tiles: a large mono numeral, a plain label, an optional quiet line. Use .stats as the row */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-1); overflow: hidden; }
.stat { display: flex; flex-direction: column; gap: 6px; padding: var(--pad-card); min-width: 0; box-shadow: -1px 0 0 var(--line-2); }
.stat__value { font-family: var(--mono); font-weight: 500; font-size: clamp(34px, 2.8vw, 44px); line-height: 1; letter-spacing: -0.045em; color: var(--fg); font-variant-numeric: lining-nums tabular-nums; }
.stat__label { margin-top: 6px; font-size: var(--t-md); font-weight: 600; color: var(--fg); line-height: 1.35; }
.stat__sub { font-size: var(--t-sm); color: var(--fg-3); }
@media (max-width: 720px) { .stat { box-shadow: 0 -1px 0 var(--line-2); } }
.kpi__spark { margin-top: auto; height: 28px; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-size: var(--t-sm); font-weight: 600; font-family: var(--mono); letter-spacing: -0.02em; }
.delta--up { color: var(--good); } .delta--down { color: var(--crit); } .delta--flat { color: var(--fg-3); }
@media (max-width: 900px) {
  .kpis, .kpis--5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis > .kpi { border-right: 1px solid var(--line-2) !important; border-bottom: 1px solid var(--line-2) !important; }
}

/* ------------------------------------------------------------------ tiles, widgets */
/* .tile: a luminous icon tile; colour from a .hue-* class on it or an ancestor. .tile--solid fills it */
.tile { width: 40px; height: 40px; flex: none; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--hue, var(--brand)) var(--hue-soft-mix), transparent); color: var(--hue, var(--brand)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue, var(--brand)) 30%, transparent), 0 0 20px -8px var(--hue, var(--brand)); }
.tile--sm { width: 32px; height: 32px; border-radius: 10px; } .tile--sm .ic { width: 16px; height: 16px; }
.tile--lg { width: 52px; height: 52px; border-radius: 16px; } .tile--lg .ic { width: 24px; height: 24px; }
.tile--solid { background: var(--hue, var(--brand)); color: var(--on-hue); }

/* KPI widgets: glass, icon tile, label, a big mono number (counts up), a delta or sparkline, link arrow */
.wgs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter); }
.wgs--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .wgs--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wg {
  position: relative; display: flex; flex-direction: column; gap: 12px; min-width: 0; padding: var(--s5) var(--s5) var(--s4);
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-1); color: inherit; text-decoration: none; overflow: hidden; isolation: isolate;
  transition: border-color var(--d2) var(--ease), box-shadow var(--d2) var(--ease), transform var(--d2) var(--ease);
}
/* a soft hue bloom in the corner instead of a painted bar */
.wg::before { content: ''; position: absolute; z-index: -1; top: -60%; right: -30%; width: 80%; height: 120%; border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--hue, var(--brand)) 22%, transparent), transparent); opacity: .9; pointer-events: none; }
a.wg:hover { text-decoration: none; border-color: color-mix(in srgb, var(--hue, var(--brand)) 45%, transparent); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-2), 0 0 36px -12px var(--hue, var(--brand)); transform: translateY(-3px); }
.wg__top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.wg__label { flex: 1; min-width: 0; font-size: var(--t-md); font-weight: 500; color: var(--fg-2); line-height: 1.3; }
.wg__go { color: var(--fg-3); transition: transform var(--d2) var(--ease), color var(--d2); }
a.wg:hover .wg__go { color: var(--hue, var(--brand)); transform: translateX(3px); }
.wg__value { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; font-family: var(--mono); font-weight: 500; font-size: var(--t-number); line-height: .95; letter-spacing: -0.055em; color: var(--fg); font-variant-numeric: lining-nums tabular-nums; }
.dp { display: inline-block; margin: 0 -.22em; }
.wg__unit { font-family: var(--font); font-size: var(--t-lg); font-weight: 500; color: var(--fg-3); letter-spacing: -0.01em; }
.wg__foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--t-sm); color: var(--fg-3); line-height: 1.4; min-height: 20px; }
.wg__spark { margin-top: auto; height: 36px; filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--hue, var(--brand)) 40%, transparent)); }
@media (max-width: 1180px) { .wgs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .wgs, .wgs--3, .wgs--2 { grid-template-columns: minmax(0, 1fr); } }

/* ------------------------------------------------------------------ boards (glass) */
/* .board: a glass surface holding one or more .bgroup blocks, each a hue-coded, collapsible table group */
.board { position: relative; background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--r-lg); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-1); min-width: 0; display: flex; flex-direction: column; }
.board__head { display: flex; align-items: center; gap: var(--s3); padding: var(--s5) var(--pad-card) var(--s4); flex-wrap: wrap; }
.board__title { font-size: var(--t-card); font-weight: 600; letter-spacing: -0.018em; display: flex; align-items: center; gap: 12px; }
.board__sub { font-size: var(--t-sm); color: var(--fg-3); margin-top: 2px; }
.board__body { padding: 0 var(--s4) var(--s4); display: flex; flex-direction: column; gap: var(--s5); min-width: 0; }
.board__foot { padding: var(--s3) var(--pad-card); border-top: 1px solid var(--line-2); display: flex; align-items: center; gap: var(--s3); font-size: var(--t-sm); color: var(--fg-3); }
.bgroup { --hue: var(--hue-indigo); min-width: 0; }
.bgroup__head {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 4px 10px 4px 6px; margin-bottom: 8px;
  border: 0; background: none; border-radius: var(--r-sm); text-align: left; color: inherit; cursor: pointer; font: inherit;
}
.bgroup__head:hover { background: var(--canvas-2); }
.bgroup__head > .ic { color: var(--hue); transition: transform var(--d2) var(--ease); }
.bgroup.is-collapsed .bgroup__head > .ic { transform: rotate(-90deg); }
.bgroup__title { font-size: var(--t-lg); font-weight: 600; color: var(--hue); letter-spacing: -0.015em; white-space: nowrap; text-shadow: 0 0 18px color-mix(in srgb, var(--hue) 45%, transparent); }
.bgroup__count { font-size: var(--t-sm); color: var(--fg-3); white-space: nowrap; font-family: var(--mono); letter-spacing: -0.02em; }
.bgroup__head .battery { margin-left: auto; width: min(220px, 34%); }
.bgroup__body { position: relative; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--sunken); }
.bgroup__body::before { content: ''; position: absolute; z-index: 2; left: 0; top: 0; bottom: 0; width: 3px; background: var(--hue); box-shadow: 0 0 14px 1px var(--hue); pointer-events: none; }
.bgroup.is-collapsed .bgroup__body { display: none; }
.bgroup__body > .table-wrap, .bgroup__body > .list { background-color: transparent; }
.bgroup__add { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 var(--s4); border-top: 1px solid var(--line-2); color: var(--fg-3); font-size: var(--t-sm); }
@media (max-width: 720px) { .board__body { padding: 0 var(--s2) var(--s3); } .bgroup__head .battery { width: 100%; margin-left: 0; order: 9; } .bgroup__head { flex-wrap: wrap; } }

/* board tables: quiet column header, row hover glow, status pills, right-aligned mono numbers */
.dt--board { font-size: var(--t-md); }
.dt--board th { background: transparent; color: var(--fg-3); font-size: var(--t-xs); font-weight: 500; border-bottom: 1px solid var(--line); padding: 11px 14px; text-align: left; text-transform: none; }
.dt--board th.c, .dt--board th.cell-status { text-align: center; }
.dt--board td { height: 58px; padding: 8px 14px; border-bottom: 1px solid var(--line-2); color: var(--fg-2); }
.dt--board th + th, .dt--board td + td { border-left: 1px solid var(--line-2); }
.dt--board th:first-child, .dt--board td:first-child { padding-left: var(--s5); }
.dt--board tbody tr:hover td { background: var(--brand-tint); }
.dt--board tbody tr:hover td.cell-status { background: var(--brand-tint); }
.dt--board td.cell-status { padding: 6px 8px; width: 172px; min-width: 150px; }
.dt--board td.r { font-weight: 500; color: var(--fg); font-family: var(--mono); letter-spacing: -0.02em; }

/* .dt--stack: on phones each row becomes a two-column card (first cell + status on top, the rest below) */
@media (max-width: 720px) {
  .dt--stack thead { display: none; }
  .dt--stack, .dt--stack tbody { display: block; width: 100%; }
  .dt--stack tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding: 12px 14px 12px 16px; border-bottom: 1px solid var(--line-2); }
  .dt--stack tr:last-child { border-bottom: 0; }
  .dt--stack td { display: block; height: auto; padding: 0 !important; border: 0 !important; min-width: 0; font-size: var(--t-sm); }
  .dt--stack td:first-child { grid-column: 1; grid-row: 1; font-size: var(--t-md); }
  .dt--stack td.cell-status { grid-column: 2; grid-row: 1; width: auto; min-width: 0; }
  .dt--stack td.cell-status .status--cell { height: 34px; padding: 0 12px; }
  .dt--stack td:not(:first-child):not(.cell-status) { grid-column: 1 / -1; color: var(--fg-3); }
  .dt--stack td[data-label]:not(:first-child)::before { content: attr(data-label) ': '; color: var(--fg-3); }
  .dt--stack tbody tr:hover td { background: transparent; }
}

/* ------------------------------------------------------------------ status pills / cells */
/* dark: tinted glass pill, bright text, hairline of the same hue. light: solid accessible fill, white text. One icon per status */
.status {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 32px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--st-b, color-mix(in srgb, var(--st, var(--st-none)) 15%, transparent)); color: var(--st-on, var(--st, var(--st-none)));
  border: 1px solid var(--st-l, color-mix(in srgb, var(--st, var(--st-none)) 40%, transparent)); font-size: var(--t-sm); font-weight: 600; line-height: 1; white-space: nowrap; letter-spacing: -0.005em;
  transition: background var(--d3) var(--ease), color var(--d3) var(--ease), border-color var(--d3) var(--ease), box-shadow var(--d3) var(--ease);
}
.status .ic { width: 16px; height: 16px; flex: none; }
.status > span { overflow: hidden; text-overflow: ellipsis; }
.status--sm { height: 26px; padding: 0 10px; font-size: var(--t-xs); gap: 5px; }
.status--cell { display: flex; width: 100%; height: 42px; border-radius: 12px; }
.status--done { --st: var(--st-done); --st-b: var(--st-done-bg); --st-l: var(--st-done-bd); }
.status--working { --st: var(--st-working); --st-b: var(--st-working-bg); --st-l: var(--st-working-bd); }
.status--stuck { --st: var(--st-stuck); --st-b: var(--st-stuck-bg); --st-l: var(--st-stuck-bd); }
.status--none { --st: var(--st-none); --st-b: var(--st-none-bg); --st-l: var(--st-none-bd); }
.status--sched { --st: var(--st-sched); --st-b: var(--st-sched-bg); --st-l: var(--st-sched-bd); }
.status--other { --st: var(--st-other); --st-b: var(--st-other-bg); --st-l: var(--st-other-bd); }
.status--off { --st: var(--st-off); --st-b: var(--st-off-bg); --st-l: var(--st-off-bd); }
.status--brand { --st: var(--st-brand); --st-b: var(--st-brand-bg); --st-l: var(--st-brand-bd); }
.status--ai { --st: var(--st-ai); --st-b: var(--st-ai-bg); --st-l: var(--st-ai-bd); }
.status--stuck:not(.status--sm), .status--ai:not(.status--sm) { box-shadow: 0 0 22px -8px var(--st); }
.status.is-flash { animation: m-status 900ms var(--ease-out); }
@keyframes m-status { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--st) 55%, transparent); transform: scale(.97); } 40% { transform: scale(1.03); } 100% { box-shadow: 0 0 0 12px transparent; transform: none; } }

/* battery: thin luminous progress bar; .battery--pct is one fill, plain .battery is the status mix */
.battery { display: inline-flex; align-items: center; gap: 10px; min-width: 80px; width: 100%; }
.battery__track { position: relative; display: flex; flex: 1; gap: 2px; height: 8px; border-radius: var(--r-pill); background: var(--canvas-2); overflow: hidden; }
.battery__track > i { display: block; height: 100%; min-width: 3px; background: var(--st, var(--st-none)); border: 0; padding: 0; }
.battery__track > i.status--done, .battery__track > i.status--working, .battery__track > i.status--stuck, .battery__track > i.status--none, .battery__track > i.status--sched, .battery__track > i.status--other, .battery__track > i.status--off, .battery__track > i.status--brand, .battery__track > i.status--ai { box-shadow: 0 0 8px -1px var(--st); }
.battery--pct .battery__track > i { width: calc(var(--v, 0) * 1%); min-width: 0; flex: none; border-radius: inherit; background: var(--hue, var(--st-done)); box-shadow: 0 0 10px -1px var(--hue, var(--st-done)); transition: width var(--d4) var(--ease-out); }
.battery--done .battery__track > i { background: var(--st-done); } .battery--ai .battery__track > i { background: var(--ai); } .battery--brand .battery__track > i { background: var(--brand-grad); }
.battery > b { font-size: var(--t-sm); font-weight: 500; color: var(--fg); min-width: 42px; text-align: right; font-family: var(--mono); letter-spacing: -0.03em; }

/* ------------------------------------------------------------------ view tabs (glass segmented) */
.tabs--views { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--glass-border); border-radius: var(--r-pill); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); box-shadow: inset 0 1px 0 var(--glass-hi); max-width: 100%; }
.tabs--views .tab { height: 40px; padding: 0 16px; border-radius: var(--r-pill); color: var(--fg-3); font-weight: 500; font-size: var(--t-sm); transition: color var(--d2), background var(--d2), box-shadow var(--d2); }
.tabs--views .tab::after { display: none; }
.tabs--views .tab .ic { color: var(--fg-3); }
.tabs--views .tab:hover { background: var(--canvas-2); color: var(--fg); }
.tabs--views .tab.is-active { background: var(--surface-2); color: var(--fg); font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--line), 0 0 20px -6px var(--brand); }
.tabs--views .tab.is-active .ic { color: var(--brand); }
.tabs--views .tab.is-active .tab__count { background: var(--brand-grad); color: #FFFFFF; }

/* ------------------------------------------------------------------ tags, callouts */
/* .tag: a rounded luminous tint for non-status labels; colour from .hue-* */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: var(--r-pill); font-size: var(--t-sm); font-weight: 500; white-space: nowrap; background: color-mix(in srgb, var(--hue, var(--fg-3)) var(--hue-soft-mix), transparent); color: var(--hue, var(--fg-2)); border: 1px solid color-mix(in srgb, var(--hue, var(--fg-3)) 28%, transparent); }
.tag .ic { width: 14px; height: 14px; }
/* callout: a prominent hue moment (safety path, booking). Colour from .hue-* */
.callout { position: relative; display: flex; gap: 14px; align-items: flex-start; padding: var(--s4) var(--s5); border-radius: var(--r); background: color-mix(in srgb, var(--hue, var(--brand)) 10%, var(--glass)); border: 1px solid color-mix(in srgb, var(--hue, var(--brand)) 36%, transparent); box-shadow: inset 3px 0 0 var(--hue, var(--brand)), 0 0 40px -18px var(--hue, var(--brand)); color: var(--fg-2); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.callout__title { font-weight: 600; color: var(--fg); font-size: var(--t-md); }
.callout__body { font-size: var(--t-sm); margin-top: 2px; }
.callout > .tile { margin-top: 1px; }

/* ------------------------------------------------------------------ buttons */
/* 44px default, 40 .btn--sm, 48 .btn--lg, 56 .btn--xl. One primary per view (gradient + glow); secondary is glass; ghost for tertiary */
.btn {
  --btn-h: 44px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--btn-h); padding: 0 18px; flex: none;
  border-radius: var(--r-pill); border: 1px solid transparent; font-size: var(--t-md); font-weight: 500; line-height: 1; white-space: nowrap; letter-spacing: -0.01em;
  cursor: pointer; text-decoration: none; user-select: none; color: var(--fg);
  transition: background var(--d2) var(--ease), border-color var(--d2) var(--ease), color var(--d2) var(--ease), box-shadow var(--d2) var(--ease), transform var(--d1) var(--ease), filter var(--d2) var(--ease);
}
.btn .ic { width: 18px; height: 18px; }
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled], .btn.is-disabled { opacity: .45; pointer-events: none; }
.btn--primary { background: var(--brand-grad); color: #FFFFFF; font-weight: 600; border-color: rgba(255, 255, 255, .12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 18px -8px rgba(91, 95, 239, .8); }
.btn--primary:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 0 0 1px rgba(167, 139, 250, .5), 0 10px 34px -6px rgba(124, 131, 255, .75); filter: brightness(1.08); }
.btn--primary:active { filter: brightness(.96); }
.btn--secondary { background: var(--glass); border-color: var(--line-strong); color: var(--fg); box-shadow: inset 0 1px 0 var(--glass-hi); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.btn--secondary:hover { background: var(--surface-2); border-color: var(--brand-line); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 24px -10px var(--brand); }
.btn--ghost { background: transparent; color: var(--fg-2); }
.btn--ghost:hover { background: var(--canvas-2); color: var(--fg); }
.btn--danger { background: linear-gradient(135deg, #E11D48, #BE123C); color: #FFFFFF; font-weight: 600; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 18px -8px rgba(225, 29, 72, .8); }
.btn--danger:hover { filter: brightness(1.08); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 10px 30px -8px rgba(251, 113, 133, .8); }
.btn--danger-soft { background: var(--crit-soft); color: var(--crit); border-color: var(--crit-line); }
.btn--ai { background: var(--ai-soft); color: var(--ai-ink); border-color: var(--ai-line); }
.btn--ai:hover { border-color: var(--ai); box-shadow: 0 0 26px -8px var(--ai-glow); }
.btn--sm { --btn-h: 40px; padding: 0 14px; font-size: var(--t-sm); gap: 6px; }
.btn--sm .ic { width: 16px; height: 16px; }
.btn--lg { --btn-h: 48px; padding: 0 22px; font-size: var(--t-md); }
.btn--xl { --btn-h: 56px; padding: 0 30px; font-size: var(--t-lg); gap: 10px; }
.btn--xl .ic { width: 20px; height: 20px; }
.btn--icon { width: var(--btn-h); padding: 0; }
.btn--block { width: 100%; }
.btn .ic { opacity: .95; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; margin-left: -1px; } .btn-group .btn:first-child { border-radius: var(--r-pill) 0 0 var(--r-pill); margin-left: 0; } .btn-group .btn:last-child { border-radius: 0 var(--r-pill) var(--r-pill) 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-ink); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; min-height: 24px; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ badges, chips, tags, dots */
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: calc(13.5px * var(--fs)); font-weight: 500; line-height: 1; white-space: nowrap; letter-spacing: 0;
  background: var(--canvas-2); color: var(--fg-2); border: 1px solid var(--line);
}
.badge .ic { margin-left: -2px; width: 14px; height: 14px; }
.badge--good { background: var(--good-soft); color: var(--good); border-color: var(--good-line); }
.badge--warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.badge--crit { background: var(--crit-soft); color: var(--crit); border-color: var(--crit-line); }
.badge--info { background: var(--info-soft); color: var(--info); border-color: var(--info-line); }
.badge--brand { background: var(--brand-soft); color: var(--brand-ink); border-color: var(--brand-line); }
.badge--ai { background: var(--ai-soft); color: var(--ai-ink); border-color: var(--ai-line); }
.badge--outline { background: transparent; border-color: var(--line-strong); color: var(--fg-2); }
.badge--solid { background: var(--fg); color: var(--fg-inverse); border-color: transparent; }
.badge--dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 6px currentColor; flex: none; }
.badge--lg { height: 30px; padding: 0 12px; font-size: var(--t-sm); }

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 15px; border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--glass); color: var(--fg-2); font-size: var(--t-sm); font-weight: 500; cursor: pointer;
  transition: all var(--d2) var(--ease); white-space: nowrap; -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.chip:hover { border-color: var(--line-strong); color: var(--fg); background: var(--surface-2); }
.chip.is-active { background: var(--brand-soft); color: var(--fg); border-color: var(--brand-line); font-weight: 600; box-shadow: 0 0 22px -8px var(--brand); }
.chip .chip__n { font-size: var(--t-xs); color: var(--fg-3); font-weight: 500; font-family: var(--mono); }
.chip.is-active .chip__n { color: inherit; opacity: .75; }
.chip .chip__x { margin-right: -4px; opacity: .6; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.lang {
  display: inline-flex; align-items: center; justify-content: center; height: 22px; min-width: 30px; padding: 0 6px; border-radius: 6px;
  font-size: var(--t-xs); font-weight: 500; font-family: var(--mono); letter-spacing: .02em; border: 1px solid var(--line-strong); color: var(--fg-2); background: var(--canvas-2);
}
.lang--es { border-color: var(--ai-line); color: var(--ai-ink); background: var(--ai-soft); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-4); flex: none; }
.dot--good { background: var(--good); } .dot--warn { background: var(--warn); } .dot--crit { background: var(--crit); } .dot--info { background: var(--info); } .dot--brand { background: var(--brand); } .dot--ai { background: var(--ai); box-shadow: 0 0 8px var(--ai); }
.dot--live { background: var(--ai); box-shadow: 0 0 0 0 var(--ai); animation: m-ping 1.8s var(--ease) infinite; }

.ptag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-sm); color: var(--fg-2); white-space: nowrap; }
.ptag i { width: 8px; height: 8px; border-radius: 50%; background: var(--ptag, var(--brand)); box-shadow: 0 0 6px var(--ptag, var(--brand)); flex: none; }

/* ------------------------------------------------------------------ tabs + segmented */
.tabs { display: flex; align-items: center; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; position: relative; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 48px; padding: 0 14px; border: 0; background: none;
  color: var(--fg-3); font-weight: 500; font-size: var(--t-md); cursor: pointer; white-space: nowrap; transition: color var(--d1);
}
.tab:hover { color: var(--fg); }
.tab::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brand); box-shadow: 0 0 10px var(--brand); transform: scaleX(0); transition: transform var(--d3) var(--ease-out); }
.tab.is-active { color: var(--fg); font-weight: 600; }
.tab.is-active::after { transform: scaleX(1); }
.tab__count { font-size: var(--t-xs); font-weight: 500; font-family: var(--mono); padding: 1px 7px; border-radius: var(--r-pill); background: var(--canvas-2); color: var(--fg-3); }
.tab.is-active .tab__count { background: var(--brand-grad); color: #FFFFFF; }
.tab__count--warn { background: var(--warn-soft) !important; color: var(--warn) !important; }
.tab__count--crit { background: var(--crit-soft) !important; color: var(--crit) !important; }
.tabs--pill { border: 0; gap: 4px; }
.tabs--pill .tab { height: 40px; border-radius: var(--r-pill); }
.tabs--pill .tab::after { display: none; }
.tabs--pill .tab.is-active { background: var(--surface-2); box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--line); }
[data-panel] { animation: m-fade var(--d3) var(--ease); }

.seg { display: inline-flex; padding: 4px; gap: 2px; border-radius: var(--r-pill); background: var(--glass); border: 1px solid var(--glass-border); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); }
.seg button {
  height: 38px; padding: 0 15px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--fg-3); font-size: var(--t-sm); font-weight: 500;
  cursor: pointer; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; transition: background var(--d2), color var(--d2), box-shadow var(--d2);
}
.seg button:hover { color: var(--fg); }
.seg button.is-active { background: var(--surface-2); color: var(--fg); font-weight: 600; box-shadow: inset 0 1px 0 var(--glass-hi), 0 0 0 1px var(--line), 0 0 18px -8px var(--brand); }
.seg--sm button { height: 34px; padding: 0 11px; font-size: var(--t-xs); }

/* ------------------------------------------------------------------ clinical patterns (shared with the call page) */
/* soft status tag: a tint of the status hue with the hue as text; works in both themes and with a custom --st */
:root .status.status--soft, :root[data-theme] .status.status--soft {
  height: 28px; padding: 0 10px; gap: 6px; border-radius: 8px; font-size: var(--t-xs); font-weight: 600;
  background: color-mix(in srgb, var(--st, var(--st-none)) 13%, var(--surface-solid)); color: var(--st, var(--st-none)); border-color: transparent; box-shadow: none;
}
.status--soft .ic { width: 14px; height: 14px; }
.status--soft.status--cell { height: 34px; }

/* section header: a green bar, the title, an optional count badge; <h3 class="sec-head"><span class="sec-head__t">Now asking</span><span class="count">28/67</span></h3> */
.sec-head { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; min-width: 0; }
.sec-head__t { display: inline-flex; align-items: center; gap: 10px; font-size: var(--t-md); font-weight: 700; color: var(--good); letter-spacing: -0.01em; }
.sec-head__t::before { content: ''; flex: none; width: 4px; height: 18px; border-radius: 2px; background: currentColor; }
.sec-head > .push, .sec-head > .link-btn:last-child { margin-left: auto; }
/* count badge: green by default, .count--muted / .count--brand */
.count { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); font-family: var(--mono); font-size: var(--t-xs); font-weight: 600; letter-spacing: -0.02em; color: var(--good); background: var(--good-soft); white-space: nowrap; }
.count--muted { color: var(--fg-2); background: var(--canvas-2); } .count--brand { color: var(--brand-ink); background: var(--brand-soft); }
/* panel head: icon tile, title over one line, a count on the right (used by card heads on clinical pages) */
.panel-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line-2); }
.panel-head__ic { flex: none; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--good-soft); color: var(--good); }
.panel-head__t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.panel-head__t b { font-size: var(--t-lg); font-weight: 700; color: var(--fg); }
.panel-head__t span { font-size: var(--t-xs); color: var(--fg-3); }

/* fact columns: a small label over a value, in a grid; groups are split by a hairline */
.facts { display: grid; grid-template-columns: repeat(var(--cols, 3), auto); gap: 10px 28px; padding: 2px 24px; border-left: 1px solid var(--line); }
.facts:first-child { border-left: 0; padding-left: 0; }
.fact { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fact > span { font-size: var(--t-xs); color: var(--fg-3); }
.fact > b { font-size: var(--t-sm); font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fact > b.mono { font-weight: 500; }

/* patient header: avatar, green kicker, name + tag, meta row, then fact columns and one action */
.pth { display: flex; align-items: center; gap: 20px 28px; flex-wrap: wrap; padding: 18px 22px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-1); }
.pth__who { display: flex; align-items: center; gap: 16px; min-width: 0; flex: 1 1 340px; }
.pth__av .av { width: 76px; height: 76px; font-size: calc(26px * var(--fs)); font-weight: 600; background: var(--good-soft); color: var(--good); box-shadow: inset 0 0 0 1px var(--good-line); }
.pth__id { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.pth__h { margin: 0; font-size: var(--t-xs); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--good); }
.pth__name { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: var(--t-2xl); font-weight: 700; letter-spacing: -0.02em; color: var(--fg); }
.pth__meta { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; font-size: var(--t-sm); color: var(--fg-2); }
.pth__meta > span { display: inline-flex; align-items: center; gap: 6px; }
.pth__meta .ic { color: var(--fg-3); }
.pth__facts { display: flex; flex: 0 1 auto; flex-wrap: wrap; row-gap: 14px; }
.pth__act { margin-left: auto; flex: none; }
@media (max-width: 720px) { .pth { padding: 16px; } .pth__av .av { width: 56px; height: 56px; font-size: calc(20px * var(--fs)); } .facts { flex: 1 1 100%; padding: 0; border-left: 0; grid-template-columns: repeat(2, minmax(0, 1fr)); } .pth__act { margin-left: 0; } }

/* ------------------------------------------------------------------ data grid */
/* UI.initGrids wraps every table.dt in .table-wrap: it scrolls sideways on narrow screens, with edge shadows as the cue */
.table-wrap { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-md); }
.dt th {
  position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 500; font-size: var(--t-xs); letter-spacing: .01em; color: var(--fg-3);
  padding: 12px 16px; background: var(--sunken); border-bottom: 1px solid var(--line); white-space: nowrap; user-select: none;
}
.dt th:first-child, .dt td:first-child { padding-left: var(--pad-card); }
.dt th:last-child, .dt td:last-child { padding-right: var(--pad-card); }
.dt th[data-sort] { cursor: pointer; }
.dt th[data-sort]:hover { color: var(--ink); }
.dt th .sort-ic { display: inline-block; width: 8px; margin-left: 5px; opacity: 0; transition: opacity var(--d1), transform var(--d2); vertical-align: 1px; }
.dt th[data-sort]:hover .sort-ic { opacity: .5; }
.dt th.is-sorted { color: var(--ink); }
.dt th.is-sorted .sort-ic { opacity: 1; }
.dt th.is-desc .sort-ic { transform: rotate(180deg); }
.dt td { height: 60px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; color: var(--ink-2); }
.dt td.strong, .dt td b { color: var(--ink); }
.dt tr:last-child td { border-bottom: 0; }
.dt tbody tr { transition: background var(--d1); }
.dt tbody tr:hover td { background: var(--brand-tint); }
.dt tbody tr[data-href], .dt tbody tr.is-clickable { cursor: pointer; }
.dt tbody tr.is-selected td { background: var(--brand-tint); }
.dt tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--brand), inset 10px 0 16px -12px var(--brand); }
.dt .r, .dt th.r { text-align: right; font-variant-numeric: tabular-nums; }
.dt td.r { font-family: var(--mono); letter-spacing: -0.02em; }
.dt .c, .dt th.c { text-align: center; }
/* one action column: right-aligned, same style for every row */
.dt .dt__actions { width: 1%; text-align: right; white-space: nowrap; }
.dt .dt__actions > * + * { margin-left: var(--s2); }
.dt--compact td { height: 48px; padding-top: 8px; padding-bottom: 8px; }
.dt--plain th { background: transparent; }
.dt__check { width: 44px; }
.dt__check input, .check { appearance: none; width: 20px; height: 20px; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface); display: grid; place-items: center; cursor: pointer; margin: 0; transition: all var(--d1); }
.dt__check input:checked, .check:checked { background: var(--brand); border-color: var(--brand); }
.dt__check input:checked::after, .check:checked::after { content: ''; width: 8px; height: 4.5px; border-left: 2px solid var(--on-brand); border-bottom: 2px solid var(--on-brand); transform: translateY(-1px) rotate(-45deg); }
.dt__check input:indeterminate { background: var(--brand); border-color: var(--brand); }
.dt__check input:indeterminate::after { content: ''; width: 8px; height: 2px; background: var(--on-brand); border-radius: 1px; }
.dt-empty td { text-align: center; padding: 40px; color: var(--ink-3); }
.cell-person { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cell-person .cp-txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.cell-person .cp-txt b { color: var(--ink); font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-person .cp-txt span { font-size: var(--t-xs); color: var(--ink-3); }
.toolbar { display: flex; align-items: center; gap: var(--s3); padding: var(--s4) var(--pad-card); border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.selbar { display: flex; align-items: center; gap: var(--s3); padding: 8px var(--s5); background: var(--glass-strong); color: var(--fg); border: 1px solid var(--brand-line); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); font-size: var(--t-sm); border-radius: var(--r-pill); box-shadow: var(--sh-3); animation: m-rise var(--d2) var(--ease-out); }
.selbar .btn--ghost { color: var(--fg); } .selbar .btn--ghost:hover { background: var(--canvas-2); }

/* ------------------------------------------------------------------ list rows */
.list { display: flex; flex-direction: column; }
.lrow { display: flex; align-items: center; gap: var(--s3); min-height: 60px; padding: 12px var(--pad-card); border-bottom: 1px solid var(--line-2); color: inherit; text-decoration: none; min-width: 0; transition: background var(--d1); }
.lrow:last-child { border-bottom: 0; }
a.lrow:hover, button.lrow:hover, .lrow.is-clickable:hover { background: var(--surface-2); text-decoration: none; }
button.lrow { width: 100%; border: 0; border-bottom: 1px solid var(--line-2); background: none; text-align: left; cursor: pointer; }
.lrow__lead { flex: none; display: flex; align-items: center; }
.lrow__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lrow__title { font-weight: 550; color: var(--ink); display: flex; align-items: center; gap: 8px; min-width: 0; }
.lrow__title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow__sub { font-size: var(--t-sm); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow__trail { flex: none; display: flex; align-items: center; gap: var(--s2); color: var(--ink-3); font-size: var(--t-sm); }
.list--inset .lrow { padding-left: 0; padding-right: 0; }
.icon-tile { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--canvas-2); color: var(--ink-2); flex: none; }
.icon-tile--good { background: var(--good-soft); color: var(--good); } .icon-tile--warn { background: var(--warn-soft); color: var(--warn); } .icon-tile--crit { background: var(--crit-soft); color: var(--crit); }
.icon-tile--info { background: var(--info-soft); color: var(--info); } .icon-tile--brand { background: var(--brand-soft); color: var(--brand-ink); } .icon-tile--ai { background: var(--ai-soft); color: var(--ai-ink); }
.icon-tile--sm { width: 30px; height: 30px; border-radius: 8px; }

/* ------------------------------------------------------------------ timeline / event log */
.tl { position: relative; display: flex; flex-direction: column; }
.tl__item { position: relative; display: grid; grid-template-columns: 64px 22px minmax(0, 1fr); gap: 0 10px; padding: 0 0 14px; }
.tl__item::before { content: ''; position: absolute; left: 84px; top: 16px; bottom: -2px; width: 1.5px; background: var(--line-strong); }
.tl__item:last-child::before { display: none; }
.tl__time { font-size: var(--t-xs); color: var(--fg-3); text-align: right; padding-top: 3px; white-space: nowrap; font-family: var(--mono); letter-spacing: -0.02em; }
.tl__dot { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); border: 1.5px solid var(--line-strong); color: var(--ink-3); }
.tl__dot--good { border-color: var(--good-line); background: var(--good-soft); color: var(--good); }
.tl__dot--warn { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.tl__dot--crit { border-color: var(--crit-line); background: var(--crit-soft); color: var(--crit); }
.tl__dot--info { border-color: var(--info-line); background: var(--info-soft); color: var(--info); }
.tl__dot--brand { border-color: var(--brand-line); background: var(--brand-soft); color: var(--brand-ink); }
.tl__dot--ai { border-color: var(--ai-line); background: var(--ai-soft); color: var(--ai-ink); }
.tl__dot--plain { width: 10px; height: 10px; margin: 6px; border-width: 2px; }
.tl__body { min-width: 0; padding-top: 1px; }
.tl__title { font-weight: 550; color: var(--ink); font-size: var(--t-md); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl__text { color: var(--ink-3); font-size: var(--t-sm); margin-top: 2px; }
.tl__meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tl--compact .tl__item { grid-template-columns: 52px 18px minmax(0, 1fr); padding-bottom: 10px; }
.tl--compact .tl__item::before { left: 70px; }
.tl--compact .tl__dot { width: 18px; height: 18px; }
.tl--compact .tl__dot--plain { width: 8px; height: 8px; margin: 5px; }
.payload { margin-top: 8px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line-2); font-family: var(--mono); font-size: var(--t-xs); color: var(--ink-2); line-height: 1.6; white-space: pre-wrap; overflow-x: auto; font-variant-numeric: tabular-nums; }

/* live activity feed: a glowing vertical rail with one event per row; colour per event from --st (a status token) */
.feed { position: relative; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.feed::before { content: ''; position: absolute; left: 15px; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: linear-gradient(180deg, var(--ai), color-mix(in srgb, var(--brand) 60%, transparent) 45%, transparent); opacity: .55; }
.feed__item { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 14px; padding: 10px 0; color: inherit; text-decoration: none; border-radius: var(--r-sm); }
a.feed__item:hover { text-decoration: none; } a.feed__item:hover .feed__title { color: var(--brand-ink); }
.feed__dot { position: relative; z-index: 1; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--bg); color: var(--st, var(--ai)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--st, var(--ai)) 45%, transparent), 0 0 18px -4px color-mix(in srgb, var(--st, var(--ai)) 70%, transparent); }
.feed__dot .ic { width: 15px; height: 15px; }
.feed__item.is-new .feed__dot::after { content: ''; position: absolute; inset: -3px; border-radius: 50%; border: 1.5px solid var(--st, var(--ai)); animation: live-ping 2s var(--ease-out) infinite; }
.feed__body { min-width: 0; padding-top: 1px; }
.feed__top { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.feed__title { flex: 1; min-width: 0; font-weight: 600; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color var(--d1); }
.feed__time { flex: none; font-family: var(--mono); font-size: var(--t-xs); color: var(--fg-3); letter-spacing: -0.02em; }
.feed__text { font-size: var(--t-sm); color: var(--fg-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed__text b { color: var(--st, var(--fg-2)); font-weight: 600; }

/* ------------------------------------------------------------------ key-value */
.kv { display: grid; grid-template-columns: minmax(110px, auto) minmax(0, 1fr); gap: 0; margin: 0; font-size: var(--t-md); }
.kv dt { color: var(--ink-3); padding: 10px 16px 10px 0; border-bottom: 1px solid var(--line-2); }
.kv dd { margin: 0; padding: 10px 0; color: var(--ink); border-bottom: 1px solid var(--line-2); min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kv dt:last-of-type, .kv dd:last-of-type { border-bottom: 0; }
.kv--stack { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--s4) var(--s5); }
.kv--stack > div { display: flex; flex-direction: column; gap: 2px; }
.kv--stack dt, .kv--stack dd { border: 0; padding: 0; }
.kv--stack dt { font-size: var(--t-sm); }

/* ------------------------------------------------------------------ transcript bubbles */
.ts { display: flex; flex-direction: column; gap: 14px; }
.bub { display: flex; gap: 10px; max-width: 88%; animation: m-rise var(--d3) var(--ease-out) both; }
.bub__av { flex: none; margin-top: 2px; }
.bub__col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.bub__who { font-size: var(--t-xs); color: var(--ink-3); min-height: 18px; display: flex; align-items: center; gap: 6px; }
.bub__who b { color: var(--ink-2); font-weight: 600; }
.bub__text { padding: 12px 16px; border-radius: 18px; font-size: var(--t-md); line-height: 1.5; color: var(--fg); background: var(--glass); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi); overflow-wrap: anywhere; }
.bub__gloss { font-size: var(--t-sm); color: var(--ink-3); padding: 0 4px; font-style: italic; }
.bub__gloss::before { content: 'English: '; font-style: normal; font-family: var(--font-ui); color: var(--ink-4); }
.bub__tool { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 4px 9px 4px 7px; border-radius: 7px; font-size: var(--t-xs); color: var(--ai-ink); background: var(--ai-soft); border: 1px solid var(--ai-line); font-weight: 500; max-width: 100%; }
.bub__tool code { color: var(--ink-2); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bub--agent .bub__text { border-top-left-radius: 6px; border-color: var(--ai-line); background: color-mix(in srgb, var(--ai) 8%, var(--glass)); }
.bub--patient { align-self: flex-end; flex-direction: row-reverse; }
.bub--patient .bub__col { align-items: flex-end; }
.bub--patient .bub__text { background: var(--brand-grad); color: #FFFFFF; border-color: transparent; border-top-right-radius: 6px; box-shadow: 0 8px 24px -12px rgba(124, 131, 255, .8); }
.bub--patient .bub__gloss { text-align: right; }
.bub--human .bub__text { background: var(--info-soft); border-color: var(--info-line); border-top-left-radius: 5px; }
.bub--system { align-self: center; max-width: 92%; animation-name: m-fade; }
.bub--system .bub__text { background: transparent; border: 1px dashed var(--line-strong); box-shadow: none; font-size: var(--t-sm); color: var(--ink-3); padding: 6px 12px; border-radius: var(--r-pill); text-align: center; display: inline-flex; gap: 6px; align-items: center; }
.bub--system .bub__col { align-items: center; }
.bub.is-interim .bub__text { opacity: .6; }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; border-radius: 16px; border-top-left-radius: 6px; background: var(--ai-soft); border: 1px solid var(--ai-line); }
.typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ai); box-shadow: 0 0 6px var(--ai); animation: m-typing 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }

/* ------------------------------------------------------------------ drawer, modal, scrim, menu */
.scrim { position: fixed; inset: 0; z-index: 80; background: var(--overlay); -webkit-backdrop-filter: blur(6px) saturate(120%); backdrop-filter: blur(6px) saturate(120%); opacity: 0; pointer-events: none; transition: opacity var(--d3) var(--ease); }
.scrim.is-open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 12px; right: 12px; bottom: 12px; z-index: 90; width: min(580px, calc(100vw - 24px)); display: flex; flex-direction: column;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r-xl); overflow: hidden;
  -webkit-backdrop-filter: blur(28px) saturate(160%); backdrop-filter: blur(28px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-3);
  transform: translateX(calc(100% + 24px)); transition: transform 320ms var(--ease-out), visibility 0s linear 320ms; visibility: hidden;
}
.drawer.is-open { transform: none; visibility: visible; transition: transform 320ms var(--ease-out); }
.drawer--wide { width: min(760px, calc(100vw - 16px)); }
.drawer__head { position: relative; display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s6) var(--s6) var(--s5); border-bottom: 1px solid var(--line-2); background: radial-gradient(120% 140% at 0% 0%, var(--brand-tint), transparent 60%); }
.drawer__title { font-family: var(--font); font-weight: 600; font-size: var(--t-3xl); letter-spacing: -0.03em; line-height: 1.1; }
.drawer__sub { color: var(--ink-3); font-size: var(--t-sm); margin-top: 4px; }
.drawer__body { flex: 1; overflow-y: auto; padding: var(--s6); }
.drawer__foot { display: flex; align-items: center; gap: var(--s2); padding: var(--s4) var(--s6); border-top: 1px solid var(--line-2); }

.modal { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: var(--s5); pointer-events: none; visibility: hidden; }
.modal.is-open { pointer-events: auto; visibility: visible; }
.modal__panel {
  width: min(520px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column; background: var(--glass-strong);
  border: 1px solid var(--glass-border); border-radius: var(--r-xl); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-3);
  -webkit-backdrop-filter: blur(28px) saturate(160%); backdrop-filter: blur(28px) saturate(160%); opacity: 0; transform: translateY(10px) scale(.98);
  transition: opacity var(--d2) var(--ease), transform var(--d3) var(--ease-out);
}
.modal.is-open .modal__panel { opacity: 1; transform: none; }
.modal--wide .modal__panel { width: min(760px, 100%); }
.modal__head { display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s5) var(--s6) var(--s2); }
.modal__title { font-family: var(--font); font-weight: 600; font-size: var(--t-2xl); letter-spacing: -0.025em; line-height: 1.2; }
.modal__body { padding: var(--s2) var(--s6) var(--s5); overflow-y: auto; color: var(--ink-2); }
.modal__foot { display: flex; justify-content: flex-end; gap: var(--s2); padding: var(--s4) var(--s6); border-top: 1px solid var(--line-2); background: var(--sunken); border-radius: 0 0 var(--r-xl) var(--r-xl); }

.menu {
  position: fixed; z-index: 100; min-width: 220px; max-width: calc(100vw - 16px); padding: 6px; background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r-lg);
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-3); animation: m-pop var(--d2) var(--ease-out); transform-origin: top left;
}
.menu__label { font-size: var(--t-xs); color: var(--ink-3); padding: 8px 12px 6px; font-weight: 600; }
.menu__note { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; font-size: var(--t-sm); color: var(--ink-3); line-height: 1.4; }
.menu__note .ic { margin-top: 2px; color: var(--ink-4); }
.menu__item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: none; border-radius: 12px; color: var(--ink-2); font-size: var(--t-md); text-align: left; cursor: pointer; text-decoration: none; }
.menu__item:hover, .menu__item.is-focus, .menu__item:focus-visible { background: var(--brand-soft); color: var(--fg); text-decoration: none; box-shadow: none; }
.menu__item:focus-visible { outline-offset: -2px; }
.menu__item .ic { color: var(--ink-3); }
.menu__item .menu__sub { display: block; font-size: var(--t-xs); color: var(--ink-3); }
.menu__item .menu__check { margin-left: auto; color: var(--brand); }
.menu__item--crit { color: var(--crit); } .menu__item--crit .ic { color: var(--crit); }
.menu__sep { height: 1px; background: var(--line-2); margin: 5px 4px; }

/* command palette: the hero of navigation, a large centred glass sheet */
.cmdk { position: fixed; inset: 0; z-index: 110; display: flex; justify-content: center; align-items: flex-start; padding-top: 12vh; pointer-events: none; visibility: hidden; }
.cmdk.is-open { pointer-events: auto; visibility: visible; }
.cmdk__panel {
  position: relative; width: min(720px, calc(100vw - 24px)); background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: var(--r-xl); overflow: hidden;
  -webkit-backdrop-filter: blur(32px) saturate(170%); backdrop-filter: blur(32px) saturate(170%);
  box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-3), 0 0 120px -40px var(--brand);
  opacity: 0; transform: translateY(-10px) scale(.97); transition: opacity var(--d2) var(--ease), transform var(--d3) var(--ease-out);
}
.cmdk__panel::before { content: ''; position: absolute; left: 10%; right: 10%; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--ai), var(--brand), transparent); opacity: .8; }
.cmdk.is-open .cmdk__panel { opacity: 1; transform: none; }
.cmdk__input { display: flex; align-items: center; gap: 12px; padding: 0 var(--s6); border-bottom: 1px solid var(--line-2); }
.cmdk__input .ic { color: var(--ai); }
.cmdk__input input { flex: 1; min-width: 0; height: 72px; border: 0; background: transparent; font: inherit; font-size: var(--t-2xl); letter-spacing: -0.02em; color: var(--fg); outline: none; box-shadow: none; }
.cmdk__input input::placeholder { color: var(--fg-3); }
.cmdk__list { max-height: min(460px, 56vh); overflow-y: auto; padding: 8px; }
.cmdk__group { font-size: var(--t-xs); color: var(--fg-3); padding: 14px 14px 6px; font-weight: 500; font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.cmdk__item { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 10px 14px; border-radius: var(--r); cursor: pointer; color: var(--fg-2); transition: background var(--d1) var(--ease); }
.cmdk__item > .ic { width: 32px; height: 32px; padding: 7px; border-radius: 10px; background: var(--canvas-2); color: var(--fg-3); }
.cmdk__item.is-focus { background: var(--brand-soft); color: var(--fg); box-shadow: inset 0 0 0 1px var(--brand-line), 0 0 30px -14px var(--brand); }
.cmdk__item.is-focus > .ic { color: var(--brand-ink); background: var(--brand-soft); }
.cmdk__item .cmdk__hint { margin-left: auto; font-size: var(--t-xs); color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.cmdk__item .cmdk__enter { display: none; margin-left: 8px; }
.cmdk__item.is-focus .cmdk__enter { display: inline-flex; }
.cmdk__empty { padding: 36px; text-align: center; color: var(--fg-3); }
.cmdk__foot { display: flex; gap: var(--s5); padding: 10px var(--s6); border-top: 1px solid var(--line-2); font-size: var(--t-xs); color: var(--fg-3); background: var(--sunken); }
.cmdk__foot span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 720px) { .cmdk { padding-top: 10px; } .cmdk__input input { height: 60px; font-size: var(--t-lg); } .cmdk__foot span:not(.push) { display: none; } .cmdk__item .cmdk__hint { display: none; } }

/* toast */
.toasts { position: fixed; z-index: 120; bottom: calc(20px + var(--dock-b)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column-reverse; gap: 8px; align-items: center; pointer-events: none; width: min(520px, calc(100vw - 32px)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 10px; border-radius: var(--r-pill);
  background: var(--glass-strong); color: var(--fg); border: 1px solid var(--glass-border); box-shadow: inset 0 1px 0 var(--glass-hi), var(--sh-3); font-size: var(--t-md); max-width: 100%;
  -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%);
  animation: m-toast-in var(--d3) var(--ease-out) both;
}
.toast.is-leaving { animation: m-toast-out var(--d2) var(--ease) both; }
.toast__ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--brand-grad); color: #FFFFFF; box-shadow: 0 0 16px -4px var(--brand); }
.toast--good .toast__ic { background: var(--st-done); box-shadow: 0 0 16px -4px var(--st-done); }
.toast--warn .toast__ic { background: var(--st-working); box-shadow: 0 0 16px -4px var(--st-working); }
.toast--crit .toast__ic { background: var(--st-stuck); box-shadow: 0 0 16px -4px var(--st-stuck); }
.toast--ai .toast__ic { background: var(--ai); box-shadow: 0 0 16px -4px var(--ai); }
.toast--info .toast__ic { background: var(--st-sched); box-shadow: 0 0 16px -4px var(--st-sched); }
.toast__txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.toast__txt b { font-weight: 600; }
.toast__txt span { color: var(--ink-3); font-size: var(--t-sm); }
.toast__act { margin-left: auto; min-height: 40px; padding: 0 14px; background: none; border: 0; border-radius: var(--r-pill); color: var(--brand-ink); font-weight: 700; cursor: pointer; white-space: nowrap; }
.toast__act:hover { background: var(--brand-tint); }
.toast__act:hover { opacity: 1; text-decoration: underline; }
.toast--good .toast__ic, .toast--warn .toast__ic, .toast--crit .toast__ic, .toast--ai .toast__ic, .toast--info .toast__ic { color: var(--on-status); }

/* tooltip */
.tip { position: fixed; z-index: 130; pointer-events: none; padding: 7px 11px; border-radius: var(--r-sm); background: var(--glass-strong); color: var(--fg); border: 1px solid var(--glass-border); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); font-size: var(--t-sm); line-height: 1.4; box-shadow: var(--sh-2); max-width: 280px; opacity: 0; transform: translateY(4px); transition: opacity var(--d1), transform var(--d1); }
.tip.is-on { opacity: 1; transform: none; }
.tip b { font-weight: 600; }
.tip .tip__row { display: flex; align-items: center; gap: 8px; }
.tip .tip__sw { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.tip .tip__v { margin-left: auto; padding-left: 12px; font-weight: 500; font-family: var(--mono); }

/* ------------------------------------------------------------------ forms */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field__label { font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); }
.field__hint { font-size: var(--t-xs); color: var(--ink-3); line-height: 1.45; }
.field__error { font-size: var(--t-xs); color: var(--crit); }
.input, .select, .textarea {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--sunken);
  color: var(--fg); font: inherit; font-size: var(--t-md); transition: border-color var(--d2), box-shadow var(--d2), background var(--d2); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .12);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-4); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); background: var(--canvas-2); box-shadow: var(--ring), 0 0 24px -8px var(--brand); }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.select option { background: var(--bg); color: var(--fg); }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238C94AA' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 11px center; cursor: pointer; }
.input--sm, .select--sm { height: 40px; font-size: var(--t-sm); }
.input.is-invalid { border-color: var(--crit); }
.input-icon { position: relative; display: flex; align-items: center; border: 0; padding: 0; background: none; box-shadow: none; }
.input-icon > .ic { position: absolute; left: 11px; color: var(--ink-4); pointer-events: none; }
.input-icon > .input { padding-left: 34px; }
.input-icon > kbd { position: absolute; right: 8px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--glass); cursor: pointer; transition: border-color var(--d1), background var(--d1); }
.radio-card:hover { border-color: var(--line-strong); }
.radio-card.is-active, .radio-card:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); box-shadow: inset 0 0 0 1px var(--brand); }
.radio-card input { accent-color: var(--brand); margin-top: 3px; }

.switch { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; cursor: pointer; user-select: none; font-size: var(--t-md); color: var(--ink-2); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track { position: relative; width: 40px; height: 24px; border-radius: var(--r-pill); background: var(--line-strong); transition: background var(--d2) var(--ease); flex: none; }
.switch__track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform var(--d2) var(--spring); }
.switch input:checked + .switch__track { background: var(--brand-grad); box-shadow: 0 0 16px -4px var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { box-shadow: var(--ring); }
.range { width: 100%; accent-color: var(--brand); }

/* ------------------------------------------------------------------ ring, meter, avatars */
.ring { position: relative; display: inline-grid; place-items: center; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring__track { stroke: var(--line); }
.ring__bar { stroke: var(--brand); transition: stroke-dashoffset var(--d4) var(--ease-out); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--brand) 60%, transparent)); }
.ring--good .ring__bar { stroke: var(--good); } .ring--warn .ring__bar { stroke: var(--warn); } .ring--crit .ring__bar { stroke: var(--crit); } .ring--ai .ring__bar { stroke: var(--ai); }
.ring__label { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; line-height: 1.1; }
.ring__label b { font-family: var(--mono); font-weight: 500; letter-spacing: -0.05em; font-variant-numeric: lining-nums tabular-nums; }
.ring__label span { display: block; font-size: var(--t-xs); color: var(--ink-3); }

.meter { position: relative; height: 6px; border-radius: var(--r-pill); background: var(--canvas-2); overflow: hidden; min-width: 40px; }
.meter > i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--v, 0) * 1%); border-radius: inherit; background: var(--brand-grad); transition: width var(--d4) var(--ease-out); }
.meter--good > i { background: var(--good); } .meter--warn > i { background: var(--warn); } .meter--crit > i { background: var(--crit); } .meter--ai > i { background: var(--ai); } .meter--info > i { background: var(--info); }
.meter > b { position: absolute; top: -3px; bottom: -3px; width: 2px; left: calc(var(--t, 0) * 1%); background: var(--fg); border-radius: 1px; }
.meter--lg { height: 10px; }

.av { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; font-size: calc(14px * var(--fs)); font-weight: 600; letter-spacing: .01em; color: var(--av-fg, var(--ink-2)); background: var(--av-bg, var(--avatar)); box-shadow: inset 0 0 0 1px var(--line); user-select: none; }
.av--xs { width: 26px; height: 26px; font-size: calc(13px * var(--fs)); letter-spacing: -.02em; } .av--sm { width: 30px; height: 30px; font-size: calc(13px * var(--fs)); } .av--lg { width: 48px; height: 48px; font-size: calc(17px * var(--fs)); } .av--xl { width: 72px; height: 72px; font-size: calc(24px * var(--fs)); font-weight: 600; }
.av--ai { background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--ai) 40%, transparent), var(--ai-soft)); color: var(--ai-ink); box-shadow: inset 0 0 0 1px var(--ai-line), 0 0 14px -4px var(--ai-glow); }
.av--human { background: var(--info-soft); color: var(--info); }
.av--brand { background: var(--brand-grad); color: #FFFFFF; }
.person { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.person__txt { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.person__txt b { font-weight: 550; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person__txt span { font-size: var(--t-xs); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ------------------------------------------------------------------ empty, alert, demo note, skeleton */
/* empty and idle states: icon in a soft circle, one sentence, the primary action */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: var(--s8) var(--s5); color: var(--ink-3); }
.empty__ic { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--hue, var(--brand)) 30%, transparent), color-mix(in srgb, var(--hue, var(--brand)) 8%, transparent)); color: var(--hue, var(--brand)); margin-bottom: 8px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--hue, var(--brand)) 35%, transparent), 0 0 0 10px color-mix(in srgb, var(--hue, var(--brand)) 5%, transparent), 0 0 40px -6px color-mix(in srgb, var(--hue, var(--brand)) 50%, transparent); }
.empty__ic .ic { width: 24px; height: 24px; }
.empty__title { font-weight: 600; color: var(--fg); font-size: var(--t-xl); letter-spacing: -0.02em; }
.empty__body { max-width: 44ch; font-size: var(--t-md); }
.empty > .btn { margin-top: 8px; }

/* the one "Show details" disclosure: closed by default, quiet link-coloured summary with a turning chevron */
details.disclosure { border-top: 1px solid var(--line-2); }
details.disclosure.card { border-top: 1px solid var(--line); }
details.disclosure > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 12px var(--pad-card); cursor: pointer; color: var(--brand-ink); font-weight: 600; font-size: var(--t-md); border-radius: inherit; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary::before { content: ''; flex: none; width: 8px; height: 8px; margin: 0 4px 0 2px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform var(--d2) var(--ease); }
details.disclosure[open] > summary::before { transform: rotate(45deg); }
details.disclosure > summary:hover { background: var(--canvas-2); }
details.disclosure > summary .disclosure__hint { color: var(--ink-3); font-weight: 400; font-size: var(--t-sm); }
.disclosure__body { padding: 0 var(--pad-card) var(--pad-card); }

.alert { display: flex; align-items: flex-start; gap: 12px; padding: 14px 18px; border-radius: var(--r); border: 1px solid var(--line); background: var(--glass); -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur); font-size: var(--t-md); color: var(--ink-2); }
.alert > .ic { margin-top: 1px; }
.alert__main { flex: 1; min-width: 0; }
.alert__title { font-weight: 600; color: var(--ink); }
.alert__actions { display: flex; gap: 6px; align-items: center; flex: none; }
.alert--good { background: var(--good-soft); border-color: var(--good-line); } .alert--good > .ic { color: var(--good); }
.alert--warn { background: var(--warn-soft); border-color: var(--warn-line); } .alert--warn > .ic { color: var(--warn); }
.alert--crit { background: var(--crit-soft); border-color: var(--crit-line); } .alert--crit > .ic { color: var(--crit); }
.alert--info { background: var(--info-soft); border-color: var(--info-line); } .alert--info > .ic { color: var(--info); }
.alert--ai { background: var(--ai-soft); border-color: var(--ai-line); } .alert--ai > .ic { color: var(--ai-ink); }
.alert--brand { background: var(--brand-tint); border-color: var(--brand-line); } .alert--brand > .ic { color: var(--brand-ink); }

/* Demo note: speaks to the people watching the demo, never to the patient */
.demo-note {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 16px 12px 14px; border-radius: var(--r);
  background: color-mix(in srgb, var(--ai) 5%, var(--glass));
  border: 1px dashed var(--ai-line); color: var(--ink-2); font-size: var(--t-md); line-height: 1.5;
}
.demo-note > .ic { color: var(--ai-ink); margin-top: 2px; }
.demo-note b:first-child { color: var(--ai-ink); font-weight: 600; margin-right: 4px; }
.demo-note--sm { padding: 10px 14px; font-size: var(--t-sm); }

.skel { position: relative; overflow: hidden; background: var(--canvas-2); border-radius: var(--r-xs); min-height: 12px; }
.skel::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, var(--canvas-2), transparent); animation: m-shimmer 1.4s infinite; }
.skel--line { height: 12px; margin: 6px 0; } .skel--title { height: 22px; width: 40%; } .skel--block { height: 120px; border-radius: var(--r-md); }

.divider { height: 1px; background: var(--line-2); margin: var(--s4) 0; }
.vr { width: 1px; align-self: stretch; background: var(--line); }
.progress-steps { display: flex; gap: 4px; }
.progress-steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.progress-steps i.is-done { background: var(--brand); } .progress-steps i.is-now { background: var(--ai); box-shadow: 0 0 8px var(--ai); }

/* ------------------------------------------------------------------ charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-mount { width: 100%; min-width: 0; }
.chart text { font-family: var(--mono); font-size: calc(13px * var(--fs)); letter-spacing: -0.02em; fill: var(--chart-axis); }
.chart .grid-line { stroke: var(--chart-grid); stroke-width: 1; }
.chart .base-line { stroke: var(--line-strong); stroke-width: 1; }
.chart .target-line { stroke: var(--ink-2); stroke-width: 1.25; stroke-dasharray: 4 4; }
.chart .target-label { fill: var(--ink-2); font-weight: 600; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .xhair { stroke: var(--ink-3); stroke-width: 1; stroke-dasharray: 2 3; opacity: 0; transition: opacity var(--d1); }
.chart .bar { transition: opacity var(--d1); }
.chart:hover .bar { opacity: .55; } .chart .bar:hover, .chart .bar-g:hover .bar { opacity: 1; }
.chart .end-dot { filter: drop-shadow(0 0 6px currentColor); }
.chart .line { filter: drop-shadow(0 0 5px color-mix(in srgb, currentColor 55%, transparent)); }
.chart .end-halo { opacity: .25; animation: m-halo 2.4s var(--ease-out) infinite; transform-box: fill-box; transform-origin: center; }
@keyframes m-halo { 0% { transform: scale(.6); opacity: .5; } 100% { transform: scale(2); opacity: 0; } }
.chart .pt { stroke: var(--bg); stroke-width: 2; opacity: 0; transition: opacity var(--d1); }
.chart .pt.is-on { opacity: 1; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: var(--t-sm); color: var(--ink-2); }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.chart-legend i.ln { height: 2px; border-radius: 1px; width: 14px; }
.chart-legend i.dash { height: 0; border-top: 1.5px dashed var(--ink-2); border-radius: 0; width: 14px; background: none !important; }
.fill-c1 { fill: var(--c1); } .fill-c2 { fill: var(--c2); } .fill-c3 { fill: var(--c3); } .fill-c4 { fill: var(--c4); } .fill-c5 { fill: var(--c5); } .fill-c6 { fill: var(--c6); }
.fill-brand { fill: var(--brand); } .fill-ai { fill: var(--ai); } .fill-good { fill: var(--good); } .fill-warn { fill: var(--warn); } .fill-crit { fill: var(--crit); } .fill-info { fill: var(--info); } .fill-neutral { fill: var(--ink-4); } .fill-soft { fill: var(--line); }
.stroke-c1 { stroke: var(--c1); } .stroke-c2 { stroke: var(--c2); } .stroke-c3 { stroke: var(--c3); } .stroke-c4 { stroke: var(--c4); } .stroke-c5 { stroke: var(--c5); } .stroke-c6 { stroke: var(--c6); }
.stroke-brand { stroke: var(--brand); } .stroke-ai { stroke: var(--ai); } .stroke-good { stroke: var(--good); } .stroke-warn { stroke: var(--warn); } .stroke-crit { stroke: var(--crit); } .stroke-info { stroke: var(--info); } .stroke-neutral { stroke: var(--ink-4); }
.bg-c1 { background: var(--c1); } .bg-c2 { background: var(--c2); } .bg-c3 { background: var(--c3); } .bg-c4 { background: var(--c4); } .bg-c5 { background: var(--c5); } .bg-c6 { background: var(--c6); }
.bg-brand { background: var(--brand); } .bg-ai { background: var(--ai); } .bg-good { background: var(--good); } .bg-warn { background: var(--warn); } .bg-crit { background: var(--crit); } .bg-info { background: var(--info); } .bg-neutral { background: var(--ink-4); }

.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(110px, 38%) minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: var(--t-md); color: inherit; text-decoration: none; padding: 2px 0; border-radius: 6px; }
a.hbar:hover { text-decoration: none; } a.hbar:hover .hbar__label { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.hbar__label { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.hbar__track { display: block; height: 8px; border-radius: 4px; background: var(--canvas-2); overflow: hidden; }
.hbar__fill { display: block; height: 100%; border-radius: 4px; background: var(--brand); box-shadow: 0 0 10px -2px currentColor; transform-origin: left; animation: m-grow var(--d4) var(--ease-out) both; }
.hbar__v { font-weight: 500; color: var(--fg); min-width: 42px; text-align: right; font-family: var(--mono); letter-spacing: -0.02em; }
.hbar__v span { font-weight: 400; color: var(--fg-3); margin-left: 6px; font-size: var(--t-sm); font-family: var(--font); }

.stackbar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; background: transparent; }
.stackbar > i { display: block; height: 100%; min-width: 2px; }
.stackbar > i:first-child { border-radius: 5px 0 0 5px; } .stackbar > i:last-child { border-radius: 0 5px 5px 0; }

/* ------------------------------------------------------------------ motion */
@keyframes m-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes m-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes m-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes m-slide-in { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
@keyframes m-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes m-ping { 0% { box-shadow: 0 0 0 0 var(--ai-glow); } 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes m-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@keyframes m-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
@keyframes m-shimmer { to { transform: translateX(100%); } }
@keyframes m-toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes m-toast-out { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes m-flash { 0% { background: var(--ai-soft); } 100% { background: transparent; } }
@keyframes m-draw { from { stroke-dashoffset: var(--len, 1000); } to { stroke-dashoffset: 0; } }
@keyframes m-spin { to { transform: rotate(360deg); } }
.m-fade { animation: m-fade var(--d3) var(--ease) both; }
.m-rise { animation: m-rise var(--d3) var(--ease-out) both; }
.m-pop { animation: m-pop var(--d2) var(--ease-out) both; }
.m-slide-in { animation: m-slide-in var(--d3) var(--ease-out) both; }
.m-pulse { animation: m-pulse 1.6s ease-in-out infinite; }
.m-flash { animation: m-flash 1.4s var(--ease) both; }
.m-spin { animation: m-spin 1s linear infinite; }
.m-draw { stroke-dasharray: var(--len, 1000); animation: m-draw 1.1s var(--ease-out) both; }
.m-stagger > * { animation: m-rise 520ms var(--ease-out) both; }
.m-stagger > *:nth-child(2) { animation-delay: 60ms; } .m-stagger > *:nth-child(3) { animation-delay: 120ms; } .m-stagger > *:nth-child(4) { animation-delay: 180ms; }
.m-stagger > *:nth-child(5) { animation-delay: 240ms; } .m-stagger > *:nth-child(6) { animation-delay: 300ms; } .m-stagger > *:nth-child(7) { animation-delay: 360ms; } .m-stagger > *:nth-child(n+8) { animation-delay: 400ms; }

.is-static *, .is-static *::before, .is-static *::after { animation: none !important; transition: none !important; }
.is-static body::before { animation: none !important; }

/* cross-page View Transitions: a quick fade of the content; the sidebar and top bar stay put */
@view-transition { navigation: auto; }
::view-transition-group(*) { animation-duration: 150ms; }
::view-transition-old(root) { animation: 120ms var(--ease) both vt-out; }
::view-transition-new(root) { animation: 150ms var(--ease) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; animation-delay: 0ms !important; transition-duration: 1ms !important; scroll-behavior: auto !important; }
  body::before { animation: none !important; }
}

/* ------------------------------------------------------------------ print */
@media print {
  .dock, .sb, .topbar, .toasts, .cmdk, .scrim { display: none !important; }
  .app { display: block; } .main { margin-left: 0; }
  html, body { background: #fff; } body::before, body::after { display: none; }
  .page { padding-top: 0; }
  .card, .kpis { box-shadow: none; break-inside: avoid; }
}

/* ========================================================================== minimal layer
   Restyles every shared component to the Ravera look (both themes). Last in the file so it wins. */
body::before, body::after { display: none !important; }
/* tabular numerals only where numbers line up (Inter's tabular hyphen looks spaced in running text) */
body { letter-spacing: -0.006em; font-feature-settings: 'cv11'; font-variant-numeric: normal; }
.num, .mono, td.r, .dt td.r, .wg__value, .kpi__value, .stat__value, .count, .tab__count, .chip__n, .battery > b, .feed__time, .tl__time, .hbar__v, .delta, .chart text, .tip .tip__v, .ring__label b, .fact > b, .bgroup__count, .tb-btn__badge, time { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: none; }
/* everything visible is Inter with tabular figures (IDs, receipts, phones in <code> too); real code/JSON keeps a monospace */
code, kbd { font-family: var(--font); font-size: .95em; font-variant-numeric: tabular-nums; letter-spacing: 0; }
pre, .payload, details.disclosure pre, details.disclosure code.json, .bub__tool code, code.code { font-family: var(--code); font-size: var(--t-xs); }
kbd { background: var(--surface); border-color: var(--line); border-radius: 5px; }
h1, h2, h3, h4, h5 { font-weight: 600; letter-spacing: -0.015em; }
.grad-text { background: none !important; -webkit-background-clip: initial; background-clip: initial; color: var(--fg); }
.dp { margin: 0; }
.card, .board, .wg, .kpis, .stats, .kpi, .chip, .seg, .tabs--views, .subnav, .ph__kicker, .btn--secondary, .callout, .alert, .glass, .selbar, .tip { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* page head: a 24px title top-left, one grey sentence, actions on the title row */
.ph { align-items: center; padding: 0 0 var(--s6); column-gap: var(--s5); }
.ph__kicker { padding: 0; margin-bottom: 6px; background: none; border: 0; border-radius: 0; color: var(--fg-3); font-size: var(--t-sm); font-weight: 500; }
.ph__kicker .ic { color: var(--fg-3); }
.ph__title { font-size: var(--t-page); font-weight: 600; line-height: 1.25; letter-spacing: -0.02em; }
.ph__sub { margin-top: 4px; font-size: var(--t-md); color: var(--fg-3); }
.ph__actions { gap: var(--s2); align-self: center; }
@media (max-width: 720px) { .ph__actions { margin-top: var(--s4); } }
.section-title h2 { font-size: var(--t-section); font-weight: 600; }

/* surfaces: white, hairline, 12px radius, no shadow */
.card, .board, .kpis, .stats { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: none; }
.card__title, .board__title { font-size: var(--t-lg); font-weight: 600; }
.card__title .ic { color: var(--fg-3); }
.card--hero { border-radius: var(--r-lg); box-shadow: none; }
.card--ai { border-color: var(--ai-line); box-shadow: none; }
.card.is-selected, .card[aria-current], .card[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
a.card:hover, button.card:hover { transform: none; border-color: var(--line-strong); box-shadow: var(--sh-2); }
.card-link { color: var(--brand); }
.tile { width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--hue, var(--brand)) 12%, var(--surface-solid)); color: var(--hue, var(--brand)); box-shadow: none; }
.tile--sm { width: 30px; height: 30px; border-radius: 50%; } .tile--lg { width: 44px; height: 44px; border-radius: 50%; }
.tile--solid { background: var(--hue, var(--brand)); color: var(--on-hue); }
.icon-tile { border-radius: 50%; }

/* KPI cards: icon circle at the left, bold value, SMALL UPPERCASE COLOURED LABEL, a grey note */
.wgs { gap: var(--s4); }
.wg { flex-direction: row; align-items: flex-start; gap: 14px; padding: 18px 18px 16px; background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: none; overflow: visible; }
.wg::before { display: none; }
a.wg:hover { transform: none; border-color: var(--line-strong); box-shadow: var(--sh-2); }
.wg__ic { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--hue, var(--brand)) 12%, var(--surface-solid)); color: var(--hue, var(--brand)); }
.wg__ic .ic { width: 18px; height: 18px; }
.wg__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wg__value { margin: 0; font-family: var(--font); font-size: var(--t-number); font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; color: var(--fg); }
.wg__unit { font-family: var(--font); font-size: var(--t-sm); font-weight: 600; color: var(--fg-3); letter-spacing: 0; }
.wg__label { order: 2; flex: none; font-size: calc(13px * var(--fs)); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--hue, var(--brand)); line-height: 1.4; }
.wg__foot { order: 3; min-height: 0; margin-top: 2px; font-size: var(--t-xs); color: var(--fg-3); }
.wg__go { flex: none; color: var(--ink-4); margin-top: 2px; }
.wg__spark { display: none; }
.wg__top { display: contents; }
/* legacy KPI row and stat tiles, same language */
.kpis > .kpi { background: transparent; }
.kpi { background: var(--surface-solid); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: none; padding: 18px 20px; gap: 4px; }
.kpi__label { font-size: calc(13px * var(--fs)); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--fg-3); }
.kpi__value, .stat__value { font-family: var(--font); font-size: var(--t-number); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.kpi__unit { font-size: var(--t-sm); }
.stat__label { font-size: var(--t-sm); }
.delta { font-family: var(--font); letter-spacing: 0; }

/* boards and groups: hairline groups, a small coloured dot instead of bars and glows */
.board__head { padding: 18px var(--pad-card) 14px; }
.board__body { padding: 0 var(--pad-card) var(--pad-card); gap: var(--s5); }
.bgroup__head { padding: 4px 4px; min-height: 40px; margin-bottom: 4px; }
.bgroup__head:hover { background: transparent; }
.bgroup__head > .ic { color: var(--fg-3); }
.bgroup__title { font-size: var(--t-md); font-weight: 600; color: var(--fg); text-shadow: none; display: inline-flex; align-items: center; gap: 8px; }
.bgroup__title::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--hue); flex: none; }
.bgroup__count { font-family: var(--font); color: var(--fg-3); font-size: var(--t-sm); letter-spacing: 0; }
.bgroup__body { border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-solid); }
.bgroup__body::before { display: none; }

/* tables: small uppercase grey headers, 56px rows, hairlines, no zebra */
.table-wrap {
  background:
    linear-gradient(to right, var(--surface-solid) 30%, transparent) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--surface-solid) 30%, transparent) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(16, 24, 40, .12), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(16, 24, 40, .12), transparent) right center / 12px 100% no-repeat scroll;
}
.dt { font-size: var(--t-md); }
.dt th, .dt--board th { height: 44px; padding: 10px 16px; background: var(--surface-2); color: var(--fg-3); font-size: calc(13px * var(--fs)); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.dt td, .dt--board td { height: 56px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); color: var(--fg-2); }
.dt--board th + th, .dt--board td + td { border-left: 0; }
.dt tbody tr:hover td, .dt--board tbody tr:hover td, .dt--board tbody tr:hover td.cell-status { background: var(--hover); }
.dt tbody tr.is-selected td { background: var(--brand-tint); }
.dt tbody tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--brand); }
.dt td.r, .dt--board td.r { font-family: var(--font); font-weight: 500; letter-spacing: 0; }
.dt a { color: var(--brand); }
.dt--board td.cell-status { width: 170px; min-width: 140px; padding: 6px 16px; }
.dt--board th.cell-status, .dt--board th.c { text-align: left; }
.toolbar { gap: var(--s3); padding: 14px var(--pad-card); border-bottom: 1px solid var(--line); }

/* status: soft dot pill by default ("● Done"): a light tint, coloured text, a dot. No solid blocks */
:root .status, :root[data-theme] .status, :root .status.status--soft, :root[data-theme] .status.status--soft {
  height: 26px; padding: 0 10px 0 8px; gap: 6px; border-radius: var(--r-pill); border: 0; box-shadow: none;
  background: var(--st-b, color-mix(in srgb, var(--st, var(--st-none)) 12%, var(--surface-solid))); color: var(--st, var(--st-none));
  font-size: var(--t-xs); font-weight: 600; letter-spacing: 0;
}
.status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.status > .ic { display: none; }
.status--sm { height: 24px; }
:root .status.status--cell { display: inline-flex; width: auto; height: 26px; border-radius: var(--r-pill); }
.status--none::before, .status--off::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.status.is-flash { animation: m-fade var(--d4) var(--ease); }
.battery__track { height: 6px; background: var(--canvas-2); gap: 1px; }
.battery__track > i { box-shadow: none !important; }
.battery--pct .battery__track > i { box-shadow: none; }
.battery--brand .battery__track > i { background: var(--brand); }
.battery > b { font-family: var(--font); font-weight: 600; letter-spacing: 0; }

/* tabs: segmented with count badges, underline tabs, link rows, segmented controls */
.tabs--views, .seg { display: inline-flex; gap: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-solid); box-shadow: none; overflow: hidden; }
.tabs--views .tab, .seg button { height: 38px; padding: 0 14px; border-radius: 0; color: var(--fg-3); font-size: var(--t-sm); font-weight: 500; box-shadow: none; }
.tabs--views .tab + .tab, .seg button + button { border-left: 1px solid var(--line); }
.tabs--views .tab:hover, .seg button:hover { background: var(--hover); color: var(--fg); }
:root .tabs--views .tab.is-active, :root .seg button.is-active { background: var(--active); color: var(--fg); font-weight: 600; box-shadow: none; }
.tabs--views .tab.is-active .ic { color: var(--fg); }
.tabs--views .tab.is-active .tab__count, .tab.is-active .tab__count { background: var(--surface-solid); color: var(--fg); box-shadow: inset 0 0 0 1px var(--line); }
.tab__count { font-family: var(--font); font-size: calc(13px * var(--fs)); font-weight: 600; padding: 1px 8px; background: var(--canvas-2); color: var(--fg-3); }
.tab::after { height: 2px; border-radius: 0; background: var(--fg); box-shadow: none; }
.tabs--pill .tab.is-active { background: var(--active); box-shadow: none; }
.subnav { display: flex; padding: 0; gap: 4px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.subnav > a, .subnav > button { height: 44px; padding: 0 12px; border-radius: 0; }
.subnav > a:hover, .subnav > button:hover { background: transparent; }
:root .subnav > [aria-current], :root .subnav > .is-active { background: transparent; box-shadow: inset 0 -2px 0 var(--fg); }
.subnav > [aria-current] .ic, .subnav > .is-active .ic { color: var(--fg); }

/* buttons: 40px, 8px radius; one blue primary, outline secondary, quiet ghost */
.btn { --btn-h: 40px; border-radius: var(--r-sm); font-size: var(--t-sm); font-weight: 600; padding: 0 16px; }
.btn:active { transform: none; }
.btn--primary { background: var(--brand); color: #FFFFFF; border-color: var(--brand); box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.btn--primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); filter: none; box-shadow: 0 1px 2px rgba(16, 24, 40, .06); }
.btn--primary:active { background: var(--brand-press); filter: none; }
:root .btn--secondary { background: var(--surface-solid); border-color: var(--line-strong); color: var(--fg-2); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
:root .btn--secondary:hover { background: var(--hover); border-color: var(--line-strong); color: var(--fg); box-shadow: 0 1px 2px rgba(16, 24, 40, .05); }
.btn--ghost { color: var(--fg-3); font-weight: 500; } .btn--ghost:hover { background: var(--hover); color: var(--fg); }
.btn--danger { background: #D92D20; box-shadow: none; } .btn--danger:hover { filter: none; background: #B42318; box-shadow: none; }
.btn--ai { background: var(--ai-soft); color: var(--ai-ink); border-color: var(--ai-line); } .btn--ai:hover { box-shadow: none; }
.btn--sm { --btn-h: 36px; padding: 0 12px; } .btn--lg { --btn-h: 44px; padding: 0 18px; font-size: var(--t-md); } .btn--xl { --btn-h: 52px; padding: 0 24px; font-size: var(--t-lg); }
.btn-group .btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); } .btn-group .btn:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.link-btn { color: var(--brand); }

/* chips, badges, tags, counts */
.chip { height: 36px; padding: 0 12px; border-radius: var(--r-sm); background: var(--surface-solid); border-color: var(--line); color: var(--fg-2); }
.chip:hover { background: var(--hover); border-color: var(--line-strong); }
.chip.is-active { background: var(--active); border-color: var(--line-strong); color: var(--fg); box-shadow: none; }
.chip .chip__n { font-family: var(--font); }
.badge { height: 24px; font-size: var(--t-xs); font-weight: 500; border: 0; }
.badge--outline { box-shadow: inset 0 0 0 1px var(--line-strong); }
.badge--dot::before { box-shadow: none; }
.tag { border: 0; height: 26px; font-size: var(--t-xs); background: color-mix(in srgb, var(--hue, var(--fg-3)) 10%, var(--surface-solid)); }
.lang { font-family: var(--font); background: transparent; }
.dot--ai { box-shadow: none; }
.ptag i { border-radius: 50%; box-shadow: none; }
.count { font-family: var(--font); letter-spacing: 0; color: var(--fg-2); background: var(--canvas-2); height: 24px; }
.sec-head__t { color: var(--fg); font-size: var(--t-lg); font-weight: 600; }
.sec-head__t::before { display: none; }
.panel-head { padding: 16px var(--pad-card); }
.panel-head__ic { border-radius: 50%; background: var(--canvas-2); color: var(--fg-3); }
.panel-head__t b { font-size: var(--t-lg); font-weight: 600; }
.callout { background: var(--surface-solid); border: 1px solid var(--line); box-shadow: inset 3px 0 0 var(--hue, var(--brand)); border-radius: var(--r); }
.alert { border-radius: var(--r); }
.demo-note { background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r); }
.demo-note > .ic, .demo-note b:first-child { color: var(--fg-2); }

/* clinical patterns, minimal (folded from the call page) */
.pth { background: transparent; border: 0; box-shadow: none; padding: 4px 0 20px; border-radius: 0; }
.pth__av .av { width: 56px; height: 56px; font-size: calc(20px * var(--fs)); background: transparent; color: var(--fg-2); box-shadow: inset 0 0 0 1px var(--line); }
.pth__h { color: var(--fg-3); letter-spacing: .02em; text-transform: none; font-weight: 500; font-size: var(--t-sm); }
.pth__name { font-size: var(--t-3xl); font-weight: 600; }
.pth__meta { color: var(--fg-3); }
.facts { border-left: 0; padding: 2px 0 2px 32px; gap: 8px 32px; }
.facts:first-child { padding-left: 0; }
.fact > span { color: var(--ink-4); }
.fact > b { font-weight: 500; }

/* timeline and feed */
.feed::before { background: var(--line); opacity: 1; width: 1px; left: 15.5px; }
.feed__dot { background: var(--surface-solid); box-shadow: inset 0 0 0 1px var(--line); color: var(--st, var(--fg-3)); }
.feed__time { font-family: var(--font); letter-spacing: 0; }
.tl__time { font-family: var(--font); letter-spacing: 0; }
.tl__dot { background: var(--surface-solid); }
.tl__item::before { background: var(--line); }

/* transcript bubbles: plain */
.bub__text { background: var(--canvas-2); border: 0; box-shadow: none; border-radius: 14px; }
.bub--agent .bub__text { background: var(--canvas-2); border: 0; }
.bub--patient .bub__text { background: var(--brand); color: #FFFFFF; box-shadow: none; }
.typing { background: var(--canvas-2); border: 0; }
.typing i { background: var(--ai); box-shadow: none; }
.av--ai { background: var(--ai-soft); box-shadow: none; }
.av { box-shadow: none; background: var(--avatar); }
.av--brand { background: var(--brand); }

/* side panel, modal, menu, palette, toast, tooltip: white, hairline, soft overlay shadow */
.scrim { -webkit-backdrop-filter: none; backdrop-filter: none; }
.drawer { top: 0; right: 0; bottom: 0; width: min(560px, 100vw); border-radius: 0; border: 0; border-left: 1px solid var(--line); background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: var(--sh-3); }
.drawer--wide { width: min(760px, 100vw); }
.drawer__head { background: none; padding: 20px 24px 16px; }
.drawer__title { font-size: var(--t-2xl); font-weight: 600; letter-spacing: -0.015em; }
.drawer__body { padding: 20px 24px; }
.drawer__foot { padding: 14px 24px; }
.modal__panel { background: var(--surface-solid); border-color: var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); -webkit-backdrop-filter: none; backdrop-filter: none; }
.modal__foot { border-radius: 0 0 var(--r-lg) var(--r-lg); background: var(--surface-2); }
.menu { background: var(--surface-solid); border-color: var(--line); border-radius: var(--r); box-shadow: var(--sh-3); -webkit-backdrop-filter: none; backdrop-filter: none; padding: 4px; }
.menu__item { border-radius: 6px; min-height: 40px; font-size: var(--t-sm); }
.menu__item:hover, .menu__item.is-focus, .menu__item:focus-visible { background: var(--hover); }
.menu__label { font-size: calc(13px * var(--fs)); letter-spacing: .05em; text-transform: uppercase; color: var(--ink-4); }
.cmdk__panel { width: min(640px, calc(100vw - 24px)); background: var(--surface-solid); border-color: var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); -webkit-backdrop-filter: none; backdrop-filter: none; }
.cmdk__panel::before { display: none; }
.cmdk__input { padding: 0 var(--s5); }
.cmdk__input .ic { color: var(--fg-3); }
.cmdk__input input { height: 56px; font-size: var(--t-lg); letter-spacing: -0.01em; }
.cmdk__group { font-family: var(--font); font-size: calc(13px * var(--fs)); font-weight: 600; letter-spacing: .05em; color: var(--ink-4); }
.cmdk__item { min-height: 44px; border-radius: var(--r-sm); padding: 8px 12px; }
.cmdk__item > .ic { width: 18px; height: 18px; padding: 0; background: none; color: var(--fg-3); border-radius: 0; }
.cmdk__item.is-focus { background: var(--active); box-shadow: none; color: var(--fg); }
.cmdk__item.is-focus > .ic { background: none; color: var(--fg); }
.cmdk__foot { background: var(--surface-2); }
.toast { border-radius: var(--r); background: var(--surface-solid); border-color: var(--line); box-shadow: var(--sh-3); -webkit-backdrop-filter: none; backdrop-filter: none; padding: 10px 12px; }
.toast__ic, .toast--good .toast__ic, .toast--warn .toast__ic, .toast--crit .toast__ic, .toast--ai .toast__ic, .toast--info .toast__ic { width: 30px; height: 30px; box-shadow: none; background: var(--brand-soft); color: var(--brand); }
.toast--good .toast__ic { background: var(--st-done-bg); color: var(--st-done); } .toast--warn .toast__ic { background: var(--st-working-bg); color: var(--st-working); }
.toast--crit .toast__ic { background: var(--st-stuck-bg); color: var(--st-stuck); } .toast--ai .toast__ic { background: var(--ai-soft); color: var(--ai-ink); } .toast--info .toast__ic { background: var(--st-sched-bg); color: var(--st-sched); }
.toast__act { color: var(--brand); border-radius: var(--r-sm); }
.tip { background: var(--fg); color: var(--fg-inverse); border: 0; }
.selbar { background: var(--fg); color: var(--fg-inverse); border: 0; border-radius: var(--r); }
.selbar .btn--ghost { color: var(--fg-inverse); }

/* forms: white, 40px, 8px radius; blue focus */
.input, .select, .textarea { height: 40px; border-radius: var(--r-sm); background: var(--surface-solid); border-color: var(--line-strong); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); font-size: var(--t-md); }
.textarea { height: auto; }
.input:focus, .select:focus, .textarea:focus { background: var(--surface-solid); border-color: var(--brand); box-shadow: var(--ring); }
.switch input:checked + .switch__track { background: var(--brand); box-shadow: none; }
.radio-card { background: var(--surface-solid); border-radius: var(--r); }
.radio-card.is-active, .radio-card:has(input:checked) { background: var(--brand-tint); }

/* empty, ring, meter, charts */
.empty__ic { width: 52px; height: 52px; background: var(--canvas-2); color: var(--fg-3); box-shadow: none; }
.empty__title { font-size: var(--t-lg); }
.ring__bar { filter: none; }
.ring__label b { font-family: var(--font); letter-spacing: -0.02em; font-weight: 600; }
.meter > i { background: var(--brand); }
.hbar__fill { box-shadow: none; }
.hbar__v { font-family: var(--font); letter-spacing: 0; }
.chart text { font-family: var(--font); letter-spacing: 0; font-size: calc(13px * var(--fs)); }
.chart .line, .chart .end-dot { filter: none; }
.chart .end-halo { display: none; }
.progress-steps i.is-now { box-shadow: none; }

/* motion: 150ms fades only */
.m-stagger > * { animation: m-fade var(--d2) var(--ease) both; animation-delay: 0ms !important; }
@keyframes m-rise { from { opacity: 0; } to { opacity: 1; } }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible, .input-icon:focus-within { outline: none; }
.input-icon > .input { width: 100%; }

/* disclosure: the summary lines up with the content it sits in; inside a card's own edge it keeps the card padding */
details.disclosure > summary { padding: 12px 0; }
.disclosure__body { padding: 0 0 var(--s4); }
.card > details.disclosure > summary, .board > details.disclosure > summary { padding-left: var(--pad-card); padding-right: var(--pad-card); }
.card > details.disclosure > .disclosure__body, .board > details.disclosure > .disclosure__body { padding: 0 var(--pad-card) var(--pad-card); }
details.disclosure > summary:hover { background: transparent; color: var(--brand-hover); }
.num, .link-btn, .dt--stack td[data-label]::before { font-family: var(--font); }

/* ========================================================================== slate sidebar
   A charcoal slate rail beside the white top bar; sidebar-local tokens so nothing else changes. */
.sb {
  --sb-bg: #111827; --sb-surface: #1F2937; --sb-hover: rgba(255, 255, 255, .06); --sb-edge: #1F2937; --sb-divider: #263040;
  --sb-fg: #D1D5DB; --sb-strong: #FFFFFF; --sb-muted: #9CA3AF; --sb-active: rgba(255, 255, 255, .10); --sb-accent: #60A5FA; --sb-focus: #93C5FD;
  background: var(--sb-bg); border-right: 1px solid var(--sb-edge); color: var(--sb-fg); color-scheme: dark;
}
:root[data-theme="dark"] .sb { --sb-bg: #0B0F17; --sb-surface: #171D29; --sb-edge: #1A2130; --sb-divider: #1E2533; }
.sb :focus-visible { outline-color: var(--sb-focus); }
.sb .sb__brand { color: var(--sb-strong); }
.sb .sb__mark { background: #FFFFFF; color: var(--sb-bg); }
.sb .sb__name small { color: var(--sb-muted); }
.sb .sb__ws { background: var(--sb-surface); border-color: transparent; color: var(--sb-strong); }
.sb .sb__ws:hover, .sb .sb__ws[aria-expanded="true"] { background: color-mix(in srgb, var(--sb-surface) 82%, #FFFFFF); }
.sb .sb__ws > .ic, .sb .sb__ws-txt span { color: var(--sb-muted); }
.sb .sb__label { color: var(--sb-muted); }
.sb .nav-item { color: var(--sb-fg); }
.sb .nav-item .ic { color: var(--sb-fg); }
.sb .nav-item:hover { background: var(--sb-hover); color: var(--sb-strong); }
.sb .nav-item:hover .ic { color: var(--sb-strong); }
/* active: a quiet white highlight with a thin blue bar on the left */
.sb .nav-item.is-active { background: var(--sb-active); color: #FFFFFF; font-weight: 600; box-shadow: inset 3px 0 0 var(--sb-accent); }
.sb .nav-item.is-active .ic { color: #FFFFFF; }
.sb .nav-item.is-active:focus-visible { outline-color: #FFFFFF; }
/* the live teal dot keeps a ring so it reads on the slate rail */
.sb .nav-item__live { background: #2ED3B7; box-shadow: 0 0 0 2px color-mix(in srgb, var(--sb-bg) 60%, transparent); }
.sb .nav-item.is-active .nav-item__live { box-shadow: 0 0 0 2px color-mix(in srgb, var(--sb-bg) 60%, transparent); }
.sb .nav-item__count { color: var(--sb-strong); background: var(--sb-surface); }
.sb .sb__foot { border-top-color: var(--sb-divider); }
.sb .sb__collapse { color: var(--sb-fg); }
.sb .sb__collapse:hover { background: var(--sb-hover); color: var(--sb-strong); }
.sb .sb__close { color: var(--sb-fg); } .sb .sb__close:hover { background: var(--sb-hover); color: var(--sb-strong); }
.sb::-webkit-scrollbar-thumb { background: var(--sb-surface); }
@media (min-width: 721px) { .sb-mini .sb .sb__label::after { background: var(--sb-divider); } }
/* tooltips from the rail sit to its right (placed by pyc.js), in white so they read against the slate */
.tip.tip--side { background: var(--surface-solid); color: var(--fg); box-shadow: var(--sh-3); border: 1px solid var(--line); }
