/* FOUNDRY — styles. Industrial: dark metal, amber signage, cyan terminal glass.
 * 1993's idea of the future, built properly: thin rules, honest edges, mono numerals,
 * no glow for glow's sake. Every colour is a variable so a band palette can move later.
 *
 * PHASE4 §8.6 — the contrast pass, and where it had to happen. ui.js injects its own stylesheet at
 * boot for the Phase 2/3/4 screens (see its injectStyles, which REPORTS that this file should
 * absorb it) — appended to <head> after this file's <link>, so at equal specificity that copy wins
 * and anything written HERE for .fx / .hb / .iv-* / .sh-* is dead text. What this file still owns
 * outright is the VARIABLES: the injected rules all say var(--ink-faint), and var(--ink-faint) is
 * declared right here. So the contrast pass is done at the root and reaches every screen in the
 * game — including the ones this file cannot otherwise touch — without one line of specificity
 * warfare against another file. Lift the ink, and the whole building lifts with it. */
* { margin:0; padding:0; box-sizing:border-box; }
:root {
  /* metal */
  --bg:#0a0c0f; --panel:#13171c; --panel2:#1a1f26; --panel3:#232a33;
  /* Edges carry the whole layout in a game with no drop shadows: one step up each, so a panel
     reads as a panel at arm's length on a matte laptop screen and not just at 2am in the dark. */
  --edge:#313a46; --edge2:#46515f;
  /* ink. --ink-faint was doing real work at 3:1 on --panel — section headers, load tiers, the
     hall's epitaphs, every mono readout in the injected screens — which is a contrast ratio for
     decoration, not for text somebody is expected to read while deciding whether to walk home.
     Both dims come up; --ink is already right and does not move. Muted is the art direction;
     unreadable was never part of it. */
  --ink:#dce3ea; --ink-dim:#9aa4af; --ink-faint:#727c88;
  /* accents */
  --amber:#e2a53f; --amber-dim:#a8792c; --amber-deep:#2a2214;
  --cyan:#4ec9de; --cyan-dim:#2d7d8c; --cyan-deep:#13252a;
  /* meaning */
  --good:#6fbf78; --bad:#d75f56; --warn:#e2a53f;
  /* POLISH1 §6.3 — the SECOND warning step, between --warn and --bad. It has always existed as a
     value (the encumbrance readout's tier 2, the item card's tier 2) and never as a name, so the
     one hue in this palette that was invisible to a colour sweep was the one that means "this is
     getting heavy". Byte-identical to what those two rules already said; nothing on screen moves. */
  --warn2:#e07b3c;
  --hp:#6fbf78; --cp:#4ec9de; --xp:#e2a53f; --kg:#c98b4b; --bulk:#8f7fc0;
  /* POLISH1 §6.2 — the primary button's face. This gradient and its ink were pasted at three call
     sites (.btn-big, .m-btn.primary, .iv-btns .btn-med.primary), which meant POWER ON, Write over
     it and Equip were the same button by coincidence rather than by construction. Byte-equal to
     what all three carried; this is a name for a fact, not a change to it. */
  --btn-primary-grad:linear-gradient(180deg, #f0b750, #b8801f);
  --btn-primary-ink:#221803;
  /* POLISH1 §6.7 — THE TYPE-SCALE BEACHHEAD. Three names for the three half-pixel sizes this
     stylesheet actually repeats, and nothing else: every `10.5px`/`11.5px`/`12.5px` font-size below
     now says one of these and no rule's computed size changes by a hundredth of a pixel. The bare
     10/11/12px sizes are NOT folded in — they are a real spread that wants a ruling, not a rename,
     and the buildlog entry lists every one of them for it. */
  --fs-small:10.5px; --fs-body:11.5px; --fs-med:12.5px;
  --font:'Segoe UI', system-ui, -apple-system, sans-serif;
  --mono:'Consolas', 'SF Mono', ui-monospace, monospace;
}
html, body { width:100%; height:100%; overflow:hidden; background:var(--bg); color:var(--ink);
  font-family:var(--font); font-size:14px; }
button, input { font-family:var(--font); }
button { cursor:pointer; }
.hidden { display:none !important; }
.mono { font-family:var(--mono); font-variant-numeric:tabular-nums; }
.screen { position:fixed; inset:0; }
kbd { background:var(--panel3); border:1px solid var(--edge2); border-bottom-width:2px; border-radius:3px;
  padding:0 4px; font-family:var(--mono); font-size:10px; color:var(--ink-dim); }

/* ============ TITLE SCREEN ============ */
#titleScreen { overflow-y:auto; display:flex; justify-content:center; background:
  radial-gradient(1100px 620px at 50% -12%, #1b232c 0%, var(--bg) 62%),
  repeating-linear-gradient(90deg, rgba(255,255,255,.014) 0 1px, transparent 1px 3px); }
.title-inner { max-width:1000px; width:100%; padding:38px 24px 56px; }
.title-head { text-align:center; }
.title { font-size:66px; font-weight:600; letter-spacing:20px; color:var(--amber); text-indent:20px;
  text-shadow:0 0 44px rgba(226,165,63,.22); line-height:1; }
.subtitle { letter-spacing:9px; color:var(--ink-faint); font-size:11px; margin-top:10px; text-indent:9px; }
.rule { height:1px; margin:22px auto 20px; max-width:640px;
  background:linear-gradient(90deg, transparent, var(--edge2) 18%, var(--edge2) 82%, transparent); }
/* The procedural Gatetown silhouette (PHASE5-BRIEF §2). Fixed 1000x200 buffer scaled to the column
   width — bold masses read the same at 1280 and at a half-size window. Its own backdrop feathers to
   transparent at the top, so there is no box edge against the page. */
.title-art { display:block; width:100%; max-width:1000px; height:auto; margin:0 auto 22px; }
.title-grid { display:flex; gap:24px; align-items:flex-start; }
.crawl-col, .setup-col { background:var(--panel); border:1px solid var(--edge); border-radius:8px;
  padding:20px 22px; box-shadow:inset 0 1px 0 rgba(255,255,255,.035); }
.crawl-col { flex:1.25; }
.setup-col { flex:1; }
.crawl-col h3, .setup-col h3 { color:var(--amber); font-size:11px; font-weight:700; letter-spacing:3px;
  text-transform:uppercase; border-bottom:1px solid var(--edge); padding-bottom:8px; margin-bottom:14px; }
.crawl { font-size:13.5px; line-height:1.72; color:var(--ink-dim); max-height:52vh; overflow-y:auto;
  padding-right:8px; }
.crawl p { margin-bottom:12px; }
.crawl p:first-child { color:var(--ink); }
.crawl p:last-child { color:var(--amber-dim); margin-bottom:0; }
.setup-col label { display:block; margin-bottom:12px; color:var(--ink-dim); font-size:11px;
  letter-spacing:1.5px; text-transform:uppercase; }
.setup-col input[type=text] { display:block; width:100%; margin-top:5px; background:var(--bg);
  color:var(--ink); border:1px solid var(--edge2); border-radius:4px; padding:8px 10px;
  font-size:14px; font-family:var(--mono); letter-spacing:0; text-transform:none; }
.setup-col input[type=text]:focus { outline:none; border-color:var(--cyan-dim);
  box-shadow:0 0 0 2px var(--cyan-deep); }
.field-label { color:var(--ink-dim); font-size:11px; letter-spacing:1.5px; text-transform:uppercase;
  margin-bottom:6px; }
.kit-pick { display:flex; flex-direction:column; gap:6px; margin-bottom:14px; }
.kit-card { text-align:left; background:var(--panel2); border:1px solid var(--edge); border-radius:5px;
  padding:9px 12px; color:var(--ink-dim); display:block; width:100%; }
.kit-card:hover { border-color:var(--edge2); }
.kit-card.on { border-color:var(--amber-dim); background:var(--amber-deep); }
.kit-card b { color:var(--ink); font-size:13.5px; }
.kit-card.on b { color:var(--amber); }
.kit-nudge { font-family:var(--mono); font-size:11px; color:var(--cyan); margin-left:8px; }
.kit-blurb { display:block; font-size:var(--fs-body); line-height:1.5; margin-top:3px; }
.check { display:flex !important; align-items:flex-start; gap:8px; text-transform:none !important;
  letter-spacing:0 !important; font-size:12px !important; line-height:1.5; }
.check input { margin-top:2px; accent-color:var(--amber); }
.check b { color:var(--ink); }
.setup-buttons { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.btn-big { flex:1 0 100%; background:var(--btn-primary-grad); color:var(--btn-primary-ink); border:none;
  border-radius:5px; padding:14px; font-size:15px; font-weight:700; letter-spacing:4px;
  box-shadow:0 3px 20px rgba(226,165,63,.28); }
.btn-big:hover { filter:brightness(1.09); }
.btn-med { flex:1; background:var(--panel2); color:var(--ink); border:1px solid var(--edge2);
  border-radius:5px; padding:9px 12px; font-size:var(--fs-med); white-space:nowrap; }
.btn-med:hover { border-color:var(--amber-dim); color:var(--amber); }
.btn-med:disabled { opacity:.32; cursor:default; }
.btn-med:disabled:hover { border-color:var(--edge2); color:var(--ink); }
.setup-foot { margin-top:12px; color:var(--ink-faint); font-size:11px; font-family:var(--mono); }
.title-foot { margin-top:26px; text-align:center; color:var(--ink-faint); font-size:10px; letter-spacing:3px; }

/* ============ GAME LAYOUT ============ */
#gameScreen { display:grid; grid-template-columns:1fr 300px; grid-template-rows:38px 1fr 170px; }
#topBar { grid-column:1/3; grid-row:1; }
/* POLISH1 §6.6 — the near-blacks agree. render.js paints unseen ground at #05070a ("not a colour
   choice — the absence of a draw", its own words) and this box sat one step off it at #06080a, so
   the letterboxing around a small map was a different black from the fog inside it. ΔE ≈ 0.5:
   sub-JND, invisible to anyone with or without a colour deficiency, and therefore NOT a palette
   change and not a CVD-sweep trigger — it is an ALIGNMENT to a value the renderer already owns. */
#viewport { grid-column:1; grid-row:2; position:relative; overflow:hidden; background:#05070a; }
#sidePanel { grid-column:2; grid-row:2/4; }
#logPanel { grid-column:1; grid-row:3; }
#mapCanvas { position:absolute; inset:0; width:100%; height:100%; display:block; }

/* ============ PHASE 16 — THE RAID ============
   The scene is the ordinary viewport with the ordinary renderer. The furniture leaves the room so
   the log and the street are the whole screen; a uniform black wash grades every shipped colour by
   the same amount. No palette value changes and no special camera exists. */
#gameScreen.raid-mode { grid-template-columns:1fr; grid-template-rows:1fr 200px; }
#gameScreen.raid-mode #topBar, #gameScreen.raid-mode #sidePanel { display:none; }
#gameScreen.raid-mode #viewport { grid-column:1; grid-row:1; min-height:0; }
#gameScreen.raid-mode #logPanel { grid-column:1; grid-row:2; min-height:0; }
#gameScreen.raid-mode #viewport::after { content:''; position:absolute; inset:0;
  background:rgba(0,0,0,.28); pointer-events:none; }
/* §12.3: the grid dies ON SCREEN. One deeper step of the same wash, added at the grid beat and
   removed with raid-mode. No transition — "All of it, at once" is a snap, not a fade — and no hex
   moves: this is the identical uniform grade, a notch further down. */
#gameScreen.raid-mode.raid-dark #viewport::after { background:rgba(0,0,0,.42); }
#overlayRoot.raid-title { background:#000; }
.raid-card { text-align:center; padding:28px; }
.raid-word { color:var(--amber); font-size:54px; font-weight:600; letter-spacing:16px;
  text-indent:16px; line-height:1; }
.raid-sub { color:var(--ink-faint); font-size:11px; letter-spacing:7px; margin-top:14px; }
.raid-key { color:var(--ink-faint); font-family:var(--mono); font-size:10px; margin-top:38px; }

/* ============ TOP STRIP ============ */
#topBar { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:0 12px;
  background:linear-gradient(180deg, #171c22, #10141a); border-bottom:1px solid var(--edge);
  user-select:none; }
.tb-left { display:flex; align-items:baseline; gap:10px; min-width:0; }
.tb-name { color:var(--amber); font-size:14px; font-weight:600; letter-spacing:2px;
  text-transform:uppercase; white-space:nowrap; }
.tb-blurb { color:var(--ink-faint); font-size:var(--fs-body); white-space:nowrap; overflow:hidden;
  text-overflow:ellipsis; }
.tb-mid { display:flex; align-items:center; gap:18px; }
.tb-item { color:var(--ink-dim); font-size:11px; letter-spacing:1.5px; text-transform:uppercase;
  white-space:nowrap; }
.tb-item b { color:var(--ink); font-family:var(--mono); font-size:13px; letter-spacing:0;
  font-variant-numeric:tabular-nums; }
.tb-item.t1 b { color:var(--warn); } .tb-item.t2 b { color:var(--warn2); } .tb-item.t3 b { color:var(--bad); }
.tb-right { display:flex; gap:6px; }
.tb-btn { display:flex; align-items:center; gap:6px; background:transparent; color:var(--ink-dim);
  border:1px solid var(--edge); border-radius:4px; padding:5px 10px; font-size:var(--fs-body); }
.tb-btn:hover { color:var(--amber); border-color:var(--amber-dim); }

/* ============ VIEWPORT CHROME ============ */
#hoverHint { position:absolute; left:10px; bottom:8px; font-size:var(--fs-body); color:var(--ink-dim);
  background:rgba(10,12,15,.82); border:1px solid var(--edge); border-radius:4px; padding:3px 9px;
  pointer-events:none; max-width:70%; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#hoverHint:empty { display:none; }
#hoverHint b { color:var(--ink); }
#examineBadge, #closeBadge { position:absolute; left:10px; top:8px; font-size:10px; letter-spacing:2px;
  color:var(--cyan); background:var(--cyan-deep); border:1px solid var(--cyan-dim); border-radius:4px;
  padding:4px 9px; pointer-events:none; }
/* Close is a verb you reach for under pressure — amber, so it reads as a prompt that wants an
   answer rather than a mode you are idling in. */
#closeBadge { color:var(--amber); background:var(--amber-deep); border-color:var(--amber-dim); }

/* ============ RIGHT PANEL ============ */
#sidePanel { background:var(--panel); border-left:1px solid var(--edge); padding:10px; overflow-y:auto;
  display:flex; flex-direction:column; gap:7px; }
.pd-head { border-bottom:1px solid var(--edge); padding-bottom:6px; }
.pd-name { color:var(--amber); font-size:16px; font-weight:600; letter-spacing:2px; text-transform:uppercase; }
.pd-sub { color:var(--ink-faint); font-size:11px; margin-top:2px; }
/* The panel's section rules. They are the only navigation the sidebar has — INTEGRITY, the doll,
   the systems, the map — so they get the ink of a label rather than of a watermark. */
.panel-h { color:var(--ink-dim); font-size:9.5px; font-weight:700; letter-spacing:2.5px;
  text-transform:uppercase; border-bottom:1px solid var(--edge); padding-bottom:4px; margin-top:2px; }

.bar-row { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:3px; }
.bar-label { color:var(--ink-dim); font-size:10px; letter-spacing:1.5px; text-transform:uppercase; }
.bar-num { font-family:var(--mono); font-size:var(--fs-body); color:var(--ink); font-variant-numeric:tabular-nums; }
.bar { height:8px; background:var(--bg); border:1px solid var(--edge); border-radius:2px;
  overflow:hidden; margin-bottom:6px; }
.bar:last-child { margin-bottom:0; }
.bar.thin { height:5px; }
.bar-fill { height:100%; transition:width .16s ease; }
.bar-fill.hp { background:linear-gradient(180deg, #8bd694, var(--hp)); }
.bar-fill.cp { background:linear-gradient(180deg, #74dcee, var(--cp)); }
.bar-fill.xp { background:var(--xp); }
.bar-fill.kg { background:linear-gradient(180deg, #dda469, var(--kg)); }
.bar-fill.bulk { background:linear-gradient(180deg, #a596d2, var(--bulk)); }
.bar-fill.warn { background:linear-gradient(180deg, #f0b750, var(--warn)); }
.bar-fill.bad  { background:linear-gradient(180deg, #e57b73, var(--bad)); }

/* The grade sentence on an item card (PHASE6 §5) — the badge says "+2", this says what +2 buys. */
.ic-grade { font-size:11px; line-height:1.5; color:var(--cyan); margin-bottom:4px; }

/* ============ TEXT SIZE (PHASE6-BRIEF §3) ============
   §6's verdict on the picture was "feels small, little squinty" — on a laptop, from the one player
   who matters. The map got its own answer (the wheel zoom, and a 1.2 default on a machine that has
   never chosen one); this is the other half, and it is only ever about WORDS.

   Implemented as `zoom` on the four containers that hold text, rather than as a font-size variable,
   and the reason is worth writing down: every font-size in this file is a hardcoded px literal
   (there are about a hundred and twenty), so a --fs variable would mean rewriting all of them and
   would still miss anything ui.js sets inline. `zoom` scales a subtree including px literals and it
   scales the LAYOUT with them, which is what a reader actually wants — bigger text in a box the
   same shape, not bigger text overflowing the box it was measured for.

   The panel and log columns grow by the same factor so nothing is squeezed: 1.15 zoom inside a
   345px column is exactly the 300px of logical room the panel was designed against. The map keeps
   whatever is left, which is the correct thing to spend on legibility and the reason this is a
   setting rather than the default. */
:root[data-text="large"] #gameScreen { grid-template-columns:1fr 345px; grid-template-rows:44px 1fr 196px; }
:root[data-text="large"] #gameScreen.raid-mode { grid-template-columns:1fr; grid-template-rows:1fr 230px; }
:root[data-text="large"] #topBar,
:root[data-text="large"] #sidePanel,
:root[data-text="large"] #logPanel,
:root[data-text="large"] #tip,
:root[data-text="large"] #modalBox { zoom:1.15; }
/* The toast rail is pinned to the panel's edge in px, so it moves when the panel widens — but it is
   NOT zoomed. A `position:fixed` element's own offsets are multiplied by its zoom, so zooming this
   would push it 15% further from the right edge than the number says and float it off the panel it
   is supposed to sit beside. #tip has the same property and pays for it in JS instead (see UI.tip),
   because a tooltip must track the pointer; a toast rail is static and can simply not opt in. */
:root[data-text="large"] #toasts { right:347px; }

/* ============ GAUGES (PHASE6-BRIEF §1b) ============ */
/* Castle of the Winds drew an attribute as a row of filled and unfilled cells, and that row is most
   of why its character sheet read like an instrument panel rather than a form. This is the .bar
   family's segmented variant: the same track and the same 1px edge, with the fill cut by an etched
   overlay into D.C.ST_MAX cells and a heavier graduation every fifth.
   DISPLAY ONLY, permanently — no hover, no cursor, no hit target. A gauge you can click is an
   allocation pool arriving through the art, and GAMEPLAN §10 spends its points on kits, not on a
   character sheet. ui.js sets widths and nothing else.
   Drawn as stacked absolute runs under one ::after overlay rather than as ST_MAX elements: the
   Systems panel repaints every turn, and this way a repaint is a handful of width assignments
   instead of a hundred nodes. */
.gauge { position:relative; height:6px; background:var(--bg); border:1px solid var(--edge);
  border-radius:2px; overflow:hidden; }
.gauge span { position:absolute; top:0; bottom:0; left:0; transition:width .16s ease, left .16s ease; }
/* Source order is paint order: the base run, then the worn delta over its end, then the floor over
   all of it. Cyan for a surplus is not a new convention — it is the one .stat.geared already set. */
.g-base { background:linear-gradient(180deg, #f0b750, var(--amber)); }
.g-surplus { background:linear-gradient(180deg, #74dcee, var(--cyan)); }
.g-deficit { background:linear-gradient(180deg, #e57b73, var(--bad)); }
/* D.C.ST_MIN, the floor of R.spendStat's clamp: filled, because it is filled for everyone, and dark
   because nobody chose it. It paints OVER the base run rather than under it — under it the amber
   would swallow the one stretch of the bar that was never an achievement. */
.g-floor { background:linear-gradient(180deg, #4a3b1d, var(--amber-deep)); }
/* The spend picker only: the '12 → 13' arrow drawn as the cell it would fill. Hollow, so it reads
   as an offer and not as a number you already have. */
.g-next { border:1px solid var(--amber); border-radius:1px; background:rgba(226,165,63,.14); }
.g-next.pulse { animation:gaugeNext 1.15s ease-in-out infinite; }
@keyframes gaugeNext { 0%, 100% { opacity:.4; } 50% { opacity:1; } }
@media (prefers-reduced-motion: reduce) { .g-next.pulse { animation:none; opacity:.9; } }
/* The etching, over every run. --edge and --edge2 are dark against amber and light against the
   empty track, so ONE overlay reads on both halves of the bar and the segment count stays countable
   whether a cell is filled or not — which is the whole reason this is segments and not a percentage
   (position and count are CVD-safe on their own; the colour only says where the number came from). */
.gauge::after { content:''; position:absolute; inset:0; pointer-events:none; background:
  repeating-linear-gradient(90deg, transparent 0 calc(20% - 2px), var(--edge2) calc(20% - 2px) 20%),
  repeating-linear-gradient(90deg, transparent 0 calc(4% - 1px), var(--edge) calc(4% - 1px) 4%); }
.stat .gauge { margin-top:3px; }
.kit-card .gauge { margin-top:7px; }
/* The title screen's kit cards: four micro-gauges of START_ST with the kit's nudge lit in cyan. The
   player who remembers allocating at creation gets the picture of it, and no pool to spend. */
.kit-gauges { display:grid; grid-template-columns:repeat(4, 1fr); gap:8px; margin-top:8px; }
.kit-gauges .g-abbr { color:var(--ink-faint); font-size:8.5px; letter-spacing:1.5px; }
.kit-gauges .gauge { height:5px; margin-top:2px; }

/* paper doll — 11 slots, laid out like a unit standing at attention.
   Cells are fixed at 40px so the 32px sprites paint 1:1 and stay crisp; letting them stretch to
   the panel width blew them up to 85px of blur and pushed the minimap off the bottom. */
.doll { display:grid; grid-template-columns:repeat(3, 40px); grid-auto-rows:40px; gap:4px;
  justify-content:center; }
.slot { position:relative; background:var(--panel2); border:1px solid var(--edge);
  border-radius:4px; display:flex; align-items:center; justify-content:center; cursor:pointer; }
.slot:hover { border-color:var(--amber-dim); background:var(--panel3); }
.slot canvas { width:32px; height:32px; opacity:.34; }
.slot.filled canvas { opacity:1; }
.slot.filled { border-color:var(--edge2); }
.slot[data-slot="head"]    { grid-column:2; grid-row:1; }
.slot[data-slot="weapon"]  { grid-column:1; grid-row:2; }
.slot[data-slot="plating"] { grid-column:2; grid-row:2; }
.slot[data-slot="shield"]  { grid-column:3; grid-row:2; }
.slot[data-slot="hands"]   { grid-column:1; grid-row:3; }
.slot[data-slot="mantle"]  { grid-column:2; grid-row:3; }
.slot[data-slot="belt"]    { grid-column:3; grid-row:3; }
.slot[data-slot="chip1"]   { grid-column:1; grid-row:4; }
.slot[data-slot="core"]    { grid-column:2; grid-row:4; }
.slot[data-slot="chip2"]   { grid-column:3; grid-row:4; }
.slot[data-slot="feet"]    { grid-column:2; grid-row:5; }

.stat-grid { display:grid; grid-template-columns:1fr 1fr; gap:4px; }
.stat { background:var(--panel2); border:1px solid var(--edge); border-radius:4px; padding:4px 7px;
  cursor:default; }
.stat:hover { border-color:var(--edge2); }
.stat .s-abbr { color:var(--ink-faint); font-size:8.5px; letter-spacing:1.5px; }
.stat .s-val { color:var(--ink); font-family:var(--mono); font-size:16px; font-weight:600; line-height:1.15; }
.stat .s-name { color:var(--ink-dim); font-size:9.5px; }

.meta-row { display:flex; justify-content:space-between; align-items:baseline; font-size:12px;
  color:var(--ink-dim); margin-bottom:4px; }
.meta-row b { color:var(--ink); }
.meta-row .mono { color:var(--ink-dim); font-size:11px; }
#mChits { color:var(--amber); }

/* render.js sizes #minimap itself (4px/tile) and sets inline width/height, so the box just
   frames it. Click it to walk; right-click for the full map. */
#minimapBox { display:flex; align-items:center; justify-content:center; overflow:auto;
  background:var(--bg); border:1px solid var(--edge); border-radius:4px; padding:4px;
  cursor:pointer; flex:0 0 auto; }
#minimapBox:hover { border-color:var(--amber-dim); }
#minimap { display:block; }

/* ============ LOG ============ */
/* PHASE4 §8.6. This game carries every number it has in prose — the doctrine, the damage, the
   whole of the combat feedback that Phase 1 refused to spend on floaters ("the log lines carry the
   numbers; the picture carries one white frame"). That makes this panel the primary instrument and
   not a footer, and it was set like a footer: 12.5px of --ink-dim at 1.62, every line the same
   weight, nothing to catch the eye that something had happened.
   Three changes, all typographic, none of them colour: size and leading up so a wall of it is
   readable; a hair of tracking off; and the newest line lifted to full ink, because "what just
   happened" is the one question this panel is always being asked. */
#logPanel { background:var(--panel); border-top:1px solid var(--edge); overflow-y:auto; padding:9px 13px; }
#logList { font-size:13px; line-height:1.7; }
.lg { color:var(--ink-dim); padding:1.5px 0; }
/* Not a highlight and not an animation — just the ink of a thing that is current. It stops being
   current when the next line arrives, which is exactly when you stop needing it to stand out. */
.lg:last-child { color:var(--ink); }
.lg.good { color:var(--good); }
.lg.bad { color:var(--bad); }
.lg.warn { color:var(--warn); }
.lg.sys { color:var(--cyan-dim); font-family:var(--mono); font-size:12px; letter-spacing:-.1px; }
.lg.flavor { color:var(--ink-faint); font-style:italic; }
.lg.say { color:var(--ink); }
/* The classed lines keep their own meaning when they are the newest one: a kill is green whether or
   not it just happened, and :last-child must not repaint it grey-white. */
.lg.good:last-child { color:var(--good); }
.lg.bad:last-child { color:var(--bad); }
.lg.warn:last-child { color:var(--warn); }
.lg.sys:last-child { color:var(--cyan); }
.lg.flavor:last-child { color:var(--ink-dim); }
.lg b { color:var(--ink); font-weight:600; }

/* ============ TOOLTIP ============ */
#tip { position:fixed; z-index:60; width:290px; background:rgba(16,20,25,.98); border:1px solid var(--edge2);
  border-top:2px solid var(--amber-dim); border-radius:5px; padding:9px 11px; font-size:12px;
  pointer-events:none; box-shadow:0 8px 30px rgba(0,0,0,.65); }
.tc-h { color:var(--amber); font-size:var(--fs-med); font-weight:700; letter-spacing:1px; text-transform:uppercase;
  margin-top:8px; }
.tc-h:first-child { margin-top:0; }
.tc-desc { color:var(--ink-dim); line-height:1.55; margin-top:3px; }
.tc-row { color:var(--ink); margin-top:4px; font-size:var(--fs-body); }
.tc-vend { color:var(--cyan); font-size:var(--fs-body); line-height:1.5; margin-top:4px; }
.tc-dim { color:var(--ink-faint); font-size:11px; font-style:italic; margin-top:6px;
  border-top:1px solid var(--edge); padding-top:5px; }

/* ============ TOASTS ============ */
#toasts { position:fixed; top:48px; right:312px; width:280px; z-index:55; display:flex;
  flex-direction:column; gap:5px; pointer-events:none; }
.toast { background:rgba(19,23,28,.97); border:1px solid var(--edge2); border-left:3px solid var(--amber);
  border-radius:4px; padding:7px 11px; font-size:12px; pointer-events:auto; cursor:pointer;
  box-shadow:0 4px 18px rgba(0,0,0,.5); animation:toastIn .18s ease; }
.toast.good { border-left-color:var(--good); }
.toast.bad { border-left-color:var(--bad); }
.toast.warn { border-left-color:var(--warn); }
.toast.sys { border-left-color:var(--cyan); }
@keyframes toastIn { from { transform:translateX(18px); opacity:0; } to { transform:none; opacity:1; } }
/* POLISH1 §6.5 — the one animation in this file that was not covered. .g-next's pulse has honoured
   reduced-motion since Phase 6 and this slide did not, which meant a player who had told their
   machine to stop moving things still got a toast sliding in from the panel edge every time they
   picked something up. It arrives; it does not travel. */
@media (prefers-reduced-motion: reduce) { .toast { animation:none; } }

/* ============ MODALS ============ */
/* POLISH1 §6.8 — the z-index that used to be here (100) is gone, not moved. It was dead text: the
   documented `#modalRoot { z-index:140 }` further down this file wins at equal specificity by
   source order, so the 100 could only ever mislead the next reader into thinking a modal sat under
   #overlayRoot's 120. One declaration, one place, and the comment that explains it is beside it. */
#modalRoot { position:fixed; inset:0; background:rgba(4,6,8,.74); display:flex;
  align-items:center; justify-content:center; backdrop-filter:blur(2px); }
#modalBox { background:var(--panel); border:1px solid var(--edge2); border-top:2px solid var(--amber-dim);
  border-radius:8px; max-width:720px; width:92%; max-height:86vh; overflow-y:auto; padding:20px 24px;
  box-shadow:0 24px 80px rgba(0,0,0,.75); }
#modalBox h2 { color:var(--amber); font-size:17px; font-weight:600; letter-spacing:3px;
  text-transform:uppercase; margin-bottom:14px; padding-right:34px; }
.m-close { float:right; background:none; border:1px solid var(--edge); color:var(--ink-dim);
  border-radius:4px; padding:3px 9px; font-size:12px; }
.m-close:hover { color:var(--ink); border-color:var(--amber-dim); }
.m-body { font-size:13px; line-height:1.65; color:var(--ink-dim); }
.m-body p { margin-bottom:10px; }
.m-body b { color:var(--ink); }
.m-note { border-left:2px solid var(--cyan-dim); padding-left:10px; color:var(--ink-faint) !important;
  font-size:12px; }
.m-empty { color:var(--ink-faint); font-style:italic; }
.m-buttons { display:flex; gap:8px; justify-content:flex-end; margin-top:16px; flex-wrap:wrap; }
.m-btn { background:var(--panel2); border:1px solid var(--edge2); color:var(--ink); border-radius:4px;
  padding:8px 16px; font-size:var(--fs-med); }
.m-btn:hover { border-color:var(--amber-dim); color:var(--amber); }
.m-btn.primary { background:var(--btn-primary-grad); color:var(--btn-primary-ink); border:none;
  font-weight:700; letter-spacing:1px; }
.m-btn:disabled { opacity:.32; cursor:default; }
.err { background:var(--bg); border:1px solid var(--bad); border-radius:4px; padding:8px;
  font-family:var(--mono); font-size:11px; color:var(--bad); white-space:pre-wrap; margin-bottom:10px; }

/* talk card */
.talk { display:flex; gap:14px; align-items:flex-start; }
.talk-por { flex:0 0 72px; height:72px; background:var(--panel2); border:1px solid var(--edge2);
  border-radius:5px; display:flex; align-items:center; justify-content:center; }
.talk-por canvas { width:64px; height:64px; }
.talk-body { flex:1; min-width:0; }
.talk-line { color:var(--ink); font-size:14px; line-height:1.6; }
.talk-desc { color:var(--ink-dim); font-size:12px; line-height:1.55; margin-top:10px;
  border-top:1px solid var(--edge); padding-top:8px; }
.talk-vend { margin-top:10px; background:var(--cyan-deep); border:1px solid var(--cyan-dim);
  border-radius:4px; padding:8px 10px; font-size:var(--fs-body); color:var(--ink-dim); line-height:1.5; }
.talk-vend b { color:var(--cyan); display:block; margin-bottom:3px; letter-spacing:1px; }
.talk-cats { color:var(--ink-faint); font-family:var(--mono); font-size:var(--fs-small); margin-top:5px; }

/* inventory stub / lists */
.inv-list { list-style:none; }
.inv-list li { display:flex; justify-content:space-between; gap:10px; background:var(--panel2);
  border:1px solid var(--edge); border-radius:4px; padding:6px 10px; margin-bottom:4px; font-size:var(--fs-med); }
.inv-list .i-name { color:var(--ink); }
.inv-list .i-stat { color:var(--ink-faint); font-family:var(--mono); font-size:11px; white-space:nowrap; }
.inv-foot { margin-top:10px; border-top:1px solid var(--edge); padding-top:8px; font-family:var(--mono);
  font-size:var(--fs-body); color:var(--ink-dim); }

/* save slots */
.slot-row { display:flex; gap:8px; align-items:center; margin-bottom:6px; }
.slot-row .btn-med { flex:1; text-align:left; }
.slot-row .btn-med small { color:var(--ink-faint); font-family:var(--mono); font-size:var(--fs-small); }
.danger { border-color:#6d3430 !important; }
.danger:hover { border-color:var(--bad) !important; color:var(--bad) !important; }

/* help */
.help-cols { display:flex; gap:22px; }
.help-cols > div { flex:1; }
.help-cols h4 { color:var(--amber); font-size:11px; font-weight:700; letter-spacing:2px;
  text-transform:uppercase; margin:14px 0 5px; }
.help-cols h4:first-child { margin-top:0; }
.keytab { width:100%; border-collapse:collapse; font-size:12px; }
.keytab td { padding:3px 0; border-bottom:1px solid var(--edge); color:var(--ink-dim); }
.keytab td:first-child { width:96px; }

/* tables (hall of fame, recap) */
.tab { width:100%; border-collapse:collapse; font-size:var(--fs-med); }
.tab th { color:var(--ink-faint); font-size:9.5px; letter-spacing:2px; text-transform:uppercase;
  text-align:left; padding:5px 10px 5px 0; border-bottom:1px solid var(--edge2); }
.tab td { padding:6px 10px 6px 0; border-bottom:1px solid var(--edge); color:var(--ink-dim); }
.tab td b { color:var(--ink); }
.tab tr.win td b { color:var(--amber); }
.tab .num { font-family:var(--mono); font-variant-numeric:tabular-nums; }

/* ============ OVERLAYS (full map, recap) ============ */
#overlayRoot { position:fixed; inset:0; background:rgba(6,8,10,.96); z-index:120; display:flex;
  align-items:center; justify-content:center; }
.ov-inner { text-align:center; max-width:94vw; }
.ov-inner h1 { color:var(--amber); font-size:26px; font-weight:600; letter-spacing:6px;
  text-transform:uppercase; margin-bottom:4px; }
.ov-inner .ov-sub { color:var(--ink-faint); font-size:var(--fs-body); margin-bottom:16px; }
.ov-inner canvas { display:block; margin:0 auto; border:1px solid var(--edge2); border-radius:4px;
  background:#000; cursor:crosshair; }
.ov-legend { color:var(--ink-faint); font-size:11px; margin-top:12px; letter-spacing:1px; }
.ov-btns { display:flex; gap:10px; justify-content:center; margin-top:16px; }
.ov-recap { text-align:left; background:var(--panel); border:1px solid var(--edge); border-radius:8px;
  padding:22px 26px; min-width:440px; }
.ov-cause { color:var(--ink); font-size:14px; line-height:1.6; margin-bottom:16px; }
/* The recap epitaph line: prose, amber, its own thing — not the mono readout the numbers use.
   Same amber as the Hall's .hall-ep, one size up because the recap is not a dense table. */
.ov-recap .ov-ep { color:var(--amber); font-weight:600; letter-spacing:1px; }

/* ============ PHASE 4 (§8.6) ============ */

/* REPORTED by ui.js's bindChrome in as many words: "css/style.css should carry
   #modalRoot { z-index:140 } and this line should go." Carried. A modal is the topmost thing on
   screen by definition, and #overlayRoot at 120 was rendering the full map over the Hall opened
   from it. ui.js still sets this inline at boot and an inline style outranks any stylesheet, so
   today this changes nothing and duplicates nothing — it is the half of a two-file fix that lives
   on this side of the fence, waiting for the half that does not. */
#modalRoot { z-index:140; }

/* ============ PHASE 12 §1c — THE QUANTITY PROMPT ============
   Above the modal (140) because it opens OVER the inventory, a shop or the Lockbox and those own
   #modalBox while they are up. Everything below is the modal's own vocabulary at a smaller size —
   this is a question, not a screen, and it should not look like one. */
#qtyRoot { position:fixed; inset:0; background:rgba(4,6,8,.62); z-index:160; display:flex;
  align-items:center; justify-content:center; }
#qtyBox { background:var(--panel); border:1px solid var(--edge2); border-top:2px solid var(--amber-dim);
  border-radius:6px; padding:18px 20px; width:340px; max-width:92vw; box-shadow:0 18px 46px rgba(0,0,0,.6); }
.q-h { color:var(--amber); font-size:13px; font-weight:600; letter-spacing:2.5px;
  text-transform:uppercase; margin-bottom:6px; }
.q-sub { color:var(--ink-faint); font-size:var(--fs-body); line-height:1.55; margin-bottom:12px; }
.q-row { display:flex; gap:6px; align-items:center; margin-bottom:8px; }
.q-num { flex:1 1 auto; min-width:0; background:var(--panel2); border:1px solid var(--edge2);
  color:var(--amber); border-radius:4px; padding:6px 8px; font-family:var(--mono);
  font-variant-numeric:tabular-nums; font-size:15px; text-align:center; }
.q-step { background:var(--panel2); border:1px solid var(--edge2); color:var(--ink); border-radius:4px;
  width:30px; padding:6px 0; font-size:14px; line-height:1; cursor:pointer; }
.q-step:hover, .q-pick:hover { border-color:var(--amber-dim); color:var(--amber); }
.q-pick { background:var(--panel2); border:1px solid var(--edge2); color:var(--ink); border-radius:4px;
  padding:6px 9px; font-size:11px; cursor:pointer; white-space:nowrap; }
.q-quote { color:var(--ink-faint); font-family:var(--mono); font-variant-numeric:tabular-nums;
  font-size:var(--fs-body); min-height:15px; margin-bottom:10px; }
.q-hint { color:var(--ink-faint); font-size:var(--fs-small); letter-spacing:.5px; margin-top:9px; }

/* The tooltip is where every item, monster and program in the game explains itself, and it is a lot
   of words in a 290px box. Leading, and a measure — nothing else. */
#tip { line-height:1.5; }
.tc-desc { line-height:1.6; }

/* The paper doll and the minimap are the two things in the sidebar you AIM at with a mouse, so they
   get the one affordance the panel was missing: something that happens when you are over them. */
.slot, #minimapBox { transition:border-color .12s ease, background-color .12s ease; }

/* Keyboard focus. Every mouse action in this game has a key path (three phases of it) and the
   browser's own focus ring is invisible on a dark panel — so anything focusable says so in the
   game's own amber rather than in Chrome's blue. */
button:focus-visible, .slot:focus-visible, input:focus-visible {
  outline:2px solid var(--amber-dim); outline-offset:1px; }

/* POLISH1 §6.1 — THE PRESSED STATE, once, for every button family in the game. Hover was answered
   everywhere and the press was answered nowhere: a click landed with no acknowledgement at all,
   which on a turn-based game with a 42 ms travel step is the difference between "it did not take
   my click" and "it took my click and the turn is resolving". Half a pixel and eight percent of
   brightness — the smallest thing that reads, and nothing that moves layout. */
.m-btn:active, .tb-btn:active, .btn-big:active, .btn-med:active, .q-step:active, .q-pick:active {
  filter:brightness(.92); transform:translateY(0.5px); }
/* The brightness IS the feedback and it survives; the half-pixel dip is the part that is motion. */
@media (prefers-reduced-motion: reduce) {
  .m-btn:active, .tb-btn:active, .btn-big:active, .btn-med:active, .q-step:active, .q-pick:active {
    transform:none; }
}

/* POLISH1 §6.4 — the same scrollbar in Firefox, which has never read a ::-webkit- rule and so has
   been drawing the OS default light bar down the side of the log and the shop panes since Phase 0.
   Firefox offers two properties and no more; these are the closest the standard syntax can come to
   the four rules below, and they use the same two tokens deliberately. */
* { scrollbar-width:thin; scrollbar-color:var(--edge2) var(--bg); }
::-webkit-scrollbar { width:9px; height:9px; }
::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:var(--edge2); border-radius:5px; }
::-webkit-scrollbar-thumb:hover { background:#4c5a68; }

/* ============ ABSORBED FROM ui.js injectStyles() (PHASE5-BRIEF §0.4) ============
   These ~190 lines shipped injected from ui.js because Phase 2-4 clusters could not write this
   file. They are moved here verbatim and injectStyles() is deleted in the same change: two copies
   of one rule where the injected one wins is the law-in-the-wrong-file failure (sighting six).
   Every value is one of the variables above; nothing here invents a colour. */
#modalBox.wide { max-width:1040px; }
.tag { font-size:8.5px; letter-spacing:1px; text-transform:uppercase; border:1px solid var(--edge2);
  border-radius:3px; padding:0 3px; color:var(--ink-faint); margin-left:3px; white-space:nowrap; }
.tag.eq { color:var(--cyan); border-color:var(--cyan-dim); }
.tag.lock { color:var(--amber); border-color:var(--amber-dim); }
.tag.cert { color:var(--good); border-color:var(--good); }
.tag.mal { color:var(--bad); border-color:var(--bad); }
.tag.new { color:var(--ink-faint); border-color:var(--edge2); }

/* ---- item card ---- */
.iv-card { background:var(--panel2); border:1px solid var(--edge); border-radius:5px;
  padding:9px 11px; margin-top:8px; font-size:12px; }
.ic-tags { margin-top:5px; }
.ic-stats { font-family:var(--mono); font-size:var(--fs-body); color:var(--amber); margin-top:6px; }
.ic-blind { color:var(--ink-faint); }
.ic-riders { display:flex; flex-wrap:wrap; gap:4px 10px; margin-top:6px; }
.ic-r { font-family:var(--mono); font-size:11px; color:var(--ink); }
.ic-r i { color:var(--ink-faint); font-style:normal; }

/* ---- inventory ---- */
.iv-tabs { display:flex; gap:4px; flex-wrap:wrap; margin-bottom:8px; }
.iv-tab { background:var(--panel2); border:1px solid var(--edge); border-radius:4px; padding:5px 9px;
  font-size:var(--fs-body); color:var(--ink-dim); }
.iv-tab i { font-family:var(--mono); font-size:10px; color:var(--ink-faint); font-style:normal; }
.iv-tab:hover { border-color:var(--edge2); }
.iv-tab.on { border-color:var(--amber-dim); background:var(--amber-deep); color:var(--amber); }
.iv-tab.dest { border-color:var(--cyan-dim); color:var(--cyan); }
.iv-tab.drop { border-color:var(--cyan); background:var(--cyan-deep); }
.iv-n { font-family:var(--mono); font-size:10px; color:var(--ink-faint); }
.iv-cols { display:flex; gap:12px; align-items:flex-start; }
.iv-list { flex:1.6; min-width:0; max-height:44vh; overflow-y:auto; }
.iv-side { flex:1; min-width:0; }
.iv-only { display:flex; justify-content:space-between; align-items:center; gap:8px; font-size:11px;
  color:var(--ink-faint); margin-bottom:5px; }
.iv-only b { color:var(--cyan); }
.iv-row { display:flex; align-items:center; gap:8px; background:var(--panel2); border:1px solid var(--edge);
  border-radius:4px; padding:4px 8px; margin-bottom:3px; cursor:pointer; }
.iv-row:hover { border-color:var(--edge2); }
.iv-row.sel { border-color:var(--amber-dim); background:var(--amber-deep); }
.iv-row canvas { width:24px; height:24px; flex:0 0 24px; }
.iv-nm { flex:1; min-width:0; color:var(--ink); font-size:var(--fs-med); overflow:hidden;
  text-overflow:ellipsis; white-space:nowrap; }
.iv-st { font-family:var(--mono); font-size:var(--fs-small); color:var(--ink-faint); white-space:nowrap; }
.iv-st.no { color:var(--bad); }
.iv-doll { margin-bottom:8px; }
.slot.mal { border-color:var(--bad); }
.slot.only { border-color:var(--cyan); }
.slot.drop { border-color:var(--cyan); background:var(--cyan-deep); }
.iv-btns { display:flex; gap:5px; flex-wrap:wrap; margin-top:8px; }
.iv-btns .btn-med { flex:0 1 auto; padding:6px 10px; font-size:var(--fs-body); }
.iv-btns .btn-med.primary { background:var(--btn-primary-grad); color:var(--btn-primary-ink);
  border:none; font-weight:700; }
.iv-btns .btn-med.off { opacity:.4; }
.iv-foot { margin-top:10px; border-top:1px solid var(--edge); padding-top:8px; }
/* Not absolutely positioned, and that is the fix rather than the style: pinned to the top-right
   of .iv-foot it landed exactly on the weight bar's own right-aligned readout and overprinted it.
   Caught in a screenshot; a DOM test would have called both strings present and passed. */
.iv-tier { text-align:right; margin-top:5px; font-size:10px; letter-spacing:2px;
  text-transform:uppercase; color:var(--ink-faint); }
.iv-tier.t1 { color:var(--warn); } .iv-tier.t2 { color:var(--warn2); } .iv-tier.t3 { color:var(--bad); }
.iv-hint { margin-top:8px; font-size:var(--fs-small); color:var(--ink-faint); line-height:1.9; }
.iv-move { color:var(--amber); letter-spacing:1px; }

/* ---- the program picker's school strip (PHASE6 §1) ----
   Deliberately heavier than .sh-f, which is what this used to be: the shop's 10px uppercase
   transparent filter chip read as a caption, so nineteen levels went by inside one school. These
   are buttons — panel ground, real padding, the school's own icon and accent. `.empty` is a school
   with nothing loaded in it yet: dimmed, never hidden, because that is the one worth advertising. */
.pk-schools { display:flex; gap:5px; flex-wrap:wrap; margin-bottom:9px; }
.pk-school { display:flex; align-items:center; gap:6px; background:var(--panel2);
  border:1px solid var(--edge); border-radius:5px; padding:5px 10px; cursor:pointer; }
.pk-school:hover { border-color:var(--edge2); }
.pk-school canvas { width:18px; height:18px; flex:0 0 18px; }
.pk-nm { font-size:12px; }
.pk-n { font-family:var(--mono); font-size:var(--fs-small); color:var(--ink-faint); }
.pk-school.empty { opacity:0.72; }
.pk-school.empty .pk-n { color:var(--ink-dim); }
.pk-school.on { border-width:1px; }
.pk-school.on .pk-n { color:var(--ink); }
.pk-banner { margin:-3px 0 9px; padding:6px 10px; border-left:2px solid var(--amber-dim);
  background:var(--amber-deep); color:var(--amber); font-size:var(--fs-body); line-height:1.6; }

/* ---- shops ---- */
.sh-head { display:flex; justify-content:space-between; gap:16px; align-items:flex-start;
  margin-bottom:10px; }
.sh-blurb { flex:1; font-size:12px; line-height:1.6; color:var(--ink-dim); }
.sh-till { font-size:12px; color:var(--ink-dim); text-align:right; white-space:nowrap; }
.sh-till b { font-family:var(--mono); color:var(--amber); font-size:14px; }
.sh-dim { color:var(--ink-faint); font-style:italic; }
.sh-you { font-size:11px; color:var(--ink-faint); }
.sh-you b { color:var(--cyan); font-size:var(--fs-med); }
.sh-filters { display:flex; gap:3px; flex-wrap:wrap; margin-bottom:8px; }
.sh-f { background:transparent; border:1px solid var(--edge); border-radius:3px; padding:1px 7px;
  font-size:10px; color:var(--ink-faint); letter-spacing:1px; text-transform:uppercase; }
.sh-f:hover { border-color:var(--edge2); color:var(--ink-dim); }
.sh-f.on { border-color:var(--cyan-dim); color:var(--cyan); background:var(--cyan-deep); }
.sh-cols { display:flex; gap:10px; align-items:flex-start; }
.sh-pane { flex:1; min-width:0; border:1px solid var(--edge); border-radius:5px; padding:8px; }
.sh-pane.on { border-color:var(--amber-dim); }
.sh-h { display:flex; justify-content:space-between; color:var(--ink-faint); font-size:9.5px;
  letter-spacing:2px; text-transform:uppercase; margin-bottom:6px; }
.sh-list { max-height:34vh; }

/* ---- service counters ---- */
.svc { background:var(--panel2); border:1px solid var(--edge); border-radius:5px; padding:10px 12px;
  margin-bottom:8px; }
.svc .btn-med { margin-top:8px; flex:0 0 auto; }
.svc-p { font-family:var(--mono); color:var(--amber); float:right; }
.svc-list { max-height:22vh; margin-top:8px; }

/* ============ PHASE 3 ============ */

/* ---- status chips (§2). They sit ON the bars, because CORR is a thing eating the top one. ---- */
.fx-chips { display:flex; flex-wrap:wrap; gap:3px; margin-top:6px; }
.fx-chips:empty { display:none; }
.fx { display:inline-flex; align-items:center; gap:4px; font-size:9px; letter-spacing:1.5px;
  border:1px solid var(--edge2); border-radius:3px; padding:1px 5px; color:var(--ink-dim);
  cursor:default; white-space:nowrap; }
.fx b { font-family:var(--mono); font-size:9.5px; letter-spacing:0; color:var(--ink-faint);
  font-weight:400; }
.fx i { font-style:normal; font-size:8.5px; color:var(--ink-faint); letter-spacing:1px; }
/* The two meanings, and they are D.FX's own cls field — a status that did this TO you reads bad, a
   thing you did back reads good. No file here decides which is which. */
.fx.bad { color:var(--bad); border-color:var(--bad); background:rgba(215,95,86,.10); }
.fx.good { color:var(--good); border-color:var(--good); background:rgba(111,191,120,.10); }

/* ---- the hotbar (GAMEPLAN §10). Ten digits, five to a row, the doll's visual language: fixed
   cells so the 26px school glyphs paint near 1:1 rather than blurring to the panel's width. ---- */
.hotbar { display:grid; grid-template-columns:repeat(5, 40px); grid-auto-rows:40px; gap:4px;
  justify-content:center; }
.hb { position:relative; background:var(--panel2); border:1px solid var(--edge); border-radius:4px;
  display:flex; align-items:center; justify-content:center; padding:0; }
.hb:hover { border-color:var(--amber-dim); background:var(--panel3); }
.hb canvas { width:26px; height:26px; opacity:.28; }
.hb.filled canvas { opacity:1; }
/* Dim, never dead: an empty pool is rules.js's refusal to word, not ours to pre-empt. The cell
   still presses, and R.canCast says why. */
.hb.off canvas { opacity:.42; }
.hb.off .hb-ct { color:var(--bad); }
/* The slot you are currently aiming. */
.hb.on { background:var(--amber-deep); box-shadow:inset 0 0 0 1px var(--amber-dim); }
.hb-k { position:absolute; top:-1px; left:1px; padding:0 2px; font-size:8px; background:transparent;
  border:none; color:var(--ink-faint); }
.hb.filled .hb-k { color:var(--ink-dim); }
.hb-ct { position:absolute; bottom:0; right:2px; font-size:9px; color:var(--ink-faint);
  font-variant-numeric:tabular-nums; }

/* ---- the aim badge. Amber like the close prompt: it is a mode that wants an answer. ---- */
#aimBadge { position:absolute; left:10px; top:8px; font-size:10px; letter-spacing:2px;
  color:var(--amber); background:var(--amber-deep); border:1px solid var(--amber-dim);
  border-radius:4px; padding:4px 9px; pointer-events:none; }

/* ---- program cards + the picker ---- */
.tag.tier { color:var(--ink-dim); border-color:var(--edge2); }
.iv-row.dim { opacity:.5; }
.iv-row.dim.sel { opacity:.85; }

/* ============ PHASE 4 ============ */

/* A trophy announces itself (D.ITEMS' unique block) and a quest object announces that it is not
   yours. Amber is this game's colour for a thing with weight and worth; the quest tag is the cyan
   the shop screens already use for 'this is the town talking', because that is what it is. */
.tag.uniq { color:var(--amber); border-color:var(--amber-dim); background:var(--amber-deep); }
.tag.quest { color:var(--cyan); border-color:var(--cyan-dim); }
/* The eight uniques' lore is the reward for twelve floors of walking and it is four sentences long
   on purpose. Give it the line-height to be read; take nothing else. */
.ic-lore { line-height:1.75; }

/* ---- the Founder's Archive (§4). The restraint IS the landing: no glow, no scanlines, no green
   phosphor, no typewriter. It is a record, on a bench, in a white room, and it is rendered in the
   same panel as a receipt from Bex. The ONLY thing this stylesheet gives it that the shop does not
   get is room to breathe: a measure that stops at ~62 characters, because the reveal is three
   paragraphs long and a paragraph the width of a shop counter is a paragraph nobody reads. ---- */
.story { background:var(--panel2); border:1px solid var(--edge); border-radius:5px; padding:16px 18px; }
.story-head { font-family:var(--mono); font-size:10px; letter-spacing:3px; text-transform:uppercase;
  color:var(--ink-faint); border-bottom:1px solid var(--edge); padding-bottom:8px; margin-bottom:12px; }
.story-body { font-size:13px; line-height:1.85; color:var(--ink); max-width:62ch; }
/* The screen has gone dark and the line is the room, not the terminal. One shade back, and that is
   the whole of the difference — it is the same voice, it has just stopped being addressed to you. */
.story-dark { color:var(--ink-dim); }
.story-btns { align-items:center; }
.story-pg { margin-left:auto; font-size:10px; color:var(--ink-faint); letter-spacing:1px; }

/* ---- Aske's trade (§3). Neither half is weighted, so neither half is coloured. ---- */
.talk-trade { margin-top:10px; border:1px solid var(--edge); border-radius:5px; padding:8px 10px;
  font-size:12px; line-height:1.6; color:var(--ink-dim); }
.talk-trade b { color:var(--amber); }

/* ---- the telegraph (§2). The bottom of the viewport, the width of the room, and the one red thing
   in a game whose whole juice budget is a 120 ms white flash. It is red because it is the only
   warning in this game that is about a turn you have not spent yet — and it is not animated, it
   does not pulse and it does not move, because a thing that moves is a thing you look at instead of
   the tile you are standing on. ---- */
#threatBadge { position:absolute; left:50%; transform:translateX(-50%); bottom:10px; font-size:11px;
  letter-spacing:2px; color:var(--bad); background:rgba(215,95,86,.14); border:1px solid var(--bad);
  border-radius:4px; padding:5px 12px; pointer-events:none; text-align:center; }
#threatBadge b { font-family:var(--mono); }

/* ---- the ending (§5) ---- */
.ov-card { color:var(--ink-dim); font-size:13.5px; line-height:1.7; margin-bottom:16px; }
.ov-card p { margin:0 0 8px; }
.ov-card p:last-child { color:var(--ink); }
/* D.EPITAPHS, under the name, where a headstone puts it. */
.hall-ep { color:var(--amber); font-size:10px; letter-spacing:1px; }
/* PHASE13 §3 — the tier tag beside the name in the Hall. Deliberately the FAINTEST ink on the row,
   and deliberately not amber: the epitaph above is something a run earned and this is a fact about
   which door it came in by. It states it once and is done — no colour of its own, so the palette and
   the CVD sweep are untouched by this phase. */
.hall-tag { color:var(--ink-faint); font-size:9px; letter-spacing:2px; margin-left:7px;
  border:1px solid var(--edge2); border-radius:3px; padding:1px 4px; }
/* A system that is higher than the one Maren rebuilt: the Gauntlets, the Bearing. Marked, never
   re-derived — statVal asks R.statOf and this only says that the two numbers differ. */
.stat.geared .s-val { color:var(--cyan); }

/* ============ POLISH2 §4 — the worn group and the sort chip ============
   A group rule, not a row: the header is a label the arrow keys walk past and the index arithmetic
   never sees. Every value here is an existing token — no new hex enters the palette for a caption,
   so the CVD sweep has nothing to re-run (V3-GAMEPLAN §2's colour law). The chip itself reuses
   `.sh-f.on`, the shop's own filter chip, because it is the same object: a small stateful control
   at the end of a bar. */
.iv-group { font-size:9.5px; letter-spacing:1.5px; text-transform:uppercase; color:var(--ink-faint);
  border-top:1px solid var(--edge); margin:8px 0 3px; padding-top:5px; display:flex;
  justify-content:space-between; align-items:baseline; }
.iv-group:first-child { border-top:0; margin-top:0; padding-top:0; }
.iv-sort { margin-left:auto; }
