/* =============================================================================
   NotJustAnyMed.Tech Design System
   Shared stylesheet — tokens, documentation chrome, and component styles.

   Built on shadcn/ui conventions. Two token layers, deliberately separate:

     PRODUCT tokens  — shadcn variable names (--background, --primary, --radius…)
                       plus an --alarm-* medical extension. These ship in a SaMD.
     DOC tokens      — --doc-* / --njt-* editorial skin of md.notjustany.tech.
                       These style the documentation and never ship in a product.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   PRIMITIVES — the raw ramps. Never consumed directly by a component.
   -------------------------------------------------------------------------- */
:root {
  /* Teal — the brand spine. 500–900 are the md.notjustany.tech anchors. */
  --njt-teal-50:#F1F6F6;  --njt-teal-100:#DCEDEA; --njt-teal-200:#B7DED8;
  --njt-teal-300:#7FCFC3; --njt-teal-400:#3BC4AF; --njt-teal-500:#2A8B7C;
  --njt-teal-600:#1D6E62; --njt-teal-700:#16504A; --njt-teal-800:#0F3B35;
  --njt-teal-900:#0B2A26;

  /* Coral — brand accent. Documentation only; banned in product UI. */
  --njt-coral-50:#F8F1EF;  --njt-coral-100:#F1DEDA; --njt-coral-200:#EABEB3;
  --njt-coral-300:#E39582; --njt-coral-400:#DF755B; --njt-coral-500:#D8593A;
  --njt-coral-600:#C04426; --njt-coral-700:#A03920; --njt-coral-800:#792D1B;
  --njt-coral-900:#522014;

  /* Warm neutral */
  --njt-warm-50:#F8F9F9;  --njt-warm-100:#EFF0F0; --njt-warm-200:#DDDFDE;
  --njt-warm-300:#C1C3C2; --njt-warm-400:#9CA09F; --njt-warm-500:#797E7C;
  --njt-warm-600:#5E6260; --njt-warm-700:#484C4B; --njt-warm-800:#333635;
  --njt-warm-900:#1F2120;

  /* Paper — the brand's warm surfaces */
  --njt-paper:#FFFDF9; --njt-cream:#F6F1E7; --njt-cream-card:#FBF7EE;
  --njt-ink:#16231F;

  /* NB: there is deliberately no --njt-iec-* primitive. The IEC 60601-1-8
     hues are declared as literals on the governed --alarm-* tokens below, so a
     reviewer reads the mandated value at its single definition point without
     following an indirection. */

  /* Spacing — 4 px base */
  --njt-s-1:4px;  --njt-s-2:8px;  --njt-s-3:12px; --njt-s-4:16px; --njt-s-5:20px;
  --njt-s-6:24px; --njt-s-8:32px; --njt-s-10:40px; --njt-s-12:48px; --njt-s-16:64px;

  /* Type */
  --font-head:"Fraunces",Georgia,"Times New Roman",serif;
  --font-body:"Inter",system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-mono:ui-monospace,"SFMono-Regular","Cascadia Code",Menlo,Consolas,monospace;

  /* Motion */
  --njt-dur-1:80ms; --njt-dur-2:140ms; --njt-dur-3:220ms; --njt-dur-4:320ms;
  --njt-ease-standard:cubic-bezier(.2,0,0,1);
  --njt-ease-enter:cubic-bezier(0,0,0,1);
  --njt-ease-exit:cubic-bezier(.3,0,1,1);
}

/* -----------------------------------------------------------------------------
   PRODUCT TOKENS — shadcn/ui contract. Light.
   -------------------------------------------------------------------------- */
.product, :root {
  /* Open semantics reference a primitive wherever one matches exactly, so the
     primitive → semantic → component chain is real and not just documented. */
  --background:#FDFCF8;                    --foreground:var(--njt-ink);
  --card:#FFFFFF;                          --card-foreground:var(--njt-ink);
  --popover:#FFFFFF;                       --popover-foreground:var(--njt-ink);
  --primary:var(--njt-teal-800);           --primary-foreground:var(--njt-cream);
  --secondary:#EFEDE4;                     --secondary-foreground:var(--njt-teal-700);
  --muted:#EFEDE4;                         --muted-foreground:#54635E;
  --accent:#E4EEE9;                        --accent-foreground:var(--njt-teal-800);
  --destructive:#CE0E2D;                   --destructive-foreground:#FFFFFF;
  --border:#DEE4DF;                        --input:#76827C;
  --ring:var(--njt-teal-500);              --radius:0.625rem;
  /* NB --input is deliberately darker than --border. A divider is decorative;
     a control boundary must reach 3:1 against every surface it can sit on
     (WCAG 2.2 SC 1.4.11) — background, card and muted. Governed token. */

  /* Medical extension — IEC 60601-1-8 priorities. Not re-themable. */
  --alarm-critical:#CE0E2D;  --alarm-critical-foreground:#FFFFFF;
  --alarm-urgent:#F2C200;    --alarm-urgent-foreground:#000000;
  --alarm-advisory:#4FB3D9;  --alarm-advisory-foreground:#000000;
  --alarm-info:#B3BEB9;      --alarm-info-foreground:#000000;
  --alarm-ok:#1D6E62;        --alarm-ok-foreground:#FFFFFF;

  --radius-sm:calc(var(--radius) - 4px);
  --radius-md:calc(var(--radius) - 2px);
  --radius-lg:var(--radius);
}

/* PRODUCT TOKENS — dark. Base is the brand's deepest teal, not a generic black. */
.product.dark, .dark {
  --background:var(--njt-teal-900);        --foreground:var(--njt-cream);
  --card:var(--njt-teal-800);              --card-foreground:var(--njt-cream);
  --popover:var(--njt-teal-800);           --popover-foreground:var(--njt-cream);
  --primary:var(--njt-teal-400);           --primary-foreground:#06201C;
  --secondary:var(--njt-teal-700);         --secondary-foreground:var(--njt-cream);
  --muted:var(--njt-teal-700);             --muted-foreground:#A8BDB6;
  --accent:var(--njt-teal-700);            --accent-foreground:var(--njt-cream);
  --destructive:#D93650;                   --destructive-foreground:#FFFFFF;
  --border:#1E4A43;                        --input:#92ACA4;
  --ring:var(--njt-teal-400);
  /* --alarm-* deliberately unchanged: the standard's hues are absolute. */
}

/* -----------------------------------------------------------------------------
   DOCUMENTATION TOKENS
   -------------------------------------------------------------------------- */
:root {
  --doc-paper:var(--njt-paper); --doc-cream:var(--njt-cream);
  --doc-cream-card:var(--njt-cream-card); --doc-ink:var(--njt-ink);
  --doc-muted:#54635E; --doc-faint:#5F6F69;
  --doc-coral:var(--njt-coral-500);       /* graphics only */
  --doc-coral-text:var(--njt-coral-700);  /* AA for small text */
  --doc-border:rgba(15,59,53,.14); --doc-border-strong:rgba(15,59,53,.28);
  --doc-shadow:0 1px 2px rgba(11,42,38,.05), 0 8px 28px rgba(11,42,38,.06);
  --r-sm:6px; --r-md:10px; --r-lg:16px; --maxw:1400px;
}

/* =============================================================================
   DOC CHROME
   ============================================================================= */
*,*::before,*::after{box-sizing:border-box}
body{margin:0;font-family:var(--font-body);color:var(--doc-ink);
  background:var(--doc-paper);line-height:1.65;-webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility}

.site-header{position:sticky;top:0;z-index:60;background:rgba(255,253,249,.88);
  -webkit-backdrop-filter:saturate(140%) blur(10px);backdrop-filter:saturate(140%) blur(10px);
  border-bottom:1px solid var(--doc-border)}
.site-header .bar{display:flex;align-items:center;gap:1rem;height:62px;
  max-width:var(--maxw);margin:0 auto;padding:0 1.5rem}
.brand{display:flex;align-items:center;gap:10px;font-family:var(--font-head);
  font-size:1.16rem;color:var(--njt-teal-900);font-weight:500;text-decoration:none}
.brand .mark{width:30px;height:30px;border-radius:8px;background:var(--njt-teal-800);
  color:var(--njt-cream);display:grid;place-items:center;font-size:.95rem;
  font-weight:600;font-family:var(--font-mono)}
.brand .mark::after{content:"N"}
.brand .sys{font-family:var(--font-mono);font-size:.66rem;letter-spacing:.14em;
  text-transform:uppercase;color:var(--doc-muted);border-left:1px solid var(--doc-border-strong);
  padding-left:10px}
.site-header .spacer{flex:1}
.navtoggle{display:none;font-family:var(--font-mono);font-size:.68rem;letter-spacing:.1em;
  text-transform:uppercase;background:transparent;border:1px solid var(--doc-border-strong);
  border-radius:var(--r-sm);padding:.35rem .7rem;cursor:pointer;color:var(--njt-teal-800)}

/* three-column shell: sidenav | content | rail */
.layout{display:grid;grid-template-columns:272px minmax(0,1fr) 200px;gap:2.75rem;
  max-width:var(--maxw);margin:0 auto;padding:2.4rem 1.5rem 5rem;align-items:start}
@media (max-width:1279px){.layout{grid-template-columns:256px minmax(0,1fr);gap:2.25rem}
  .rail{display:none}}
@media (max-width:900px){.layout{grid-template-columns:minmax(0,1fr);padding-top:1.6rem}
  .sidenav{display:none}.sidenav.open{display:block}.navtoggle{display:inline-block}}

/* left sidenav */
.sidenav{position:sticky;top:88px;max-height:calc(100vh - 108px);overflow-y:auto;
  font-size:.875rem;padding-right:.5rem;scrollbar-width:thin}

/* Two levels, deliberately different in kind rather than only in size.
   A section name is printed once so sub-labels stay short — repeating
   "Components · " on every label was what made this list unreadable. */
.navsection{margin-bottom:1.9rem}
.navsection + .navsection{padding-top:1.5rem;border-top:1px solid var(--doc-border)}
.navsec{font-family:var(--font-head);font-size:.98rem;font-weight:500;letter-spacing:-.01em;
  color:var(--njt-teal-900);margin:0 0 .55rem}
.navsub{margin-top:1rem}
.navsub:first-of-type{margin-top:.35rem}
.navsublabel{font-family:var(--font-mono);font-size:.62rem;letter-spacing:.13em;
  text-transform:uppercase;color:var(--doc-faint);font-weight:600;margin:0 0 .3rem;
  padding-left:.62rem}
/* the rule binds a set of items to the sub-label above it */
.navsub > .navitems{border-left:1px solid var(--doc-border);padding-left:.15rem;margin-left:.1rem}
.sidenav a{display:block;padding:.3rem .6rem;border-radius:var(--r-sm);
  color:var(--doc-muted);text-decoration:none;line-height:1.35}
.sidenav a:hover{background:var(--doc-cream);color:var(--njt-teal-800)}
.sidenav a.current{background:var(--njt-teal-800);color:var(--njt-cream);font-weight:500}
.navsub > .navitems a.current{box-shadow:-1px 0 0 0 var(--njt-teal-800)}
.sidenav a.soon{color:var(--doc-faint);pointer-events:none}
.sidenav a.soon::after{content:"·";margin-left:.4rem;color:var(--doc-coral)}

/* previous / next, injected above the footer by nav.js */
.pagenav{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin:3rem 0 0;
  padding-top:1.6rem;border-top:1px solid var(--doc-border)}
.pagenav a{display:flex;flex-direction:column;gap:.2rem;text-decoration:none;
  padding:.85rem 1rem;border:1px solid var(--doc-border);border-radius:var(--r-md);
  background:var(--doc-paper);min-width:0}
.pagenav a:hover{border-color:var(--njt-teal-600);background:var(--doc-cream)}
.pagenav a:focus-visible{outline:2px solid var(--njt-teal-600);outline-offset:2px}
.pagenav__dir{font-family:var(--font-mono);font-size:.62rem;letter-spacing:.13em;
  text-transform:uppercase;color:var(--doc-faint);font-weight:600}
.pagenav__t{font-family:var(--font-head);font-size:1rem;font-weight:500;
  color:var(--njt-teal-800);line-height:1.25;letter-spacing:-.01em}
.pagenav__r{text-align:right;align-items:flex-end}
.pagenav__empty{border:0;background:none}
@media (max-width:600px){.pagenav{grid-template-columns:1fr}
  .pagenav__r{text-align:left;align-items:flex-start}
  .pagenav__empty{display:none}}

/* right rail */
.rail{position:sticky;top:88px;font-size:.86rem}
.rail h4{margin:0 0 .7rem;font-family:var(--font-mono);font-size:.64rem;
  letter-spacing:.16em;text-transform:uppercase;color:var(--doc-faint);font-weight:600}
.rail a{display:block;padding:.3rem 0 .3rem .8rem;color:var(--doc-muted);
  text-decoration:none;border-left:2px solid var(--doc-border)}
.rail a:hover{color:var(--njt-teal-700);border-left-color:var(--doc-coral)}

/* typography */
h1,h2,h3,h4{font-family:var(--font-head);font-weight:500;line-height:1.12;
  color:var(--njt-teal-900);margin:0 0 .5em;letter-spacing:-.01em}
h1{font-size:clamp(2rem,4.4vw,2.9rem)}
h2{font-size:clamp(1.5rem,3vw,2rem);margin-top:3rem;scroll-margin-top:90px}
h3{font-size:1.16rem;margin-top:1.9rem;scroll-margin-top:90px}
h4{font-size:.98rem;margin-top:1.3rem}
p{margin:0 0 1rem;max-width:70ch}
ul,ol{margin:0 0 1rem;padding-left:1.35rem;max-width:70ch}
li{margin-bottom:.42rem}
a{color:var(--njt-teal-700)}
.lead{font-size:1.14rem;color:var(--doc-muted);max-width:60ch}
.eyebrow{font-family:var(--font-mono);font-size:.7rem;letter-spacing:.18em;
  text-transform:uppercase;color:var(--doc-coral-text);margin:0 0 .85rem;display:inline-block}
.coral-rule{width:54px;height:3px;background:var(--doc-coral);border:0;
  margin:0 0 1.3rem;border-radius:2px}
code{font-family:var(--font-mono);font-size:.85em;background:var(--doc-cream);
  border:1px solid var(--doc-border);border-radius:var(--r-sm);padding:1px 5px}

.meta-row{display:flex;flex-wrap:wrap;gap:.45rem;margin:1.3rem 0 0}
.pill{font-family:var(--font-mono);font-size:.68rem;letter-spacing:.08em;text-transform:uppercase;
  padding:.26rem .68rem;border-radius:999px;border:1px solid var(--doc-border-strong);
  color:var(--doc-muted);background:var(--doc-cream)}
.pill.ok{border-color:var(--njt-teal-600);color:var(--njt-teal-700)}
.pill.draft{border-color:var(--doc-coral);color:var(--doc-coral-text)}
/* dashed = a framework or vocabulary reference, NOT a conformance claim.
   Solid pills name standards a product can actually be assessed against. */
.pill.frame{border-style:dashed;color:var(--doc-muted);background:transparent}

/* callouts */
.callout{background:var(--doc-cream);border:1px solid var(--doc-border);
  border-left:4px solid var(--doc-coral);border-radius:var(--r-md);
  padding:1.05rem 1.25rem;margin:0 0 1.3rem}
.callout.teal{border-left-color:var(--njt-teal-600)}
.callout.safety{border-left-color:var(--alarm-critical)}
.callout h4{margin-top:0}.callout p:last-child{margin-bottom:0}

/* principle triad */
.principles{display:grid;grid-template-columns:repeat(3,1fr);gap:1rem;margin-bottom:1rem}
@media (max-width:860px){.principles{grid-template-columns:1fr}}
.principle{background:var(--doc-cream-card);border:1px solid var(--doc-border);
  border-radius:var(--r-lg);padding:1.35rem;box-shadow:var(--doc-shadow)}
.principle .accent-bar{height:4px;width:40px;border-radius:2px;background:var(--doc-coral);
  margin-bottom:.9rem}
.principle h3{margin:0 0 .45rem;font-size:1.1rem}
.principle p{margin:0;font-size:.92rem;color:var(--doc-muted)}

/* demo frames — show the PRODUCT canvas, not doc paper */
.demo{border:1px solid var(--doc-border);border-radius:var(--r-lg);overflow:hidden;
  margin-bottom:1.3rem;box-shadow:var(--doc-shadow)}
.demo-head{display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.55rem 1rem;background:var(--doc-cream);border-bottom:1px solid var(--doc-border);
  font-family:var(--font-mono);font-size:.66rem;letter-spacing:.14em;text-transform:uppercase;
  color:var(--doc-muted)}
.themebtn{font-family:var(--font-mono);font-size:.64rem;letter-spacing:.12em;text-transform:uppercase;
  color:var(--njt-teal-800);background:transparent;border:1px solid var(--doc-border-strong);
  border-radius:var(--r-sm);padding:.28rem .58rem;cursor:pointer}
.themebtn:hover{background:var(--doc-paper)}
.themebtn:focus-visible{outline:2px solid var(--njt-teal-600);outline-offset:2px}
.demo-body{padding:1.5rem;background:var(--background);color:var(--foreground);
  transition:background var(--njt-dur-3) var(--njt-ease-standard)}
.stack{display:flex;flex-direction:column;gap:1rem}
.row{display:flex;flex-wrap:wrap;gap:.75rem;align-items:center}

/* tables */
.tbl-wrap{overflow-x:auto;margin-bottom:1.3rem;border:1px solid var(--doc-border);
  border-radius:var(--r-lg);background:var(--doc-cream-card)}
table{width:100%;border-collapse:collapse;font-size:.88rem;min-width:600px}
th,td{text-align:left;padding:.62rem 1rem;border-bottom:1px solid var(--doc-border);
  vertical-align:top}
th{background:var(--doc-cream);font-family:var(--font-mono);font-weight:600;font-size:.66rem;
  letter-spacing:.12em;text-transform:uppercase;color:var(--doc-muted)}
tr:last-child td{border-bottom:none}
td code{white-space:nowrap}
.sw{display:inline-block;width:13px;height:13px;border-radius:3px;
  border:1px solid rgba(0,0,0,.2);vertical-align:-2px;margin-right:6px}
.num{font-family:var(--font-mono);font-variant-numeric:tabular-nums}

/* do / don't */
.dodont{display:grid;grid-template-columns:1fr 1fr;gap:1rem;margin-bottom:1rem}
@media (max-width:860px){.dodont{grid-template-columns:1fr}}
.dd{border:1px solid var(--doc-border);border-radius:var(--r-lg);overflow:hidden;
  background:var(--doc-cream-card)}
.dd-head{padding:.48rem 1rem;font-family:var(--font-mono);font-size:.66rem;font-weight:600;
  letter-spacing:.14em;text-transform:uppercase}
.dd--do .dd-head{background:#E4EEE9;color:var(--njt-teal-700)}
.dd--dont .dd-head{background:#F7E6E2;color:var(--doc-coral-text)}
.dd-body{padding:1rem;background:var(--background);color:var(--foreground)}
.dd-note{font-size:.85rem;color:var(--muted-foreground);margin:.8rem 0 0}

/* code */
pre{background:var(--njt-teal-900);color:#DCE9E4;border-radius:var(--r-lg);
  padding:1.15rem 1.25rem;overflow-x:auto;font-family:var(--font-mono);font-size:.79rem;
  line-height:1.7;margin:0 0 1.3rem}
pre code{background:none;border:none;padding:0;font-size:inherit;color:inherit}
.t-k{color:#E39582}.t-t{color:#7FCFC3}.t-s{color:#D9C48A}
.t-c{color:#6F8A84}.t-p{color:#A8BDB6}

footer{border-top:1px solid var(--doc-border);margin-top:3.6rem;padding-top:1.3rem;
  font-size:.85rem;color:var(--doc-faint)}

/* index cards */
.cardgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:1rem}
.dcard{background:var(--doc-cream-card);border:1px solid var(--doc-border);
  border-radius:var(--r-lg);padding:1.25rem;box-shadow:var(--doc-shadow);
  text-decoration:none;color:inherit;display:flex;flex-direction:column;
  transition:transform .12s ease,box-shadow .15s ease}
a.dcard:hover{transform:translateY(-3px);
  box-shadow:0 6px 14px rgba(11,42,38,.08),0 18px 40px rgba(11,42,38,.10)}
.dcard .tag{font-family:var(--font-mono);font-size:.64rem;letter-spacing:.14em;
  text-transform:uppercase;color:var(--doc-faint);margin-bottom:.55rem}
.dcard h3{margin:0 0 .4rem;font-size:1.05rem}
.dcard p{margin:0;font-size:.87rem;color:var(--doc-muted)}

/* =============================================================================
   COMPONENTS
   ============================================================================= */

/* ---- Alert Banner -------------------------------------------------------- */
.alert{position:relative;display:flex;width:100%;align-items:flex-start;gap:.75rem;
  border-radius:var(--radius-md);border:1px solid transparent;padding:.75rem 1rem;
  font-family:var(--font-body);box-shadow:0 1px 2px rgba(11,42,38,.06)}
.alert__glyph{flex:none;width:1.375rem;height:1.375rem;border-radius:999px;display:grid;
  place-items:center;font-size:.8rem;font-weight:700;margin-top:1px;line-height:1}
.alert__count{flex:none;min-width:1.375rem;height:1.375rem;padding:0 .4rem;border-radius:999px;
  display:grid;place-items:center;font-size:.75rem;font-weight:700;margin-top:1px;
  background:rgba(0,0,0,.22);font-variant-numeric:tabular-nums}
.alert__body{flex:1;min-width:0}
.alert__title{font-weight:600;font-size:.97rem;line-height:1.35;letter-spacing:-.005em}
.alert__desc{font-size:.88rem;line-height:1.45;margin-top:.15rem;opacity:.92}
.alert__prov{font-size:.78rem;line-height:1.4;margin-top:.5rem;opacity:.82;
  font-family:var(--font-mono);font-variant-numeric:tabular-nums;letter-spacing:.01em}
.alert__actions{flex:none;display:flex;align-items:center;gap:.5rem;margin-left:.5rem}

.alert--critical{background:var(--alarm-critical);color:var(--alarm-critical-foreground);
  border-color:rgba(0,0,0,.18)}
.alert--critical .alert__glyph{background:rgba(255,255,255,.24);color:#fff}
.alert--urgent{background:var(--alarm-urgent);color:var(--alarm-urgent-foreground);
  border-color:rgba(0,0,0,.18)}
.alert--urgent .alert__glyph{background:rgba(0,0,0,.16);color:#000}
.alert--advisory{background:var(--alarm-advisory);color:var(--alarm-advisory-foreground);
  border-color:rgba(0,0,0,.18)}
.alert--advisory .alert__glyph{background:rgba(0,0,0,.16);color:#000}
.alert--info{background:var(--alarm-info);color:var(--alarm-info-foreground);
  border-color:rgba(0,0,0,.16)}
.alert--info .alert__glyph{background:rgba(0,0,0,.16);color:#000}
.alert--confirmation{background:var(--alarm-ok);color:var(--alarm-ok-foreground);
  border-color:rgba(0,0,0,.18)}
.alert--confirmation .alert__glyph{background:rgba(255,255,255,.24);color:#fff}

.alert--inline,.alert--acknowledged{background:var(--card);color:var(--card-foreground);
  border-color:var(--border);border-left-width:4px;box-shadow:none}
.alert--inline.alert--critical,.alert--acknowledged.alert--critical{border-left-color:var(--alarm-critical)}
.alert--inline.alert--urgent,.alert--acknowledged.alert--urgent{border-left-color:#8A6D00}
.alert--inline.alert--advisory{border-left-color:#0F6A8C}
.alert--inline.alert--info{border-left-color:var(--muted-foreground)}
.alert--inline.alert--confirmation{border-left-color:var(--alarm-ok)}
.alert--inline .alert__glyph{color:#fff}
.alert--inline.alert--critical .alert__glyph{background:var(--alarm-critical)}
.alert--inline.alert--urgent .alert__glyph{background:var(--alarm-urgent);color:#000}
.alert--inline.alert--advisory .alert__glyph{background:var(--alarm-advisory);color:#000}
.alert--inline.alert--info .alert__glyph{background:var(--alarm-info);color:#000}
.alert--inline.alert--confirmation .alert__glyph{background:var(--alarm-ok)}
.alert--acknowledged .alert__glyph,.alert--acknowledged .alert__count{
  background:var(--muted);color:var(--muted-foreground)}

.alert--compact{align-items:center;gap:.5rem;padding:.4rem .75rem}
.alert--compact .alert__glyph{width:1.125rem;height:1.125rem;font-size:.68rem;margin-top:0}
.alert--compact .alert__title{font-size:.88rem}

/* ---- Button (shadcn Button) ---------------------------------------------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:.4rem;
  white-space:nowrap;border-radius:var(--radius-sm);font-family:var(--font-body);
  font-size:.82rem;font-weight:600;line-height:1;height:2rem;padding:0 .7rem;
  cursor:pointer;border:1px solid currentColor;background:transparent;color:inherit;
  transition:background var(--njt-dur-2) var(--njt-ease-standard),transform var(--njt-dur-1) ease}
.btn:active{transform:scale(.98)}
.btn:hover{background:rgba(255,255,255,.18)}
.alert--urgent .btn:hover,.alert--advisory .btn:hover,.alert--info .btn:hover{background:rgba(0,0,0,.1)}
.btn--solid{background:rgba(255,255,255,.95);color:#111;border-color:transparent}
.btn--solid:hover{background:#fff}
.alert--inline .btn,.alert--acknowledged .btn{border-color:var(--input);color:var(--foreground)}
.alert--inline .btn:hover,.alert--acknowledged .btn:hover{background:var(--muted)}
.alert--inline .btn--solid,.alert--acknowledged .btn--solid{background:var(--primary);
  color:var(--primary-foreground);border-color:transparent}
.btn:focus-visible{outline:2px solid var(--ring);outline-offset:2px}

/* standalone product buttons (outside an alert) */
.btn--primary{background:var(--primary);color:var(--primary-foreground);border-color:transparent}
.btn--primary:hover{background:var(--primary);filter:brightness(1.12)}
.btn--outline{background:transparent;color:var(--foreground);border-color:var(--input)}
.btn--outline:hover{background:var(--muted)}
.btn--ghost{background:transparent;color:var(--foreground);border-color:transparent}
.btn--ghost:hover{background:var(--muted)}
.btn--lg{height:2.75rem;padding:0 1.1rem;font-size:.92rem}

/* ---- anatomy diagram ----------------------------------------------------- */
.anatomy{position:relative;padding:2.6rem 2.4rem 3rem}
.pin{position:absolute;width:1.375rem;height:1.375rem;border-radius:999px;
  background:var(--njt-teal-900);color:var(--njt-cream);display:grid;place-items:center;
  font-family:var(--font-mono);font-size:.7rem;font-weight:600;z-index:2;
  box-shadow:0 0 0 3px var(--background)}
.dark .pin{background:var(--njt-cream);color:var(--njt-teal-900)}
.legend{display:grid;grid-template-columns:repeat(2,1fr);gap:.5rem 2rem;margin-top:1.8rem;
  font-size:.87rem;color:var(--foreground)}
@media (max-width:860px){.legend{grid-template-columns:1fr}}
.legend div{display:flex;gap:.7rem;align-items:baseline}
.legend .k{flex:none;width:1.2rem;height:1.2rem;border-radius:999px;background:var(--njt-teal-900);
  color:var(--njt-cream);display:grid;place-items:center;font-family:var(--font-mono);
  font-size:.62rem;font-weight:600}
.dark .legend .k{background:var(--njt-cream);color:var(--njt-teal-900)}

/* visually hidden but available to assistive technology */
.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}

/* ---- Worklist (clinical pattern) ----------------------------------------- */
.wl{width:100%;border-collapse:collapse;font-family:var(--font-body);font-size:.88rem;
  background:var(--card);color:var(--card-foreground);border-radius:var(--radius-md);
  overflow:hidden;min-width:0}
.wl th{background:var(--muted);color:var(--muted-foreground);text-align:left;
  font-family:var(--font-body);font-size:.78rem;font-weight:600;letter-spacing:.02em;
  text-transform:none;padding:.5rem .7rem;border-bottom:1px solid var(--border);
  white-space:nowrap}
.wl td{padding:.55rem .7rem;border-bottom:1px solid var(--border);vertical-align:middle}
.wl tr:last-child td{border-bottom:none}
.wl .rank{width:4px;padding:0}
.wl .rank i{display:block;width:4px;height:100%;min-height:2.6rem}
.wl tr[data-p="critical"] .rank i{background:var(--alarm-critical)}
.wl tr[data-p="urgent"]   .rank i{background:var(--alarm-urgent)}
.wl tr[data-p="advisory"] .rank i{background:var(--alarm-advisory)}
.wl tr[data-p="info"]     .rank i{background:var(--alarm-info)}
.wl tr[data-ack="yes"]{opacity:.72}
.wl .pt{font-weight:600}
.wl .mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:.82rem}
.wl .sub{color:var(--muted-foreground);font-size:.78rem}
/* ---- Status chip --------------------------------------------------------- */
.schip{display:inline-flex;align-items:center;gap:.3rem;font-family:var(--font-body);
  font-size:.72rem;font-weight:700;letter-spacing:.04em;padding:.15rem .45rem;
  border-radius:var(--radius-sm);text-transform:uppercase;white-space:nowrap;
  border:1px solid transparent}
.schip--critical{background:var(--alarm-critical);color:var(--alarm-critical-foreground)}
.schip--urgent{background:var(--alarm-urgent);color:var(--alarm-urgent-foreground)}
.schip--advisory{background:var(--alarm-advisory);color:var(--alarm-advisory-foreground)}
.schip--info{background:var(--alarm-info);color:var(--alarm-info-foreground)}
.schip--ok{background:var(--alarm-ok);color:var(--alarm-ok-foreground)}
/* neutral = process state with no clinical meaning. Deliberately colourless. */
.schip--neutral{background:var(--muted);color:var(--foreground);border-color:var(--input)}
.schip--quiet{background:transparent;color:var(--muted-foreground);border-color:var(--input)}
.schip--lg{font-size:.78rem;padding:.25rem .6rem}

/* ---- Card ---------------------------------------------------------------- */
.pcard{display:flex;flex-direction:column;background:var(--card);color:var(--card-foreground);
  border:1px solid var(--border);border-radius:var(--radius-lg);overflow:hidden;
  font-family:var(--font-body)}
.pcard__head{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;
  padding:.7rem 1rem;border-bottom:1px solid var(--border);flex-wrap:wrap}
.pcard__title{font-size:.97rem;font-weight:600;line-height:1.3;margin:0}
.pcard__meta{font-family:var(--font-mono);font-size:.74rem;color:var(--muted-foreground);
  font-variant-numeric:tabular-nums}
.pcard__body{padding:1rem;flex:1}
.pcard__body > :last-child{margin-bottom:0}
.pcard__foot{padding:.6rem 1rem;border-top:1px solid var(--border);
  background:var(--secondary);color:var(--secondary-foreground);font-size:.82rem}
.pcard--interactive{cursor:pointer;text-decoration:none;
  transition:border-color var(--njt-dur-2) var(--njt-ease-standard)}
.pcard--interactive:hover{border-color:var(--input)}
.pcard--interactive:focus-visible{outline:2px solid var(--ring);outline-offset:2px}
.pcard--flush .pcard__body{padding:0}
.cardrow{display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:.75rem}
.wl-wrap{overflow-x:auto;border:1px solid var(--border);border-radius:var(--radius-md)}
.wl-wrap .wl{min-width:660px}

/* ---- Patient header (clinical pattern) ----------------------------------- */
.ph{display:flex;align-items:stretch;gap:0;background:var(--card);color:var(--card-foreground);
  border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden;
  font-family:var(--font-body)}
.ph__id{flex:none;padding:.7rem 1rem;border-right:1px solid var(--border);min-width:0}
.ph__name{font-size:1.05rem;font-weight:700;letter-spacing:-.01em;line-height:1.25;
  white-space:nowrap}
.ph__mrn{font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:.8rem;
  color:var(--muted-foreground);margin-top:.1rem;white-space:nowrap}
.ph__fields{flex:1;display:flex;flex-wrap:wrap;gap:0;min-width:0}
.ph__f{padding:.7rem 1rem;border-right:1px solid var(--border);min-width:0}
.ph__f:last-child{border-right:none}
.ph__k{font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted-foreground);line-height:1.2}
.ph__v{font-size:.92rem;font-weight:600;line-height:1.3;margin-top:.1rem;white-space:nowrap}
.ph__v.mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums}
.ph__flags{flex:none;display:flex;align-items:center;gap:.35rem;padding:.7rem 1rem;
  border-left:1px solid var(--border)}
.ph--compact .ph__id,.ph--compact .ph__f,.ph--compact .ph__flags{padding:.4rem .8rem}
.ph--compact .ph__name{font-size:.92rem}
.ph-flag{display:inline-flex;align-items:center;gap:.25rem;font-size:.7rem;font-weight:700;
  letter-spacing:.04em;text-transform:uppercase;padding:.2rem .45rem;
  border-radius:var(--radius-sm);white-space:nowrap}
.ph-flag--alert{background:var(--alarm-critical);color:var(--alarm-critical-foreground)}
.ph-flag--care{background:var(--alarm-urgent);color:var(--alarm-urgent-foreground)}
.ph-flag--note{background:var(--muted);color:var(--foreground);
  border:1px solid var(--input)}

/* ---- ECG review (clinical pattern) --------------------------------------- */
.ecg{position:relative;background:var(--card);border:1px solid var(--border);
  border-radius:var(--radius-md);overflow:hidden}
.ecg__paper{background-image:
  repeating-linear-gradient(to right,color-mix(in srgb,var(--alarm-critical) 16%,transparent) 0 1px,transparent 1px 12px),
  repeating-linear-gradient(to bottom,color-mix(in srgb,var(--alarm-critical) 16%,transparent) 0 1px,transparent 1px 12px)}
.ecg__svg{display:block;width:100%;height:auto}
.ecg__trace{fill:none;stroke:var(--foreground);stroke-width:1.4;
  stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}
.ecg__lead{position:absolute;top:.35rem;left:.5rem;font-family:var(--font-mono);
  font-size:.72rem;font-weight:600;color:var(--foreground);
  background:color-mix(in srgb,var(--card) 82%,transparent);padding:.05rem .3rem;
  border-radius:var(--radius-sm)}
.ecg__cal{position:absolute;bottom:.35rem;right:.5rem;font-family:var(--font-mono);
  font-size:.66rem;color:var(--muted-foreground)}
.ecg-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:.5rem}
@media (max-width:760px){.ecg-grid{grid-template-columns:repeat(2,1fr)}}
.ecg--flag{outline:2px solid var(--alarm-critical);outline-offset:-2px}
.ecg__mark{fill:none;stroke:var(--alarm-critical);stroke-width:2;stroke-dasharray:4 3;
  vector-effect:non-scaling-stroke}

/* ---- Data grid ----------------------------------------------------------- */
.dg-wrap{overflow:auto;border:1px solid var(--border);border-radius:var(--radius-md);
  background:var(--card)}
.dg{width:100%;border-collapse:separate;border-spacing:0;font-family:var(--font-body);
  font-size:.88rem;color:var(--card-foreground);min-width:640px}
.dg thead th{position:sticky;top:0;z-index:1;background:var(--muted);
  color:var(--muted-foreground);text-align:left;font-size:.78rem;font-weight:600;
  letter-spacing:.01em;text-transform:none;padding:0;
  border-bottom:1px solid var(--border);white-space:nowrap}
.dg thead th .dg__sort{display:flex;align-items:center;gap:.3rem;width:100%;
  padding:.5rem .7rem;background:none;border:0;font:inherit;color:inherit;
  cursor:pointer;text-align:left}
.dg thead th .dg__sort:hover{background:color-mix(in srgb,var(--foreground) 6%,transparent)}
.dg thead th .dg__sort:focus-visible{outline:2px solid var(--ring);outline-offset:-2px}
.dg thead th .dg__static{display:block;padding:.5rem .7rem}
.dg__dir{font-size:.7rem;opacity:.8}
.dg td{padding:.5rem .7rem;border-bottom:1px solid var(--border);vertical-align:middle}
.dg tbody tr:last-child td{border-bottom:none}
.dg tbody tr:hover td{background:color-mix(in srgb,var(--foreground) 4%,transparent)}
.dg tbody tr[aria-selected="true"] td{background:var(--accent);color:var(--accent-foreground)}
.dg tbody tr[data-new="yes"] td{box-shadow:inset 3px 0 0 var(--alarm-advisory)}
.dg--compact td,.dg--compact .dg__sort,.dg--compact .dg__static{padding:.28rem .7rem}
.dg--comfortable td{padding:.75rem .7rem}
.dg .rail4{width:4px;padding:0}
.dg .rail4 i{display:block;width:4px;height:100%;min-height:2.2rem}
.dg tr[data-p="critical"] .rail4 i{background:var(--alarm-critical)}
.dg tr[data-p="urgent"]   .rail4 i{background:var(--alarm-urgent)}
.dg tr[data-p="advisory"] .rail4 i{background:var(--alarm-advisory)}
.dg .mono{font-family:var(--font-mono);font-variant-numeric:tabular-nums;font-size:.82rem}
.dg .sub{color:var(--muted-foreground);font-size:.78rem}
.dg__bar{display:flex;align-items:center;justify-content:space-between;gap:.75rem;
  flex-wrap:wrap;padding:.5rem .7rem;background:var(--card);
  border-bottom:1px solid var(--border);font-size:.84rem;color:var(--muted-foreground)}

/* ---- Toast --------------------------------------------------------------- */
.toaststack{display:flex;flex-direction:column;gap:.5rem;align-items:flex-end}
.toast{display:flex;align-items:flex-start;gap:.6rem;max-width:22rem;width:100%;
  background:var(--popover);color:var(--popover-foreground);
  border:1px solid var(--border);border-left:4px solid var(--muted-foreground);
  border-radius:var(--radius-md);padding:.6rem .75rem;
  box-shadow:0 6px 18px rgba(11,42,38,.16);font-family:var(--font-body)}
.toast--ok{border-left-color:var(--alarm-ok)}
.toast--info{border-left-color:var(--muted-foreground)}
.toast__body{flex:1;min-width:0}
.toast__title{font-size:.9rem;font-weight:600;line-height:1.35}
.toast__meta{font-family:var(--font-mono);font-size:.72rem;color:var(--muted-foreground);
  margin-top:.15rem;font-variant-numeric:tabular-nums}
.toast__x{flex:none;background:none;border:0;color:var(--muted-foreground);cursor:pointer;
  font-size:.9rem;line-height:1;padding:.15rem .25rem;border-radius:var(--radius-sm)}
.toast__x:hover{background:var(--muted);color:var(--foreground)}

/* ---- Calendar (date picker) ---------------------------------------------- */
.cal{background:var(--popover);color:var(--popover-foreground);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:.6rem;width:max-content;
  box-shadow:0 6px 18px rgba(11,42,38,.16)}
.cal__head{display:flex;align-items:center;justify-content:space-between;gap:.5rem;
  padding:.1rem .2rem .5rem;font-size:.9rem;font-weight:600}
.cal__grid{display:grid;grid-template-columns:repeat(7,2rem);gap:2px}
.cal__dow{font-family:var(--font-mono);font-size:.62rem;text-transform:uppercase;
  color:var(--muted-foreground);text-align:center;padding:.2rem 0}
.cal__d{height:2rem;display:grid;place-items:center;font-size:.82rem;
  font-variant-numeric:tabular-nums;border-radius:var(--radius-sm);cursor:pointer;
  border:1px solid transparent}
.cal__d:hover{background:var(--muted)}
.cal__d[aria-selected="true"]{background:var(--primary);color:var(--primary-foreground);
  font-weight:700}
.cal__d[data-today="true"]{border-color:var(--input);font-weight:600}
.cal__d[aria-disabled="true"]{color:var(--muted-foreground);opacity:.45;cursor:not-allowed}
.cal__d.out{color:var(--muted-foreground);opacity:.5}
.cal__foot{margin-top:.5rem;padding-top:.5rem;border-top:1px solid var(--border);
  font-family:var(--font-mono);font-size:.72rem;color:var(--muted-foreground)}

/* ---- Device identification / regulatory label ----------------------------
   The electronic label. MDR Annex VI Part C 6.5.4 requires the UDI to be shown
   on an easily accessible screen, so this is a UI object with a legal content
   list, not a marketing "about" box.

   Note what is deliberately absent: any drawn regulatory symbol. ISO 15223-1
   symbols and the CE mark have prescribed forms; a design system that redraws
   them approximately is a design system that ships a non-conforming label. The
   slots below are placeholders that a manufacturer fills from the standard. */
.dlabel{background:var(--card);color:var(--card-foreground);border:1px solid var(--border);
  border-radius:var(--radius-md);overflow:hidden;font-family:var(--font-body)}
.dlabel__hd{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;
  flex-wrap:wrap;padding:.7rem .85rem;border-bottom:1px solid var(--border)}
.dlabel__name{font-size:1rem;font-weight:600;line-height:1.3}
.dlabel__b{padding:.85rem}
.dlabel__grid{display:grid;grid-template-columns:minmax(9rem,auto) 1fr;gap:.4rem .9rem;
  align-items:baseline;margin:0}
.dlabel__k{font-size:.8rem;color:var(--muted-foreground);line-height:1.35}
/* Identifiers are read aloud down a phone and typed into a vigilance report:
   monospace, selectable, and never truncated or wrapped mid-token. */
.dlabel__v{font-family:var(--font-mono);font-size:.82rem;color:var(--foreground);
  font-variant-numeric:tabular-nums;line-height:1.35;overflow-wrap:anywhere;
  user-select:all;margin:0}
.dlabel__v--text{font-family:var(--font-body);font-size:.85rem;user-select:auto;
  overflow-wrap:normal}
.dlabel__sec{margin-top:.9rem;padding-top:.8rem;border-top:1px solid var(--border)}
.dlabel__sect{font-family:var(--font-mono);font-size:.62rem;letter-spacing:.13em;
  text-transform:uppercase;color:var(--muted-foreground);font-weight:600;margin:0 0 .5rem}
.dlabel__syms{display:flex;flex-wrap:wrap;gap:.6rem;align-items:stretch}

/* A slot the manufacturer fills from ISO 15223-1. Dashed so it can never be
   mistaken for a rendered symbol in a screenshot. */
.symslot{display:flex;flex-direction:column;gap:.15rem;min-width:5.5rem;
  border:1px dashed var(--input);border-radius:var(--radius-sm);padding:.4rem .5rem;
  background:var(--background)}
.symslot__box{font-family:var(--font-mono);font-size:.58rem;letter-spacing:.08em;
  text-transform:uppercase;color:var(--muted-foreground)}
.symslot__v{font-family:var(--font-mono);font-size:.78rem;color:var(--foreground);
  font-variant-numeric:tabular-nums;user-select:all}
.symslot__ref{font-family:var(--font-mono);font-size:.58rem;color:var(--muted-foreground)}

/* ---- Regulatory symbols --------------------------------------------------
   These do not theme, and that is the whole rule. ISO 15223-1 symbols are used
   black on a light background; a symbol recoloured for a dark UI is a
   non-conforming symbol. So each renders on its own white plate in both themes
   — the same reasoning that keeps --alarm-* identical across themes. Black and
   white are literals here on purpose: they are not design decisions and must
   not be re-themable. */
.sym{display:inline-grid;place-items:center;flex:none;width:2.75rem;height:2.75rem;
  background:#FFFFFF;color:#000000;border:1px solid rgba(0,0,0,.30);border-radius:2px}
.sym svg{display:block;width:88%;height:88%}
.sym--lg{width:3.6rem;height:3.6rem}
.sym--sm{width:2rem;height:2rem}
/* An empty slot the manufacturer fills from the standard. Dashed so an unfilled
   one is obvious in review rather than plausible in a screenshot. It carries no
   text of its own — a caption crammed inside a 44px box overflows it, and the
   explanation belongs in the card beside it. */
.sym--slot{border-style:dashed;border-color:rgba(0,0,0,.45);background:#FFFFFF;
  color:rgba(0,0,0,.55);overflow:hidden}
.sym--slot::before{content:"";display:block;width:45%;height:2px;background:currentColor}


.symgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(13.5rem,1fr));
  gap:.6rem}
.symcard{display:flex;align-items:center;gap:.6rem;padding:.5rem .6rem;
  border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--card);
  color:var(--card-foreground);min-width:0}
.symcard__b{min-width:0}
.symcard__t{font-family:var(--font-body);font-size:.82rem;font-weight:600;line-height:1.25}
.symcard__ref{font-family:var(--font-mono);font-size:.62rem;color:var(--muted-foreground);
  line-height:1.3}

/* ---- Charts (Data visualisation foundation) ------------------------------
   Deliberately built from existing semantic tokens only. There is no chart
   colour palette: series are distinguished by direct labelling and line style,
   never by hue, so a chart survives greyscale printing and colour-vision
   deficiency without a second encoding having to be remembered. Adding a
   --chart-series-* ramp would also mean adding governed tokens for something
   that does not need them. */
.chart{background:var(--card);color:var(--card-foreground);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:.85rem .9rem;font-family:var(--font-body)}
.chart__head{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;
  flex-wrap:wrap;margin-bottom:.5rem}
.chart__title{font-size:.92rem;font-weight:600;line-height:1.3}
.chart__meta{font-family:var(--font-mono);font-size:.72rem;color:var(--muted-foreground);
  font-variant-numeric:tabular-nums}
.chart svg{display:block;width:100%;height:auto;overflow:visible}
.chart__band{fill:var(--accent)}
.chart__grid{stroke:var(--border);stroke-width:1}
.chart__ax{stroke:var(--input);stroke-width:1}
.chart__line{fill:none;stroke:var(--foreground);stroke-width:2;
  stroke-linejoin:round;stroke-linecap:round}
/* A projection is not a measurement. Dashed and lighter, never solid. */
.chart__line--proj{stroke-dasharray:5 4;opacity:.55}
/* A break in the line is a gap in the data. Never interpolated across. */
.chart__line--break{stroke-dasharray:2 4;opacity:.35;stroke-width:1.5}
.chart__pt{fill:var(--card);stroke:var(--foreground);stroke-width:2}
.chart__pt--proj{fill:var(--muted);stroke:var(--muted-foreground);stroke-dasharray:2 2}
.chart__tick{font-family:var(--font-mono);font-size:9px;fill:var(--muted-foreground)}
.chart__dlbl{font-family:var(--font-body);font-size:10px;font-weight:600;fill:var(--foreground)}
.chart__bandlbl{font-family:var(--font-mono);font-size:9px;fill:var(--accent-foreground)}
.chart__foot{margin-top:.5rem;font-size:.78rem;color:var(--muted-foreground);line-height:1.45}
.chart__gapmark{font-family:var(--font-mono);font-size:9px;fill:var(--muted-foreground)}

/* Sparkline — trend at a glance, never the sole carrier of a value. */
.spark{display:inline-flex;align-items:center;gap:.45rem;font-family:var(--font-mono);
  font-size:.8rem;font-variant-numeric:tabular-nums;color:var(--foreground)}
.spark svg{display:block;width:64px;height:18px}
.spark__line{fill:none;stroke:var(--foreground);stroke-width:1.5;stroke-linejoin:round}

/* ---- List & tree --------------------------------------------------------- */
.lst{background:var(--card);color:var(--card-foreground);border:1px solid var(--border);
  border-radius:var(--radius-md);overflow:hidden;font-family:var(--font-body)}
.lst__item{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;
  padding:.55rem .7rem;border-bottom:1px solid var(--border)}
.lst__item:last-child{border-bottom:none}
.lst__item[aria-current="true"]{background:var(--accent);color:var(--accent-foreground);
  box-shadow:inset 3px 0 0 var(--primary)}
.lst__main{min-width:0}
.lst__t{font-size:.92rem;font-weight:600;line-height:1.35}
.lst__s{font-size:.8rem;color:var(--muted-foreground)}
.lst__meta{font-family:var(--font-mono);font-size:.75rem;color:var(--muted-foreground);
  font-variant-numeric:tabular-nums;white-space:nowrap}
.tree{font-family:var(--font-body);font-size:.9rem}
.tree ul{list-style:none;margin:0;padding-left:1.1rem;
  border-left:1px solid var(--border)}
.tree li{padding:.15rem 0}
.tree .node{display:inline-flex;align-items:center;gap:.35rem;padding:.15rem .4rem;
  border-radius:var(--radius-sm)}
.tree .node:hover{background:var(--muted)}
.tree .node[aria-current="true"]{background:var(--accent);color:var(--accent-foreground);
  font-weight:600}
.tree .tw{font-size:.65rem;color:var(--muted-foreground);width:.7rem;display:inline-block}

/* ---- Badge --------------------------------------------------------------- */
.badge{display:inline-grid;place-items:center;min-width:1.3rem;height:1.3rem;padding:0 .35rem;
  border-radius:999px;font-family:var(--font-mono);font-size:.72rem;font-weight:700;
  font-variant-numeric:tabular-nums;background:var(--secondary);color:var(--secondary-foreground)}
/* Docs-only. Exists solely to render the "don't" examples on Badge & pagination
   and Accordion. There is deliberately no alarm-coloured badge variant in the
   product: quantity and priority are separate facts with separate components. */
.badge--dont{background:var(--alarm-critical);color:var(--alarm-critical-foreground)}
.badge--dot{min-width:.55rem;width:.55rem;height:.55rem;padding:0}

/* ---- Pagination ---------------------------------------------------------- */
.pgn{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;font-family:var(--font-body);
  font-size:.86rem}
.pgn__btn{font:inherit;font-size:.86rem;min-width:2.25rem;height:2.25rem;padding:0 .5rem;
  border:1px solid var(--input);background:var(--background);color:var(--foreground);
  border-radius:var(--radius-sm);cursor:pointer;font-variant-numeric:tabular-nums}
.pgn__btn[aria-current="page"]{background:var(--primary);color:var(--primary-foreground);
  border-color:var(--primary);font-weight:700}
.pgn__btn:disabled{opacity:.45;cursor:not-allowed}
.pgn__info{color:var(--muted-foreground);font-family:var(--font-mono);font-size:.78rem;
  font-variant-numeric:tabular-nums}

/* ---- Accordion & layout panel -------------------------------------------- */
.acc{border:1px solid var(--border);border-radius:var(--radius-md);overflow:hidden;
  background:var(--card);color:var(--card-foreground)}
.acc__h{display:flex;align-items:center;justify-content:space-between;gap:.75rem;width:100%;
  font:inherit;font-size:.94rem;font-weight:600;text-align:left;padding:.65rem .8rem;
  background:none;border:0;border-bottom:1px solid var(--border);cursor:pointer;
  color:inherit}
.acc__h:hover{background:var(--muted)}
.acc__h:focus-visible{outline:2px solid var(--ring);outline-offset:-2px}
.acc__h .tw{font-size:.7rem;color:var(--muted-foreground)}
.acc__p{padding:.8rem;border-bottom:1px solid var(--border);font-size:.9rem}
.acc > :last-child{border-bottom:0}
.lpanel{background:var(--card);color:var(--card-foreground);border:1px solid var(--border);
  border-radius:var(--radius-md);overflow:hidden}
.lpanel__h{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;
  padding:.6rem .8rem;border-bottom:1px solid var(--border);font-size:.94rem;font-weight:600}
.lpanel__b{padding:.8rem}

/* ---- Filter -------------------------------------------------------------- */
.ftags{display:flex;align-items:center;gap:.4rem;flex-wrap:wrap}
.ftag{display:inline-flex;align-items:center;gap:.35rem;font-family:var(--font-body);
  font-size:.8rem;padding:.2rem .3rem .2rem .55rem;border-radius:999px;
  background:var(--accent);color:var(--accent-foreground);border:1px solid var(--input)}
.ftag button{font:inherit;background:none;border:0;cursor:pointer;color:inherit;
  line-height:1;padding:.1rem .25rem;border-radius:999px;font-size:.8rem}
.ftag button:hover{background:rgba(0,0,0,.12)}

/* ---- Menu & popover ------------------------------------------------------ */
.menu{background:var(--popover);color:var(--popover-foreground);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:.25rem;min-width:13rem;width:max-content;
  box-shadow:0 6px 18px rgba(11,42,38,.16);font-family:var(--font-body)}
.menu__item{display:flex;align-items:center;justify-content:space-between;gap:1rem;
  padding:.45rem .55rem;border-radius:var(--radius-sm);font-size:.92rem;cursor:pointer}
.menu__item:hover{background:var(--muted)}
.menu__item[aria-disabled="true"]{color:var(--muted-foreground);cursor:not-allowed}
.menu__item[aria-disabled="true"]:hover{background:none}
.menu__item .k{font-family:var(--font-mono);font-size:.72rem;color:var(--muted-foreground)}
.menu__item--danger{color:var(--destructive);font-weight:600}
.menu__sep{height:1px;background:var(--border);margin:.25rem 0}
.menu__label{font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted-foreground);padding:.4rem .55rem .2rem}
.pop{background:var(--popover);color:var(--popover-foreground);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:.85rem;max-width:20rem;
  box-shadow:0 6px 18px rgba(11,42,38,.16)}

/* ---- Toolbar & button group ---------------------------------------------- */
.tbar{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.5rem .6rem;
  background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md)}
.tbar__sep{width:1px;align-self:stretch;background:var(--border);margin:0 .15rem}
.tbar__spacer{flex:1}
.bgrp{display:inline-flex;border:1px solid var(--input);border-radius:var(--radius-sm);
  overflow:hidden}
.bgrp button{font:inherit;font-size:.85rem;font-weight:600;padding:.45rem .75rem;
  background:var(--background);color:var(--foreground);border:0;
  border-right:1px solid var(--input);cursor:pointer;white-space:nowrap}
.bgrp button:last-child{border-right:0}
/* Three signals, not one: fill, weight, and an inset rule that survives greyscale
   and colour-vision deficiency. aria-pressed carries the fourth, non-visual one. */
.bgrp button[aria-pressed="true"]{background:var(--accent);color:var(--accent-foreground);
  font-weight:700;box-shadow:inset 0 -3px 0 var(--primary)}
.bgrp button:focus-visible{outline:2px solid var(--ring);outline-offset:-2px}

/* ---- Navigation ---------------------------------------------------------- */
.mast{display:flex;align-items:center;gap:.75rem;padding:.5rem .8rem;
  background:var(--primary);color:var(--primary-foreground);border-radius:var(--radius-md);
  font-family:var(--font-body);flex-wrap:wrap}
.mast__name{font-weight:700;font-size:.95rem}
.mast__spacer{flex:1}
.mast__meta{font-family:var(--font-mono);font-size:.74rem;opacity:.85}
.snav{background:var(--card);border:1px solid var(--border);border-radius:var(--radius-md);
  padding:.35rem;min-width:12rem;font-family:var(--font-body)}
.snav a{display:flex;align-items:center;justify-content:space-between;gap:.5rem;
  padding:.45rem .55rem;border-radius:var(--radius-sm);font-size:.9rem;
  color:var(--foreground);text-decoration:none}
.snav a:hover{background:var(--muted)}
.snav a[aria-current="page"]{background:var(--accent);color:var(--accent-foreground);
  font-weight:600;box-shadow:inset 3px 0 0 var(--primary)}
.crumb{display:flex;align-items:center;gap:.35rem;flex-wrap:wrap;font-size:.85rem;
  font-family:var(--font-body)}
.crumb a{color:var(--muted-foreground);text-decoration:none}
.crumb a:hover{text-decoration:underline}
.crumb .sep{color:var(--muted-foreground)}
.crumb [aria-current="page"]{color:var(--foreground);font-weight:600}

/* ---- Selection controls -------------------------------------------------- */
.chk{display:flex;gap:.65rem;align-items:flex-start;font-family:var(--font-body);
  padding:.35rem 0;cursor:pointer}
.chk__box{flex:none;width:1.25rem;height:1.25rem;margin-top:.05rem;
  border:1px solid var(--input);border-radius:3px;background:var(--background);
  display:grid;place-items:center;font-size:.75rem;color:transparent;line-height:1}
.chk__box--radio{border-radius:999px}
.chk[data-checked="true"] .chk__box{background:var(--primary);border-color:var(--primary);
  color:var(--primary-foreground)}
.chk[data-checked="mixed"] .chk__box{background:var(--primary);border-color:var(--primary);
  color:var(--primary-foreground)}
.chk[data-disabled="true"]{opacity:.5;cursor:not-allowed}
.chk__label{font-size:.95rem;line-height:1.35}
.chk__hint{display:block;font-size:.8rem;color:var(--muted-foreground);margin-top:.1rem}

.swtch{display:flex;align-items:center;gap:.65rem;font-family:var(--font-body);
  padding:.35rem 0;cursor:pointer}
.swtch__track{flex:none;width:2.75rem;height:1.5rem;border-radius:999px;
  background:var(--muted);border:1px solid var(--input);position:relative;
  transition:background var(--njt-dur-2) var(--njt-ease-standard)}
.swtch__knob{position:absolute;top:1px;left:1px;width:1.25rem;height:1.25rem;
  border-radius:999px;background:var(--background);border:1px solid var(--input);
  transition:transform var(--njt-dur-2) var(--njt-ease-standard)}
.swtch[data-on="true"] .swtch__track{background:var(--primary);border-color:var(--primary)}
.swtch[data-on="true"] .swtch__knob{transform:translateX(1.25rem)}

/* ---- Numeric input ------------------------------------------------------- */
.spin{display:inline-flex;align-items:stretch;border:1px solid var(--input);
  border-radius:var(--radius-sm);overflow:hidden;background:var(--background);height:2.75rem}
.spin__val{border:0;background:none;font:inherit;font-family:var(--font-mono);
  font-variant-numeric:tabular-nums;font-size:1rem;color:var(--foreground);
  width:6rem;text-align:right;padding:0 .5rem}
.spin__val:focus-visible{outline:2px solid var(--ring);outline-offset:-2px}
/* An empty numeric field must read as empty rather than as a value, so the
   placeholder is a dash at full text contrast — not a greyed-out number. */
.spin__val::placeholder{color:var(--muted-foreground);opacity:1}
.spin__unit{display:grid;place-items:center;padding:0 .5rem;font-size:.85rem;
  color:var(--muted-foreground);border-right:1px solid var(--border)}
.spin__btn{width:2.5rem;background:var(--muted);border:0;border-left:1px solid var(--border);
  color:var(--foreground);font-size:1rem;cursor:pointer}
.spin__btn:hover{background:var(--accent)}
.spin__btn:focus-visible{outline:2px solid var(--ring);outline-offset:-2px}

.sldr{max-width:22rem}
.sldr__track{height:6px;border-radius:999px;background:var(--muted);position:relative}
.sldr__fill{position:absolute;inset:0 auto 0 0;background:var(--primary);border-radius:999px}
.sldr__knob{position:absolute;top:50%;width:1.25rem;height:1.25rem;border-radius:999px;
  background:var(--background);border:2px solid var(--primary);transform:translate(-50%,-50%)}
.sldr__scale{display:flex;justify-content:space-between;font-family:var(--font-mono);
  font-size:.7rem;color:var(--muted-foreground);margin-top:.4rem}

/* ---- Textarea ------------------------------------------------------------ */
.ta{display:block;width:100%;min-height:6rem;padding:.6rem .75rem;font:inherit;
  font-size:1rem;line-height:1.5;color:var(--foreground);background:var(--background);
  border:1px solid var(--input);border-radius:var(--radius-sm);resize:vertical}
.ta:focus-visible{outline:2px solid var(--ring);outline-offset:1px;border-color:var(--ring)}
.ta__count{display:flex;justify-content:space-between;gap:.75rem;margin-top:.25rem;
  font-family:var(--font-mono);font-size:.74rem;color:var(--muted-foreground);
  font-variant-numeric:tabular-nums}

/* ---- Progress & activity ------------------------------------------------- */
.prog{display:grid;gap:.3rem;max-width:24rem}
.prog__track{height:8px;border-radius:999px;background:var(--muted);overflow:hidden}
.prog__fill{height:100%;background:var(--primary);border-radius:999px}
.prog__meta{display:flex;justify-content:space-between;gap:.75rem;
  font-family:var(--font-mono);font-size:.74rem;color:var(--muted-foreground);
  font-variant-numeric:tabular-nums}
.prog--indet .prog__fill{width:38%;background:linear-gradient(90deg,
  transparent,var(--primary),transparent);opacity:.75}
.spinner{display:inline-block;width:1rem;height:1rem;border:2px solid var(--muted-foreground);
  border-right-color:transparent;border-radius:999px;vertical-align:-2px}
.spinner--lg{width:1.5rem;height:1.5rem;border-width:3px}

/* ---- Search -------------------------------------------------------------- */
.srch{max-width:30rem}
.srch__results{margin-top:.35rem;background:var(--popover);color:var(--popover-foreground);
  border:1px solid var(--border);border-radius:var(--radius-sm);overflow:hidden}
.srch__hit{display:flex;align-items:baseline;justify-content:space-between;gap:.75rem;
  padding:.55rem .7rem;border-bottom:1px solid var(--border);cursor:pointer}
.srch__hit:last-child{border-bottom:none}
.srch__hit:hover{background:var(--muted)}
.srch__hit:focus-visible{outline:2px solid var(--ring);outline-offset:-2px}
.srch__name{font-weight:600;font-size:.92rem}
.srch__ident{font-family:var(--font-mono);font-size:.76rem;color:var(--muted-foreground);
  font-variant-numeric:tabular-nums;white-space:nowrap}
.srch__note{padding:.55rem .7rem;font-size:.82rem;color:var(--muted-foreground)}

/* ---- Key–value pair ------------------------------------------------------ */
.kv{display:grid;gap:.1rem}
.kv__k{font-size:.8rem;color:var(--muted-foreground);line-height:1.3}
.kv__v{font-family:var(--font-mono);font-variant-numeric:tabular-nums;
  font-size:1.15rem;font-weight:600;line-height:1.25}
.kv__v .u{font-size:.8rem;font-weight:400;color:var(--muted-foreground);margin-left:.15rem}
.kv__v.absent{font-weight:400;color:var(--muted-foreground)}
.kv__ref{font-family:var(--font-mono);font-size:.72rem;color:var(--muted-foreground)}
.kv__prov{font-family:var(--font-mono);font-size:.72rem;color:var(--muted-foreground);
  margin-top:.15rem}
.kvgrid{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:1rem}
.kv--stack{display:grid;grid-template-columns:auto 1fr;gap:.2rem .75rem;align-items:baseline}
.kv--stack .kv__k{text-align:right}

/* ---- Empty state --------------------------------------------------------- */
.empty{display:grid;gap:.35rem;justify-items:start;padding:1.25rem;
  background:var(--card);color:var(--card-foreground);border:1px solid var(--border);
  border-radius:var(--radius-md)}
.empty__title{font-size:1rem;font-weight:600}
.empty__desc{font-size:.88rem;color:var(--muted-foreground);max-width:48ch}
.empty__proof{font-family:var(--font-mono);font-size:.74rem;color:var(--muted-foreground);
  font-variant-numeric:tabular-nums;margin-top:.2rem}

/* ---- Tooltip ------------------------------------------------------------- */
.tipwrap{position:relative;display:inline-flex}
.tip{position:absolute;bottom:calc(100% + 8px);left:50%;transform:translateX(-50%);
  background:var(--njt-teal-900);color:var(--njt-cream);
  font-family:var(--font-body);font-size:.8rem;line-height:1.4;padding:.35rem .6rem;
  border-radius:var(--radius-sm);white-space:nowrap;
  box-shadow:0 2px 8px rgba(11,42,38,.35);z-index:5;
  /* width:max-content is load-bearing. An absolutely positioned box shrink-to-fits
     against its containing block — here .tipwrap, which is only as wide as the
     trigger — so a wrapping bubble would otherwise collapse to its longest word. */
  width:max-content}
.dark .tip{background:var(--njt-cream);color:var(--njt-teal-900)}
.tip::after{content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);
  border:5px solid transparent;border-top-color:var(--njt-teal-900)}
.dark .tip::after{border-top-color:var(--njt-cream)}
.tip--wrap{white-space:normal;max-width:200px}   /* clamps the max-content width above */
/* Docs helper. Tooltips are rendered statically on the documentation pages so
   they can be seen without hovering; these cells give the bubble room so it is
   neither clipped by the demo frame nor overlapping its neighbour. */
.tipdemo-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:.5rem}
.tipdemo{display:grid;place-items:center;min-height:8rem;padding:4.25rem 1rem 1.25rem}
.tipdemo .tipwrap{margin:0}

/* ---- Select -------------------------------------------------------------- */
.sel{display:inline-flex;flex-direction:column;width:100%;max-width:320px}
.sel__trigger{display:flex;align-items:center;justify-content:space-between;gap:.5rem;
  width:100%;height:2.75rem;padding:0 .75rem;font:inherit;font-size:1rem;
  color:var(--foreground);background:var(--background);border:1px solid var(--input);
  border-radius:var(--radius-sm);cursor:pointer;text-align:left}
.sel__trigger:focus-visible{outline:2px solid var(--ring);outline-offset:1px;border-color:var(--ring)}
.sel__trigger[data-placeholder]{color:var(--muted-foreground)}
.sel__caret{flex:none;font-size:.7rem;color:var(--muted-foreground)}
.sel__list{margin-top:.25rem;background:var(--popover);color:var(--popover-foreground);
  border:1px solid var(--border);border-radius:var(--radius-sm);padding:.25rem;
  box-shadow:0 8px 24px rgba(11,42,38,.18)}
.sel__group{font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;
  color:var(--muted-foreground);padding:.4rem .5rem .2rem}
.sel__opt{display:flex;align-items:center;justify-content:space-between;gap:.5rem;
  padding:.45rem .5rem;border-radius:var(--radius-sm);font-size:.94rem;cursor:pointer}
.sel__opt:hover{background:var(--muted)}
.sel__opt[aria-selected="true"]{background:var(--accent);color:var(--accent-foreground);
  font-weight:600}

/* ---- Tabs ---------------------------------------------------------------- */
.tabs{display:flex;flex-direction:column}
.tabs__list{display:flex;gap:.15rem;border-bottom:1px solid var(--border);
  overflow-x:auto;flex-wrap:nowrap}
.tabs__tab{display:inline-flex;align-items:center;gap:.4rem;white-space:nowrap;
  font:inherit;font-size:.92rem;font-weight:600;color:var(--muted-foreground);
  background:none;border:0;border-bottom:2px solid transparent;
  padding:.6rem .8rem;margin-bottom:-1px;cursor:pointer}
.tabs__tab:hover{color:var(--foreground);background:var(--muted)}
.tabs__tab:focus-visible{outline:2px solid var(--ring);outline-offset:-2px}
.tabs__tab[aria-selected="true"]{color:var(--foreground);border-bottom-color:var(--primary)}
.tabs__count{font-family:var(--font-mono);font-size:.7rem;font-weight:700;
  background:var(--secondary);color:var(--secondary-foreground);
  border-radius:999px;padding:.05rem .35rem;min-width:1.15rem;text-align:center}
.tabs__tab[data-alarm="true"] .tabs__count{background:var(--alarm-critical);
  color:var(--alarm-critical-foreground)}
.tabs__panel{padding:1rem 0 0}

/* ---- Dialog -------------------------------------------------------------- */
.dlg-scrim{background:color-mix(in srgb,var(--njt-teal-900) 55%,transparent);
  padding:1.5rem;border-radius:var(--radius-md);display:grid;place-items:center}
.dlg{background:var(--popover);color:var(--popover-foreground);
  border:1px solid var(--border);border-radius:var(--radius-lg);
  box-shadow:0 12px 40px rgba(11,42,38,.28);width:100%;max-width:460px;padding:1.25rem}
.dlg__title{font-family:var(--font-body);font-size:1.05rem;font-weight:700;
  line-height:1.3;margin:0 0 .35rem}
.dlg__desc{font-size:.9rem;line-height:1.5;color:var(--muted-foreground);margin:0 0 1rem}
.dlg__actions{display:flex;gap:.5rem;justify-content:flex-end;flex-wrap:wrap}
.dlg__actions--split{justify-content:space-between}

/* ---- Form field ---------------------------------------------------------- */
.field{display:block;margin-bottom:.9rem}
.field__label{display:block;font-size:.875rem;font-weight:600;line-height:1.4;
  margin-bottom:.25rem;color:var(--foreground)}
.field__input{display:block;width:100%;height:2.75rem;padding:0 .75rem;font:inherit;
  font-size:1rem;color:var(--foreground);background:var(--background);
  border:1px solid var(--input);border-radius:var(--radius-sm)}
.field__input::placeholder{color:var(--muted-foreground)}
.field__input:focus-visible{outline:2px solid var(--ring);outline-offset:1px;
  border-color:var(--ring)}
.field__input[aria-invalid="true"]{border-color:var(--destructive);border-width:2px}
.field__hint{font-size:.8rem;color:var(--muted-foreground);margin-top:.25rem}
.field__err{font-size:.8rem;color:var(--destructive);margin-top:.25rem;font-weight:600}

/* ---- Flow diagram (state machines) --------------------------------------- */
.flow{display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;font-family:var(--font-body)}
.flow__node{border:1px solid var(--input);border-radius:var(--radius-sm);
  padding:.3rem .6rem;font-size:.82rem;background:var(--card);color:var(--card-foreground);
  white-space:nowrap}
.flow__node--alarm{border-color:var(--alarm-critical);border-width:2px;font-weight:600}
.flow__node--quiet{opacity:.7}
.flow__arrow{color:var(--muted-foreground);font-size:.9rem;padding:0 .1rem}
.flow__lbl{font-family:var(--font-mono);font-size:.68rem;color:var(--muted-foreground)}

/* ---- Audit trail (override pattern) -------------------------------------- */
.audit{border-left:2px solid var(--border);margin:0;padding:0 0 0 1rem;list-style:none}
.audit li{position:relative;padding:0 0 1rem}
.audit li::before{content:"";position:absolute;left:calc(-1rem - 5px);top:.45rem;
  width:8px;height:8px;border-radius:999px;background:var(--muted-foreground)}
.audit li[data-kind="model"]::before{background:var(--alarm-advisory)}
.audit li[data-kind="override"]::before{background:var(--alarm-urgent)}
.audit li[data-kind="action"]::before{background:var(--alarm-ok)}
.audit .when{font-family:var(--font-mono);font-size:.74rem;color:var(--muted-foreground);
  font-variant-numeric:tabular-nums}
.audit .what{font-size:.9rem;font-weight:600;line-height:1.35;margin-top:.05rem}
.audit .who{font-size:.82rem;color:var(--muted-foreground);margin-top:.1rem}

/* ---- Confidence disclosure ----------------------------------------------- */
.conf{display:flex;align-items:center;gap:.6rem;font-family:var(--font-mono);
  font-size:.8rem;font-variant-numeric:tabular-nums;color:var(--foreground)}
.conf__bar{position:relative;flex:none;width:120px;height:8px;border-radius:999px;
  background:var(--muted);overflow:hidden}
.conf__fill{position:absolute;inset:0 auto 0 0;background:var(--primary);border-radius:999px}
.conf__scale{display:flex;justify-content:space-between;width:120px;
  font-size:.62rem;color:var(--muted-foreground);margin-top:.2rem}

/* ---- Foundation diagrams (spacing / grid / elevation / motion) ----------- */
.spacescale{display:flex;flex-direction:column;gap:.35rem}
.spacescale .row3{display:flex;align-items:center;gap:.75rem;font-family:var(--font-mono);
  font-size:.75rem;color:var(--muted-foreground)}
.spacescale .bar{height:14px;background:var(--primary);border-radius:2px;flex:none}
.spacescale .nm{width:6.5rem;flex:none;color:var(--foreground)}

.regions{display:flex;flex-direction:column;gap:2px;font-family:var(--font-mono);
  font-size:.7rem;letter-spacing:.04em}
.regions div{padding:.5rem .7rem;border-radius:var(--radius-sm);
  border:1px solid var(--border);background:var(--card);color:var(--card-foreground)}
.regions .r-alarm{border-color:var(--alarm-critical);border-width:2px;border-style:dashed}
.regions .r-main{min-height:5rem;display:grid;place-items:center;
  color:var(--muted-foreground);background:var(--background)}
.regions .r-fixed{background:var(--muted)}

.zstack{position:relative;height:15rem}
.zstack div{position:absolute;left:0;right:0;padding:.5rem .75rem;
  border:1px solid var(--border);border-radius:var(--radius-sm);
  background:var(--card);color:var(--card-foreground);font-family:var(--font-mono);
  font-size:.72rem}
.zstack .z1{top:8.5rem;left:0;   right:5rem}
.zstack .z2{top:6.6rem;left:1rem;right:4rem;box-shadow:0 1px 2px rgba(11,42,38,.10)}
.zstack .z3{top:4.7rem;left:2rem;right:3rem;box-shadow:0 2px 6px rgba(11,42,38,.14)}
.zstack .z4{top:2.8rem;left:3rem;right:2rem;box-shadow:0 6px 18px rgba(11,42,38,.20)}
.zstack .z5{top:.9rem; left:4rem;right:1rem;background:var(--alarm-critical);
  color:var(--alarm-critical-foreground);border-color:rgba(0,0,0,.2);
  box-shadow:0 10px 28px rgba(11,42,38,.28)}

.durbars{display:flex;flex-direction:column;gap:.4rem;font-family:var(--font-mono);
  font-size:.75rem}
.durbars .row3{display:flex;align-items:center;gap:.75rem}
.durbars .nm{width:9rem;flex:none;color:var(--foreground)}
.durbars .bar{height:12px;border-radius:2px;background:var(--primary);flex:none}
.durbars .val{color:var(--muted-foreground)}

/* ---- swatches (colour / token pages) ------------------------------------- */
.ramp{display:grid;grid-template-columns:repeat(10,1fr);border-radius:var(--r-md);
  overflow:hidden;border:1px solid var(--doc-border);margin-bottom:.5rem}
@media (max-width:900px){.ramp{grid-template-columns:repeat(5,1fr)}}
.ramp .stop{padding:.9rem .5rem 1.6rem;font-family:var(--font-mono);font-size:.6rem;
  line-height:1.5;text-align:center}
.ramp .stop b{display:block;font-size:.66rem;font-weight:600}
.tokrow{display:flex;align-items:center;gap:.7rem;padding:.5rem 0;
  border-bottom:1px solid var(--doc-border);font-size:.87rem}
.tokrow:last-child{border-bottom:none}
.tokchip{flex:none;width:34px;height:34px;border-radius:var(--r-sm);
  border:1px solid rgba(0,0,0,.15)}
.tokrow .nm{font-family:var(--font-mono);font-size:.78rem}
.tokrow .val{margin-left:auto;font-family:var(--font-mono);font-size:.75rem;color:var(--doc-faint)}

/* ---- type specimen ------------------------------------------------------- */
.spec{border:1px solid var(--doc-border);border-radius:var(--r-lg);overflow:hidden;
  margin-bottom:1rem;background:var(--doc-cream-card)}
.spec .row2{display:flex;gap:1.2rem;align-items:baseline;padding:.9rem 1.2rem;
  border-bottom:1px solid var(--doc-border);flex-wrap:wrap}
.spec .row2:last-child{border-bottom:none}
.spec .meta2{flex:none;width:170px;font-family:var(--font-mono);font-size:.68rem;
  letter-spacing:.06em;color:var(--doc-muted);text-transform:uppercase}
.spec .sample{flex:1;min-width:0;color:var(--njt-teal-900)}
