/* ─────────────────────────────────────────────────────────────────────────
   dta.css — URGA shared design system (SINGLE SOURCE OF TRUTH).
   Served at /system/dta.css. Every surface links this; page-specific CSS
   lives in each page's own <style> block. Edit tokens/chrome HERE, once.
   ───────────────────────────────────────────────────────────────────────── */

/* ─── design tokens ─── */
:root {
  --bg: #F3F3F0; --paper: #FFFFFF; --ink: #0E1116; --soft: #2A2F37;
  --mute: #5A636E; --faint: #8B92A1; --hair: rgba(14,17,22,0.07);
  --rule: rgba(14,17,22,0.22); --grid: rgba(14,17,22,0.12);
  --accent: #B2201A; --up: #0A763E; --blue: #2E5C8A;  /* --up darkened from #0E8A4A → AA 4.5+ as text on light paper (was 3.97:1, now 5.14:1) */
  /* LED MATERIAL (the signal protocol): the split-flap/LED card "phosphor" —
     a MATERIAL colour, not a semantic one. Scoped to .flap-c / board glyphs;
     never used as text on the page surface. --led-dim = the dimmed unit marker
     beside lit digits (tokenises the stray #c98a2b ANALYST flagged). */
  --led: #ffb22e; --led-dim: #c98a2b;
  --on-accent: #fff;  /* text on an --accent fill — white passes AA on the dark-red light accent */
  --stale: #8A6E1A;   /* amber — overdue primary series ("as of" cue, contract B) */
  /* multi-series (compare) */
  --s0:#B2201A; --s1:#2E5C8A; --s2:#0E8A4A; --s3:#8A6E1A; --s4:#6B4FA0; --s5:#0E1116;
  /* map */
  --land: #ECE7DC; --landstroke: rgba(14,17,22,0.30); --nodata: #D7DBE0;
  --serif: 'STIX Two Text', Georgia, serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --font-led: 'Doto', 'IBM Plex Mono', ui-monospace, monospace;  /* dot-matrix LED face — scoped to the /board kiosk (distance-read); dense close-read flappers stay mono for legibility */
}
:root[data-theme="dark"] {
  --bg: #0E1116; --paper: #161B22; --ink: #ECEAE3; --soft: #C7C3B6;
  --mute: #8B92A1; --faint: #5A636E; --hair: rgba(236,234,227,0.09);
  --rule: rgba(236,234,227,0.20); --grid: rgba(236,234,227,0.12);
  --accent: #F2675C; --up: #5FE08D; --blue: #5B9BD5;
  --on-accent: #0E1116;  /* dark text on the lighter coral dark-accent — white FAILS AA there (ANALYST), near-black passes */
  --stale: #D6B656;   /* amber — overdue primary series ("as of" cue, contract B) */
  --s0:#F2675C; --s1:#5B9BD5; --s2:#5FE08D; --s3:#D6B656; --s4:#B79CE0; --s5:#ECEAE3;
  --land: #1C222B; --landstroke: rgba(236,234,227,0.28); --nodata: #2A313B;
}

/* ─── base ─── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* the `hidden` attribute must always win: an author display:flex/grid/block rule
   otherwise silently beats the UA [hidden]{display:none} (ANALYST 2026-06-03 — a
   hidden-but-display:flex camera button rendered DEAD on iOS/FF). Guard the whole
   class, not one element. */
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); font-family: var(--mono); font-size: 12.5px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }

/* ─── language reveal (EN/MN dual-span; html[data-lang] flips it) ─── */
[data-lang="en"] .mn-only { display: none !important; }
[data-lang="mn"] .en-only { display: none !important; }

/* ─── chrome / topbar (identical on every surface) ─── */
.chrome { position: sticky; top: 0; z-index: 50; min-height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-bottom: 0.5px solid var(--rule); background: var(--bg); font-family: var(--mono); font-size: 11px; }
/* mobile: ONE non-wrapping opaque row. Wrapping (the old fix for the .ws nav
   overflow) let the 2nd row spill BELOW the chrome's background onto the board —
   BOB's "transparent top bar overlapping content". Nav lives in the botbar on
   mobile, so hide the chrome's .ws links + the search label; the bar fits one row. */
@media (max-width: 720px) {
  .chrome { flex-wrap: nowrap; }
  .chrome .ws { display: none; }
  .chrome .brand { min-width: 0; }
  .chrome .sb-lbl { display: none; }
  .chrome .crumb { min-width: 0; }
}
.chrome .brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; letter-spacing: 0.07em; color: var(--ink); flex-shrink: 0; font-size: 14px; }
.chrome .brand svg { transition: transform 0.4s cubic-bezier(0.2,0.7,0.3,1); }
.chrome .brand:hover svg { transform: rotate(45deg); }
/* full name beside the DTA wordmark (BOB) — muted tagline, hidden on the tight
   mobile bar (the acronym + logo carry the brand there). */
.chrome .brand .full { font-size: 0.82em; font-weight: 400; letter-spacing: 0.01em; color: var(--mute); white-space: nowrap; }
@media (max-width: 720px) { .chrome .brand .full { display: none; } }
/* brand mark: the "alive" press logo — a radar dish that slowly SCANS (rotates),
   a red core that BEATS, and a ripple that flashes on each live signed obs. The
   beat + scan are AUTONOMOUS (run on every page, not gated on a live WS) so the
   logo is alive site-wide; the landing's stream adds the per-obs ripple on top.
   The core eases toward the cursor (compass-needle, dta.js brandMark). */
.chrome .brand .logo { transition: transform 0.4s cubic-bezier(0.2,0.7,0.3,1); overflow: visible; }
.chrome .brand:hover .logo { transform: rotate(45deg); }
.logo-core, .logo-ripple, .logo-scan { transform-box: fill-box; transform-origin: center; }
.logo-aim { transition: transform 0.18s cubic-bezier(0.2,0.7,0.3,1); }   /* dta.js eases this toward the cursor */
.logo-core { fill: var(--accent); transition: fill 0.5s ease; }   /* ALWAYS bright + beating — a brand mark, not a status light (so it never dims when the press sleeps overnight); the live-data signal is the ripple, not a dim core */
.logo-ripple { opacity: 0; stroke: var(--accent); }   /* flashes on each live obs (landing stream) */
@media (prefers-reduced-motion: no-preference) {
  .logo-core { animation: logo-beat 2.6s ease-in-out infinite; }
  .logo-scan { animation: logo-scan 32s linear infinite; }
  .logo-ripple.tick { animation: logo-ripple 0.9s ease-out; }
}
@keyframes logo-beat { 0%,100% { transform: scale(1); } 10% { transform: scale(1.22); } 20% { transform: scale(1); } 30% { transform: scale(1.10); } 42% { transform: scale(1); } }
@keyframes logo-ripple { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(5.5); opacity: 0; } }
@keyframes logo-scan { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
/* click/tap feedback — a quick press punch; dta.js also fires the hearth RIPPLE
   burst on pointerdown, so a click reads as a signed-pulse (the motion carries the
   "alive/signed" meaning the old hover tooltip used to spell out). */
.chrome .brand:active .logo { transform: scale(0.9) rotate(45deg); transition-duration: 0.1s; }
.chrome .sep { color: var(--faint); flex-shrink: 0; }
.chrome .ws { color: var(--mute); white-space: nowrap; }
.chrome .ws a { color: var(--mute); }
.chrome .ws a:hover { color: var(--accent); }
.chrome .ws.now { color: var(--ink); }
.chrome .prompt { color: var(--accent); font-weight: 700; font-size: 13px; flex-shrink: 0; }
.chrome .cmd-input { flex: 1; min-width: 90px; font-family: var(--mono); font-size: 12px; color: var(--ink); background: transparent; border: 0; outline: none; padding: 0; caret-color: var(--accent); }
.chrome .cmd-input::placeholder { color: var(--faint); }
.chrome .crumb { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.chrome .crumb b { color: var(--ink); }
.chrome .right { margin-left: auto; display: flex; gap: 12px; align-items: center; color: var(--mute); flex-shrink: 0; }
.chrome .clock { color: var(--soft); font-variant-numeric: tabular-nums; }
/* live "online now" — ○ hollow at 0 (shown honestly), ● green at ≥1. The poll
   that feeds it IS the presence heartbeat (dta.js). */
.presence { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums; white-space: nowrap; }
.presence .pdot { width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--faint); box-sizing: border-box; flex: 0 0 auto; }
.presence.on .pdot { background: var(--up); border-color: var(--up); box-shadow: 0 0 5px color-mix(in srgb, var(--up) 60%, transparent); }
.presence .pn { color: var(--soft); font-weight: 600; }
.presence.on .pn { color: var(--ink); }
.presence .plbl { color: var(--mute); letter-spacing: 0.04em; }
/* narrow phones: drop the presence label, and tighten the .right cluster gap so the
   optional watchlist ★ (28px) fits without tipping the bar into horizontal overflow
   (the command bar is already at its min width here, so there's no flex left to give). */
@media (max-width: 520px) { .presence .plbl { display: none; } .chrome .right { gap: 7px; } }

/* ─── theme + language toggles (inline, in the chrome .right cluster) ─── */
.lang-toggle, .dt-toggle { font-family: var(--mono); color: var(--mute); background: transparent; border: 0; cursor: pointer; line-height: 1; white-space: nowrap; flex-shrink: 0; }
.lang-toggle { font-size: 10px; letter-spacing: 0.08em; padding: 4px 4px; }
.dt-toggle { font-size: 14px; padding: 2px 2px; }
.lang-toggle:hover, .lang-toggle:focus, .dt-toggle:hover, .dt-toggle:focus { color: var(--accent); }
.lang-toggle .seg { color: var(--faint); }
.lang-toggle .seg-sep { color: var(--faint); margin: 0 1px; }
[data-lang="en"] .lang-toggle .seg-en, [data-lang="mn"] .lang-toggle .seg-mn { color: var(--ink); font-weight: 600; }
@media (max-width: 800px) { .lang-toggle, .dt-toggle { padding: 6px 5px; } }
/* watchlist ★ — hidden until you follow ≥1 series; the lit star + count = "your
   follows, reachable here". Accent because it's the one active/personal control. */
.wl-toggle { font-family: var(--mono); color: var(--accent); background: transparent; border: 0; cursor: pointer; line-height: 1; white-space: nowrap; flex-shrink: 0; font-size: 13px; padding: 3px 3px; display: inline-flex; align-items: center; gap: 3px; }
.wl-toggle:hover, .wl-toggle:focus { color: var(--accent); filter: brightness(1.15); outline: none; }
.wl-toggle .wl-n { font-size: 10px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 800px) { .wl-toggle { padding: 6px 4px; } }
/* ─── icon system — inline Phosphor sprite (build.py injects the <symbol> defs;
   use <svg class="ic"><use href="#i-NAME"/></svg>). Phosphor is fill-based, em-sized,
   currentColor-tinted, so an icon inherits its parent's colour + font-size. ─── */
.ic { display: inline-block; width: 1em; height: 1em; fill: currentColor; vertical-align: -0.125em; flex: none; }

/* ─── bottom CONSOLE HANDLE (.conbar) — the command bar moved UP into the top
   chrome (it duplicated the top bar). The bottom is now the live signed-obs
   console's COLLAPSED handle: a slim always-on dark strip (matches the #console
   terminal) that expands the console up over it on click or the ` key. ─── */
.conbar {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 79;
  height: 30px; padding: 0 14px; padding-bottom: env(safe-area-inset-bottom);
  background: #0E1116; color: rgba(236,234,227,0.72);
  border: 0; border-top: 1px solid rgba(255,255,255,0.12);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.06em; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
body { padding-bottom: calc(30px + env(safe-area-inset-bottom)); }
.conbar:hover { color: #ECEAE3; }
.conbar .cb-prompt { flex: none; color: #F2675C; font-weight: 600; }  /* fixed coral — the bar is always dark, so don't use the light-theme accent (dark-red on near-black is invisible) */
.conbar .cb-lbl { text-transform: uppercase; letter-spacing: 0.1em; }
.conbar .cb-hint { margin-left: auto; color: rgba(255,255,255,0.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conbar .cb-chev { flex: none; color: rgba(255,255,255,0.5); transition: transform 0.15s ease; }
.conbar[aria-expanded="true"] .cb-chev { transform: rotate(180deg); }
@media (max-width: 420px) { .conbar .cb-lbl { display: none; } }
/* dev console: a captured JS/fetch fault flashes the collapsed handle red (the
   prompt pulses + the top hairline reddens) until the console is opened — a fault
   is impossible to miss even closed (the cb-hint already ticks the message). */
.conbar.has-err { border-top-color: #F2675C; color: #F2C7C2; }
.conbar.has-err .cb-prompt { animation: cb-err 1s ease-in-out infinite; }
@keyframes cb-err { 0%,100% { color: #F2675C; } 50% { color: #ECEAE3; } }
@media (prefers-reduced-motion: reduce) { .conbar.has-err .cb-prompt { animation: none; } }
/* the command-bar caret blink (used by .topcmd in the top chrome) */
@keyframes cs-blink { 0%, 55% { opacity: 0.9; } 56%, 100% { opacity: 0; } }

/* scan / verify bottom sheet */
.scansheet[hidden] { display: none; }
.scansheet { position: fixed; inset: 0; z-index: 70; display: flex; align-items: flex-end; }
.scansheet .ss-back { position: absolute; inset: 0; background: rgba(14,17,22,0.45); }
.scansheet .ss-panel { position: relative; width: 100%; background: var(--paper); border-radius: 14px 14px 0 0; padding: 16px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 24px rgba(14,17,22,0.22); animation: ss-up 0.22s ease-out; }
@keyframes ss-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.scansheet .ss-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-family: var(--serif); font-size: 16px; color: var(--ink); }
.scansheet .ss-x { background: transparent; border: 0; color: var(--mute); font-size: 16px; cursor: pointer; padding: 4px 6px; }
.scansheet .ss-note { font-size: 11.5px; color: var(--mute); line-height: 1.55; margin: 0 0 14px; }
.scansheet .ss-paste { display: flex; gap: 8px; }
.scansheet .ss-paste input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 13px; color: var(--ink); background: var(--bg); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; outline: none; }
.scansheet .ss-paste input:focus { border-color: var(--accent); }
.scansheet .ss-paste button { font-family: var(--mono); font-size: 13px; color: #fff; background: var(--accent); border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer; white-space: nowrap; }
.scansheet .ss-err { color: var(--accent); font-size: 11px; margin-top: 8px; }
.scansheet .ss-cam-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; font-family: var(--mono); font-size: 13px; color: #fff; background: var(--accent); border: 0; border-radius: 8px; padding: 12px; cursor: pointer; margin-bottom: 12px; }
.scansheet .ss-cam-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.scansheet .ss-cam { position: relative; width: 100%; aspect-ratio: 4 / 3; background: #000; border-radius: 10px; overflow: hidden; margin-bottom: 12px; }
.scansheet .ss-cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scansheet .ss-ret { position: absolute; inset: 16% 20%; border: 2px solid rgba(255,255,255,0.9); border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0,0,0,0.28); }
.scansheet .ss-or { text-align: center; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
@media (min-width: 560px) { .scansheet { align-items: center; justify-content: center; } .scansheet .ss-panel { max-width: 420px; border-radius: 14px; } }
@media (prefers-reduced-motion: reduce) { .scansheet .ss-panel { animation: none; } }

/* ─── backtick console — live signed-obs feed (HLDS-style, always-dark) ─── */
.console[hidden] { display: none; }
.console { position: fixed; left: 0; right: 0; bottom: calc(30px + env(safe-area-inset-bottom)); z-index: 80; height: 46vh; max-height: 460px; display: flex; flex-direction: column; background: #0E1116; color: #ECEAE3; border-top: 2px solid var(--accent); box-shadow: 0 -8px 28px rgba(0,0,0,0.4); font-family: var(--mono); animation: con-up 0.18s ease-out; }
@keyframes con-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.console .con-head { display: flex; align-items: center; gap: 12px; padding: 7px 14px; border-bottom: 1px solid rgba(255,255,255,0.14); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; flex-shrink: 0; }
.console .con-title { color: #ECEAE3; font-weight: 600; }
.console .con-health { color: #5FE08D; letter-spacing: 0.03em; text-transform: none; }
.console .con-health .dn { color: #F2675C; }
.console .con-hint { color: rgba(255,255,255,0.4); font-size: 9px; letter-spacing: 0.03em; text-transform: none; }
.console .con-x { background: transparent; border: 0; color: rgba(255,255,255,0.55); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.console .con-x:hover { color: #ECEAE3; }
.console .con-log { flex: 1; overflow-y: auto; padding: 8px 14px 14px; font-size: 11px; line-height: 1.7; }
.console .con-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(236,234,227,0.82); }
.console .con-line .t { color: rgba(255,255,255,0.38); }
.console .con-line .op { color: #5B9BD5; }
.console .con-line .val { color: #5FE08D; font-weight: 600; }
/* the session journal lines (conLog) — interleaved above the server pulse */
.console .con-line.jr .jk { display: inline-block; min-width: 34px; font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(255,255,255,0.45); }
.console .jr-cmd .jk, .console .jr-win .jk { color: #F2675C; }
.console .jr-sig .jk { color: #5FE08D; }
.console .jr-err .jk { color: #F2675C; }
.console .jr-sys .jk { color: #5B9BD5; }
.console .con-div { padding: 6px 0 2px; font-size: 8.5px; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(255,255,255,0.35); }
.console .con-line a { color: #F2675C; border: 0; }
.console .con-line a:hover { text-decoration: underline; }
.console .con-empty { color: rgba(255,255,255,0.4); font-size: 11px; padding: 6px 0; }
/* dev tools in the con-head — filter chips (all·dev·err·pulse) + copy; the net/obs
   line colours. Chips are ≥24px tap targets (WCAG 2.2). */
.console .con-filters { display: inline-flex; gap: 3px; }
.console .con-f, .console .con-tool { background: transparent; border: 1px solid rgba(255,255,255,0.16); color: rgba(255,255,255,0.55); font-family: var(--mono); font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 8px; min-height: 24px; border-radius: 3px; cursor: pointer; }
.console .con-f:hover, .console .con-tool:hover { color: #ECEAE3; border-color: rgba(255,255,255,0.34); }
.console .con-f.on { color: #0E1116; background: #ECEAE3; border-color: #ECEAE3; }
.console .con-fn { margin-left: 4px; color: #F2675C; font-weight: 700; }
.console .con-f.on .con-fn { color: #B2201A; }
.console .con-tool.ok { color: #5FE08D; border-color: #5FE08D; }
.console .jr-err { color: #F2A39B; }
.console .jr-net .jk { color: #E8B34B; }
.console .jr-obs .jk { color: #5FE08D; }
@media (max-width: 560px) { .console .con-f, .console .con-tool { padding: 3px 6px; } .console .con-health { display: none; } .console .con-head { gap: 7px; } }
/* ≤420: drop the title text (the chips self-label) so all·dev·err·pulse + copy + ✕
   fit one row without overflowing the viewport on a phone. */
@media (max-width: 420px) { .console .con-head { gap: 5px; padding: 7px 9px; } .console .con-title { display: none; } .console .con-f, .console .con-tool { padding: 3px 5px; letter-spacing: 0.02em; } }

/* ─── popup-window system (the "popwindow") — reskinned from CSCLEAR.
   Desktop: floating draggable window. Mobile (≤700px): full-screen bottom
   sheet, swipe-down to dismiss. See web/INTERACTION.md §L2.2. ─── */
#win-layer { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
#win-layer .win { pointer-events: auto; }
.win {
  position: fixed; display: flex; flex-direction: column; overflow: hidden;
  min-width: 280px; min-height: 160px; max-width: 96vw; resize: both;
  background: var(--bg); color: var(--ink);
  border: 1px solid var(--rule); border-left: 2px solid var(--accent);
  box-shadow: 0 10px 40px rgba(14,17,22,0.18);
}
:root[data-theme="dark"] .win { box-shadow: 0 12px 48px rgba(0,0,0,0.55); }
.win-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 30px; flex-shrink: 0; padding: 0 5px 0 11px; cursor: move; user-select: none;
  background: var(--bg); border-bottom: 1px solid var(--rule);
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
}
.win-title { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.win-close { color: var(--mute); cursor: pointer; font-size: 14px; line-height: 1; padding: 4px 7px; border-radius: 2px; }
.win-close:hover, .win-close:focus-visible { color: var(--accent); background: var(--hair); outline: none; }
.win-body { flex: 1; overflow-y: auto; padding: 13px 15px; min-height: 0; font-family: var(--mono); font-size: 12px; }
.win-body::-webkit-scrollbar { width: 6px; }
.win-body::-webkit-scrollbar-thumb { background: var(--hair); border-radius: 3px; }
/* series-island summoned into a window (window.dta.openSeries) — a nervous-system node */
.sw { font-family: var(--mono); }
.sw-load { color: var(--mute); font-size: 12px; padding: 6px 0; }
.sw-val { font-size: 30px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.sw-val .u { font-size: 12px; font-weight: 400; color: var(--mute); margin-left: 3px; }
.sw-d { font-size: 13px; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sw-d.up { color: var(--up); } .sw-d.dn { color: var(--accent); } .sw-d.eq { color: var(--mute); }
/* window chart = the atlas 'tik' figure look (axes + ticks + labels + terminal marker) */
.swc { width: 100%; height: clamp(124px, 26vh, 182px); display: block; margin: 12px 0 10px; font-family: var(--mono); }
.swc .ar { fill: var(--ink); fill-opacity: 0.055; stroke: none; }   /* the area ribbon under the line — pro-terminal weight */
.swc .ar.ar2 { fill-opacity: 0.13; }   /* the filled-LEVEL vocab (area) */
.swc .br { fill: var(--ink); }
.swc .br.neg { fill: var(--accent); }   /* bipolar negatives — the signal protocol's down */
.swc .ax { stroke: var(--ink); stroke-width: 0.5; fill: none; }
.swc .gr { stroke: var(--hair); stroke-width: 0.4; stroke-dasharray: 1 2; }
.swc .ln { stroke: var(--ink); stroke-width: 0.9; fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.swc .pt { fill: var(--accent); }
.swc .lbl { font-size: 7.5px; fill: var(--mute); letter-spacing: 0.03em; }
.swc .it { font-size: 8.5px; font-weight: 600; fill: var(--accent); }
/* shugam v2 — the terminal chart signatures */
.swc .vtag { fill: var(--accent); }
.swc .vtagt { font-family: var(--mono); font-size: 7.5px; font-weight: 600; fill: var(--on-accent); }
.swc .xh line { stroke: var(--accent); stroke-width: 0.5; stroke-dasharray: 2 2; }
.swc .xh circle { fill: var(--accent); stroke: var(--bg); stroke-width: 1; }
.swc .mk { fill: none; stroke: var(--accent); stroke-width: 1.4; }   /* the datum-in-context ring */
svg.swc[data-v] { cursor: crosshair; }
#swcTip { position: fixed; z-index: 120; pointer-events: none; font-family: var(--mono); font-size: 11px;
  padding: 3px 8px; background: var(--ink); color: var(--bg); border-radius: 3px;
  font-variant-numeric: tabular-nums; box-shadow: 0 2px 10px rgba(0,0,0,0.3); white-space: nowrap; }
.sw-meta { font-size: 10px; color: var(--mute); letter-spacing: 0.04em; }
.sw-meta .sw-sig { color: var(--accent); }
.sw-act { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
/* the function-pack windows: i (profile) · stat · t (history table) */
.kv { display: flex; align-items: baseline; gap: 12px; padding: 5px 0; border-bottom: 0.5px solid var(--hair); font-size: 12px; }
.kv-k { flex: 0 0 96px; font-size: 9px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.kv-v { color: var(--ink); font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
.kv-u { color: var(--mute); font-size: 10px; }
.kv-sub { color: var(--faint); font-size: 10px; }
.kv-name { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.4; margin-bottom: 8px; }
.kv-name .kv-en { display: block; font-weight: 400; font-size: 11px; color: var(--mute); }
.kv-blk { padding: 8px 0 4px; border-bottom: 0.5px solid var(--hair); }
.kv-blk .kv-k { display: block; margin-bottom: 4px; }
.kv-txt { font-size: 11.5px; line-height: 1.6; color: var(--soft); }
.htbl { font-variant-numeric: tabular-nums; }
.htbl-hd, .htbl-r { display: grid; grid-template-columns: 1fr 1fr 0.8fr 24px; gap: 8px; align-items: baseline; padding: 5px 0; border-bottom: 0.5px solid var(--hair); }
.htbl-hd { font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--faint); }
.htbl-r { font-size: 12px; color: var(--soft); }
.htbl-v { color: var(--ink); font-weight: 500; text-align: right; }
.htbl-d { text-align: right; font-size: 11px; }
.htbl-d.up { color: var(--up); } .htbl-d.dn { color: var(--accent); } .htbl-d.eq { color: var(--faint); }
.htbl-sid { color: var(--accent); text-decoration: none; font-size: 10px; }
/* civic entity window (window.dta.openEntity) — an object that's a lens onto data */
.ew-kind { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.ew-desc { font-family: var(--serif); font-size: 14px; line-height: 1.55; color: var(--soft); margin: 0 0 14px; }
.ew-lbl { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 7px; }
.ew-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.ew-chip { font-family: var(--mono); font-size: 11px; color: var(--soft); background: color-mix(in srgb, var(--ink) 4%, transparent); border: 0.5px solid var(--hair); border-radius: 2px; padding: 4px 9px; cursor: pointer; }
.ew-chip:hover { border-color: var(--accent); color: var(--accent); }
.ew-list { display: flex; flex-direction: column; }
.ew-sec { display: flex; align-items: baseline; gap: 7px; font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); padding: 15px 4px 6px; }
.ew-sec:first-child { padding-top: 2px; }
.ew-sec-n { font-family: var(--mono); font-size: 10px; color: var(--accent); }
.ew-li { display: flex; align-items: flex-start; gap: 11px; padding: 11px 4px; border-bottom: 0.5px solid var(--hair); background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; text-align: left; width: 100%; }
.ew-li:hover { background: var(--hair); }
.ew-li:hover .ew-li-go { color: var(--accent); transform: translateX(2px); }
.ew-ic { width: 17px; height: 17px; flex-shrink: 0; color: var(--accent); margin-top: 1px; }
.ew-li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ew-li-nm { font-family: var(--mono); font-size: 13px; color: var(--ink); line-height: 1.3; }
.ew-li-d { font-size: 11.5px; line-height: 1.4; color: var(--soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ew-li-go { width: 14px; height: 14px; flex-shrink: 0; color: var(--faint); margin-top: 2px; transition: transform .12s ease, color .12s ease; }
/* release calendar window (window.dta.openCalendar) — upcoming scheduled prints */
.cal { display: flex; flex-direction: column; }
.cal-row { display: flex; align-items: baseline; gap: 12px; padding: 10px 4px; border-bottom: 0.5px solid var(--hair); background: none; border-left: 0; border-right: 0; border-top: 0; cursor: pointer; text-align: left; width: 100%; font-family: var(--mono); }
.cal-row[data-code]:hover { background: var(--hair); }
.cal-when { display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; width: 96px; }
.cal-d { font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.cal-in { font-size: 9px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); }
.cal-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cal-t { font-size: 12px; color: var(--soft); }
.cal-v { font-size: 9px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
/* alerts window (window.dta.openAlerts) — the efferent reflex, signed */
.al-quiet { color: var(--up); font-size: 12px; padding: 10px 2px; }
.al { display: flex; flex-direction: column; }
.al-row { display: flex; align-items: baseline; gap: 11px; padding: 11px 4px; border-bottom: 0.5px solid var(--hair); border-left: 2px solid var(--rule); padding-left: 10px; }
.al-row.al-alert, .al-row.al-high, .al-row.al-critical { border-left-color: var(--accent); }
.al-row.al-warn, .al-row.al-medium { border-left-color: var(--stale); }
.al-row.al-info, .al-row.al-low { border-left-color: var(--blue); }
.al-sev { font-size: 8.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mute); flex-shrink: 0; width: 56px; }
.al-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.al-b { font-size: 12px; color: var(--ink); line-height: 1.4; }
.al-m { font-size: 9px; letter-spacing: 0.04em; color: var(--faint); font-variant-numeric: tabular-nums; }
.al-m .sw-sig { color: var(--accent); }
@media (max-width: 700px) {
  .win {
    left: 0 !important; right: 0; top: auto !important; bottom: 0;
    width: 100vw !important; max-width: 100vw; height: 86vh !important;
    border-left: 0; border-right: 0; border-bottom: 0; border-radius: 11px 11px 0 0;
    resize: none; transition: transform 0.18s ease;
  }
  .win-bar { height: 42px; padding-top: 9px; position: relative; font-size: 11px; }
  .win-bar::before { content: ''; position: absolute; top: 5px; left: 50%; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 2px; background: var(--rule); }
  .win-close { font-size: 20px; padding: 6px 11px; }
  .win-body { padding: 12px 14px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) { .win { transition: none; } }

/* ─── watchlist popwindow body — your followed series (the "follow" set) ─── */
.wl { font-family: var(--mono); }
.wl-load, .wl-empty { padding: 26px 14px; text-align: center; color: var(--mute); font-size: 12px; line-height: 1.6; }
.wl-row { display: grid; grid-template-columns: 1fr auto 80px auto; align-items: center; gap: 10px; padding: 9px 12px; border-top: 0.5px solid var(--hair); }
.wl-row:first-child { border-top: 0; }
.wl-nm { min-width: 0; font-size: 12px; color: var(--ink); overflow: hidden; }
.wl-nm small { display: block; color: var(--faint); font-size: 9.5px; letter-spacing: 0.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wl-v { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.wl-d { font-size: 10px; font-weight: 600; margin-left: 3px; }
.wl-d.up { color: var(--up); } .wl-d.dn { color: var(--accent); } .wl-d.eq { color: var(--mute); }
.wl-sk { width: 80px; height: 22px; display: block; }
.wl-sk polyline { fill: none; stroke: var(--faint); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.wl-sk polyline.up { stroke: var(--up); } .wl-sk polyline.dn { stroke: var(--accent); }
.wl-sk-x { display: inline-block; width: 80px; }
.wl-act { display: flex; gap: 2px; }
.wl-x { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; min-width: 28px; border: none; background: none; color: var(--mute); font-size: 13px; cursor: pointer; text-decoration: none; border-radius: 3px; }
.wl-x:hover { color: var(--accent); background: var(--hair); }
.wl-foot { padding: 13px 12px; margin-top: 4px; border-top: 0.5px solid var(--rule); text-align: center; font-size: 11px; line-height: 1.5; color: var(--mute); }
.wl-foot a { color: var(--accent); }
@media (max-width: 400px) { .wl-row { grid-template-columns: 1fr auto 54px auto; gap: 7px; } .wl-sk, .wl-sk-x { width: 54px; } }

/* ─── search overlay — the shared command palette (⌕ chrome trigger + ⌘K) ─── */
/* the command bar — lives in the top chrome (BOB: top bar IS the command line);
   a prominent prompt that opens the CLI. Grows to fill the chrome between brand + meta. */
.topcmd { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px;
  height: 30px; padding: 0 12px; margin: 0 6px;
  border: 0.5px solid var(--soft); border-radius: 8px; background: var(--paper);
  color: var(--ink); cursor: text; font-family: var(--mono); font-size: 12px; letter-spacing: 0.01em; }
.topcmd:hover, .topcmd:focus-visible { border-color: var(--accent); outline: none; }
.topcmd .tc-prompt { flex: none; color: var(--accent); font-weight: 600; }
.topcmd .tc-ph { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--mute); }
.topcmd .tc-min { display: none; }  /* short placeholder — shown only on narrow (see ≤560 below) */
.topcmd .tc-caret { flex: none; width: 6px; height: 1.05em; background: var(--accent); opacity: 0.9; animation: cs-blink 1.15s steps(1) infinite; }
.topcmd .tc-k { flex: none; margin-left: auto; font-size: 10px; color: var(--faint); border: 0.5px solid var(--rule); border-radius: 4px; padding: 1px 5px; }
/* the verbose "command · search · run" triplet (158px) can't fit the starved
   mobile bar — it clipped mid-word to a meaningless fragment ("comman▍"). The bar
   is flex:1 so it loses width fastest; text can't shrink gracefully. So show the
   MOST that fits at each width, never clip (mirrors the logo's .wm/.full pattern):
   full triplet > 560 · short word 421–560 · icon-only (prompt+caret, an empty CLI
   input) ≤ 420 where the bar is too starved for any word. */
@media (max-width: 560px) {
  .topcmd .tc-k { display: none; }
  .topcmd { margin: 0 4px; gap: 6px; padding: 0 9px; }
  .topcmd .tc-full { display: none; }
  .topcmd .tc-min { display: inline; }
}
@media (max-width: 420px) {
  /* starved — drop the placeholder entirely; the ▸ prompt + blinking caret read as
     an empty command line ready for input (tc-ph is the only part that can't shrink
     without clipping; prompt+caret are flex:none ~14px and always fit). */
  .topcmd .tc-ph { display: none; }
  .topcmd { gap: 7px; }
}
@media (prefers-reduced-motion: reduce) { .topcmd .tc-caret { animation: none; opacity: 0.55; } }
.searchsheet { position: fixed; inset: 0; z-index: 80; }
.search-panel { position: relative; max-width: 640px; margin: 8vh auto 0; background: var(--bg); border: 1px solid var(--rule); border-radius: 6px; box-shadow: 0 16px 56px rgba(0,0,0,0.32); overflow: hidden; }
.search-bar { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 0.5px solid var(--hair); }
.search-bar .search-ic { color: var(--accent); font-size: 16px; flex-shrink: 0; }
/* the LOADED CONTEXT chip — the Bloomberg loaded-security model: a picked
   series locks here; everything typed then filters its function menu */
.cmd-ctx { display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; max-width: 40%;
  border: 1px solid var(--accent); border-radius: 4px; padding: 2px 4px 2px 8px;
  font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent); }
.cmd-ctx .cmd-ctx-l { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-ctx .cmd-ctx-x { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: 13px; line-height: 1; padding: 1px 4px; }
.cmd-ctx .cmd-ctx-x:hover { color: var(--ink); }
.search-bar .cmd-input { flex: 1; min-width: 0; font-family: var(--mono); font-size: 14px; color: var(--ink); background: transparent; border: 0; outline: none; caret-color: var(--accent); }
.search-bar .cmd-input::placeholder { color: var(--faint); letter-spacing: 0.02em; }
.search-x { background: none; border: 0; color: var(--mute); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 6px; flex-shrink: 0; }
.search-x:hover { color: var(--accent); }
.cmd-dropdown { max-height: 60vh; overflow-y: auto; }
.cmd-row { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-top: 0.5px solid var(--hair); cursor: pointer; font-family: var(--mono); font-size: 12px; color: var(--ink); }
.cmd-row:first-child { border-top: 0; }
.cmd-row.active, .cmd-row:hover { background: var(--hair); }
.cmd-row.active { border-left: 2px solid var(--accent); padding-left: 12px; }
.cmd-row .num { flex-shrink: 0; width: 12px; text-align: right; font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }   /* the Reuters menu number — digits execute */
.cmd-row.active .num { color: var(--accent); }
.cmd-row .kind { font-size: 8px; letter-spacing: 0.1em; color: var(--faint); background: var(--hair); padding: 2px 4px; border-radius: 2px; flex-shrink: 0; }
/* leading civic icon for the command-bar home menu (a pro terminal function-list);
   subtle by default, accent when the row is active/hovered — colour as feedback. */
.cmd-row .cmd-ic { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 22px; color: var(--soft); }
.cmd-row .cmd-ic .ic { width: 17px; height: 17px; }
.cmd-row.active .cmd-ic, .cmd-row:hover .cmd-ic { color: var(--accent); }
.cmd-row .main { flex: 1; min-width: 0; overflow: hidden; }
.cmd-row .main .label { color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.cmd-row .main .label mark { background: transparent; color: var(--accent); font-weight: 600; }
.cmd-row .main .sec { color: var(--mute); font-size: 9.5px; margin-top: 1px; letter-spacing: 0.02em; }
.cmd-row .arrow { color: var(--faint); flex-shrink: 0; }
.cmd-dropdown .empty-state { padding: 16px 14px; color: var(--mute); font-size: 11px; }
.cmd-dropdown .empty-state .acc { color: var(--accent); }
.cmd-dropdown .cmd-hint { padding: 11px 14px; color: var(--mute); font-size: 11px; line-height: 1.55; border-bottom: 0.5px solid var(--hair); }
.cmd-dropdown .cmd-hint b { color: var(--accent); font-weight: 600; }

/* ─── nav menu — the expandable menu (replaces the inline "listed buttons");
   right-side drawer on desktop, bottom sheet on mobile. Opened from the chrome
   ☰ and the botbar Menu. ─── */
.menu-btn { background: none; border: 0; color: var(--mute); cursor: pointer; padding: 4px 6px; line-height: 0; flex-shrink: 0; }
.menu-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.menu-btn:hover { color: var(--accent); }
.navmenu { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: flex-end; }
.navmenu[hidden] { display: none; }
.nm-back { position: absolute; inset: 0; background: rgba(14,17,22,0.42); animation: nm-fade 0.18s ease; }
:root[data-theme="dark"] .nm-back { background: rgba(0,0,0,0.55); }
@keyframes nm-fade { from { opacity: 0; } to { opacity: 1; } }
.nm-panel { position: relative; width: min(300px, 86vw); height: 100%; display: flex; flex-direction: column; background: var(--bg); border-left: 1px solid var(--rule); box-shadow: -10px 0 40px rgba(14,17,22,0.18); padding: 12px 0 14px; animation: nm-in 0.2s cubic-bezier(0.2,0.7,0.3,1); }
@keyframes nm-in { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.nm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 4px 16px 12px; border-bottom: 0.5px solid var(--hair); }
.nm-head .wm { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--mute); }
.nm-x { background: none; border: 0; color: var(--mute); font-size: 17px; cursor: pointer; padding: 2px 8px; line-height: 1; }
.nm-x:hover { color: var(--accent); }
.nm-links { display: flex; flex-direction: column; padding: 8px 0; }
.nm-links a { padding: 11px 16px; color: var(--ink); font-family: var(--mono); font-size: 13px; letter-spacing: 0.04em; text-transform: capitalize; border-left: 2px solid transparent; }
.nm-links a:hover { background: var(--hair); color: var(--accent); border-left-color: var(--accent); }
.nm-links a.now { color: var(--accent); border-left-color: var(--accent); }
.nm-actions { margin-top: auto; padding: 12px 16px 2px; border-top: 0.5px solid var(--hair); }
.nm-act { display: flex; align-items: center; gap: 9px; width: 100%; background: none; border: 0; color: var(--mute); font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; cursor: pointer; padding: 8px 0; text-align: left; }
.nm-act:hover { color: var(--accent); }
.nm-act svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; flex-shrink: 0; }
@media (max-width: 720px) {
  .navmenu { justify-content: stretch; align-items: flex-end; }
  .nm-panel { width: 100%; height: auto; max-height: 82vh; border-left: 0; border-radius: 14px 14px 0 0; padding-top: 16px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); animation: nm-up 0.2s cubic-bezier(0.2,0.7,0.3,1); }
  .nm-head { position: relative; }
  .nm-head::before { content: ''; position: absolute; top: -8px; left: 50%; transform: translateX(-50%); width: 38px; height: 4px; border-radius: 2px; background: var(--rule); }
  .nm-links a { padding: 13px 18px; font-size: 14px; }
}
@keyframes nm-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media print { .chrome, .dt-toggle, .lang-toggle, .conbar, .scansheet, .console, #win-layer, .navmenu, .menu-btn { display: none; } }

/* ============================================================
   DTA UI KIT — design-system primitives ported to our tokens.
   Button · Field · Switch · StatusTag. Theme-aware (light/dark),
   keeps our accent/STIX; the spec is the DS .jsx/.prompt.md.
   ============================================================ */
/* — Button — */
.dta-btn { --_bg: var(--accent); --_fg: var(--on-accent); --_bd: transparent;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  border: 1px solid var(--_bd); background: var(--_bg); color: var(--_fg);
  border-radius: 2px; height: 36px; padding: 0 16px; cursor: pointer; text-decoration: none;
  -webkit-appearance: none; appearance: none; transition: background .12s, box-shadow .12s, color .12s, border-color .12s, transform .08s; }
.dta-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dta-btn:active { transform: translateY(1px); }
.dta-btn[disabled], .dta-btn[aria-disabled="true"] { opacity: .42; cursor: not-allowed; pointer-events: none; }
.dta-btn--primary { box-shadow: inset 0 1px 0 rgba(255,255,255,0.16); }   /* a lit key, not a flat chip */
.dta-btn--primary:hover { filter: brightness(1.07); }
.dta-btn--secondary { --_bg: transparent; --_fg: var(--ink); --_bd: var(--rule); }
.dta-btn--secondary:hover { --_bd: var(--accent); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dta-btn--ghost { --_bg: transparent; --_fg: var(--soft); --_bd: transparent; }
.dta-btn--ghost:hover { background: var(--hair); color: var(--ink); }
.dta-btn--sm { height: 28px; padding: 0 12px; font-size: 10px; }
.dta-btn--lg { height: 44px; padding: 0 24px; font-size: 14px; }
.dta-btn--block { width: 100%; }
.dta-btn__ico { display: inline-flex; width: 1.05em; height: 1.05em; flex: none; }
.dta-btn__ico svg { width: 100%; height: 100%; }
/* — Field — */
.dta-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.dta-field__label { font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; color: var(--mute); }
.dta-field__wrap { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px;
  background: color-mix(in srgb, var(--ink) 4%, transparent); border: 1px solid var(--hair); border-radius: 2px; transition: border-color .12s, box-shadow .12s; }
.dta-field__wrap:focus-within { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dta-field__ico { display: inline-flex; color: var(--mute); flex: none; }
.dta-field__input { flex: 1 1 auto; min-width: 0; border: 0; outline: 0; background: transparent; font-family: var(--mono); font-size: 13px; color: var(--ink); }
.dta-field__input::placeholder { color: var(--faint); }
.dta-field__hint { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.dta-field--error .dta-field__wrap { border-color: var(--accent); }
.dta-field--error .dta-field__hint { color: var(--accent); }
/* — Switch — */
.dta-switch { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; user-select: none; }
.dta-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.dta-switch__track { position: relative; width: 42px; height: 22px; flex: none; border-radius: 3px; background: color-mix(in srgb, var(--ink) 10%, transparent); border: 1px solid var(--rule); transition: background .12s, border-color .12s, box-shadow .12s; }   /* a square LED slot, not an iOS pill */
.dta-switch__thumb { position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 2px; background: var(--mute); box-shadow: inset 0 1px 0 rgba(255,255,255,0.18); transition: transform .14s cubic-bezier(0.3,0.8,0.4,1), background .12s; }   /* a key that travels */
.dta-switch input:checked + .dta-switch__track { background: color-mix(in srgb, var(--accent) 20%, transparent); border-color: var(--accent); }
.dta-switch input:checked + .dta-switch__track .dta-switch__thumb { transform: translateX(20px); background: var(--accent); box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 0 7px color-mix(in srgb, var(--accent) 55%, transparent); }
.dta-switch input:focus-visible + .dta-switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.dta-switch--disabled { opacity: .45; cursor: not-allowed; }
.dta-switch__label { font-family: var(--mono); font-size: 13px; color: var(--soft); }
/* — StatusTag — */
.dta-tag { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px;
  font-family: var(--mono); font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  border-radius: 2px; border: 1px solid var(--_bd, var(--rule)); color: var(--_fg, var(--soft)); background: var(--_bg, transparent); }
.dta-tag__dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }
.dta-tag__dot--live { box-shadow: 0 0 6px currentColor; animation: dta-blink 2s steps(1, end) infinite; }
@media (prefers-reduced-motion: reduce) { .dta-tag__dot--live { animation: none; } }
@keyframes dta-blink { 50% { opacity: 0.35; } }
/* text mixed toward --ink so it passes AA on the tint in BOTH themes (darkens in light, lightens in dark) — ANALYST a11y */
.dta-tag--ok { --_fg: color-mix(in srgb, var(--up) 62%, var(--ink)); --_bd: color-mix(in srgb, var(--up) 45%, transparent); --_bg: color-mix(in srgb, var(--up) 14%, transparent); }
.dta-tag--alert { --_fg: color-mix(in srgb, var(--accent) 62%, var(--ink)); --_bd: color-mix(in srgb, var(--accent) 48%, transparent); --_bg: color-mix(in srgb, var(--accent) 14%, transparent); }
.dta-tag--info { --_fg: color-mix(in srgb, var(--blue) 62%, var(--ink)); --_bd: color-mix(in srgb, var(--blue) 45%, transparent); --_bg: color-mix(in srgb, var(--blue) 14%, transparent); }
.dta-tag--amber { --_fg: color-mix(in srgb, var(--stale) 62%, var(--ink)); --_bd: color-mix(in srgb, var(--stale) 48%, transparent); --_bg: color-mix(in srgb, var(--stale) 14%, transparent); }

/* — Interact (.itx) — the citizen WRITE controls: signed ±1 vote + 1–5 rating on a
   datum (interaction:v0, device-key Ed25519 via /system/sign.js → POST /ingest).
   Instrument styling: hairline-topped row, square keys, directional colour (up =
   --up, down = --accent), the rating as a 5-LED level meter. Provenance stays the
   bass: a tiny "signed with your device key" note line, never a crypto hero. */
.itx { font-family: var(--mono); margin-top: 10px; padding-top: 9px; border-top: 0.5px solid var(--hair); }
.itx-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.itx-v { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 26px; padding: 0 8px;
  font-family: var(--mono); font-size: 12px; color: var(--soft); background: transparent;
  border: 1px solid var(--rule); border-radius: 3px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.itx-v:hover { color: var(--ink); background: var(--hair); }
.itx-v:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.itx-up.my { color: var(--up); border-color: var(--up); background: color-mix(in srgb, var(--up) 12%, transparent); font-weight: 600; }
.itx-dn.my { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); font-weight: 600; }
.itx-lbl { font-size: 9px; letter-spacing: 0.07em; text-transform: uppercase; color: var(--faint); flex: none; }
.itx-v .itx-w { font-size: 9.5px; letter-spacing: 0.04em; }
.itx-sep { width: 0.5px; height: 18px; background: var(--rule); margin: 0 2px; flex: none; }
.itx-rate { display: inline-flex; align-items: center; gap: 3px; }
.itx-r { width: 16px; height: 16px; padding: 0; border: 1px solid var(--rule); border-radius: 2px; background: color-mix(in srgb, var(--ink) 7%, transparent); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.itx-r:hover { border-color: var(--soft); }
.itx-r:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.itx-r { position: relative; }
.itx-r::after { content: attr(data-r); position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 8px; color: var(--faint); }
.itx-r.on { background: var(--accent); border-color: var(--accent); box-shadow: inset 0 1px 0 rgba(255,255,255,0.22); }
.itx-r.on::after { color: var(--on-accent); }
.itx-agg { font-size: 10px; color: var(--mute); letter-spacing: 0.03em; font-variant-numeric: tabular-nums; margin-left: 2px; }
.itx-note { font-size: 8.5px; letter-spacing: 0.05em; color: var(--faint); margin-top: 6px; }
.itx-note .ok { color: color-mix(in srgb, var(--up) 62%, var(--ink)); }
.itx-note .err { color: color-mix(in srgb, var(--accent) 62%, var(--ink)); }
.itx.busy { opacity: 0.55; pointer-events: none; }
.itx[hidden] { display: none; }

/* — Text figure (.txtwin) — shugam·text set in the SURFACE'S material (BOB:
   "the plot shall be TeX-like"): on PAPER pages + workspace windows it is INK
   ON PAPER — a TeX figure set in type (braille + box rules, hairline framing).
   PHOSPHOR is reserved for the true display surfaces (/led styles its own pre;
   /board). The material follows the surface, never the renderer. */
.txtwin { margin: 0; padding: 14px 16px; background: var(--paper); color: var(--ink);
  border: 1px solid var(--grid); border-radius: 2px;
  font-family: var(--mono); font-size: 12px; line-height: 1.35; white-space: pre; overflow: auto;
  font-variant-numeric: tabular-nums; }
.txtwin .dim { color: var(--mute); }

/* — Fit controls — standalone display surfaces (led/embeds on a wall): quiet
   corner buttons, full opacity on hover; never shown inside an iframe */
.fitctl { position: fixed; right: 10px; bottom: 10px; z-index: 90; display: flex; gap: 4px; opacity: 0.25; transition: opacity 0.2s; }
.fitctl:hover, .fitctl:focus-within { opacity: 1; }
.fitctl button { font-family: var(--mono); font-size: 11px; min-width: 30px; height: 26px; cursor: pointer;
  color: var(--mute); background: var(--bg); border: 1px solid var(--rule); border-radius: 4px; }
.fitctl button:hover { color: var(--ink); border-color: var(--soft); }

/* — Distro — Display · Embed · Share (the distribution affordance) */
.distro { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ─── THE SIGNAL PROTOCOL · motion vocabulary (canonical: web/DESIGN_SYSTEM.md).
   Every animation signals a STATE — nothing loops decoratively. The closed set:
     dta-flip   "this value CHANGED"     — per-digit flap flip, fires once
     cs-blink   "ready for input"        — the command-bar caret only
     dta-blink  "connected / receiving"  — the live dot (one per surface max)
     figflash   "new signed obs arrived" — cell flash, once per event
     dta-dots   "working"                — loading ellipsis
   Durations: state flips ≤ 350ms; blinks ≥ 1.15s period; nothing in between.
   Every member dies under prefers-reduced-motion. ─── */
@keyframes dta-flip { 0% { transform: rotateX(-90deg); } 55% { transform: rotateX(7deg); } 100% { transform: rotateX(0); } }
.flap-c.flip { animation: dta-flip 0.32s cubic-bezier(0.3,0.8,0.4,1) both; }
.dta-dots::after { content: '···'; display: inline-block; overflow: hidden; vertical-align: bottom; animation: dta-dots 1.2s steps(4, jump-none) infinite; width: 0; }
@keyframes dta-dots { to { width: 1.4em; } }
@media (prefers-reduced-motion: reduce) {
  .flap-c.flip { animation: none !important; }
  .dta-dots::after { animation: none; width: 1.4em; }
}

/* ─── STORY CARD — the atomic comprehension unit (ANALYST spec 2026-06-19).
   Self-contained on dta.css tokens so it ports to landing panels, /c heroes,
   /d, /board. icon · big number (count-up) · direction glyph (NEVER colour-
   alone — the ▲/▼ carries it, colour reinforces) · spark (draw-in) · plain-MN
   so-what · relatable signed-anchor units (tap to cycle) · verify→/d. Every
   motion dies under prefers-reduced-motion. ─── */
.story-card { position: relative; }
.sc-head { display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px; }
.sc-ico { width: 19px; height: 19px; flex-shrink: 0; color: var(--accent); align-self: center; }
.sc-lbl { font-family: var(--mono); font-size: 10px; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink); font-weight: 600; }
.sc-aside { margin-left: auto; text-align: right; font-family: var(--mono); }
.sc-numrow { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.sc-num { font-family: var(--mono); font-weight: 600; font-size: clamp(30px, 6.2vw, 46px); line-height: 1; letter-spacing: -0.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.sc-unit { font-family: var(--mono); font-size: 0.4em; color: var(--mute); font-weight: 400; margin-left: 3px; }
.sc-dir { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; display: inline-flex; align-items: baseline; gap: 4px; white-space: nowrap; }
.sc-gl { font-size: 0.85em; }
.sc-dir-good { color: var(--up); }      /* the move is good (e.g. reserves up) */
.sc-dir-bad  { color: var(--accent); }  /* the move hurts (e.g. inflation up, basket dearer) */
.sc-dir-neu  { color: var(--mute); }    /* a level, not a gain/loss — magnitude only */
.sc-dir-w { color: var(--faint); font-size: 0.85em; }
.sc-spark { display: block; width: 100%; height: 34px; margin: 11px 0 2px; color: var(--mute); }
.sc-spark.up { color: var(--up); } .sc-spark.dn { color: var(--accent); }   /* tint = direction of the citizen-felt move */
.sc-spark polyline { fill: none; stroke: currentColor; stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.sc-line { font-family: var(--serif); font-size: 13.5px; line-height: 1.45; color: var(--soft); margin: 8px 0 0; }
.sc-line .sc-draft { font-style: italic; color: var(--faint); }   /* MN copy pending BOB-commit */
/* the relatable bridge — the bass: a ₮ value spoken in things people hold */
.sc-rel { display: inline-flex; align-items: baseline; gap: 7px; margin: 11px 0 0; padding: 7px 11px; background: color-mix(in srgb, var(--accent) 5%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 4px; font-family: var(--mono); color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent; min-height: 24px; }
.sc-rel:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); }
.sc-rel:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sc-rel-ap { color: var(--mute); font-size: 13px; }
.sc-rel-n { font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.sc-rel-u { font-size: 13px; color: var(--soft); }
.sc-rel-cyc { margin-left: 4px; color: var(--accent); font-size: 13px; opacity: 0.7; }
.sc-rel.swap .sc-rel-n, .sc-rel.swap .sc-rel-u { animation: sc-relswap 0.34s ease; }
.sc-foot { display: flex; align-items: center; gap: 8px; margin-top: 11px; font-family: var(--mono); font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); }
.sc-foot .sc-verify { display: inline-flex; align-items: center; gap: 4px; color: var(--mute); text-decoration: none; }
.sc-foot .sc-verify:hover { color: var(--accent); }
.sc-foot .sc-qr { width: 13px; height: 13px; }
.sc-foot .sc-asof { margin-left: auto; }
.sc-foot .sc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--up); display: inline-block; }
.sc-foot .sc-dot.stale { background: var(--faint); }
@keyframes sc-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sc-relswap { 0% { opacity: 0.25; transform: translateY(2px); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: no-preference) {
  .sc-spark.draw polyline { stroke-dasharray: 1; stroke-dashoffset: 1; animation: sc-draw 0.9s ease 0.05s forwards; }
}
