/* =====================================================================================================================
   LagerLink design system — FINAL (v1.0, 30 Sep 2026)
   Base: direction A "Swiss Precision" (paper and ink, colour only for state), with the judges' grafts from B and C.
   ---------------------------------------------------------------------------------------------------------------------
   One stylesheet, served from 'self' (CSP style-src 'self'). No inline styles anywhere: dynamic values arrive as custom
   properties set through the CSSOM (element.style.setProperty) or as classes.

   Rules encoded here (see DESIGN-SYSTEM.md for the long form):
   · Paper and ink. Colour is reserved for STATE: order-state group, alert severity, pipeline health, environment.
     Everything else is a neutral with a typographic hierarchy.
   · Red means CRITICAL and nothing else. PROD has its own hue (carmine) AND its own pattern (hatched band with a boxed
     label); TEST is amber with a dark hatch. A brand can never make PROD look safe or CRIT look calm.
   · Brand tokens are raw inputs (--brand-primary/-accent) plus contrast-checked derivatives computed at runtime by
     js/lib/brand.js. Components only ever use the theme-resolved aliases --brand-text / --brand-fill / --brand-fill-ink.
   · Every text token is ≥ 4.5:1 on --surface and --bg in its theme; UI boundaries (--border-strong, --focus) ≥ 3:1.
   Sections: 1 tokens · 2 dark tokens · 3 base · 4 typography · 5 shell · 6 core components · 7 domain components ·
             8 charts · 9 overlays · 10 modes · 11 motion & forced colours
   Page layouts (grids per screen, wall composition) live in screens.css.
   ===================================================================================================================== */

/* 1 ─ Tokens (light, default) ───────────────────────────────────────────────────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Brand — raw (white-label input; overwritten per brand by brand.js) */
  --brand-primary: #1F4E79;
  --brand-primary-ink: #FFFFFF;
  --brand-accent: #E07A1F;
  --brand-accent-ink: #111418;
  /* Brand — derived, contrast-checked (defaults = LagerLink) */
  --brand-primary-text-light: #1F4E79;   /* primary as text/link on light surfaces, ≥ 4.5:1 */
  --brand-primary-text-dark: #8FB6E0;    /* primary as text/link on dark surfaces, ≥ 4.5:1 */
  --brand-primary-fill-dark: #2968A2;    /* primary as fill in dark theme, ≥ 3:1 against the dark surface */
  --brand-primary-fill-dark-ink: #FFFFFF;
  /* Brand — theme-resolved aliases (components use ONLY these) */
  --brand-text: var(--brand-primary-text-light);
  --brand-fill: var(--brand-primary);
  --brand-fill-ink: var(--brand-primary-ink);

  /* Neutrals — paper & ink */
  --bg: #F3F3F0;
  --surface: #FFFFFF;
  --surface-2: #F8F8F6;
  --surface-3: #EDEDE8;
  --border: #DEDED8;
  --border-strong: #7A7F87;
  --text: #16181B;
  --text-muted: #5B6068;
  --ink-2: #3A3F46;
  --scrim: rgba(12, 14, 17, 0.38);
  --selection: #CFE0F5;

  /* Order-state groups (LABELS.stateGroup) — colour + glyph + word, never colour alone */
  --state-intake: #5A4A9E;
  --state-flow: #2B5A8A;
  --state-done: #1B7243;
  --state-attention: #8C6300;
  --state-critical: #C21F14;
  --state-neutral: #646A73;

  /* Alert severity (AlertSeverity) — CRIT is the only red in the system */
  --sev-crit: #C21F14;
  --sev-crit-fill: #C21F14;
  --sev-crit-fill-ink: #FFFFFF;
  --sev-high: #B04A0B;
  --sev-warn: #8C6300;
  --sev-info: #2C5C8C;

  /* Tints — quiet backgrounds, used sparingly (text on every tint stays ≥ 4.5:1) */
  --tint-crit: #FBECEA;
  --tint-high: #FBEFE6;
  --tint-warn: #FAF3E0;
  --tint-info: #EBF1F8;
  --tint-done: #E8F3EC;
  --tint-flow: #EAF0F7;
  --tint-intake: #EFEDF8;
  --tint-neutral: #F0F0EC;

  /* Environment — never brand-derived, never the CRIT red. Hue + pattern + boxed label. */
  --env-prod: #8E1848;              /* carmine: "live", distinct from CRIT vermilion */
  --env-prod-ink: #FFFFFF;          /* 8.8:1 on --env-prod */
  --env-prod-text: #8E1848;         /* PROD as text on light surfaces, 8.8:1 */
  --env-prod-hatch: rgba(255, 255, 255, 0.13);
  --env-test: #E8B03A;
  --env-test-ink: #1A1405;          /* 9.3:1 on --env-test */
  --env-test-text: #7F5700;
  --env-hatch: rgba(26, 20, 5, 0.14);

  /* Focus — independent of brand, ≥ 3:1 against every surface */
  --focus: #1558D6;
  --focus-ring: 0 0 0 2px var(--surface), 0 0 0 4px var(--focus);

  /* Type — system stacks only (no web fonts are fetched) */
  --font-sans: system-ui, -apple-system, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --fs-2xs: 10.5px;
  --fs-xs: 11.5px;
  --fs-sm: 12.5px;
  --fs-md: 13.5px;
  --fs-base: 14px;
  --fs-lg: 15.5px;
  --fs-xl: 19px;
  --fs-2xl: 26px;
  --fs-3xl: 36px;
  --fs-4xl: 52px;
  --fs-5xl: 76px;
  --fs-flow: 28px;                  /* loop numerals on the desk; the wall raises it to 52px */
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-body: 1.5;
  --track-caps: 0.075em;
  --measure: 76ch;

  /* Space (4 px grid) — contract --space-1 … --space-6, extended to 8 */
  --space-0: 2px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* Shape & elevation */
  --radius: 4px;
  --radius-sm: 2px;
  --radius-lg: 6px;
  --radius-pill: 999px;
  --shadow-1: 0 1px 0 rgba(16, 18, 21, 0.04);
  --shadow-2: 0 2px 6px rgba(16, 18, 21, 0.08), 0 1px 2px rgba(16, 18, 21, 0.06);
  --shadow-3: 0 18px 48px rgba(16, 18, 21, 0.18), 0 4px 12px rgba(16, 18, 21, 0.08);

  /* Motion — explains causality, never decorates */
  --dur-1: 120ms;
  --dur-2: 180ms;
  --dur-3: 240ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.3, 0, 0.1, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);

  /* Layers */
  --z-sticky: 30;
  --z-topbar: 40;
  --z-popover: 70;
  --z-scrim: 80;
  --z-drawer: 90;
  --z-modal: 100;
  --z-caption: 110;
  --z-toast: 120;

  /* Layout */
  --topbar-h: 52px;
  --envbar-h: 32px;
  --rail-w: 252px;
  --rail-w-collapsed: 64px;
  --page-pad-x: 32px;
  --gutter: 24px;
  --content-max: 1720px;
}

/* 2 ─ Dark tokens (system preference unless the viewer forced light; or forced dark) ───────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --brand-text: var(--brand-primary-text-dark);
    --brand-fill: var(--brand-primary-fill-dark);
    --brand-fill-ink: var(--brand-primary-fill-dark-ink);
    --bg: #0D0F12;
    --surface: #15181C;
    --surface-2: #1A1E23;
    --surface-3: #22272D;
    --border: #2B3037;
    --border-strong: #6B727C;
    --text: #E9EBEE;
    --text-muted: #A3A9B2;
    --ink-2: #C9CDD3;
    --scrim: rgba(0, 0, 0, 0.6);
    --selection: #26466E;
    --state-intake: #AFA2F2;
    --state-flow: #86AEDF;
    --state-done: #4FC58B;
    --state-attention: #E0B040;
    --state-critical: #FF6B5F;
    --state-neutral: #9AA1AB;
    --sev-crit: #FF6B5F;
    --sev-crit-fill: #C8352C;
    --sev-crit-fill-ink: #FFFFFF;
    --sev-high: #F28A45;
    --sev-warn: #E0B040;
    --sev-info: #79AEE6;
    --tint-crit: #3A1714;
    --tint-high: #3A2112;
    --tint-warn: #362B10;
    --tint-info: #13263A;
    --tint-done: #10301F;
    --tint-flow: #15263A;
    --tint-intake: #221D3D;
    --tint-neutral: #1E2227;
    --env-prod: #A3235A;
    --env-prod-ink: #FFFFFF;
    --env-prod-text: #F07AA8;
    --env-prod-hatch: rgba(255, 255, 255, 0.12);
    --env-test: #D9A43A;
    --env-test-ink: #1A1405;
    --env-test-text: #E3B341;
    --env-hatch: rgba(26, 20, 5, 0.16);
    --focus: #8AB4F8;
    --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.3);
    --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-3: 0 22px 60px rgba(0, 0, 0, 0.6), 0 4px 14px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --brand-text: var(--brand-primary-text-dark);
  --brand-fill: var(--brand-primary-fill-dark);
  --brand-fill-ink: var(--brand-primary-fill-dark-ink);
  --bg: #0D0F12;
  --surface: #15181C;
  --surface-2: #1A1E23;
  --surface-3: #22272D;
  --border: #2B3037;
  --border-strong: #6B727C;
  --text: #E9EBEE;
  --text-muted: #A3A9B2;
  --ink-2: #C9CDD3;
  --scrim: rgba(0, 0, 0, 0.6);
  --selection: #26466E;
  --state-intake: #AFA2F2;
  --state-flow: #86AEDF;
  --state-done: #4FC58B;
  --state-attention: #E0B040;
  --state-critical: #FF6B5F;
  --state-neutral: #9AA1AB;
  --sev-crit: #FF6B5F;
  --sev-crit-fill: #C8352C;
  --sev-crit-fill-ink: #FFFFFF;
  --sev-high: #F28A45;
  --sev-warn: #E0B040;
  --sev-info: #79AEE6;
  --tint-crit: #3A1714;
  --tint-high: #3A2112;
  --tint-warn: #362B10;
  --tint-info: #13263A;
  --tint-done: #10301F;
  --tint-flow: #15263A;
  --tint-intake: #221D3D;
  --tint-neutral: #1E2227;
  --env-prod: #A3235A;
  --env-prod-ink: #FFFFFF;
  --env-prod-text: #F07AA8;
  --env-prod-hatch: rgba(255, 255, 255, 0.12);
  --env-test: #D9A43A;
  --env-test-ink: #1A1405;
  --env-test-text: #E3B341;
  --env-hatch: rgba(26, 20, 5, 0.16);
  --focus: #8AB4F8;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, 0.3);
  --shadow-2: 0 2px 8px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-3: 0 22px 60px rgba(0, 0, 0, 0.6), 0 4px 14px rgba(0, 0, 0, 0.45);
}

/* 3 ─ Base ──────────────────────────────────────────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + var(--envbar-h) + 24px);
  background: var(--bg);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 400 var(--fs-base)/var(--lh-body) var(--font-sans);
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
::selection { background: var(--selection); }
h1, h2, h3, h4, h5, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
:where(ul[role="list"], ol[role="list"], .plain) { list-style: none; padding: 0; }
img, svg { display: block; }
svg { overflow: visible; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-text); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd, samp, pre, .mono { font-family: var(--font-mono); font-size: 0.92em; }
table { border-collapse: collapse; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-4) 0; }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { scroll-margin: calc(var(--topbar-h) + var(--envbar-h) + 32px) 0 96px; }

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -60px;
  z-index: 200;
  padding: var(--space-2) var(--space-4);
  background: var(--text);
  color: var(--bg);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: top var(--dur-1) var(--ease);
}
.skip-link:focus { top: var(--space-2); }
.vh, .sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap;
}
.noscript { padding: var(--space-6); max-width: 60ch; }

/* 4 ─ Typography ────────────────────────────────────────────────────────────────────────────────────────────────── */
.num, .tnum, time, .tbl td, .kpi__value, .countdown { font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums slashed-zero; letter-spacing: 0; }
.caps, .eyebrow {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  color: var(--text-muted);
}
.muted { color: var(--text-muted); }
.ink { color: var(--text); }
.strong { font-weight: 600; }
.small { font-size: var(--fs-sm); }
.xsmall { font-size: var(--fs-xs); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.balance { text-wrap: balance; }
.pretty { text-wrap: pretty; }
.measure { max-width: var(--measure); }
.t-crit { color: var(--sev-crit); }
.t-high { color: var(--sev-high); }
.t-warn { color: var(--sev-warn); }
.t-info { color: var(--sev-info); }
.t-done { color: var(--state-done); }
.t-flow { color: var(--state-flow); }
.t-neutral { color: var(--state-neutral); }
.t-attention { color: var(--state-attention); }
.t-prod { color: var(--env-prod-text); }
.display {
  font-size: var(--fs-3xl);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.gloss { border-bottom: 1px dotted var(--border-strong); cursor: help; }
kbd, .kbd {
  display: inline-block;
  min-width: 20px;
  padding: 0 5px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  line-height: 18px;
  text-align: center;
  color: var(--text);
}
/* Wire terms (Auftrag_ID, Freigabe=1, BestandListe …) stay untranslated and look like data */
.wire { font-family: var(--font-mono); font-size: 0.9em; font-variant-numeric: slashed-zero; padding: 0 3px; border-radius: var(--radius-sm); background: var(--surface-3); color: var(--text); white-space: nowrap; }

/* 5 ─ Application shell ─────────────────────────────────────────────────────────────────────────────────────────── */
.app { min-height: 100vh; display: flex; flex-direction: column; }

/* Top bar: a thin brand rule, then paper. The brand is a signature, not a flood. */
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-topbar);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: inset 0 2px 0 var(--brand-fill);
}
.brandmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}
.brandmark__glyph {
  position: relative;
  width: 22px; height: 22px;
  flex: none;
  border-radius: var(--radius-sm);
  background: var(--brand-fill);
}
.brandmark__glyph::after {
  content: "";
  position: absolute;
  right: 3px; bottom: 3px;
  width: 7px; height: 7px;
  border-radius: 1px;
  background: var(--brand-accent);
}
.brandmark__name { font-weight: 650; font-size: var(--fs-lg); letter-spacing: -0.01em; white-space: nowrap; }
.brandmark__scope {
  padding-left: var(--space-3);
  margin-left: var(--space-1);
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  font-size: var(--fs-sm);
  white-space: nowrap;
  line-height: 1.25;
}
.brandmark__scope b { display: block; color: var(--text); font-weight: 550; }
.topbar__search { flex: 1 1 360px; max-width: 520px; min-width: 200px; position: relative; }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.topbar__sep { width: 1px; height: 24px; background: var(--border); margin: 0 var(--space-1); }
.topbar__counts { display: flex; }

.clock {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 2px var(--space-2);
  border: 0;
  background: none;
  border-radius: var(--radius);
  line-height: 1.15;
  text-align: right;
}
.clock:hover { background: var(--surface-2); }
.clock__time { font-size: var(--fs-lg); font-weight: 600; font-variant-numeric: tabular-nums; }
.clock__meta { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; }

/* Needs-a-human counter: the four severities always sum to the inbox total shown in the rail and on every page. */
.inbox-count {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-weight: 650;
  font-size: var(--fs-md);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  white-space: nowrap;
}
.inbox-count:hover { background: var(--surface-2); text-decoration: none; }
.inbox-count__part { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--radius-sm); padding: 0 2px; }
.inbox-count__part--crit .glyph { color: var(--sev-crit); }
.inbox-count__part--high .glyph { color: var(--sev-high); }
.inbox-count__part--warn .glyph { color: var(--sev-warn); }
.inbox-count__part--info .glyph { color: var(--sev-info); }
.inbox-count__total { padding-left: 8px; border-left: 1px solid var(--border); color: var(--text-muted); font-weight: 550; }
.inbox-count--crit { border-color: var(--sev-crit); box-shadow: inset 0 0 0 1px var(--sev-crit); }
.inbox-count--crit .inbox-count__part--crit { color: var(--sev-crit); }
.inbox-count--clear { color: var(--state-done); border-color: var(--border); }

.userchip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 36px;
  padding: 2px 6px 2px 2px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  text-align: left;
}
.userchip:hover { background: var(--surface-2); border-color: var(--border); }
.userchip__avatar {
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--text);
  color: var(--surface);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.userchip__text { display: flex; flex-direction: column; line-height: 1.2; font-size: var(--fs-xs); color: var(--text-muted); }
.userchip__text b { color: var(--text); font-size: var(--fs-sm); font-weight: 600; }

.app__body { flex: 1; display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 0; }
.app__body--norail { grid-template-columns: minmax(0, 1fr); }
.main { min-width: 0; outline: none; display: flex; flex-direction: column; }
.page {
  width: 100%;
  max-width: var(--content-max);
  padding: var(--space-5) var(--page-pad-x) var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}

/* Navigation rail — operations first, then shops that need a look (with Mandant), healthy shops summarised */
.rail {
  position: sticky;
  top: var(--topbar-h);
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-4) var(--space-3) var(--space-5);
  border-right: 1px solid var(--border);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  scrollbar-width: thin;
}
.rail__group { display: flex; flex-direction: column; gap: 1px; }
.rail__label { display: flex; align-items: baseline; gap: var(--space-2); padding: 0 var(--space-2) var(--space-1); }
.rail__label .push { font-variant-numeric: tabular-nums; }
.rail__item {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 34px;
  padding: 0 var(--space-2);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-md);
}
.rail__item:hover { background: var(--surface-3); text-decoration: none; }
.rail__item[aria-current="page"] { background: var(--surface); box-shadow: inset 2px 0 0 var(--brand-fill), 0 0 0 1px var(--border); font-weight: 600; }
.rail__item .icon { color: var(--text-muted); flex: none; }
.rail__item[aria-current="page"] .icon { color: var(--text); }
.rail__text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rail__note { display: block; font-size: var(--fs-2xs); color: var(--text-muted); font-weight: 500; letter-spacing: 0.02em; }
.rail__count {
  min-width: 22px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rail__count--crit { background: var(--sev-crit-fill); color: var(--sev-crit-fill-ink); }
.rail__tenant { min-height: 30px; gap: var(--space-2); font-size: var(--fs-sm); }
.rail__tenant .health { gap: 0; flex: none; }
.rail__mandant { flex: none; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums slashed-zero; }
.rail__crit { flex: none; display: inline-flex; align-items: center; gap: 3px; padding: 0 5px; min-height: 18px; border-radius: var(--radius-sm); background: var(--sev-crit-fill); color: var(--sev-crit-fill-ink); font-size: var(--fs-2xs); font-weight: 750; font-variant-numeric: tabular-nums; }
.rail__crit .glyph { color: var(--sev-crit-fill-ink); width: 9px; height: 9px; }
.rail__env { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; padding: 1px 4px; border-radius: 2px; border: 1px solid var(--border-strong); color: var(--text-muted); flex: none; }
.rail__env--test { background: var(--env-test); color: var(--env-test-ink); border-color: var(--env-test); }
/* Shop names wrap to two lines instead of being cut off (the TEST / SHADOW chip takes room); the title keeps the full name. */
.rail__tenant .rail__text { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-height: 1.25; -webkit-hyphens: auto; hyphens: auto; overflow-wrap: break-word; }
.rail__ok { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 30px; padding: 0 var(--space-2); border: 0; border-radius: var(--radius); background: none; color: var(--text-muted); font-size: var(--fs-sm); text-align: left; }
.rail__ok:hover { background: var(--surface-3); color: var(--text); }
.rail__ok .glyph { color: var(--state-done); }
.rail__jump { margin: 0 0 var(--space-1); }
.rail__jump .input { min-height: 30px; font-size: var(--fs-sm); background: var(--surface); }
.rail__foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--space-2); padding: 0 var(--space-2); }
.rail__keys { border: 0; background: none; width: 100%; text-align: left; font: inherit; color: var(--text-muted); }
.rail__tip { display: none; }
.rail__dot { display: none; }

/* Environment band — the environment is a state with its own hue AND its own pattern (never the CRIT red).
   Sticks under the top bar on every tenant-scoped view; the same band repeats inside drawers and approval dialogs. */
.env-slot { position: sticky; top: var(--topbar-h); z-index: var(--z-sticky); }
.env-slot:empty { display: none; }
.envbar {
  position: relative;
  min-height: var(--envbar-h);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--page-pad-x);
  font-size: var(--fs-sm);
  line-height: 1.3;
}
.envbar--prod {
  background-color: var(--env-prod);
  background-image: repeating-linear-gradient(135deg, var(--env-prod-hatch) 0 6px, transparent 6px 14px);
  color: var(--env-prod-ink);
}
.envbar--test {
  background-color: var(--env-test);
  background-image: repeating-linear-gradient(135deg, var(--env-hatch) 0 8px, transparent 8px 16px);
  color: var(--env-test-ink);
}
.envbar__env {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 1px 7px;
  border: 1.5px solid currentColor;
  border-radius: var(--radius-sm);
  font-weight: 800;
  letter-spacing: 0.1em;
  font-size: var(--fs-xs);
  white-space: nowrap;
}
.envbar__env .icon { width: 13px; height: 13px; stroke-width: 2; }
.envbar__path { font-family: var(--font-mono); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; font-variant-numeric: slashed-zero; }
.envbar__tenant { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.envbar__note { margin-left: auto; min-width: 0; flex: 0 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.envbar .badge { border-color: currentColor; color: inherit; background: transparent; }
/* A page without a page-level band (scoped to many shops) gives its sticky elements the band's height back. */
.env-slot:empty + .page { --envbar-h: 0px; }
/* The band of a selected item (Attention inbox): on top of the detail pane, sticky while the card is read. */
.envbar--item { position: sticky; top: calc(var(--topbar-h) + 8px); z-index: 4; flex-wrap: wrap; row-gap: 2px; min-height: 36px; padding: 5px var(--space-3); border-radius: var(--radius) var(--radius) 0 0; }
.envbar__sel { font-size: var(--fs-2xs); font-weight: 800; letter-spacing: var(--track-caps); text-transform: uppercase; opacity: 0.92; }
.envbar--item + .card { border-top-left-radius: 0; border-top-right-radius: 0; }

/* Footer (trademark + honesty line) */
.app-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-4) var(--page-pad-x) var(--space-5);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2) var(--space-6);
  background: var(--bg);
}
.app-footer p { max-width: 110ch; }
.app-footer__meta { text-align: right; white-space: nowrap; }

/* Page header & section headings — the Swiss rule */
.page-head { display: flex; align-items: flex-end; gap: var(--space-3) var(--space-5); flex-wrap: wrap; }
.page-head__titles { min-width: 0; flex: 1 1 420px; display: flex; flex-direction: column; gap: var(--space-1); }
.page-head h1 { font-size: var(--fs-2xl); font-weight: 650; line-height: var(--lh-tight); letter-spacing: -0.015em; }
.page-head__sub { color: var(--text-muted); font-size: var(--fs-md); }
.page-head__actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

.sec { display: flex; flex-direction: column; gap: var(--space-3); min-width: 0; }
.sec-head {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--text);
  min-width: 0;
}
.sec-head__no { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums slashed-zero; }
.sec-head h2, .sec-head h3 { font-size: var(--fs-lg); font-weight: 650; letter-spacing: -0.005em; line-height: var(--lh-snug); }
.sec-head__meta { margin-left: auto; color: var(--text-muted); font-size: var(--fs-sm); display: flex; gap: var(--space-3); align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* Grid utilities (12-column Swiss grid) */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--gutter); }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; } .span-12 { grid-column: 1 / -1; }
.stack { display: flex; flex-direction: column; gap: var(--space-3); }
.stack--sm { gap: var(--space-2); }
.stack--lg { gap: var(--space-5); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.cluster--lg { gap: var(--space-4); }
.spread { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.push { margin-left: auto; }
.rule { border: 0; border-top: 1px solid var(--border); margin: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.w-full { width: 100%; }
.mt-1 { margin-top: var(--space-1); } .mt-2 { margin-top: var(--space-2); } .mt-3 { margin-top: var(--space-3); } .mt-4 { margin-top: var(--space-4); }
.gap-4 { gap: var(--space-4); }
.maxw-32 { max-width: 32ch; }
.icon-inline { display: inline-block; vertical-align: -3px; }

/* 6 ─ Core components ───────────────────────────────────────────────────────────────────────────────────────────── */

/* Icons & glyphs (inline SVG built with createElementNS; stroke/fill from currentColor) */
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 22px; height: 22px; }
.glyph { width: 10px; height: 10px; flex: none; }
.glyph--lg { width: 14px; height: 14px; }
.glyph .g-fill { fill: currentColor; }
.glyph .g-stroke { fill: none; stroke: currentColor; stroke-width: 1.6; }
.glyph .g-dash { fill: none; stroke: currentColor; stroke-width: 1.4; stroke-dasharray: 1.8 1.4; }
.glyph .g-knock { fill: var(--surface); }
.glyph .g-knock-s { fill: none; stroke: var(--surface); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.glyph .g-line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* Buttons */
.btn {
  --_bg: var(--surface);
  --_fg: var(--text);
  --_bd: var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 0 var(--space-3);
  border: 1px solid var(--_bd);
  border-radius: var(--radius);
  background: var(--_bg);
  color: var(--_fg);
  font-size: var(--fs-md);
  font-weight: 550;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease), color var(--dur-1) var(--ease);
}
.btn:hover { --_bg: var(--surface-2); text-decoration: none; }
.btn:active { --_bg: var(--surface-3); }
.btn[disabled], .btn[aria-disabled="true"] { cursor: not-allowed; opacity: 1; --_fg: var(--text-muted); --_bd: var(--border); --_bg: var(--surface-2); }
.btn--primary { --_bg: var(--brand-fill); --_fg: var(--brand-fill-ink); --_bd: var(--brand-fill); }
.btn--primary:hover { --_bg: var(--brand-fill); filter: brightness(1.08) saturate(1.05); }
.btn--primary[disabled], .btn--primary[aria-disabled="true"] { filter: none; --_fg: var(--text-muted); --_bd: var(--border); --_bg: var(--surface-2); }
.btn--danger { --_bg: var(--sev-crit-fill); --_fg: var(--sev-crit-fill-ink); --_bd: var(--sev-crit-fill); }
.btn--danger:hover { --_bg: var(--sev-crit-fill); filter: brightness(1.08); }
.btn--quiet { --_bd: transparent; --_bg: transparent; }
.btn--quiet:hover { --_bg: var(--surface-3); }
.btn--sm { min-height: 26px; padding: 0 var(--space-2); font-size: var(--fs-sm); gap: var(--space-1); }
.btn--lg { min-height: 40px; padding: 0 var(--space-4); font-size: var(--fs-base); }
.btn--icon { width: 32px; padding: 0; }
.btn--icon.btn--sm { width: 26px; }
.btn__kbd { margin-left: var(--space-1); }
.btn .spinner { width: 14px; height: 14px; }
.linkbtn {
  display: inline;
  padding: 0;
  border: 0;
  background: none;
  color: var(--brand-text);
  font: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  cursor: pointer;
}
.linkbtn:hover { text-decoration-thickness: 2px; }

/* Segmented control (radio-group semantics) */
.seg {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  gap: 2px;
}
.seg__opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 26px;
  min-width: 28px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
}
.seg__opt:hover { color: var(--text); background: var(--surface-2); }
.seg__opt[aria-checked="true"], .seg__opt[aria-pressed="true"], .seg__opt[aria-selected="true"] { background: var(--text); color: var(--surface); }

/* Demo chrome — controls that exist only in the sales/prototype build are fenced by a dashed frame and labelled */
.democtl { display: inline-flex; align-items: center; gap: var(--space-2); padding: 3px 4px 3px var(--space-2); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2); }
.democtl__label { font-size: var(--fs-2xs); font-weight: 750; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); white-space: nowrap; }
.democtl__note { font-weight: 600; letter-spacing: 0.02em; text-transform: none; }
/* The screenshot build (?capture=1) shows the product, not the sales build's demo chrome. */
[data-capture] .democtl, [data-capture] .demo-only, [data-capture] .rail__item--demo, [data-capture] .rail__group--more { display: none !important; }
.democtl .select { min-height: 28px; width: auto; min-width: 200px; font-size: var(--fs-sm); }

/* Form controls */
.field { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.field__label { font-size: var(--fs-sm); font-weight: 600; }
.field__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.field__error { font-size: var(--fs-sm); color: var(--sev-crit); font-weight: 550; }
.field__error:empty { display: none; }
.input, .select, .textarea {
  width: 100%;
  min-height: 34px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-md);
}
.textarea { padding: var(--space-2) var(--space-3); min-height: 96px; line-height: 1.5; resize: vertical; }
.input--mono { font-family: var(--font-mono); letter-spacing: 0.02em; }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--sev-crit); }
.input::placeholder { color: var(--text-muted); opacity: 1; }
.search { position: relative; display: flex; align-items: center; }
.search .icon { position: absolute; left: 10px; color: var(--text-muted); pointer-events: none; }
.search .input { padding-left: 34px; padding-right: 40px; background: var(--surface-2); border-color: var(--border); }
.search .input:hover { border-color: var(--border-strong); }
.search .kbd { position: absolute; right: 8px; pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); cursor: pointer; min-height: 24px; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand-fill); }
.check--strong { padding: var(--space-2) var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface-2); font-weight: 550; }

/* Combobox listbox (global order search) */
.listbox {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  z-index: 60;
  max-height: 420px;
  overflow: auto;
  padding: var(--space-1);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
}
.listbox__opt {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--fs-sm);
}
.listbox__opt[aria-selected="true"] { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--focus); }
.listbox__empty { padding: var(--space-3); color: var(--text-muted); font-size: var(--fs-sm); }

/* State pill — glyph carries colour, word carries meaning (never colour alone) */
.pill {
  --_c: var(--state-neutral);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 22px;
  padding: 0 8px 0 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-sm);
  font-weight: 550;
  line-height: 1.1;
  white-space: nowrap;
  vertical-align: middle;
}
.pill .glyph { color: var(--_c); }
.pill--intake { --_c: var(--state-intake); }
.pill--flow { --_c: var(--state-flow); }
.pill--done { --_c: var(--state-done); }
.pill--attention { --_c: var(--state-attention); border-color: color-mix(in srgb, var(--state-attention) 45%, var(--border)); }
.pill--critical { --_c: var(--state-critical); background: var(--tint-crit); border-color: color-mix(in srgb, var(--state-critical) 55%, var(--border)); color: var(--sev-crit); font-weight: 650; }
.pill--neutral { --_c: var(--state-neutral); background: var(--surface-2); color: var(--text-muted); }
.pill--lg { min-height: 28px; padding: 0 10px 0 9px; font-size: var(--fs-md); }
.pill--lg .glyph { width: 12px; height: 12px; }

/* Severity chip — distinct SHAPE per severity (octagon CRIT · triangle HIGH · diamond WARN · circle INFO) + word */
.sev {
  --_c: var(--sev-info);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 0 6px 0 5px;
  border-radius: var(--radius-sm);
  color: var(--_c);
  font-size: var(--fs-xs);
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.sev--crit { background: var(--sev-crit-fill); color: var(--sev-crit-fill-ink); }
.sev--crit .glyph { color: var(--sev-crit-fill-ink); }
.sev--high { --_c: var(--sev-high); background: var(--tint-high); }
.sev--warn { --_c: var(--sev-warn); background: var(--tint-warn); }
.sev--info { --_c: var(--sev-info); background: var(--tint-info); }
.sev--alias { text-transform: none; letter-spacing: 0; font-weight: 700; font-size: var(--fs-sm); }
.sev--bare { background: transparent !important; padding: 0; }
.sev--bare.sev--crit { color: var(--sev-crit); }
.sev--bare.sev--crit .glyph { color: var(--sev-crit); }

/* Flag chips — orthogonal to state; max two visible + "+n" */
.flags { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; vertical-align: middle; }
.flag {
  --_c: var(--state-neutral);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 550;
  white-space: nowrap;
}
.flag::before { content: ""; width: 6px; height: 6px; border-radius: 1px; background: var(--_c); flex: none; }
.flag--crit { --_c: var(--sev-crit); }
.flag--warn { --_c: var(--sev-warn); }
.flag--info { --_c: var(--sev-info); }
.flag--more { cursor: help; }
.flag--more::before { display: none; }

/* Environment tag (inline) — same language as the band: carmine PROD block / hatched amber TEST block + Mandant */
.env {
  display: inline-flex;
  align-items: stretch;
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: var(--fs-xs);
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  border: 1px solid transparent;
}
.env__name { display: inline-flex; align-items: center; padding: 3px 6px; font-weight: 800; letter-spacing: 0.08em; }
.env__mandant { display: inline-flex; align-items: center; padding: 3px 6px; font-family: var(--font-mono); font-weight: 600; background: var(--surface); color: var(--text); font-variant-numeric: slashed-zero; }
.env--prod { border-color: var(--env-prod); }
.env--prod .env__name { background-color: var(--env-prod); background-image: repeating-linear-gradient(135deg, var(--env-prod-hatch) 0 4px, transparent 4px 8px); color: var(--env-prod-ink); }
.env--test { border-color: var(--env-test); }
.env--test .env__name { background-color: var(--env-test); background-image: repeating-linear-gradient(135deg, var(--env-hatch) 0 5px, transparent 5px 10px); color: var(--env-test-ink); }

/* Badges & chips */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 0 6px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.badge--mode { border-style: dashed; }
.badge--shadow { border-style: dotted; border-width: 2px; }
.badge--quiet { border-color: var(--border); color: var(--text-muted); font-weight: 600; letter-spacing: 0.04em; }
.badge--untrusted { border-color: var(--sev-warn); color: var(--sev-warn); background: var(--tint-warn); }
.badge--req { border-color: var(--sev-info); color: var(--sev-info); background: var(--tint-info); text-transform: none; letter-spacing: 0; font-weight: 600; }
.badge--demo { border-style: dashed; color: var(--text-muted); text-transform: none; letter-spacing: 0; font-weight: 600; white-space: normal; text-align: left; line-height: 1.3; padding-top: 2px; padding-bottom: 2px; }
/* "ready" — the next step is already prepared (drafted message, pending proposal): one gesture away */
.chip-ready { display: inline-flex; align-items: center; gap: 3px; min-height: 18px; padding: 0 5px; border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--state-done) 55%, var(--border)); color: var(--state-done); background: var(--tint-done); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.03em; white-space: nowrap; }
.chip-ready .icon { width: 11px; height: 11px; stroke-width: 2.2; }
/* Service-level chip (Control Tower header) */
.slachip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 32px; padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); font-size: var(--fs-sm); white-space: nowrap; }
.slachip b { font-size: var(--fs-lg); font-weight: 650; font-variant-numeric: tabular-nums; }
.slachip .glyph { color: var(--state-done); }
.slachip__fict { padding: 0 5px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }

/* Health word (tenant pipeline health) — the same four shapes as severity */
.health { display: inline-flex; align-items: center; gap: 6px; font-weight: 650; font-size: var(--fs-sm); white-space: nowrap; }
.health--ok { color: var(--state-done); }
.health--degraded { color: var(--sev-warn); }
.health--failing { color: var(--sev-crit); }
.health--onboarding { color: var(--state-intake); }
.health--paused { color: var(--state-neutral); }

/* Panels */
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
}
.panel__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.panel__head h2, .panel__head h3 { font-size: var(--fs-md); font-weight: 650; }
.panel__body { padding: var(--space-4); }
.panel__body--flush { padding: 0; }
.panel__foot { padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.panel--inset { background: var(--surface-2); }
.panel--crit { border-color: color-mix(in srgb, var(--sev-crit) 50%, var(--border)); box-shadow: inset 3px 0 0 var(--sev-crit); }
.panel--quiet { background: transparent; border-style: dashed; }

/* Key-value lists — the forensic record */
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 6px var(--space-4); font-size: var(--fs-md); }
.kv dt { color: var(--text-muted); font-size: var(--fs-sm); padding-top: 1px; }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kv--tight { gap: 3px var(--space-3); font-size: var(--fs-sm); }
.kv--cols { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--space-3) var(--space-5); }
.kv--cols > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kv--cols dt { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: var(--track-caps); font-weight: 600; }

/* KPI tiles — numbers first */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-5); }
.kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi__label { font-size: var(--fs-xs); font-weight: 600; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); }
.kpi__value { font-size: var(--fs-3xl); font-weight: 300; letter-spacing: -0.025em; line-height: 1.05; }
.kpi__value small { font-size: 0.45em; font-weight: 500; letter-spacing: 0; color: var(--text-muted); margin-left: 2px; }
.kpi__foot { font-size: var(--fs-sm); color: var(--text-muted); }

/* Tables — real <table>, sticky header, sticky first column, tabular numerals */
.tbl-wrap { position: relative; overflow: auto; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.tbl-wrap--bare { border: 0; border-radius: 0; background: transparent; }
.tbl-wrap--scroll { max-height: var(--maxh, 420px); }
.tbl { width: 100%; font-size: var(--fs-md); }
.tbl caption { text-align: left; padding: var(--space-3) var(--space-4); font-weight: 650; font-size: var(--fs-md); caption-side: top; }
.tbl th, .tbl td { padding: 7px var(--space-3); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--border); }
.tbl thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--fs-xs);
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}
.tbl tbody tr:hover > * { background: var(--surface-2); }
.tbl tbody tr:last-child > * { border-bottom: 0; }
.tbl .c-num, .tbl th.c-num { text-align: right; }
.tbl .c-mono { font-family: var(--font-mono); font-size: var(--fs-sm); }
.tbl .c-min { width: 1%; white-space: nowrap; }
.tbl--sticky-first tbody th, .tbl--sticky-first thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.tbl--sticky-first thead th:first-child { z-index: 3; background: var(--surface-2); }
.tbl--sticky-first tbody th { font-weight: 550; box-shadow: 1px 0 0 var(--border); }
.tbl--sticky-first tbody tr:hover > th { background: var(--surface-2); }
.tbl tbody th { font-weight: 550; text-align: left; }
.tbl--dense th, .tbl--dense td { padding: 5px var(--space-2); font-size: var(--fs-sm); }
.tbl .row--muted > * { color: var(--text-muted); }
.tbl .row--crit > :first-child { box-shadow: inset 3px 0 0 var(--sev-crit); }
.tbl .row--warn > :first-child { box-shadow: inset 3px 0 0 var(--sev-warn); }
.tbl .row--link { cursor: pointer; }
.tbl .row--insert > * { background: var(--surface-2); font-style: italic; }
.tbl .row--match > * { background: var(--tint-done); }
.sort { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
.sort .icon { width: 12px; height: 12px; opacity: 0.55; }
.sort .icon.is-asc { transform: rotate(180deg); }
th[aria-sort="ascending"] .sort .icon, th[aria-sort="descending"] .sort .icon { opacity: 1; }

/* Tabs */
.tabs { display: flex; gap: var(--space-4); border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tab {
  position: relative;
  min-height: 36px;
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--text-muted);
  font-size: var(--fs-md);
  font-weight: 600;
  white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); }
.tab[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand-fill); }
.tab__count { margin-left: 6px; padding: 0 6px; border-radius: var(--radius-pill); background: var(--surface-3); font-size: var(--fs-xs); color: var(--text); font-variant-numeric: tabular-nums; }

/* Disclosure sections (collapse rather than hide) */
.disc { border-top: 1px solid var(--text); }
.disc__head { display: flex; align-items: baseline; gap: var(--space-3); padding: var(--space-3) 0 var(--space-2); }
.disc__btn {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-3);
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  min-width: 0;
}
.disc__btn .icon { width: 14px; height: 14px; transition: transform var(--dur-2) var(--ease); align-self: center; color: var(--text-muted); }
.disc__btn[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.disc__no { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums slashed-zero; }
.disc__title { font-size: var(--fs-lg); font-weight: 650; }
.disc__meta { margin-left: auto; color: var(--text-muted); font-size: var(--fs-sm); text-align: right; }
.disc__body { padding: var(--space-2) 0 var(--space-5); }

/* Notices / callouts */
.note {
  --_c: var(--sev-info);
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-left: 3px solid var(--_c);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--fs-md);
}
.note .icon { color: var(--_c); margin-top: 1px; }
.note--crit { --_c: var(--sev-crit); background: var(--tint-crit); }
.note--warn { --_c: var(--sev-warn); background: var(--tint-warn); }
.note--done { --_c: var(--state-done); background: var(--tint-done); }
.note--info { --_c: var(--sev-info); background: var(--tint-info); }
.note--neutral { --_c: var(--border-strong); }
.note__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.note__title { font-weight: 650; }

/* Untrusted frame — agent-written text shown verbatim, never styled as ours */
.untrusted {
  position: relative;
  padding: var(--space-3) var(--space-4) var(--space-3);
  border: 1px dashed var(--sev-warn);
  border-radius: var(--radius);
  background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in srgb, var(--sev-warn) 6%, transparent) 10px 20px), var(--surface);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.untrusted__label { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); font-family: var(--font-sans); }

/* Hash (approval hash / audit chain) */
.hash { font-family: var(--font-mono); font-size: var(--fs-sm); letter-spacing: 0.02em; font-variant-numeric: slashed-zero; }
.hash__dim { color: var(--text-muted); }
.chain { display: inline-flex; align-items: baseline; gap: 6px; }
.chain__link { color: var(--text-muted); }

/* Countdown & live age */
.countdown { font-family: var(--font-mono); font-weight: 650; letter-spacing: 0.01em; white-space: nowrap; }
.countdown--crit { color: var(--sev-crit); }
.countdown--done { color: var(--text-muted); }
.age { color: var(--text-muted); font-size: var(--fs-sm); white-space: nowrap; }
.time { white-space: nowrap; }
.time__utc { color: var(--text-muted); font-size: var(--fs-xs); margin-left: 4px; }

/* Code (WA record XML) — field order preserved; PII masked until an audited reveal */
.code {
  margin: 0;
  padding: var(--space-3) 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.6;
  overflow: auto;
  counter-reset: ln;
  max-height: 520px;
}
.code__line { display: block; padding: 0 var(--space-4) 0 0; white-space: pre; }
.code__line::before {
  counter-increment: ln;
  content: counter(ln);
  display: inline-block;
  width: 3.4em;
  margin-right: var(--space-3);
  padding-right: var(--space-2);
  text-align: right;
  color: var(--text-muted);
  border-right: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
.code--plain { padding: var(--space-3) var(--space-4); white-space: pre-wrap; counter-reset: none; line-height: 1.55; }
.tok-pi { color: var(--text-muted); }
.tok-tag { color: var(--state-flow); }
.tok-val { color: var(--text); font-weight: 600; }
.tok-pii { color: var(--text-muted); letter-spacing: 0.08em; }
.code__line--pii { background: color-mix(in srgb, var(--sev-warn) 8%, transparent); }

/* Unit strips — counts shown as countable units, never as a gauge */
.units { display: flex; flex-wrap: wrap; gap: 3px; }
.unit { width: 12px; height: 12px; border-radius: 1px; background: var(--surface-3); border: 1px solid var(--border-strong); }
.unit--have, .unit--green { background: var(--state-done); border-color: var(--state-done); }
.unit--missing { background: transparent; border: 1.5px dashed var(--sev-crit); }
.unit--risk { background: transparent; border: 1.5px dashed var(--sev-warn); }
.unit--send { background: var(--state-flow); border-color: var(--state-flow); }
.unit--hold, .unit--amber { background: var(--sev-warn); border-color: var(--sev-warn); }
.unit--route { background: var(--state-neutral); border-color: var(--state-neutral); }
.unit--wait { background: transparent; border-color: var(--state-attention); border-width: 2px; }
.unit--red { background: var(--sev-crit); border-color: var(--sev-crit); }
.unit--legend-received { background: transparent; border: 1px solid var(--text-muted); }
.unit--legend-sent { background: var(--ink-2); border-color: var(--ink-2); }
.unit--legend-shipped { background: var(--state-done); border-color: var(--state-done); }
.unit--lg { width: 18px; height: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); font-size: var(--fs-sm); color: var(--text-muted); }
.legend__item { display: inline-flex; align-items: center; gap: 6px; }

/* Micro-bars — per-shop in / sent / shipped, one scale per tile */
.mbars { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 3px var(--space-2); align-items: center; margin: 0; font-size: var(--fs-xs); }
.mbars dt { color: var(--text-muted); white-space: nowrap; }
.mbars dd { margin: 0; display: contents; }
.mbar__track { position: relative; height: 6px; background: var(--surface-3); border-radius: 1px; overflow: hidden; }
.mbar__fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0%); background: var(--ink-2); border-radius: 1px; }
.mbar__fill--in { background: transparent; box-shadow: inset 0 0 0 1px var(--text-muted); }
.mbar__fill--ship { background: var(--state-done); }
.mbar__n { text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); min-width: 2ch; }

/* Bullet bar — actual vs target */
.bullet { position: relative; height: 8px; background: var(--surface-3); border-radius: 1px; }
.bullet__bar { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w, 0%); background: var(--ink-2); border-radius: 1px; }
.bullet__target { position: absolute; top: -4px; bottom: -4px; left: var(--t, 100%); width: 2px; background: var(--text); }
.bullet--done .bullet__bar { background: var(--state-done); }

/* Progress (determinate, e.g. demo scenario) */
.progress { height: 3px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.progress__bar { height: 100%; width: var(--p, 0%); background: var(--brand-fill); transition: width var(--dur-2) linear; }

/* Empty, loading and error states — honest emptiness */
.empty { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); padding: var(--space-7) var(--space-6); }
.empty__big { font-size: var(--fs-5xl); font-weight: 200; line-height: 0.9; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.empty__title { font-size: var(--fs-xl); font-weight: 650; }
.empty__text { color: var(--text-muted); max-width: 56ch; }
.skel { display: flex; flex-direction: column; gap: 10px; padding: var(--space-4); }
.skel__line {
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--surface-3) 0%, var(--surface-2) 40%, var(--surface-3) 80%);
  background-size: 300% 100%;
  animation: skel 1.4s var(--ease) infinite;
}
.skel__line:nth-child(2) { width: 82%; } .skel__line:nth-child(3) { width: 64%; } .skel__line:nth-child(4) { width: 72%; }
@keyframes skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.error-state { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-left: 3px solid var(--sev-crit); border-radius: var(--radius); background: var(--surface); }
.error-state__title { font-weight: 650; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Copy field */
.copy {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}
.copy__val { flex: 1; min-width: 0; padding: 6px var(--space-3); font-family: var(--font-mono); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.copy .btn { border: 0; border-left: 1px solid var(--border); border-radius: 0; min-height: 0; }

/* Event stream (vertical) */
.events { display: flex; flex-direction: column; }
.event {
  position: relative;
  display: grid;
  grid-template-columns: 92px 18px minmax(0, 1fr);
  gap: var(--space-2);
  padding: 6px 0;
}
.event::before { content: ""; position: absolute; left: 100px; top: 0; bottom: 0; width: 1px; background: var(--border); }
.event:first-child::before { top: 14px; }
.event:last-child::before { bottom: calc(100% - 14px); }
.event__time { text-align: right; font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); padding-top: 3px; font-variant-numeric: tabular-nums; line-height: 1.35; }
.event__node { position: relative; z-index: 1; display: grid; place-items: start center; padding-top: 5px; }
.event__node .glyph { background: var(--bg); box-shadow: 0 0 0 3px var(--bg); border-radius: 50%; }
.event__body { min-width: 0; font-size: var(--fs-md); }
.event__title { font-weight: 600; }
.event__data { color: var(--text-muted); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.event__data code { font-size: var(--fs-xs); }
.event--new { animation: flash-in 1.2s var(--ease-out); }
.event--crit .event__title { color: var(--sev-crit); }

/* Evidence checklist (monospace, exact timestamps) — the forensic proof behind every card and timeline */
.evl { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); font-family: var(--font-mono); font-size: var(--fs-sm); font-variant-numeric: tabular-nums slashed-zero; }
.evl__row { display: grid; grid-template-columns: 16px 76px minmax(0, 1fr); gap: var(--space-2); align-items: baseline; padding: 5px var(--space-3); border-top: 1px dotted var(--border); }
.evl__row:first-child { border-top: 0; }
.evl__mark { font-family: var(--font-sans); font-weight: 800; text-align: center; }
.evl__at { color: var(--text-muted); white-space: nowrap; }
.evl__txt { min-width: 0; overflow-wrap: anywhere; }
.evl__row--ok .evl__mark { color: var(--state-done); }
.evl__row--bad .evl__mark, .evl__row--bad .evl__txt { color: var(--sev-crit); }
.evl__row--bad .evl__txt { font-weight: 650; }
.evl__row--open .evl__mark { color: var(--text-muted); }
.evl__row--open .evl__txt { color: var(--text-muted); }

/* One-sentence summary (merchant home, auditor, wall, showreel) — derived from the same selector as the verdict board */
.sentence { font-size: 22px; line-height: 1.35; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; max-width: 72ch; }
.sentence b { font-weight: 700; }
.sentence__crit { color: var(--sev-crit); font-weight: 700; }
.sentence__warn { color: var(--sev-warn); font-weight: 650; }
.sentence__ok { color: var(--state-done); font-weight: 700; }
.sentence__flow { color: var(--state-flow); font-weight: 650; }
.sentence .glyph { display: inline-block; vertical-align: 0.05em; margin-right: 4px; }
.sentence .countdown { font-size: inherit; }
.sentence--lg { font-size: 28px; line-height: 1.28; }
.sentence--sm { font-size: var(--fs-lg); font-weight: 500; }

/* Summary strip — a row of labelled facts (onboarding progress, scale preview) */
.sumstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sumstrip__cell { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-4); border-left: 1px solid var(--border); min-width: 0; }
.sumstrip__cell:first-child { border-left: 0; }
.sumstrip__v { font-size: var(--fs-xl); font-weight: 400; font-variant-numeric: tabular-nums; line-height: 1.2; white-space: nowrap; }
.sumstrip__v small { font-size: var(--fs-sm); color: var(--text-muted); font-weight: 500; }
.sumstrip__cell--crit .sumstrip__v { color: var(--sev-crit); font-weight: 600; }
.sumstrip__cell--done .sumstrip__v { color: var(--state-done); }

/* 7 ─ Domain components ─────────────────────────────────────────────────────────────────────────────────────────── */

/* Verdict board — the five-second answer as a departure board (fire? where? flowing? next?) */
.verdict { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.verdict__rows { display: flex; flex-direction: column; }
.verdict__row {
  display: grid;
  grid-template-columns: minmax(180px, 224px) minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--space-4);
  min-height: 50px;
  padding: var(--space-2) var(--space-4) var(--space-2) var(--space-5);
  border-top: 1px solid var(--border);
  position: relative;
}
.verdict__row:first-child { border-top: 0; }
.verdict__word { display: flex; align-items: center; gap: 10px; font-size: var(--fs-lg); font-weight: 700; letter-spacing: -0.005em; white-space: nowrap; }
.verdict__detail { font-size: var(--fs-lg); line-height: 1.35; min-width: 0; text-wrap: pretty; }
.verdict__detail b { font-weight: 650; }
.verdict__meta { display: flex; align-items: baseline; gap: var(--space-2); white-space: nowrap; }
.verdict__meta .countdown { font-size: var(--fs-xl); }
.verdict__action:empty, .verdict__meta:empty { display: none; }
.verdict__row--crit { background: linear-gradient(90deg, var(--tint-crit), transparent 70%); }
.verdict__row--crit::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sev-crit); }
.verdict__row--crit .verdict__word { color: var(--sev-crit); }
.verdict__row--crit-soft::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--sev-crit); opacity: 0.55; }
.verdict__row--crit-soft .verdict__word { color: var(--sev-crit); }
.verdict__row--waiting .verdict__word { color: var(--state-attention); }
.verdict__row--done .verdict__word { color: var(--state-done); }
.verdict__row--flow .verdict__word { color: var(--state-flow); }
.verdict__row--neutral .verdict__word { color: var(--text); }
.verdict__row--neutral .verdict__word .icon { color: var(--text-muted); }

/* Heartbeat — silence is a signal: every "last X" carries its age AND its expected rhythm */
.heartbeat { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.heartbeat__list { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.hb { display: flex; flex-direction: column; gap: 1px; padding: var(--space-2) var(--space-3); border-left: 1px solid var(--border); min-width: 0; }
.hb:first-child { border-left: 0; padding-left: 0; }
.hb__label { display: flex; align-items: center; gap: 6px; }
.hb--ok .hb__label .glyph { color: var(--state-done); }
.hb--bad .hb__label .glyph { color: var(--sev-high); }
.hb--bad .hb__value { color: var(--sev-high); font-weight: 650; }
.hb__value { font-size: var(--fs-md); font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb__value .age { font-size: inherit; color: inherit; }
.hb__exp { font-size: var(--fs-xs); color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hb__exp b { color: var(--text); font-weight: 600; }

/* The loop — shop → LagerLink → SFTP → warehouse and back. Sent ≠ picked up ≠ shipped, drawn as separate facts.
   Nodes are stations (kicker, name, one number); the segments between them carry the counts; the back lane runs
   underneath in the done colour. Numerals: 28 px on the desk, 52 px on the wall (--fs-flow). */
.loop { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.loop__grid {
  display: grid;
  grid-template-columns: minmax(92px, 0.85fr) minmax(96px, 1.15fr) minmax(92px, 0.85fr) minmax(96px, 1.15fr) minmax(92px, 0.85fr) minmax(96px, 1.15fr) minmax(92px, 0.85fr);
  grid-template-rows: auto auto;
  column-gap: 0;
  row-gap: var(--space-1);
  align-items: stretch;
}
.loop__node {
  grid-row: 1 / 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: var(--space-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  min-width: 0;
  position: relative;
  z-index: 1;
}
.loop__node--llk { border-width: 2px; border-color: var(--text); }
.loop__node--wms { background: var(--surface-2); }
.loop__node--bad { border-color: var(--sev-crit); box-shadow: inset 0 0 0 1px var(--sev-crit); }
.loop__kicker { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); overflow-wrap: anywhere; -webkit-hyphens: auto; hyphens: auto; }
.loop__name { font-weight: 650; font-size: var(--fs-md); line-height: 1.25; overflow-wrap: anywhere; }
.loop__big { font-size: var(--fs-flow); font-weight: 300; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.loop__sub { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.3; }
.loop__path { font-family: var(--font-mono); font-variant-numeric: slashed-zero; }
.loop__seg {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  padding: 2px 6px 13px;
  text-align: center;
  line-height: 1.25;
}
.loop__seg::before { content: ""; position: absolute; left: 0; right: 7px; bottom: 5px; height: 2px; background: var(--text); }
.loop__seg::after { content: ""; position: absolute; right: 0; bottom: 1px; border: 5px solid transparent; border-left: 8px solid var(--text); border-right: 0; }
.loop__seg--out { grid-row: 1; }
.loop__seg--back { grid-row: 2; justify-content: flex-start; padding: 13px 6px 2px; }
.loop__seg--back::before { left: 7px; right: 0; top: 5px; bottom: auto; background: var(--state-done); }
.loop__seg--back::after { left: 0; right: auto; top: 1px; bottom: auto; border-left: 0; border-right: 8px solid var(--state-done); }
.loop__seg--failing::before { background: repeating-linear-gradient(90deg, var(--sev-crit) 0 6px, transparent 6px 10px); }
.loop__seg--failing::after { border-left-color: var(--sev-crit); }
.loop__c1 { grid-column: 1; } .loop__c2 { grid-column: 2; } .loop__c3 { grid-column: 3; } .loop__c4 { grid-column: 4; }
.loop__c5 { grid-column: 5; } .loop__c6 { grid-column: 6; } .loop__c7 { grid-column: 7; }
.loop__n { font-size: var(--fs-flow); font-weight: 300; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.loop__seg--back .loop__n { color: var(--state-done); }
.loop__label { font-size: var(--fs-sm); font-weight: 650; }
.loop__wire { font-family: var(--font-mono); font-size: var(--fs-2xs); color: var(--text-muted); letter-spacing: -0.01em; }
.loop__note { font-size: var(--fs-2xs); font-weight: 650; }
.loop__note--warn { color: var(--sev-warn); }
.loop__note--crit { color: var(--sev-crit); }
.loop__note--flow { color: var(--state-flow); }
.loop__token { position: absolute; left: var(--x, 60%); bottom: 1px; z-index: 2; width: 11px; height: 11px; transform: translateX(-50%); border-radius: 2px; background: var(--state-flow); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--state-flow); }
.loop__token--new { animation: token-pop 1s var(--ease-out); }
@keyframes token-pop { 0% { left: 6%; opacity: 0.2; } 100% { left: var(--x, 60%); opacity: 1; } }
.loop__exits { display: flex; flex-wrap: wrap; gap: 2px var(--space-3); font-size: var(--fs-sm); color: var(--text-muted); }
.loop__exits b { color: var(--text); font-variant-numeric: tabular-nums; }
.loop__exits .is-attn, .loop__exits .is-attn b { color: var(--sev-warn); }
.loop__caption { font-size: var(--fs-sm); color: var(--text-muted); max-width: 120ch; }
/* The funnel adds up: two reconciled equations under the loop (auditors add these up). */
.loop__recon { display: grid; gap: 2px; margin: 0; padding: var(--space-2) var(--space-3); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); background: var(--surface-2); font-size: var(--fs-sm); }
.loop__recon > div { display: grid; grid-template-columns: minmax(150px, max-content) minmax(0, 1fr); gap: var(--space-3); align-items: baseline; }
.loop__recon dt { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); }
.loop__recon dd { margin: 0; font-variant-numeric: tabular-nums; min-width: 0; }

/* Rhythm of the day — expected vs arrived; silence drawn as hatched gaps ("silence is a signal") */
.rhythm { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.rhythm__head { display: flex; align-items: baseline; gap: var(--space-3); flex-wrap: wrap; }
.rhythm__head b { font-size: var(--fs-md); font-weight: 650; }
.rhythm__plot { display: grid; grid-template-columns: 74px minmax(0, 1fr); row-gap: 6px; column-gap: var(--space-3); align-items: center; }
.rhythm__label { font-size: var(--fs-xs); color: var(--text-muted); text-align: right; white-space: nowrap; }
.rhythm__track { position: relative; height: 18px; border-radius: var(--radius-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.rhythm__mark { position: absolute; top: 50%; left: var(--x, 0%); transform: translate(-50%, -50%); width: 12px; height: 12px; border-radius: 50%; background: var(--state-done); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--state-done); }
.rhythm__mark--due { background: var(--surface); border: 2px dashed var(--state-flow); box-shadow: none; }
.rhythm__mark--missed { background: var(--sev-crit); box-shadow: 0 0 0 1px var(--sev-crit); }
.rhythm__mark--sm { width: 8px; height: 8px; border-width: 1px; }
.rhythm__tick { position: absolute; top: 3px; bottom: 3px; left: var(--x, 0%); width: 1px; background: var(--border-strong); opacity: 0.55; }
.rhythm__gap { position: absolute; top: 2px; bottom: 2px; left: var(--from, 0%); width: var(--w, 0%); min-width: 3px; border-radius: 2px; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--sev-crit) 70%, transparent) 0 4px, transparent 4px 8px); box-shadow: inset 0 0 0 1px var(--sev-crit); }
.rhythm__gap--healed { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--state-neutral) 55%, transparent) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--border-strong); }
.rhythm__gap--paused { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--state-neutral) 40%, transparent) 0 2px, transparent 2px 6px); box-shadow: inset 0 0 0 1px var(--border); }
.rhythm__gaplabel { position: absolute; top: 50%; left: calc(var(--from, 0%) + 4px); transform: translateY(-50%); font-size: 10px; font-weight: 700; color: var(--sev-crit); white-space: nowrap; background: var(--surface-2); padding: 0 3px; border-radius: 2px; }
.rhythm__now { position: absolute; top: -3px; bottom: -3px; left: var(--x, 0%); width: 2px; background: var(--text); }
.rhythm__axis { grid-column: 2; position: relative; height: 14px; }
.rhythm__axis span { position: absolute; left: var(--x, 0%); transform: translateX(-50%); font-size: 10px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rhythm__axis .rhythm__axis-now { color: var(--text); font-weight: 700; }
.rhythm__legend { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-xs); color: var(--text-muted); }
.rhythm__legend li { display: flex; align-items: baseline; gap: var(--space-2); }
.rhythm__key { flex: none; display: inline-block; width: 18px; height: 9px; border-radius: 2px; }
.rhythm__key--gap { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--sev-crit) 70%, transparent) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--sev-crit); }
.rhythm__key--healed { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--state-neutral) 55%, transparent) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--border-strong); }
.rhythm__key--paused { background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--state-neutral) 40%, transparent) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--border); }

/* Live file protocol — every tick is a file (DATA_UPLOADED, INSERT_HELD, CONSUMED …) */
.plog { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.plog__row { display: grid; grid-template-columns: 62px 14px minmax(0, 1fr); gap: var(--space-2); align-items: baseline; padding: 4px 0; border-top: 1px dotted var(--border); font-size: var(--fs-sm); }
.plog__row:first-child { border-top: 0; }
.plog__at { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); font-variant-numeric: tabular-nums; }
.plog__dir { font-weight: 800; color: var(--text-muted); text-align: center; }
.plog__dir--out { color: var(--state-flow); }
.plog__dir--in { color: var(--state-done); }
.plog__main { min-width: 0; display: flex; flex-direction: column; }
.plog__what { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plog__file { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: slashed-zero; }
.plog__step { font-family: var(--font-mono); font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.02em; }
.plog__row--new { animation: flash-in 1.2s var(--ease-out); }

/* Attention list (Control Tower) — one row per kind; the number is ITEMS (it sums to the inbox total) */
.attlist { display: flex; flex-direction: column; }
.attlist__row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto 28px 14px;
  align-items: center;
  gap: var(--space-2);
  min-height: 32px;
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  text-decoration: none;
  font-size: var(--fs-md);
}
.attlist__row:hover { background: var(--surface-2); text-decoration: none; }
.attlist__row .icon { color: var(--text-muted); }
.attlist__row--crit { background: var(--tint-crit); font-weight: 650; }
.attlist__row--crit:hover { background: var(--tint-crit); box-shadow: inset 0 0 0 1px var(--sev-crit); }
.attlist__row--crit .glyph { color: var(--sev-crit); }
.attlist__row--high .glyph { color: var(--sev-high); }
.attlist__row--warn .glyph { color: var(--sev-warn); }
.attlist__row--info .glyph { color: var(--sev-info); }
/* Titles wrap to two lines instead of truncating (German labels are long); the critical row never truncates. */
.attlist__label { min-width: 0; line-height: 1.25; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; padding-block: 3px; }
.attlist__row--crit .attlist__label { -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.attlist__n { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.attlist__extra { white-space: nowrap; font-size: var(--fs-xs); color: var(--text-muted); }
.attlist__extra .countdown { font-size: var(--fs-sm); }
.attwait { margin-top: var(--space-3); padding: var(--space-2); border-top: 1px dashed var(--border-strong); display: flex; flex-direction: column; gap: 4px; }
.attwait__row { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; font-size: var(--fs-sm); color: var(--text); text-decoration: none; }
.attwait__row .glyph { color: var(--state-attention); }

/* Live activity ticker */
.ticker { display: flex; flex-direction: column; gap: 6px; }
.ticker__row { display: grid; grid-template-columns: 62px 12px minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
.ticker__row .glyph { color: var(--state-flow); transform: translateY(1px); }

/* Shop tiles — pipeline health first; open alerts next to it, never folded in */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: var(--space-3); }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-3) var(--space-4) var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.tile:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.tile:focus-within { border-color: var(--focus); }
.tile--failing { box-shadow: inset 4px 0 0 var(--sev-crit); border-color: color-mix(in srgb, var(--sev-crit) 40%, var(--border)); }
.tile--failing:hover { box-shadow: inset 4px 0 0 var(--sev-crit), var(--shadow-2); }
.tile--degraded { box-shadow: inset 4px 0 0 var(--sev-warn); }
.tile--degraded:hover { box-shadow: inset 4px 0 0 var(--sev-warn), var(--shadow-2); }
.tile--onboarding { border-style: dashed; border-color: var(--border-strong); background: var(--surface-2); }
.tile--summary { justify-content: center; align-items: flex-start; background: var(--surface-2); border-style: dashed; }
.tile__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.tile__top > .env { flex: none; }
.tile__health { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.tile__name { font-size: var(--fs-lg); font-weight: 650; line-height: 1.25; margin-top: 2px; }
.tile__open { padding: 0; border: 0; background: none; text-align: left; font: inherit; color: inherit; }
.tile__open::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.tile__open:focus-visible { outline: none; }
.tile__open:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 2px; }
.tile__city { font-size: var(--fs-xs); color: var(--text-muted); margin-top: -4px; }
.tile__reason { font-size: var(--fs-sm); line-height: 1.4; min-height: 2.8em; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile__reason--crit { color: var(--sev-crit); font-weight: 550; }
.tile__reason--quiet { color: var(--text-muted); }
.tile { container-type: inline-size; }
.tile__facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px var(--space-2); margin: 2px 0 0; padding-top: var(--space-2); border-top: 1px solid var(--border); }
@container (max-width: 300px) { .tile__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile__reason .glyph { display: inline-block; vertical-align: -1px; margin-right: 4px; }
.tile__facts > div { min-width: 0; }
.tile__facts dt { font-size: var(--fs-2xs); font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__facts dd { margin: 0; font-size: var(--fs-sm); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile__facts .is-bad { color: var(--sev-crit); }
.tile__facts .is-warn { color: var(--sev-warn); }
.tile__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); font-size: var(--fs-xs); color: var(--text-muted); padding-top: var(--space-1); }
.tile__alerts { display: inline-flex; gap: var(--space-2); position: relative; z-index: 1; }
.acount { display: inline-flex; align-items: center; gap: 3px; font-weight: 700; font-variant-numeric: tabular-nums; font-size: var(--fs-sm); }
.acount--zero { color: var(--text-muted); font-weight: 500; opacity: 0.8; }
.acount--crit { color: var(--sev-crit); }
.acount--high { color: var(--sev-high); }
.acount--warn { color: var(--sev-warn); }
.acount--info { color: var(--sev-info); }

/* Shop table — the 80-merchant mode: dense, sortable, problems first */
.shoptbl .c-shop { min-width: 220px; }
.shoptbl .shop-cell { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; }
.shoptbl .shop-cell .linkbtn { text-align: left; white-space: nowrap; font-weight: 600; }
.shoptbl .shop-cell small { color: var(--text-muted); font-size: var(--fs-xs); }
.shoptbl .mbar__track { width: 64px; display: inline-block; vertical-align: middle; }
.shoptbl .is-bad { color: var(--sev-crit); font-weight: 650; }
.shoptbl .is-warn { color: var(--sev-warn); font-weight: 650; }
.shops-filter { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.shops-filter__q { width: 260px; }
.shops-filter__q .input { background: var(--surface); }

/* File exchange — the SFTP directory as a two-way pipe */
.pipes { display: flex; flex-direction: column; gap: var(--space-3); }
.pipe { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.pipe--failing { border-color: var(--sev-crit); box-shadow: inset 4px 0 0 var(--sev-crit); }
.pipe--test, .pipe--legacy { background: var(--surface-2); }
.pipe__head { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.pipe__note { font-size: var(--fs-sm); color: var(--text-muted); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pipe__note--healed .glyph { color: var(--state-done); }
.lane { display: grid; grid-template-columns: 170px minmax(240px, 1.1fr) minmax(0, 1.6fr); gap: var(--space-4); align-items: center; min-height: 38px; }
.lane__label { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.lane__arrow { font-weight: 700; font-size: var(--fs-lg); line-height: 1; width: 14px; }
.lane__track { position: relative; height: 26px; margin: 0 var(--space-2); }
.lane__track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 2px; transform: translateY(-50%); background: repeating-linear-gradient(90deg, var(--border-strong) 0 6px, transparent 6px 10px); }
.lane--out .lane__track::after { content: ""; position: absolute; right: -2px; top: 50%; border: 5px solid transparent; border-left: 7px solid var(--border-strong); transform: translate(6px, -50%); }
.lane--in .lane__track::after { content: ""; position: absolute; left: -2px; top: 50%; border: 5px solid transparent; border-right: 7px solid var(--border-strong); transform: translate(-12px, -50%); }
.lane__node { position: absolute; top: 50%; transform: translate(-50%, -50%); padding: 1px 5px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); white-space: nowrap; z-index: 1; }
.pipe--test .lane__node, .pipe--legacy .lane__node { background: var(--surface-2); }
.lane__node--a { left: 0; transform: translate(0, -50%); }
.lane__node--b { left: 50%; }
.lane__node--c { right: 0; left: auto; transform: translate(0, -50%); }
.lane--failing .lane__track::before { background: repeating-linear-gradient(90deg, var(--sev-crit) 0 6px, transparent 6px 10px); }
.lane__stop { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); color: var(--sev-crit); z-index: 2; }
.lane__stop .glyph { width: 14px; height: 14px; }
.lane__stats { color: var(--text-muted); min-width: 0; }
.lane__stats span:not(.lane__dot):first-of-type { color: var(--text); font-weight: 600; }
.token {
  position: absolute;
  top: 50%;
  left: var(--x, 50%);
  z-index: 2;
  width: 12px; height: 12px;
  transform: translate(-50%, -50%);
  background: var(--state-flow);
  border: 2px solid var(--surface);
  border-radius: 2px;
  box-shadow: 0 0 0 1px var(--state-flow);
  transition: left 900ms var(--ease);
}
.token--in { background: var(--state-done); box-shadow: 0 0 0 1px var(--state-done); }
.token__label { position: absolute; left: 50%; bottom: calc(100% + 5px); transform: translateX(-50%); font-family: var(--font-mono); font-size: 9.5px; color: var(--text-muted); white-space: nowrap; }
.token--new { animation: token-travel 1.1s var(--ease-out); }
@keyframes token-travel { from { left: 4%; opacity: 0.2; } to { left: var(--x, 50%); opacity: 1; } }
.lane--in .token--new { animation-name: token-travel-in; }
@keyframes token-travel-in { from { left: 96%; opacity: 0.2; } to { left: var(--x, 50%); opacity: 1; } }
.al-title { display: flex; flex-direction: column; gap: 1px; min-width: 240px; }

/* Severity summary (inbox header) */
.sevsum { display: flex; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.sevsum__cell { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) var(--space-4); border-left: 1px solid var(--border); min-width: 88px; }
.sevsum__cell:first-child { border-left: 0; }
.sevsum__n { font-size: var(--fs-2xl); font-weight: 300; line-height: 1; font-variant-numeric: tabular-nums; }
.sevsum__l { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); white-space: nowrap; }
.sevsum__cell--crit .sevsum__n, .sevsum__cell--crit .glyph { color: var(--sev-crit); }
.sevsum__cell--crit:not(.is-zero) { background: var(--tint-crit); }
.sevsum__cell--high .glyph { color: var(--sev-high); }
.sevsum__cell--warn .glyph { color: var(--sev-warn); }
.sevsum__cell--info .glyph { color: var(--sev-info); }
.sevsum__cell--wait .glyph { color: var(--state-attention); }
.sevsum__cell.is-zero .sevsum__n { color: var(--text-muted); }

/* Inbox list — rows grouped by severity; causes grouped (children are sub-lines, never separate decisions) */
.ilist { display: flex; flex-direction: column; gap: var(--space-3); }
.ilist__group { display: flex; flex-direction: column; }
.ilist__head { display: flex; align-items: center; gap: 6px; padding: 0 var(--space-2) var(--space-1); font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.ilist__head--crit { color: var(--sev-crit); }
.ilist__head--crit .glyph { color: var(--sev-crit); }
.ilist__head--high .glyph { color: var(--sev-high); }
.ilist__head--warn .glyph { color: var(--sev-warn); }
.ilist__head--info .glyph { color: var(--sev-info); }
.ilist__count { margin-left: auto; font-variant-numeric: tabular-nums; }
.ilist__more { position: sticky; bottom: 0; align-self: center; z-index: 2; display: inline-flex; align-items: center; gap: var(--space-2); margin-top: var(--space-2); padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface); box-shadow: var(--shadow-2); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.ilist__more:hover { background: var(--surface-2); }
.irow { display: grid; grid-template-columns: 26px minmax(0, 1fr); align-items: center; border-bottom: 1px solid var(--border); position: relative; }
.irow__cb { justify-self: center; width: 16px; height: 16px; margin: 0; accent-color: var(--brand-fill); }
.irow__cb--none { width: 16px; height: 16px; }
.irow__btn { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: var(--space-2); align-items: center; width: 100%; min-height: 48px; padding: 6px var(--space-2) 6px 4px; border: 0; background: transparent; text-align: left; border-radius: var(--radius-sm); color: var(--text); }
.irow__btn:hover { background: var(--surface-2); }
.irow--sel .irow__btn { background: var(--surface); box-shadow: inset 3px 0 0 var(--text), 0 0 0 1px var(--border-strong); }
.irow--waiting .irow__title, .irow--acked .irow__title, .irow--snoozed .irow__title, .irow--done .irow__title { color: var(--text-muted); }
.irow__sev--crit { color: var(--sev-crit); }
.irow__sev--high { color: var(--sev-high); }
.irow__sev--warn { color: var(--sev-warn); }
.irow__sev--info { color: var(--sev-info); }
.irow__sev--waiting { color: var(--state-attention); }
.irow__main { display: flex; flex-direction: column; min-width: 0; }
.irow__title { display: flex; align-items: center; gap: 6px; font-size: var(--fs-md); font-weight: 600; min-width: 0; }
/* The cause is never cut off: titles take up to two lines (critical ones any number); the «ready» chip sits on the
   meta line; the age column is compact («23 h», full age on hover). */
.irow__title > span:first-child { min-width: 0; line-height: 1.3; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.irow--crit .irow__title > span:first-child { -webkit-line-clamp: unset; line-clamp: none; overflow: visible; }
.irow__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; margin-top: 1px; font-size: var(--fs-xs); color: var(--text-muted); min-width: 0; }
.irow__meta > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.irow__meta .mono { font-size: 1em; }
.irow__kids { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; padding-left: 10px; border-left: 1px solid var(--border-strong); font-size: var(--fs-xs); color: var(--text-muted); }
.irow__right { font-size: var(--fs-xs); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.irow__right .countdown { font-size: var(--fs-md); }

/* Attention card (inbox detail) — What happened / Why it matters / Suggested next step (prepared), then the facts */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); display: flex; flex-direction: column; }
.card--crit { border-color: color-mix(in srgb, var(--sev-crit) 45%, var(--border)); box-shadow: inset 4px 0 0 var(--sev-crit); }
.card--high { box-shadow: inset 4px 0 0 var(--sev-high); }
.card--warn { box-shadow: inset 4px 0 0 var(--sev-warn); }
.card--info { box-shadow: inset 4px 0 0 var(--sev-info); }
.card--waiting { border-color: var(--border); box-shadow: inset 4px 0 0 var(--state-attention); }
.card--done { box-shadow: inset 4px 0 0 var(--state-done); }
.card__head { padding: var(--space-4) var(--space-5) var(--space-3) var(--space-6); border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: var(--space-2); }
.card__kicker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.card__title { font-size: var(--fs-2xl); font-weight: 650; line-height: 1.15; letter-spacing: -0.015em; text-wrap: balance; }
.card--crit .card__title { color: var(--sev-crit); }
.card__ctx { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); font-size: var(--fs-md); }
.card__body { padding: var(--space-4) var(--space-5) var(--space-4) var(--space-6); display: flex; flex-direction: column; gap: var(--space-4); }
.card__without { margin: 0 var(--space-5) var(--space-4) var(--space-6); padding: var(--space-2) var(--space-3); border-left: 2px solid var(--border-strong); color: var(--text-muted); font-size: var(--fs-md); background: var(--surface-2); }
.card__actions { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; padding: var(--space-3) var(--space-5) var(--space-3) var(--space-6); border-top: 1px solid var(--border); background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(6px); border-radius: 0 0 var(--radius) var(--radius); }
.card__split { display: flex; gap: var(--space-6); align-items: flex-start; flex-wrap: wrap; }
.anat { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0; margin: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.anat dt, .anat dd { margin: 0; padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border); }
.anat dt:first-of-type, .anat dt:first-of-type + dd { border-top: 0; }
.anat dt { background: var(--surface-2); font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); padding-top: calc(var(--space-2) + 2px); }
.anat dd { font-size: var(--fs-base); line-height: 1.45; text-wrap: pretty; max-width: 92ch; }
.anat__next { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.anat__next .chip-ready { align-self: center; }
.deadline { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); border: 1px solid color-mix(in srgb, var(--sev-crit) 50%, var(--border)); border-radius: var(--radius); background: var(--tint-crit); min-width: 200px; }
.deadline__n .countdown { font-size: var(--fs-4xl); font-weight: 300; letter-spacing: -0.03em; line-height: 1; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.deadline__l { font-size: var(--fs-sm); font-weight: 600; color: var(--sev-crit); }
.deadline--passed .deadline__n .countdown { color: var(--text-muted); }
.deadline--aside { min-width: 0; }
.deadline--aside .deadline__n .countdown { font-size: var(--fs-3xl); }
.evidence { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.kid { display: flex; gap: var(--space-2); align-items: center; font-size: var(--fs-md); }
.contrast { padding: var(--space-3) var(--space-4); border: 1px dashed var(--border-strong); border-radius: var(--radius); display: flex; flex-direction: column; gap: var(--space-2); }
.bulkbar { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-3); background: var(--text); color: var(--surface); border-radius: var(--radius); }
.bulkbar .btn { --_bg: transparent; --_fg: var(--surface); --_bd: color-mix(in srgb, var(--surface) 45%, transparent); }
.bulkbar .btn:hover { --_bg: color-mix(in srgb, var(--surface) 12%, transparent); }
.ctx-events { display: flex; flex-direction: column; gap: 4px; }
.ctx-events li { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: var(--space-2); align-items: baseline; }
.ctx-alert { display: flex; gap: var(--space-2); align-items: baseline; }

/* Mail preview (the exact bytes that will be sent) */
.mail { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.mail__head { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 4px var(--space-3); margin: 0; padding: var(--space-3) var(--space-4); background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.mail__head dt { color: var(--text-muted); }
.mail__head dd { margin: 0; overflow-wrap: anywhere; }
.mail__head dd:last-child { font-weight: 650; }
.mail__body { margin: 0; padding: var(--space-3) var(--space-4); font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.55; white-space: pre-wrap; max-height: 320px; overflow: auto; }
.mail--compact .mail__body { max-height: 220px; }

/* Shortage allocation — need/have as countable units */
.alloc-strips { display: flex; flex-direction: column; gap: var(--space-2); }
.alloc-strip { display: grid; grid-template-columns: 70px auto 1fr; gap: var(--space-3); align-items: center; }

/* Label preview (address overflow) with a 35-column ruler */
.label-compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr)); gap: var(--space-4); }
.label-fig { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.label-card { padding: var(--space-3) var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.6; box-shadow: 3px 3px 0 var(--surface-3); overflow-x: auto; }
.label-card--bad { border-color: var(--sev-crit); box-shadow: 3px 3px 0 var(--tint-crit); }
.label-card__ruler { color: var(--text-muted); font-size: var(--fs-sm); letter-spacing: 0; margin-left: 90px; white-space: pre; overflow: hidden; line-height: 1; }
.label-line { display: grid; grid-template-columns: 84px minmax(max-content, 1fr) 44px; gap: 6px; align-items: baseline; }
.label-line__f { font-size: var(--fs-2xs); color: var(--text-muted); }
.label-line__v { white-space: pre; }
.label-line__n { text-align: right; font-size: var(--fs-2xs); color: var(--text-muted); }
.label-line--over .label-line__n { color: var(--sev-crit); font-weight: 700; }
.label-line__cut { color: var(--sev-crit); text-decoration: line-through; text-decoration-thickness: 2px; background: var(--tint-crit); }

/* WAF diagnosis — a cryptic 403 becomes a two-minute fix */
.diag { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: var(--space-4); align-items: start; }
.diag__raw { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.fixsteps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.waf { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); }
.waf__hero { font-size: var(--fs-xl); font-weight: 600; letter-spacing: -0.01em; }
.waf__steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--space-4) var(--space-5); }
.waf__steps > .waf__step:nth-child(3) { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: var(--space-4); padding-top: var(--space-3); border-top: 1px dashed var(--border-strong); }
.waf__copy { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: var(--space-3); transition: opacity var(--dur-3) var(--ease); }
.waf__copy.is-off { opacity: 0.18; }
.waf__step { display: flex; flex-direction: column; gap: var(--space-2); transition: opacity var(--dur-3) var(--ease), transform var(--dur-3) var(--ease); }
.waf__step.is-off { opacity: 0.18; transform: translateY(4px); }
.waf__k { display: flex; align-items: center; gap: var(--space-2); font-weight: 650; font-size: var(--fs-sm); }
.waf__badge { display: inline-grid; place-items: center; min-width: 38px; height: 24px; padding: 0 6px; border-radius: var(--radius-sm); font-family: var(--font-mono); font-weight: 700; background: var(--surface-3); }
.waf__badge--bad { background: var(--sev-crit-fill); color: var(--sev-crit-fill-ink); }
.waf__badge--ok { background: var(--state-done); color: var(--surface); }
.waf__means { font-size: var(--fs-md); }

/* Stuck ribbon (business hours) & leap-frog */
.ribbon { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.ribbon__days { display: flex; flex-direction: column; gap: 4px; }
.ribbon__day { display: grid; grid-template-columns: 34px minmax(0, 1fr) 56px; gap: var(--space-2); align-items: center; font-size: var(--fs-xs); }
.ribbon__day--weekend { opacity: 0.55; }
.ribbon__wd { font-weight: 650; }
.ribbon__track { position: relative; height: 12px; background: var(--surface-3); border-radius: 2px; }
.ribbon__day--weekend .ribbon__track { background: repeating-linear-gradient(135deg, var(--surface-3) 0 4px, transparent 4px 8px); }
.ribbon__fill { position: absolute; top: 0; bottom: 0; left: var(--from); width: var(--w); background: var(--sev-warn); border-radius: 2px; }
.ribbon__fill--over { background: repeating-linear-gradient(90deg, var(--sev-warn) 0 6px, color-mix(in srgb, var(--sev-warn) 70%, var(--surface)) 6px 8px); }
.ribbon__thr { position: absolute; top: -4px; bottom: -4px; left: var(--x); width: 2px; background: var(--text); }
.ribbon__h { text-align: right; font-variant-numeric: tabular-nums; color: var(--text-muted); }
.leap { display: flex; flex-direction: column; gap: 6px; padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); }
.leap__row { display: grid; grid-template-columns: 60px 140px minmax(0, 1fr); gap: var(--space-3); align-items: center; }
.leap__bar { height: 8px; border-radius: 1px; }
.leap__bar--open { background: repeating-linear-gradient(90deg, var(--sev-warn) 0 6px, transparent 6px 9px); }
.leap__bar--done { background: var(--state-done); width: 60%; }

/* Approval contract (modal) — what, who, until when, the hash; payload below; re-auth inline next to the one gesture */
.contract { display: grid; grid-template-columns: 138px minmax(0, 1fr); gap: 6px var(--space-4); margin: 0; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); font-size: var(--fs-md); }
.contract dt { color: var(--text-muted); font-size: var(--fs-sm); padding-top: 1px; }
.contract dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.contract__hash { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.contract__hash .hash { font-size: var(--fs-md); font-weight: 650; }
.ap-summary { font-size: var(--fs-lg); line-height: 1.45; }
.ap-payload { max-height: 300px; overflow: auto; border-radius: var(--radius); }
.ap-payload .mail__body { max-height: none; }
.ap-source { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.reauth-inline { flex: 1 1 420px; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: var(--space-1) var(--space-3); margin: 0; padding: var(--space-2) var(--space-3) var(--space-3); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); min-width: 0; }
.reauth-inline legend { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px; font-weight: 650; font-size: var(--fs-sm); }
.reauth-inline .field__hint { grid-column: 1 / -1; }
.reauth-inline .input { min-height: 32px; }
.reauth-fresh { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); color: var(--text-muted); }
.reauth-fresh .icon { color: var(--state-done); }
.reauth-user { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; padding: var(--space-2) var(--space-3); background: var(--surface-2); border-radius: var(--radius); }
.diff-before { color: var(--sev-crit); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--sev-crit) 60%, transparent); }
.diff-after { color: var(--state-done); font-weight: 650; }
.diff-row--changed > th { box-shadow: inset 3px 0 0 var(--focus); }
.textarea--mail { min-height: 260px; font-family: var(--font-mono); font-size: var(--fs-sm); }

/* The railway line — an order's route, station by station (the Control Tower loop uses the same vocabulary):
   filled check = done · red ✕ = the breaking event · dashed ring = pending with a due time · hollow ring = future */
.oline-wrap { padding: var(--space-3) 0 var(--space-4); overflow-x: auto; }
.oline { list-style: none; margin: 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(118px, 1fr); position: relative; min-width: 640px; }
.oline__st { position: relative; display: flex; flex-direction: column; gap: 2px; padding-right: var(--space-2); }
.oline__st::before { content: ""; position: absolute; top: 10px; left: 22px; right: -2px; height: 2px; background: var(--text); }
.oline__st:last-child::before { display: none; }
.oline__st--pending::before, .oline__st--skipped::before, .oline__st--future::before, .oline__st--due::before, .oline__st--x::before { background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px); }
.oline__st--current::before { background: repeating-linear-gradient(90deg, var(--state-flow) 0 6px, transparent 6px 9px); }
.oline__node { position: relative; z-index: 1; width: 22px; height: 22px; display: grid; place-items: center; background: var(--bg); border-radius: 50%; }
.oline__node .glyph { width: 20px; height: 20px; }
.oline__dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border-strong); background: var(--bg); }
.oline__ring-due { width: 18px; height: 18px; border-radius: 50%; border: 2px dashed var(--state-flow); background: var(--bg); }
.oline__st--done .glyph { color: var(--state-done); }
.oline__st--crit .glyph, .oline__st--x .glyph { color: var(--sev-crit); }
.oline__st--attention .glyph { color: var(--state-attention); }
.oline__st--current .glyph { color: var(--state-flow); }
.oline__st--neutral .glyph { color: var(--state-neutral); }
.oline__label { font-weight: 650; font-size: var(--fs-md); margin-top: 6px; }
.oline__sub { font-size: var(--fs-xs); color: var(--text-muted); font-family: var(--font-mono); min-height: 1.3em; }
.oline__at { font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.oline__st--skipped .oline__label, .oline__st--pending .oline__label, .oline__st--future .oline__label { color: var(--text-muted); font-weight: 550; }
.oline__st--due .oline__label { color: var(--state-flow); }
.oline__st--due .oline__at { color: var(--state-flow); font-weight: 650; }
.oline__st--crit .oline__label, .oline__st--x .oline__label { color: var(--sev-crit); }
.oline__st--branch .oline__label { color: var(--sev-crit); }
.oline__st--branch.oline__st--neutral .oline__label { color: var(--text); }
.oline__st--branch::after { content: ""; position: absolute; left: 10px; top: -14px; width: 2px; height: 14px; background: var(--sev-crit); }
.oline__st--branch.oline__st--neutral::after { background: var(--state-neutral); }

/* Merchant milestones (plain-language line) */
.mline { list-style: none; margin: 0; padding: var(--space-3) 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mline__st { position: relative; display: flex; flex-direction: column; gap: 4px; }
.mline__st::before { content: ""; position: absolute; top: 10px; left: 22px; right: 0; height: 3px; background: var(--state-done); }
.mline__st--pending::before { background: repeating-linear-gradient(90deg, var(--border-strong) 0 5px, transparent 5px 10px); }
.mline__st:last-child::before { display: none; }
.mline__node { position: relative; z-index: 1; width: 22px; height: 22px; display: grid; place-items: center; background: var(--bg); border-radius: 50%; color: var(--state-done); }
.mline__node .glyph { width: 20px; height: 20px; }
.mline__label { font-size: var(--fs-lg); font-weight: 650; margin-top: 6px; }
.mline__st--pending .mline__label { color: var(--text-muted); }
.mline__at { font-size: var(--fs-sm); color: var(--text-muted); }

/* Order header & the one-sentence answer */
.ohead { display: flex; flex-direction: column; gap: var(--space-1); }
.ohead__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ohead h1 { font-size: var(--fs-2xl); font-weight: 650; letter-spacing: -0.015em; }
.ohead__ids { color: var(--text-muted); }
.answer { padding: var(--space-4) var(--space-5); border: 1px solid var(--border); border-left: 4px solid var(--state-neutral); border-radius: var(--radius); background: var(--surface); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-5); }
.answer__text { font-size: 22px; line-height: 1.3; font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; flex: 1 1 520px; }
.answer__text .countdown { font-size: inherit; }
.answer__track { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.answer--done { border-left-color: var(--state-done); }
.answer--crit { border-left-color: var(--sev-crit); background: linear-gradient(90deg, var(--tint-crit), var(--surface) 60%); }
.answer--crit .answer__text { color: var(--sev-crit); }
.answer--attention { border-left-color: var(--state-attention); }
.answer--flow { border-left-color: var(--state-flow); }
.answer--intake { border-left-color: var(--state-intake); }
.aside-card { padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: var(--space-2); }
.aside-card .kv { grid-template-columns: 96px minmax(0, 1fr); }

/* Upload protocol tickets — the exactly-once proof */
.ticket { border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); margin-bottom: var(--space-3); overflow: hidden; }
.ticket--warn { border-color: var(--sev-warn); }
.ticket--del { border-style: dashed; }
.ticket__head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: var(--space-2) var(--space-4); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.ticket__file { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 2px; padding: var(--space-3) var(--space-4) 0; font-size: var(--fs-lg); }
.ticket__counter { font-weight: 750; letter-spacing: 0.02em; background: var(--tint-flow); padding: 0 3px; border-radius: 2px; }
.proto { list-style: none; margin: 0; padding: var(--space-3) var(--space-4) var(--space-4); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; }
.proto__st { position: relative; display: flex; flex-direction: column; gap: 2px; padding-right: var(--space-3); min-width: 0; }
.proto__st::before { content: ""; position: absolute; top: 5px; left: 12px; right: 0; height: 2px; background: var(--text); }
.proto__st:last-child::before { display: none; }
.proto__st--pending::before, .proto__st--next::before, .proto__st--unverified::before { background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px); }
.proto__node { position: relative; z-index: 1; width: 12px; height: 12px; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 3px var(--surface); margin-bottom: 6px; }
.proto__st--pending .proto__node, .proto__st--next .proto__node { background: var(--surface); border: 2px solid var(--border-strong); }
.proto__st--next .proto__node { border-color: var(--state-flow); }
.proto__st--unverified .proto__node { background: var(--surface); border: 2px solid var(--sev-warn); }
.proto__st:last-child.proto__st--done .proto__node { background: var(--state-done); }
.proto__step { font-size: var(--fs-2xs); font-weight: 700; letter-spacing: 0.03em; }
.proto__label { font-weight: 600; }
.proto__time { font-size: var(--fs-sm); }
.proto__delta { font-size: var(--fs-xs); color: var(--state-flow); min-height: 1.2em; }
.proto__detail { color: var(--text-muted); overflow-wrap: anywhere; }
.proto__st--unverified .proto__time { color: var(--sev-warn); font-weight: 650; }

/* Write-back list (tracking BEFORE status) & tracking card */
.wblist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.wb { display: grid; grid-template-columns: 22px 120px auto 80px minmax(0, 1fr); gap: var(--space-3); align-items: baseline; padding: 6px var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.wb--failed { border-color: var(--sev-crit); box-shadow: inset 3px 0 0 var(--sev-crit); }
.wb__n { color: var(--text-muted); }
.wb__payload { grid-column: 5; color: var(--text-muted); overflow-wrap: anywhere; }
.wb__err { grid-column: 2 / -1; }
.trackcard { padding: var(--space-3) var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius); display: flex; flex-direction: column; gap: 4px; }
.trackcard__n { font-size: var(--fs-xl); font-weight: 650; letter-spacing: 0.02em; }
.tl-alert { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }

/* Onboarding step rail — also the step navigation (one step in view at a time) */
.obline { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: var(--space-3) var(--space-4) var(--space-3); overflow-x: auto; }
.obline__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(8, minmax(108px, 1fr)); }
.obline__st { position: relative; }
.obline__st::before { content: ""; position: absolute; top: 11px; left: 24px; right: 0; height: 2px; background: var(--state-done); }
.obline__st:last-child::before { display: none; }
.obline__st--attention::before, .obline__st--blocked::before, .obline__st--todo::before { background: repeating-linear-gradient(90deg, var(--border-strong) 0 4px, transparent 4px 8px); }
.obline__a { position: relative; display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; padding: 0 var(--space-2) 4px 0; border-radius: var(--radius-sm); }
.obline__a:hover .obline__label { text-decoration: underline; }
.obline__a[aria-current="step"] { box-shadow: inset 0 -3px 0 var(--brand-fill); }
.obline__a[aria-current="step"] .obline__label { font-weight: 750; }
.obline__node { position: relative; z-index: 1; width: 24px; height: 24px; display: grid; place-items: center; background: var(--surface); border-radius: 50%; }
.obline__node .glyph { width: 20px; height: 20px; }
.obline__num { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border-strong); display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; color: var(--text-muted); background: var(--surface); }
.obline__st--done .glyph { color: var(--state-done); }
.obline__st--attention .glyph { color: var(--sev-warn); }
.obline__st--blocked .glyph { color: var(--sev-crit); }
.obline__label { font-weight: 650; font-size: var(--fs-md); margin-top: 6px; }
.obline__status { font-size: var(--fs-xs); color: var(--text-muted); }
.obline__st--attention .obline__status { color: var(--sev-warn); font-weight: 600; }
.obline__st--blocked .obline__status { color: var(--sev-crit); font-weight: 600; }
.obmeta { font-size: var(--fs-sm); }
.obmeta--done { color: var(--state-done); }
.obmeta--attention { color: var(--sev-warn); font-weight: 600; }
.obmeta--blocked { color: var(--sev-crit); font-weight: 600; }
/* Go-live headline: "<shop> is N fixes away from go-live" with the blockers directly under it */
.golive { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4) var(--space-5); border: 1px solid var(--border); border-left: 4px solid var(--sev-crit); border-radius: var(--radius); background: var(--surface); }
.golive--ready { border-left-color: var(--state-done); }
.golive__title { font-size: 24px; font-weight: 650; letter-spacing: -0.015em; line-height: 1.25; text-wrap: balance; }
.golive__title .t-crit { font-weight: 700; }
.golive__blockers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.golive__blocker { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: var(--space-2); align-items: baseline; font-size: var(--fs-md); }
.golive__blocker .glyph { color: var(--sev-crit); align-self: center; }
.golive__owner { font-size: var(--fs-xs); color: var(--text-muted); }

/* Readiness list (blockers first, each with a Fix link) & go-live checklist */
.rd__sum { display: flex; flex-direction: column; gap: var(--space-2); }
.rdlist { display: flex; flex-direction: column; }
.rdi { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: var(--space-2); align-items: start; padding: 6px 0; border-top: 1px solid var(--border); }
.rdi .glyph { margin-top: 3px; }
.rdi--green .glyph { color: var(--state-done); }
.rdi--amber .glyph { color: var(--sev-warn); }
.rdi--red .glyph { color: var(--sev-crit); }
.rdi__main { display: flex; flex-direction: column; min-width: 0; }
.rdi__t { font-size: var(--fs-sm); font-weight: 650; }
.rdi__s { font-size: var(--fs-xs); color: var(--text-muted); }
.rdi--red .rdi__t { color: var(--sev-crit); }
.rdi__fix { font-weight: 650; white-space: nowrap; }
.rdlist__sep { padding: var(--space-2) 0 2px; font-size: var(--fs-2xs); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: var(--text-muted); border-top: 1px solid var(--border); }
.gllist { display: flex; flex-direction: column; gap: 2px; }
.gli { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; gap: var(--space-2); align-items: start; padding: 6px 0; border-top: 1px solid var(--border); }
.gli .glyph { color: var(--state-done); margin-top: 3px; }
.gli__box { width: 12px; height: 12px; margin-top: 3px; border: 1.5px solid var(--border-strong); border-radius: 2px; }
.gli--done .gli__t { color: var(--text-muted); }

/* Onboarding details: pairing code, env check, counter floor, EAN, dry-run, switch map */
.pair { display: grid; grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr); gap: var(--space-4); align-items: start; }
.pair__result { grid-column: 1 / -1; display: flex; flex-direction: column; gap: var(--space-2); }
.pair__result .kv { grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); }
.pair__code { padding: var(--space-3) var(--space-4); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: var(--space-2); container-type: inline-size; }
.pair__value { font-size: 17px; font-weight: 700; letter-spacing: 0.04em; white-space: nowrap; overflow-wrap: normal; }
@container (max-width: 300px) { .pair__value { white-space: normal; overflow-wrap: anywhere; } }
.envcheck { display: flex; gap: var(--space-4); }
.envcheck__cfg { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3); border: 1px solid var(--state-done); border-radius: var(--radius); }
.envcheck__tuple { font-size: var(--fs-lg); font-weight: 650; }
.numline { padding: var(--space-5) var(--space-2) var(--space-2); }
.numline__track { position: relative; height: 2px; background: var(--border-strong); }
.numline__mark { position: absolute; left: var(--x); top: -6px; width: 2px; height: 14px; background: var(--text); }
.numline__mark span { position: absolute; bottom: 18px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; }
.numline__mark--floor { background: var(--state-done); }
.numline__mark--floor span { color: var(--state-done); }
.numline__mark--last { background: var(--state-flow); }
.problem { padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-left: 3px solid var(--sev-crit); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: var(--space-2); }
.problem--fixed { border-left-color: var(--state-done); background: var(--surface-2); }
.problem__head { display: flex; align-items: center; gap: var(--space-2); }
.problem__head .glyph { color: var(--sev-crit); }
.problem--fixed .problem__head .glyph { color: var(--state-done); }
.ean { display: flex; gap: 2px; flex-wrap: wrap; }
.ean__c { display: flex; flex-direction: column; align-items: center; min-width: 22px; padding: 2px 0; border: 1px solid var(--border); border-radius: 2px; font-family: var(--font-mono); background: var(--surface); }
.ean__v { font-size: var(--fs-lg); font-weight: 650; }
.ean__i { font-size: 9px; color: var(--text-muted); }
.ean__c--bad { border-color: var(--sev-crit); background: var(--tint-crit); color: var(--sev-crit); }
.problem--fixed .ean__c--bad { border-color: var(--border); background: var(--surface); color: var(--text-muted); text-decoration: line-through; }
.drdec { font-weight: 650; }
.drdec--send { color: var(--state-flow); }
.drdec--hold { color: var(--sev-warn); }
.drdec--route_elsewhere { color: var(--state-neutral); }
.drdec--wait { color: var(--state-attention); }
.swmap { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); }
.swmap__side { display: flex; flex-direction: column; gap: 4px; }
.blocker { display: flex; gap: var(--space-2); align-items: baseline; }
.blocker .glyph { color: var(--sev-high); }
.reasons { margin: 0; padding-left: 18px; color: var(--text); font-size: var(--fs-md); display: flex; flex-direction: column; gap: 4px; }
.dr-alert { display: flex; gap: var(--space-2); align-items: baseline; font-size: var(--fs-md); }

/* WordPress plugin mock (white-label preview: onboarding + showreel) */
.wpmock { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.wpmock__frame { border: 1px solid var(--border-strong); border-radius: var(--radius); overflow: hidden; background: var(--surface); font-size: var(--fs-sm); }
.wpmock__bar { display: flex; align-items: center; gap: var(--space-2); padding: 6px var(--space-3); background: #1d2327; color: #f0f0f1; font-weight: 600; }
.wpmock__logo { width: 14px; height: 14px; border-radius: 2px; background: var(--brand-primary); box-shadow: inset -5px -5px 0 var(--brand-accent); }
.wpmock__steps { margin: 0; padding: var(--space-3) var(--space-3) var(--space-2) calc(var(--space-3) + 18px); display: flex; flex-direction: column; gap: 4px; }
.wpmock__steps li.is-done { color: var(--text-muted); }
.wpmock__steps li.is-current { font-weight: 650; }
.wpmock__btn { margin: 0 var(--space-3) var(--space-3); display: inline-block; padding: 5px 10px; border-radius: 3px; background: var(--brand-primary); color: var(--brand-primary-ink); font-weight: 600; }

/* Clock popover content & keyboard help */
.pop-w-320 { width: 320px; }
.clock-pop__now { display: flex; flex-direction: column; gap: 2px; }
.clock-pop__now .display { font-size: var(--fs-2xl); font-weight: 300; }
.batch-list { display: flex; flex-direction: column; gap: 2px; }
.batch { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); padding: 3px 0; border-bottom: 1px dotted var(--border); font-size: var(--fs-md); }
.batch--passed .mono { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--border-strong); }
.batch--next .mono { font-weight: 700; color: var(--state-flow); }
.keys-table th { width: 120px; }

/* Wall clock */
.wallclock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.wallclock__t { font-size: 44px; font-weight: 250; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wallclock__m { font-size: var(--fs-xs); color: var(--text-muted); }

/* 8 ─ Charts (SVG, CSS-coloured; each has a text or table equivalent) ─────────────────────────────────────────── */
.chart { width: 100%; height: auto; color: var(--text-muted); font-family: var(--font-sans); }
.chart text { fill: var(--text-muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart .axis { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart .grid-line { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart .bar-received { fill: none; stroke: var(--text-muted); stroke-width: 1; shape-rendering: crispEdges; }
.chart .bar-sent { fill: var(--ink-2); shape-rendering: crispEdges; }
.chart .bar-shipped { fill: var(--state-done); shape-rendering: crispEdges; }
.chart .bar-future { fill: var(--surface-3); shape-rendering: crispEdges; }
.chart .marker { stroke: var(--text); stroke-width: 1; shape-rendering: crispEdges; }
.chart .marker--next { stroke: var(--state-flow); stroke-dasharray: 3 3; }
.chart .marker--now { stroke: var(--sev-crit); }
.chart .marker-label { fill: var(--text); font-weight: 600; }
.chart .marker-label--next { fill: var(--state-flow); }
.chart .marker-label--now { fill: var(--text); }
.chart .label-strong { fill: var(--text); font-weight: 650; }
.chart .label-bg { fill: var(--surface); }
.chart-fig { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.spark { width: 100%; height: 28px; }
.spark .spark-line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark .spark-area { fill: var(--surface-3); }
.spark .spark-dot { fill: var(--text); }
.spark .spark-base { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }

/* 9 ─ Overlays: drawer, modal, popover, toast, caption ─────────────────────────────────────────────────────────── */
.scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background: var(--scrim);
  animation: fade-in var(--dur-2) var(--ease);
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  z-index: var(--z-drawer);
  width: min(620px, 94vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--border-strong);
  box-shadow: var(--shadow-3);
  animation: drawer-in var(--dur-3) var(--ease-out);
}
.drawer--wide { width: min(820px, 96vw); }
.drawer__head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-3);
  border-bottom: 1px solid var(--border);
}
.drawer__title { font-size: var(--fs-xl); font-weight: 650; line-height: 1.2; }
.drawer__sub { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 2px; }
.drawer__body { flex: 1; overflow: auto; padding: var(--space-4) var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-5); }
.drawer__foot { padding: var(--space-3) var(--space-5); border-top: 1px solid var(--border); display: flex; gap: var(--space-2); flex-wrap: wrap; }
.drawer .envbar { position: static; padding: 0 var(--space-5); }
@keyframes drawer-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-wrap { position: fixed; inset: 0; z-index: var(--z-modal); display: grid; place-items: start center; padding: 5vh var(--space-4) var(--space-4); overflow: auto; }
.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 5vh - var(--space-4));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  animation: modal-in var(--dur-3) var(--ease-out);
}
.modal--sm { width: min(480px, 100%); }
.modal--lg { width: min(960px, 100%); }
.modal__head { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
.modal__title { font-size: var(--fs-xl); font-weight: 650; line-height: 1.25; }
.modal__sub { color: var(--text-muted); font-size: var(--fs-sm); margin-top: 2px; }
.modal__body { padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); overflow: auto; overscroll-behavior: contain; min-height: 0; }
.modal__head, .modal__foot { flex: none; }
.modal__foot {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  flex-wrap: wrap;
}
.modal__foot .push { margin-left: auto; }
.modal__foot--contract { align-items: flex-end; }
.modal .envbar { position: static; padding: 6px var(--space-3); border-radius: var(--radius-sm); }
@keyframes modal-in { from { transform: translateY(8px) scale(0.99); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.menu-anchor { position: relative; }
.popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: var(--z-popover);
  min-width: 260px;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  animation: fade-in var(--dur-1) var(--ease);
}
.popover--right { left: auto; right: 0; }
.popover__sec { padding: var(--space-2); display: flex; flex-direction: column; gap: var(--space-2); }
.popover__sec + .popover__sec { border-top: 1px solid var(--border); }
.menu-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  min-height: 32px;
  padding: 0 var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  font-size: var(--fs-md);
  color: var(--text);
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-3); }
.menu-item[aria-checked="true"] { font-weight: 650; }
.menu-item__check { width: 14px; height: 14px; color: var(--brand-text); visibility: hidden; }
.menu-item[aria-checked="true"] .menu-item__check { visibility: visible; }
.menu-item__meta { margin-left: auto; color: var(--text-muted); font-size: var(--fs-xs); }
.swatch { width: 16px; height: 16px; border-radius: var(--radius-sm); flex: none; background: var(--sw1, #888); box-shadow: inset -6px -6px 0 var(--sw2, #ccc), 0 0 0 1px var(--border-strong); }

/* Toasts sit top-right, under the top bar and env band: they never cover a card's sticky action bar */
.toasts {
  position: fixed;
  right: var(--space-4);
  top: calc(var(--topbar-h) + var(--envbar-h) + var(--space-3));
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  --_c: var(--state-done);
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--_c);
  border-radius: var(--radius);
  box-shadow: var(--shadow-3);
  font-size: var(--fs-md);
  animation: toast-in var(--dur-3) var(--ease-out);
}
.toast .icon { color: var(--_c); margin-top: 1px; }
.toast--crit { --_c: var(--sev-crit); }
.toast--info { --_c: var(--sev-info); }
.toast--warn { --_c: var(--sev-warn); }
.toast__title { font-weight: 650; }
.toast__meta { color: var(--text-muted); font-size: var(--fs-xs); margin-top: 2px; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* Narration caption (demo): calm, legible, never covering the focused control */
.caption {
  position: fixed;
  left: 50%;
  bottom: var(--space-5);
  z-index: var(--z-caption);
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 48px));
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-5);
  background: #111418;
  color: #F2F3F5;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-3);
  animation: toast-in var(--dur-3) var(--ease-out);
}
.caption__kicker { font-size: var(--fs-xs); font-weight: 700; letter-spacing: var(--track-caps); text-transform: uppercase; color: #C9CDD3; white-space: nowrap; }
.caption__text { font-size: var(--fs-lg); line-height: 1.4; text-wrap: balance; }
.caption .btn { --_bg: transparent; --_fg: #F2F3F5; --_bd: #6B727C; }
.caption .btn:hover { --_bg: #22272D; }

/* Flash — "this just changed" (demo & live updates). Outline, not colour flood; off under reduced motion. */
.is-changed { animation: flash-outline 1.6s var(--ease-out); }
@keyframes flash-outline {
  0% { box-shadow: 0 0 0 2px var(--focus); }
  70% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus) 35%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
@keyframes flash-in {
  0% { background: color-mix(in srgb, var(--focus) 16%, transparent); }
  100% { background: transparent; }
}
.enter { animation: enter var(--dur-3) var(--ease-out); }
@keyframes enter { from { transform: translateY(-6px); opacity: 0; } to { transform: none; opacity: 1; } }
.leave { animation: leave var(--dur-3) var(--ease-in) forwards; }
@keyframes leave { to { transform: translateX(16px); opacity: 0; } }
html.is-locked, html.is-locked body { overflow: hidden; }

/* 10 ─ Modes ────────────────────────────────────────────────────────────────────────────────────────────────────── */
/* Density: compact tables and rows for the 8-hour shift (per-viewer preference) */
:root[data-density="compact"] .tbl th, :root[data-density="compact"] .tbl td { padding-top: 4px; padding-bottom: 4px; }
:root[data-density="compact"] .irow__btn { min-height: 40px; padding-top: 3px; padding-bottom: 3px; }

/* Collapsed rail: 1024–1279 px — icons, labels on focus/hover; shops reachable through the Shops page and search */
@media (max-width: 1279px) {
  :root { --rail-w: var(--rail-w-collapsed); --page-pad-x: 24px; --gutter: 16px; }
  .rail { padding: var(--space-3) var(--space-2); align-items: stretch; }
  .rail__label, .rail__text, .rail__count, .rail__group--tenants, .rail__foot .rail__foot-text { display: none; }
  .rail__item { justify-content: center; padding: 0; min-height: 40px; }
  .rail__item .rail__tip {
    display: block;
    position: absolute;
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%);
    z-index: var(--z-scrim);
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--bg);
    font-size: var(--fs-sm);
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--dur-1) var(--ease);
  }
  .rail__item:hover .rail__tip, .rail__item:focus-visible .rail__tip { opacity: 1; }
  .rail__item .rail__dot { display: block; position: absolute; top: 6px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--sev-crit-fill); box-shadow: 0 0 0 2px var(--bg); }
  .brandmark__scope { display: none; }
  .clock__meta { display: none; }
  .hide-md { display: none !important; }
}
@media (max-width: 1100px) { .hide-sm { display: none !important; } }

/* Embedded (inside the showreel / demo frame): the product stays real; only the page gutter tightens */
:root[data-embed] { --page-pad-x: 28px; }

/* Wall (2560 ops screen): larger type, no hover dependence. Layout in screens.css. */
:root[data-wall] { --fs-base: 16px; --fs-md: 15px; --fs-sm: 14px; --fs-xs: 12.5px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 32px; --fs-flow: 52px; --page-pad-x: 32px; --content-max: 2560px; }

/* 11 ─ Motion preferences & forced colours ──────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .skel__line { animation: none; }
  .is-changed { animation: none; box-shadow: 0 0 0 2px var(--focus); }
  .enter, .leave, .drawer, .modal, .toast, .caption { animation-name: fade-in !important; animation-duration: 160ms !important; }
}
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
  animation-duration: 1ms !important;
  transition-duration: 1ms !important;
}
:root[data-motion="reduce"] .enter, :root[data-motion="reduce"] .leave, :root[data-motion="reduce"] .toast { animation-name: fade-in !important; animation-duration: 160ms !important; }

@media (forced-colors: active) {
  .pill, .sev, .flag, .env, .badge, .btn, .panel, .unit, .chip-ready, .envbar__env { border: 1px solid CanvasText; }
  .unit--have, .unit--send, .unit--green { background: CanvasText; }
  .sev--crit { forced-color-adjust: none; }
  .envbar { border-bottom: 2px solid CanvasText; }
  .loop__seg::before, .rhythm__gap { forced-color-adjust: none; }
}
