/* Survey Bridge shell (slice 1). Every rule here is under [data-shell="bridge"]
 * (ui/js/shell.js sets it on <html>; Bridge is the default, Classic stays selectable), so the Classic shell
 * is untouched and the bridge is reverted by flipping one attribute. Both shells
 * share one DOM and one set of renderers: this file is layout and skin only.
 *
 * Rules of this file, each checked by dev/test/role-tokens.test.mjs and
 * dev/test/no-idle-motion.test.mjs:
 *   - colours come from the role tokens at the end of theme.css; none is typed here;
 *   - a size is rem, a ratio or a token; no px is typed here (the px in a media
 *     query is a breakpoint, which CSS cannot read from a token);
 *   - nothing moves: no animation and no transition. A tile lights; it does not blink.
 *
 * The console: one continuous frame (the annunciator strip on top, the stations
 * below it), not a grid of equal cards. A station's rail is plain ink; a rail takes
 * a status colour only where it names that station's level (the annunciator's does).
 * The one brand mark is the accent bar under the wordmark, where the frame begins.
 * Type: Orbitron for station and panel headers and the master word only; Ubuntu for
 * labels and text; the mono face for every value. Sizes from the book's type scale (brand-tokens.css):
 * no size typed here under its 12 px floor (--brand-type-label; text inheriting app.css sizes is not covered), readouts at --brand-type-readout.
 */

/* ---- Ground and header ------------------------------------------------------- */
[data-shell="bridge"] body { background: var(--role-ground); }
[data-shell="bridge"] .site-header { background: var(--role-ground); border-bottom-color: transparent; }
/* The console's one brand mark: an accent bar under the wordmark, where the frame begins. A fill, never text. */
[data-shell="bridge"] .site-header .inner {
  padding-bottom: 0.4rem;
  background: linear-gradient(to right, var(--role-accent) 0 9rem, transparent 9rem) left bottom / 100% calc(var(--rail-w) / 2.5) no-repeat;
}
[data-shell="bridge"] .brand-wordmark { letter-spacing: 0.3em; }

/* Rockers: every two- and three-way switch (shell, theme, board view, map mode,
   chart window, block display). Squared, with the pressed position filled in ink:
   position and fill, never colour alone. Native buttons with aria-pressed, as before. */
[data-shell="bridge"] .theme-toggle,
[data-shell="bridge"] .window-toggle {
  background: var(--role-surface-raised);
  border-color: var(--role-line);
  border-radius: calc(var(--station-radius) / 3);
  padding: calc(var(--rule-w) * 2);
}
[data-shell="bridge"] .theme-toggle button,
[data-shell="bridge"] .window-toggle button {
  min-height: var(--target-min);
  min-width: var(--target-min);
  border-radius: calc(var(--station-radius) / 4);
  color: var(--role-ink-muted);
  letter-spacing: 0.08em;
}
[data-shell="bridge"] .theme-toggle button[aria-pressed="true"],
[data-shell="bridge"] .window-toggle button[aria-pressed="true"] {
  background: var(--role-ink);
  color: var(--role-surface);
}

/* ---- The annunciator strip: the console's top panel ---------------------------- */
[data-shell="bridge"] .safety-strip {
  background: var(--role-ground);
  border-bottom: 0;
  box-shadow: none;
}
[data-shell="bridge"] .safety-strip .inner {
  position: relative;
  padding: 0.5rem 0.75rem 0.5rem calc(var(--rail-w) + 0.75rem);
  background: var(--role-surface);
  border: var(--rule-w) solid var(--role-line);
  border-radius: var(--station-radius) var(--station-radius) 0 0;
}
/* The rail names this station's level: ink when quiet, the status colour otherwise. */
[data-shell="bridge"] .safety-strip .inner::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rail-w);
  border-radius: var(--station-radius) 0 0 0;
  background: var(--role-ink-muted);
}
[data-shell="bridge"] .safety-strip:has(.verdict[data-level="unknown"]) .inner::before { background: var(--status-unknown); }
[data-shell="bridge"] .safety-strip:has(.verdict[data-level="advisory"]) .inner::before { background: var(--status-advisory); }
[data-shell="bridge"] .safety-strip:has(.verdict[data-level="caution"]) .inner::before { background: var(--status-caution); }
[data-shell="bridge"] .safety-strip:has(.verdict[data-level="alert"]) .inner::before { background: var(--status-alert); }

[data-shell="bridge"] .verdict {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
}
/* The master word: Orbitron, in ink when quiet. Colour only with a glyph and the word itself. */
[data-shell="bridge"] .verdict-master {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem 0.6rem;
  min-width: 0;
  color: var(--role-ink);
}
[data-shell="bridge"] .verdict-master[data-level="unknown"] { color: var(--status-unknown); }
[data-shell="bridge"] .verdict-master[data-level="advisory"] { color: var(--status-advisory); }
[data-shell="bridge"] .verdict-master[data-level="caution"] { color: var(--status-caution); }
[data-shell="bridge"] .verdict-master[data-level="alert"] { color: var(--status-alert); }
[data-shell="bridge"] .verdict-word {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.1;
  letter-spacing: 0.18em;
}
[data-shell="bridge"] .verdict-sentence {
  flex: 1 1 100%;
  font-size: var(--brand-type-label);
  color: var(--role-ink-muted);
}
/* The headline under the master word is a sentence with served values in it: reading text, not display type. */
[data-shell="bridge"] .safety-headline { font-family: var(--font); font-weight: 700; letter-spacing: 0.02em; }
[data-shell="bridge"] .annunciator {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.375rem;
  min-width: 0;
}

/* A tile: dark when quiet (muted legend, ink reading, no colour); lit on a deviation
   with a glyph, the level word and the status colour; flagged when unknown (dashed
   edge, hatched lamp band, "?"). Its position never changes. */
[data-shell="bridge"] .tile {
  --lamp: transparent;
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "glyph legend" "reading reading";
  align-items: center;
  gap: 0.1rem 0.35rem;
  min-width: 0;
  padding: 0.45rem 0.5rem 0.3rem;
  background: var(--role-surface-raised);
  border: var(--rule-w) solid var(--role-line);
  border-radius: calc(var(--station-radius) / 2);
  color: var(--role-ink-muted);
  overflow: hidden;
}
/* The lamp band along the tile's top edge. */
[data-shell="bridge"] .tile::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 0.1875rem;
  background: var(--lamp);
}
[data-shell="bridge"] .tile[data-level="advisory"] { --lamp: var(--status-advisory); color: var(--status-advisory); border-color: var(--status-advisory); }
[data-shell="bridge"] .tile[data-level="caution"] { --lamp: var(--status-caution); color: var(--status-caution); border-color: var(--status-caution); }
[data-shell="bridge"] .tile[data-level="alert"] { --lamp: var(--status-alert); color: var(--status-alert); border-color: var(--status-alert); }
[data-shell="bridge"] .tile[data-level="unknown"] { color: var(--status-unknown); border-style: dashed; border-color: var(--status-unknown); }
[data-shell="bridge"] .tile[data-level="unknown"]::before {
  background: repeating-linear-gradient(-45deg, var(--status-unknown) 0 0.125rem, transparent 0.125rem 0.3125rem);
}
[data-shell="bridge"] .tile-legend {
  grid-area: legend;
  font-size: var(--brand-type-label);
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* The level word (CAUTION, ALERT, UNKNOWN) is the master word's; in a tile the level is the glyph's shape and the
   lamp, beside the legend's own word. The tile's word stays for a screen reader and in its title. */
[data-shell="bridge"] .tile-word {
  position: absolute;
  width: var(--rule-w);
  height: var(--rule-w);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
[data-shell="bridge"] .tile-reading {
  grid-area: reading;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--brand-type-label);
  line-height: 1.25;
  color: var(--role-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
[data-shell="bridge"] .tile[data-level="unknown"] .tile-reading { color: var(--status-unknown); }
/* Not offered (offered.js): a quiet tile with a dashed-free hairline and a slashed ring: neither a deviation nor an unknown. */
[data-shell="bridge"] .tile[data-level="notoffered"] { color: var(--role-ink-muted); border-style: solid; }
[data-shell="bridge"] .tile[data-level="notoffered"] .tile-reading,
[data-shell="bridge"] .tile[data-level="notoffered"] .tile-reading-short { color: var(--role-ink-muted); }

/* Text fits its tile (Ronald, 2026-11-17: the words overflowed their boxes). A tile is a size container: below 6.5rem
   its legend and reading swap to the terse forms of the one token set (en.js verdict.tileShort.* / verdict.short.* /
   state.*), beside the same glyph; the full words stay in the title and for a screen reader. Nothing is cut mid-word. */
[data-shell="bridge"] .tile { container: tile / inline-size; }
[data-shell="bridge"] .tile-legend-short,
[data-shell="bridge"] .tile-reading-short { display: none; }
@container tile (max-width: 6.5rem) {
  [data-shell="bridge"] .tile-legend { display: none; }
  [data-shell="bridge"] .tile-legend-short {
    display: block;
    grid-area: legend;
    font-size: var(--brand-type-label);
    font-weight: 700;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  [data-shell="bridge"] .tile-reading { display: none; }
  [data-shell="bridge"] .tile-reading-short {
    display: block;
    grid-area: reading;
    font-family: var(--mono);
    font-variant-numeric: tabular-nums;
    font-size: var(--brand-type-label);
    line-height: 1.25;
    color: var(--role-ink);
    white-space: nowrap;
  }
  [data-shell="bridge"] .tile[data-level="unknown"] .tile-reading-short { color: var(--status-unknown); }
  [data-shell="bridge"] .tile[data-level="notoffered"] .tile-reading-short { color: var(--role-ink-muted); }
}

/* Level glyphs, drawn here so they never depend on a font: a ring (quiet), "?"
   (unknown), "i" in a square (advisory), a hollow triangle (caution), a filled
   triangle (alert). The shape differs at every level; the colour only repeats it. */
[data-shell="bridge"] .tile-glyph,
[data-shell="bridge"] .verdict-glyph {
  --glyph: 0.75rem;
  --glyph-ground: var(--role-surface-raised);
  grid-area: glyph;
  position: relative;
  flex: none;
  display: inline-block;
  width: var(--glyph);
  height: var(--glyph);
  box-sizing: border-box;
  font-family: var(--mono);
  font-weight: 500;
  font-size: var(--glyph);
  line-height: 1;
  text-align: center;
}
[data-shell="bridge"] .verdict-glyph { --glyph: 1.5rem; --glyph-ground: var(--role-surface); }
[data-shell="bridge"] [data-level="quiet"] > .tile-glyph,
[data-shell="bridge"] [data-level="quiet"] > .verdict-glyph {
  border: calc(var(--glyph) / 8) solid currentColor;
  border-radius: 50%;
}
[data-shell="bridge"] [data-level="unknown"] > .tile-glyph::before,
[data-shell="bridge"] [data-level="unknown"] > .verdict-glyph::before { content: "?"; }
/* Not offered: a ring with a slash through it (a shape no other level has). */
[data-shell="bridge"] [data-level="notoffered"] > .tile-glyph,
[data-shell="bridge"] [data-level="notoffered"] > .verdict-glyph {
  border: calc(var(--glyph) / 8) solid currentColor;
  border-radius: 50%;
  background: linear-gradient(to top right, transparent calc(50% - var(--glyph) / 16), currentColor calc(50% - var(--glyph) / 16), currentColor calc(50% + var(--glyph) / 16), transparent calc(50% + var(--glyph) / 16));
}
[data-shell="bridge"] [data-level="advisory"] > .tile-glyph,
[data-shell="bridge"] [data-level="advisory"] > .verdict-glyph {
  border: calc(var(--glyph) / 8) solid currentColor;
  border-radius: calc(var(--glyph) / 5);
  font-size: calc(var(--glyph) * 0.7);
}
[data-shell="bridge"] [data-level="advisory"] > .tile-glyph::before,
[data-shell="bridge"] [data-level="advisory"] > .verdict-glyph::before { content: "i"; }
[data-shell="bridge"] [data-level="caution"] > .tile-glyph::before,
[data-shell="bridge"] [data-level="caution"] > .verdict-glyph::before,
[data-shell="bridge"] [data-level="alert"] > .tile-glyph::before,
[data-shell="bridge"] [data-level="alert"] > .verdict-glyph::before {
  content: "";
  position: absolute;
  inset: 0;
  background: currentColor;
  clip-path: polygon(50% 4%, 100% 96%, 0 96%);
}
[data-shell="bridge"] [data-level="caution"] > .tile-glyph::after,
[data-shell="bridge"] [data-level="caution"] > .verdict-glyph::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--glyph-ground);
  clip-path: polygon(50% 34%, 78% 84%, 22% 84%);
}

/* ---- The console frame and its stations --------------------------------------- */
[data-shell="bridge"] main.wrap {
  position: relative;
  gap: var(--station-gap);
  padding: var(--station-gap);
  background: var(--role-ground);
  border: var(--rule-w) solid var(--role-line);
  border-top: 0;
  border-radius: 0 0 var(--station-radius) var(--station-radius);
}
/* A station: a panel with a rail down its left edge and a short elbow along its top. */
[data-shell="bridge"] main > section {
  position: relative;
  min-width: 0;
  padding: 0.75rem 0.75rem 0.75rem calc(var(--rail-w) + 0.75rem);
  background: var(--role-surface);
  border: var(--rule-w) solid var(--role-line);
  border-radius: var(--station-radius);
}
[data-shell="bridge"] main > section[hidden] { display: none; }
[data-shell="bridge"] main > section::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rail-w);
  border-radius: var(--station-radius) 0 0 var(--station-radius);
  background: var(--role-ink-muted);
}
[data-shell="bridge"] main > section::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4rem;
  height: calc(var(--rail-w) / 2);
  border-radius: var(--station-radius) 0 calc(var(--rail-w) / 2) 0;
  background: var(--role-ink-muted);
}

/* Station and panel headers: engraved Orbitron, wide-tracked, with a rule to the edge. */
[data-shell="bridge"] .section-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--brand-type-label);
  letter-spacing: 0.22em;
  color: var(--role-ink);
}
[data-shell="bridge"] .section-eyebrow::after {
  content: "";
  flex: 1 1 auto;
  height: var(--rule-w);
  background: var(--role-line);
}
[data-shell="bridge"] .boards-title .section-eyebrow::after { content: none; }
[data-shell="bridge"] .chart-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--brand-type-label);
  letter-spacing: 0.16em;
  color: var(--role-ink-muted);
}

/* Faces: what were separate cards are parts of their station, outlined by a hairline, with no shadow of their own. */
[data-shell="bridge"] .kpi-card,
[data-shell="bridge"] .chart-card,
[data-shell="bridge"] .run-path-card {
  background: var(--role-surface-raised);
  border-color: var(--role-line);
  border-radius: calc(var(--station-radius) / 2);
  box-shadow: none;
}
/* Readouts: the label is a small tracked legend, the value is the mono face in ink (never amber). */
[data-shell="bridge"] .kpi-label { letter-spacing: 0.12em; color: var(--role-ink-muted); }
/* The legends over the big readouts: the book's 12 px floor (the base sheet's 0.6rem is 9.6 px). */
[data-shell="bridge"] .station-summary .kpi-label { font-size: var(--brand-type-label); }
[data-shell="bridge"] .kpi-value { color: var(--role-ink); font-variant-numeric: tabular-nums; }
[data-shell="bridge"] .site-footer { border-top-color: transparent; }

/* Text fits its box (Ronald, 2026-11-17). A readout card is a size container: its legend and its value wrap inside it,
   and the value's size follows the card's width (container query units) down to the 12 px floor, so "not exposed"
   or "not reported" never runs past the card. The hashrate readout and the pool card keep their own sizes. */
/* (not the pool card: its width is fit-content, which size containment would collapse) */
[data-shell="bridge"] .kpi-card:not(.kpi-card-pool) { container: kpi / inline-size; }
[data-shell="bridge"] .kpi-label,
[data-shell="bridge"] .kpi-value { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
@container kpi (max-width: 16rem) {
  [data-shell="bridge"] .kpi-label { letter-spacing: 0.04em; }
}
@container kpi (max-width: 13rem) {
  [data-shell="bridge"] .kpi-card:not(:first-child):not(.kpi-card-pool) .kpi-value { font-size: clamp(0.75rem, 8.5cqw, 1.5rem); }
}
/* A value that is not a measurement wears its state's glyph: a slashed ring (not reported, exposed, served, offered), "?"
   (unknown), "..." (loading). Beside the word, never instead of it (kpi.js markStates; the words are en.js state.*). */
/* Only the states that are NOT a measurement draw it: a measured datum (live, value, none, a fault state) wears no
   glyph. A bare [data-state] selector put it on the live pill, readouts and board headers (the test: glyph-scope). */
[data-shell="bridge"] [data-state="notReported"]::before,
[data-shell="bridge"] [data-state="notExposed"]::before,
[data-shell="bridge"] [data-state="notoffered"]::before,
[data-shell="bridge"] [data-state="unknown"]::before,
[data-shell="bridge"] [data-state="loading"]::before {
  content: "";
  display: inline-block;
  width: 0.7em;
  height: 0.7em;
  margin-right: 0.3em;
  box-sizing: border-box;
  vertical-align: -0.02em;
  color: var(--role-ink-muted);
  border: 0.09em solid currentColor;
  border-radius: 50%;
  background: linear-gradient(to top right, transparent calc(50% - 0.05em), currentColor calc(50% - 0.05em), currentColor calc(50% + 0.05em), transparent calc(50% + 0.05em));
}
[data-shell="bridge"] [data-state="unknown"]::before,
[data-shell="bridge"] [data-state="loading"]::before {
  width: auto;
  height: auto;
  border: 0;
  border-radius: 0;
  background: none;
  line-height: 1;
}
[data-shell="bridge"] [data-state="unknown"]::before { content: "?"; }
[data-shell="bridge"] [data-state="loading"]::before { content: "\2026"; }

/* ---- Widths ------------------------------------------------------------------- */
/* 600 px and up: seven tiles in one row. */
@media (min-width: 600px) {
  [data-shell="bridge"] .annunciator { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
/* 960 px and up (the laptop, the primary viewer): the master word beside the tiles, larger readouts. */
@media (min-width: 960px) {
  [data-shell="bridge"] .verdict { grid-template-columns: minmax(15rem, 1fr) minmax(0, 3fr); gap: 1rem; }
  [data-shell="bridge"] .verdict-word { font-size: 2rem; }
}
/* 600 px and up: the summary is a row of readouts, a small legend over a large value in ink. Every line box is a
   whole number of px (1rem and 1.5rem), as the compact strip's are, so the boards below stay on whole pixels. */
@media (min-width: 600px) {
  [data-shell="bridge"] .kpi-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; align-items: stretch; }
  [data-shell="bridge"] .kpi-card { padding: 0.375rem 0.5rem; }
  [data-shell="bridge"] .kpi-card-pool { grid-column: 1 / -1; min-width: 0; order: 1; }
  [data-shell="bridge"] .kpi-line { line-height: 1.5rem; }
  [data-shell="bridge"] .kpi-label { flex: 1 0 100%; line-height: 1rem; }
  [data-shell="bridge"] .kpi-value { font-size: 1.125rem; line-height: 1.5rem; }
  [data-shell="bridge"] .kpi-card-pool .kpi-value { font-size: 1rem; }
}
@media (min-width: 960px) {
  [data-shell="bridge"] .kpi-row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  [data-shell="bridge"] .kpi-card-pool { grid-column: span 2; order: 0; }
}
/* Below 600 px (a phone): a tile is its glyph and legend, four to a row, so a pinned
   strip stays short. The reading and the level word stay in the tile's title and
   for a screen reader, and the headline and chips below carry every deviation in words. */
@media (max-width: 599px) {
  [data-shell="bridge"] .safety-strip .inner { padding: 0.375rem 0.5rem 0.375rem calc(var(--rail-w) / 2 + 0.5rem); }
  [data-shell="bridge"] .safety-strip .inner::before { width: calc(var(--rail-w) / 2); }
  [data-shell="bridge"] .verdict { gap: 0.3rem; }
  [data-shell="bridge"] .verdict-word { font-size: 1.25rem; letter-spacing: 0.14em; }
  [data-shell="bridge"] .verdict-glyph { --glyph: 1.1rem; }
  [data-shell="bridge"] .verdict-sentence { flex-basis: auto; }
  [data-shell="bridge"] .annunciator { gap: 0.25rem; }
  [data-shell="bridge"] .tile { grid-template-areas: "glyph legend"; grid-template-columns: auto minmax(0, 1fr); padding: 0.4rem 0.35rem 0.25rem; }
  [data-shell="bridge"] .tile { gap: 0.1rem 0.25rem; }
  [data-shell="bridge"] .tile-legend { font-size: var(--brand-type-label); letter-spacing: 0; }
  [data-shell="bridge"] .safety-headline { font-size: 0.8rem; }
  [data-shell="bridge"] .tile-reading-short { display: none; }
  [data-shell="bridge"] .tile-reading {
    position: absolute;
    width: var(--rule-w);
    height: var(--rule-w);
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  [data-shell="bridge"] main.wrap { padding: calc(var(--station-gap) / 2); gap: calc(var(--station-gap) / 1.5); }
  [data-shell="bridge"] main > section { padding: 0.5rem 0.5rem 0.5rem calc(var(--rail-w) / 2 + 0.5rem); }
  [data-shell="bridge"] main > section::before { width: calc(var(--rail-w) / 2); }
  [data-shell="bridge"] main > section::after { width: 2.5rem; height: calc(var(--rail-w) / 3); }
}
/* ---- The console grid (Bridge look, 2026-11-16) --------------------------------
   The hex scope is the hero: the widest station, in the middle on a laptop. The verdict stays first, in the strip
   above. Beside the hex: the readouts (Summary) and the J/TH domain instruments; below: the run path and the charts.
   Only the stations' places change: the hex keeps its own geometry (render/hex-scope.js), it is only given room.
   721 px and up: two columns (hex | readouts); 1200 px and up: three (readouts | hex | instruments). Under 721 px
   (a phone): one column in reading order.
   No empty column (Ronald, 2026-11-17: a blank right third at 1280): the run path sits in the side column under
   the instruments, beside the hex, and moves up when they are hidden (no efficiency served, as on a replay). When
   both are hidden at 1200 px and up, the third column is dropped and the hex station takes its width. */
@media (min-width: 721px) {
  [data-shell="bridge"] main.wrap {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-rows: auto auto auto 1fr auto auto auto;
    grid-template-areas: "boards summary" "boards instruments" "boards rail" "boards ." "run run" "autotune autotune" "charts charts";
    align-items: start;
  }
  [data-shell="bridge"] main > .station-summary { grid-area: summary; }
  [data-shell="bridge"] main > .station-boards { grid-area: boards; align-self: stretch; }
  [data-shell="bridge"] main > .instruments { grid-area: instruments; }
  [data-shell="bridge"] main > .rail { grid-area: rail; }
  [data-shell="bridge"] main > .run-path { grid-area: run; }
  /* In a side column the run ladder wraps its steps, so it never pushes the page sideways. */
  [data-shell="bridge"] main > .run-path .run-path-group { flex-wrap: wrap; row-gap: 0.35rem; }
  [data-shell="bridge"] main > .autotune { grid-area: autotune; } /* U-UX3: full width, between the run path and the charts */
  [data-shell="bridge"] main > [data-charts] { grid-area: charts; }
  /* A board card in the hex station is a third of the hero column (about 190 px at 1280 px). A card whose raw
     inspector is open takes the station's whole width, so the inspector's paths and values have room to read. */
  [data-shell="bridge"] .boards-grid > .board-card:has([data-inspector][open]) { grid-column: 1 / -1; }
  /* Readouts in a side column: two to a row, the hashrate and the pool across it. */
  [data-shell="bridge"] .station-summary .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  [data-shell="bridge"] .station-summary .kpi-card:first-child,
  [data-shell="bridge"] .station-summary .kpi-card-pool { grid-column: 1 / -1; order: 0; }
  [data-shell="bridge"] .station-summary .kpi-value { font-size: 1.5rem; line-height: 2rem; }
  [data-shell="bridge"] .station-summary .kpi-card:first-child .kpi-value { font-size: var(--brand-type-readout); line-height: 2.5rem; }
  [data-shell="bridge"] .station-summary .kpi-card-pool .kpi-value { font-size: 1rem; line-height: 1.5rem; }
}
@media (min-width: 1200px) {
  [data-shell="bridge"] main.wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto auto auto;
    grid-template-areas: "summary boards instruments" "summary boards rail" "run run run" "autotune autotune autotune" "charts charts charts";
  }
  [data-shell="bridge"] main > .station-summary { align-self: start; }
  /* Neither side station is shown: no empty third column; the hex station takes the width. */
  [data-shell="bridge"] main.wrap:has(> .instruments[hidden]):has(> .rail[hidden]) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
    grid-template-areas: "summary boards" "summary boards" "run run" "autotune autotune" "charts charts";
  }
  /* The side columns are narrow here: one readout to a row. */
  [data-shell="bridge"] .station-summary .kpi-row,
  [data-shell="bridge"] .instruments .readouts { grid-template-columns: minmax(0, 1fr); }
}

/* The mission clock: T+ before a served uptime (kpi.js sets data-clock only then; instruments.js missionClock). */
[data-shell="bridge"] [data-kpi="uptime"][data-clock]::before { content: attr(data-clock) "\00a0"; color: var(--role-ink-muted); }

/* The J/TH domain instruments (render/instruments.js): a legend over a large value in ink; a flag word beside it. */
[data-shell="bridge"] .instruments { display: block; }
[data-shell="bridge"] .instruments[hidden] { display: none; }
[data-shell="bridge"] .instruments-window { margin-top: 0.25rem; font-size: var(--brand-type-label); color: var(--role-ink-muted); }
[data-shell="bridge"] .readouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; margin: 0.5rem 0 0; }
[data-shell="bridge"] .readout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0.375rem 0.5rem;
  background: var(--role-surface-raised);
  border: var(--rule-w) solid var(--role-line);
  border-radius: calc(var(--station-radius) / 2);
}
[data-shell="bridge"] .readout[data-state="lost"],
[data-shell="bridge"] .readout[data-state="unknown"] { border-style: dashed; }
[data-shell="bridge"] .readout-label { font-size: var(--brand-type-label); line-height: 1rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--role-ink-muted); }
[data-shell="bridge"] .readout-value { display: flex; align-items: baseline; gap: 0.5rem; margin: 0; min-width: 0; }
[data-shell="bridge"] .readout-num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: var(--brand-type-readout); line-height: 2.5rem; color: var(--role-ink); }
[data-shell="bridge"] .readout[data-state="lost"] .readout-num,
[data-shell="bridge"] .readout[data-state="unknown"] .readout-num { font-size: 1rem; color: var(--status-unknown); }
/* A readout is a size container too: its number follows the card's width down to the 12 px floor (Ronald, 2026-11-17). */
[data-shell="bridge"] .readout { container: readout / inline-size; min-width: 0; }
[data-shell="bridge"] .readout-label { min-width: 0; overflow-wrap: anywhere; }
[data-shell="bridge"] .readout-num { min-width: 0; font-size: clamp(0.75rem, 24cqw, var(--brand-type-readout)); overflow-wrap: anywhere; }
@container readout (max-width: 7rem) {
  [data-shell="bridge"] .readout-label { letter-spacing: 0.04em; }
}
[data-shell="bridge"] .readout-flag { font-family: var(--mono); font-size: var(--brand-type-label); color: var(--role-ink-muted); }
[data-shell="bridge"] .readout-flag:empty { display: none; }

/* Forced colours drop backgrounds, and with them the drawn glyphs and the lamp band:
   keep each as an outline, so a level is still a shape and a word. */
@media (forced-colors: active) {
  [data-shell="bridge"] .tile-glyph,
  [data-shell="bridge"] .verdict-glyph,
  [data-shell="bridge"] .tile::before { forced-color-adjust: none; }
}
@media print {
  [data-shell="bridge"] .safety-strip[data-pinned="true"] { position: static; }
}
