/* ROOTWAR — app.css (client-shell). Design system v2 « ctOS // DedSec » (DESIGN.md): a cold surveillance HUD —
   square slabs, hairlines, bone-white type, OSD metadata in the periphery and ONE hot colour — vandalised by
   glitch graphics only at the big moments. Tokens, base, shared components, the application shell (HUD strip,
   rail, comms, console), modals, toasts, sheets, zero-day banner, verdict/alarm fallbacks and the boot screen.
   Colours ONLY through the theme variables (--bg --panel --fg --dim --accent --accent2 --danger --glow) and the
   tokens derived from them below, so every cosmetic theme restyles the whole UI.
   Breakpoints match ui/shell.js: mobile ≤ 767 px · tablet · desktop ≥ 1024 px (rail labels ≥ 1440 px). */

/* ---- fonts (self-hosted, SIL Open Font License — see public/fonts/OFL-*.txt) ------------------------------ */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/barlow-condensed-500.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("../fonts/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); }

/* ==========================================================================================================
   TOKENS (DESIGN.md §3). New names first, v1 names kept as aliases at the end of the block.
   ========================================================================================================== */
:root {
  /* type */
  --font-display: "Barlow Condensed", Bahnschrift, "Arial Narrow", system-ui, sans-serif;
  --font-ui: system-ui, -apple-system, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", "SFMono-Regular", Menlo, Consolas, monospace;
  --osd: 600 10.5px/1.2 var(--font-mono);

  /* surfaces, from the page up */
  --s0: var(--bg);
  --s1: var(--panel);
  --s2: color-mix(in srgb, var(--panel), var(--fg) 4%);
  --s3: color-mix(in srgb, var(--panel), var(--fg) 7%);
  --s4: color-mix(in srgb, var(--panel), var(--fg) 11%);

  /* hairlines */
  --hair: 1px;
  --line: color-mix(in srgb, var(--fg) 8%, transparent);
  --line-2: color-mix(in srgb, var(--fg) 15%, transparent);
  --line-3: color-mix(in srgb, var(--fg) 30%, transparent);
  --line-hot: color-mix(in srgb, var(--accent) 60%, transparent);

  /* text */
  --t1: var(--fg);
  --t2: color-mix(in srgb, var(--fg) 72%, var(--bg));
  --t3: var(--dim);
  --t-ink: color-mix(in srgb, var(--bg) 94%, var(--accent));

  /* semantic roles: HOT = actionable / you, INTEL = information / allies, HOSTILE = danger / enemies */
  --hot: var(--accent);
  --intel: var(--accent2);
  --hostile: var(--danger);
  --ok: var(--accent);
  --bad: var(--danger);
  --warn: var(--accent2);

  /* soft fills */
  --a-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --a-mid: color-mix(in srgb, var(--accent) 26%, transparent);
  --a-line: color-mix(in srgb, var(--accent) 50%, transparent);
  --a2-soft: color-mix(in srgb, var(--accent2) 12%, transparent);
  --a2-line: color-mix(in srgb, var(--accent2) 50%, transparent);
  --d-soft: color-mix(in srgb, var(--danger) 13%, transparent);
  --d-line: color-mix(in srgb, var(--danger) 55%, transparent);

  /* motion */
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.7, 0, .84, 0);
  --ease-snap: cubic-bezier(.2, 1.4, .4, 1);
  --dur-1: 120ms;
  --dur-2: 220ms;
  --dur-3: 420ms;
  --dur-4: 900ms;

  /* geometry */
  --r: 0;
  --r-in: 2px;
  --top-h: 52px;
  --nav-w: 64px;
  --chat-w: 320px;
  --nav-h: 48px;
  --term-strip: 36px;
  --term-h: 220px;
  --tab-h: 58px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --pad-x: 32px;
  --pad-y: 28px;

  /* texture: fractal noise (grayscale), used once on the page background by .grain / the shell */
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");

  /* ---- v1 aliases (view stylesheets written against v1 keep working) ---- */
  --fx-mono: var(--font-mono);
  --ink: var(--t-ink);
  --ease: var(--ease-out);
  --glass: var(--s1);
  --panel-glass: var(--s1);
  --panel-2: var(--s3);
  --tint: var(--a-soft);
  --tint-2: var(--a2-soft);
  --tint-bad: var(--d-soft);
  --shadow: 0 18px 44px -28px color-mix(in srgb, var(--bg) 96%, transparent);
  --shadow-lg: 0 30px 80px -30px color-mix(in srgb, var(--bg) 98%, transparent);
  --r-sm: var(--r-in);
  --cut: 0px;                 /* v1 chamfers are retired: every legacy clip-path collapses to a square */
  --cut-s: 0px;
}
@media (min-width: 1440px) { :root { --nav-w: 200px; --chat-w: 336px; } }

/* ==========================================================================================================
   BASE
   ========================================================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--bg);
  color: var(--t1);
  font: 14px/1.5 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--intel); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--t1); }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 700; }
p { margin: 0 0 .6em; }
p:last-child { margin-bottom: 0; }
ul, ol { margin: 0; padding: 0; }
code, kbd, samp { font-family: var(--font-mono); font-size: .9em; }
kbd {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--t2);
  font: var(--osd);
  letter-spacing: 0;
}
::selection { background: var(--a-mid); color: var(--t1); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }
[hidden] { display: none !important; }
* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--line-2); }
::-webkit-scrollbar-thumb:hover { background: var(--line-3); }
::-webkit-scrollbar-track { background: transparent; }

/* ---- type utilities ---- */
.num { font-family: var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.muted { color: var(--t3); }
.small { font-size: 12px; }
.ok { color: var(--ok); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.hot { color: var(--hot); }
.intel { color: var(--intel); }
.hostile { color: var(--hostile); }
/* OSD — camera-feed metadata (mono, uppercase, tracked). The only letter-spaced uppercase in the UI. */
.osd, .label, .field-label, .stat-label {
  color: var(--t3);
  font: var(--osd);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.osd.t1 { color: var(--t1); }
.osd.t2 { color: var(--t2); }
.osd.hot { color: var(--hot); }
.osd.intel { color: var(--intel); }
.osd.hostile { color: var(--hostile); }
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: fixed;
  left: 8px; top: 8px;
  z-index: 100;
  padding: 9px 14px;
  background: var(--hot);
  color: var(--t-ink);
  font: 700 14px/1 var(--font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
  transform: translateY(-160%);
  transition: transform var(--dur-1) var(--ease-out);
}
.skip-link:focus { transform: none; }
/* grain: noise texture, applied ONCE to the page background (the shell uses it on its ::after) */
.grain { position: relative; }
.grain::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--noise);
  opacity: .035;
}

/* ---- icons ---- */
.ico { display: inline-flex; width: 18px; height: 18px; flex: none; }
.ico svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: miter; }
/* currency marks (common.js money): hexagonal credit token · faceted shard crystal — theme-driven colours */
.money { display: inline-flex; flex: none; width: var(--ms, 16px); height: var(--ms, 16px); vertical-align: -.18em; line-height: 0; }
.money svg { width: 100%; height: 100%; overflow: visible; }
.money-credits .mn-coin { fill: var(--hot); }
.money-credits .mn-rim { fill: none; stroke: var(--t-ink); stroke-opacity: .3; stroke-width: 1; }
.money-credits .mn-mark { fill: none; stroke: var(--t-ink); stroke-width: 2.3; stroke-linecap: square; stroke-linejoin: miter; }
.money-shards .mn-l { fill: var(--intel); }
.money-shards .mn-r { fill: color-mix(in srgb, var(--intel) 52%, var(--bg)); }
.money-shards .mn-t { fill: color-mix(in srgb, var(--intel) 45%, var(--fg)); }
.money-shards .mn-e { fill: none; stroke: color-mix(in srgb, var(--intel) 35%, var(--fg)); stroke-width: .7; stroke-linejoin: round; opacity: .75; }
.money.dim .mn-coin, .money.dim .mn-l { fill: var(--t3); }
.money.dim .mn-r { fill: color-mix(in srgb, var(--t3) 55%, var(--bg)); }
.money.dim .mn-t { fill: color-mix(in srgb, var(--t3) 60%, var(--fg)); }
/* on a hot (filled) surface the coin inverts: ink token, hot mark */
.btn.primary .money-credits .mn-coin, .money.ink .mn-coin { fill: var(--t-ink); }
.btn.primary .money-credits .mn-mark, .btn.primary .money-credits .mn-rim, .money.ink .mn-mark, .money.ink .mn-rim { stroke: var(--hot); stroke-opacity: 1; }
/* data (v3): stacked data core — lit intel faces over shaded bands, a hot index notch on the top platter */
.money-data .mn-ds { fill: color-mix(in srgb, var(--intel) 46%, var(--bg)); }
.money-data .mn-df { fill: var(--intel); stroke: color-mix(in srgb, var(--intel) 38%, var(--bg)); stroke-width: .5; }
.money-data .mn-dt { fill: color-mix(in srgb, var(--intel) 78%, var(--fg)); }
.money-data .mn-dn { fill: var(--hot); }
.money-data.dim .mn-df, .money-data.dim .mn-dn { fill: var(--t3); }
.money-data.dim .mn-dt { fill: color-mix(in srgb, var(--t3) 70%, var(--fg)); }
.money-data.dim .mn-ds { fill: color-mix(in srgb, var(--t3) 50%, var(--bg)); }
.money-data.dim .mn-df { stroke: color-mix(in srgb, var(--t3) 40%, var(--bg)); }
.btn.primary .money-data .mn-df, .btn.primary .money-data .mn-dt, .money-data.ink .mn-df, .money-data.ink .mn-dt { fill: var(--t-ink); stroke: none; }
.btn.primary .money-data .mn-ds, .money-data.ink .mn-ds { fill: color-mix(in srgb, var(--t-ink) 62%, var(--hot)); }
.btn.primary .money-data .mn-dn, .money-data.ink .mn-dn { fill: var(--hot); }
.glyph { font-family: var(--font-display); font-weight: 700; font-size: 17px; line-height: 1; }
/* program / tech glyphs (shared/glyphs.js): stroke drawings in currentColor, sized by their width/height attributes */
svg.glyph { display: inline-block; flex: none; vertical-align: middle; overflow: visible; }

/* ==========================================================================================================
   BUTTONS (DESIGN.md §5): square, 36 px, display 14 px uppercase. Hover = a wipe sweeping left → right
   (::before scales from the left, leaves to the right), press = 1 px down. ::after is free for states.
   ========================================================================================================== */
.btn {
  --bc: var(--line-2);                 /* border */
  --bf: var(--s2);                     /* fill */
  --fc: var(--t1);                     /* text */
  --wipe: var(--s4);                   /* hover wipe */
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--bc);
  border-radius: 0;
  background: var(--bf);
  color: var(--fc);
  font: 600 14px/1 var(--font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
  overflow: hidden;
  isolation: isolate;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur-1), border-color var(--dur-1), transform 60ms;
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--wipe);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform var(--dur-1) var(--ease-in);
  pointer-events: none;
}
.btn:hover:not(:disabled)::before { transform: scaleX(1); transform-origin: left center; transition: transform var(--dur-2) var(--ease-out); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; }
.btn:disabled { opacity: .4; }
.btn .ico { width: 16px; height: 16px; }
.btn > span { position: relative; }
.btn.primary { --bc: var(--hot); --bf: var(--hot); --fc: var(--t-ink); --wipe: color-mix(in srgb, var(--hot), var(--bg) 24%); font-weight: 700; }
.btn.primary:focus-visible { outline-color: var(--t1); }
.btn.danger { --bc: var(--hostile); --bf: var(--hostile); --fc: color-mix(in srgb, var(--bg) 94%, var(--danger)); --wipe: color-mix(in srgb, var(--hostile), var(--bg) 26%); font-weight: 700; }
.btn.danger:focus-visible { outline-color: var(--t1); }
.btn.ghost { --bc: var(--line-2); --bf: transparent; --fc: var(--t2); --wipe: color-mix(in srgb, var(--fg) 6%, transparent); }
.btn.ghost:hover:not(:disabled) { --bc: var(--t2); --fc: var(--t1); }
.btn.alt { --bc: var(--a2-line); --bf: transparent; --fc: var(--intel); --wipe: var(--a2-soft); }
.btn.alt:hover:not(:disabled) { --bc: var(--intel); --fc: var(--t1); }
.btn:not(.primary):not(.danger):not(.ghost):not(.alt):hover:not(:disabled) { --bc: var(--line-3); }
.btn.sm { min-height: 32px; padding: 0 12px; font-size: 13px; gap: 6px; }
.btn.sm .ico { width: 14px; height: 14px; }
.btn.lg { min-height: 44px; padding: 0 26px; font-size: 16px; }
.btn.block { width: 100%; }
/* busy: a scanning bar along the bottom edge (live status, may loop) */
.btn.busy { pointer-events: none; }
.btn.busy > span { opacity: .6; }
.btn.busy::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent) no-repeat;
  background-size: 40% 100%;
  animation: btn-busy 1s linear infinite;
}
@keyframes btn-busy { from { background-position: -60% 0; } to { background-position: 160% 0; } }
/* hold: press-and-hold hostile actions (common.js holdBtn). --p (0..1) drives the fill; .held flashes once. */
.btn.hold { --p: 0; }
.btn.hold .hold-fill {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--fc) 26%, transparent);
  transform: scaleX(var(--p));
  transform-origin: left center;
  pointer-events: none;
}
.btn.hold .hold-fill::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 2px; background: var(--fc); opacity: calc(var(--p) * 4); }
.btn.hold.holding { transform: translateY(1px); }
.btn.hold.held { animation: hold-done .4s var(--ease-out); }
@keyframes hold-done { 0% { filter: brightness(1.8); } 100% { filter: none; } }
.btn.hold.nudge { animation: hold-nudge .3s linear; }
@keyframes hold-nudge { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--t3);
  transition: color var(--dur-1), background-color var(--dur-1), border-color var(--dur-1);
}
.icon-btn:hover { color: var(--t1); background: var(--s3); }
.icon-btn[aria-pressed="true"] { color: var(--t1); border-color: var(--line-2); }
.icon-btn.off { color: color-mix(in srgb, var(--dim) 60%, transparent); }
.icon-btn .ico { width: 18px; height: 18px; }
.link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--intel);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.link-btn:hover { color: var(--t1); }

/* ==========================================================================================================
   SLABS (replace cards): --s1, hairline, radius 0, no shadow. Head = display title left + OSD right.
   ========================================================================================================== */
.slab, .card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--s1);
}
.slab-head, .card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  min-height: 44px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--line);
}
.slab-title, .card-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--t1);
  font: 600 16px/1.1 var(--font-display);
  letter-spacing: .03em;
  text-transform: uppercase;
}
.slab-title .ico, .card-title .ico { width: 16px; height: 16px; color: var(--t3); }
.slab-osd { color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.slab-body, .card-body { padding: 16px; }
.card-foot, .slab-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}
.card.danger, .slab.danger { border-color: var(--d-line); }
.card.danger::before, .slab.danger::before { content: ''; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; background: var(--hostile); }
.corner { position: relative; }

/* Lock brackets: four hot L-corners = "this is locked on" (targeted / selected / mine). They snap in from
   outside. .card.corner (hero slabs) gets the same frame in a neutral line colour. */
.lock-on, .card.glow { position: relative; }
.lock-on::after, .card.glow::after, .card.corner::after {
  --lk: var(--hot);
  --lz: 10px;
  --lw: 2px;
  content: '';
  position: absolute;
  inset: -1px;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(var(--lk), var(--lk)) left top / var(--lz) var(--lw),
    linear-gradient(var(--lk), var(--lk)) left top / var(--lw) var(--lz),
    linear-gradient(var(--lk), var(--lk)) right top / var(--lz) var(--lw),
    linear-gradient(var(--lk), var(--lk)) right top / var(--lw) var(--lz),
    linear-gradient(var(--lk), var(--lk)) left bottom / var(--lz) var(--lw),
    linear-gradient(var(--lk), var(--lk)) left bottom / var(--lw) var(--lz),
    linear-gradient(var(--lk), var(--lk)) right bottom / var(--lz) var(--lw),
    linear-gradient(var(--lk), var(--lk)) right bottom / var(--lw) var(--lz);
  background-repeat: no-repeat;
}
.lock-on::after, .card.glow::after { animation: lock-on var(--dur-2) var(--ease-out) both; }
.card.corner::after { --lk: var(--line-3); --lz: 12px; --lw: 1px; }
.card.corner.glow::after, .card.corner.lock-on::after { --lk: var(--hot); --lz: 10px; --lw: 2px; }
.lock-on.hostile::after { --lk: var(--hostile); }
.lock-on.intel::after { --lk: var(--intel); }
@keyframes lock-on { from { inset: -9px; opacity: 0; } 60% { opacity: 1; } }

/* ==========================================================================================================
   TAGS (were chips), dots, badges, identity bits
   ========================================================================================================== */
.tag, .chip {
  --cc: var(--t2);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 18px;
  padding: 0 6px;
  border: 1px solid color-mix(in srgb, var(--cc) 34%, transparent);
  border-radius: 0;
  background: transparent;
  color: var(--cc);
  font: var(--osd);
  letter-spacing: .08em;
  line-height: 16px;
  text-transform: uppercase;
  white-space: nowrap;
  vertical-align: middle;
}
.tag.hot, .chip.ok, .chip.accent { --cc: var(--hot); }
.tag.hostile, .chip.bad { --cc: var(--hostile); }
.tag.intel, .chip.warn, .chip.alt { --cc: var(--intel); }
.tag.dim, .chip.dim { --cc: var(--t3); }
.tag.fill { border-color: var(--cc); background: var(--cc); color: var(--t-ink); }
.tag.hot.fill { color: var(--t-ink); }
.tag.hostile.fill { color: color-mix(in srgb, var(--bg) 94%, var(--danger)); }
.tag .ico, .chip .ico { width: 12px; height: 12px; }
.chip.link { cursor: pointer; transition: border-color var(--dur-1), color var(--dur-1); }
.chip.link:hover { border-color: var(--cc); color: var(--t1); }
/* v1 "pill" (floating notice buttons): a flat hot tag-button now */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: var(--hot);
  color: var(--t-ink);
  font: 700 12px/1 var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.dot {
  display: inline-block;
  width: 6px; height: 6px;
  flex: none;
  background: var(--line-3);
}
.dot.on { background: var(--hot); }
.dot.bad { background: var(--hostile); }
.dot.intel { background: var(--intel); }
.badge-glyph { display: inline-flex; flex: none; width: 1.1em; height: 1.1em; margin-right: 4px; color: var(--c, var(--hot)); vertical-align: -.2em; line-height: 0; }
.badge-glyph svg { width: 100%; height: 100%; overflow: visible; }
.crew-tag { color: var(--crew, var(--intel)); font: 700 13px/1 var(--font-display); letter-spacing: .06em; margin-right: 5px; }
/* titles: one treatment per rarity — // comment, [bracketed], violet rule, gold tape */
.ptitle { display: block; width: fit-content; max-width: 100%; color: var(--t3); font: 500 10.5px/1.35 var(--font-mono); font-style: normal; letter-spacing: .06em; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptitle[data-rarity="common"]::before { content: '// '; opacity: .6; }
.ptitle[data-rarity="rare"] { color: var(--rar-rare); }
.ptitle[data-rarity="rare"]::before { content: '['; margin-right: 2px; opacity: .7; }
.ptitle[data-rarity="rare"]::after { content: ']'; margin-left: 2px; opacity: .7; }
.ptitle[data-rarity="epic"] { padding-left: 7px; color: var(--rar-epic); box-shadow: inset 2px 0 0 var(--rar-epic); }
.ptitle[data-rarity="legendary"] { padding: 0 6px; color: var(--t-ink); background: var(--rar-legendary); font-weight: 700; box-shadow: 2px 2px 0 color-mix(in srgb, var(--rar-legendary) 35%, transparent); }
.pname { font-weight: 600; }
.avatar { position: relative; display: inline-block; flex: none; width: var(--size, 40px); height: var(--size, 40px); line-height: 0; }
.avatar svg { width: 100%; height: 100%; }
.avatar.on::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 7px; height: 7px; background: var(--hot); box-shadow: 0 0 0 2px var(--s1); }
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 20px;
  border: 1px solid color-mix(in srgb, var(--tier, var(--dim)) 55%, transparent);
  border-radius: 0;
  background: color-mix(in srgb, var(--tier, var(--dim)) 10%, transparent);
  color: var(--tier, var(--t1));
  font: 700 12px/18px var(--font-display);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tier-badge .tier-name { padding: 0 7px; }
.tier-badge .tier-elo { padding: 0 7px; border-left: 1px solid color-mix(in srgb, var(--tier, var(--dim)) 40%, transparent); color: var(--t1); font-weight: 600; letter-spacing: .03em; }

/* ==========================================================================================================
   METERS: 4 px, square ends. .seg = 10 segments with 2 px gaps (continuous fill, masked). .segs = discrete pips.
   ========================================================================================================== */
.meter {
  position: relative;
  height: 4px;
  overflow: hidden;
  background: var(--line);
}
.meter > i {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  background: var(--hot);
  transition: transform var(--dur-3) var(--ease-out);
}
.meter.alt > i, .meter.intel > i { background: var(--intel); }
.meter.bad > i, .meter.low > i { background: var(--hostile); }
.meter.dim > i { background: var(--t2); }
.meter.thin { height: 2px; }
.meter.thick { height: 6px; }
.meter.seg {
  height: 6px;
  -webkit-mask-image: repeating-linear-gradient(90deg, var(--fg) 0 calc(10% - 2px), transparent calc(10% - 2px) 10%);
  mask-image: repeating-linear-gradient(90deg, var(--fg) 0 calc(10% - 2px), transparent calc(10% - 2px) 10%);
}
.meter.timed > i { transition: none; }
.meter.timed.fill > i { animation: meter-fill var(--dur, 1s) linear var(--delay, 0s) both; }
.meter.timed.drain > i { animation: meter-drain var(--dur, 1s) linear var(--delay, 0s) both; }
@keyframes meter-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes meter-drain { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.segs { display: flex; gap: 2px; height: 6px; }
.segs > i { flex: 1 1 0; min-width: 2px; background: var(--line-2); transition: background-color var(--dur-2); }
.segs > i.on { background: var(--hot); }
.segs.intel > i.on { background: var(--intel); }
.segs.hostile > i.on, .segs.bad > i.on { background: var(--hostile); }
.segs.tall { height: 10px; }

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--line-2);
  border-top-color: var(--hot);
  border-radius: 0;
  animation: spin .9s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================================================
   TABS: text tabs, one 2 px hot ink sliding between them (common.js tabs() positions .tabs-ink).
   ========================================================================================================== */
.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--line);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  background: transparent;
  color: var(--t3);
  font: 600 15px/1 var(--font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--dur-1);
}
.tab::after {
  content: '';
  position: absolute;
  left: 10px; right: 10px; bottom: -1px;
  height: 2px;
  background: var(--hot);
  transform: scaleX(0);
  transition: transform var(--dur-2) var(--ease-out);
}
.tab:hover { color: var(--t1); }
.tab.on, .tab[aria-selected="true"] { color: var(--t1); }
.tab.on::after { transform: scaleX(1); }
.tabs.has-ink .tab::after { display: none; }
.tabs-ink {
  position: absolute;
  left: 0; bottom: 0;
  width: var(--ink-w, 0px);
  height: 2px;
  background: var(--hot);
  transform: translateX(var(--ink-x, 0px));
  pointer-events: none;
}
.tabs.ink-ready .tabs-ink { transition: transform var(--dur-2) var(--ease-out), width var(--dur-2) var(--ease-out); }
.tab-badge, .nav-badge {
  display: inline-grid;
  place-items: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 0;
  background: var(--hot);
  color: var(--t-ink);
  font: 700 11px/1 var(--font-display);
  letter-spacing: 0;
}
/* hostile badge: something is coming at me (incoming raid) */
.tab-badge.hostile, .nav-badge.hostile { background: var(--hostile); color: color-mix(in srgb, var(--bg) 94%, var(--danger)); }

/* ==========================================================================================================
   STATS & KEY/VALUE: numbers big and white, labels small OSD. Stat rows are divided by hairlines.
   ========================================================================================================== */
.stat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 14px 16px 12px;
  box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line);
}
.stat-val { color: var(--t1); font: 700 28px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: .01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stat-sub { color: var(--t3); font-size: 12px; }
.stat.accent::before { content: ''; position: absolute; left: 0; top: 0; width: 18px; height: 2px; background: var(--hot); }
.stat.danger .stat-val { color: var(--hostile); }
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--s1);
}
.stat-row > .stat { margin: 0 0 0 1px; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.sg-item { padding: 12px 14px; background: var(--s1); }
.sg-item dt { margin: 0; color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; }
.sg-item dd { margin: 6px 0 0; font: 700 22px/1 var(--font-display); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 0 16px; margin: 0; }
.kv > dt, .kv > dd { padding: 7px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; align-self: center; }
.kv dd { margin: 0; text-align: right; color: var(--t1); }
.kv-mini { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }

/* ---- rows & tables: 44 px rows, hairline separators, hover = --s3 + 2 px hot left edge ---- */
.rows { display: grid; list-style: none; border-top: 1px solid var(--line); }
.row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--line);
  transition: background-color var(--dur-1);
}
.row::before, .tbl tbody tr > :first-child::before {
  content: '';
  position: absolute;
  left: 0; top: -1px; bottom: -1px;
  width: 2px;
  background: var(--hot);
  transform: scaleY(0);
  transition: transform var(--dur-1) var(--ease-out);
}
.row:hover, .row.on, .tbl tbody tr:hover { background: var(--s3); }
.row:hover::before, .row.on::before, .tbl tbody tr:hover > :first-child::before { transform: scaleY(1); }
.row .r-grow { flex: 1 1 auto; min-width: 0; }
.row .r-num { margin-left: auto; font: 700 16px/1 var(--font-display); text-align: right; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { padding: 0 12px 8px; color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; text-align: left; border-bottom: 1px solid var(--line-2); }
.tbl td { height: 44px; padding: 4px 12px; border-bottom: 1px solid var(--line); }
.tbl tbody tr > :first-child { position: relative; }
.tbl .n, .tbl th.n { text-align: right; font-family: var(--font-display); font-size: 15px; font-weight: 700; }

/* ---- empty state: "no signal" slot ---- */
.empty {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 30px 16px;
  border: 1px dashed var(--line-2);
  color: var(--t3);
  text-align: center;
}
.empty::before { content: 'NO SIGNAL'; color: var(--t3); font: var(--osd); letter-spacing: .2em; opacity: .7; }
.empty p { margin: 0; max-width: 36em; }

/* ==========================================================================================================
   FORMS: --s3 fill, hairline, 2 px radius, focus = hot border (no glow)
   ========================================================================================================== */
.form { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; }
.field > label { color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; }
.field-hint { color: var(--t3); font-size: 12px; }
.form-err { margin: 0; padding-left: 10px; border-left: 2px solid var(--hostile); color: var(--hostile); font-size: 13px; }
.form-err:empty { display: none; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
input[type="text"], input[type="password"], input[type="search"], input[type="number"], input[type="email"], input:not([type]), select, textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-in);
  background: var(--s3);
  color: var(--t1);
  font: 14px/1.4 var(--font-ui);
  transition: border-color var(--dur-1), background-color var(--dur-1);
}
select {
  appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--t2) 50%), linear-gradient(135deg, var(--t2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--dim) 85%, transparent); }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { border-color: var(--hot); outline: none; background-color: var(--s2); }
input[aria-invalid="true"] { border-color: var(--hostile); }
input[type="color"] { width: 46px; height: 38px; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-in); background: transparent; }
textarea { min-height: 76px; resize: vertical; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; accent-color: var(--hot); }
/* switch: a square track with a square knob */
.switch {
  position: relative;
  flex: none;
  width: 40px; height: 20px;
  padding: 0;
  border: 1px solid var(--line-3);
  border-radius: 0;
  background: transparent;
  transition: border-color var(--dur-1), background-color var(--dur-1);
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 12px; height: 12px;
  background: var(--t3);
  transition: transform var(--dur-2) var(--ease-out), background-color var(--dur-1);
}
.switch[aria-checked="true"] { border-color: var(--hot); background: var(--a-soft); }
.switch[aria-checked="true"]::after { transform: translateX(20px); background: var(--hot); }
.seg { display: inline-flex; border: 1px solid var(--line-2); overflow: hidden; }
.seg button { min-height: 32px; padding: 0 14px; border: 0; background: transparent; color: var(--t3); font: 600 14px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; transition: color var(--dur-1), background-color var(--dur-1); }
.seg button + button { border-left: 1px solid var(--line-2); }
.seg button:hover { color: var(--t1); }
.seg button[aria-pressed="true"] { background: var(--t1); color: var(--bg); }

/* ==========================================================================================================
   SHELL LAYOUT (DESIGN.md §8): HUD strip · rail · main · comms · console
   ========================================================================================================== */
.shell {
  display: grid;
  height: 100vh;
  height: 100dvh;
  grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--chat-w);
  grid-template-rows: var(--top-h) minmax(0, 1fr) auto;
  grid-template-areas:
    "top top top"
    "nav main chat"
    "nav term chat";
}
/* static ctOS city grid: fallback while the canvas backdrop (fx.startBackdrop) is not running */
.shell::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--fg) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--fg) 4%, transparent) 1px, transparent 1px),
    linear-gradient(color-mix(in srgb, var(--fg) 2%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--fg) 2%, transparent) 1px, transparent 1px);
  background-size: 192px 192px, 192px 192px, 32px 32px, 32px 32px;
  background-position: -1px -1px;
}
html.backdrop-on .shell::before { display: none; }
/* grain, once, under everything */
.shell::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--noise);
  opacity: .035;
}
.topbar { grid-area: top; }
.sidenav { grid-area: nav; }
.main { grid-area: main; }
.chat { grid-area: chat; }
.term { grid-area: term; }
.tabbar, .nav-item.nav-chat { display: none; }

.main {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  /* the city backdrop stays visible as texture but never competes with view content */
  background: color-mix(in srgb, var(--bg) 70%, transparent);
}
.main:focus { outline: none; }
.views { position: relative; min-height: 100%; padding: var(--pad-y) var(--pad-x) 48px; }
.view { max-width: 1280px; }
.view-network { max-width: none; }
/* entrance fallback when fx.reveal is unavailable (html.fx-ready = the FX module is loaded) */
html:not(.fx-ready) .view:not(.view-leave) { animation: view-in var(--dur-3) var(--ease-out) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
/* outgoing view: kept on screen for 90 ms, absolutely placed over the incoming one (ui/view.js) */
.view.view-leave {
  position: absolute;
  top: var(--pad-y);
  left: var(--pad-x);
  right: var(--pad-x);
  z-index: 1;
  pointer-events: none;
  animation: view-out 90ms var(--ease-in) forwards;
}
@keyframes view-out { to { opacity: 0; transform: translateY(-6px); } }

/* ---- view header: big display title + OSD line (NODE://…), tools right ---- */
.view-head {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.view-head::after { content: ''; position: absolute; left: 0; bottom: -1px; width: 28px; height: 1px; background: var(--t1); }
.view-heading { display: grid; gap: 8px; min-width: 0; }
.view-title {
  margin: 0;
  color: var(--t1);
  font: 700 clamp(30px, 2.6vw, 36px)/.95 var(--font-display);
  letter-spacing: .02em;
  text-transform: uppercase;
}
.view-title:focus { outline: none; }
.view-osd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  margin: 0;
  color: var(--t3);
  font: var(--osd);
  letter-spacing: .08em;
  text-transform: uppercase;
}
.view-osd > :empty { display: none; }
.view-osd > * + *::before { content: '·'; margin: 0 .8em; color: var(--line-3); }
.view-osd .vo-code { color: var(--t2); }
.view-sub { margin: 0; max-width: 62ch; color: var(--t3); font-size: 13.5px; }
.view-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.view-kicker { display: none; }         /* v1 numbered eyebrow: retired */
.view-error code { display: block; margin-top: 8px; word-break: break-word; }
.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 32px 0 12px;
  color: var(--t1);
  font: 600 16px/1.1 var(--font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.section-title::after { content: ''; flex: 1 1 auto; height: 1px; background: var(--line); }
.sub-title { margin: 18px 0 8px; color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }

.shell.is-offline .main { filter: saturate(.45) brightness(.88); }
.shell.no-me .tb-stats, .shell.no-me .tb-id { visibility: hidden; }

/* ==========================================================================================================
   HUD STRIP (top, 52 px): brand · identity · credits · data · shards · rep · tier ··· OSD (shield, ops, squads,
   compute, season, online, link, clock) · tools
   ========================================================================================================== */
.topbar {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: stretch;
  min-width: 0;
  border-bottom: 1px solid var(--line);
  background: var(--s1);
}
.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: none;
  width: var(--nav-w);
  padding: 0;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--t1);
}
.brand-mark { display: inline-flex; width: 26px; height: 26px; color: var(--t1); flex: none; transition: color var(--dur-1); }
.brand-mark svg { width: 100%; height: 100%; }
.brand:hover .brand-mark { color: var(--hot); animation: brand-glitch .3s steps(2, end); }
@keyframes brand-glitch { 0% { transform: translate(2px, -1px); } 50% { transform: translate(-2px, 1px); } 100% { transform: none; } }
.brand-name { display: none; font: 700 20px/1 var(--font-display); letter-spacing: .2em; padding-left: .2em; }
@media (min-width: 1440px) { .brand { justify-content: flex-start; padding: 0 20px; } .brand-name { display: inline; } }

/* identity: square avatar inside a square XP "ring", level tag, name + OSD line */
.tb-id {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  max-width: 230px;
  padding: 0 16px 0 12px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--t1);
  text-align: left;
  transition: background-color var(--dur-1);
}
.tb-id:hover { background: var(--s2); }
.tb-av { position: relative; display: grid; place-items: center; flex: none; width: 40px; height: 40px; }
.tb-ring { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tb-ring rect { fill: none; stroke-width: 2; }
.tb-ring .tb-ring-t { stroke: var(--line-2); }
.tb-ring .tb-ring-p { stroke: var(--hot); stroke-dasharray: 100 100; stroke-linecap: butt; transition: stroke-dashoffset var(--dur-3) var(--ease-out); }
.tb-avatar { display: block; width: 30px; height: 30px; line-height: 0; }
.tb-avatar .avatar { --size: 30px; }
.tb-lvl {
  position: absolute;
  right: -6px; bottom: -5px;
  min-width: 18px;
  height: 15px;
  padding: 0 3px;
  background: var(--hot);
  color: var(--t-ink);
  font: 700 12px/15px var(--font-display);
  text-align: center;
}
.tb-idt { display: grid; gap: 3px; min-width: 0; }
.tb-name { overflow: hidden; font: 600 15px/1.05 var(--font-display); letter-spacing: .02em; text-overflow: ellipsis; white-space: nowrap; }
.tb-name .pname { font-weight: 600; }
.tb-idsub { color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; }
.tb-id.bump .tb-av { animation: tb-bump .9s var(--ease-out); }

.tb-stats { display: flex; align-items: stretch; min-width: 0; flex: 0 1 auto; }
.hud-i {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--t1);
  text-align: left;
  white-space: nowrap;
}
button.hud-i { transition: background-color var(--dur-1); }
button.hud-i:hover { background: var(--s2); }
.hud-k { display: flex; align-items: baseline; gap: 8px; color: var(--t3); font: 600 9.5px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }
.hud-v { display: flex; align-items: baseline; gap: 6px; font: 700 20px/1 var(--font-display); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.tb-credits { min-width: 150px; }
.tb-cur { display: inline-flex; align-items: center; line-height: 0; }
.tb-val { display: inline-block; color: var(--t1); font-size: 22px; }
.tb-inc { color: var(--hot); letter-spacing: .04em; }
.tb-bank { position: absolute; left: 16px; right: 16px; bottom: 6px; height: 2px; }
.tb-credits.full .tb-bank > i { background: var(--intel); }
.tb-credits.full .tb-inc { color: var(--t3); text-decoration: line-through; }
.tb-credits.gain .tb-val { animation: tb-gain .9s var(--ease-out); }
.tb-credits.loss .tb-val { animation: tb-loss .7s linear; }
@keyframes tb-gain { 15% { color: var(--hot); } }
@keyframes tb-loss { 10%, 50% { color: var(--hostile); transform: translateX(-2px); } 30% { transform: translateX(2px); } 70% { transform: none; } }
.tb-float {
  position: absolute;
  left: 16px; top: calc(100% - 4px);
  z-index: 6;
  padding: 2px 6px;
  font: 700 14px/1 var(--font-display);
  pointer-events: none;
  animation: tb-float 1.3s var(--ease-out) forwards;
}
.tb-float.up { background: var(--hot); color: var(--t-ink); }
.tb-float.down { background: var(--hostile); color: color-mix(in srgb, var(--bg) 94%, var(--danger)); }
@keyframes tb-float { from { opacity: 0; transform: translateY(-6px); } 12% { opacity: 1; transform: none; } 70% { opacity: 1; } to { opacity: 0; transform: translateY(10px); } }
/* data (v3): same readout as credits; intel is its colour where credits are hot (DESIGN.md §9) */
.tb-data { min-width: 132px; }
.tb-data .tb-inc { color: var(--intel); }
.tb-data .tb-store > i { background: var(--intel); }
.tb-data.full .tb-store > i { background: var(--t2); }
.tb-data.full .tb-inc { color: var(--t3); text-decoration: line-through; }
.tb-data.gain .tb-val { animation: tb-gain-intel .9s var(--ease-out); }
.tb-data.loss .tb-val { animation: tb-loss .7s linear; }
@keyframes tb-gain-intel { 15% { color: var(--intel); } }
.tb-data .tb-float { display: inline-flex; align-items: center; gap: 3px; }
.tb-data .tb-float.up { background: var(--intel); color: var(--t-ink); }
.tb-data .tb-float .money { --ms: 12px; }
.tb-gem { display: inline-flex; align-items: center; line-height: 0; }
.tb-shards.bump .hud-v, .tb-rep.bump .hud-v { animation: tb-bump .9s var(--ease-out); }
@keyframes tb-bump { 20% { transform: translateY(-2px); color: var(--hot); } }
.tb-rep .tb-ico { color: var(--t3); font-size: 12px; }
.tb-tier .hud-v { font-size: 14px; }
.tb-tier .tier-badge { height: 20px; }

/* right side: OSD cluster (shield · ops · squads · compute · season · online · live · clock) and tools */
.tb-right { display: flex; align-items: center; gap: 0; flex: none; margin-left: auto; padding-right: 6px; }
.tb-osd { display: flex; align-items: center; height: 100%; }
.tb-osd > * {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--t3);
  font: var(--osd);
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}
.tb-osd > * + * { border-left: 1px solid var(--line); }
.tb-osd b { color: var(--t1); font-weight: 700; }
.tb-osd button { transition: color var(--dur-1), background-color var(--dur-1); }
.tb-osd button:hover { background: var(--s2); color: var(--t1); }
.tb-shield { color: var(--intel); }
.tb-shield b { color: var(--intel); }
.tb-shield .ico { width: 14px; height: 14px; }
.tb-ops { color: var(--hot) !important; }
.tb-ops b { color: var(--hot); }
.tb-ops .ico { width: 14px; height: 14px; }
.tb-ops-bar { display: inline-block; width: 40px; }
.tb-ops-bar .meter { height: 2px; }
.tb-ops-t { color: var(--t1); }
/* squads in flight (hot while outbound, intel once they all fly home) and compute used/cap (+ compile queue ETA) */
.tb-msn { color: var(--hot) !important; }
.tb-msn b { color: var(--hot); }
.tb-msn.back, .tb-msn.back b { color: var(--intel) !important; }
.tb-msn .ico, .tb-cpu .ico { width: 14px; height: 14px; }
.tb-msn-t { color: var(--t1); }
.tb-cpu-v { display: inline-flex; align-items: baseline; }
.tb-cpu-cap { color: var(--t3); }
.tb-cpu.full b, .tb-cpu.full .ico { color: var(--intel); }
.tb-cpu-q { display: inline-flex; align-items: center; gap: 5px; margin-left: 2px; padding-left: 8px; border-left: 1px solid var(--line); color: var(--t2); }
.tb-cpu-q .ico { width: 13px; height: 13px; color: var(--hot); }
.tb-season .tb-sid { color: var(--t1); font-weight: 700; }
.tb-online .dot { width: 5px; height: 5px; }
.tb-conn .conn-dot { width: 6px; height: 6px; background: var(--dim); }
.tb-conn[data-state="online"] { color: var(--t2); }
.tb-conn[data-state="online"] .conn-dot { background: var(--hot); animation: live-dot 2.4s steps(1, end) infinite; }
.tb-conn[data-state="connecting"] { color: var(--intel); }
.tb-conn[data-state="connecting"] .conn-dot { background: var(--intel); animation: blink-soft 1s ease-in-out infinite; }
.tb-conn[data-state="offline"] { color: var(--hostile); background: var(--d-soft) !important; }
.tb-conn[data-state="offline"] .conn-dot { background: var(--hostile); animation: blink-soft .8s ease-in-out infinite; }
@keyframes live-dot { 0%, 70% { opacity: 1; } 71%, 100% { opacity: .25; } }
@keyframes blink-soft { 50% { opacity: .25; } }
@keyframes fx-blink-soft { 50% { opacity: .25; } }
.tb-clock { color: var(--t2) !important; min-width: 84px; justify-content: center; }
.tb-tools { display: flex; align-items: center; gap: 2px; padding-left: 8px; margin-left: 4px; border-left: 1px solid var(--line); height: 100%; }
.tb-tools .icon-btn { width: 36px; height: 36px; }
.tb-term[aria-pressed="true"] { color: var(--hot); border-color: var(--a-line); }

/* ==========================================================================================================
   RAIL (left nav): 64 px icons, 200 px with labels ≥ 1440. One hot ink bar slides to the active item.
   ========================================================================================================== */
.sidenav {
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  padding: 10px 0 8px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  border-right: 1px solid var(--line);
  background: var(--s1);
}
.sidenav::-webkit-scrollbar { display: none; }
.nav-list { position: relative; display: flex; flex-direction: column; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: var(--nav-h);
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--t3);
  font: 600 15px/1 var(--font-display);
  letter-spacing: .05em;
  text-transform: uppercase;
  transition: color var(--dur-1), background-color var(--dur-1);
}
.nav-item .ico { width: 20px; height: 20px; }
.nav-item:hover { color: var(--t1); background: var(--s2); }
.nav-item::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--hot);
  transform: scaleY(0);
  transition: transform var(--dur-2) var(--ease-out);
}
.nav-item[aria-current="page"] { color: var(--t1); background: var(--s2); }
.nav-item[aria-current="page"]::before { transform: scaleY(1); }
.nav-list.has-ink .nav-item::before { display: none; }
.nav-ink {
  position: absolute;
  left: 0; top: 0;
  z-index: 1;
  width: 2px;
  height: var(--nav-h);
  background: var(--hot);
  transform: translateY(var(--ink-y, 0px));
  pointer-events: none;
  opacity: 0;
}
.nav-list.has-ink .nav-ink { opacity: 1; }
.nav-list.ink-ready .nav-ink { transition: transform var(--dur-2) var(--ease-out); }
.nav-label { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }
.sidenav .nav-label { position: absolute; width: 1px; height: 1px; clip: rect(0 0 0 0); }
.nav-item .nav-badge { position: absolute; top: 8px; right: 10px; }
.nav-sep { display: block; height: 1px; margin: 8px 16px; background: var(--line); flex: none; }
/* a raid is coming at me: the war-room item turns hostile (badge included, see .nav-badge.hostile) */
.nav-item.hostile .ico, .tab-item.hostile .ico, .sheet-item.hostile .ico { color: var(--hostile); }
/* twelve views: the rail tightens on short screens so it never has to scroll (1366×657 browser windows) */
@media (min-width: 768px) and (max-height: 780px) {
  :root { --nav-h: 42px; }
  .nav-sep { margin-top: 5px; margin-bottom: 5px; }
  .nav-item .nav-badge { top: 5px; }
}
@media (min-width: 768px) and (max-height: 660px) { :root { --nav-h: 38px; } }
.nav-foot { display: grid; justify-items: center; gap: 2px; padding: 10px 4px 2px; color: var(--t3); font: var(--osd); letter-spacing: .06em; text-transform: uppercase; text-align: center; }
.nav-foot b { color: var(--t2); font-weight: 600; }
.nav-foot .nf-k { font-size: 9px; opacity: .8; }
@media (min-width: 1440px) {
  .nav-item { justify-content: flex-start; padding: 0 22px; }
  .sidenav .nav-label { position: static; width: auto; height: auto; clip: auto; }
  .nav-item .nav-badge { position: static; margin-left: auto; }
  .nav-sep { margin: 8px 22px; }
  .nav-foot { grid-auto-flow: column; justify-content: start; gap: 8px; padding: 10px 22px 4px; }
}

/* ==========================================================================================================
   ZERO-DAY (world event banner): hostile band, segmented HP, strike button
   ========================================================================================================== */
.zd-banner {
  position: sticky;
  top: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px var(--pad-x) 10px 0;
  border-bottom: 1px solid var(--d-line);
  background: var(--s1);
}
.zd-banner::before { content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--hostile); }
.zd-banner.zd-new { animation: zd-new 1.2s steps(1, end); }
@keyframes zd-new { 0%, 20%, 40% { background: var(--d-soft); } 10%, 30%, 50% { background: var(--s1); } }
.zd-ico {
  display: grid;
  place-items: center;
  align-self: stretch;
  width: 56px;
  margin: -10px 0;
  background: var(--hostile);
  color: color-mix(in srgb, var(--bg) 94%, var(--danger));
}
.zd-ico .ico { width: 24px; height: 24px; animation: blink-soft 1.6s steps(1, end) infinite; }
.zd-main { position: relative; display: grid; gap: 7px; min-width: 0; }
.zd-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.zd-title {
  padding: 0;
  border: 0;
  background: none;
  color: var(--t1);
  font: 700 19px/1 var(--font-display);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.zd-title:hover { color: var(--hostile); }
.zd-left { color: var(--hostile); font: var(--osd); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.zd-part, .zd-top { color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; }
.zd-hp { display: flex; align-items: center; gap: 12px; }
.zd-meter { flex: 1 1 auto; }
.zd-meter.meter { height: 8px; -webkit-mask-image: repeating-linear-gradient(90deg, var(--fg) 0 calc(5% - 2px), transparent calc(5% - 2px) 5%); mask-image: repeating-linear-gradient(90deg, var(--fg) 0 calc(5% - 2px), transparent calc(5% - 2px) 5%); }
.zd-meter > i { background: var(--hostile); }
.zd-hp-txt { color: var(--t1); font: 700 14px/1 var(--font-display); white-space: nowrap; }
.zd-hit { position: relative; flex: none; min-width: 140px; }
.zd-hit-bar { position: absolute; left: 0; right: 0; bottom: 0; }
.zd-hit-bar .meter { height: 3px; background: transparent; }
.zd-hit-bar .meter > i { background: color-mix(in srgb, var(--bg) 60%, transparent); }

/* ==========================================================================================================
   COMMS (chat panel): intercepted-traffic log — mono timestamps, coloured names, whispers in intel
   ========================================================================================================== */
.chat {
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: var(--s1);
}
.chat-head { flex: none; }
.chat-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 36px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.chat-title { margin: 0; color: var(--t1); font: 600 15px/1 var(--font-display); letter-spacing: .06em; text-transform: uppercase; }
.chat-osd { display: inline-flex; align-items: center; gap: 7px; color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; }
.chat-osd .dot { width: 5px; height: 5px; }
.chat-tabs { padding: 0 6px; }
.chat-tabs .tab { flex: 1 1 0; justify-content: center; min-height: 38px; font-size: 14px; }
.chat-body { position: relative; flex: 1 1 auto; min-height: 0; }
.chat-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: 8px 0 12px; }
.chat-list { display: grid; list-style: none; }
.chat-empty, .chat-locked { margin: 28px 16px; color: var(--t3); font: var(--osd); letter-spacing: .08em; text-align: center; text-transform: uppercase; }
.msg {
  position: relative;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  column-gap: 8px;
  padding: 4px 14px 4px 12px;
  border-left: 2px solid transparent;
  font-size: 13.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  animation: msg-in var(--dur-2) var(--ease-out);
}
@keyframes msg-in { from { opacity: 0; transform: translateX(-6px); } }
.msg:hover { background: var(--s2); }
.msg > .m-time { grid-column: 1; grid-row: 1 / span 9; padding-top: 3px; }
.msg > :not(.m-time) { grid-column: 2; }
.m-body { display: block; min-width: 0; }
.m-time { color: var(--t3); font: 500 10.5px/1.45 var(--font-mono); letter-spacing: 0; }
.m-name { padding: 0; border: 0; background: none; font: 600 13.5px/1.45 var(--font-ui); cursor: pointer; }
.m-name:hover .pname, .m-name:focus-visible .pname { text-decoration: underline; text-underline-offset: 3px; }
.m-arrow { margin: 0 6px 0 4px; color: var(--t3); font-size: 11px; }
.m-text { color: var(--t2); }
.msg .ptitle { display: inline; margin-left: 6px; font-size: 9.5px; vertical-align: .05em; }
.msg .crew-tag { font-size: 12px; margin-right: 4px; }
.msg.mine .m-text { color: var(--t1); }
.msg.mine .m-arrow { color: var(--hot); }
.msg.mention { border-left-color: var(--hot); background: var(--a-soft); }
.msg.ch-crew { border-left-color: var(--line-3); }
.msg.ch-w { border-left-color: var(--intel); background: color-mix(in srgb, var(--accent2) 6%, transparent); }
.msg.ch-w .m-text { color: var(--t1); }
.m-w { padding: 0; border: 0; background: none; color: var(--intel); font: 700 12px/1.45 var(--font-display); letter-spacing: .08em; text-transform: uppercase; }
.m-w:hover { text-decoration: underline; }
.msg.sys { font-size: 12.5px; }
.msg.sys .m-sys { color: var(--t2); }
.msg.sys .m-sys::before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 8px 1px 0; background: var(--hot); vertical-align: middle; }
.msg.sys.local .m-sys { color: var(--t3); }
.msg.sys.local .m-sys::before { background: var(--t3); }
.chat-new { position: absolute; left: 50%; bottom: 10px; z-index: 2; transform: translateX(-50%); }
.chat-form { flex: none; display: grid; gap: 6px; padding: 10px 12px 12px; border-top: 1px solid var(--line); }
.chat-row { position: relative; display: flex; align-items: center; gap: 6px; }
.chat-in { flex: 1 1 auto; min-width: 0; min-height: 38px; padding-right: 54px; font-size: 13.5px; }
.chat-count { position: absolute; right: 52px; color: var(--t3); font: 500 10px/1 var(--font-mono); pointer-events: none; }
.chat-count.warn { color: var(--intel); }
.chat-count.bad { color: var(--hostile); }
.chat-send { min-height: 38px; width: 40px; padding: 0; }
.chat-cd { position: absolute; left: 0; right: 0; bottom: -4px; height: 2px; background: var(--hot); transform: scaleX(0); transform-origin: left; opacity: 0; }
.chat-cd.run { animation: chat-cd var(--dur, 1.5s) linear forwards; }
@keyframes chat-cd { from { transform: scaleX(1); opacity: .9; } to { transform: scaleX(0); opacity: .3; } }
.chat-hint { margin: 0; color: var(--t3); font-size: 11.5px; }
.chat-err { font-size: 12px; }

/* ==========================================================================================================
   CONSOLE (terminal): a 36 px strip (prompt + last line) that opens as a drawer (² / Ctrl+`)
   ========================================================================================================== */
.term {
  z-index: 3;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-top: 1px solid var(--line-2);
  background: color-mix(in srgb, var(--bg) 70%, var(--panel));
  font-family: var(--font-mono);
}
.term-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; height: var(--term-strip); padding: 0 6px 0 0; }
.term-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--t3);
  font: var(--osd);
  letter-spacing: .08em;
  text-align: left;
  text-transform: uppercase;
  transition: color var(--dur-1), background-color var(--dur-1);
}
.term-toggle:hover { color: var(--t1); background: var(--s1); }
.term-toggle .ico { width: 15px; height: 15px; color: var(--hot); }
.term-name { color: var(--t1); font-weight: 700; }
.term-host { flex: none; color: var(--hot); font: 500 12px/1 var(--font-mono); letter-spacing: 0; text-transform: none; white-space: nowrap; }
.term-last { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--t3); font: 400 12px/1 var(--font-mono); letter-spacing: 0; text-overflow: ellipsis; text-transform: none; white-space: nowrap; }
.term.open .term-last { visibility: hidden; }
.term-lights { display: none; }
.term-key { flex: none; }
.term-tools { display: flex; align-items: center; gap: 2px; }
.term-tools .icon-btn { width: 28px; height: 28px; }
.term-tools .icon-btn .ico { width: 15px; height: 15px; }
.term-chev .ico { transition: transform var(--dur-2) var(--ease-out); }
.term.open .term-chev .ico { transform: rotate(180deg); }
.term:not(.open) .term-tall, .term:not(.open) .term-clear { display: none; }
.term-body {
  display: flex;
  flex-direction: column;
  height: var(--term-h);
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--line);
  transition: height var(--dur-2) var(--ease-in);
}
.term.open .term-body { transition: height var(--dur-2) var(--ease-out); }
.term.closing .term-body, .term.opening .term-body { height: 0; }
.term.tall { --term-h: min(52vh, 520px); }
.term-out {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 16px 4px;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  cursor: text;
}
.tl { min-height: 1.6em; }
.tl.typing > span:last-child::after { content: '▋'; color: var(--hot); animation: blink-soft .7s steps(1) infinite; }
.tl-head { color: var(--t3); }
.tl-head .c-fg { font-weight: 700; }
.c-ok { color: var(--hot); }
.c-bad { color: var(--hostile); }
.c-warn { color: var(--intel); }
.c-dim { color: var(--t3); }
.c-accent { color: var(--hot); }
.c-accent2 { color: var(--intel); }
.c-fg { color: var(--t1); }
.t-link { padding: 0; border: 0; background: none; font: inherit; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
.t-link:hover { text-decoration-style: solid; color: var(--t1); }
.term-line { position: relative; display: flex; align-items: center; gap: 8px; padding: 6px 16px 9px; border-top: 1px solid var(--line); }
.term-ps1 { flex: none; color: var(--hot); font-size: 12.5px; white-space: nowrap; }
.term-in {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 26px !important;
  padding: 2px 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: var(--t1);
  font: 12.5px var(--font-mono) !important;
  caret-color: var(--hot);
}
.term-busy { position: absolute; left: 16px; right: 16px; bottom: 3px; height: 1px; opacity: 0; background: linear-gradient(90deg, transparent, var(--hot), transparent) no-repeat; background-size: 40% 100%; }
.term.busy .term-busy { opacity: 1; animation: btn-busy 1s linear infinite; }

/* ==========================================================================================================
   VERDICT + ALARM (fallbacks when the cinematics are unavailable): DedSec stamp on a tape
   ========================================================================================================== */
.verdict { position: fixed; left: 50%; top: 40%; z-index: 45; pointer-events: none; opacity: 0; transform: translate(-50%, -50%); }
.verdict.show { animation: verdict 2s var(--ease-out) both; }
@keyframes verdict {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(1.12); }
  6% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  8% { transform: translate(calc(-50% + 6px), -50%); }
  10%, 84% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, -50%); }
}
.verdict-box { display: grid; justify-items: center; gap: 8px; text-align: center; }
.verdict[data-tone="ok"] { --vc: var(--hot); --vi: var(--t-ink); }
.verdict[data-tone="bad"] { --vc: var(--hostile); --vi: color-mix(in srgb, var(--bg) 94%, var(--danger)); }
.verdict-title {
  display: block;
  min-width: min(360px, 80vw);
  padding: 10px 28px 8px;
  background: var(--vc, var(--hot));
  color: var(--vi, var(--t-ink));
  font: 700 clamp(30px, 5vw, 52px)/1 var(--font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  transform: skewX(-8deg) rotate(-2deg);
}
.verdict.show .verdict-title { animation: stamp-rgb .24s steps(3, end) 1; }
@keyframes stamp-rgb {
  0% { text-shadow: 3px 0 var(--intel), -3px 0 var(--hostile); clip-path: inset(0 0 55% 0); }
  50% { text-shadow: -2px 0 var(--intel), 2px 0 var(--hostile); clip-path: inset(40% 0 0 0); }
  100% { text-shadow: none; clip-path: inset(0); }
}
.verdict-sub { padding: 5px 12px; background: var(--s1); color: var(--t1); font: var(--osd); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; }
.verdict-sub:empty { display: none; }
.verdict-scan { display: none; }
.alarm-edge { position: fixed; inset: 0; z-index: 44; pointer-events: none; opacity: 0; box-shadow: inset 0 0 0 2px var(--hostile), inset 0 0 120px 10px color-mix(in srgb, var(--danger) 40%, transparent); }
.alarm-edge.on { animation: alarm 2.4s ease-out; }
@keyframes alarm { 0%, 30%, 60% { opacity: 1; } 15%, 45% { opacity: .3; } 100% { opacity: 0; } }

/* ==========================================================================================================
   MODALS: slab with a 3 px top rule (hot, or hostile), backdrop --bg 70 % + 4 px blur, wipe-in from the top
   ========================================================================================================== */
.modal-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.modal-back.in { opacity: 1; }
.modal-back.out { opacity: 0; transition: opacity 140ms var(--ease-in); }
.modal {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--line-2);
  border-top: 3px solid var(--hot);
  background: var(--s1);
  box-shadow: var(--shadow-lg);
  clip-path: inset(0 0 100% 0);
  transform: translateY(10px);
  transition: clip-path var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.modal-back.in .modal { clip-path: inset(0 0 -40px 0); transform: none; }
.modal-back.out .modal { clip-path: inset(0 0 -40px 0); transform: translateY(4px); transition: transform 140ms var(--ease-in); }
.modal-sm { width: min(440px, 100%); }
.modal-lg { width: min(780px, 100%); }
.modal-kicked, .modal.danger { border-top-color: var(--hostile); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 12px 12px 20px; border-bottom: 1px solid var(--line); }
.modal-title { margin: 0; color: var(--t1); font: 700 24px/1.05 var(--font-display); letter-spacing: .03em; text-transform: uppercase; }
.modal-x { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 8px; border: 0; background: transparent; color: var(--t3); transition: color var(--dur-1), background-color var(--dur-1); }
.modal-x kbd { border-color: var(--line); color: var(--t3); }
.modal-x .ico { width: 16px; height: 16px; }
.modal-x:hover { color: var(--t1); background: var(--s3); }
.modal-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 20px 20px; }
.modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.modal-lead { color: var(--t2); line-height: 1.6; }
.confirm-body p { line-height: 1.6; color: var(--t2); }
.perks { display: grid; gap: 8px; margin: 4px 0 18px; list-style: none; }
.perks li { position: relative; padding-left: 20px; font-size: 13.5px; color: var(--t2); }
.perks li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; background: var(--hot); }
.card-loading { display: grid; place-items: center; min-height: 140px; }

/* ==========================================================================================================
   TOASTS: phone notifications (top-right). OSD header (app · kind · time), one line, tone rule on the left.
   ========================================================================================================== */
.rw-toasts {
  position: fixed;
  top: calc(var(--top-h) + 10px);
  right: 12px;
  z-index: 66;
  display: grid;
  gap: 8px;
  width: min(340px, calc(100vw - 24px));
  pointer-events: none;
}
.toast {
  --tc: var(--t3);
  position: relative;
  display: grid;
  gap: 5px;
  padding: 9px 10px 10px 14px;
  border: 1px solid var(--line-2);
  border-left: 3px solid var(--tc);
  background: var(--s2);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  pointer-events: auto;
  animation: toast-in 380ms var(--ease-snap);
}
.toast.ok { --tc: var(--hot); }
.toast.bad { --tc: var(--hostile); }
.toast.warn { --tc: var(--intel); }
.toast.info { --tc: var(--t3); }
.toast.out { animation: toast-out 180ms var(--ease-in) forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateX(calc(100% + 16px)); } 60% { opacity: 1; } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }
.toast-head { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; }
.toast-app { color: var(--t1); font-weight: 700; }
.toast-kind { color: var(--tc); }
.toast.info .toast-kind { color: var(--t3); }
.toast-time { margin-left: auto; }
.toast-count { color: var(--tc); font-weight: 700; }
.toast-x { display: grid; place-items: center; flex: none; width: 22px; height: 22px; margin: -4px -4px -4px 2px; padding: 0; border: 0; background: transparent; color: var(--t3); }
.toast-x .ico { width: 13px; height: 13px; }
.toast-x:hover { color: var(--t1); background: var(--s4); }
.toast-txt { min-width: 0; color: var(--t1); line-height: 1.45; overflow-wrap: anywhere; }
.toast-life { position: absolute; left: -3px; right: 0; bottom: -1px; height: 1px; background: var(--tc); transform-origin: left; animation: toast-life var(--ttl, 4.5s) linear forwards; opacity: .7; }
.toast:hover .toast-life { animation-play-state: paused; }
@keyframes toast-life { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ==========================================================================================================
   MOBILE "MORE" SHEET
   ========================================================================================================== */
.sheet-back {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity var(--dur-2) var(--ease-out);
}
.sheet-back.in { opacity: 1; }
.sheet {
  width: 100%;
  max-height: 82dvh;
  overflow-y: auto;
  padding: 8px 14px calc(var(--tab-h) + var(--safe-b) + 14px);
  border-top: 2px solid var(--hot);
  background: var(--s1);
  transform: translateY(100%);
  transition: transform var(--dur-2) var(--ease-in);
}
.sheet-back.in .sheet { transform: none; transition: transform var(--dur-3) var(--ease-out); }
.sheet:focus { outline: none; }
.sheet-grip { width: 32px; height: 3px; margin: 2px auto 14px; background: var(--line-3); }
.sheet-status { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; border: 1px solid var(--line); background: var(--s1); overflow: hidden; }
.sheet-status .kv-mini { padding: 10px 12px; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); margin: 0 0 0 1px; }
.sheet-status .muted { font: var(--osd); letter-spacing: .08em; text-transform: uppercase; }
.sheet-status .num { font-size: 18px; font-weight: 700; }
.sheet-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); }
.sheet-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 78px;
  padding: 12px 4px 10px;
  border: 0;
  background: var(--s1);
  color: var(--t2);
  font: 600 13px/1.1 var(--font-display);
  letter-spacing: .05em;
  text-transform: uppercase;
}
.sheet-item .ico { width: 22px; height: 22px; color: var(--t1); }
.sheet-item[aria-current="page"] { color: var(--t1); background: var(--s3); box-shadow: inset 0 2px 0 var(--hot); }
.sheet-item .nav-badge { position: absolute; top: 6px; right: 8px; }
.sheet-state { color: var(--t3); font: var(--osd); letter-spacing: .06em; }
.sheet-status .sheet-v { display: inline-flex; align-items: center; gap: 6px; }

/* ==========================================================================================================
   SHARED GAME BITS (views + modals)
   ========================================================================================================== */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 14px; }
.link-like { display: inline-flex; align-items: center; gap: 4px; padding: 0; border: 0; background: none; color: var(--t1); font: inherit; text-align: left; }
.link-like:hover span:last-child { text-decoration: underline; }
.chance {
  --cc: var(--intel);
  display: inline-grid;
  place-items: center;
  min-width: 56px;
  height: 24px;
  padding: 0 8px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--cc) 22%, transparent) calc(var(--p, .5) * 100%), transparent 0), var(--s1);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cc) 40%, transparent);
  color: var(--cc);
  font: 700 15px/1 var(--font-display);
  white-space: nowrap;
}
.chance.good { --cc: var(--hot); }
.chance.mid { --cc: var(--intel); }
.chance.bad { --cc: var(--hostile); }
/* crew emblem: square stencil block in the crew colour */
.crew-emblem {
  --crew-c: var(--crew, var(--intel));
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 76px; height: 76px;
  border: 2px solid var(--crew-c);
  background: color-mix(in srgb, var(--crew-c) 16%, var(--panel));
  color: var(--t1);
  font: 700 24px/1 var(--font-display);
  letter-spacing: .06em;
}
.crew-emblem.sm { width: 46px; height: 46px; font-size: 15px; border-width: 1px; }
.crew-emblem.xs { width: 32px; height: 32px; font-size: 11px; letter-spacing: .02em; border-width: 1px; }
.crew-chips, .crew-dists { display: flex; flex-wrap: wrap; gap: 6px; }
.crew-card { display: grid; gap: 14px; }
.crew-card-head { display: flex; align-items: center; gap: 14px; }
.crew-card-head .crew-chips { margin-bottom: 4px; }
.member-mini { display: grid; list-style: none; max-height: 260px; overflow-y: auto; border-top: 1px solid var(--line); }
.member-mini li { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.member-mini li:hover { background: var(--s3); }
.member-mini .link-btn { flex: 1 1 auto; text-align: left; color: var(--t1); text-decoration: none; font-weight: 600; }
.member-mini .link-btn:hover { color: var(--hot); }
.role-glyph { display: inline-grid; place-items: center; width: 18px; color: var(--intel); font-size: 13px; }
.emote-bubble {
  position: relative;
  display: inline-block;
  max-width: 240px;
  padding: 7px 12px;
  background: var(--hot);
  color: var(--t-ink);
  font: 700 15px/1.1 var(--font-display);
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: bubble-in 300ms var(--ease-snap);
}
.emote-bubble.opp { background: var(--intel); color: color-mix(in srgb, var(--bg) 94%, var(--accent2)); }
.emote-bubble.out { opacity: 0; transform: translateY(-8px); transition: opacity .3s, transform .3s; }
.emote-bubble.static { animation: none; }
@keyframes bubble-in { from { opacity: 0; transform: translateY(8px) scale(.92); } }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 26px; height: 26px; padding: 0; border: 1px solid var(--line-2); border-radius: 0; background: var(--sw); box-shadow: inset 0 0 0 2px var(--panel); transition: transform var(--dur-1); }
.swatch:hover { transform: translateY(-1px); }
.swatch[aria-pressed="true"] { border-color: var(--t1); box-shadow: inset 0 0 0 2px var(--panel), 0 0 0 1px var(--t1); }
.color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.guest-warn, .guest-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--a2-line); border-left-width: 3px; background: var(--a2-soft); color: var(--t1); }
.guest-warn .ico, .guest-note .ico { color: var(--intel); }

/* ==========================================================================================================
   BOOT SCREEN (overrides the legacy boot section of fx.css): ctOS boot — bone-white mark, OSD BIOS lines,
   a 1 px progress line. The glitch-out exit (#boot.boot-out) stays in fx.css.
   ========================================================================================================== */
#boot {
  gap: 0;
  background: var(--bg);
  color: var(--t1);
  font-family: var(--font-mono);
}
#boot::before {
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(color-mix(in srgb, var(--fg) 4%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--fg) 4%, transparent) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: center center;
  -webkit-mask-image: linear-gradient(180deg, transparent, var(--fg) 30%, var(--fg) 70%, transparent);
  mask-image: linear-gradient(180deg, transparent, var(--fg) 30%, var(--fg) 70%, transparent);
  animation: none;
  opacity: .8;
}
#boot::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: var(--noise);
  opacity: .04;
}
#boot .boot-brand { gap: 18px; color: var(--t1); animation: boot-in .9s var(--ease-out) both; }
#boot .boot-mark { width: 56px; height: 56px; filter: none; color: var(--t1); }
#boot .boot-word { margin: 0; color: var(--t1); font: 700 clamp(40px, 7vw, 64px)/1 var(--font-display); letter-spacing: .32em; padding-left: .32em; }
@keyframes boot-in { from { opacity: 0; clip-path: inset(0 0 100% 0); } to { opacity: 1; clip-path: inset(0); } }
#boot .boot-line { margin: 22px 0 0; min-height: 1.3em; color: var(--t3); font: var(--osd); letter-spacing: .14em; text-transform: uppercase; }
#boot .boot-bar { width: min(280px, 64vw); height: 1px; margin-top: 12px; background: var(--line-2); }
#boot .boot-bar > i { background: var(--hot); box-shadow: none; }
#boot .boot-bar:not(.indet) > i { width: auto; animation: none; transform: scaleX(var(--p, 0)); transition: transform var(--dur-3) var(--ease-out); }
#boot .boot-cursor { display: none; }
#boot .boot-osd { position: absolute; display: flex; gap: 18px; color: var(--t3); font: var(--osd); letter-spacing: .08em; text-transform: uppercase; }
#boot .boot-osd b { color: var(--t1); font-weight: 600; }
#boot .boot-osd-tl { left: 24px; top: 20px; }
#boot .boot-osd-tr { right: 24px; top: 20px; }
#boot .boot-osd-tr .rec::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 7px; background: var(--hostile); vertical-align: 1px; animation: live-dot 1.6s steps(1, end) infinite; }
#boot .boot-term {
  left: 24px; bottom: 20px;
  width: min(460px, calc(100% - 48px));
  max-height: 34vh;
  color: var(--t3);
  font: 500 10.5px/1.75 var(--font-mono);
  letter-spacing: .04em;
  text-transform: uppercase;
  opacity: 1;
}
#boot .bl { gap: 12px; }
#boot .bl-st { color: var(--t2); font-weight: 600; }
#boot .bl-st.wait { color: var(--t3); }
#boot .bl-st.ok { color: var(--t1); text-shadow: none; }
#boot .bl-st.bad, #boot .bl.bad { color: var(--hostile); }
#boot .bl-head { color: var(--t1); letter-spacing: .08em; }
#boot .bl.dim { color: var(--t3); }
#boot .boot-ready { margin-top: 6px; color: var(--hot); font: 700 11px/1.6 var(--font-mono); letter-spacing: .24em; }
#boot .boot-retry { min-height: 24px; padding: 0 8px; font-size: 11px; }
#boot .boot-noscript { color: var(--t1); }
@media (max-width: 767px) {
  #boot .boot-term { left: 16px; bottom: 16px; width: calc(100% - 32px); max-height: 26vh; }
  #boot .boot-osd-tl { left: 16px; top: 14px; }
  #boot .boot-osd-tr { right: 16px; top: 14px; }
}

/* ==========================================================================================================
   RESPONSIVE
   ========================================================================================================== */
@media (max-width: 1439px) {
  .tb-clock { display: none; }
}
@media (max-width: 1279px) {
  :root { --pad-x: 24px; --pad-y: 24px; }
  .tb-idt { display: none; }
  .tb-id { padding: 0 12px; }
  .tb-inc { display: none; }
  .tb-online .tb-lbl { display: none; }
  .tb-credits { min-width: 128px; }
  .tb-data { min-width: 108px; }
}
@media (max-width: 1119px) { .tb-rep { display: none; } }

/* ---- tablet (768–1023): no comms column (chat becomes a view reachable from the rail) ---- */
@media (max-width: 1023px) {
  .shell {
    grid-template-columns: var(--nav-w) minmax(0, 1fr);
    grid-template-areas:
      "top top"
      "nav main"
      "nav term";
  }
  .nav-item.nav-chat { display: flex; }
  .chat { display: none; border-left: 0; }
  .shell[data-view="chat"] .chat { display: flex; grid-area: main; }
  .shell[data-view="chat"] .main { display: none; }
  .tb-season, .tb-online { display: none !important; }
  .tb-cpu { display: none !important; }          /* compute lives in the OSD on desktop only (SPEC §9.4) */
  .zd-hit { min-width: 0; }
}

/* ---- mobile (≤ 767): condensed HUD, bottom tab bar, console as an overlay sheet ---- */
@media (max-width: 767px) {
  :root { --top-h: 50px; --pad-x: 16px; --pad-y: 16px; }
  .shell {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--top-h) minmax(0, 1fr) calc(var(--tab-h) + var(--safe-b));
    grid-template-areas:
      "top"
      "main"
      "tabs";
  }
  .sidenav, .brand { display: none; }
  .topbar { padding-right: 2px; }
  .tb-id { padding: 0 10px 0 12px; }
  .tb-av { width: 36px; height: 36px; }
  .tb-avatar, .tb-avatar .avatar { width: 26px; height: 26px; --size: 26px; }
  .hud-i { padding: 0 12px; }
  .hud-k { font-size: 9px; }
  .hud-v { font-size: 18px; }
  .tb-val { font-size: 19px; }
  .tb-credits { min-width: 0; }
  .tb-bank { left: 12px; right: 12px; bottom: 5px; }
  .tb-rep, .tb-tier, .tb-season, .tb-online, .tb-clock, .tb-ops-bar, .tb-ops-t, .tb-shield b, .tb-sound { display: none !important; }
  .tb-data, .tb-msn { display: none !important; }  /* condensed HUD: data and compute move to the "more" sheet */
  .tb-osd > * { padding: 0 8px; }
  .tb-conn .conn-txt { display: none; }
  .tb-tools { padding-left: 2px; margin-left: 0; }
  .tb-tools .icon-btn { width: 40px; height: 40px; }
  .tabbar {
    grid-area: tabs;
    z-index: 6;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0 0 var(--safe-b);
    border-top: 1px solid var(--line-2);
    background: var(--s1);
  }
  .tab-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    padding: 6px 2px;
    border: 0;
    background: transparent;
    color: var(--t3);
    font: 600 11.5px/1 var(--font-display);
    letter-spacing: .06em;
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--dur-1);
  }
  .tab-item .ico { width: 22px; height: 22px; }
  .tab-item[aria-current="page"], .tab-item.on { color: var(--t1); }
  .tab-item::before {
    content: '';
    position: absolute;
    top: -1px; left: 22%; right: 22%;
    height: 2px;
    background: var(--hot);
    transform: scaleX(0);
    transition: transform var(--dur-2) var(--ease-out);
  }
  .tab-item[aria-current="page"]::before, .tab-item.on::before { transform: scaleX(1); }
  .tab-item .nav-badge { position: absolute; top: 5px; left: calc(50% + 8px); }
  .view-head { margin-bottom: 16px; padding-bottom: 10px; gap: 10px 16px; }
  .view-title { font-size: 30px; }
  .zd-banner { grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 10px 12px 10px 0; }
  .zd-ico { width: 40px; grid-row: 1 / span 2; }
  .zd-hit { grid-column: 2; justify-self: start; }
  .zd-title { font-size: 16px; }
  .zd-part, .zd-top { display: none; }
  .chat { border-left: 0; }
  .shell[data-view="chat"] .chat { grid-area: main; }
  .term {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(var(--tab-h) + var(--safe-b));
    z-index: 30;
    display: none;
    max-height: calc(100dvh - var(--top-h) - var(--tab-h) - var(--safe-b));
    border-top: 2px solid var(--hot);
    background: var(--s1);
    box-shadow: var(--shadow-lg);
  }
  .term.open, .term.closing { display: flex; }
  .term.open { animation: term-up var(--dur-2) var(--ease-out); }
  .term.closing { animation: term-down 150ms var(--ease-in) forwards; }
  @keyframes term-up { from { transform: translateY(24px); opacity: 0; } }
  @keyframes term-down { to { transform: translateY(24px); opacity: 0; } }
  .term-body, .term.tall .term-body { height: min(58dvh, 460px); transition: none; }
  .term.closing .term-body, .term.opening .term-body { height: min(58dvh, 460px); }
  .term-key, .term-last { display: none; }
  .rw-toasts { top: calc(var(--top-h) + 8px); left: 10px; right: 10px; width: auto; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { width: 100%; max-height: 92dvh; padding-bottom: var(--safe-b); border-left: 0; border-right: 0; border-bottom: 0; clip-path: none; transform: translateY(100%); }
  .modal-back.in .modal { clip-path: none; transform: none; }
  .modal-back.out .modal { clip-path: none; transform: translateY(40px); }
  .modal-sm, .modal-lg { width: 100%; }
  .modal-x kbd { display: none; }
}
@media (max-width: 380px) {
  .hud-i { padding: 0 9px; }
  .tb-shards .hud-k { display: none; }
}

/* ==========================================================================================================
   REDUCED MOTION (html.rm = manual toggle, plus the OS preference): no movement, no glitch; short fades only
   ========================================================================================================== */
html.rm .view, html.rm .msg, html.rm .tb-float, html.rm .zd-ico .ico, html.rm .brand:hover .brand-mark,
html.rm .tb-credits.gain .tb-val, html.rm .tb-credits.loss .tb-val, html.rm .tb-shards.bump .hud-v, html.rm .tb-rep.bump .hud-v,
html.rm .tb-data.gain .tb-val, html.rm .tb-data.loss .tb-val,
html.rm .tb-id.bump .tb-av, html.rm .zd-banner.zd-new, html.rm .term.open, html.rm .term.closing,
html.rm .tl.typing > span:last-child::after, html.rm .lock-on::after, html.rm .card.glow::after,
html.rm .btn.hold.nudge, html.rm .btn.hold.held, html.rm .emote-bubble, html.rm .tb-conn .conn-dot,
html.rm #boot .boot-brand, html.rm #boot .rec::before,
html.rm .ot-card, html.rm .ci-slash, html.rm .cine-result.bad .cr-title, html.rm .ca-edge, html.rm .ca-kicker::before { animation: none !important; }
html.rm .view.view-leave { display: none; }
html.rm .toast { animation: fade-in 120ms linear; }
html.rm .toast.out { animation: fade-out 120ms linear forwards; }
html.rm .verdict.show { animation: fade-still 1.5s ease both; }
html.rm .verdict.show .verdict-title { animation: none; }
html.rm .alarm-edge.on { animation: alarm-still 2s ease both; }
html.rm .modal, html.rm .modal-back.in .modal, html.rm .modal-back.out .modal { clip-path: none; transform: none; transition: none; }
html.rm .sheet, html.rm .sheet-back.in .sheet { transform: none; transition: none; }
html.rm .btn::before, html.rm .btn:hover:not(:disabled)::before { transition: none; }
html.rm .tabs-ink, html.rm .nav-ink, html.rm .term-body, html.rm .term.open .term-body { transition: none !important; }
html.rm .ci-veil, html.rm .ci-center, html.rm .cc-band { animation-name: fade-still !important; }
html.rm .ci-side { animation: fade-still 2.2s ease both !important; transform: translateY(-50%); }
html.rm .cr-plate { animation: fade-still 2.8s ease both !important; transform: translate(-50%, -50%); }
html.rm .ci-center { transform: translate(-50%, -50%); }
@keyframes fade-still { 0%, 100% { opacity: 0; } 10%, 85% { opacity: 1; } }
@keyframes alarm-still { 0% { opacity: .8; } 100% { opacity: 0; } }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .view, .msg, .tb-float, .zd-banner.zd-new, .zd-ico .ico, .lock-on::after, .card.glow::after, .emote-bubble,
  .tb-credits.gain .tb-val, .tb-credits.loss .tb-val, .tb-data.gain .tb-val, .tb-data.loss .tb-val,
  .tb-id.bump .tb-av, .btn.hold.nudge, .term.open, .term.closing,
  #boot .boot-brand, .ot-card, .ci-slash { animation: none !important; }
  .view.view-leave { display: none; }
  .toast { animation: fade-in 120ms linear; }
  .toast.out { animation: fade-out 120ms linear forwards; }
  .verdict.show .verdict-title { animation: none; }
  .modal, .modal-back.in .modal, .modal-back.out .modal { clip-path: none; transform: none; transition: none; }
  .sheet, .sheet-back.in .sheet { transform: none; transition: none; }
  .btn::before, .btn:hover:not(:disabled)::before { transition: none; }
  .tabs-ink, .nav-ink, .term-body, .term.open .term-body { transition: none !important; }
}
