/* Homelab dashboards — design system.
 *
 * No CDN, no webfonts, no framework: this runs on a homelab network that may have no
 * route to the internet, and a font that fails to load is a page that reflows in front
 * of you. Everything here is system fonts and hand-written SVG.
 *
 * Two themes via [data-theme] on <html> (persisted in localStorage), defaulting to the
 * OS preference. All colours are tokens; nothing in a component hardcodes a colour.
 */

:root {
  --bg: #0d0f13;
  --bg-raised: #14171e;
  --bg-sunken: #0a0c0f;
  --border: #232836;
  --border-strong: #333b4d;
  --text: #e7eaf0;
  --text-muted: #8b94a7;
  --text-faint: #5c6478;
  --accent: #ff8a3d;
  --accent-soft: rgba(255, 138, 61, 0.14);
  --ok: #3fb950;
  --ok-soft: rgba(63, 185, 80, 0.15);
  --warn: #d29922;
  --warn-soft: rgba(210, 153, 34, 0.16);
  --fail: #f85149;
  --fail-soft: rgba(248, 81, 73, 0.16);
  --info: #58a6ff;
  --info-soft: rgba(88, 166, 255, 0.15);
  --series-1: #ff8a3d;
  --series-2: #58a6ff;
  --series-3: #3fb950;
  --series-4: #bc8cff;
  --series-5: #f778ba;
  --series-6: #d29922;
  --series-7: #39c5cf;
  --series-8: #8b94a7;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.25);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-h: 58px;
  /* The masthead nav toggle (phase 18): hidden everywhere until the ≤640px block flips it.
   * A token rather than a literal `display: none` so the reveal may name the button with any
   * selector, in any order — see `#nav-toggle` in the header section. */
  --nav-toggle-display: none;
}

[data-theme="light"] {
  --bg: #f4f5f8;
  --bg-raised: #ffffff;
  --bg-sunken: #e9ebf0;
  --border: #dfe3ea;
  --border-strong: #c3cad6;
  --text: #16191f;
  --text-muted: #5b6473;
  --text-faint: #8a93a3;
  --accent: #d2691e;
  --accent-soft: rgba(210, 105, 30, 0.12);
  --ok: #1a7f37;
  --ok-soft: rgba(26, 127, 55, 0.12);
  --warn: #9a6700;
  --warn-soft: rgba(154, 103, 0, 0.12);
  --fail: #cf222e;
  --fail-soft: rgba(207, 34, 46, 0.1);
  --info: #0969da;
  --info-soft: rgba(9, 105, 218, 0.1);
  --series-1: #d2691e;
  --series-2: #0969da;
  --series-3: #1a7f37;
  --series-4: #8250df;
  --series-5: #bf3989;
  --series-6: #9a6700;
  --series-7: #1b7c84;
  --series-8: #5b6473;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 6px 20px rgba(16, 24, 40, 0.06);
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---- header ------------------------------------------------------------- */
/* The masthead is **three rows at every width, the two control rows flush right** (phase 20
 * task 01 made the rows, `TODO.md:5-6` — "the hosts disks engines and UPS indicators … in
 * their own row", "the ⚷ Certs ⚙ Account ☾ Dark buttons … in their own row under" them; phase
 * 25 task 02 re-justified them right, `TODO.md:4` — "I made a mistake earlier, I did want
 * hosts disks engines UPS badges and certs/account/dark right justified"): row 1 the brand,
 * `#nav-toggle` and the five tabs; row 2 the `#nav-status` reachability dots; row 3 the
 * `.masthead-right` controls — `⚷ Certs`, `⚙ Account`, the theme toggle, then the clock, in
 * that markup order because on a `flex-end` row the **last** child is the farthest-right item
 * (phase 25 task 03, `TODO.md:5` — "The time should show up as the farthest right item on the
 * navbar"; nothing is reordered in CSS, so the pin can read the markup).
 *
 * No markup changed to get them, and that decides the mechanism. `#nav-status` is the first
 * child of `.masthead-right`, so there is no wrapper to promote: in a `flex-wrap: wrap`
 * container an item whose *flex base size* fills the line is alone on it — line breaking uses
 * the base size, before shrink — so `flex-basis: 100%` on the div starts a new row of the bar
 * and the same declaration on the dots starts a row inside it, leaving the controls that
 * follow to wrap onto the third. `align-items` centres each row's content against its own line
 * box; `height` became `min-height` because three rows do not fit in `--header-h` and a fixed
 * height clipped the controls (the ≤640px block no longer restates it, so there is one
 * declaration to keep honest).
 *
 * The bar is **not sticky** (phase 20 task 02, `TODO.md:10` — "It shouldn't be sticky at all.
 * We want to maximize the amount of screen space for data viewing"): it scrolls away with the
 * page, and the "sticky part way down" quirk on a phone was the fixed-height bar fighting the
 * wrapped rows, so removing the stick removed the quirk. What it does *not* lose is its role as
 * a positioned ancestor: `position: relative` keeps the ≤640px dropdown's `top: 100%` anchored
 * under it (the default `static` would hand that to the initial containing block and the menu
 * would open at the top of the document), and `z-index: 40` stays so the menu's `41` still
 * means "one above the masthead". */
.masthead {
  position: relative;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .35rem 1.1rem;
  min-height: var(--header-h);
  padding: .45rem 1.25rem;
  background: color-mix(in srgb, var(--bg-raised) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: .55rem;
  font-weight: 650;
  letter-spacing: .01em;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(140deg, var(--accent), color-mix(in srgb, var(--accent) 45%, var(--info)));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  display: grid;
  place-items: center;
  font-size: 12px;
  color: #14171e;
  font-weight: 800;
}

nav.tabs { display: flex; gap: .15rem; margin-inline-start: .4rem; }
nav.tabs a {
  padding: .38rem .7rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 550;
  display: flex;
  align-items: center;
  gap: .4rem;
}
nav.tabs a:hover { background: var(--bg-sunken); color: var(--text); text-decoration: none; }
nav.tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

/* Row 3: the controls, flush right under the indicators. `margin-inline-start: auto` is what
 * pinned this cluster to the right edge of the old single-row bar and stays **absent**: on a
 * row of its own it pushes against nothing, so the alignment is `justify-content: flex-end`
 * (phase 25 task 02 — the operator overruled phase 20's `flex-start`; the badges and the
 * cluster are right-justified). `flex-basis: 100%` is the row break (see `.masthead` above)
 * and `flex-wrap` is what a phone gets when `⚷ Certs` + `⚙ Account` + theme will not share a line
 * (the clock is the last child and hides below 900px on its own — a readout, not a control, so
 * that is not the "no control is hidden to fit the width" rule) — phase 18's rule, and nothing in
 * this block hides a button to make the arithmetic work. */
.masthead-right {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: .35rem .55rem;
}

/* Row 2: the per-source indicators, flush right on a line of their own, so a readout lines up
 * with the controls under it and is never mistaken for one more button beside them. `.gap`
 * already makes this a flex row; the `flex-basis` is the break inside `.masthead-right`,
 * `justify-content` the alignment, and the gap is restated at .55rem so the dots read as a row
 * of their own rather than as the tail of the cluster below. */
#nav-status {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
}

.clock { font-family: var(--mono); font-size: 12.5px; color: var(--text-muted); }
@media (max-width: 900px) { .clock { display: none; } }

/* One control, two tags: the pager's arrows and the masthead's `⚙ Account` link are the same
 * quiet outlined thing, and an `<a>` styled by a second near-copy is the version that stops
 * matching the theme. `text-decoration` is here because the global `a:hover` underlines. */
button.ghost, a.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: .32rem .6rem;
  font: 550 12.5px var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  text-decoration: none;
}
button.ghost:hover, a.ghost:hover {
  border-color: var(--border-strong); color: var(--text); background: var(--bg-sunken);
  text-decoration: none;
}
button.ghost[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
/* The pager's ends: still legible, still unclickable (an arrow that does nothing at page 1
   or the last page is a control that lies about there being more history). */
button.ghost:disabled { opacity: .45; cursor: not-allowed; }

/* The hamburger that swaps the tab nav for a dropdown on phones (phase 18): one per tabbed
 * page (`#nav-toggle`, `aria-controls="nav-tabs"`), hidden at every width until the ≤640px
 * block reveals it — so the masthead renders exactly as it did before the button existed.
 *
 * The token is the specificity ladder, not decoration. This element carries the shared `ghost`
 * class, whose rule above claims `display: inline-flex` at (0,1,1): a literal
 * `.nav-toggle { display: none }` loses to that and ships a visible 29×29 px button into the
 * desktop masthead (measured in a browser, not deduced). Addressing the id out-ranks that, and
 * reading the value from a token means the reveal can be any selector that matches the button,
 * anywhere in this file — a declaration of `--nav-toggle-display` on the element always beats
 * the value inherited from `:root` — so `@media (max-width: 640px) { #nav-toggle {
 * --nav-toggle-display: inline-flex } }` is the whole reveal, with no `!important`. */
#nav-toggle { display: var(--nav-toggle-display); }

/* ---- mobile nav ---------------------------------------------------------
 * The ≤640px half of the hamburger (phase 18), now living inside the three-row bar of task 01:
 * the five tab links leave the bar and come back as a dropdown under it, opened by
 * `#nav-toggle`. The state lives entirely in the `.is-open` class task 03's binding puts on
 * `#nav-tabs`, so this block renders a verdict made elsewhere and owns no behaviour of its own —
 * and since task 03, it owns the slide too: `nav.tabs` is the closed menu and `.is-open` its
 * visible counterpart, with a 180 ms `opacity`/`transform` transition on both.
 *
 * Above 640px nothing here applies, which is the point: the same three rows — brand + toggle,
 * indicators, controls, the last two flush right — with the tabs inline on the first one and
 * the button hidden. What a phone changes is only that the tabs become a menu and the gaps
 * tighten.
 */
@media (max-width: 640px) {
  /* The bar's vertical rhythm, and nothing structural. The three rows come from the base
   * rules now, so the one-row wrap this block used to own (`height: auto` plus the
   * `flex-wrap` that made it) is gone rather than restated — `min-height: var(--header-h)` is
   * declared once, on `.masthead`, which is what stops the two drifting apart. The dropdown's
   * `top: 100%` is unaffected: it pins to the bottom of the masthead however many rows that
   * is, which on a phone is the whole three-row bar rather than wedged between rows. */
  .masthead {
    row-gap: .4rem;
    padding-block: .5rem;
    /* The bar must not start at y=0 of the layout viewport. On a real phone the viewport
     * runs under the status bar (Android Chrome is edge-to-edge by default; iOS does the
     * same once the page opts into viewport-fit=cover), and the system top-edge zone
     * does not reliably deliver taps to the page — a button in it is unreachable, not
     * unbound, and no amount of headless emulation shows it (an emulated viewport has no
     * system top edge). Padding by the top safe-area inset pushes the whole bar — the
     * first-row #nav-toggle first — into the tappable region; the dropdown's top:100%
     * follows the taller bar. env() resolves to 0px on every non-notch surface (desktop,
     * headless, non-notched phones), so those render byte-identical. The 0.5rem is the
     * padding-block value restated for the one side the inset grows, so the two never
     * drift. Same fix brain of reese shipped for the same owner-reported symptom. */
    padding-top: calc(.5rem + env(safe-area-inset-top, 0px));
  }

  /* The same treatment one level down, and these rules are still what a 360px phone actually
   * requires — phase 18 measured both sides of them: the status dots fell into a single-file
   * column and `⚷ Certs` broke over two lines, because every item shrank to a fraction of its
   * content. So the cluster may wrap, its items may neither shrink nor break a label, and the
   * dots keep their labels. Row 3 still wraps *within itself*: `⚷ Certs`, `⚙ Account` and the
   * theme button do not fit in 320px once over on the narrowest phones, and nothing here hides a
   * control to make the arithmetic work — a phone gets the same words every other width does.
   * The row alignment is the base rule's `flex-end` (phase 25 task 02), restated nowhere: this
   * block only tightens the gap, so the two rows cannot disagree about which edge they sit on.
   *
   * The dots wrap too, since phase 29 task 05 gave them a member that made the row overflow.
   * Phase 18's `nowrap` was right for the chips it measured (267px) and wrong once the set grew:
   * an item that may not shrink and may not wrap does not become smaller — it widens the
   * *document* (372px once, so a phone got a sideways scroll, which phase 18 exists to forbid).
   * Wrapping inside a row that is `flex-basis: 100%` is not the single-file column phase 18 saw
   * either: the last chip moves to a second line of the same right-aligned row and the bar grows
   * by one line box. */
  .masthead-right { flex-wrap: wrap; gap: .4rem; }
  .masthead-right > * { flex: none; white-space: nowrap; }
  #nav-status { flex-wrap: wrap; row-gap: .25rem; }

  /* The reveal, through task 01's token: `#nav-toggle` reads its `display` from
   * `--nav-toggle-display`, so declaring the token on the element here is the whole flip —
   * no selector order to get right, no `!important`, and the `button.ghost` outline it
   * inherits stays the only styling it needs. Right-aligned because that is where a thumb
   * already is on a phone (brain of reese does the same), and `touch-action` because the
   * default double-tap-to-zoom disambiguation makes a first tap feel like a dead button. */
  #nav-toggle {
    --nav-toggle-display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: auto;
    min-width: 40px;
    min-height: 40px;
    padding: 0 .5rem;
    font-size: 15px;
    touch-action: manipulation;
  }

  /* The nav *is* the dropdown — no menu panel element to keep in sync. `.masthead` is
   * `position: relative` (task 02 un-pinned the bar from the viewport top and kept it a
   * positioned ancestor on purpose), so `top: 100%` lands directly under
   * it — under the **whole** three-row bar since task 01, which is the intended look: a menu
   * below the masthead rather than wedged between its rows — and `left/right: 0` span the
   * masthead's padding box edge to edge; hence
   * `margin-inline-start: 0`, without which the base rule's .4rem over-constrains the box
   * and insets the menu's left edge by that much. `z-index: 41` is one above the masthead's
   * 40 so the menu paints over the content it overlaps. Since the bar itself now scrolls,
   * the menu scrolls with it: opening the menu and then scrolling the page moves both, which
   * is what a bar that is not pinned to the viewport means.
   *
   * `box-shadow: var(--shadow)` rather than a literal black: this file's rule is that no
   * component hardcodes a colour, and the light theme re-declares the token — a .35-alpha
   * black drop is the one thing that looks wrong under a white menu.
   *
   * **This rule is also the closed state** (task 03, `TODO.md:11` — "a nice animation for the
   * hamburger menu — a slide out and slide back in"). It used to be `nav.tabs { display: none }
   * with the geometry on `.is-open`, and that is precisely why the menu snapped: a `display`
   * flip has no animatable intermediate, so an `opacity`/`transform` transition there would
   * never have run. The geometry therefore lives here now — the box the transition animates is
   * the same box that exists while closed — and `.is-open` below flips only the four properties
   * that say *visible*. `visibility: hidden` keeps the closed menu out of the accessibility
   * tree and its five links out of the tab order, exactly as `display: none` did, and
   * `pointer-events: none` makes it unhittable while it is off-screen mid-slide. On the way
   * shut `visibility` carries a delay equal to the animation, so the box stays visible for the
   * 180 ms it takes to fade and rise out and only then leaves the tree; on the way open
   * `.is-open` drops that delay, or the menu would be invisible for the first 180 ms of its own
   * opening. `transition` on both states is the reference pattern (brain of reese's `.app-nav`),
   * and `prefers-reduced-motion` at the foot of this file stills both of them. */
  nav.tabs {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-inline-start: 0;
    padding: .4rem;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 41;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease, visibility 0s linear 180ms;
  }

  /* The open state, and the only thing the class flip changes. `transform: none` is the other
   * half of the slide: the 8 px rise from the closed rule resolves to the menu's own position,
   * so the row of links travels 8 px while it fades in, and back the other way when
   * `setNavMenu(false)` drops the class — out and back in, which is what was asked for. */
  nav.tabs.is-open {
    visibility: visible;
    opacity: 1;
    transform: none;
    pointer-events: auto;
    transition: opacity 180ms ease, transform 180ms ease, visibility 0s;
  }

  /* Rows, not pills: the base .38rem padding is a desktop tab strip, and a menu item you
   * can miss is a menu that does not work with a thumb. `border-radius` is restated because
   * the highlight (`:hover`, `[aria-current="page"]`) is now a row, not a chip — both rules
   * carry over unchanged, which is why nothing here mentions a colour. */
  nav.tabs.is-open a {
    padding: .6rem .7rem;
    min-height: 40px;
    border-radius: var(--radius-sm);
  }

  /* Every table scrolls sideways inside its own card (phase 27 task 01, `TODO.md:7` — "None of
   * the tables are horizontally scrollable on mobile"). Measured on 2026-10-20 (AGENTS.md gap 12):
   * at 360 px `/`'s fleet table is 450-510 px inside a 320 px `section.card`, and
   * `.card { overflow: hidden }` clipped
   * `WORST DISK`, `GPU BUSY`, `TEMP` and `UP` with nothing to reach them.
   *
   * The mechanism is the one the all-widths `table.data.scroll` rule proves: `display: block`
   * keeps the table's internal layout in an anonymous box while the element itself becomes a
   * block the width of the card, and `overflow-x: auto` gives that box a scrollbar only where
   * the table is wider than it — so a table that fits paints no scrollbar and shifts nothing.
   * One class-level rule reaches all seven tables (`#fleet-table`, `#agents-table`, the four
   * `page-system.js` tables and the NUT-variables table in `page-ups.js`) because all seven
   * already carry `data`; hand-placing `.scroll` on each is the drift this avoids, and the four
   * JS-built ones cannot be edited in markup anyway. It also reaches the tables inside
   * disclosures (`/system`'s "More detail", `/ups`'s raw variables): `overflow-x` on a block
   * inside a revealed `<details>` is the same box model — measured, not assumed, by expanding
   * both at 360 px in `data/logs/27-task01-scroll.cjs` (and that leg stays in task 02's sweep).
   *
   * Two things this rule deliberately does **not** do. It is horizontal-only: `overflow-x`, not
   * `overflow`, and **no `max-height`**, because `.scroll`'s 320 px cap is that modifier's
   * vertical-use contract and a phone given a height-capped table on top of a horizontal one is
   * two new failure modes bought to fix one. And it fixes nothing at the document level —
   * phase 18's guarantee that the page itself never scrolls sideways at a phone width stands,
   * which is only true because the scroll container is the table and not `main`.
   *
   * The all-widths `table.data.scroll` rule is untouched and still wins where both apply (two
   * classes to one), so `#agents-table` keeps its own both-axis box and 320 px cap on a phone
   * exactly as on a desktop. */
  table.data {
    display: block;
    overflow-x: auto;
  }

  /* The other half of the rule above, and without it that rule does nothing for half the tables.
   * Measured at 360 px on the live fleet: `/system`'s "More detail" tables came back 520 px wide
   * inside a 320 px card with `scrollWidth === clientWidth` — no scrollbar, tail clipped — because
   * the card body is `.body.stack`, a one-column **grid**, and a grid item's automatic minimum
   * size is its content's min-content width. The `<details>` therefore grew the column to the
   * table's width instead of the table overflowing its own box, and `.card { overflow: hidden }`
   * ate the difference. `min-width: 0` says the item may be narrower than its content, which is
   * what a scroll container *is*: nothing can scroll what its own container refuses to shrink.
   *
   * It is scoped to the card body's own items, not to `*`: the tables, disclosures and chart
   * stacks inside a card are what a phone runs out of room for, and a page-level `min-width: 0`
   * would reach layout this sheet does not own. Side effect, and a good one — the per-host chart
   * stack in the same column was being laid out at that same 520 px and clipped with the tables. */
  .body.stack > * {
    min-width: 0;
  }
}

/* ---- layout ------------------------------------------------------------- */
main { padding: 1.15rem 1.25rem 3rem; max-width: 1680px; margin: 0 auto; }

.page-head {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.page-head h1 { font-size: 1.15rem; margin: 0; font-weight: 650; letter-spacing: .01em; }
.page-head .sub { color: var(--text-muted); font-size: 12.5px; }
.page-head .spacer { margin-inline-start: auto; }

.grid { display: grid; gap: .85rem; }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
/* Keep a row's cards at their own height instead of stretching them to the tallest
   sibling — for the grids whose extra space must stay *outside* the card: `/system`'s
   and `/disks`' `#hosts` grids (an expanded disclosure must not stretch its collapsed
   siblings into blank cards, and a blank card reads as "no data") and the `certs` and
   `settings` card rows. The `/llm` strip and panel rows deliberately use
   the grid default (`stretch`) instead: the operator judged the dead gap below the
   shorter card worse than an equalized one (2026-10-25), so there the shorter card
   stretches and the extra space reads as bottom card padding — its content stays
   top-aligned through `.stack`'s `align-content: start`. */
.grid.items-start { align-items: start; }
.stack { display: grid; gap: .85rem; align-content: start; }

/* ---- cards -------------------------------------------------------------- */
.card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card > header {
  display: flex;
  align-items: center;
  gap: .55rem;
  /* One line whenever the facts fit, a second line when they do not (phase 27 task 03).
   * Measured at 360 px by `data/logs/27-task02-mobile-audit.cjs`: `.card > header` was a
   * single nowrap flex line, so the tail of a long header — the `.updated` age stamp on
   * `/system` (right 402-415 px), `/llm` (374-393) and `/ups` (392-531), plus the `apc`
   * card's `.chip.model` (376) and `.chip.health` (463) — stood *past the card* and
   * `.card { overflow: hidden }` ate it. The age stamp and the model are facts the
   * operator reads, so the fix is the row, not the content: nothing here is hidden, it
   * wraps. A wrapped flex line with room on it is the same single line, and
   * `data/logs/27-task03-verify.cjs` measures that — `/ups`, `/llm`, `/` and `/certs` keep
   * byte-identical header and card geometry at 1280 px. `/system`'s host headers are the
   * exception, and they grew (62 px to 74 px) for a reason worth writing down: a nowrap line
   * that cannot fit does not overflow, it *shrinks* its one shrinkable child, so the age
   * stamp was painting `updated` / `5s` torn across two lines inside 67 px. A second line
   * for a fact that needs one is the cheaper of those two. */
  flex-wrap: wrap;
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-raised) 70%, var(--bg-sunken));
}
/* The two header pieces that carry free text, and the only reason `min-width` is named:
 * a flex item's automatic minimum size is its content's min-content width, so without
 * this a long OS or model string could not wrap inside its own box even on a line of its
 * own (the 290 px `apc` model chip at a 252 px card). `white-space` is relaxed for chips
 * only — a chip is a label, and a chip that becomes two lines still says the whole label,
 * which is what the GPU-value card already decided about the model string in phase 06. */
.card > header h3 { min-width: 0; max-width: 100%; }
.card > header .chip { min-width: 0; max-width: 100%; white-space: normal; }
.card > header h2, .card > header h3 {
  margin: 0; font-size: 12.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted);
}
.card > header .spacer { margin-inline-start: auto; }
.card > .body { padding: .8rem; }
.card > .body.tight { padding: .45rem .8rem .6rem; }
.card.flat { box-shadow: none; }

/* ---- metrics ------------------------------------------------------------ */
.metrics { display: grid; gap: .7rem .9rem; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); }
.metric { min-width: 0; }
.metric .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.metric .value {
  font-family: var(--mono); font-size: 1.3rem; font-weight: 600; line-height: 1.25;
  display: flex; align-items: baseline; gap: .22rem; row-gap: .1rem;
  /* the provenance chip has to be able to drop under the number: with nowrap it painted
     over the neighbouring column, which reads as a wrong value on the next metric */
  flex-wrap: wrap;
}
.metric .value > span, .metric .value > .unit { white-space: nowrap; }
.metric .value .unit { font-size: .62em; color: var(--text-muted); font-weight: 500; }
.metric .value.sm { font-size: 1.02rem; }
.metric .note { font-size: 11px; color: var(--text-faint); }
.metric .value.is-null { color: var(--text-faint); font-size: 1rem; }

.prov {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .02em;
  color: var(--text-faint); border: 1px solid var(--border); border-radius: 999px;
  padding: 0 .32rem; margin-inline-start: .28rem; vertical-align: 2px; white-space: nowrap;
}

.na { color: var(--text-faint); }

/* ---- engine cell list -----------------------------------------------------
 * `/llm`'s secondary rows: label left, value right-aligned in tabular numerals, sparkline
 * in a fixed-width third column so rows line up and growth stays right-aligned the way
 * `llm_monitor`'s drawSpark did. Percentiles ride under the value as a mono foot line —
 * visible without a hover, because a mean latency without its p95 is half the truth.
 * The heroes above are the loudest thing here on purpose; nothing in this block competes
 * with them, and only payload verdicts colour it (KV through `.cell.warn/.cell.fail`).
 */
.cells { display: grid; gap: .45rem; }
.cell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content 160px;
  gap: .1rem .7rem;
  align-items: center;
}
.cell .cell-label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cell .cell-value {
  font-family: var(--mono); font-size: 1.05rem; font-weight: 600; line-height: 1.3;
  font-variant-numeric: tabular-nums;
  text-align: right; white-space: nowrap;
}
.cell .cell-value .unit { font-size: .62em; color: var(--text-muted); font-weight: 500; margin-inline-start: .18rem; }
.cell .cell-value.is-null { color: var(--text-faint); }
.cell .cell-foot { grid-column: 2; text-align: right; font-family: var(--mono); font-size: 10.5px; color: var(--text-faint); }
.cell .cell-spark { display: block; width: 160px; }
/* the KV verdict, taken from the API's `severity` exactly as the hero cards take theirs */
.cell.warn .cell-value { color: var(--warn); }
.cell.fail .cell-value { color: var(--fail); }
/* alarm chips reuse the one fail chip vocabulary — the row itself only exists while the
   counter is non-zero, so this is the presence of an incident, never a graded threshold */
.alarms { display: flex; flex-wrap: wrap; gap: .4rem; }
@media (max-width: 640px) {
  .cell { grid-template-columns: minmax(0, 1fr) max-content; }
  .cell .cell-spark { grid-column: 1 / -1; width: 100%; }
}

/* ---- engine stats strip ---------------------------------------------------
 * `/llm`'s per-engine summary card (`llm_monitor`'s shared strip): the KV-cache bar and a
 * `dl` of the numbers you read across the room, built entirely from vocabulary this
 * stylesheet already owned — `.card` for the panel, `.kv` for label/value rows, `.bar` for
 * the fill, `.chip.fail` for an incident, `.prov` for the rate tag. Nothing new is painted
 * and no `.sev-*` family exists.
 *
 * Two rules worth naming, because they are the difference between a summary and a lie:
 *  - the bar's fill takes the **payload** verdict through the shared `.bar.ok/.warn/.fail`
 *    tokens, and only a breach paints the *text* (the `.cell` rows' rule): an unrated KV
 *    reading stays an unfilled shell in ink, and a missing one prints `n/a` with no fill at
 *    all rather than a confident 0 %;
 *  - `.prov:empty` collapses. An empty tag is a 1 px pill of nothing, which reads as a
 *    label for a number that is not there.
 *
 * `auto-fit` is the single-engine rule: one engine gets one card across the page, never a
 * red half of a two-column row.
 */
.strip {
  display: grid; gap: .85rem;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}
.strip > .card > .body { display: grid; gap: .6rem; }
/* `.kv` lays dt/dd pairs out side by side; a strip row wraps its pair in a `div` so the row
   can carry the payload key it reads, so the two-column grid moves *inside* the wrapper:
   one row per line, label left, value right — otherwise every wrapper becomes a grid item
   and the card reads as two columns of orphaned labels. */
.strip .kv { margin: 0; grid-template-columns: 1fr; }
.strip .kv > div {
  display: grid; grid-template-columns: max-content minmax(0, 1fr);
  gap: .18rem .8rem; align-items: baseline;
}
.strip .kv dd .unit { font-size: .78em; color: var(--text-muted); margin-inline-start: .18rem; }
.strip .kv dd .foot { display: block; font-size: 10.5px; color: var(--text-faint); }
.prov:empty { display: none; }
.stat-bar {
  display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: .55rem; align-items: center;
}
.stat-bar .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  white-space: nowrap;
}
.stat-bar .value {
  font-family: var(--mono); font-size: .95rem; font-weight: 600;
  font-variant-numeric: tabular-nums; text-align: right;
}
/* the verdict, when the payload sent one — `ok` leaves the digits alone (quiet ink) */
.stat-bar.warn .value { color: var(--warn); }
.stat-bar.fail .value { color: var(--fail); }

/* ---- engine slot grid ------------------------------------------------------
 * `/llm`'s gufo slot cards — `llm_monitor`'s `.slots`/`.slot` (~L499) ported to this
 * vocabulary: a bordered mini-panel per parallel slot, `.chip` for the state pill, `.dt`/`.dd`
 * for the numbers. `section-label` heads a block *inside* a card the way `.metric .label`
 * heads a number, and is the only new word here.
 *
 * The busy marker is a **border, a glyph and a word** — never a verdict. A slot generating
 * tokens is the job on an LLM server (phase 06's reasoning about GPU utilisation), so
 * `severity.py` rates no slot and nothing in this section reaches for `--ok/--warn/--fail`;
 * `--accent` is the app's *this is the live one* colour, not a good/bad colour, and the pill
 * says "processing" so the marker survives monochrome and screen readers alike.
 *
 * `.slots` ships `hidden` and `.slots-empty` is a sentence: an engine whose `/slots` did not
 * answer says so, because a grid of `n/a` cards is the failure this page already had once.
 */
/* an `<h4>` so the block it heads is navigable, styled as the micro-label the strip's rows use */
.section-label {
  margin: 0; font-size: 10.5px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; color: var(--text-faint);
}
.slots {
  display: grid; gap: .5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(190px, 100%), 1fr));
}
.slot {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .5rem .6rem; background: var(--bg-sunken);
}
.slot.busy {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--bg-sunken);
}
.slot-top { display: flex; align-items: center; gap: .45rem; margin-bottom: .4rem; }
.slot-id {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); white-space: nowrap;
}
.slot-mark { color: var(--text-faint); margin-inline-end: .25rem; }
.slot.busy .slot-mark { color: var(--accent); }
.slot-model {
  flex: 1; min-width: 0; font-size: 10.5px; color: var(--text-faint);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.slot-top .chip { margin-inline-start: auto; }
.slot dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .1rem .5rem; margin: 0; }
.slot dt {
  font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slot dd {
  margin: 0; font-family: var(--mono); font-size: 12.5px; text-align: right;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
}
.slot dd small { display: block; font-size: 10px; color: var(--text-faint); }
.slots-empty, .slots-note { margin: 0; font-size: 11.5px; color: var(--text-muted); }

/* the radiance strip's own block (phase 34): the 7-bar spec-acceptance curve, the
   per-request rows beside the counts, and the count-otherwise sentence the API writes
   into the note slot while the table is hidden. Neutral ink only — the curve is an
   efficiency number (never a verdict token) and the rows are the engine's own fields
   in `table.data` at the strip's scale. The `.reqs` box must not be narrower than the
   card is: the strip body is a one-column grid, and a grid item's automatic minimum
   is its content's min-content — the ten-column request table's min-content (~950 px)
   grew the column and painted every value cell of the card past the card's edge,
   where `.card { overflow: hidden }` ate it. `min-width: 0` lets the box stay the
   card's width; `overflow-x: auto` gives the table a sideways scroll inside the card
   only where it is wider than the card. */
.spec-curve { margin: 0; }
.spec-curve svg { display: block; }
.reqs { margin: 0; min-width: 0; overflow-x: auto; }
.reqs table.data { font-size: 12px; }
.reqs table.data th, .reqs table.data td { padding: .25rem .5rem; }
.reqs-note { margin: 0; font-size: 11.5px; color: var(--text-muted); }

/* ---- fleet totals ----------------------------------------------------------
 * The `/llm` aggregate block — `llm_monitor`'s `#fleet`, assembled from vocabulary this
 * stylesheet already owns: `.card.flat` for the panel, `.metrics`/`.metric` for the sums,
 * `.dot` and `.chip` for the head. Nothing here colours a number, because nothing here has
 * a verdict to render (`severity.py` rates no throughput and no queue depth: 0 tok/s on an
 * idle fleet is healthy), and `llm_monitor`'s coloured left border — a state colour on the
 * panel that holds the numbers — is precisely the reading this block must not invite. The
 * one state it does express is *how many engines went into the sum*: the shared dot for
 * reachability, and the shared `.stale` dim on the count tag when an engine is missing.
 */
.fleet > .body { padding: .6rem .8rem .7rem; }
.fleet-head {
  display: flex; align-items: center; gap: .45rem; flex-wrap: wrap;
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted);
}
.fleet-name { font-weight: 650; }
.fleet-note {
  margin-inline-start: auto; font-size: 10.5px; color: var(--text-faint);
  text-transform: none; letter-spacing: 0;
}
.fleet .metrics { margin-top: .55rem; }

/* The `/llm` section stack's `.85rem` rhythm (`TODO.md:4`: the fleet block and the engine
 * summaries rendered flush into one wall; the section under `#strip` already carried
 * `margin-top:.85rem` inline).
 *
 * `#strip`'s gap is unconditional: below two engines `#fleet` is `[hidden]` and the strip *is*
 * the first visible section, and a summary strip whose gap depended on a block above it
 * rendering is one layout change away from flush again.
 * The `:empty` guard is the no-double-gap half of the same idea — with a banner up, that
 * banner's own inline `margin-bottom:.85rem` **is** the gap above the block and this rule must
 * not stack a second one; with the slot empty the block owns its gap instead of borrowing the
 * empty slot's margin. `tests/test_api.py` pins both rules, and pins that nothing else styles
 * either id.
 */
#strip { margin-top: .85rem; }
#banners:empty ~ #fleet { margin-top: .85rem; }

/* ---- drive panels -----------------------------------------------------------
 * `/disks`: one `.disk` mini-panel per **physical** drive inside its host's `.card`, in the
 * `.slot` shape (bordered mini-panel, `.chip` for the drive's own word) because a drive is an
 * item in a grid, not a page-level panel. `.metrics`/`.metric` and `.alarms` are the existing
 * vocabulary; the three columns are fixed so a 16-drive host reads as rows of equal cards.
 *
 * Colour is the payload's verdict and nothing else: `--warn`/`--fail` on the two rated numbers
 * (`disk.temp_c`, `disk.percentage_used`), `--fail` on a `FAILED` health chip via `.chip.fail`,
 * and *no* colour on the power-on odometer or on a drive that published nothing (`.value.is-null`
 * keeps printing faint `n/a`). A host whose SMART cannot be read is dimmed with the shared
 * `.stale` on `.disks` — an unreadable drive is unconfigured, not broken (invariant 3) — so
 * nothing in this section paints a red panel for a missing binary.
 */
.disks {
  display: grid; gap: .5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
}
.disk {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .5rem .6rem; background: var(--bg-sunken); min-width: 0;
}
.disk-head { display: flex; align-items: center; gap: .45rem; }
.disk-dev {
  font-size: 12px; color: var(--text); min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.disk-head .chip { margin-inline-start: auto; }
.disk-model {
  font-size: 10.5px; margin-bottom: .45rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.disk .metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem .5rem; }
.disk .metric .label { font-size: 9.5px; letter-spacing: .04em; }
.disk .alarms { margin-top: .45rem; }
/* the two rated numbers, coloured by the `severity` the API sent — `ok` stays quiet ink, the
   fleet table's rule, so a wall of healthy drives is not a wall of green */
.disk .metric.warn .value { color: var(--warn); }
.disk .metric.fail .value { color: var(--fail); }

/* ---- hero numbers --------------------------------------------------------
 * The big glanceable number: label, value + unit, and optional bar and footnote.
 * Colour comes from the *same* `ok|warn|fail` classes the rest of the stylesheet uses
 * (`.bar.ok`, `.dot.warn`, `.chip.fail`) — there is deliberately no parallel `.sev-*`
 * family, because one word per colour is what keeps four pages agreeing. `Dash.hero()`
 * applies the class from the `severity` the API sent, so nothing here (or in JS) knows a
 * threshold. No class at all means no measurement: the number renders faint, never green.
 */
.hero {
  display: grid;
  gap: .18rem;
  min-width: 0;
  /* The number stays *under its own label*, always. A `.hero` is a grid of auto rows and a
   * grid row is `align-content: stretch` by default, which distributes a hero's surplus
   * height **between** its rows — and the surplus is `row height − this hero's content`, so
   * every hero in the row drifts by a different amount: the CPU number (label, number, bar)
   * sits lower than memory's (label, number, bar, footnote) and far lower than a bare
   * temperature. Measured on `/system` before this line: the five hero numbers of one card
   * started 102 px apart (20/63/63/84/121) at 1440 px, and their bars came with them. Rows
   * that need the surplus *inside* the cell (`.ups-hero`) get it from that grid's own
   * `align-items: center`, not from a per-hero distribution. */
  align-content: start;
}
.hero .label {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero .value {
  font-family: var(--mono); font-size: 2.4rem; font-weight: 650; line-height: 1.05;
  font-variant-numeric: tabular-nums; /* fixed digit width: no jitter between polls */
  display: flex; align-items: baseline; gap: .3rem; flex-wrap: wrap;
  color: var(--text);
}
.hero .value > span { white-space: nowrap; }
.hero .unit { font-size: .38em; font-weight: 550; color: var(--text-muted); }
.hero .sub {
  font-family: var(--mono); font-size: 11px; color: var(--text-faint);
  overflow-wrap: anywhere;
}
/* an empty label/sub takes no space, so a hero without a footnote is not taller */
.hero .label:empty, .hero .sub:empty { display: none; }

.hero.ok .value { color: var(--ok); }
.hero.warn .value { color: var(--warn); }
.hero.fail .value { color: var(--fail); }
/* after the verdicts on purpose: `n/a` is not a measurement, so it is never coloured */
.hero .value.is-null, .hero .value .is-null { color: var(--text-faint); font-size: 1.25rem; font-weight: 550; }

/* number + bar: the per-host cards and the UPS hero row both want the pair, and the bar
   takes its colour from the hero so markup does not have to repeat the verdict */
.hero-bar { gap: .28rem; }
.hero-bar .bar { width: 100%; }
.hero-bar.ok .bar > i { background: var(--ok); }
.hero-bar.warn .bar > i { background: var(--warn); }
.hero-bar.fail .bar > i { background: var(--fail); }
/* with no verdict on either the hero or the bar the fill stays the neutral accent: the
   bar shows *how much*, never a judgement nobody measured. */

/* The per-host hero row: six glanceable numbers — CPU, MEM, TEMP, DISK, GPU, NET — as a
   grid whose track *count* is chosen for the card, not squeezed out of the card's width.
   `auto-fit` alone was the bug: the track floor decided the count, so a 784 px card got five
   144 px tracks and threw NET onto a second row by itself, and the row that was left could
   not be scanned as one line of numbers. The floor here is the widest string the row is ever
   asked to print on one line, measured off the served stylesheet in a browser:
   `100.0 °C` 138 px, `↑112.3 MiB/s` 148 px (`.hero .hero-lines` is nowrap below), so 150 px
   plus a 16 px gap: 3 tracks need 482 px of card, 6 need 980 px. Between those, 3 tracks × 2
   rows is the shape — a fixed count beats `auto-fit`'s 4+2 for six items, because the row is
   read as *the fleet's numbers*, not as a wall that reflows.

   The rules are container queries (`#hosts` cards, below) because a card's width is the
   fleet's business: two hosts at 1920 px is an 816 px card, three hosts at 1280 px is a
   400 px card, and neither is a viewport width a media query could name. The `auto-fit`
   declaration stays as the fallback for a browser without container queries and for the
   cards below the 482 px threshold, where 1 or 2 tracks is the honest answer. */
.heroes {
  display: grid; gap: .9rem 1rem; align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
}
/* The card body is the query container: `.heroes` is sized by the card, and the card is
   sized by `#hosts`. `inline-size` containment is the cheap kind — the card's height still
   comes from its content, only its width stops depending on it (it never did: the track is
   `1fr`). */
#hosts > .card > .body { container: hero-row / inline-size; }

@container hero-row (min-width: 482px) {
  .heroes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@container hero-row (min-width: 980px) {
  .heroes { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
/* a slot that holds more than one thing (one busy hero per physical GPU) without breaking
   the row; `hidden` — which `renderGpuSlot()` sets for a host with no card — beats the
   `display` here through the `[hidden]` rule at the end of this sheet */
.hero-slot { display: grid; gap: .7rem; min-width: 0; align-content: start; }
/* The GPU facts, **under** the hero row rather than inside its track. Four labelled cells
   want ~186 px each (measured: `Radeon AI PRO R9700`, `31.8 GiB / 31.9 GiB` at `.sm`) and a
   hero track is 144–253 px, so in-track they stacked 4×1 and made the GPU column three times
   as tall as the five numbers beside it — and that surplus height is exactly what the rest of
   the row used to redistribute (`.hero`'s `align-content`, and the reason the same card read
   as numbers scattered up and down). Out here each card gets the whole card width, keeps its
   Model / VRAM / Pool / Temp cells (phase 21 task 02 — they are still four labelled values,
   never the dense ` · ` sentence), and a host with no card hides the strip with the same
   `[hidden]` rule that hides its hero slot. */
.gpu-strip { display: grid; gap: .5rem; }
.gpu-card { display: grid; gap: .3rem; min-width: 0; }
/* The four values: `.metric` shapes (label above value) at the same `.sm` size every other
   secondary number on this page uses. The count comes from the card, same as the hero row:
   the widest cell here is `165.0 MiB / 512.0 MiB` — 21 characters of mono at `.sm`, 206 px
   measured — and the Model string is 186 px, so 2 columns need 480 px of card and 4 need
   900 px, and the `auto-fit` floor is that same 210 px so a narrow card stacks the four facts
   rather than breaking a byte count in half. No colour
   vocabulary at all (phase 06 has no `gpu.*` threshold row); `overflow-wrap` is the half of
   TODO.md:12 that a long model string wraps instead of truncating — a *model name* may break,
   a byte count should not, which is what the two thresholds below are for. */
.gpu-values {
  display: grid; gap: .3rem .6rem; min-width: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(210px, 100%), 1fr));
}
.gpu-values .value { overflow-wrap: anywhere; }

@container hero-row (min-width: 480px) {
  .gpu-values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@container hero-row (min-width: 900px) {
  .gpu-values { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/* Network is one hero with two lines: in and out are one wire seen in two directions, and
   two big numbers side by side read as a competition. It is deliberately colourless —
   a byte rate has no good/bad, so no verdict ever paints here (severity.py has no net.*
   row); `n/a` comes from `.na` and is as faint as any other unmeasured value. */
.hero .hero-lines {
  display: grid; gap: .15rem;
  font-family: var(--mono); font-size: 1.28rem; font-weight: 650; line-height: 1.25;
  font-variant-numeric: tabular-nums; /* same fixed digit width as .hero .value */
  color: var(--text);
}
.hero .hero-lines .dir { color: var(--text-muted); }
/* One rate, one line. `1.76 KiB/s` breaking after the unit and leaving a lone `s` on the
   next line is what made the NET slot read as two broken numbers; the row's 150 px floor
   above is what makes `nowrap` safe (the widest rate this slot prints, `↑112.3 MiB/s`,
   measures 148 px). */
.hero .hero-lines .line { white-space: nowrap; }

/* ---- battery glyph -------------------------------------------------------
 * `DashCharts.battery()` draws the whole cell in SVG — the charge fill, the charging bolt,
 * the on-battery dashes, the "no reading" dash through the body — so the stylesheet owes
 * only the box. One `viewBox` scaled to the container's width, capped so the hero row on a
 * big monitor does not grow a metre-tall battery; `height: auto` is what preserves the
 * aspect ratio (and with it the stroke width) instead of stretching the shell. No
 * transition anywhere: the fill is re-drawn per render, and `prefers-reduced-motion`
 * therefore holds by construction.
 */
.battery { display: block; width: 100%; max-width: 210px; }
.battery svg { display: block; width: 100%; height: auto; }

/* ---- UPS hero row -------------------------------------------------------
 * Every UPS card opens with the battery glyph and three verdicts — charge, load, runtime
 * left — because those are the three questions a UPS answers (TODO L7). The glyph gets a
 * column of its own rather than floating above the numbers: it *is* the charge drawn as a
 * shape, so it belongs beside the number it echoes — which is also why the charge hero
 * itself carries no `.bar` (`page-ups.js`).
 *
 * The three numbers are the shared `.heroes` row at the shared 2.4rem, not a UPS-specific
 * size: `n/a` and `100 %` and `1h 28m` have to be glanceable in the same way on all four
 * pages. Its track floor is 140px rather than the `/system` row's 118px because runtime is
 * prose, not a bare percent — measured in this stylesheet's own font, `9h 59m` is 138px and
 * a `.hero` number cannot wrap, so the floor is what stops a track clipping it. Below the
 * floor the row drops to 2 tracks and then 1, which is what keeps two cards side by side on
 * a laptop instead of growing a taller one. The documented remainder: a runtime of 10 h or
 * more (`10h 05m`, 161px — a UPS at a percent or two of load) reaches past its track into
 * the row's right padding. It is the last slot in the row, so it never lands on another
 * number, and `runtimeText()`'s prose is pinned by `tests/test_ups_contract.py` rather than
 * shortened to make a column fit.
 *
 * Under 620px the glyph takes its own row: a 156px battery over three full-width numbers is
 * still one glance, and 112px of cell next to three squeezed ones is not.
 */
.ups-hero {
  display: grid; align-items: center; gap: .75rem 1rem;
  grid-template-columns: minmax(112px, 156px) minmax(0, 1fr);
}
.ups-hero .heroes {
  gap: .75rem .9rem;
  grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
}
@media (max-width: 620px) {
  .ups-hero { grid-template-columns: minmax(0, 1fr); }
  .ups-hero .battery { max-width: 156px; }
}

/* The electrical row under the heroes: line in, output, battery volts and amps, battery °C.
 * Still visible rather than folded into the disclosure, because they are the numbers you
 * reach for *while* the UPS is on battery — but one step down and in muted ink, so they
 * cannot compete with the three verdicts above them. `n/a` stays fainter than the readings
 * (both real drivers here report no battery temperature), and a driver that publishes none
 * of them leaves an empty grid that takes no space at all. */
.ups-electrical { gap: .5rem .9rem; }
.ups-electrical .metric .value.sm { font-size: .95rem; color: var(--text-muted); }
/* after the rule above on purpose: an unmeasured value is fainter than a muted reading, and
   `.metric .value.is-null` alone is not specific enough to survive here */
.ups-electrical .metric .value.sm.is-null { font-size: .95rem; color: var(--text-faint); }

/* ---- bars, dots, chips -------------------------------------------------- */
.bar {
  position: relative; height: 7px; border-radius: 999px; background: var(--bg-sunken);
  overflow: hidden; border: 1px solid var(--border);
}
.bar > i {
  position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 999px;
  background: var(--accent); transition: width .35s ease;
}
.bar.ok > i { background: var(--ok); }
.bar.warn > i { background: var(--warn); }
.bar.fail > i { background: var(--fail); }
.bar.thin { height: 5px; }
.bar.tall { height: 10px; }

.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); flex: none; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.dot.fail { background: var(--fail); box-shadow: 0 0 0 3px var(--fail-soft); }
.dot.idle { background: var(--text-faint); }

.chip {
  display: inline-flex; align-items: center; gap: .3rem;
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  padding: .16rem .45rem; border-radius: 999px;
  background: var(--bg-sunken); border: 1px solid var(--border); color: var(--text-muted);
  white-space: nowrap;
}
.chip.ok { color: var(--ok); background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.chip.warn { color: var(--warn); background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); }
.chip.fail { color: var(--fail); background: var(--fail-soft); border-color: color-mix(in srgb, var(--fail) 35%, transparent); }
.chip.accent { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

.banner {
  display: flex; gap: .55rem; align-items: center;
  padding: .5rem .7rem; border-radius: var(--radius-sm);
  background: var(--bg-sunken); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 12.5px;
}
.banner.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.banner.fail { background: var(--fail-soft); border-color: color-mix(in srgb, var(--fail) 35%, transparent); color: var(--fail); }
.banner.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.banner.info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); color: var(--info); }
.banner code { font-family: var(--mono); font-size: 11.5px; background: var(--bg-sunken); padding: 0 .25rem; border-radius: 3px; }

/* simulated data is watermarked everywhere it appears */
.sim-badge {
  font: 700 10px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase;
  color: var(--warn); background: var(--warn-soft);
  border: 1px dashed color-mix(in srgb, var(--warn) 55%, transparent);
  padding: .2rem .4rem; border-radius: 4px;
}

/* ---- tables ------------------------------------------------------------- */
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th, table.data td { padding: .34rem .5rem; text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; }
table.data thead th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg-raised);
}
table.data tbody tr + tr td { border-top: 1px solid color-mix(in srgb, var(--border) 55%, transparent); }
table.data tbody tr:hover td { background: var(--bg-sunken); }
table.data td.name { font-weight: 600; }
table.data .num { font-family: var(--mono); }
table.data .mute { color: var(--text-muted); }
/* verdict colour on a table cell (overview fleet rows): only a breach paints, `ok` stays
   plain text so a healthy table is quiet — the words are the same `ok|warn|fail` the API
   sends, never a JS-side threshold */
table.data td.warn { color: var(--warn); }
table.data td.fail { color: var(--fail); }
table.data.scroll { display: block; overflow: auto; max-height: 320px; }
/* The same gap-12 defect at the widths the ≤640px rule does not reach (phase 27 task 03), and
 * the reason the fix belongs on the disclosure rather than on the table. `data/logs
 * /27-task02-mobile-audit.cjs` measured `/system`'s "More detail" tables at 520 px inside a
 * 404 px card at 1280 px, and the tail was not merely clipped — the over-wide disclosure also
 * stretched the `charts-box` item beside it to the same 520 px, so a chart plot's right-hand
 * (newest) edge and the table's last column both painted under the next card.
 *
 * Why the *disclosure* and not the table: hoisting task 01's `display: block` would make a
 * block-level table shrink-to-fit, so the tables that fit their card today (327/257/287 px of
 * content) would stop filling it — a control-width layout change for the many to rescue the
 * one. A disclosure, on the other hand, is only ever as wide as the card, and a scroll
 * container's automatic minimum size is zero, so this one declaration both stops the item
 * growing past the card and gives the over-wide content a scrollbar; no `min-width: 0` is
 * needed here (task 01 needed it because there the scroller is the table while the *item* is
 * not one — measured, `min-width` alone leaves `scrollWidth === clientWidth`, i.e. nothing to
 * scroll and the tail still clipped). Inert wherever the content fits: `/ups`'s variables
 * disclosure (586 px in a 632 px card) and both `/disks` chart disclosures measure the same
 * box, `scrollWidth === clientWidth`, no scrollbar, before and after. */
.card > .body.stack > details { overflow-x: auto; }

/* ---- charts ------------------------------------------------------------- */
/* The chart vocabulary every page draws with. `LineChart` puts the y tick labels in the
   `grid` group and the x labels in `axis`, so both groups need the same text style — the
   grid text used to inherit SVG's black fill, which meant the numbers beside a utilisation
   chart were invisible on the dark theme. */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: 100%; overflow: visible; }
.chart .axis text, .chart .grid text {
  fill: var(--text-faint); font-family: var(--mono); font-size: 10px;
}
.chart .axis line, .chart .grid line { stroke: var(--border); stroke-width: 1; }
.chart .grid line { stroke-dasharray: 2 4; opacity: .75; }
.chart .zero line { stroke: var(--border-strong); }
.chart .line { fill: none; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .16; }
.chart .cursor line { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .empty {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--text-faint); font-size: 12px; pointer-events: none;
}
.legend { display: flex; flex-wrap: wrap; gap: .35rem .8rem; font-size: 11.5px; color: var(--text-muted); }
.legend .item { display: inline-flex; align-items: center; gap: .35rem; }
.legend .swatch { width: 9px; height: 9px; border-radius: 2px; }
.legend .lv { font-family: var(--mono); color: var(--text); }

/* The per-host chart stack inside a `/system` panel: supporting evidence under a number,
   not the main event. One utilisation chart, one network chart, and a GPU chart only for a
   host that reports cards (`page-system.js` adds and removes that slot with `host.gpus`),
   each with its legend glued underneath. They are stacked rather than side by side because
   a 200px-wide plot cannot show an hour of CPU without its axis labels colliding — and no
   chart in here ever contains a second host. */

/* The stack sits behind this toggle, collapsed by default: the page's job is the current
   numbers, and a fleet of ten hosts each drawing three plots is the mess the operator asked
   to stop seeing. It is a native `<details>` in the card's own quiet vocabulary — no box,
   no colour, and a caret rather than only colour to say open/closed. The chip carries the
   window the stack will draw; the window chips themselves stay in the page head, so one
   control still drives every panel's single history request. A closed `<details>` renders no
   content at all, so the collapsed stack costs exactly nothing in height. */
details.charts-box { min-width: 0; }
details.charts-box > summary {
  display: flex; align-items: center; gap: .45rem;
  list-style: none; cursor: pointer; user-select: none;
  font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--text-faint);
}
details.charts-box > summary::-webkit-details-marker { display: none; }
details.charts-box > summary::before { content: "\25B8"; font-size: 9px; }
details.charts-box[open] > summary::before { content: "\25BE"; }
details.charts-box > summary:hover { color: var(--text-muted); }
details.charts-box[open] > summary { color: var(--text-muted); margin-bottom: .55rem; }
/* the chip is a value, not a heading: it keeps its own casing and size inside the summary */
details.charts-box > summary .chip { text-transform: none; letter-spacing: .02em; }

/* The `/ups` Power events feed is the same kind of disclosure and shut by default, which is
   what lets `page-ups.js` fetch nothing while nobody is looking at it. It is not `charts-box`
   copied for one structural reason: that toggle sits *inside* a card body, while this
   `<summary>` replaces the card's own `header` — so it takes the header's type, padding,
   sunken ground and bottom rule (a closed card reads as its heading, and an open one puts the
   feed under the same rule every other card draws), with the `▸`/`▾` caret as the summary's
   first flex item so the marker rides the text's centre line and says open/closed in a shape
   as well as a colour. No `margin-bottom` on the open state: the `.body` below carries the
   spacing `charts-box`'s summary has to buy for itself. No animation either, same as
   `charts-box` — a summary that snaps is the house style, and `prefers-reduced-motion` holds
   by construction. */
details.events-box { min-width: 0; }
details.events-box > summary {
  display: flex; align-items: center; gap: .55rem;
  list-style: none; cursor: pointer; user-select: none;
  font-size: 12.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-muted);
  padding: .6rem .8rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-raised) 70%, var(--bg-sunken));
}
details.events-box > summary::-webkit-details-marker { display: none; }
details.events-box > summary::before { content: "\25B8"; font-size: 9px; color: var(--text-faint); }
details.events-box[open] > summary::before { content: "\25BE"; }
details.events-box > summary:hover { color: var(--text); }
/* open, the label steps back: the operator is reading the feed now, not the heading */
details.events-box[open] > summary { color: var(--text-faint); }
/* Inside the disclosure the body is a *grandchild* of the card, so the shared
   `.card > .body` padding no longer reaches it. This restates that padding rather than
   inventing a second one; `ul.events` and `.events-pager` stay untouched — they are
   class-based and resolve here exactly as they do on the other three feeds. */
details.events-box > .body { padding: .8rem; }

.host-charts { display: grid; gap: .7rem; }
.host-chart { display: grid; gap: .15rem; min-width: 0; }
/* `sm` is the slot's floor before `LineChart` writes its measured height inline, so an
   empty panel is the height it is about to be rather than a collapsing card. */
.chart.sm { min-height: 120px; }
.host-chart .legend { font-size: 10.5px; gap: .2rem .6rem; }
.host-chart .legend .swatch { width: 7px; height: 7px; }

.tooltip {
  position: absolute; z-index: 30; pointer-events: none; opacity: 0;
  background: color-mix(in srgb, var(--bg-raised) 95%, transparent);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: .35rem .5rem; font-size: 11.5px; min-width: 118px;
  transition: opacity .12s ease;
}
.tooltip .ts { color: var(--text-faint); font-family: var(--mono); font-size: 10.5px; margin-bottom: .18rem; }
.tooltip .row { display: flex; align-items: center; gap: .35rem; }
.tooltip .row .val { margin-inline-start: auto; font-family: var(--mono); }

/* ---- lists -------------------------------------------------------------- */
/* An event feed is a **window** over the `event` table, not a printout of it: the list is
   bounded and scrolls (same 320px as the scrollable data table), and `Dash.eventsPager()`
   puts 50 events in it per page. A host that has been flapping for a month writes hundreds
   of rows, and that history used to push the rest of `/system` off the screen. */
ul.events {
  list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem;
  max-height: 320px; overflow-y: auto; overscroll-behavior: contain;
}
ul.events li {
  display: grid; grid-template-columns: 62px 1fr; gap: .55rem; align-items: baseline;
  padding: .3rem .1rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  font-size: 12.5px;
}
ul.events li:last-child { border-bottom: 0; }
ul.events time { font-family: var(--mono); font-size: 11px; color: var(--text-faint); }
ul.events .sev { font-weight: 600; }
ul.events .sev.info { color: var(--text-muted); }
ul.events .sev.warn { color: var(--warn); }
ul.events .sev.error { color: var(--fail); }

/* The pager strip under a feed: quiet ink, no box, the window chips' own `button.ghost`.
   Hidden when the feed fits on one page — the `[hidden]` rule at the end of this sheet is
   what beats the `display: flex` here, as it does for `.banner`. */
.events-pager {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  margin-block-start: .45rem; padding-block-start: .4rem;
  border-top: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
}
.events-pager .faint { font-size: 11.5px; }

/* overview alerts: source (link to its dashboard) · message · age. The class on the row
   is the server's verdict — `alerts.py` decided, the page only paints it. */
ul.alerts { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
ul.alerts li {
  display: grid; grid-template-columns: max-content 1fr max-content; gap: .7rem; align-items: baseline;
  padding: .4rem .1rem; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  font-size: 13px;
}
ul.alerts li:last-child { border-bottom: 0; }
ul.alerts .src { font-weight: 650; white-space: nowrap; }
ul.alerts .msg { color: var(--text-muted); overflow-wrap: anywhere; }
ul.alerts time { font-family: var(--mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; }
ul.alerts li.ok .src { color: var(--ok); }
ul.alerts li.warn .src { color: var(--warn); }
ul.alerts li.fail .src { color: var(--fail); }

/* the overview's two panels swap by verdict, not by re-rendering: an active problem reads
   first, an empty list leaves the fleet table on top and the all-clear state below it */
#overview-panels .panel-fleet { order: 1; }
#overview-panels .panel-alerts { order: 2; }
#overview-panels[data-state="alerting"] .panel-alerts { order: 1; }
#overview-panels[data-state="alerting"] .panel-fleet { order: 2; }

ul.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; }
ul.checks li { display: grid; grid-template-columns: 18px 1fr; gap: .5rem; align-items: start; }
ul.checks .what { font-weight: 600; font-size: 12.5px; }
ul.checks .detail { color: var(--text-muted); font-size: 12px; }
ul.checks .mark { font-family: var(--mono); font-size: 12px; text-align: center; }
ul.checks li.ok .mark { color: var(--ok); }
ul.checks li.warn .mark { color: var(--warn); }
ul.checks li.fail .mark { color: var(--fail); }
ul.checks li.unknown .mark { color: var(--text-faint); }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: .18rem .8rem; font-size: 12.5px; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; font-family: var(--mono); text-align: right; overflow-wrap: anywhere; }

/* ---- buttons ------------------------------------------------------------ */
button.action {
  font: 600 12.5px var(--sans);
  padding: .42rem .7rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg-sunken); color: var(--text);
  cursor: pointer;
}
button.action:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
button.action:disabled { opacity: .5; cursor: not-allowed; }
button.action.caution { border-color: color-mix(in srgb, var(--warn) 45%, var(--border-strong)); }
button.action.dangerous { border-color: color-mix(in srgb, var(--fail) 45%, var(--border-strong)); color: var(--fail); }
button.action.dangerous:hover:not(:disabled) { background: var(--fail-soft); border-color: var(--fail); color: var(--fail); }

fieldset.commands { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .7rem; margin: 0; }
fieldset.commands legend { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-faint); padding: 0 .3rem; }
fieldset.commands .row { display: flex; flex-wrap: wrap; gap: .4rem; }

input[type="text"].confirm {
  font-family: var(--mono); background: var(--bg-sunken); color: var(--text);
  border: 1px solid var(--fail); border-radius: var(--radius-sm); padding: .35rem .5rem; width: 11ch;
}

/* ---- login ---------------------------------------------------------------
 * The one page with no tabs, no status dots and no data: it is what stands between the public
 * domain and the fleet, so it renders the same tokens with nothing to do but type a password.
 * Nothing here is a verdict colour — a refused sign-in is `--fail` text, not a graded value,
 * and there is no `.sev-*` family for it to join. The password field is the app's one text
 * input rule (`input[type="text"], input[type="password"]` in the buttons section): the same
 * control `/ups`'s `DANGER` box is, styled once. `label` is the `.hero .label` caption
 * vocabulary, so the field is labelled the way every number on the other four pages is. */
.login-card { max-width: 26rem; margin: 3rem auto; }
.login-card h1 { margin: 0; font-size: 1.15rem; font-weight: 650; letter-spacing: .01em; }
.login-card .sub { margin: .3rem 0 0; color: var(--text-muted); font-size: 12.5px; }
.login-card form { display: grid; gap: .6rem; margin-top: .9rem; }
.login-card label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint);
}
.login-card button { justify-self: start; }
/* The refusal is the sentence; the countdown under it is the clock. Both are text, and the
 * countdown is not a live region — a tick per second is noise, not news. */
.login-card .login-error { margin: .8rem 0 0; font-size: 12.5px; color: var(--fail); }
.login-card .login-note { margin: .35rem 0 0; }

/* ---- account ------------------------------------------------------------
 * `/settings`: the session this browser holds and the one form that changes the password. It
 * borrows the sheet's vocabulary rather than growing a second one — `.kv` for the session rows,
 * the `.hero .label` caption for the fields, `input[type="password"]` for the controls, and the
 * shared `ok|warn|fail` words for the outcome of the write. A flavour of its own is what makes a
 * page look like it belongs to another app. */
.settings-form { display: grid; gap: .45rem; max-width: 22rem; }
.settings-form label {
  font-size: 10.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-faint);
}
.settings-form button { justify-self: start; margin-top: .35rem; }
/* The outcome line: no space until it has something to say, and its colour is the shared word
 * for what happened (`ok` landed, `warn` was refused before the wire, `fail` was refused by the
 * credential), not a third palette. `/certs` borrows the rule for the outcome of a rotate or a
 * revoke — same sentence shape, and a second near-copy is how one of them stops matching the
 * theme. */
.settings-result { margin: .8rem 0 0; font-size: 12.5px; }
.settings-result.ok { color: var(--ok); }
.settings-result.warn { color: var(--warn); }
.settings-result.fail { color: var(--fail); }

/* ---- certificates -------------------------------------------------------
 * `/certs` (phase 15 task 05) is built out of parts the sheet already owns — `.card` for the
 * panels, `.kv` for the two authority rows, `table.data` for the agents, `.chip` for a status
 * word, `button.ghost` / `button.action.caution` for the writes, `.stale` for a bundle that is
 * behind, and the account page's `.settings-result` for the outcome line. One shape is missing,
 * and it is the one cell a table cannot nowrap: an address list. */
table.data td.san { white-space: normal; }

/* ---- dialog ------------------------------------------------------------- */
dialog {
  border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--bg-raised);
  color: var(--text); padding: 0; max-width: 34rem; width: calc(100% - 2rem); box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0, 0, 0, .55); }
dialog h2 { margin: 0; font-size: 1rem; }
dialog > header { padding: .8rem .9rem; border-bottom: 1px solid var(--border); display: flex; gap: .5rem; align-items: center; }
dialog .body { padding: .9rem; font-size: 13px; color: var(--text-muted); }
dialog footer { padding: .7rem .9rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; justify-content: flex-end; }

/* ---- misc --------------------------------------------------------------- */
.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.gap { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
/* `[hidden]` must beat any display set on the same element — .banner is display:flex, so a
 * hidden banner used to occupy a grey strip above the KPIs on every card. */
[hidden] { display: none !important; }

.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.wrap { overflow-wrap: anywhere; }

.empty-state { padding: 2rem 1rem; text-align: center; color: var(--text-muted); }
.empty-state h3 { margin: 0 0 .4rem; font-size: 1rem; color: var(--text); }
.empty-state code { font-family: var(--mono); font-size: 12px; background: var(--bg-sunken); padding: .1rem .3rem; border-radius: 4px; }
.empty-state ul { text-align: left; display: inline-block; margin: .6rem 0 0; }

.stale { opacity: .62; }

/* One rule for the app's two text fields — `/ups`'s `DANGER` box and `/login`'s password —
 * which are the same control, and a second near-copy is how one of them stops matching the theme.
 * `/system`'s host/metric pickers were the last `select` on the app and left with the shared
 * charts, along with the `label.field` caption that sat above them. Focus needs nothing here:
 * `:focus-visible` at the top of this file already draws the accent outline. */
input[type="text"], input[type="password"] {
  background: var(--bg-sunken); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .3rem .45rem; font: 500 12.5px var(--sans);
}

footer.pagefoot {
  margin-top: 1.6rem; padding-top: .8rem; border-top: 1px solid var(--border);
  color: var(--text-faint); font-size: 11.5px; display: flex; gap: 1rem; flex-wrap: wrap;
}

/* Motion, stilled. The universal rule is the app-wide answer (the bar fill, the pager's
 * opacity and the ≤640px menu all fall under it). The menu's own pair is named as well,
 * **both states**, and that is not decoration: `nav.tabs.is-open` is a higher-priority rule
 * than `nav.tabs`, so a reduced-motion block that named only the closed state would leave the
 * OPEN transition — the one that carries `visibility 0s` — free to animate if the universal
 * rule were ever narrowed. Naming both states is brain of reese's phase-46 lesson, quoted here
 * so the next reader does not "simplify" one of the two selectors away. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }

  nav.tabs,
  nav.tabs.is-open { transition: none; }
}
