/* ====================================================================
   Purpose : The operator screen's layout on the Zanus brand system: the
             sign-in view, the rail, the four pages, the Configure dialog,
             and the pickers.
   Detail  : Reads tokens from 01_tokens.css and composes the controls in
             04_controls.css; it positions them and never restyles them.
             Red appears only when something needs a person: a failure, a hot
             or silent GPU, a destructive action. Everything works from 390px
             wide: below 960 the rail becomes a bar across the top and the
             grids halve, below 720 tables stack their rows and the Configure
             dialog fills the screen (the responsive section, last). A value
             the live frame changes never moves the page: the lines its text
             can take are reserved, its unit is always drawn, and a table the
             frame fills has fixed columns. Vertical scrolling
             happens in the document, in .modal__body, in .menu, and in
             .turn__thought; the chat's composer sticks to the bottom while the
             conversation scrolls with the document. Nothing
             scrolls sideways. Property order: layout, position, size,
             spacing, overflow, visual, typography, interaction, animation.
   ==================================================================== */

/* ====================================================================
   Kind    : Component
   Name    : .operations
   Purpose : The document on this surface: black ground, white focus ring, silver selection.
   ==================================================================== */
html, body { background: var(--color-ink); }
.operations { color: var(--color-paper); font-family: var(--font-brand); line-height: 1.5; }
.operations :focus-visible { outline: 2px solid var(--color-paper); outline-offset: 3px; border-radius: 4px; }
.operations ::selection { background: var(--color-line-hover); }
.operations [hidden], .is-hidden { display: none !important; }

/* ====================================================================
   Kind    : Component
   Name    : .signin
   Purpose : The sign-in view: the chip stack beside the card, lit from below by the horizon.
   ==================================================================== */
.signin { display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; min-height: 100vh; min-height: 100svh; padding: 72px 24px 48px; overflow: hidden; }
/* .signin__horizon: the home page's closing horizon, under the card */
.signin__horizon { position: absolute; left: 50%; top: 100%; width: 2400px; height: 2400px; margin-left: -1200px; border-radius: 50%; background: radial-gradient(closest-side, var(--color-well) 96%, transparent 100%); box-shadow: var(--shadow-horizon); transform: translateY(-56px); }
.signin__stack { position: relative; z-index: 1; width: 320px; height: 250px; }
.signin__card { display: flex; flex-direction: column; align-items: center; position: relative; z-index: 1; width: 100%; max-width: 380px; text-align: center; }
.signin__logo { width: auto; height: 22px; }
.signin__division { margin-top: 14px; }
.signin__title { margin-top: 40px; font-size: clamp(44px, 7vw, 64px); font-weight: 600; line-height: 1; letter-spacing: -0.055em; }
.signin__text { margin-top: 14px; color: var(--color-paper-muted); font-size: 17px; font-weight: 300; }
.signin__button { margin-top: 32px; padding: 0 26px 0 22px; }
.signin__google { width: 18px; height: 18px; }
.signin__error { margin-top: 18px; color: var(--color-signal-text); font-size: 14.5px; }
.signin__note { margin-top: 26px; color: var(--color-paper-faint); font: 500 11px/1.6 var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.signin__back { position: absolute; z-index: 1; top: 24px; left: 24px; color: var(--color-paper-muted); font-size: 14px; }
@media (min-width: 960px) {
  .signin { flex-direction: row; gap: 20px; padding: 24px 6vw; }
  .signin__horizon { transform: translateY(-120px); }
  .signin__stack { flex: 0 0 auto; width: 640px; height: 560px; }
  .signin__card { flex: 0 1 380px; }
}

/* ====================================================================
   Kind    : Component
   Name    : .app
   Purpose : The application frame: the rail on the left, the page beside it.
   ==================================================================== */
.app { display: flex; min-height: 100vh; }

/* ====================================================================
   Kind    : Component
   Name    : .rail
   Purpose : Navigation, the live state, the UTC clock, and who is signed in; it stays put while the page scrolls.
   ==================================================================== */
.rail { display: flex; flex: 0 0 236px; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 26px 18px 20px; border-right: 1px solid var(--color-line); background: linear-gradient(180deg, var(--color-graphite), var(--color-ink)); }
.rail__brand { display: flex; flex-direction: column; gap: 10px; padding: 0 8px 28px; border-bottom: 1px solid var(--color-line); }
.rail__logo { align-self: flex-start; width: auto; height: 18px; }
.rail__links { display: flex; flex-direction: column; gap: 2px; margin-top: 20px; }
.rail__link { display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 10px; border-radius: var(--radius-control); color: var(--color-paper-muted); font-size: 15px; text-align: left; transition: color 0.15s, background-color 0.15s; }
.rail__link:hover { background: var(--color-wash); color: var(--color-paper); }
.rail__link.is-active { background: var(--color-graphite-raised); box-shadow: inset 0 0 0 1px var(--color-line); color: var(--color-paper-bright); }
.rail__index { color: var(--color-paper-faint); font: 500 11px var(--font-mono); letter-spacing: 0.08em; }
.rail__link.is-active .rail__index { color: var(--color-paper-soft); }
.rail__foot { display: flex; flex-direction: column; gap: 12px; margin-top: auto; padding: 18px 8px 0; border-top: 1px solid var(--color-line); }
.rail__clock { color: var(--color-paper-muted); font: 500 12px var(--font-mono); letter-spacing: 0.08em; }
.rail__user { display: flex; flex-direction: column; gap: 4px; }
.rail__email { overflow: hidden; color: var(--color-paper-soft); font-size: 13.5px; text-overflow: ellipsis; white-space: nowrap; }
.rail__signout { align-self: flex-start; color: var(--color-paper-faint); font-size: 13px; transition: color 0.15s; }
.rail__signout:hover { color: var(--color-paper); }

/* ====================================================================
   Kind    : Component
   Name    : .main
   Purpose : The page column on a faint grid, with the one notice line above the page.
   ==================================================================== */
.main { flex: 1 1 auto; min-width: 0; padding: 34px 40px 60px; background-image: linear-gradient(var(--color-grid) 1px, transparent 1px), linear-gradient(90deg, var(--color-grid) 1px, transparent 1px); background-size: 56px 56px; }
.notice { display: flex; align-items: center; gap: 14px; max-width: 1320px; margin: 0 auto 16px; padding: 12px 16px; border: 1px solid var(--color-line-strong); border-radius: var(--radius-control); background: var(--color-graphite-raised); font-size: 14px; }
.notice[hidden] { display: none; }
.notice[data-kind="error"] { border-color: var(--color-signal-border); background: var(--color-signal-tint); color: var(--color-signal-text); }
.notice__text { flex: 1 1 auto; }
.notice__close { color: var(--color-paper-muted); font-size: 18px; line-height: 1; }

/* ====================================================================
   Kind    : Component
   Name    : .page
   Purpose : One of the four pages; only the active one is shown, and it rises in when chosen.
   ==================================================================== */
.page { display: none; flex-direction: column; gap: 16px; max-width: 1320px; margin: 0 auto; }
.page.is-active { display: flex; animation: rise 0.6s var(--ease-expo) backwards; }
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 10px; }
.head__title { margin-top: 10px; font-size: clamp(30px, 3vw, 42px); font-weight: 500; line-height: 1.05; letter-spacing: -0.045em; }
/* .head__stamp: room for "Sampled 99999 s ago", so the age ticking up never moves the stamp */
.head__stamp { min-width: calc(19 * (1ch + 0.14em)); padding-bottom: 6px; text-align: right; }
.head__stamp.is-stale { color: var(--color-signal-text); }

/* ====================================================================
   Kind    : Component
   Name    : .segment
   Purpose : The range picker: one choice of five, the chosen one in white.
   ==================================================================== */
.segment { display: inline-flex; padding: 3px; border: 1px solid var(--color-line); border-radius: 10px; background: var(--color-graphite); }
.segment button { height: 30px; padding: 0 13px; border-radius: 7px; color: var(--color-paper-muted); font: 500 12.5px var(--font-mono); transition: color 0.15s; }
.segment button:hover { color: var(--color-paper); }
.segment button.is-active { background: var(--color-paper); color: var(--color-ink); }

/* ====================================================================
   Kind    : Component
   Name    : .verdict
   Purpose : One sentence that says whether anything is wrong; it turns red only when something is.
   ==================================================================== */
.verdict { display: flex; align-items: center; gap: 18px; padding: 22px 24px; border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--gradient-panel); }
.verdict__dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; background: var(--color-paper-faint); box-shadow: 0 0 0 5px var(--color-wash); }
.verdict__words { display: flex; flex: 1 1 auto; flex-direction: column; min-width: 0; }
/* .verdict__title, .verdict__detail: one title line and two detail lines, held and never exceeded, since a probe error from a node has no length limit; the whole sentence is in the tooltip */
.verdict__title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 1; min-height: 1lh; overflow: hidden; font-size: 26px; font-weight: 500; line-height: 1.15; letter-spacing: -0.035em; }
.verdict__detail { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; min-height: 2lh; margin-top: 4px; overflow: hidden; color: var(--color-paper-muted); font-size: 14.5px; }
.verdict[data-state="ok"] .verdict__dot { background: var(--color-silver); }
.verdict[data-state="degraded"] .verdict__dot { background: var(--color-caution); }
.verdict[data-state="down"] { border-color: var(--color-signal-border); background: linear-gradient(90deg, var(--color-signal-tint), transparent 60%), var(--gradient-panel); }
.verdict[data-state="down"] .verdict__dot { background: var(--color-signal-bright); box-shadow: 0 0 0 5px var(--color-signal-haze), 0 0 18px var(--color-signal); }

/* ====================================================================
   Kind    : Component
   Name    : .figure
   Purpose : A headline number, centered, with its unit and one line of context; on Performance the last minute rolls behind it as a wave whose shape is the data.
   ==================================================================== */
.figures { display: flex; gap: 16px; }
.figure { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; justify-content: center; position: relative; min-width: 0; padding: 18px 20px; overflow: hidden; border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--gradient-panel); text-align: center; }
.figure > p { align-self: stretch; position: relative; z-index: 1; }
.figure--wave { min-height: 164px; }
.figure__value { margin-top: 10px; font: 500 clamp(28px, 2.7vw, 38px)/1 var(--font-brand); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.figure__unit { margin-left: 5px; color: var(--color-paper-faint); font-size: 15px; letter-spacing: 0; }
.figure__detail { margin-top: 8px; color: var(--color-paper-muted); font-size: 13px; }
.figure.is-alarm { border-color: var(--color-signal-border); }
.figure.is-alarm .figure__value { color: var(--color-signal-text); }
/* .figure.is-stale: latency held from the last answer, dimmed so it never reads as live */
.figure.is-stale .figure__value { color: var(--color-paper-faint); }
.wave { position: absolute; inset: 0; }
.wave svg { display: block; width: 100%; height: 100%; }
.wave__flow { transform: translateX(var(--wave-shift)); }
/* .wave__flow.is-rolling: one second of linear roll per live frame, so the wave moves continuously while frames arrive */
.wave__flow.is-rolling { transition: transform 1s linear; }
.wave__stop--top { stop-color: var(--color-silver); stop-opacity: 0.16; }
.wave__stop--bottom { stop-color: var(--color-silver); stop-opacity: 0.01; }
.wave__edge { fill: none; stroke: var(--color-silver); stroke-opacity: 0.55; stroke-width: 1.5; stroke-linejoin: round; }
/* .figure > .figure__detail: two lines held, since a detail that names a GPU or a range wraps on one frame and not the next */
.figure > .figure__detail { min-height: 2lh; }

/* ====================================================================
   Kind    : Component
   Name    : .plot
   Purpose : Bar charts per UTC bucket with a readout under the pointer; marks take their colour from a series class, never from the script.
   ==================================================================== */
.switch { display: inline-flex; gap: 4px; margin-left: auto; }
.switch button { height: 30px; padding: 0 12px; border-radius: 7px; color: var(--color-paper-muted); font-size: 13px; transition: color 0.15s, background-color 0.15s; }
.switch button:hover { color: var(--color-paper); }
.switch button.is-active { background: var(--color-graphite-high); color: var(--color-paper); }
.legend { display: flex; gap: 18px; padding: 14px 20px 0; color: var(--color-paper-muted); font-size: 12.5px; }
.legend__item { display: inline-flex; align-items: center; gap: 7px; }
.plot { position: relative; height: 260px; padding: 12px 20px 16px; }
.plot svg { display: block; width: 100%; height: 100%; overflow: visible; }
.plot__empty, .panel__empty { padding: 28px 20px; color: var(--color-paper-muted); font-size: 14px; }
.plot__grid { stroke: var(--color-line); }
.plot__label { fill: var(--color-paper-faint); font: 400 11px var(--font-mono); }
.plot__guide { stroke: var(--color-line-hover); }
.plot__tip { position: absolute; top: 8px; z-index: 2; min-width: 170px; padding: 10px 12px; border: 1px solid var(--color-line-strong); border-radius: var(--radius-control); background: var(--color-graphite-high); box-shadow: var(--shadow-drop); font-size: 12.5px; pointer-events: none; }
.plot__tip[hidden] { display: none; }
.plot__tip-title { margin-bottom: 6px; color: var(--color-paper-muted); font: 500 11px var(--font-mono); letter-spacing: 0.06em; }
.plot__tip-row { display: flex; align-items: center; gap: 8px; }
.plot__tip-row b { margin-left: auto; padding-left: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }
.swatch { display: inline-block; flex: 0 0 auto; width: 9px; height: 9px; margin-right: 7px; border-radius: 2px; }
.mark--silver { fill: var(--color-silver); }
.mark--deep { fill: var(--color-silver-deep); }
.mark--ghost { fill: var(--color-paper-ghost); }
.mark--bright { fill: var(--color-paper-bright); }
.mark--signal { fill: var(--color-signal-bright); }
.swatch.mark--silver, .swatch--input { background: var(--color-silver); }
.swatch.mark--deep, .swatch--cache-write { background: var(--color-silver-deep); }
.swatch.mark--ghost, .swatch--cache-read { background: var(--color-paper-ghost); }
.swatch.mark--bright, .swatch--output { background: var(--color-paper-bright); }
.swatch.mark--signal { background: var(--color-signal-bright); }

/* ====================================================================
   Kind    : Component
   Name    : .now
   Purpose : The admission pool this second: running against the limit, waiting, rejected, and failed; only a failure turns a cell red.
   ==================================================================== */
.split { display: flex; gap: 16px; }
.split > .panel { flex: 1 1 0; min-width: 0; }
.now { display: flex; }
.now__cell { flex: 1 1 0; padding: 20px; }
.now__cell + .now__cell { border-left: 1px solid var(--color-line); }
.now__value { margin-top: 10px; font: 500 30px/1 var(--font-brand); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.now__unit { margin-left: 4px; color: var(--color-paper-faint); font-size: 14px; letter-spacing: 0; }
/* .now__hint: two lines held, the longest hint a cell writes */
.now__hint { min-height: 2lh; margin-top: 12px; color: var(--color-paper-muted); font-size: 13px; }
.now__cell.is-alarm .now__value { color: var(--color-signal-text); }

/* ====================================================================
   Kind    : Component
   Name    : .meter
   Purpose : A thin bar filled by --fill from the script; red when the reading is past its limit.
   ==================================================================== */
.meter { position: relative; height: 6px; margin-top: 14px; overflow: hidden; border-radius: 999px; background: var(--color-graphite-high); }
.meter__fill { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, var(--color-silver-deep), var(--color-silver)); transform: scaleX(var(--fill, 0)); transform-origin: left; transition: transform 0.6s var(--ease-expo); }
.meter__held { position: absolute; inset: 0; border-radius: inherit; background: var(--color-paper-ghost); transform: scaleX(var(--fill, 0)); transform-origin: left; transition: transform 0.6s var(--ease-expo); }
.meter.is-alarm .meter__fill { background: linear-gradient(90deg, var(--color-signal), var(--color-signal-bright)); }
.meter--inline { display: inline-block; width: 70px; margin: 0 8px 0 0; vertical-align: middle; }

/* ====================================================================
   Kind    : Component
   Name    : .failures
   Purpose : The recent refusals and failures; a server error is red, a refusal is not.
   ==================================================================== */
.failures .table td:first-child { white-space: nowrap; }
.badge.is-alarm { border-color: var(--color-signal-border); color: var(--color-signal-text); }

/* ====================================================================
   Kind    : Component
   Name    : .machine
   Purpose : One node on Hardware: its bar with the status pill, Drain, and Configure, then its GPUs and engines.
   ==================================================================== */
.machines { display: flex; flex-direction: column; gap: 16px; }
/* .machine__title: the name and its facts on one line beside the controls; a narrow desktop cuts the facts, whose tooltip holds them */
.machine__title { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine__meta { color: var(--color-paper-faint); font-weight: 400; }
/* .machine__state: wide enough for the longest state (Draining · 253 running) and set against Drain, so the bar holds still as the state changes */
.machine__state { justify-content: flex-end; min-width: 29ch; }
/* .machine__drain: wide enough for Drain, Confirm?, and Resume, so the bar does not shift as it changes */
.machine__drain { min-width: 96px; }
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.gpus { display: flex; flex-wrap: wrap; }
.gpu { flex: 0 0 25%; min-width: 0; padding: 18px 20px 20px; border-right: 1px solid var(--color-line); border-bottom: 1px solid var(--color-line); }
.gpu__head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
/* .gpu__head > .label: the card name gives way to the flag on a narrow tile and keeps the full name in its tooltip */
.gpu__head > .label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* .gpu__flag: one width for every word it shows, the longest being four letters, plus its padding, its border, and a pixel for rounding */
.gpu__flag { flex: none; width: calc(4 * (1ch + 0.08em) + 17px); padding: 2px 7px; border: 1px solid var(--color-line-strong); border-radius: 999px; color: var(--color-paper-muted); font: 500 10.5px var(--font-mono); letter-spacing: 0.08em; text-align: center; text-transform: uppercase; white-space: nowrap; }
.gpu__temperature { margin-top: 12px; font: 500 34px/1 var(--font-brand); letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.gpu__temperature small { margin-left: 4px; color: var(--color-paper-faint); font-size: 14px; letter-spacing: 0; }
.gpu__engine { margin-top: 6px; overflow: hidden; color: var(--color-paper-muted); font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.gpu__row { display: flex; align-items: center; gap: 10px; margin-top: 12px; color: var(--color-paper-muted); font-size: 12.5px; }
.gpu__row > span { flex: 0 0 56px; }
.gpu__row .meter { flex: 1 1 auto; margin: 0; }
.gpu__row b { flex: 0 0 76px; color: var(--color-paper-soft); font: 500 12px var(--font-mono); text-align: right; }
.gpu.is-hot .gpu__temperature, .gpu.is-down .gpu__temperature { color: var(--color-signal-text); }
.gpu.is-hot .gpu__flag, .gpu.is-down .gpu__flag { border-color: var(--color-signal-border); color: var(--color-signal-text); }
.gpu.is-idle { background: repeating-linear-gradient(135deg, transparent 0 10px, var(--color-grid) 10px 20px); }
/* .engines: fixed columns, so a number that grows on one frame never pushes its neighbours; a cell too narrow for its text is cut and keeps it in its tooltip */
.engines { table-layout: fixed; }
.engines th:nth-child(1) { width: 14%; }
.engines th:nth-child(2) { width: 11%; }
.engines th:nth-child(3) { width: 10%; }
.engines th:nth-child(4) { width: 8%; }
.engines th:nth-child(5) { width: 13%; }
.engines th:nth-child(6) { width: 18%; }
.engines th:nth-child(7) { width: 26%; }
.engines td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.engines td.is-alarm { color: var(--color-signal-text); }
/* .gpu__flag.is-blank: a tile with nothing to flag keeps the flag's room, so its head never changes height */
.gpu__flag.is-blank { visibility: hidden; }
/* .is-stale: a machine whose agent went quiet keeps its last tiles and rows, dimmed, until it reports again */
.gpus.is-stale, .engines.is-stale { opacity: 0.45; }

/* ====================================================================
   Kind    : Component
   Name    : .earned
   Purpose : What the API would have earned all time, in metal, and in the chosen range, in white.
   ==================================================================== */
.earned { display: flex; gap: 16px; }
.earned__block { flex: 1 1 0; padding: 24px; border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--gradient-panel); }
.earned__value { margin-top: 12px; background: var(--gradient-metal); -webkit-background-clip: text; background-clip: text; color: transparent; font: 600 clamp(40px, 4.4vw, 60px)/1 var(--font-brand); letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.earned__value--range { background: none; color: var(--color-paper); }

/* ====================================================================
   Kind    : Component
   Name    : .spread
   Purpose : The token spread for the range: shares in one bar, then tokens, price, and money per kind.
   ==================================================================== */
.spread { padding: 20px; }
.spread__bar { display: flex; gap: 3px; height: 12px; overflow: hidden; border-radius: 999px; background: var(--color-graphite-high); }
.spread__share { flex: var(--share, 0) 1 0; min-width: 0; }
.spread__share--input { background: var(--color-silver); }
.spread__share--cache-write { background: var(--color-silver-deep); }
.spread__share--cache-read { background: var(--color-paper-ghost); }
.spread__share--output { background: var(--color-paper-bright); }
.spread__columns { display: flex; margin-top: 20px; }
.spread__column { flex: 1 1 0; min-width: 0; padding-right: 16px; }
.spread__column + .spread__column { padding-left: 20px; border-left: 1px solid var(--color-line); }
.spread__tokens { margin-top: 10px; font: 500 26px/1 var(--font-brand); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.spread__rate { display: flex; align-items: center; gap: 8px; margin-top: 10px; color: var(--color-paper-faint); font: 500 12px var(--font-mono); }
.spread__input { width: 84px; height: 30px; }
.spread__input:disabled { border-color: transparent; background: transparent; padding-left: 0; }
.spread__cost { margin-top: 8px; color: var(--color-paper-soft); font-size: 15px; font-variant-numeric: tabular-nums; }
.spread__note { margin-top: 18px; color: var(--color-paper-faint); font-size: 12.5px; }

/* ====================================================================
   Kind    : Component
   Name    : .keyform
   Purpose : Creating a key in one row, then showing it once.
   ==================================================================== */
.panel__hint { margin-left: auto; color: var(--color-paper-faint); font-size: 12.5px; }
.keyform { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 18px 20px 20px; }
.keyform .field { flex: 1 1 140px; }
.keyform__submit { flex: 0 0 auto; }
.reveal { display: flex; align-items: center; gap: 12px; margin: 0 20px 20px; padding: 12px 14px; border: 1px solid var(--color-line-strong); border-radius: var(--radius-control); background: var(--color-well); }
.reveal[hidden] { display: none; }
.reveal__label { flex: 0 0 auto; color: var(--color-paper-muted); font-size: 12.5px; }
.reveal__value { flex: 1 1 auto; min-width: 0; overflow: hidden; color: var(--color-paper); font: 400 12.5px var(--font-mono); text-overflow: ellipsis; white-space: nowrap; }
.keys__name { display: flex; flex-direction: column; }
.keys__name small { color: var(--color-paper-faint); font-size: 12px; }
.keys__rename { max-width: 280px; margin-bottom: 4px; }
.keys__actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.keys tr.is-off td { color: var(--color-paper-faint); }

/* ====================================================================
   Kind    : Component
   Name    : .modal
   Purpose : A dialog over a dimmed page; its body is one of the named vertical scrollers.
   ==================================================================== */
.modal { display: flex; align-items: center; justify-content: center; position: fixed; inset: 0; z-index: 10; padding: 40px; }
.modal__backdrop { position: absolute; inset: 0; background: var(--color-ink); opacity: 0.78; animation: fade-in 0.2s ease-out backwards; }
.modal__panel { display: flex; flex-direction: column; position: relative; width: 560px; max-height: calc(100vh - 80px); overflow: hidden; border: 1px solid var(--color-line-strong); border-radius: var(--radius-panel); background: var(--gradient-panel); box-shadow: var(--shadow-drop); animation: rise 0.35s var(--ease-expo) backwards; }
.modal__panel--wide { width: 1040px; max-width: 100%; }
.modal__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--color-line); }
.modal__title { font-size: 20px; font-weight: 500; letter-spacing: -0.02em; }
.modal__close { color: var(--color-paper-muted); font-size: 22px; line-height: 1; transition: color 0.15s; }
.modal__close:hover { color: var(--color-paper); }
.modal__close[disabled] { opacity: 0.3; cursor: not-allowed; }
.modal__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.modal__foot { display: flex; align-items: center; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--color-line); }
.modal__message { flex: 1 1 auto; color: var(--color-paper-muted); font-size: 13px; }
.modal__message.is-alarm { color: var(--color-signal-text); }
.modal .tabs { flex-wrap: wrap; overflow: visible; }
.modal .tabs__tab { display: flex; flex-direction: column; gap: 2px; font-family: var(--font-mono); font-size: 12.5px; }
.modal .tabs__tab small { color: var(--color-paper-faint); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; }
.modal .tabs__tab[disabled] { cursor: not-allowed; }

/* ====================================================================
   Kind    : Component
   Name    : .option
   Purpose : One engine setting in the Configure modal: what it does, its name, and its allowed values; a changed pick is marked until saved or discarded.
   ==================================================================== */
.options { display: flex; flex-direction: column; }
/* .options__note: one sentence above the rows when the tab has a rule the operator needs before picking */
.options__note { padding: 14px 20px; border-bottom: 1px solid var(--color-line); background: var(--color-graphite-raised); color: var(--color-paper-muted); font-size: 13px; }
.option { display: flex; align-items: center; gap: 20px; padding: 14px 20px; border-bottom: 1px solid var(--color-line); }
.option:last-child { border-bottom: 0; }
.option__words { flex: 1 1 auto; min-width: 0; }
.option__name { font-size: 14.5px; }
.option__key { margin-top: 2px; color: var(--color-paper-faint); font: 400 11.5px var(--font-mono); }
.option .input, .option .picker { flex: 0 0 200px; }
.option .segment { flex: 0 0 auto; }
.option.is-changed { background: var(--color-graphite-raised); box-shadow: inset 2px 0 0 var(--color-paper); }

/* ====================================================================
   Kind    : Component
   Name    : .picker
   Purpose : A choice from a long list: the value in a field with a chevron, the list in a menu fixed to the window so no dialog clips it; the default is tagged in the list, never written into the value.
   ==================================================================== */
.picker { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 36px; padding: 0 12px; border: 1px solid var(--color-line-strong); border-radius: var(--radius-control); background: var(--color-ink); color: var(--color-silver); font: 400 13px var(--font-mono); text-align: left; transition: border-color 0.15s, background-color 0.15s; }
.picker:hover { border-color: var(--color-line-hover); background: var(--color-graphite); }
.picker[aria-expanded="true"] { border-color: var(--color-paper); }
.picker[disabled] { opacity: 0.4; cursor: not-allowed; }
.picker__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* .picker::after: the chevron, drawn from two borders so it takes the text colour */
.picker::after { content: ""; flex: 0 0 auto; width: 6px; height: 6px; margin-top: -3px; border-right: 1.5px solid var(--color-paper-muted); border-bottom: 1.5px solid var(--color-paper-muted); transform: rotate(45deg); transition: transform 0.15s; }
.picker[aria-expanded="true"]::after { margin-top: 3px; transform: rotate(-135deg); }
.segment button[disabled] { opacity: 0.4; cursor: not-allowed; }
.menu { display: flex; flex-direction: column; position: fixed; z-index: 20; right: var(--menu-right); top: var(--menu-top); min-width: var(--menu-width); max-width: 480px; max-height: 300px; padding: 4px; overflow-y: auto; border: 1px solid var(--color-line-strong); border-radius: var(--radius-control); background: var(--color-graphite-high); box-shadow: var(--shadow-drop); animation: fade-in 0.12s ease-out backwards; }
.menu--above { top: auto; bottom: var(--menu-bottom); }
.menu__item { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: 12px; height: 32px; padding: 0 10px; border-radius: 6px; color: var(--color-paper-soft); font: 400 13px var(--font-mono); text-align: left; white-space: nowrap; }
.menu__item:hover, .menu__item:focus-visible { outline: none; background: var(--color-wash); color: var(--color-paper-bright); }
.menu__item.is-selected { background: var(--color-graphite-raised); box-shadow: inset 2px 0 0 var(--color-paper); color: var(--color-paper-bright); }
.menu__tag { color: var(--color-paper-faint); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; }

/* ====================================================================
   Kind    : Component
   Name    : .chat
   Purpose : The Chat page: the conversation in the document's own scroll, the composer stuck to the bottom of the window; a reply that failed is the only red.
   ==================================================================== */
.chat__tools { display: flex; align-items: center; gap: 10px; }
.chat__model .picker { width: 260px; }
.chat { display: flex; flex-direction: column; border: 1px solid var(--color-line); border-radius: var(--radius-panel); background: var(--gradient-panel); box-shadow: var(--shadow-panel); }
.chat__log { display: flex; flex-direction: column; gap: 4px; min-height: 360px; padding: 12px 0; }
.chat__empty { padding: 28px 24px; color: var(--color-paper-muted); font-size: 14px; }
.chat__composer { display: flex; align-items: flex-end; gap: 12px; position: sticky; bottom: 0; padding: 14px 20px 18px; border-top: 1px solid var(--color-line); border-radius: 0 0 var(--radius-panel) var(--radius-panel); background: var(--color-graphite); }
.chat__prompt { flex: 1 1 auto; height: auto; min-height: 44px; max-height: 220px; padding: 11px 14px; resize: none; field-sizing: content; line-height: 1.5; }
.turn { display: flex; flex-direction: column; gap: 6px; padding: 14px 24px; }
.turn--user { background: var(--color-graphite-raised); }
.turn__text { color: var(--color-paper); font-size: 15px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.turn--user .turn__text { color: var(--color-paper-soft); }
.turn__meta { color: var(--color-paper-faint); font: 500 11.5px var(--font-mono); letter-spacing: 0.04em; }
.turn.is-alarm .turn__meta { color: var(--color-signal-text); }
.turn__thinking summary { color: var(--color-paper-muted); font: 500 11.5px var(--font-mono); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.turn__thought { max-height: 260px; margin-top: 8px; padding: 10px 12px; overflow-y: auto; border-left: 2px solid var(--color-line-strong); color: var(--color-paper-muted); font-size: 13.5px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }

/* ====================================================================
   Kind    : Component
   Name    : responsive
   Purpose : The two snaps: below 960 the rail becomes a sticky bar with the four pages in one row and every grid halves; below 720 tables stack, the Configure dialog fills the screen, and nothing needs a pointer or scrolls sideways.
   ==================================================================== */
@media (max-width: 959px) {
  .app { flex-direction: column; }
  .rail { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 12px 16px; z-index: 5; height: auto; padding: 12px 16px 10px; border-right: 0; border-bottom: 1px solid var(--color-line); background: var(--color-graphite); }
  .rail__brand { flex-direction: row; align-items: center; gap: 14px; padding: 0; border-bottom: 0; }
  .rail__foot { flex-direction: row; align-items: center; order: 2; gap: 16px; margin: 0 0 0 auto; padding: 0; border-top: 0; }
  .rail__user { flex-direction: row; align-items: center; gap: 12px; }
  .rail__links { flex: 1 1 100%; flex-direction: row; order: 3; gap: 4px; margin-top: 0; }
  .rail__link { flex: 1 1 0; justify-content: center; gap: 8px; height: 38px; padding: 0 6px; font-size: 14px; }
  .main { padding: 24px 24px 56px; }
  .main .panel__bar { flex-wrap: wrap; }
  .figures { flex-wrap: wrap; }
  .figure { flex: 1 1 calc(50% - 8px); }
  .split { flex-direction: column; }
  .gpu { flex-basis: 50%; }
  .modal { padding: 24px; }
  .main .table, .main .table tbody, .main .table tr, .main .table td { display: block; }
  .main .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .main .table tr { padding: 10px 18px; border-bottom: 1px solid var(--color-line); }
  .main .table tbody tr:last-child { border-bottom: 0; }
  /* .main .table td: the column's name hangs in the left gutter, the value flows beside it */
  .main .table td { position: relative; min-height: 26px; padding: 4px 0 4px 136px; border-bottom: 0; white-space: normal; }
  .main .table td::before { content: attr(data-label); position: absolute; left: 0; top: 4px; width: 128px; padding-top: 0.3em; overflow: hidden; color: var(--color-paper-faint); font: 500 10px/1.4 var(--font-mono); letter-spacing: 0.06em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
  .main .table td:not([data-label]) { padding-left: 0; }
  .keys__actions { justify-content: flex-start; padding-top: 6px; }
  .machine__title { flex-basis: 100%; white-space: normal; }
  .machine__meta { display: block; min-height: 1lh; }
}
@media (max-width: 719px) {
  .rail__brand .label, .rail__index, .rail__email, .rail__clock { display: none; }
  .rail__link { font-size: 13.5px; }
  .main { padding: 18px 14px 48px; }
  .notice { margin-bottom: 12px; }
  .head { flex-direction: column; align-items: stretch; gap: 14px; margin-bottom: 4px; }
  .head .segment { align-self: flex-start; }
  .verdict { gap: 14px; padding: 16px; }
  .verdict__title { -webkit-line-clamp: 2; min-height: 2lh; font-size: 20px; }
  .verdict__detail { -webkit-line-clamp: 3; min-height: 3lh; }
  .head__stamp { text-align: left; }
  .figures { gap: 10px; }
  .figure { flex-basis: calc(50% - 5px); padding: 14px 10px; }
  .figure--wave { min-height: 132px; }
  .figure__detail { font-size: 12px; }
  .plot { height: 220px; padding: 10px 12px 12px; }
  .legend { flex-wrap: wrap; gap: 8px 14px; padding: 12px 14px 0; }
  .now { flex-wrap: wrap; }
  .now__cell { flex: 1 1 50%; padding: 16px; }
  .now__cell + .now__cell { border-left: 0; }
  .now__cell:nth-child(even) { border-left: 1px solid var(--color-line); }
  .now__cell:nth-child(n + 3) { border-top: 1px solid var(--color-line); }
  .now__value { font-size: 26px; }
  .gpu { padding: 14px 12px 16px; }
  .gpu__temperature { font-size: 28px; }
  .gpu__row { gap: 8px; margin-top: 10px; font-size: 12px; }
  .gpu__row > span { flex-basis: 48px; }
  .gpu__row b { flex-basis: 56px; font-size: 11px; white-space: nowrap; }
  .machine__meta { min-height: 2lh; }
  .machine .panel__actions { flex: 1 1 100%; flex-wrap: wrap; }
  .machine__state { flex: 1 1 100%; justify-content: flex-start; }
  .main .table tr { padding: 10px 14px; }
  .main .engines td:last-child { min-height: calc(2lh + 8px); }
  .earned { flex-direction: column; gap: 10px; }
  .earned__block { padding: 18px; }
  .spread { padding: 16px; }
  .spread__columns { flex-wrap: wrap; row-gap: 18px; }
  .spread__column { flex: 1 1 50%; padding-right: 12px; }
  .spread__column + .spread__column { padding-left: 0; border-left: 0; }
  .spread__column:nth-child(even) { padding-left: 14px; border-left: 1px solid var(--color-line); }
  .spread__tokens { font-size: 22px; }
  .spread__rate { flex-wrap: wrap; gap: 4px 8px; }
  .spread__rate span { white-space: nowrap; }
  .spread__input { width: 76px; }
  .reveal { flex-wrap: wrap; }
  .chat__tools { width: 100%; }
  .chat__model { flex: 1 1 auto; min-width: 0; }
  .chat__model .picker { width: 100%; }
  .turn { padding: 12px 14px; }
  .chat__composer { gap: 8px; padding: 10px 12px 12px; }
  .modal { align-items: stretch; padding: 0; }
  .modal__panel, .modal__panel--wide { width: 100%; min-height: 100svh; max-height: 100svh; border: 0; border-radius: 0; }
  .modal .tabs { gap: 6px 16px; }
  .option { flex-wrap: wrap; gap: 10px; padding: 14px 16px; }
  .option__words { flex: 1 1 100%; }
  .option .input, .option .picker { flex: 1 1 100%; }
  .option .segment { flex-wrap: wrap; }
  .modal__foot { flex-wrap: wrap; padding: 12px 16px 16px; }
  .modal__message { flex: 1 1 100%; }
  .modal__foot .btn { flex: 1 1 auto; }
  .menu { max-width: calc(100vw - 24px); }
}
