/* Block Performance — the console, in the InsightX layout language (§8e).

   §8c stays the palette (warm near-black, orange as the one hot accent,
   gold/mint/rose where a number IS money) and the honesty rules. §8d stays
   the motion. §8e changes the geometry and the composition: a rounded card
   grid, one lead card per page with a soft radial orange bloom and its
   one-line "why", 36px icon tiles, delta pills, one dominant area chart,
   bubble breakdowns, a rounded rail whose selected item is a filled white
   pill, and sentence-case labels on this layer (mono stays for numbers,
   addresses and log lines). */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,200..700&family=Instrument+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* ground + surfaces (§8c's tokens kept; §8e adds the card layer) */
  --ground: #0A0908;          /* warm near-black, never a neutral one */
  --panel: #111110;
  --line: #1F1E1C;            /* the one border colour */
  --line-2: #2A2825;
  --app: #0E0D0C;             /* §8e: the ground the card grid sits on */
  --card: #141312;            /* §8e: card surface */
  --card-2: #1A1917;          /* icon tile, inset rows, hover */

  /* ink. §8c set this ramp by eye; §8g rule 8 sets a floor under it --
     text at >= 4.5:1, icons at >= 3:1. The old --ink-3 (#605D5A) measured
     2.84:1 on a card, which is what made every caption in the renders read
     as washed-out rather than quiet. Both text steps are lifted and
     re-spaced so the hierarchy survives the floor: 7.8:1 and 4.9:1 on a
     card, still clearly two registers. --ink-4 stays where it is: it is a
     bar's unfilled remainder and a hairline, never text. */
  --ink: #E8E6E3;             /* values -- 14.9:1 */
  --ink-2: #A3A09C;           /* units, denominators, secondary body -- 7.1:1 */
  --ink-3: #85827E;           /* micro-labels, captions -- 4.9:1 */
  --ink-4: #3A3836;           /* unfilled remainder of any bar; never text */

  /* the one hot accent — live or active, nothing else */
  --hot: #F4600C;
  --ok: #4ADE80;              /* dot / delta / outline only, never a fill */
  --bad: #EF4444;             /* dot / delta / outline only, never a fill */

  /* money colours keep their jobs where a number IS money */
  --gold: #E8C170;            /* reputation, market cap */
  --mint: #7EF0B5;            /* profit, and §8e's positive delta pill */
  --rose: #FF6B7A;            /* loss, and §8e's negative delta pill */
  --amber: #FFB86B;           /* HELD / WARN tags, and the change flash */

  --d: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --t: "Instrument Sans", "Inter", "Helvetica Neue", Arial, sans-serif;
  --m: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(.2,.7,.2,1);
  --t-fast: 160ms;
  --t-slow: 240ms;

  /* §8e geometry */
  --r-card: 18px;
  --r-inner: 12px;
  --r-tile: 11px;
  --r-pill: 999px;
  --gut: 14px;
  --rail-l: 232px;
  --rail-r: 332px;
  --pad: 20px;
}

/* ── reset & base ─────────────────────────────────────────────── */
* { box-sizing: border-box; }
/* `.card`, `.empty` and the table wrappers all carry their own `display`,
   which (same origin, equal specificity) beats the UA sheet's bare
   `[hidden] { display: none }` -- without this an empty state stays visible
   underneath a populated table. */
[hidden] { display: none !important; }
html, body {
  background: var(--app); color: var(--ink); margin: 0;
  /* §8g's body step. 13px was tuned on a laptop half this size; on the
     16-inch reference (1728 CSS px) it reads as a settings panel rather
     than a product. Dense registers -- tables, logs, addresses -- keep
     their own smaller mono sizes below. */
  font-family: var(--t); font-size: 14px; -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--hot); }
::selection { background: rgba(244,96,12,.28); }
:focus-visible { outline: 2px solid var(--hot); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--d); font-weight: 400; letter-spacing: -0.01em; margin: 0;
  line-height: 1.35; }

/* §8g's display steps, as the one place they are written down.
   40 hero · 32 value · 24 section · 18 card title, then 15 body / 13
   secondary / 11.5 mono caption. A page that wants a display size asks for
   a step by name instead of inventing one two pixels away from it. */
.d40 { font-family: var(--d); font-weight: 200; font-size: 40px; line-height: 1.15;
  letter-spacing: -0.03em; }
.d32 { font-family: var(--d); font-weight: 300; font-size: 32px; line-height: 1.2;
  letter-spacing: -0.025em; }
.d24 { font-family: var(--d); font-weight: 400; font-size: 24px; line-height: 1.25;
  letter-spacing: -0.02em; }
.d18 { font-family: var(--d); font-weight: 400; font-size: 18px; line-height: 1.3;
  letter-spacing: -0.015em; }
.body-copy { font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.secondary { font-size: 13px; line-height: 1.5; color: var(--ink-2); }

/* ── the three typographic registers ──────────────────────────────
   §8e: labels drop the mono uppercase on this layer and become sentence
   case; mono stays for numbers, addresses and log lines. `.mlabel` is the
   hook every page already uses for "the label above a value", so it is
   restyled rather than replaced. */
.mlabel {
  font-family: var(--t); font-size: 13px; font-weight: 400; text-transform: none;
  letter-spacing: 0; color: var(--ink-2); display: block;
}
/* the one place the instrument register survives: a table header, a log
   tag, an axis tick — rows of numbers want their column named in mono */
thead th, .navgroup .label, .axis, .tag {
  font-family: var(--m); font-size: 11px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .09em; color: var(--ink-3);
}
/* value: §8g -- 40px on the hero, 32px elsewhere, unit trailing at 45% in
   the muted colour. Tabular figures and a fixed line box so a number that
   updates never nudges the card. */
.val {
  font-family: var(--d); font-weight: 300; font-size: 32px; line-height: 1.08;
  color: var(--ink); letter-spacing: -0.025em; font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; min-width: 0;
}
.val .unit { font-size: .45em; font-weight: 400; color: var(--ink-2); letter-spacing: 0; }
.val.sm { font-size: 28px; }
.val.lg { font-size: 40px; font-weight: 200; }
/* logs, tables, addresses, axis labels */
.num, td.num, .mono { font-family: var(--m); font-variant-numeric: tabular-nums; }

.up, .profit { color: var(--mint); }
.down, .loss { color: var(--rose); }
.muted { color: var(--ink-3); }
.gold { color: var(--gold); }
.hot { color: var(--hot); }

/* ── shell: a rounded rail, a top bar, two working columns ──────
   §8g's grid: a content column that stops at 1600px and centres, 24px
   gutters, a 264px left rail and a 320px right rail at the 16-inch
   reference (1728 CSS px). Below that the gutters tighten first and the
   rails narrow second, so the working column keeps its width longest --
   it is the only column with content that has to fit. */
.console {
  display: grid; min-height: 100vh; gap: var(--gut); padding: var(--gut);
  background: var(--app); max-width: calc(1600px + var(--gut) * 2); margin: 0 auto;
  grid-template-columns: var(--rail-l) minmax(0, 1fr) var(--rail-r);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas: "left top top" "left main right";
}
@media (min-width: 1600px) {
  :root { --gut: 24px; --pad: 24px; --rail-l: 264px; --rail-r: 320px; }
}
.topbar { grid-area: top; }
.rail-left { grid-area: left; }
.workcol { grid-area: main; }
.rail-right { grid-area: right; }

/* ── top bar: title · ticker · search pill · icon buttons ──────── */
.topbar {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  position: sticky; top: 0; z-index: 8;
  background: var(--app); margin-top: calc(var(--gut) * -1);
  padding: var(--gut) 2px 10px;
}
.topbar .page-title {
  font-family: var(--d); font-size: 24px; font-weight: 400; letter-spacing: -0.03em;
  line-height: 1.25; color: var(--ink); white-space: nowrap; flex: 0 0 auto;
}
.topbar .spacer { flex: 1 1 auto; min-width: 0; }

/* the event ticker (§8d). Hidden until a page actually has events to run
   through it — an empty tape is chrome pretending to be telemetry. */
.ticker {
  flex: 1 1 auto; min-width: 0; overflow: hidden; height: 22px; margin-left: 44px;
  /* A tape that scrolls has to fade at BOTH ends by more than a word, or
     the reader sees a headline cut mid-word and reads it as a bug (§8g). */
  mask-image: linear-gradient(90deg, transparent, #000 90px, #000 calc(100% - 90px), transparent);
  -webkit-mask-image:
    linear-gradient(90deg, transparent, #000 90px, #000 calc(100% - 90px), transparent);
}
.ticker .tape { display: inline-flex; gap: 26px; white-space: nowrap; will-change: transform;
  animation: bp-ticker 42s linear infinite; }
.ticker:hover .tape { animation-play-state: paused; }
.ticker .tk { display: inline-flex; align-items: center; gap: 7px; font-size: 11.5px;
  color: var(--ink-3); }
.ticker .tk .dot { flex: 0 0 5px; width: 5px; height: 5px; }
.ticker .tk .age { font-family: var(--m); font-size: 10px; color: var(--ink-2); }

/* the "Search anything" pill — the console's one typed control (§8e) */
.cmd {
  position: relative; flex: 0 1 340px; min-width: 170px;
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 15px;
  border-radius: var(--r-pill); background: var(--card); border: 1px solid var(--line);
  transition: border-color var(--t-fast) var(--ease);
}
.cmd:focus-within { border-color: var(--line-2); }
.cmd .prompt { flex: 0 0 14px; color: var(--ink-3); display: flex; }
.cmd input[type="text"] {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; height: 24px;
  padding: 0; color: var(--ink); font-family: var(--t); font-size: 13px;
}
.cmd input[type="text"]:hover { border: 0; }
.cmd input::placeholder { color: var(--ink-3); }
/* what the command answered, under the pill — never a modal */
.cmd-out {
  position: absolute; top: calc(100% + 8px); right: 0; width: min(460px, 78vw);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-inner);
  padding: 10px 13px; display: flex; flex-direction: column; gap: 6px; z-index: 12;
  font-family: var(--m); font-size: 11px; line-height: 1.5; color: var(--ink-2);
  max-height: 260px; overflow-y: auto;
}
.cmd-out .l.warn { color: var(--amber); }
.cmd-out .l.echo { color: var(--hot); }

.iconbtn {
  flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; padding: 0;
  background: var(--card); border: 1px solid var(--line); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.iconbtn:hover { color: var(--ink); border-color: var(--line-2); }
.iconbtn.spinning svg { animation: bp-spin 700ms var(--ease); }
.iconbtn[aria-pressed="true"] { color: var(--hot); border-color: rgba(244,96,12,.5); }
/* the one emergency control (§8c), on the button system's metrics so the
   top bar's row of controls shares a baseline and a radius */
.halt {
  flex: 0 0 auto; height: 38px; padding: 0 16px; border-radius: 14px;
  border: 1px solid rgba(239,68,68,.55); background: transparent; color: var(--bad);
  cursor: pointer; font-family: var(--m); font-size: 10.5px; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.halt:hover { color: var(--ink); border-color: var(--bad); background: rgba(239,68,68,.12); }
.halt:active { transform: translateY(1px); }

/* the time-range menu the clock button opens */
.menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 12; min-width: 200px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-inner);
  padding: 8px; display: flex; flex-direction: column; gap: 2px;
}
.menu .mh { padding: 6px 9px 8px; font-size: 12px; color: var(--ink-3); line-height: 1.45; }
.menu button {
  text-align: left; background: transparent; border: 0; border-radius: 8px; height: 30px;
  padding: 0 9px; color: var(--ink-2); font-family: var(--t); font-size: 13px; cursor: pointer;
}
.menu button:hover { background: var(--card-2); color: var(--ink); }
.topbar .wrap { position: relative; display: flex; }

/* confirmation dialog */
dialog.confirm {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  color: var(--ink); padding: 0; width: min(430px, calc(100vw - 32px)); overflow: hidden;
}
dialog.confirm::backdrop { background: rgba(10,9,8,.78); }
.confirm .body { padding: 20px 22px 18px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.confirm .body b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 6px;
  font-family: var(--d); font-size: 16px; }
.confirm .foot { display: flex; gap: 10px; padding: 0 22px 20px; }
.confirm .foot button { flex: 1; height: 40px; border-radius: 14px;
  font-family: var(--t); font-size: 13.5px; letter-spacing: 0; text-transform: none; }
.confirm .err { color: var(--bad); font-family: var(--m); font-size: 11px; padding: 0 22px 14px; }

/* ── left rail: one rounded card, pill navigation ─────────────── */
.rail-left {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  display: flex; flex-direction: column; min-width: 0;
  position: sticky; top: var(--gut); align-self: start;
  height: calc(100vh - var(--gut) * 2); overflow-y: auto;
}
/* ── the brand (§8h) ──────────────────────────────────────────────
   One mark, one logotype, one set of rules -- the rail, the login card and
   the Telegram banner all draw the same thing at different sizes. The mark
   is a drawing, not an image: no border-radius clip, no box. The logotype
   gets its contrast from the two words, not from tracking. */
.bp-lockup { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.bp-mark { display: block; flex: 0 0 auto; }
.bp-word {
  /* sized by the caller through a custom property rather than an inline
     font-size, so a narrow viewport can still step it down */
  font-family: var(--d); font-size: var(--bp-word, 15px); letter-spacing: -0.01em;
  line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  min-width: 0;
}
.bp-word b { font-weight: 600; color: var(--ink); }
.bp-word i { font-style: normal; font-weight: 400; color: var(--ink-2); margin-left: .32em; }

.brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px 16px; min-width: 0; }
.chrome { color: var(--ink); }

.navgroups { display: flex; flex-direction: column; gap: 16px; flex: 1 1 auto; padding: 0 10px 16px; }
.navgroup .label { display: block; padding: 0 8px; margin-bottom: 6px;
  font-family: var(--t); font-size: 12px; text-transform: none; letter-spacing: 0;
  color: var(--ink-3); }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 13px;
  border-radius: var(--r-pill); color: var(--ink-2); font-size: 13.5px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav a svg { flex: 0 0 15px; opacity: .85; }
.nav a:hover { background: var(--card-2); color: var(--ink); }
/* §8e: the selected item is a filled white pill with dark text and an icon */
.nav a.active { background: var(--ink); color: #100F0E; font-weight: 500; }
.nav a.active svg { opacity: 1; }
.nav a.active:hover { background: #fff; color: #100F0E; }

/* the rail's foot block: the chain context and the watcher status */
/* The rail used to end with a mono-caps "BLOCK PERFORMANCE" under this
   block -- the brand twice in one 264px column, and in exactly the spaced
   capitals §8h's logotype replaced. §8g rule 7: once each. */
.railfoot { margin-top: auto; padding: 12px 12px 18px; }
.ctx-select { padding: 0 0 12px; }
.ctx-select .mlabel { margin-bottom: 6px; font-size: 12px; color: var(--ink-3); }
.userblock {
  background: var(--card-2); border-radius: var(--r-inner); padding: 12px 13px;
  display: flex; flex-direction: column; gap: 10px;
}
.userblock .top { display: flex; align-items: center; gap: 9px; min-width: 0; }
.statuspill {
  display: inline-flex; align-items: center; gap: 7px; height: 24px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill); background: transparent;
  font-family: var(--m); font-size: 10px; font-weight: 500; letter-spacing: .1em;
  color: var(--ink-2); text-transform: uppercase; white-space: nowrap;
}
.statuspill[data-state="watching"] { color: var(--hot); border-color: rgba(244,96,12,.45); }
.statuspill[data-state="degraded"] { color: var(--amber); border-color: rgba(255,184,107,.45); }
.statuspill[data-state="halted"] { color: var(--ink-2); border-color: var(--line-2); }
.railstatus { display: flex; flex-direction: column; gap: 8px; }
.railstatus .line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.railstatus .k { font-size: 12px; color: var(--ink-3); }
.railstatus .v { font-family: var(--m); font-size: 11px; color: var(--ink);
  font-variant-numeric: tabular-nums; }


/* ── breadcrumbs: a quiet line above the cards ────────────────── */
.crumbs {
  display: flex; align-items: center; gap: 7px; min-height: 18px; padding: 0 2px 12px;
  font-size: 12px; color: var(--ink-3); overflow-x: auto; white-space: nowrap;
}
.crumbs .sep { color: var(--ink-4); }
.crumbs .crumb { color: var(--ink-2); }
.crumbs .crumb.current { color: var(--hot); }

/* ── the card ─────────────────────────────────────────────────── */
.workcol { display: flex; flex-direction: column; min-width: 0; }
.content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--gut); }
.content.flush { padding: 0; }

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--pad); min-width: 0; position: relative;
  display: flex; flex-direction: column; gap: 12px;
}
.card.pad0 { padding: 0; gap: 0; }
.card-head { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.card-head .htxt { min-width: 0; flex: 1 1 auto; display: flex; flex-direction: column; gap: 3px; }
.card-head h3, .card h3 {
  font-family: var(--d); font-size: 18px; font-weight: 400; letter-spacing: -0.015em;
  line-height: 1.3; color: var(--ink); text-transform: none; min-width: 0;
  overflow-wrap: anywhere;
}
.card-head .sub { font-size: 13px; color: var(--ink-2); line-height: 1.5; max-width: 76ch; }
.card-head .mono, .card-head .pill { flex: 0 0 auto; white-space: nowrap; }
/* a control in a card head is a control, not a column: it keeps its own
   width instead of stretching across the head */
/* `.card .field { width: 100% }` further down made this control's flex
   basis the whole head, so the heading beside it got what was left --
   nothing, one letter per line. A control in a head keeps its own width
   (§8g rule 1: nothing is clipped, nothing wraps to one word per line). */
.card .card-head .field, .card-head .field { flex: 0 0 auto; width: auto; }
.card-head .field input, .card-head .field select { width: 220px; }
.card-head .mono.muted { font-size: 10.5px; letter-spacing: .04em; margin-top: 4px;
  color: var(--ink-2); }
.card .pad { padding: 0 var(--pad) var(--pad); }
.card .pad.top { padding-top: 14px; }
.card.pad0 > .card-head { padding: var(--pad) var(--pad) 0; }

/* the 36px icon tile, top-left of every card (§8e) */
.itile {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: var(--r-tile);
  background: var(--card-2); color: var(--ink-2);
  display: inline-flex; align-items: center; justify-content: center;
}
.itile svg { width: 17px; height: 17px; }
.itile.hot { color: var(--hot); }
.itile.gold { color: var(--gold); }

/* the ⋯ top-right: it toggles the card's provenance note, so it is a real
   control rather than decoration */
.cmenu {
  flex: 0 0 26px; width: 26px; height: 26px; margin: 4px 0 0 auto; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--ink-4);
  cursor: pointer; font-size: 15px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.cmenu:hover, .cmenu[aria-expanded="true"] { color: var(--ink); background: var(--card-2); }
.card-note {
  font-size: 12px; line-height: 1.5; color: var(--ink-3); border-top: 1px solid var(--line);
  padding-top: 10px; max-width: 74ch;
}
.card-note code, .card-note .mono { font-family: var(--m); font-size: 11px; color: var(--ink-2); }

/* ── KPI cards, and the one lead card per page ────────────────── */
.kpis { display: grid; gap: var(--gut); grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* §8e: the lead card is larger than the cards beside it */
.kpis.three { grid-template-columns: 1.25fr 1fr 1fr; }
.kpis.lead { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
.kpi-tile {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--pad); min-width: 0; position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
}
.kpi-tile .kpi-body { margin-top: auto; display: flex; flex-direction: column; gap: 7px; }
.kpi-tile .mlabel { margin: 0; }
.kpi-tile .val { position: relative; z-index: 1; }

/* the lead card: larger, with a soft radial orange bloom behind its value
   and its one-line "why" beneath the number (§8e). The bloom is a
   background wash — it never touches the glyphs. */
.kpi-tile.lead { min-height: 186px; }
.kpi-tile.lead::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(120% 88% at 22% 96%, rgba(244,96,12,.30) 0%, rgba(244,96,12,.11) 38%, transparent 72%),
    radial-gradient(70% 60% at 88% 8%, rgba(244,96,12,.10) 0%, transparent 70%);
}
.kpi-tile.lead > * { position: relative; z-index: 1; }
.kpi-tile.lead .val { font-size: 44px; font-weight: 200; }
.kpi-tile.lead .itile { background: rgba(26,25,23,.72); color: var(--hot); }
.why { font-size: 12px; line-height: 1.5; color: var(--ink-2); max-width: 46ch; }

/* the delta pill: mint ▲ / rose ▼ (§8e) */
.dpill {
  display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 9px;
  border-radius: var(--r-pill); font-family: var(--m); font-size: 11px; font-weight: 500;
  font-variant-numeric: tabular-nums; white-space: nowrap; align-self: center;
}
.dpill.up { color: var(--mint); background: rgba(126,240,181,.13); }
.dpill.down { color: var(--rose); background: rgba(255,107,122,.13); }
.dpill.flat { color: var(--ink-3); background: var(--card-2); }
.dpill .ar { font-size: 9px; }
.delta { font-family: var(--m); font-size: 11px; color: var(--ink-3); }
.delta.up { color: var(--mint); } .delta.down { color: var(--rose); }

/* ── the big chart ────────────────────────────────────────────── */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; }
.chart .grid line { stroke: var(--line); stroke-width: 1; shape-rendering: crispEdges; }
.chart .ytick, .chart .xtick {
  font-family: var(--m); font-size: 9.5px; fill: var(--ink-2); letter-spacing: .04em;
}
.chart .aline { fill: none; stroke: var(--hot); stroke-width: 2; stroke-linecap: round;
  stroke-linejoin: round; }
.chart .afill { stroke: none; }
/* the cursor is dashed; gridlines never are */
.chart .cursor { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 4; }
/* and so is a threshold, because that is what a dashed rule reads as */
.chart .mark { stroke: var(--hot); stroke-width: 1; stroke-dasharray: 4 4; }
.chart .marklabel { font-family: var(--m); font-size: 9.5px; fill: var(--hot);
  letter-spacing: .04em; }
.chart .cdot { fill: var(--hot); stroke: var(--card); stroke-width: 2.5; }
.chart .edge { fill: var(--hot); stroke: var(--card); stroke-width: 2.5; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart-empty { padding: 30px 2px; color: var(--ink-2); font-size: 13px; line-height: 1.6;
  max-width: 56ch; }

/* the comparison tooltip: two moments side by side (§8e) */
.ctip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 172px;
  background: var(--card-2); border: 1px solid var(--line-2); border-radius: var(--r-inner);
  padding: 9px 11px 10px; transform: translate(-50%, -100%);
  transition: opacity var(--t-fast) var(--ease);
}
.ctip .th { font-family: var(--m); font-size: 10px; letter-spacing: .06em; color: var(--ink-3);
  margin-bottom: 7px; white-space: nowrap; }
.ctip .cols { display: flex; gap: 12px; }
.ctip .col { min-width: 0; }
.ctip .col + .col { border-left: 1px solid var(--line); padding-left: 12px; }
.ctip .ck { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink-2);
  white-space: nowrap; }
.ctip .ck i { width: 9px; height: 2px; border-radius: 1px; background: currentColor;
  display: inline-block; }
.ctip .cv { font-family: var(--m); font-size: 15px; color: var(--ink); margin-top: 3px;
  font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ── bubble breakdown: share of total ─────────────────────────── */
.bubbles { position: relative; width: 100%; }
.bubbles svg { display: block; width: 100%; overflow: visible; }
.bubbles .bpct { font-family: var(--d); font-weight: 500; letter-spacing: -0.02em;
  text-anchor: middle; dominant-baseline: central; }
.blegend { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; }
.blegend .bl { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.blegend .bt { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink); }
.blegend .bt i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; }
.blegend .bv { font-family: var(--m); font-size: 11px; color: var(--ink-2); padding-left: 15px;
  font-variant-numeric: tabular-nums; }

/* ── atoms ────────────────────────────────────────────────────── */
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ink-4);
  display: inline-block; flex: 0 0 6px; }
.dot.ok { background: var(--ok); }
.dot.bad { background: var(--bad); }
.dot.hot { background: var(--hot); }
.dot.held { background: var(--amber); }
.livedot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4);
  display: inline-block; flex: 0 0 7px; }
.livedot[data-live="ok"] { background: var(--hot); }
.livedot[data-live="err"] { background: var(--bad); }
.livewrap { display: flex; align-items: center; gap: 7px; font-family: var(--m);
  font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }

.pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2);
  font-family: var(--m); font-size: 10px; letter-spacing: .06em; color: var(--ink-2);
  background: transparent; white-space: nowrap;
}
.chainpills { display: flex; gap: 6px; flex-wrap: wrap; }

/* a filter pill row (§8e) */
.pillrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pillrow .gap { flex: 1 1 12px; }
.fpill {
  display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 14px;
  border-radius: var(--r-pill); border: 1px solid var(--line); background: var(--card);
  color: var(--ink-2); font-family: var(--t); font-size: 12.5px; cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease);
}
.fpill:hover { color: var(--ink); border-color: var(--line-2); }
.fpill[aria-pressed="true"] { background: var(--ink); color: #100F0E; border-color: var(--ink);
  font-weight: 500; }
.fpill .n { font-family: var(--m); font-size: 10px; opacity: .7; }

/* bar: filled portion is the hot accent, remainder is --ink-4. §8d: the
   fill is an orange->amber gradient with a brighter leading edge. */
.bar { position: relative; height: 5px; background: var(--ink-4); overflow: hidden;
  border-radius: var(--r-pill); }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--hot) 0%, #FF8A3D 78%, var(--amber) 100%);
  transition: width var(--t-slow) var(--ease); }
.bar.gold > i { background: linear-gradient(90deg, #C89A44 0%, var(--gold) 100%); }
.rep { position: relative; height: 5px; background: var(--ink-4); overflow: hidden;
  border-radius: var(--r-pill); }
.rep > i { position: absolute; inset: 0 auto 0 0; border-radius: var(--r-pill);
  background: linear-gradient(90deg, #C89A44 0%, var(--gold) 100%);
  transition: width var(--t-slow) var(--ease); }

.tag { font-weight: 600; }
.tag.posted { color: var(--hot); }
.tag.held { color: var(--amber); }
.tag.sent { color: var(--ok); }
.tag.warn { color: var(--amber); }
.tag.info { color: var(--ink-3); }
.tag.you { color: var(--hot); }

.score {
  font-family: var(--m); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}
.score.strong { color: var(--mint); }
.score.good { color: var(--gold); }
.score.watch { color: var(--amber); }
.score.pass { color: var(--ink-3); }

/* ── controls ─────────────────────────────────────────────────── */
select, input[type="text"], input[type="number"], input[type="search"], .btn, button.btn {
  background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; color: var(--ink);
  font-family: var(--t); font-size: 13.5px; padding: 6px 12px; height: 38px;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
select {
  width: 100%; appearance: none; -webkit-appearance: none; padding-right: 26px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 15px) 15px, calc(100% - 11px) 15px;
  background-size: 4px 4px, 4px 4px; background-repeat: no-repeat;
}
select:hover, input:hover { border-color: var(--line-2); }

/* ── the button system (§8h) ──────────────────────────────────────
   Three buttons and no more: one primary (solid accent, the one action a
   screen is asking for), one secondary (outlined, same metrics), one quiet
   (text, underline on hover). Every one of them has hover, focus-visible,
   active and disabled states, and presses in 160ms.

   §8h overrides §8c's "tinted, not flooded" for this one element: a
   primary call to action IS the live thing on its screen, and a tinted
   button read as disabled next to a real input. The accent is still spent
   once per card -- a card with two primaries is the bug, not the fill. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 14px; cursor: pointer; font-family: var(--t); font-size: 13.5px;
  font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ink-2);
  padding: 0 18px; white-space: nowrap; position: relative;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.btn svg { flex: 0 0 auto; }
.btn:hover { color: var(--ink); border-color: var(--line-2); background: var(--card-2); }
.btn:active { transform: translateY(1px); }
/* §8h's metric for a standalone call to action; in-card buttons stay 38 so
   they sit on the same baseline as the inputs beside them. */
.btn.lg { height: 44px; font-size: 14.5px; padding: 0 22px; }
.btn.sm, table .btn { height: 30px; font-size: 12.5px; padding: 0 12px; border-radius: 10px; }

.btn.primary {
  background: var(--hot); border-color: var(--hot); color: #1A0C03; font-weight: 600;
}
/* §8h's "hover lifts 1px with a deeper bloom". The bloom is a radial
   gradient, the way the lead card's is: §8c banned shadows and glows
   outright, the sheet has exactly one left (the live halo) and a page test
   guards that. A gradient under the button is the same light, honestly. */
.btn.primary::after {
  content: ""; position: absolute; left: -6%; right: -6%; bottom: -12px; height: 22px;
  background: radial-gradient(50% 100% at 50% 0, rgba(244,96,12,.42), transparent 78%);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-fast) var(--ease);
}
.btn.primary:hover {
  background: #FF7020; border-color: #FF7020; color: #1A0C03; transform: translateY(-1px);
}
.btn.primary:hover::after { opacity: 1; }
.btn.primary:active { transform: translateY(0); }
.btn.primary:active::after { opacity: .55; }

.btn.danger { border-color: rgba(239,68,68,.55); color: var(--bad); background: transparent; }
.btn.danger:hover { color: var(--ink); border-color: var(--bad); background: rgba(239,68,68,.12); }

/* the quiet one: a control that must be reachable without competing */
.btn.quiet {
  background: transparent; border-color: transparent; color: var(--ink-2); padding: 0 12px;
}
.btn.quiet:hover { background: transparent; color: var(--ink); text-decoration: underline;
  text-underline-offset: 4px; }

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: .4; cursor: not-allowed; transform: none;
}
.btn:disabled:hover { transform: none; }
.btn:disabled:hover::after { opacity: 0; }
/* §8h: disabled with work in flight puts a spinner where the icon was,
   so the button explains itself instead of just going dim. */
.btn.busy > svg, .btn.busy > .ico { display: none; }
.btn.busy::before {
  content: ""; width: 14px; height: 14px; flex: 0 0 14px; border-radius: 50%;
  border: 2px solid currentColor; border-top-color: transparent;
  animation: bp-spin 700ms linear infinite;
}
/* The copy control is one letter (the template's), so it is shaped as a
   square glyph button rather than a squashed pill -- at 9px in a rounded
   pill it read as a typo in the address beside it. Its title attribute
   carries the full address for anyone who hovers or listens. */
.copybtn {
  border: 1px solid var(--line); background: transparent; color: var(--ink-3);
  font-family: var(--m); font-size: 11px; line-height: 1; border-radius: 7px;
  width: 22px; height: 22px; padding: 0; cursor: pointer; margin-left: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  vertical-align: middle; text-transform: uppercase;
}
.copybtn:hover { color: var(--ink); border-color: var(--line-2); }
/* §8e: switches as pills */
.switch { width: 42px; height: 24px; border-radius: var(--r-pill); background: var(--card-2);
  border: 1px solid var(--line); position: relative; cursor: pointer; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: var(--ink-4);
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.switch[aria-checked="true"] { border-color: rgba(244,96,12,.55); background: rgba(244,96,12,.14); }
.switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--hot); }

.filters { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field .mlabel { font-size: 12px; color: var(--ink-3); }

/* ── the signals feed: one card per judgment ──────────────────── */
.rows { display: flex; flex-direction: column; gap: var(--gut); }
.sig {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  display: flex; gap: 16px; padding: 18px 20px; min-width: 0;
  transition: border-color var(--t-fast) var(--ease);
}
.sig:hover { border-color: var(--line-2); }
/* the feed card's left block: the score is this card's identity, so it
   takes the icon tile's place and shape */
.sig-num { flex: 0 0 64px; display: flex; flex-direction: column; gap: 7px;
  background: var(--card-2); border-radius: var(--r-tile); padding: 11px 10px 10px;
  align-self: flex-start; }
.sig-of { font-family: var(--m); font-size: 9.5px; letter-spacing: .06em; color: var(--ink-2); }
.sig-score { display: block; font-family: var(--d); font-size: 26px; font-weight: 300;
  font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1; letter-spacing: -0.02em; }
.sig-score.held { color: var(--ink-3); }
.sig-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.sig-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.sig-sym { font-family: var(--d); font-size: 18px; font-weight: 500; letter-spacing: -0.02em;
  color: var(--ink); }
.sig-sym .quote { color: var(--ink-3); font-weight: 400; }
.sig-side { margin-left: auto; display: inline-flex; align-items: baseline; gap: 7px;
  font-family: var(--m); font-size: 12px; white-space: nowrap; color: var(--gold); }
.sig-side .arrow { color: var(--ink-4); }
.sig-thesis { font-size: 13px; color: var(--ink-2); line-height: 1.55; max-width: 82ch; }
.sig-marks { display: flex; gap: 8px; flex-wrap: wrap; }
.sig-marks .m { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px;
  color: var(--ink-3); background: var(--card-2); border-radius: var(--r-pill);
  padding: 3px 10px; }
.sig-marks .yes { color: var(--ok); }
.sig-marks .no { color: var(--bad); }
.sig-marks .mid { color: var(--ink-3); }
.sig-flags { display: flex; gap: 18px; flex-wrap: wrap; font-size: 12.5px; color: var(--ink-2);
  line-height: 1.5; }
.sig-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12px;
  color: var(--ink-3); }
.sig-foot .ranks { margin-right: auto; }
.sig-foot .num { font-family: var(--m); font-size: 11px; }
.flag { display: flex; align-items: flex-start; gap: 8px; color: var(--ink-2); font-size: 12.5px;
  line-height: 1.5; min-width: 0; }
.flag .dot { margin-top: 6px; }
.ranks { display: inline-flex; gap: 6px; flex-wrap: wrap; }

/* ── empty state: a plain English sentence, never a blank card ── */
.empty { background: transparent; padding: 34px 2px; color: var(--ink-2); font-size: 15px;
  line-height: 1.55; max-width: 62ch; }
.empty.tight { padding: 10px 2px; }
.empty b { display: block; color: var(--ink); font-weight: 400; font-family: var(--d);
  font-size: 18px; line-height: 1.3; margin-bottom: 7px; }
.card > .empty { padding-left: 0; }

/* ── tables ───────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; font-family: var(--m); font-size: 12px; }
thead th { position: sticky; top: 0; background: var(--card); text-align: left;
  padding: 9px 10px; border-bottom: 1px solid var(--line); z-index: 1;
  display: table-cell; white-space: nowrap; }
tbody td { padding: 0 11px; height: 38px; border-bottom: 1px solid var(--line);
  font-size: 12px; color: var(--ink-2); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--card-2); }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
.table-wrap { overflow-x: auto; border-radius: var(--r-inner); }
.table-wrap.scroll { max-height: calc(100vh - 300px); overflow-y: auto; }
.hint { color: var(--ink-2); font-size: 13.5px; line-height: 1.55; }
.note { display: block; margin-top: 6px; font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }

tbody tr[data-wallet], tbody tr[data-job] { cursor: pointer; }
.provisional-row { opacity: .58; }
tr.hairline td { text-align: left; font-family: var(--m); font-size: 10px;
  text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3);
  padding: 10px; background: var(--card-2); }
td.actions, th.actions { white-space: nowrap; position: sticky; right: 0;
  background: var(--card); border-left: 1px solid var(--line); }
tbody tr:hover td.actions { background: var(--card-2); }
.rep-mini { width: 46px; display: inline-block; vertical-align: middle; margin-left: 8px; }
.addr { font-family: var(--m); font-size: 12.5px; color: var(--ink); word-break: break-all; }
.lbl { display: inline-block; max-width: 92px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; vertical-align: bottom; }

/* a stat strip inside a card */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; }
.stats > div { background: var(--card-2); border-radius: var(--r-inner); padding: 11px 13px;
  min-width: 0; }
.stats .mlabel { margin-bottom: 5px; font-size: 11.5px; color: var(--ink-3); }
.stats b { display: block; font-family: var(--m); font-size: 14px; font-weight: 500;
  color: var(--ink); font-variant-numeric: tabular-nums; }

/* ── status vocabulary ────────────────────────────────────────── */
.pill.st-listed { color: var(--mint); border-color: rgba(126,240,181,.4); }
.pill.st-benched { color: var(--amber); border-color: rgba(255,184,107,.4); }
.pill.st-candidate, .pill.st-untracked { color: var(--ink-3); }
.pill.st-rejected { color: var(--rose); border-color: rgba(255,107,122,.4); }
.pill.job-queued { color: var(--ink-3); }
.pill.job-running { color: var(--hot); border-color: rgba(244,96,12,.45); }
.pill.job-done { color: var(--ok); border-color: rgba(74,222,128,.4); }
.pill.job-failed { color: var(--bad); border-color: rgba(239,68,68,.45); }

/* ── the verdict: one ruling, one binding reason (§6a) ────────── */
.verdict { display: block; background: var(--card-2); border-radius: var(--r-inner);
  padding: 13px 15px; }
.verdict .rule { display: flex; align-items: center; gap: 8px; font-family: var(--m);
  font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink); }
.verdict.eligible .rule { color: var(--ok); }
.verdict .rule .sep { color: var(--ink-4); }
.verdict .rule .at { color: var(--ink-2); font-weight: 500; letter-spacing: .06em; }
.verdict .why { display: block; margin-top: 7px; color: var(--ink-3); font-size: 12.5px;
  line-height: 1.55; text-transform: none; letter-spacing: 0; font-family: var(--t);
  max-width: none; }
.verdict .meta { display: block; margin-top: 6px; font-family: var(--m); font-size: 10px;
  letter-spacing: .06em; color: var(--ink-4); }

/* ── discover: the eight scan kinds, in the rounded grid ──────── */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gut); }
.cards .card { gap: 10px; }
.cards .card p { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.5;
  min-height: 56px; }
.card .field { width: 100%; }
.card select, .card input { width: 100%; }
.card .foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px; }
.card .msg { font-family: var(--m); font-size: 10px; color: var(--ink-3); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .msg.err { color: var(--rose); }
.card .msg.ok { color: var(--mint); }

/* ── the scan queue: a card list with progress pills ──────────── */
.queue { display: flex; flex-direction: column; gap: 8px; }
.queue-row { background: var(--card-2); border-radius: var(--r-inner); display: flex;
  align-items: center; gap: 11px; padding: 11px 13px; font-family: var(--m); font-size: 11px;
  color: var(--ink-2); min-width: 0; position: relative; overflow: hidden; }
.queue-row .kind { color: var(--ink); letter-spacing: .08em; text-transform: uppercase;
  flex: 0 0 74px; }
.queue-row .tgt { flex: 0 0 auto; }
.queue-row .prog { flex: 1 1 auto; min-width: 0; color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-row .when { flex: 0 0 auto; color: var(--ink-2); }

/* ── scan results ─────────────────────────────────────────────── */
.scanlist { display: flex; flex-direction: column; gap: 8px; }
.scan { background: var(--card-2); border-radius: var(--r-inner); min-width: 0; overflow: hidden; }
.scan-head { display: flex; align-items: center; gap: 11px; padding: 11px 13px;
  font-family: var(--m); font-size: 11px; color: var(--ink-2); min-width: 0; }
.scan-head.expandable { cursor: pointer; }
.scan-head .kind { color: var(--ink); text-transform: uppercase; letter-spacing: .1em;
  flex: 0 0 88px; }
.scan-head .chev { flex: 0 0 10px; color: var(--ink-4); }
.scan-head .when { margin-left: auto; color: var(--ink-2); white-space: nowrap; }
.scan-head .prog { min-width: 0; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; color: var(--ink-3); }
.scan-head .tgt { white-space: nowrap; }
.scan .verdict { border-radius: 0; background: rgba(244,96,12,.04); }
.detail { background: var(--ground); padding: 13px; }
.summary { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.mini { width: 100%; border-collapse: collapse; margin-top: 9px; }
.mini th { text-align: left; font-family: var(--m); font-size: 10px; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-3); padding: 6px 9px; border-bottom: 1px solid var(--line); }
.mini td { padding: 6px 9px; font-family: var(--m); font-size: 11px; color: var(--ink-2);
  border-bottom: 1px solid var(--line); }
.mini td.num, .mini th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mini.kv { max-width: 420px; }
.added { color: var(--mint); font-family: var(--m); font-size: 10px; }
.notadded { color: var(--ink-4); font-family: var(--m); font-size: 10px; }

/* a two-up row of cards, for a page that pairs them */
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gut); }

/* ── chains: one card per chain ───────────────────────────────── */
.chaingrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gut); }
.chaincard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--pad); min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.chaincard.halted { color: var(--ink-3); }
.chain-top { display: flex; align-items: center; gap: 11px; }
.chain-top .nm { font-family: var(--d); font-size: 19px; font-weight: 400; color: var(--ink);
  letter-spacing: -0.02em; }
.chain-top .right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.state-text { font-family: var(--m); font-size: 10px; letter-spacing: .1em; color: var(--ink-3); }
.state-text.running { color: var(--hot); }
.procs { display: flex; flex-direction: column; gap: 7px; }
.proc { display: grid; grid-template-columns: 56px 7px minmax(0, 1fr); align-items: center;
  gap: 9px; font-family: var(--m); font-size: 11px; color: var(--ink-2); }
.proc .role { color: var(--ink-3); text-transform: uppercase; letter-spacing: .1em; font-size: 10px; }
.proc .meta { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.noproc { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

/* ── the process log ──────────────────────────────────────────── */
.log { display: flex; flex-direction: column; gap: 4px; background: var(--ground);
  border-radius: var(--r-inner); padding: 12px 13px;
  max-height: 300px; overflow-y: auto; font-family: var(--m); font-size: 11px; }
.log .l { display: flex; gap: 10px; align-items: baseline; line-height: 1.55; color: var(--ink-2); }
.log .t { flex: 0 0 54px; color: var(--ink-4); }
.log .tag { flex: 0 0 52px; }
.log .who { flex: 0 0 auto; color: var(--ink-3); }
.log .msg { min-width: 0; word-break: break-word; }
.log .l.you .msg { color: var(--ink); }

/* ── settings: form grids ─────────────────────────────────────── */
.formgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px; }
.formgrid .field { min-width: 0; }
.formgrid input, .formgrid select { width: 100%; }
.switch-row { display: flex; align-items: center; height: 34px; }
.saverow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.toast { position: fixed; right: 22px; bottom: 22px; padding: 12px 16px; background: var(--card);
  border: 1px solid var(--line-2); border-radius: var(--r-inner); font-family: var(--m);
  font-size: 11px; z-index: 20; max-width: 340px; }
.toast.ok { color: var(--mint); border-color: rgba(126,240,181,.4); }
.toast.err { color: var(--rose); border-color: rgba(255,107,122,.4); }

/* ── wallet: components ───────────────────────────────────────── */
.sparkline { width: 100%; height: 94px; display: block; }
.comp-row { display: grid; grid-template-columns: 168px minmax(0, 1fr) 48px; align-items: center;
  gap: 12px; padding: 7px 0; }
.comp-row .mlabel { font-size: 12.5px; }
.rep.rose > i { background: linear-gradient(90deg, #C2455A 0%, var(--rose) 100%); }
.band-elite { color: var(--mint); }
.band-trusted { color: var(--gold); }
.band-developing { color: var(--amber); }
.band-unproven { color: var(--rose); }
.band-unscored { color: var(--ink-3); }

/* ── the command center's card grid ───────────────────────────── */
.dash { display: grid; gap: var(--gut); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.p-chart, .p-log { grid-column: 1 / -1; }
.p-bub, .p-map { grid-column: auto; }
.p-queue { grid-column: 1 / -1; }

/* LIVE, HEALTH and EVENTS are the right column's cards */
.rail-right { display: flex; flex-direction: column; gap: var(--gut); min-width: 0;
  position: sticky; top: calc(var(--gut) + 56px); align-self: start;
  max-height: calc(100vh - var(--gut) * 2 - 56px); overflow-y: auto; }
.railsec { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card);
  padding: var(--pad); min-width: 0; display: flex; flex-direction: column; gap: 12px;
  /* natural height, always: a flex column with a max-height would otherwise
     squeeze every card to fit and clip the drawing inside LIVE */
  flex: 0 0 auto; }
.railsec-head { display: flex; align-items: center; gap: 10px; }
.railsec-head .mlabel, .railsec > .mlabel { flex: 1 1 auto; margin: 0; font-size: 13px;
  color: var(--ink); font-weight: 500; }
.chainhealth { display: flex; flex-direction: column; gap: 8px; }
.chainhealth .ch { background: var(--card-2); border-radius: var(--r-inner); padding: 11px 13px; }
.chainhealth .ch.halted { color: var(--ink-3); }
.ch-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ch-name { font-family: var(--m); font-size: 11px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink); }
.ch-state { font-family: var(--m); font-size: 10px; letter-spacing: .1em; color: var(--ink-3); }
.ch-state.running { color: var(--hot); }
.ch-rows { display: flex; flex-direction: column; gap: 5px; margin-top: 9px; }
.ch-row { display: flex; align-items: center; gap: 8px; font-family: var(--m); font-size: 11px;
  color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ch-row .k { color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em;
  font-size: 10px; flex: 1 1 auto; }
.ch-row .v { color: var(--ink); }
.ch-log { margin-top: 9px; font-family: var(--m); font-size: 11px; color: var(--ink-2);
  line-height: 1.5; word-break: break-word; }
.ch-log .age { color: var(--ink-3); }

/* LIVE: the newest confluence, drawn */
.live-body { display: flex; flex-direction: column; }
.live-pane { display: flex; flex-direction: column; min-width: 0; }
.converge { width: 100%; min-height: 190px; display: block; }
.converge text { font-family: var(--m); font-size: 9px; letter-spacing: .06em; fill: var(--ink-3); }
.converge text.rank { fill: var(--ink); font-size: 10px; }
.converge text.sym { font-family: var(--d); font-size: 17px; font-weight: 400;
  letter-spacing: -0.02em; fill: var(--ink); }
.converge .link { fill: none; stroke: var(--line-2); stroke-width: 1; }
.converge .node { fill: none; stroke: var(--ink-2); stroke-width: 1; }
.converge .coin { fill: none; stroke: var(--hot); stroke-width: 1.4; }
.converge .core { fill: var(--hot); }
.converge .ring { fill: none; stroke: var(--ink-4); stroke-width: 1; stroke-dasharray: 2 4; }
.converge .retic { fill: none; stroke: var(--hot); stroke-width: 1.4; }
.live-cap { font-family: var(--m); font-size: 11px; letter-spacing: .04em; color: var(--ink-2);
  line-height: 1.55; }
/* the "nothing is live" sentence is English, so it wears the text face */
.live-cap .say { display: block; margin-top: 5px; font-family: var(--t); font-size: 12px;
  letter-spacing: 0; color: var(--ink-3); }
.live-cap b { color: var(--ink); font-weight: 500; }
.live-pane.pad { gap: 12px; }
.live-pane.pad .sig-thesis { max-width: 60ch; }
.sections { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.sec-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) 34px; align-items: center;
  gap: 10px; padding: 5px 0; }
.sec-row .mlabel { font-size: 11.5px; }
.sec-row .v { font-family: var(--m); font-size: 11px; text-align: right; color: var(--ink);
  font-variant-numeric: tabular-nums; }
.sec-row .v.low { color: var(--amber); }
.stats.telemetry { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* tabs in a card head */
.tabs { display: flex; gap: 4px; background: var(--card-2); border-radius: var(--r-pill);
  padding: 3px; }
.tab { background: transparent; border: 0; border-radius: var(--r-pill); height: 24px;
  padding: 0 11px; cursor: pointer; font-family: var(--t); font-size: 11.5px;
  letter-spacing: 0; text-transform: none; color: var(--ink-3);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.tab:hover { color: var(--ink); }
.tab[aria-selected="true"] { color: #100F0E; background: var(--ink); font-weight: 500; }

/* WATCH MAP */
.mapbody { display: flex; flex-direction: column; gap: 12px; }
.dotfield { display: grid; grid-template-columns: repeat(auto-fill, 14px); gap: 4px; }
.mdot { width: 14px; height: 14px; display: block; position: relative; color: var(--ink-4); }
.mdot::after { content: ""; position: absolute; inset: 4px; border-radius: 50%;
  background: currentColor; }
.mdot[data-heat="hour"] { color: var(--hot); }
.mdot[data-heat="hour"]::after {
  animation: bp-breathe 2.4s ease-in-out infinite;
  animation-delay: var(--breathe-delay, 0s);
}
.mdot[data-heat="day"] { color: var(--ink-2); }
.mdot:hover { color: var(--ink); }
/* §8d: an active dot ripples outward when its wallet buys */
.mdot::before { content: ""; position: absolute; inset: 4px; border-radius: 50%;
  border: 1px solid currentColor; opacity: 0; }
.mdot.ignite::before { animation: bp-ripple 700ms var(--ease) 1; }
.mdot.ignite::after { animation: bp-ignite 300ms var(--ease) 1; }
.maplegend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11.5px; color: var(--ink-3); }
.maplegend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block;
  margin-right: 6px; vertical-align: 0; background: currentColor; }

/* the health rows in the right rail */
.hrow { display: flex; flex-direction: column; gap: 7px; }
.hrow + .hrow { border-top: 1px solid var(--line); padding-top: 12px; }
.hrow .top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.hrow .k { font-size: 12.5px; color: var(--ink-2); }
.hrow .v { font-family: var(--m); font-size: 14px; color: var(--ink);
  font-variant-numeric: tabular-nums; white-space: nowrap; }
.hrow .u { font-family: var(--m); font-size: 10px; letter-spacing: .04em; color: var(--ink-2); }
.events { display: flex; flex-direction: column; gap: 11px; }
.ev { display: flex; align-items: baseline; gap: 9px; font-size: 12.5px; color: var(--ink-2);
  line-height: 1.45; min-width: 0; }
.ev .dot { align-self: flex-start; margin-top: 5px; }
.ev .dot.posted { background: var(--hot); }
.ev .dot.held { background: var(--amber); }
.ev .txt { min-width: 0; word-break: break-word; }
.ev .age { margin-left: auto; font-family: var(--m); font-size: 10px; color: var(--ink-2);
  white-space: nowrap; }
.qa { display: flex; gap: 9px; }
.qa .btn { flex: 1 1 0; height: 34px; }

/* ── the login card (§8h, §12) ────────────────────────────────────
   "The box shape is right but too empty inside." The shape is kept; what
   goes in it is a small dashboard -- the brand, a three-step strip, the one
   action with the bot's handle under it, six cells under a countdown ring,
   one status line, and a footer of facts `/api/health` can tell a stranger.
   It lives here rather than in a page-local <style> so it inherits the
   button system and cannot grow a second design language. */
.login-body { background: var(--app); }
.login-wrap {
  /* Flex, not grid: a grid's auto track is sized by the card's max-content,
     and six code <input>s carry an intrinsic width (~20 characters each) that
     once grew the track past the viewport -- the card sat centred in a track
     nobody could see, 100px to the right, the moment a code was requested. */
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  background:
    radial-gradient(980px 460px at 50% -16%, rgba(244,96,12,.11), transparent 70%),
    var(--app);
}
.login-card {
  width: 470px; max-width: 100%; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--r-card); padding: 26px 26px 0;
  display: flex; flex-direction: column; gap: 20px;
}

.login-brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.login-kicker {
  margin-left: auto; flex: 0 0 auto; font-family: var(--m); font-size: 10.5px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}

/* the strip: where you are in a flow that leaves this screen and comes back */
/* Content-sized, not three equal thirds: "Check Telegram" is longer than
   "Enter" and a 1fr column clipped it to "Check Telegr...". §8g rule 1. */
.steps { display: flex; gap: 8px; list-style: none; margin: 0; padding: 0; }
.step {
  flex: 1 1 auto; display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 11px;
  border: 1px solid var(--line); border-radius: var(--r-inner); background: var(--card-2);
  color: var(--ink-3); font-size: 12.5px; white-space: nowrap;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.step i {
  flex: 0 0 19px; width: 19px; height: 19px; border-radius: 50%; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--m); font-size: 10px; color: var(--ink-3);
  border: 1px solid var(--line-2);
}
.step span { overflow: hidden; text-overflow: ellipsis; }
/* the step you are on is the one live thing on the card */
.steps[data-at="1"] .step[data-step="1"],
.steps[data-at="2"] .step[data-step="2"],
.steps[data-at="3"] .step[data-step="3"] {
  color: var(--ink); border-color: rgba(244,96,12,.45); background: rgba(244,96,12,.10);
}
.steps[data-at="1"] .step[data-step="1"] i,
.steps[data-at="2"] .step[data-step="2"] i,
.steps[data-at="3"] .step[data-step="3"] i {
  color: #1A0C03; background: var(--hot); border-color: var(--hot);
}
/* the ones behind you are done, not pending */
.steps[data-at="2"] .step[data-step="1"],
.steps[data-at="3"] .step[data-step="1"],
.steps[data-at="3"] .step[data-step="2"] { color: var(--ink-2); }
.steps[data-at="2"] .step[data-step="1"] i,
.steps[data-at="3"] .step[data-step="1"] i,
.steps[data-at="3"] .step[data-step="2"] i { color: var(--ink-2); border-color: var(--ink-4); }

.login-head { display: flex; flex-direction: column; gap: 7px; }
.login-head h1 { font-family: var(--d); font-weight: 300; font-size: 28px; line-height: 1.15;
  letter-spacing: -0.025em; color: var(--ink); }
.login-head p { margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }

.login-action { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.login-action .btn { width: 100%; }
.bot-handle {
  align-self: center; font-family: var(--m); font-size: 12px; color: var(--ink-2);
  border-bottom: 1px solid var(--line-2); padding-bottom: 1px;
}
.bot-handle:hover { color: var(--hot); border-bottom-color: var(--hot); }

/* six cells that auto-advance and take a pasted code as one */
.code-stage { display: flex; flex-direction: column; gap: 14px; }
.code-row { display: flex; gap: 8px; }
.code-row input {
  /* width:0 kills the input's intrinsic (20-character) size; flex grows it. */
  flex: 1 1 0; width: 0; min-width: 0; height: 58px; padding: 0; text-align: center;
  font-family: var(--m); font-size: 24px; font-variant-numeric: tabular-nums;
  color: var(--ink); background: var(--card-2); border: 1px solid var(--line);
  border-radius: var(--r-inner);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.code-row input:hover { border-color: var(--line-2); }
.code-row input:focus { border-color: var(--hot); background: rgba(244,96,12,.07); outline: none; }
.code-row input:disabled { opacity: .45; }
.code-row.wrong input { border-color: rgba(255,107,122,.55); }

.code-meta { display: flex; align-items: center; gap: 12px; min-width: 0; }
.code-meta .ring { flex: 0 0 34px; line-height: 0; }
.code-meta .ring .track { stroke: var(--ink-4); }
.code-meta .ring .run { stroke: var(--hot); transition: stroke-dashoffset 1s linear; }
.code-meta.low .ring .run { stroke: var(--amber); }
.code-note { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 12.5px;
  color: var(--ink-3); line-height: 1.4; }
.countdown { font-family: var(--m); font-size: 13px; font-weight: 500; color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.code-meta.low .countdown { color: var(--amber); }

/* one line, three states (§8h): sent · wrong, N tries left · expired */
.login-status {
  margin: 0; min-height: 20px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2);
  display: flex; align-items: flex-start; gap: 8px;
}
.login-status::before {
  content: ""; flex: 0 0 7px; width: 7px; height: 7px; margin-top: 6px; border-radius: 50%;
  background: var(--ink-4);
}
.login-status[data-tone="idle"] { visibility: hidden; }
.login-status[data-tone="ok"]::before { background: var(--hot); }
.login-status[data-tone="bad"] { color: var(--rose); }
.login-status[data-tone="bad"]::before { background: var(--rose); }
.login-status[data-tone="warn"] { color: var(--amber); }
.login-status[data-tone="warn"]::before { background: var(--amber); }

/* the footer of live facts: what this app can honestly tell a stranger */
.login-facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px;
  border-top: 1px solid var(--line); margin: 0 -26px; padding: 16px 26px 18px;
}
.login-facts .fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.login-facts b {
  font-family: var(--m); font-size: 13px; font-weight: 500; color: var(--ink);
  font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.login-facts i { font-style: normal; font-size: 11.5px; color: var(--ink-3); }
.login-facts .fact.to b { color: var(--ink-2); }

@media (max-width: 460px) {
  .login-card { padding: 20px 18px 0; gap: 16px; }
  /* the lockup and the kicker do not both fit at 390px, and §8g rule 1
     says nothing is clipped -- the kicker is the decoration, so it goes */
  .login-kicker { display: none; }
  .login-brand .bp-word { --bp-word: 19px; }
  .login-facts { margin: 0 -18px; padding: 14px 18px 16px; }
  .steps { flex-direction: column; }
  .code-row { gap: 6px; }
  .code-row input { height: 52px; font-size: 21px; }
}

/* ── motion (§8d): arrive, sweep, halo, flash, ripple, boot ───── */
@keyframes bp-arrive { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes bp-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
@keyframes bp-advance { from { background-position: 0 0; } to { background-position: 22px 0; } }
@keyframes bp-ignite { 0% { transform: scale(1); } 45% { transform: scale(1.9); } 100% { transform: scale(1); } }
@keyframes bp-ripple {
  0% { opacity: .85; transform: scale(1); }
  100% { opacity: 0; transform: scale(3.4); }
}
@keyframes bp-sweep { 0% { transform: translateY(-110%); } 100% { transform: translateY(560%); } }
@keyframes bp-halo {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244,96,12,.42); }
  55% { box-shadow: 0 0 0 5px rgba(244,96,12,0); }
}
@keyframes bp-ticker { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes bp-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes bp-boot { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

.enter, .sig.enter { animation: bp-arrive var(--t-slow) var(--ease) both; }
/* the live dot and every running indicator carry a soft halo pulse */
.livedot[data-live="ok"], .dot.hot, .statuspill[data-state="watching"] .livedot {
  animation: bp-halo 1.6s var(--ease) infinite;
}
/* the coin node flares once when a new confluence arrives (§8d) */
@keyframes bp-flare { 0% { r: 3; opacity: 1; } 55% { r: 9; opacity: .35; } 100% { r: 3; opacity: 1; } }
.converge .core.flare { animation: bp-flare 420ms var(--ease) 1; }
/* a slow scan-line sweep across the lead card and LIVE, 8s, 4%. It paints
   UNDER every child of the card: §8d is explicit that text never sits on a
   moving background, so the band passes behind the numbers, not over them. */
.sweep { position: relative; overflow: hidden; }
.sweep::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 18%;
  pointer-events: none; z-index: 0;
  background: linear-gradient(180deg, transparent, rgba(232,230,227,.04), transparent);
  animation: bp-sweep 8s linear infinite;
}
.sweep > * { position: relative; z-index: 1; }
/* a changed value flashes amber for 300ms — a colour change, never a glow */
.val, .kpi-tile .val { transition: color var(--t-fast) var(--ease); }
.flash, .val.flash { color: var(--amber); }
.tweening { color: var(--amber); }
.queue-row.running::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: repeating-linear-gradient(90deg, var(--hot) 0 7px, transparent 7px 22px);
  background-size: 22px 2px; animation: bp-advance 900ms linear infinite;
}
/* the two-second boot sequence: cards light in order */
.booting .card, .booting .kpi-tile, .booting .railsec, .booting .sig, .booting .chaincard {
  animation: bp-boot 420ms var(--ease) both;
  animation-delay: calc(var(--boot-i, 0) * 90ms);
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important; animation-iteration-count: 1 !important;
    transition-duration: 1ms !important; scroll-behavior: auto !important;
  }
  .sweep::after, .ticker .tape { animation: none !important; }
  .sweep::after { display: none; }
}

/* ── responsive: two columns, then one ────────────────────────── */
@media (max-width: 1280px) {
  .console { grid-template-columns: var(--rail-l) minmax(0, 1fr);
    grid-template-areas: "left top" "left main" "left right"; }
  .rail-right { position: static; max-height: none; flex-direction: row; flex-wrap: wrap; }
  .rail-right > .railsec { flex: 1 1 300px; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .formgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpis.lead { grid-template-columns: 1.35fr 1fr 1fr 1fr; }
}
@media (max-width: 1000px) {
  .kpis, .kpis.three, .kpis.lead { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: minmax(0, 1fr); }
  .p-chart, .p-log, .p-queue, .p-bub, .p-map { grid-column: 1 / -1; }
  .chaingrid, .g2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 860px) {
  :root { --pad: 16px; --gut: 12px; }
  .console { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto;
    grid-template-areas: "top" "left" "main" "right"; }
  /* the rail stops being a column of its own: brand, one scrolling row of
     nav pills, and the context block beside the status -- roughly 200px
     tall instead of a thousand, so the page starts on the first screen */
  .rail-left { position: static; height: auto; }
  .brand { padding: 14px 14px 10px; }
  .navgroups { flex-direction: row; flex-wrap: wrap; gap: 10px 18px; padding: 0 12px 14px; }
  .navgroup { min-width: 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav a { height: 32px; padding: 0 12px; white-space: nowrap; }
  .railfoot { margin-top: 0; display: flex; gap: 12px; align-items: flex-start;
    padding-top: 0; }
  .railfoot .ctx-select { flex: 1 1 40%; padding: 0; }
  .railfoot .userblock { flex: 1 1 60%; }
  .railstatus { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; }
  .topbar { flex-wrap: wrap; gap: 10px; padding-bottom: 8px; }
  .topbar .page-title { font-size: 21px; flex: 1 1 100%; }
  .ticker { display: none; }
  .cmd { flex: 1 1 100%; order: 3; }
  .cmd-out { width: 100%; }
  .kpis, .kpis.three, .kpis.lead { grid-template-columns: minmax(0, 1fr); }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .formgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comp-row { grid-template-columns: 116px minmax(0, 1fr) 44px; gap: 8px; }
  .card-head { flex-wrap: wrap; }
  .card-head .htxt { min-width: 150px; }
  .card-head .field { flex: 1 1 100%; }
  .card-head .field input, .card-head .field select { width: 100%; }
  .queue-row, .scan-head { flex-wrap: wrap; gap: 8px; }
  .queue-row .kind, .scan-head .kind { flex: 0 0 auto; }
  .queue-row .prog { flex: 1 0 100%; }
  .scan-head .prog { display: none; }
  .sig { flex-direction: column; gap: 12px; padding: 16px; }
  .sig-num { flex-direction: row; align-items: center; gap: 12px; }
  /* the tile is content-sized in a stacked card, so the bar needs a width
     of its own -- `flex: 1 1 auto` collapses it to nothing there */
  .sig-num .bar { flex: 0 0 76px; }
  .sig-side { margin-left: 0; }
  .qa { flex-direction: column; }
  .table-wrap.scroll { max-height: 60vh; }
}

/* ── modes + labels ─────────────────────────────────────────────────
   Two controls the console did not have: the §7e mode rows on Settings,
   and the owner's label (§7f) on a Signals row and on the audit page.
   Both are built from the card language above -- `.card-2` surface, the
   `.pill` geometry, the `.field` stack -- so nothing here introduces a
   second visual vocabulary, only the parts those two controls need. */
.modegrid { display: grid; gap: var(--gut); grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mode {
  background: var(--card-2); border: 1px solid var(--line); border-radius: var(--r-inner);
  padding: 14px; display: flex; flex-direction: column; gap: 10px; min-width: 0;
}
.mode-top { display: flex; align-items: center; gap: 10px; }
.mode-top .switch { margin-left: auto; flex: 0 0 auto; }
/* The tag chip: the mode's own colour, at pill scale. One colour per mode,
   never repeated on a neighbouring card, and always beside the name -- the
   colour is a second reading of the name, never the only one. */
.mchip {
  display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--r-pill);
  border: 1px solid currentColor; font-family: var(--m); font-size: 10px;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2);
}
.mchip.m-new, .mchip.m-revival { color: var(--hot); }
.mchip.m-creator, .mchip.m-volume { color: var(--gold); }
.mchip.m-smart, .mchip.m-size { color: var(--mint); }
.mchip.m-syndicate { color: var(--ink-2); }
.mchip.m-rebuy { color: var(--amber); }
.mchip.m-breakout { color: var(--ok); }
.mchip.m-dip { color: var(--rose); }
.mode-top .mlabel { margin: 0 0 0 auto; font-size: 10.5px; color: var(--ink-3); }
.mode-top .switch { margin-left: 0; }
.mode-why { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); }
.mode-cap { margin: 4px 0 0; font-size: 10.5px; color: var(--ink-3); }
.mode .formgrid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.mode .field .mlabel { font-size: 11px; line-height: 1.35; }
.mode .field .unit { color: var(--ink-4); }
.mode input { height: 30px; font-size: 12.5px; }
.mode input::placeholder { color: var(--ink-4); font-style: italic; }
/* the card sits on `--card-2`, where `--line` is all but invisible: the one
   control that writes to the server has to read as a control */
.mode .foot { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 4px; }
.mode .foot .btn { border-color: var(--line-2); background: var(--card); }
.mode .foot .btn:hover { border-color: var(--ink-3); }
/* the server's refusal names the field to fix (`modes.new.max_age_min: …`),
   so it wraps rather than ellipsing -- half a field name is not a message */
.mode .msg { font-family: var(--m); font-size: 10px; color: var(--ink-3); min-width: 0;
  white-space: normal; overflow: visible; overflow-wrap: anywhere; line-height: 1.45; }
.mode .msg.ok { color: var(--mint); }
.mode .msg.err { color: var(--rose); }
@media (max-width: 1280px) { .modegrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .modegrid { grid-template-columns: minmax(0, 1fr); }
  .mode .formgrid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* The owner's label (§7f), on a Signals row and on the audit page. Quiet by
   design: it sits under the row's own line, in the `.pill` geometry, and
   only the chip carries colour -- a row is about the call, not about the
   control for reading it. */
.labelbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding-top: 10px; border-top: 1px solid var(--line); }
.lchip {
  display: inline-flex; align-items: center; padding: 2px 9px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); font-family: var(--m); font-size: 10px;
  letter-spacing: .06em; color: var(--ink-3); white-space: nowrap;
}
.lchip.good { color: var(--mint); border-color: rgba(126,240,181,.4); }
.lchip.scam { color: var(--rose); border-color: rgba(255,107,122,.4); }
.lchip.unsure { color: var(--amber); border-color: rgba(255,184,107,.4); }
.lbtn {
  height: 26px; padding: 0 11px; border-radius: var(--r-pill); cursor: pointer;
  border: 1px solid var(--line); background: transparent; color: var(--ink-3);
  font-family: var(--t); font-size: 12px;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.lbtn:hover { color: var(--ink); border-color: var(--line-2); }
.lbtn[aria-pressed="true"] { color: var(--ink); border-color: var(--ink-3); background: var(--card-2); }
.lnote { flex: 1 1 220px; max-width: 360px; min-width: 0; height: 26px; font-size: 12px; }
.lmsg { font-family: var(--m); font-size: 10px; color: var(--ink-3); }
.lmsg.ok { color: var(--mint); }
.lmsg.err { color: var(--rose); overflow-wrap: anywhere; }
