/*
 * flow/site/styles.css: the control room the stage is watched from.
 *
 * Kais on the old page, verbatim: "cant see shit with these colors" and "this
 * looks insanely horrible to me", and what he wants instead: "I want this thing
 * looking very nice like a game, animation".
 *
 * Reading the live page on 2026-09-17 said what was actually wrong, which was
 * not the hues. The eight semantic colours below carry real meaning and they
 * are unchanged. What failed was everything else: every node and edge wore one
 * amber so the eye had nowhere to go, and the panels sat at 0.88 alpha over the
 * canvas, which made them slabs that hid the one thing the page exists to show.
 * So the fixes here are ground, panel alpha, type scale, and restraint on the
 * accent. The accent now marks exactly one thing at a time (what is selected),
 * and semantics carry the rest.
 *
 * The eight semantic custom properties below are the palette the canvas draws
 * with. stage.js reads them out of this stylesheet at mount time, through
 * getComputedStyle(document.documentElement), and only falls back to its own
 * literals if a property is missing. So this file is the single source and the
 * two cannot drift: retuning a value here retunes the stage, and the legend in
 * the detail card keeps describing what was actually drawn. Renaming one, on
 * the other hand, silently drops the stage onto its fallback.
 *
 * Panels are thin and translucent on purpose. The stage is the thing being
 * looked at; a panel is a pane of glass over it, not a wall.
 *
 * No web font is loaded. This page is served off the t0-observability VM behind
 * IAP and has no egress guarantee, so a CDN font would be a blank page waiting
 * on a timeout. System stack only.
 *
 * Classes prefixed d-* are emitted by detail.js (this file's sibling, same
 * owner). Classes prefixed tl-* are emitted by timeline.js, which is a
 * different module: those selectors were read off the live DOM and out of that
 * file's shell(), pickerShell(), buildStrip() and buildRows() on 2026-09-17,
 * because the first pass wrote them from the module contract and most of the
 * contract's guessed names did not exist.
 */

:root {
  /* The ground and the ink. Darker and colder than the old #0d1119, which is
     what buys the semantic colours their contrast back. */
  --ground: #070a11;
  --ground-lift: #0d1320;
  --ink: #f2f5fa;
  --ink-dim: #a9b6c7;
  --ink-faint: #7d8b9e;

  /* Glass, not slab. The old value was rgba(20, 26, 36, 0.88) and it hid the
     animation; at 0.58 with a blur the points still read through a panel. */
  --panel: rgba(9, 13, 21, 0.58);
  --panel-lift: rgba(16, 22, 33, 0.72);
  --panel-solid: rgba(9, 13, 21, 0.95);
  --edge: rgba(148, 176, 214, 0.14);
  --edge-hi: rgba(240, 181, 70, 0.42);
  --accent: #f0b546;
  --accent-soft: rgba(240, 181, 70, 0.13);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.55);
  --r: 12px;

  /* THE SHARED PALETTE, and the only copy of it. stage.js reads these eight
     properties by name at mount, so the canvas and the legend cannot disagree.
     Hue says which way money crossed T0's edge; brightness on a circle says
     whether the wallet is T0's own. Rename one and the stage quietly falls back
     to its own literals. */
  /* T0's own: blue, on the header figures and on the stage alike. Kais,
     2026-09-19: "Everything issuance is purple like now and everything T0
     becomes blue." The same value under both names, so a rule can say which
     it means. */
  --t0: #5b9cff;
  --own: #5b9cff;
  --outside: #76889f;
  /* S01, the issuer. Its circles are neither T0's (bright) nor nobody's
     (grey): the same purple docs/architecture.md fills S01's boxes with, so
     the two pictures agree on whose a thing is. */
  --s01: #b48cf2;
  /* The solver: an organisation of its own, pink (Kais, 2026-09-19). */
  --solver: #f472b6;
  /* The USDC coin itself, the brand's blue. Only the core of a dollars point
     is painted with it; the glow and tail keep the direction colour above. */
  --usdc: #2775ca;
  /* Plain dollars, the cash at the broker: a dollar-bill green so it is never
     mistaken for the USDC coin beside it. */
  --usd: #4f9d69;
  --in: #5fd08f;
  --out: #ff945c;
  --internal: #8aa0c8;
  /* Cyan, not purple: purple is S01's (--s01) and a T0 crossing must not
     look like S01's money. */
  --crossing: #5fb8d0;
  --warning: #ffd666;
  --danger: #ee5e53;
  --live: #5fd08f;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
          "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ground);
  color: var(--ink);
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Every figure on this page lines up under another figure, so tabular numerals
   are the default and proportional digits are the exception. */
body {
  font-variant-numeric: tabular-nums;
}

/* --- The stage ------------------------------------------------------------ */

/* Full bleed, and the panels float over it. Nothing else may cover the canvas:
   the stage owns hit testing for picking a trade, picking a place and hovering,
   and one invisible full-viewport layer over the top would kill all three. */
#stage {
  position: fixed;
  inset: 0;
  z-index: 0;
  /* A soft well rather than flat black, so a dark point still has a ground to
     sit against near the edges of the frame. */
  background:
    radial-gradient(120% 90% at 50% 42%, var(--ground-lift) 0%, var(--ground) 62%),
    var(--ground);
}

#graph {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* --- Panels --------------------------------------------------------------- */

/* Styled by contracted id rather than by any wrapper class, because the ids in
   index.html are the fixed part of the contract and its classes are not. */
#top, #top-s01, #solver-box, #windows, #tools, #picker, #detail, #scrub, #side, #legend, #report .rp-card,
#ask .rp-card {
  position: relative;
  z-index: 20;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
}

/* Where blur is unsupported the glass is just a washed-out film over a moving
   canvas, which is unreadable. Trade the translucency for legibility there. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  #top, #windows, #tools, #picker, #detail, #scrub, #side {
    background: var(--panel-solid);
  }
}

/* HUD top-left. */
#top {
  padding: 12px 18px 11px;
  display: flex;
  gap: 26px;
  align-items: center;
}

#top h1 {
  margin: 0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
}

#top p {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--ink-dim);
}

/* The HUD figures. Selectors are scoped to #top so they cannot reach into the
   detail card, and the bare element rules above stand in if index.html's
   classes ever change: the ids are the contract, the classes are not. */
/* min-width: 0 is the fix for full dollar figures. Kais asked for balances in
   plain dollars rather than shortened to K, so "held right now" went from
   $1.2M-shaped to $1,234,567.89-shaped. The figures below keep their nowrap,
   which is right (a number must never break mid-figure), but a nowrap flex
   item will not shrink and its default min-width of auto stopped this whole
   block from shrinking too, so the HUD pushed #top past its own
   max-width instead of wrapping. With min-width: 0 the cells wrap onto a
   second line, which is what flex-wrap was already there to do. */
#top .hud {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px 22px;
  min-width: 0;
}
/* One row of figures on a desktop; the captions are short and the long
   form is the hover (Kais, 2026-10-10). */
@media (min-width: 1200px) { #top .hud { flex-wrap: nowrap; } #top .caption { white-space: nowrap; max-width: none; } }
@media (min-width: 1200px) and (max-width: 1599px) { #top .figure, #top strong, #top b { font-size: 19px; } #top-s01 .figure { font-size: 19px; } }

#top .hud-cell { min-width: 0; }

#top .figure,
#top strong,
#top b {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

#top .figure.accent { color: var(--accent); }
#top .figure.t0 { color: var(--t0); }
#top .figure.s01 { color: var(--s01); }
#top .figure.solver { color: var(--solver); }
#top .figure.ok { color: var(--in); }
#top .figure.warn { color: var(--warning); }
#top .figure.bad { color: var(--danger); }
#top .figure.muted { color: var(--ink-faint); }
#top .caption.bad { color: var(--danger); }
#top .hud-click { text-decoration: none; color: inherit; border-bottom: 0; background: none; border: 0; padding: 0; font: inherit; text-align: left; cursor: pointer; }
#top .hud-click:hover .caption { color: var(--ink); }
#top .caption.warn { color: var(--warning); }
/* S01's figures sit apart from T0's, on the right. */
#top .hud-s01 { margin-left: 10px; padding-left: 20px; border-left: 1px solid var(--edge); }
.svc-report { margin-left: auto; }
/* Firing alerts on the cards. */
.d-alerts { list-style: none; margin: 4px 0 0; padding: 0; }
.d-alert { padding: 5px 0; border-top: 1px solid var(--edge); font-size: 11.5px; }
.d-alert-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.d-alert-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warning); flex: none; }
.d-alert-critical .d-alert-dot { background: var(--danger); }
.d-alert-meta { color: var(--ink-faint); font-size: 10.5px; }
.d-alert-sub { color: var(--ink-dim); font-size: 11px; margin: 2px 0 0 15px; }
.d-alert-ok { color: var(--in); font-size: 12px; margin: 6px 0 0; }
.d-alert.marked { margin: 0 -6px; padding: 5px 6px; border-radius: 6px; background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); }

#top .caption {
  margin-top: 2px;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* A failure said out loud. It takes the whole width of the HUD so it never
   squeezes a figure, and it is the danger colour because a board that fails
   quietly is how the old one came to be trusted while it was wrong. */
#top #status {
  flex: 1 0 100%;
  /* Wraps inside the header's width instead of widening it. */
  contain: inline-size;
  margin: 0;
  font-size: 11px;
  color: var(--danger);
}

#top #status:empty { display: none; }

/* --- Which mode the page is in ------------------------------------------- */

/* Kais: "at startup show something clearer when it's live mode vs when it's
   replay. so 2 clear modes." The clock is the whole design of this page and
   the two modes behave differently (live runs at real time and the playhead is
   now; replay walks the playhead at windowSeconds / 45), so reading the board
   without knowing which one it is in tells you nothing about what you are
   watching. The transport's own tl-live button says whether live is
   AVAILABLE; this badge says which mode the page is actually IN.

   Emitted by app.js as <p id="mode" class="mode-live"> or class="mode-replay",
   optionally carrying a child <span class="mode-note">.

   Written as #mode rather than as a bare .mode-live because #top p
   already matches this element and would otherwise win on both colour and
   font-size. flex: none keeps it off a row of its own: #top #status claims
   flex: 1 0 100% deliberately and this badge must not. */
#mode {
  position: relative;
  z-index: 30;
  margin: 0;
  box-shadow: var(--shadow);
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

/* Live wears the green the rest of the page already means "money came in" with,
   and it pulses, because a page keeping up and a page that has stalled look
   identical while nothing is crossing the corridor. */
#mode.mode-live {
  color: var(--live);
  background: rgba(95, 208, 143, 0.15);
  border-color: rgba(95, 208, 143, 0.45);
}

#mode.mode-live::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(95, 208, 143, 0.2);
  /* flow-pulse is the keyframe .tl-live.tl-on::before already uses, reused so
     the two live indicators breathe together. It ends at opacity 1, so the
     reduced-motion block at the foot of this file (which forces a 0.001ms
     duration and a single iteration) leaves the dot visible rather than
     stranding it half faded. No second media query is needed. */
  animation: flow-pulse 2.4s ease-in-out infinite;
}

/* Replay is deliberately NOT the accent: the accent on this page marks exactly
   one thing, which is what is selected, and a second permanent accent badge in
   the header would break that. A cool neutral in the internal-money blue reads
   as chrome rather than as a live signal, and it has no dot at all, so live and
   replay differ in hue, in border and in whether anything moves. */
#mode.mode-replay {
  color: var(--internal);
  background: rgba(138, 160, 200, 0.12);
  border-color: rgba(138, 160, 200, 0.34);
}

/* A square where live has a circle, so the two are still told apart by a
   reader who cannot separate the hues. */
#mode.mode-replay::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 1px;
  background: currentColor;
  opacity: 0.8;
}

/* The small print after the word. Lower case and dimmer, because the mode is
   the thing being read at a glance and the note is what you read second. */
#mode .mode-note {
  font-weight: 450;
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--ink-dim);
}

/* Everything about WHEN is one control with the timeline it drives: the
   widths and the day arrows sit on the scrubber's lid, square where the two
   meet, so they read as one box (Kais, 2026-09-23). */
#windows {
  padding: 5px 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: transparent;
  box-shadow: none;
}
#scrub { border-top-left-radius: 0; border-top-right-radius: 0; }

/* The things that are not about time, each saying what it does rather than
   wearing a one-word label (Kais, 2026-09-23: "find button make it separate
   and more explanatory"). */
#tools {
  padding: 6px;
  display: flex;
  align-items: stretch;
  gap: 4px;
}
#tools .tool {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  border-radius: 8px;
  padding: 5px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
}
#tools .tool:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); border-color: var(--edge); }
#tools .tool-name { font-size: 12px; }
#tools .tool-sub { font-size: 9.5px; color: var(--ink-faint); letter-spacing: 0.04em; }
#tools .ask-pill .tool-name { color: var(--accent); }
#tools .ask-pill { display: flex; flex-direction: row; align-items: center; gap: 7px; }
#tools .ask-pill .tool-words { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }

#windows > span,
#windows .nav-label {
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-right: 4px;
}

#windows button {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  padding: 5px 11px;
  border-radius: 7px;
  cursor: pointer;
  position: relative;
  transition: color 120ms ease, background 120ms ease, border-color 120ms ease;
}

#windows button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }

#windows button.on,
#windows button[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--edge-hi);
  color: var(--accent);
}

/* A pill whose window actually holds trades carries a live dot, so a still
   stage reads as "that window was quiet" and not as "this page is broken". */
#windows button.active::after,
#windows button[data-busy="1"]::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 4px;
  height: 4px;
  margin-left: -2px;
  border-radius: 50%;
  background: var(--live);
}

/* Trade picker on the left, detail card on the right. Both are tall thin
   columns: the middle of the screen stays clear for the stage. */
#picker, #detail {
  overscroll-behavior: contain;
}

/* The picker scrolls as one panel. timeline.js also makes its own .tl-rows a
   scroller, so a long list scrolls inside the list and the panel itself stays
   put; both are wanted, and they compose. */
#picker {
  padding: 12px 14px 14px;
  overflow-y: auto;
}

/* The detail card does NOT scroll as one panel. Its head is pinned and only
   .d-body moves, so the symbol and the side stay on screen while the facts
   under them scroll (see card() in detail.js for the measurement). */
#detail {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
/* display: flex above would beat the hidden attribute, and an empty glass
   panel on the right is what the idle card became. */
#detail[hidden] { display: none; }

#detail > .d-card {
  flex: 1 1 auto;
  min-height: 0;
}

/* A hint that there is more below, because a row cut off mid line reads as
   broken rather than as scrollable: that is exactly how the pinned card was
   first reported on 2026-09-17. pointer-events stays off so the links under it
   are still clickable. */
#detail::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 1px;
  bottom: 1px;
  height: 18px;
  border-radius: 0 0 var(--r) var(--r);
  background: linear-gradient(rgba(9, 13, 21, 0), rgba(9, 13, 21, 0.85));
  pointer-events: none;
}

/* --- Report to whoever is on call ---------------------------------------- */

.rp-button {
  appearance: none;
  border: 1px solid var(--edge);
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink-dim);
  border-radius: 999px;
  padding: 2px 9px;
  font: inherit;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}
.rp-button:hover { color: var(--ink); border-color: var(--edge-hi); }
.d-report { float: right; margin: 2px 0 0 8px; }
.hv-report { margin: 8px 0 2px; }
#windows button.report { color: var(--ink-dim); }
#windows button.range { color: var(--ink-dim); }
#windows button.range.on { color: var(--ink); background: var(--panel-lift); }
#windows button.report:hover { color: var(--ink); }

#report .rp-card { width: 420px; max-width: 100%; padding: 14px 16px 14px; }
.rp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.rp-title { margin: 0; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-dim); }
.rp-close { appearance: none; border: 0; background: none; color: var(--ink-faint); font: inherit; font-size: 16px; cursor: pointer; padding: 0 2px; }
.rp-close:hover { color: var(--ink); }
.rp-who { margin-top: 10px; font-size: 12px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.rp-who b { color: var(--ink); font-weight: 600; }
.rp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--in); box-shadow: 0 0 6px rgba(95, 208, 143, 0.55); }
.rp-dim { color: var(--ink-faint); }
.rp-what { margin-top: 10px; font-size: 12.5px; color: var(--ink); display: flex; gap: 8px; align-items: baseline; }
.rp-kind { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); flex: none; }
.rp-view { margin-top: 4px; font-size: 11px; color: var(--ink-dim); }
.rp-link { color: var(--accent); }
.rp-note { display: block; width: 100%; margin-top: 10px; padding: 7px 9px; border-radius: 8px; border: 1px solid var(--edge); background: rgba(255, 255, 255, 0.03); color: var(--ink); font: inherit; font-size: 12px; resize: vertical; }
.rp-foot { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rp-status { font-size: 11px; color: var(--ink-dim); }
.rp-bad { color: var(--danger); }
.rp-good { color: var(--in); }
.rp-send { appearance: none; border: 1px solid rgba(240, 181, 70, 0.5); background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 5px 14px; font: inherit; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; }
.rp-send:disabled { opacity: 0.6; cursor: default; }

/* What the colours mean: a small figure in the bottom-left corner, under the
   trade list and clear of the transport. Kais, 2026-09-19. */
#legend {
  padding: 9px 14px 10px;
}
#legend .d-sub-head { margin-top: 0; }
#legend .d-legend-row { font-size: 10.5px; padding: 1.5px 0; }
#legend .d-note { font-size: 10px; margin: 6px 0 0; color: var(--ink-faint); }

/* --- The alerts and services panel ---------------------------------------- */

/* Not positioned and not blurred (a backdrop filter would make it the
   containing block too), so an open row's content hangs off the rail rather
   than off this panel, and this panel's scrolling cannot clip it. Solid
   instead of glass, like the content it opens. */
#side {
  position: static;
  z-index: 25;
  background: var(--panel-solid);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
  display: flex;
  flex-direction: column;
}
/* Rows keep their height and the panel scrolls: shrunk to share it, a row
   squeezed below its own head and a tap landed on the wrong one. */
#side .side-row { flex: none; display: flex; flex-direction: column; min-height: 0; border-top: 1px solid var(--edge); }
/* The display above beats the UA's [hidden] rule: break-glass is hidden from
   a reader who cannot use it. */
#side .side-row[hidden] { display: none; }
#side .side-row:first-child { border-top: 0; }
#side .side-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: none;
  border: 0;
  color: var(--ink-dim);
  font: inherit;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: left;
  cursor: pointer;
}
#side .side-head:hover { color: var(--ink); background: rgba(255, 255, 255, 0.04); }
#side .side-head.on { color: var(--ink); background: var(--panel-lift); }
#side .side-name { flex: 1; }
#side .side-chev { width: 6px; height: 6px; border-right: 1.5px solid var(--ink-faint); border-bottom: 1.5px solid var(--ink-faint); transform: rotate(-45deg); transition: transform 0.15s; flex: none; margin-right: 2px; }
#side .side-head.on .side-chev { transform: rotate(45deg); }
#side .side-dot.none { visibility: hidden; }
/* The trade list and the legend, drawn by their own modules, sit inside the
   panel as plain blocks: no frame of their own. */
#side #picker, #side #legend {
  position: static;
  width: auto;
  max-height: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 2px 0 6px;
}
#side .side-n { font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 11px; color: var(--ink); }
#side .side-dot, .svc-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--ink-faint);
}
#side .side-dot.ok, .svc-dot.ok { background: var(--in); box-shadow: 0 0 6px rgba(95, 208, 143, 0.55); }
#side .side-dot.warn, .svc-dot.warn { background: var(--warning); box-shadow: 0 0 6px rgba(255, 214, 102, 0.55); }
#side .side-dot.bad, .svc-dot.bad { background: var(--danger); box-shadow: 0 0 6px rgba(238, 94, 83, 0.6); }
#side .side-dot.off, .svc-dot.off { background: transparent; border: 1px solid var(--ink-faint); }
#side .side-body {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  max-height: 46vh;
  padding: 2px 12px 10px;
  border-top: 1px solid var(--edge);
  scrollbar-width: thin;
  scrollbar-color: rgba(169, 182, 199, 0.28) transparent;
}
#side .side-empty { color: var(--ink-faint); font-size: 11.5px; padding: 10px 0; }
#side .side-ok { color: var(--in); font-size: 12px; padding: 8px 0 4px; }
#side .side-foot { display: flex; justify-content: space-between; gap: 10px; padding-top: 8px; font-size: 10.5px; color: var(--ink-faint); }
#side .side-foot a { color: var(--ink-dim); }
#side .d-alert a, #side .svc-rule a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--edge); }
#side .d-alert a:hover, #side .svc-rule a:hover { border-bottom-color: var(--ink-dim); }

.svc { border-top: 1px solid var(--edge); }
.svc:first-child, .svc.svc-static + .svc { border-top-color: var(--edge); }
.svc-head {
  width: 100%;
  display: grid;
  grid-template-columns: 8px 1fr auto;
  grid-template-areas: "dot name cfg" "dot note cfg";
  column-gap: 9px;
  row-gap: 1px;
  align-items: center;
  padding: 7px 0;
  background: none;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.svc-head:hover .svc-name { color: var(--ink); }
.svc.svc-static { display: grid; grid-template-columns: 8px 1fr; grid-template-areas: "dot name" "dot note"; column-gap: 9px; padding: 7px 0; align-items: center; }
.svc-dot { grid-area: dot; }
.svc-name { grid-area: name; font-size: 12.5px; color: var(--ink-dim); font-weight: 600; }
.svc-note { grid-area: note; font-size: 10.5px; color: var(--ink-faint); }
.svc-bad .svc-name { color: var(--ink); }
.svc-bad .svc-note { color: var(--danger); }
.svc-warn .svc-note { color: var(--warning); }
.svc-deep { padding: 0 0 8px 17px; }
.svc-rules { list-style: none; margin: 6px 0 0; padding: 0; }
.svc-rule { display: flex; justify-content: space-between; gap: 8px; font-size: 10.5px; padding: 2px 0; color: var(--ink-faint); }
.svc-rule.hot a { color: var(--warning); }
.svc-rule-meta { flex: none; }
#side .side-md {
  margin-top: 8px;
  padding: 4px 9px;
  background: var(--panel-lift);
  border: 1px solid var(--edge);
  border-radius: 8px;
  color: var(--ink-dim);
  font: inherit;
  font-size: 10.5px;
  cursor: pointer;
}
#side .side-md:hover { color: var(--ink); border-color: var(--edge-hi); }

#scrub {
  padding: 9px 14px 10px;
}

#timeline { display: block; }

/* Scrollbars inside glass: visible enough to grab, quiet enough to ignore. */
#picker::-webkit-scrollbar, #detail::-webkit-scrollbar { width: 8px; }
#picker::-webkit-scrollbar-thumb, #detail::-webkit-scrollbar-thumb {
  background: rgba(169, 182, 199, 0.22);
  border-radius: 8px;
}
#picker, #detail { scrollbar-width: thin; scrollbar-color: rgba(169, 182, 199, 0.28) transparent; }

/* --- Shared panel typography --------------------------------------------- */

.d-card > .d-head h2, .d-title, #picker h2, #detail h2 {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
}

.d-sub {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--ink-dim);
}

.d-sub-head {
  margin: 15px 0 7px;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* The pinned half of a card. Inside #detail it is a flex item that does not
   shrink; anywhere else (the picker, a test harness) it is just a header. */
.d-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.d-head {
  flex: 0 0 auto;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--edge);
}

/* The scrolling half. min-height:0 is what actually lets it scroll: a flex item
   defaults to min-height:auto and would grow to fit its content instead. */
.d-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 14px 16px;
}

.d-note {
  margin: 12px 0 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-faint);
}

.d-note:empty { display: none; }

/* A fact the probe wrote as a sentence, kept as plain text at the foot of the
   card. detail.js strips it to text before it gets here; it is a cross-check on
   the typed fields above it, so it is set quieter than they are. */
.d-said {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--edge);
  font-size: 11px;
  line-height: 1.55;
  color: var(--ink-faint);
}

/* One transaction touching two symbols. Rare (1 in 67 on 2026-09-16) and worth
   flagging, because the dollars shown are one symbol's and not the tx's. */
.d-flag {
  margin: 11px 0 0;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid rgba(255, 214, 102, 0.3);
  background: rgba(255, 214, 102, 0.08);
  font-size: 11px;
  line-height: 1.45;
  color: var(--warning);
}

/* --- Key and value rows -------------------------------------------------- */

.d-facts { margin-top: 12px; }

.d-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 14px;
  align-items: baseline;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(148, 176, 214, 0.07);
}

.d-row:last-child { border-bottom: 0; }

.d-facts-tight .d-row {
  padding: 2px 0;
  font-size: 11.5px;
  border-bottom: 0;
  gap: 8px;
}

.d-k {
  color: var(--ink-faint);
  white-space: nowrap;
}

.d-v {
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.d-mono { font-family: var(--mono); font-size: 11px; }
/* A place's per-symbol holdings and its addresses, on the pinned card. */
.d-holdings {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.d-holdings th {
  font-weight: 500;
  color: var(--ink-faint);
  text-align: right;
  padding: 0 0 4px 8px;
  letter-spacing: 0.02em;
}
.d-holdings th:first-child { text-align: left; padding-left: 0; }
.d-holdings td { text-align: right; padding: 2px 0 2px 8px; color: var(--ink-dim); border-top: 1px solid var(--edge); }
.d-holdings td.d-sym { text-align: left; padding-left: 0; color: var(--ink); font-weight: 600; }
.d-pos { color: var(--in); }
.d-neg { color: var(--danger); }
/* Addresses: the label on its own line and the address under it, whole. In
   the two-column row the long label squeezed the value to one character a
   line (Kais: "the address is malformed, one character per line"). */
.d-facts .d-row { display: block; }
.d-facts .d-k { display: block; white-space: normal; margin-bottom: 2px; }
.d-facts .d-v { display: block; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.d-facts { margin-top: 4px; }
.d-addr .d-link, .d-addr .d-mono { font-family: var(--mono); font-size: 11px; }
.d-chain { color: var(--ink-faint); font-size: 10px; }

/* A fact nobody has. Said out loud, in the dimmest ink on the page, because a
   blank cell and an unknown value look identical and are not. */
.d-unknown { color: var(--ink-faint); font-style: italic; }

.d-pos { color: var(--in); }
.d-neg { color: var(--danger); }
.d-warn { color: var(--warning); }

/* --- The two sides of one trade ------------------------------------------ */

/* The taker's leg and the bot's leg, set against each other, because T0's money
   is the GAP between the two prices. */
.d-sides {
  margin-top: 13px;
  display: grid;
  gap: 6px;
}

.d-side {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--panel-lift);
  border-left: 3px solid var(--internal);
}

.d-side-taker { border-left-color: var(--out); }
.d-side-bot { border-left-color: var(--in); }
.d-side-none { border-left-color: var(--warning); background: rgba(255, 214, 102, 0.06); }

.d-side-tag {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.d-side-qty {
  margin-top: 3px;
  font-size: 18px;
  font-weight: 620;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.d-side-unit {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

/* The unhedged case, which is two trades in three. It gets words of its own and
   never a zero: a zero would say the two prices matched. */
.d-side-miss {
  font-size: 13px;
  font-weight: 550;
  line-height: 1.35;
  color: var(--warning);
}

.d-vs {
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  padding: 1px 0;
}

/* --- What T0 kept -------------------------------------------------------- */

/* The one figure Kais asked to ride on the moving point, so it is the largest
   thing in the card. */
.d-catch {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--edge-hi);
  background: linear-gradient(180deg, var(--accent-soft), rgba(240, 181, 70, 0.02));
  text-align: center;
}

/* The one micro-caption on the page that is NOT set in caps. It reads "T0 kept",
   and uppercasing it puts a zero next to a capital T, which the system stack
   renders close enough to "TO KEPT" to misread (seen in the harness on
   2026-09-17). The brand is worth more than the register here. */
.d-catch-cap {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}

.d-catch-fig {
  margin-top: 2px;
  font-size: 30px;
  font-weight: 680;
  letter-spacing: -0.025em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.d-catch-note {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink-dim);
}

/* --- The legs of one trade ----------------------------------------------- */

.d-legs { list-style: none; margin: 0; padding: 0; }

.d-leg {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid rgba(148, 176, 214, 0.07);
}

.d-leg:last-child { border-bottom: 0; }

.d-leg-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--internal);
  box-shadow: 0 0 0 3px rgba(138, 160, 200, 0.16);
}

.d-leg-usdc .d-leg-dot { background: var(--out); box-shadow: 0 0 0 3px rgba(255, 148, 92, 0.16); }
.d-leg-token .d-leg-dot { background: var(--own); box-shadow: 0 0 0 3px rgba(91, 156, 255, 0.18); }
.d-leg-hedge .d-leg-dot { background: var(--in); box-shadow: 0 0 0 3px rgba(95, 208, 143, 0.18); }

.d-leg-label { font-size: 12px; }
.d-leg-route { font-size: 10.5px; color: var(--ink-faint); }
.d-leg-usd { font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink-dim); }

/* --- A place, and what makes it up --------------------------------------- */

.d-total { margin-top: 12px; }

.d-total-cap {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Sized for a figure written out in full. 26px was picked when a place's total
   could be shortened to $1.2M; in plain dollars the same number is
   $1,234,567.89, which is fourteen tabular glyphs and wider than the 258px of
   usable width a 284px panel has. So the figure is a little smaller and, as a
   last resort, is allowed to wrap onto a second line rather than run out past
   the glass. */
.d-total-fig {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.d-rows { list-style: none; margin: 0; padding: 0; }

.d-rowline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  padding: 5px 0;
  font-size: 12px;
}

.d-rowline .d-k { overflow: hidden; text-overflow: ellipsis; }
.d-rowline .d-v { text-align: right; }

.d-bar {
  grid-column: 1 / -1;
  height: 2px;
  border-radius: 2px;
  background: rgba(148, 176, 214, 0.1);
  overflow: hidden;
}

.d-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  opacity: 0.6;
}

/* --- The idle HUD: the running score ------------------------------------- */

.d-score {
  margin-top: 13px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.d-tile {
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--panel-lift);
}

.d-tile-lead {
  grid-column: 1 / -1;
  border-color: var(--edge-hi);
  background: linear-gradient(180deg, var(--accent-soft), rgba(240, 181, 70, 0.02));
}

/* The window figure runs the full width rather than leaving a hole beside it,
   which is what a 2 by 2 grid with four tiles and one lead tile gives you. */
.d-tile-wide { grid-column: 1 / -1; }

.d-tile-cap {
  font-size: 9.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.d-tile-fig {
  margin-top: 2px;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* Same reason as .d-total-fig: 32px was sized for a shortened figure, and the
   lead tile carries the biggest number on the card in a tile 258px wide. */
.d-tile-lead .d-tile-fig { font-size: 27px; letter-spacing: -0.03em; }

/* --- The legend ---------------------------------------------------------- */

.d-legend { list-style: none; margin: 0; padding: 0; }

.d-legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 2.5px 0;
  font-size: 11.5px;
  color: var(--ink-dim);
}

.d-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.d-dot-own { background: var(--own); }
.d-dot-s01 { background: var(--s01); }
.d-dot-solver { background: var(--solver); }
.d-dot-outside { background: var(--outside); }
.d-dot-in { background: var(--in); }
.d-dot-out { background: var(--out); }
.d-dot-internal { background: var(--internal); }
.d-dot-crossing { background: var(--crossing); }
.d-dot-warning { background: var(--warning); }
.d-dot-danger { background: var(--danger); }

/* --- Links --------------------------------------------------------------- */

.d-link, a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 181, 70, 0.3);
  transition: color 120ms ease, border-color 120ms ease;
}

.d-link:hover, a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.d-link:focus-visible, a:focus-visible,
button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* A URL the probe wrote that did not survive the scheme check in detail.js. It
   is named rather than silently dropped, so a broken explorer link is visible
   as a data problem instead of as a missing feature. */
.d-link-dead { color: var(--ink-faint); font-style: italic; }

/* --- The empty card ------------------------------------------------------ */

.d-card-empty .d-head { border-bottom: 0; }

/* --- The hover card ------------------------------------------------------ */

/* Every hv-* class is emitted by flow/site/hover.js, this file's sibling and
   same owner. It is the card that follows the cursor over a point, and it
   exists for one thing Kais asked for: "when I hover over a point, I wanna see
   the transaction hash link on chain and a link for logs".

   That makes the geometry load-bearing rather than cosmetic. The card has to
   be reachable, so it must accept the pointer, and the layer it lives in must
   not, because #stage's comment at the top of this file is exact about it: one
   invisible full-viewport element over the canvas kills hit testing, picking
   and hovering all three. So the layer is a zero-size anchor with no pointer
   events and the card alone takes them back. hover.js sets .hv-layer on the
   container it is handed rather than trusting index.html to carry it. */
.hv-layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  overflow: visible;
  pointer-events: none;
  z-index: 40;
}

body.tour-on .hv-layer { z-index: 19; }

/* Above the panels (they are z-index 20) because a point can be hovered right
   under the edge of one, and below nothing else: there is nothing else.

   Pinned at the origin and moved with a transform, never with left and top,
   and that is a fix rather than a style. A shrink-wrapped fixed element's
   available width is the viewport MINUS its own left, so a card carried
   towards the right edge got narrower as it went, hover.js measured that
   squeezed width, and the flip it computed from it put the card's right edge
   exactly on the viewport's. Measured in the harness on 2026-09-17 at 1000px
   wide: 241px measured against 272px rendered, and the card touched the edge
   it was supposed to be flipping away from. Anchored at left: 0 the width no
   longer depends on the position, so what hover.js measures is what renders.
   width: max-content is what keeps it shrink-wrapped anyway. */
.hv-card-shell {
  position: fixed;
  left: 0;
  top: 0;
  width: max-content;
  max-width: 310px;
  pointer-events: auto;
  z-index: 40;
}

.hv-card {
  min-width: 190px;
  /* Wide enough for a full dollar figure beside its label and narrow enough to
     stay a card rather than become a second panel. */
  max-width: 310px;
  padding: 9px 11px 10px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--panel-solid);
  box-shadow: var(--shadow);
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--ink);
}

/* No blur here, unlike the panels. A panel is a pane of glass the reader looks
   through at a stage they are watching; this card is read, it sits directly on
   top of the moving point that opened it, and a translucent card over its own
   animation was unreadable. */

/* The open ring on the stage means no hedge was found, and the card's own left
   edge repeats it, so a trade that is missing its hedge says so before the
   reader has got as far as the words. */
.hv-card-trade { border-left: 2px solid var(--internal); }
.hv-card-trade.hv-hedged { border-left-color: var(--in); }
.hv-card-trade.hv-open { border-left-color: var(--warning); }
.hv-card-move { border-left: 2px solid var(--crossing); }
.hv-card-node { border-left: 2px solid var(--own); }
.hv-card-node.hv-s01 { border-left-color: var(--s01); }
/* The shares-against-tokens table on an S01 circle's card. Numbers right,
   symbol left, and the same tabular figures as the rest of the card. */
.hv-s01 {
  margin-top: 8px;
  border-collapse: collapse;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.hv-s01 th {
  font-weight: 500;
  color: var(--ink-faint);
  text-align: right;
  padding: 0 0 3px 10px;
  letter-spacing: 0.02em;
}
.hv-s01 td { text-align: right; padding: 1px 0 1px 10px; color: var(--ink-dim); }
.hv-s01 td.hv-sym { text-align: left; padding-left: 0; color: var(--ink); font-weight: 600; }
.hv-s01 th:first-child { text-align: left; padding-left: 0; }

.hv-head {
  padding-bottom: 5px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--edge);
}

.hv-title {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.hv-sub {
  margin-top: 1px;
  font-size: 10.5px;
  color: var(--ink-dim);
}

.hv-row {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  gap: 10px;
  align-items: baseline;
  padding: 1.5px 0;
}

.hv-k {
  color: var(--ink-faint);
  white-space: nowrap;
}

/* Right aligned and tabular so two rows of the card line their figures up,
   and allowed to wrap rather than widen the card past its max-width. */
.hv-v {
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.hv-pos { color: var(--in); }
.hv-neg { color: var(--danger); }

/* The third state of what T0 kept, and the reason it has a colour of its own:
   absent is not zero. Two trades in three never find their Alpaca fill, so
   this is the common case and it reads as a fact rather than as a failure. */
.hv-none { color: var(--warning); opacity: 0.9; }

.hv-unknown { color: var(--ink-faint); font-style: italic; }

.hv-note {
  margin-top: 5px;
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--ink-dim);
}

.hv-hint {
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* The point of the whole card. Given real height and a gap so the two anchors
   are separate targets for a pointer that has just crossed 16px of canvas to
   get here. */
/* The pinned alert popup takes the pointer so its links can be clicked;
   everything else on the layer stays see-through. */
.hv-card-shell.hv-pinned { pointer-events: auto; }
.hv-card-alerts { border-left: 2px solid var(--warning); }
.hv-alert { padding: 6px 0 2px; border-top: 1px solid var(--edge); }
.hv-alert:first-of-type { border-top: 0; }
.hv-alert-head { display: flex; align-items: baseline; gap: 7px; font-size: 12px; }
.hv-alert-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--warning); flex: none; }
.hv-alert-critical .hv-alert-dot { background: var(--danger); }
.hv-alert-meta { color: var(--ink-faint); font-size: 10.5px; margin: 1px 0 0 14px; }
.hv-alert-sub { color: var(--ink-dim); font-size: 11px; margin: 2px 0 0 14px; }
.hv-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px solid var(--edge);
  font-size: 11px;
}

.hv-link {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(240, 181, 70, 0.35);
  padding: 2px 0;
  font-family: var(--mono);
  font-size: 10.5px;
}

.hv-link:hover { color: var(--ink); border-bottom-color: var(--ink); }

/* A URL that did not survive the scheme check in hover.js, or a hash with no
   explorer link to hang it on (a money move has hashes and no explorer URL).
   Named rather than dropped, so a bad link is visible as a data problem
   instead of as a missing feature. */
.hv-link-dead {
  color: var(--ink-faint);
  font-style: italic;
  font-family: var(--mono);
  font-size: 10.5px;
}

/* Narrow screens: the card is placed by hover.js, which flips it away from the
   near edge, but on a phone-width viewport there is no side to flip to. Cap it
   against the viewport instead so it can never be wider than the screen. */
@media (max-width: 420px) {
  .hv-card-shell { max-width: calc(100vw - 20px); }
  .hv-card { max-width: calc(100vw - 20px); min-width: 0; }
}

/* --- The timeline and the trade picker ----------------------------------- */

/* Every tl-* class below is emitted by flow/site/timeline.js, which is a
   different module with a different owner. The first pass here was written
   against the names in the module contract and most of them were wrong, so
   these were read off the live DOM and out of shell(), pickerShell(),
   buildStrip() and buildRows() on 2026-09-17. Two traps in there:

     unhedged is BOTH a class of its own (.tl-unhedged) and the absence of
     .tl-hedged, depending on which reading of that module you trust, so the
     hollow look is matched both ways. Two trades in three land here, so getting
     it wrong would mis-draw the majority of the strip.

     a money move is .tl-movemark and is deliberately not a trade: no symbol, no
     side, nothing T0 kept. It is drawn below the baseline as a notch so a
     bridge crossing can never be counted as trading. */

.tl-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 11px;
  color: var(--ink-faint);
  padding-bottom: 5px;
}

.tl-count { color: var(--ink-dim); }

/* The dot between the clock's parts. Quiet, but present: the transport reads
   "live . 08:38:54 . 3m behind the chain" and the separators are what keep
   those three facts from running together. */
.tl-sep { color: var(--ink-faint); opacity: 0.55; }
.tl-hover { flex: 1 1 auto; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* These two carry facts a reader acts on, not decoration: the clock says how
   far behind the chain the board is (about 4 minutes, because probe.py holds
   each trade for HEDGE_WAIT_SECONDS = 150 waiting for its Alpaca fill) and the
   note says how long the window takes to replay. At 11px that means --ink-dim,
   not the faintest ink on the page. */
.tl-clock {
  margin-left: auto;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

.tl-strip {
  position: relative;
  /* 44px, matching the min-height timeline.js injects for itself. The shell
     shortens it on a short screen, and lifts that min-height to do so. */
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(148, 176, 214, 0.07), rgba(148, 176, 214, 0.02));
  border: 1px solid rgba(148, 176, 214, 0.1);
  cursor: crosshair;
  overflow: hidden;
}

/* The baseline the ticks stand on, so an empty strip still reads as a scale
   rather than as a blank box. */
.tl-strip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 9px;
  height: 1px;
  background: rgba(148, 176, 214, 0.16);
}

/* Geometry only, and additive: timeline.js positions each tick with an inline
   left percentage, so all this has to do is give those percentages a box to be
   a percentage OF. Measured at 688 x 0 before this rule existed. */
.tl-ticks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* Centring is translateX(-50%), not a negative margin, because that is the
   convention timeline.js injects for itself and its inline left percentage is
   computed against it. Anything here that sets `transform` has to carry the
   translate along or the tick jumps sideways by half its width. */
.tl-tick {
  position: absolute;
  bottom: 9px;
  width: max(1px, calc(var(--tw, 3px) * var(--tick-density, 1)));
  border-radius: 2px 2px 0 0;
  transform: translateX(-50%);
  pointer-events: auto;
  cursor: pointer;
  transition: transform 110ms ease, opacity 110ms ease;
}

/* At 24h the strip carries about 400 ticks across roughly 1130px, which at full
   width reads as one solid band and says nothing about when anything happened.
   Halving the width at the two widest pills buys the gaps back without touching
   the heights, so the magnitude channel survives. The multiplier rides down the
   cascade as a custom property, which is why there is one rule here instead of
   ten. :has() on the pills is the only link between the window and the strip;
   where it is unsupported the whole selector is ignored and ticks stay full
   width, which is exactly the behaviour without this rule. */
body:has(#windows button.on:is([data-window="6h"], [data-window="24h"], [data-window="7d"])) {
  --tick-density: 0.5;
}

/* Size on the magnitude ladder timeline.js already computes (bucketFor: under
   $50, under $250, under $1k, under $10k, over). The same strip carries a $50
   taker trade and a $70,000 rebalance, so a linear scale would draw the trade
   as one pixel. Width as well as height, because that module's own width ladder
   goes through :where() and loses to any plain rule in this file: setting only
   the heights here would flatten every tick to one width and throw away half
   the channel. Heights are shares of the strip above its baseline (7 to 30px
   on the full 44px strip), so a strip shortened for a short screen keeps the
   ladder instead of clipping its top rungs. */
.tl-mag-1 { --tw: 3px; height: calc((100% - 11px) * 7 / 33); }
.tl-mag-2 { --tw: 4px; height: calc((100% - 11px) * 12 / 33); }
.tl-mag-3 { --tw: 5px; height: calc((100% - 11px) * 18 / 33); }
.tl-mag-4 { --tw: 7px; height: calc((100% - 11px) * 24 / 33); }
.tl-mag-5 { --tw: 9px; height: calc((100% - 11px) * 30 / 33); }

/* A hedge was found: solid, in the colour of money arriving. */
.tl-trade.tl-hedged {
  background: var(--in);
  opacity: 0.8;
}

/* No hedge found within the wait. Hollow, never absent: it happened, and two in
   three look like this. Matched both ways, because that module says so twice. */
.tl-trade.tl-unhedged,
.tl-trade:not(.tl-hedged) {
  background: transparent;
  border: 1px solid var(--warning);
  border-bottom: 0;
  opacity: 0.9;
}

/* Not a trade. A notch hanging from the TOP of the strip, in the crossing
   colour, following the channel timeline.js chose: trades grow up from the
   baseline, money moves hang down from the ceiling, and the two can never be
   read as one population. top and bottom are both stated because leaving either
   to that module's :where() fallback stretches the notch the full height. */
.tl-movemark {
  top: 3px;
  bottom: auto;
  --tw: 2px;
  height: 9px;
  border-radius: 0 0 2px 2px;
  background: var(--crossing);
  opacity: 0.7;
}

.tl-tick:hover { transform: translateX(-50%) scaleX(2.2); opacity: 1; }

/* The pinned trade. The accent marks exactly one thing at a time on this page,
   and this is it. */
.tl-tick.tl-on {
  background: var(--accent);
  border-color: var(--accent);
  opacity: 1;
  box-shadow: 0 0 8px rgba(240, 181, 70, 0.8);
  transform: translateX(-50%) scaleX(2.2);
}

.tl-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  transform: translateX(-50%);
  background: var(--accent);
  box-shadow: 0 0 9px rgba(240, 181, 70, 0.75);
  pointer-events: none;
}

.tl-playhead::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--accent);
}

/* --- The scrubber --------------------------------------------------------- */

/* A native range input renders as a bright blue slider that belongs to nobody's
   palette, which is what it was still doing on the live page on 2026-09-17.
   Both vendor prefixes are needed: a rule with an unknown pseudo-element in its
   selector list is dropped whole, so they cannot be combined. */
.tl-scrub {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  height: 16px;
  margin: 3px 0 5px;
  background: transparent;
  cursor: pointer;
}

.tl-scrub::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 3px;
  background: rgba(148, 176, 214, 0.2);
}

.tl-scrub::-moz-range-track {
  height: 3px;
  border-radius: 3px;
  background: rgba(148, 176, 214, 0.2);
}

.tl-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  margin-top: -5px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 181, 70, 0.18);
}

.tl-scrub::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(240, 181, 70, 0.18);
}

/* The thumb is the only control here that is dragged rather than clicked, so it
   keeps a focus ring a keyboard can see. */
.tl-scrub:focus-visible { outline: none; }
.tl-scrub:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px rgba(240, 181, 70, 0.18), 0 0 0 5px var(--accent);
}
.tl-scrub:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px rgba(240, 181, 70, 0.18), 0 0 0 5px var(--accent);
}

/* --- The transport -------------------------------------------------------- */

.tl-transport {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--ink-dim);
  white-space: nowrap;
}

.tl-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: rgba(148, 176, 214, 0.09);
  color: var(--ink-dim);
  font: inherit;
  font-size: 11px;
  line-height: 1;
  padding: 6px 9px;
  border-radius: 7px;
  cursor: pointer;
  transition: color 110ms ease, background 110ms ease, border-color 110ms ease;
}

.tl-btn:hover { color: var(--ink); background: rgba(148, 176, 214, 0.16); }

/* tl-on is one shared class on five different elements (a row, a tick, and
   three of these buttons), so every rule for it is scoped to what it is on.
   This is the base for the buttons; play, speed and live refine it below. */
.tl-btn.tl-on {
  background: var(--accent-soft);
  border-color: var(--edge-hi);
  color: var(--accent);
}

.tl-play { min-width: 34px; }
.tl-speed { min-width: 34px; font-variant-numeric: tabular-nums; }
.tl-speed.tl-on { color: var(--accent); border-color: var(--edge-hi); background: var(--accent-soft); }

.tl-play.tl-on {
  background: var(--accent-soft);
  border-color: var(--edge-hi);
  color: var(--accent);
}

.tl-live {
  margin-left: 2px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tl-live.tl-on {
  background: rgba(95, 208, 143, 0.15);
  border-color: rgba(95, 208, 143, 0.4);
  color: var(--live);
}

/* Live pulses, because a page keeping up and a page that has stalled look
   identical while nothing is moving. */
.tl-live.tl-on::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  margin-right: 6px;
  vertical-align: 0;
  animation: flow-pulse 2.4s ease-in-out infinite;
}

.tl-note {
  margin-left: auto;
  font-size: 11px;
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
}

.tl-note:empty { display: none; }

/* --- The picker list ------------------------------------------------------ */

/* The selector Kais said he could not find. One row per trade in the window,
   newest first, so a window holding 67 trades (measured in one market hour on
   2026-09-16) can have one of them singled out. */

.tl-picker-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--edge);
}

.tl-picker-title {
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
}

.tl-picker-hint {
  font-size: 11px;
  color: var(--ink-faint);
}

.tl-rows {
  list-style: none;
  margin: 0;
  padding: 0;
}

.tl-row-wrap { margin: 1px 0; }

/* The row is a real <button>, which is right for something clicked and reached
   by keyboard, and wrong by default for something laid out in a grid. */
.tl-row {
  appearance: none;
  -webkit-appearance: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1px 8px;
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  padding: 6px 8px;
  cursor: pointer;
  transition: background 110ms ease, border-color 110ms ease;
}

.tl-row:hover { background: rgba(255, 255, 255, 0.05); }

.tl-row.tl-on {
  background: var(--accent-soft);
  border-left-color: var(--accent);
}

.tl-row-t { grid-area: 1 / 1; color: var(--ink-faint); font-size: 11px; font-variant-numeric: tabular-nums; }

/* The symbol gives way, and the figure does not. Both columns beside it are
   `auto` in a 284px panel, so now that dollars are written out in full rather
   than shortened to K a $1,234,567.89 rebalance takes the width it needs and
   something has to yield. The symbol is the thing that can: it is four letters
   and the trade is already identified by its row. Without this the figure was
   the side that got squeezed, which is the one thing in the row that must stay
   readable. */
.tl-row-sym {
  grid-area: 1 / 2;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tl-row-usd { grid-area: 1 / 3; font-variant-numeric: tabular-nums; white-space: nowrap; }

.tl-row-side { grid-area: 2 / 2; font-size: 10.5px; }
.tl-bought { color: var(--out); }
.tl-sold { color: var(--in); }

.tl-row-kept { grid-area: 2 / 3; font-size: 10.5px; font-variant-numeric: tabular-nums; }

/* The three states of what T0 kept, in the picker as in the detail card: a
   gain, a loss, and nobody knows yet. The third is not a zero. */
.tl-kept-up { color: var(--in); }
.tl-kept-down { color: var(--danger); }
.tl-kept-none { color: var(--warning); opacity: 0.85; }

/* Three states again, and for the same reason: a window still being read, a
   window read and genuinely quiet, and a window with trades in it. The old
   page's "WHAT HAPPENED . NOTHING" read to Kais as a broken page. */
.tl-empty {
  margin: 10px 0 0;
  padding: 12px 6px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-faint);
  text-align: center;
}

.tl-empty:empty { display: none; }
.tl-empty.tl-quiet { color: var(--ink-dim); }

.tl-empty.tl-loading::after {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  margin: 8px auto 0;
  border-radius: 2px;
  background: var(--accent);
  animation: flow-pulse 1.2s ease-in-out infinite;
}

@keyframes flow-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* --- Reduced motion ------------------------------------------------------ */

/* Every transition and keyframe above is decoration. The canvas animation is
   the content and is the stage's own business, so this only turns off the
   chrome. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .tl-tick:hover { transform: none; }
}

@media (max-width: 820px) {
  #top .hud { border-left: 0; padding-left: 0; gap: 8px 18px; }
  .d-score { grid-template-columns: 1fr; }
}

/* The symbol chips, between the header and the trade list on the left, in
   the window pills' dress. */
/* The chain chips share the symbols' styling and sit one line above them. */
#chains {
  z-index: 6;
  padding: 4px 8px;
  display: flex;
  flex-wrap: nowrap;
  white-space: nowrap;
  align-items: center;
  gap: 2px 2px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  backdrop-filter: blur(10px);
}
#chains .nav-label { font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-right: 3px; }
#chains button { appearance: none; border: 1px solid transparent; background: none; border-radius: 999px; color: var(--ink-dim); font: inherit; font-size: 10px; padding: 1px 6px; cursor: pointer; }
#chains button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
#chains button.on { background: var(--accent-soft); border-color: var(--edge-hi); color: var(--accent); }

#symbols {
  z-index: 5;
  max-height: 64px;
  overflow-y: auto;
  padding: 6px 9px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 4px;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: var(--r);
  backdrop-filter: blur(10px);
}
#symbols .nav-label {
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-right: 4px;
}
#symbols button {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-dim);
  font: inherit;
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
}
#symbols button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
#symbols button.on { background: var(--accent-soft); border-color: var(--edge-hi); color: var(--accent); }

.d-tile-sub { margin-top: 4px; font-size: 10.5px; color: var(--ink-faint); }

/* The day's curve under a hovered header figure. */
#spark {
  position: fixed;
  z-index: 40;
  width: 300px;
  padding: 9px 11px 10px;
  background: var(--panel-solid);
  border: 1px solid var(--edge);
  border-radius: 10px;
  box-shadow: var(--shadow);
  pointer-events: none;
}
#spark .spark-title { font-size: 11px; color: var(--ink); font-weight: 600; }
#spark .spark-sub { font-size: 11px; color: var(--ink-dim); margin-top: 1px; font-variant-numeric: tabular-nums; }
#spark svg { display: block; margin-top: 6px; }
#spark .spark-row { display: flex; justify-content: space-between; gap: 14px; margin-top: 5px; font-size: 11px; }
/* Every S01 symbol on one hover card: two columns, wider, smaller type. */
#spark.spark-dense { width: 640px; }
#spark.spark-dense .spark-rows { column-count: 2; column-gap: 22px; }
#spark.spark-dense .spark-row { font-size: 10.5px; margin-top: 3px; break-inside: avoid; }
#spark .spark-k { color: var(--ink-dim); }
#spark .spark-swatch { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; opacity: 0.85; }
#spark .spark-v { color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
#spark .spark-foot { margin-top: 4px; font-size: 10.5px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
#top .hud-cell.hud-spread { cursor: default; }

/* A card's address rows for the chains that were not clicked, and the chain
   word after a registry link. */
.d-row.d-dim, .d-v.d-dim { opacity: 0.55; }
.d-addr-chain { color: var(--ink-faint); font-size: 10.5px; }

/* A place on several chains: one tab per chain at the top of its card. */
.d-tabs { display: flex; gap: 4px; margin: 6px 0 8px; }
.d-tab { appearance: none; background: none; border: 1px solid var(--edge); border-radius: 999px; color: var(--ink-dim); font: inherit; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; cursor: pointer; }
.d-tab:hover { color: var(--ink); }
.d-tab.on { color: var(--ink); border-color: var(--edge-hi); background: var(--accent-soft); }

/* The one sentence at the top of a place's card. */
.d-desc { margin: 4px 0 10px; font-size: 12.5px; line-height: 1.45; color: var(--ink); }

/* S01's header, top right, in the same dress as T0's. */
#top-s01 { padding: 12px 18px 11px; display: flex; gap: 26px; align-items: center; }
#top-s01 .brand h1 { margin: 0; font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--s01); }
#top-s01 .brand .sub { margin: 2px 0 0; font-size: 11px; color: var(--ink-faint); }
#top-s01 .hud { display: flex; gap: 8px 24px; border-left: 1px solid var(--edge); padding-left: 24px; }
#top-s01 .figure { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ink); }
#top-s01 .figure.s01 { color: var(--s01); }
#top-s01 .figure.ok { color: var(--in); }
#top-s01 .figure.warn { color: var(--warning); }
#top-s01 .figure.bad { color: var(--danger); }
#top-s01 .figure.muted { color: var(--ink-faint); }
#top-s01 .caption { margin-top: 2px; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }
/* The solver's day, bottom left, in the header's own dress: a cell per
   figure (Kais, 2026-09-19: "should be the same format as this"). */
#solver-box { padding: 12px 18px 11px; }
#solver-box .hud { display: flex; flex-wrap: wrap; gap: 8px 24px; }
#solver-box .figure { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.1; color: var(--ink); }
#solver-box .figure.solver { color: var(--solver); }
#solver-box .caption { margin-top: 2px; font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); white-space: nowrap; }

/* The expander for a place's wallet list. */
.d-expand { appearance: none; background: var(--panel-lift); border: 1px solid var(--edge); border-radius: 999px; color: var(--ink-dim); font: inherit; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 10px; cursor: pointer; margin: 2px 0 6px; }
.d-expand:hover, .d-expand.on { color: var(--ink); border-color: var(--edge-hi); }

/* What a leg is doing, under its label on the card. */
.d-leg-why { font-size: 11px; color: var(--ink-dim); margin-top: 1px; }

/* --- The tour: a spotlight and a card --------------------------------- */
.tour { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.tour-hole {
  position: absolute; border-radius: 14px;
  box-shadow: 0 0 0 9999px rgba(4, 7, 13, 0.42), 0 0 0 2px var(--accent), 0 0 24px rgba(240, 181, 70, 0.35);
  transition: width 0.25s, height 0.25s;
}
.tour-card {
  position: absolute; pointer-events: auto;
  background: var(--panel-solid); border: 1px solid var(--edge-hi); border-radius: var(--r);
  box-shadow: var(--shadow); padding: 14px 16px 12px; color: var(--ink);
}
.tour-step { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); }
.tour-title { margin: 4px 0 6px; font-size: 15px; font-weight: 600; letter-spacing: 0.01em; }
.tour-text { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-dim); }
.tour-nav { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.tour-nav button { appearance: none; font: inherit; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 999px; padding: 5px 12px; cursor: pointer; }
.tour-skip { margin-right: auto; background: none; border: 0; color: var(--ink-faint); padding-left: 0 !important; }
.tour-skip:hover { color: var(--ink); }
.tour-never { background: none; border: 0; color: var(--ink-faint); padding-left: 0 !important; }
.tour-never:hover { color: var(--ink); }
.tour-back { background: none; border: 1px solid var(--edge); color: var(--ink-dim); }
.tour-next { background: var(--accent-soft); border: 1px solid rgba(240, 181, 70, 0.5); color: var(--accent); }
.tour-next:hover, .tour-next:focus { color: var(--ink); border-color: var(--accent); outline: none; }

/* An interactive tour step: what it is waiting for, beside the buttons. */
.tour-hint { font-size: 10.5px; letter-spacing: 0.06em; color: var(--ink-faint); margin-right: 8px; }
.tour-hint.tour-done { color: var(--ok, #4bd28f); }
.tour-hint.tour-done::before { content: '\2713  '; }

.tour-try { margin-top: 6px; font-size: 11px; color: var(--ink-faint); }

.tour-play { margin-right: 4px; }

/* --- Who is reading -------------------------------------------------------- */
#who .profile { position: relative; border-left: 1px solid var(--edge); padding-left: 12px; margin-left: -10px; align-self: stretch; display: flex; align-items: center; }
/* The display above beats the UA's [hidden] rule, so until report/me says
   who is reading (or when it cannot), the pill would sit there empty. Found
   by tests/layout.spec.js, which measured a 38px pill holding an ellipsis. */
#who .profile[hidden] { display: none; }
.profile-pill { appearance: none; background: none; border: 1px solid var(--edge); border-radius: 999px; padding: 3px 9px 3px 7px; color: var(--ink-faint); font: inherit; font-size: 10px; letter-spacing: 0.03em; cursor: pointer; display: flex; align-items: center; gap: 5px; max-width: 150px; }
.profile-pill:hover { color: var(--ink); border-color: var(--edge-hi); }
.profile-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--in); flex: none; }
.profile-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* While the menu is open the header goes above the sheets: it has a
   stacking context of its own, so the menu's z-index cannot get out on its
   own (Arda, 2026-09-24: on a phone the sheet covered log out and the
   theme). Above the side sheet, the card and the chat; below the tour, the
   loupe and find, which are meant to cover everything. */
#who.profile-open { z-index: 50; }
.profile-menu { position: absolute; top: calc(100% + 10px); right: 0; min-width: 220px; background: var(--panel-solid); border: 1px solid var(--edge-hi); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px 12px; z-index: 30; overflow-y: auto; box-sizing: border-box; }
.profile-name { font-size: 12px; font-weight: 600; margin-bottom: 8px; }
.profile-cap { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin: 6px 0 4px; }
.profile-groups { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11px; color: var(--ink-dim); margin-bottom: 8px; }
.profile-group { border: 1px solid var(--edge); border-radius: 999px; padding: 1px 8px; }
.profile-item { display: block; width: 100%; text-align: left; appearance: none; background: none; border: 0; border-top: 1px solid var(--edge); padding: 7px 0; color: var(--ink-dim); font: inherit; font-size: 11.5px; cursor: pointer; text-decoration: none; }
.profile-item:hover { color: var(--ink); }
.profile-item[hidden] { display: none; }
/* Three settings, one row: system follows the machine, the other two do not. */
.profile-identities { font-size: 11px; color: var(--ink-dim); margin-bottom: 8px; }
.profile-identity { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 2px 0; }
.profile-identity-org { color: var(--ink); }
.profile-identity-who { color: var(--ink-dim); }
.profile-signin { appearance: none; background: none; border: 1px solid var(--edge); border-radius: 999px; padding: 1px 8px; color: var(--ink-dim); font: inherit; font-size: 11px; cursor: pointer; }
.profile-signin:hover { color: var(--ink); border-color: var(--edge-hi); }
.profile-identity { flex-wrap: wrap; }
.profile-identity-why { flex-basis: 100%; font-size: 10.5px; color: var(--bad, #d9534f); }
.profile-theme { display: flex; gap: 4px; padding: 2px 0 8px; }
.profile-theme button {
  appearance: none; border: 1px solid var(--edge); background: none; color: var(--ink-dim);
  font: inherit; font-size: 11px; border-radius: 999px; padding: 2px 10px; cursor: pointer;
}
.profile-theme button:hover { color: var(--ink); border-color: var(--edge-hi); }
.profile-theme button.on { color: var(--accent); border-color: var(--edge-hi); background: var(--accent-soft); }

/* --- Light theme ------------------------------------------------------------
   The same tokens, a daylight set. stage.js re-reads them on the switch
   (Stage.retheme). Kais, 2026-09-20: "theme dark/light". */
:root[data-theme="light"] {
  --ground: #f3f5f9;
  --ground-lift: #e8ecf3;
  --ink: #101522;
  --ink-dim: #46536a;
  --ink-faint: #6b7890;
  --panel: rgba(255, 255, 255, 0.74);
  --panel-lift: rgba(255, 255, 255, 0.88);
  --panel-solid: rgba(250, 251, 253, 0.98);
  --edge: rgba(20, 40, 80, 0.14);
  --edge-hi: rgba(183, 121, 31, 0.55);
  --accent: #b7791f;
  --accent-soft: rgba(183, 121, 31, 0.12);
  --shadow: 0 12px 32px rgba(20, 30, 50, 0.16);
  --t0: #2f6fdb;
  --own: #2f6fdb;
  --outside: #5f6c80;
  --s01: #7a4fd6;
  --solver: #d6338c;
  --usdc: #2775ca;
  --usd: #2f7a48;
  --in: #1f9a52;
  --out: #d9622a;
  --internal: #5a6f9c;
  --crossing: #2a8ea8;
  --warning: #b58900;
  --danger: #d23f34;
  --live: #1f9a52;
}
:root[data-theme="light"] #stage { background: radial-gradient(ellipse at 50% 40%, #ffffff 0%, #eef1f6 55%, #e4e8ef 100%); }
:root[data-theme="light"] .tour-hole { box-shadow: 0 0 0 9999px rgba(230, 234, 240, 0.55), 0 0 0 2px var(--accent), 0 0 24px rgba(183, 121, 31, 0.3); }
:root[data-theme="light"] .tour-next { border-color: rgba(183, 121, 31, 0.6); }
.profile-group.profile-ws { border-color: rgba(47, 111, 219, 0.5); }
/* No source prefix on a group: the Zulip user groups mirror the team's real
   groups (Kais, 2026-09-20: "only zulip-admins, the rest are not zulip"). */

/* --- Kill switch, symbols, handover, ack ------------------------------------ */
.ks-intro { font-size: 11.5px; color: var(--ink-dim); margin: 6px 0 10px; line-height: 1.45; }
.ks-sign, .side-btn { appearance: none; font: inherit; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 6px 12px; cursor: pointer; background: var(--accent-soft); border: 1px solid rgba(240, 181, 70, 0.5); color: var(--accent); margin-bottom: 10px; }
.ks-card { border: 1px solid var(--edge); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.ks-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.ks-name { font-weight: 600; }
.ks-proj { font-size: 10.5px; color: var(--ink-faint); font-family: var(--mono); }
.ks-note { font-size: 11px; color: var(--ink-faint); }
.ks-svc { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; }
.ks-svc-name { font-family: var(--mono); font-size: 11.5px; }
.ks-svc-state { color: var(--ink-faint); flex: 1; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ks-stop { appearance: none; font: inherit; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; cursor: pointer; background: rgba(238, 94, 83, 0.12); border: 1px solid rgba(238, 94, 83, 0.55); color: var(--danger); }
.ks-stop:disabled { opacity: 0.45; cursor: default; }
.ks-go { padding: 6px 14px; }
.ks-cancel { appearance: none; font: inherit; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 6px 12px; cursor: pointer; background: none; border: 1px solid var(--edge); color: var(--ink-dim); }
.ks-confirm { margin-top: 8px; padding: 10px; border: 1px solid rgba(238, 94, 83, 0.45); border-radius: 8px; background: rgba(238, 94, 83, 0.06); }
.ks-warn { font-size: 11.5px; line-height: 1.45; color: var(--ink); margin-bottom: 8px; }
.ks-input, .side-input { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 12px; color: var(--ink); background: var(--panel-lift); border: 1px solid var(--edge); border-radius: 6px; padding: 6px 8px; margin-bottom: 6px; }
.ks-why, .side-input { min-height: 54px; resize: vertical; }
.ks-row { display: flex; gap: 8px; justify-content: flex-end; }
.ks-err { color: var(--danger); font-size: 11px; margin-top: 6px; }
.ks-busy { color: var(--warning); font-size: 11px; }
.ks-uses { margin-top: 10px; }
.ks-cap, .side-cap { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-faint); margin: 8px 0 4px; }
.ks-use { font-size: 11px; color: var(--ink-dim); padding: 2px 0; border-top: 1px solid var(--edge); }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-sym { padding: 6px 0; border-top: 1px solid var(--edge); }
.side-sym-head { display: flex; align-items: center; gap: 8px; }
.side-sym-name { font-size: 12.5px; }
.side-sym-meta { font-size: 11px; color: var(--ink-faint); }
.side-sym-sub { font-size: 11px; color: var(--ink-dim); margin: 2px 0 0 15px; }
.side-sym-issues { font-size: 11px; color: var(--warning); margin: 2px 0 0 15px; }
.side-ack { appearance: none; font: inherit; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 2px 8px; cursor: pointer; background: none; border: 1px solid var(--edge); color: var(--ink-dim); margin-left: auto; }
.side-ack:hover { color: var(--ink); border-color: var(--edge-hi); }
.side-ack:disabled { opacity: 0.6; cursor: default; }
.profile-oncall { font-size: 11.5px; color: var(--ink-dim); margin-bottom: 6px; }
.profile-oncall.on { color: var(--in); }
.ks-start { background: rgba(95, 208, 143, 0.12); border-color: rgba(95, 208, 143, 0.55); color: var(--in); }

/* --- Phone -------------------------------------------------------------------
   The shell's phone grid places the regions (see "The shell" below); these
   are what the panels look like inside them. Every rule here overrides a
   desktop rule above and only at 820px and below, so the desktop layout is
   untouched; tests/layout.spec.js holds both views to that.
   Kais, 2026-09-20: "adapt the entire website to phone". */
@media (max-width: 820px) {
  #top {
    padding: 8px 10px 7px; gap: 6px;
    flex-direction: row; flex-wrap: nowrap; align-items: center;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #top::-webkit-scrollbar { display: none; }
  #top .brand { flex: none; padding-right: 10px; border-right: 1px solid var(--edge); }
  #top .brand h1 { font-size: 11px; letter-spacing: 0.12em; }
  #top .brand p { display: none; }
  #top .hud { flex: none; flex-wrap: nowrap; gap: 0 16px; border-left: 0; padding-left: 0; }
  #top .hud-cell { flex: none; }
  #top .figure, #top strong, #top b { font-size: 16px; }
  #top .caption { font-size: 8.5px; white-space: nowrap; }
  /* S01's cells carry on the header row after T0's, in S01's colour, with
     the profile pill last. */
  #top-s01 { display: flex; padding: 0; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; gap: 10px; z-index: 26; }
  #top-s01 .hud { flex: none; flex-wrap: nowrap; gap: 0 16px; padding: 8px 10px 7px; border: 1px solid var(--edge); border-left: 2px solid var(--s01); border-radius: var(--r); background: var(--panel); }
  #top-s01 .hud-cell { flex: none; }
  #top-s01 .caption { color: var(--s01); white-space: nowrap; }
  #who .profile { border-left: 0; padding-left: 0; margin-left: 0; }
  .profile-pill { max-width: 110px; padding: 3px 8px; background: var(--panel-solid); }
  .profile-menu { right: 0; left: auto; min-width: 200px; max-width: calc(100vw - 24px); }
  /* The chip rows: one line each, scrolling sideways. */
  #chains, #symbols {
    flex: none;
    flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; white-space: nowrap;
  }
  #chains::-webkit-scrollbar, #symbols::-webkit-scrollbar { display: none; }
  #scrub { padding: 6px 10px 8px; }
  #timeline .tl-rows, #timeline .tl-list { display: none; }
  /* The window pills: one scrolling line on the timeline's lid. */
  #windows {
    justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 5px 8px;
  }
  #windows::-webkit-scrollbar { display: none; }
  #side .side-head { padding: 7px 12px; }
  /* Reports, hovers and the tour fit the width. */
  #report .rp-card, #ask .rp-card, .find-card { width: auto; }
  .hv-card-shell, .hv-card { max-width: calc(100vw - 16px); }
  .tour-card { max-height: 54vh; overflow: auto; }
  /* A capped card scrolls; its buttons stay in reach at its foot. */
  .tour-nav { flex-wrap: wrap; position: sticky; bottom: -12px; margin-bottom: -12px; padding: 6px 0 12px; background: var(--panel-solid); }
  .ks-svc { flex-wrap: wrap; }
}


/* --- The config a service runs --------------------------------------------- */
.svc-config { grid-area: cfg; justify-self: end; align-self: center; font-size: 9.5px; letter-spacing: 0.1em; text-transform: uppercase; border-radius: 999px; padding: 1px 8px; cursor: pointer; background: none; border: 1px solid var(--edge); color: var(--ink-faint); }
.svc-config:hover { color: var(--ink); border-color: var(--edge-hi); }
.cfg-kv { display: grid; grid-template-columns: max-content 1fr; gap: 3px 12px; font-size: 11.5px; margin: 6px 0 10px; }
.cfg-kv dt { color: var(--ink-faint); } .cfg-kv dd { margin: 0; font-family: var(--mono); font-size: 11px; word-break: break-all; }
.cfg-pre { margin: 0; padding: 10px 12px; background: var(--ground-lift); border: 1px solid var(--edge); border-radius: 8px; font-family: var(--mono); font-size: 11px; line-height: 1.5; white-space: pre; overflow: auto; max-height: 52vh; color: var(--ink); }
.cfg-pre .k { color: var(--t0); } .cfg-pre .s { color: var(--in); } .cfg-pre .n { color: var(--warning); } .cfg-pre .c { color: var(--ink-faint); } .cfg-pre .h { color: var(--s01); font-weight: 600; }
.cfg-note { font-size: 11.5px; color: var(--ink-dim); line-height: 1.45; margin: 6px 0; }
.cfg-warn { font-size: 11.5px; color: var(--warning); margin: 6px 0; }
.cfg-actions { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.cfg-actions button { appearance: none; font: inherit; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 4px 10px; cursor: pointer; background: var(--accent-soft); border: 1px solid rgba(240, 181, 70, 0.5); color: var(--accent); }
.cfg-actions button.quiet { background: none; border-color: var(--edge); color: var(--ink-dim); }
.svc-version { font-family: var(--mono); font-size: 10px; font-weight: 400; color: var(--ink-faint); border: 1px solid var(--edge); border-radius: 4px; padding: 0 5px; margin-left: 6px; white-space: nowrap; vertical-align: 1px; }
.cfg-pre .sp { display: inline-block; width: 100%; background: rgba(240, 181, 70, 0.14); box-shadow: -12px 0 0 rgba(240, 181, 70, 0.14), 12px 0 0 rgba(240, 181, 70, 0.14); color: var(--accent); }
.cfg-spread-note { color: var(--accent); }

/* --- The side panel as a menu ----------------------------------------------
   Rows are the menu; a row's content opens to the RIGHT of it like a
   submenu, never down between the rows (Kais, 2026-09-20: "if I click on
   something you should open the sub folder to the right just like a
   menu, not expand down"). The collapse button folds the menu to a rail
   of dots at the left edge. The phone keeps its stacked sheet below. */
#side .side-body:not([hidden]) {
  position: absolute; left: calc(100% + 8px); top: 0;
  width: 380px; max-height: 100%; overflow-y: auto;
  background: var(--panel-solid); border: 1px solid var(--edge); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 8px 12px 10px; z-index: 1;
}
#side .side-row { position: static; }
#side .side-head.on { background: var(--panel-lift); }
#side .side-head.on .side-chev { transform: rotate(-45deg); }
#side-collapse {
  appearance: none; font: inherit; border: 0; background: none; color: var(--ink-faint); cursor: pointer;
  display: flex; align-items: center; justify-content: flex-end; gap: 6px; width: 100%; padding: 5px 10px 4px;
  font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; border-bottom: 1px solid var(--edge);
}
#side-collapse:hover { color: var(--ink); }
#side-collapse .arr { width: 6px; height: 6px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
#side.rail { width: 44px; }
#side.rail .side-name, #side.rail .side-n, #side.rail .side-chev, #side.rail #side-collapse .lbl { display: none; }
#side.rail .side-head { justify-content: center; padding: 11px 0; }
#side.rail #side-collapse { justify-content: center; }
#side.rail #side-collapse .arr { transform: rotate(-135deg); }
#side.rail .side-dot.none { visibility: visible; background: transparent; border: 1px solid var(--edge); }
@media (max-width: 820px) {
  #side { -webkit-overflow-scrolling: touch; }
  /* Open, only the open row shows, its head being the way back, and its
     content scrolls inside the sheet. */
  #side:not(.closed) .side-row:not(.row-open) { display: none; }
  #side .side-row.row-open { flex: 0 1 auto; min-height: 0; }
  #shell.side-open #chains, #shell.side-open #symbols { display: none; }
  #side.rail { width: auto; }
  #side.rail .side-name, #side.rail .side-n, #side.rail .side-chev { display: inline; }
  #side .side-body:not([hidden]) { position: static; width: auto; left: auto; max-height: none; background: none; border: 0; border-top: 1px solid var(--edge); border-radius: 0; box-shadow: none; padding: 2px 12px 10px; }
  #side-collapse { display: none; }
}
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

/* A shared link naming a service's config: its button asks to be clicked,
   because the card itself needs the reader's own token and a popup on load
   would be blocked. */
.svc-config.flash { border-color: var(--accent); color: var(--accent); animation: cfgflash 1.2s ease-in-out infinite; }
@keyframes cfgflash { 0%, 100% { box-shadow: 0 0 0 0 rgba(212, 175, 90, 0); } 50% { box-shadow: 0 0 0 4px rgba(212, 175, 90, 0.18); } }

/* ------------------------------------------------------------------ chat
   The on-call topic, mirrored on the page: bottom left, above the strip, a
   pill until somebody opens it, and never wider than a column of talk. */
.chat { position: relative; z-index: 46; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
body.tour-on .chat { display: none; }
body.tour-on.tour-chat .chat { display: flex; }
.chat-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 999px;
  background: var(--panel-solid); border: 1px solid var(--edge); color: var(--ink-dim); font: inherit; font-size: 12px;
  letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
.chat-pill:hover { color: var(--ink); border-color: var(--edge-hi); }
.chat-dot { min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--accent);
  color: #17140c; font-size: 11px; line-height: 17px; text-align: center; letter-spacing: 0; }
.chat-card { display: none; width: 330px; max-width: calc(100vw - 32px); background: var(--panel-solid); backdrop-filter: blur(8px);
  border: 1px solid var(--edge); border-radius: 12px; overflow: hidden; box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
.chat.open .chat-card { display: block; }
.chat.open .chat-pill { display: none; }
.chat-head { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--edge); }
.chat-title { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink); }
.chat-sub { font-size: 11px; color: var(--ink-faint); flex: 1; }
.chat-shut { background: none; border: 0; color: var(--ink-faint); font-size: 16px; line-height: 1; cursor: pointer; padding: 0 2px; }
.chat-shut:hover { color: var(--ink); }
/* Open, the box shows the last line or two; the arrow in its header makes
   it tall (Kais, 2026-09-20: "by default it's expanded enough to just show
   the last message, but you can open it more"). */
.chat-list { max-height: 92px; overflow-y: auto; padding: 8px 12px; display: flex; flex-direction: column; gap: 10px; }
.chat.tall .chat-list { max-height: 44vh; }
.chat-empty { font-size: 12px; color: var(--ink-faint); line-height: 1.5; }
.chat-row { display: flex; flex-direction: column; gap: 2px; }
.chat-who { display: flex; gap: 8px; align-items: baseline; }
.chat-name { font-size: 11px; letter-spacing: 0.04em; color: var(--ink-dim); }
.chat-at { font-size: 10px; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.chat-text { font-size: 12.5px; line-height: 1.5; color: var(--ink); overflow-wrap: anywhere; white-space: pre-wrap; }
.chat-machine .chat-text, .chat-row.chat-note .chat-text { color: var(--ink-dim); font-size: 12px; }
.chat-machine .chat-name { color: var(--ink-faint); }
.chat-link { color: var(--accent); }
.chat-go { display: inline-block; margin: 2px 0; padding: 2px 8px; border-radius: 999px; background: transparent;
  border: 1px solid var(--accent); color: var(--accent); font: inherit; font-size: 11px; cursor: pointer; }
.chat-go:hover { background: rgba(212, 175, 90, 0.12); }
.chat-foot { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px; border-top: 1px solid var(--edge); align-items: center; }
.chat-input { flex: 1 1 100%; min-width: 0; font: inherit; font-size: 12.5px; color: var(--ink); background: var(--panel-lift);
  border: 1px solid var(--edge); border-radius: 8px; padding: 6px 8px; }
.chat-input:focus { outline: none; border-color: var(--edge-hi); }
.chat-view, .chat-send { font: inherit; font-size: 10.5px; letter-spacing: 0.03em; padding: 5px 8px; border-radius: 8px;
  background: transparent; border: 1px solid var(--edge); color: var(--ink-dim); cursor: pointer; white-space: nowrap; }
.chat-send { margin-left: auto; }
.chat-view.on { border-color: var(--accent); color: var(--accent); }
.chat-send { border-color: var(--accent); color: var(--accent); }
.chat-send[disabled] { opacity: 0.6; cursor: default; }
.chat-status { padding: 0 12px 8px; font-size: 11px; color: var(--ink-faint); min-height: 8px; }
@media (max-width: 820px) {
  .chat-card { width: 100%; }
  .chat-list { max-height: 34vh; }
  /* In the phone's sheet the card shrinks to fit #chat, and the list gives
     way first, so the head and the input stay on screen. Where even that
     does not fit, the card scrolls rather than clipping its head. */
  #chat.open .chat-card { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
  #chat.open .chat-card > * { flex: none; }
  #chat.open .chat-card > .chat-list { flex: 0 1 auto; min-height: 2.6em; }
}

/* ----------------------------------------------------------------- loupe
   A square drawn over the page and handed to somebody else. The drawing
   layer takes the clicks; the layer showing somebody else's square takes
   none, so the page underneath stays usable. A finger on the drawing layer
   draws the square instead of scrolling the page. */
.loupe-layer { position: fixed; inset: 0; z-index: 70; cursor: crosshair; touch-action: none; }
.loupe-layer.loupe-passive { pointer-events: none; cursor: default; }
body.tour-on .loupe-layer.loupe-passive { z-index: 59; }
.loupe-hint { position: absolute; left: 50%; top: 24px; transform: translateX(-50%); padding: 8px 14px;
  border-radius: 999px; background: var(--panel-solid); border: 1px solid var(--accent); color: var(--ink);
  font-size: 12.5px; letter-spacing: 0.02em; }
.loupe-box { position: absolute; border: 2px solid var(--accent); border-radius: 10px;
  box-shadow: 0 0 0 9999px rgba(3, 6, 12, 0.35); }
.loupe-box.loupe-drawing { box-shadow: none; background: rgba(212, 175, 90, 0.08); }
.loupe-tag { position: absolute; left: 0; top: -28px; display: flex; align-items: center; gap: 8px;
  padding: 4px 8px; border-radius: 8px; background: var(--accent); color: #17140c; font-size: 11.5px;
  letter-spacing: 0.04em; white-space: nowrap; pointer-events: auto; }
.loupe-shut { background: none; border: 0; color: #17140c; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
.chat-loupe.on { border-color: var(--accent); color: var(--accent); }
.chat-grow { font-size: 13px; }

/* Who joins the meeting: the people on call and the Workspace groups. */
.chat-guests { display: flex; flex-direction: column; gap: 5px; padding: 8px 12px; border-top: 1px solid var(--edge);
  max-height: 34vh; overflow-y: auto; }
.chat-guests-head { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }
.chat-guest { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink); cursor: pointer; }
.chat-guests-groups { font-size: 11px; color: var(--ink-faint); }
.chat-guests .chat-send { align-self: flex-start; margin-top: 4px; }

/* ---------------------------------------------------------------- market
   Where the US market is in its day, with the countdown into pre-market and
   the one out of after hours. */
/* Its own line under the header, above the chain and symbol rows: inside
   the header band it either pushed the figures onto a second row or made
   the band tall enough to reach S01's, both of which the layout tests
   catch. */
.market { position: relative; z-index: 7; align-self: flex-start;
  display: inline-flex; align-items: center; gap: 7px; padding: 2px 9px; border-radius: 999px;
  background: var(--panel-lift); border: 1px solid var(--edge); font-size: 10.5px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--ink-dim); white-space: nowrap; }
.market-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--ink-faint); }
.market-open .market-dot { background: var(--live); box-shadow: 0 0 0 3px rgba(74, 190, 130, 0.18); }
.market-premarket .market-dot, .market-after .market-dot { background: var(--accent); }
.market-open .market-word, .market-premarket .market-word, .market-after .market-word { color: var(--ink); }
.market-clock { color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; text-transform: none; }
/* The same guard as the finder's: an element with a display rule ignores the
   hidden attribute unless told otherwise. */
.market[hidden] { display: none; }
@media (max-width: 820px) { .market { display: none; } }
/* Inside the live/replay pill: no pill of its own, a thin rule before it. */
#mode .market { padding: 0 0 0 6px; border: 0; border-radius: 0;
  background: none; box-shadow: none; align-self: center; letter-spacing: 0.06em; font-weight: 500; }
#mode .market[hidden] { display: none; }
/* With the market in it the pill can outgrow its corner: it wraps instead. */
@media (min-width: 821px) {
  #mode { flex-wrap: wrap; justify-content: flex-end; white-space: normal; max-width: 100%; border-radius: 14px; row-gap: 3px; }
  #mode .mode-note, #mode .market { white-space: nowrap; }
}

.chat-view { display: inline-flex; align-items: center; gap: 5px; }
.glass { flex: none; }

/* One tab per conversation: the on-call topic, then one per open incident. */
.chat-tabs { display: flex; gap: 4px; padding: 6px 10px 0; overflow-x: auto; border-bottom: 1px solid var(--edge); }
.chat-tab { flex: none; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: inherit; font-size: 11px; letter-spacing: 0.03em; padding: 4px 9px; border-radius: 999px 999px 0 0;
  background: transparent; border: 1px solid var(--edge); border-bottom: 0; color: var(--ink-faint); cursor: pointer; }
.chat-tab:hover { color: var(--ink-dim); }
.chat-tab.on { color: var(--accent); border-color: var(--edge-hi); background: var(--panel-lift);
  border-bottom: 1px solid var(--panel-lift); margin-bottom: -1px; }

/* A quoted passage and a pasted block, the two things Zulip fences. */
.chat-quote { border-left: 2px solid var(--edge-hi); padding: 2px 0 2px 8px; margin: 3px 0; color: var(--ink-dim); }
.chat-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11.5px; line-height: 1.45;
  background: var(--ground-lift); border: 1px solid var(--edge); border-radius: 6px; padding: 6px 8px; margin: 3px 0;
  white-space: pre-wrap; overflow-x: auto; color: var(--ink-dim); }
textarea.chat-input { resize: none; line-height: 1.4; max-height: 120px; overflow-y: auto; }

.chat-go { display: inline-flex; align-items: center; gap: 5px; }
.chat-go-loupe { border-width: 1px; }

.chat-resolve { font: inherit; font-size: 10.5px; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 8px; border-radius: 999px; background: transparent; border: 1px solid var(--edge);
  color: var(--ink-faint); cursor: pointer; }
.chat-resolve:hover { color: var(--live); border-color: var(--live); }

.chat-shot { display: block; margin: 4px 0; border: 1px solid var(--edge-hi); border-radius: 8px; overflow: hidden; }
.chat-shot img { display: block; width: 100%; height: auto; max-height: 180px; object-fit: cover; }

/* The page has moved on since this tab opened. */
.newbuild { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 60;
  font: inherit; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 12px;
  border-radius: 999px; background: var(--accent); color: #17140c; border: 0; cursor: pointer; }

/* ---------------------------------------------------------------- finder
   Paste an id, get the journey. A sheet over the middle of the page, because
   what it answers with is a list of moments and each one is a click. */
.find-card { width: 640px; max-width: 100%; background: var(--panel-solid); border: 1px solid var(--edge);
  border-radius: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); overflow: hidden; }
.find-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; border-bottom: 1px solid var(--edge); }
.find-title { flex: 1; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-dim); }
.find-shut { background: none; border: 0; color: var(--ink-faint); font-size: 17px; line-height: 1; cursor: pointer; }
.find-shut:hover { color: var(--ink); }
.find-input { display: block; width: calc(100% - 28px); margin: 12px 14px 8px; font: inherit; font-size: 14px;
  color: var(--ink); background: var(--panel-lift); border: 1px solid var(--edge); border-radius: 9px; padding: 9px 11px; }
.find-input:focus { outline: none; border-color: var(--edge-hi); }
.find-note { padding: 0 15px 10px; font-size: 11.5px; line-height: 1.5; color: var(--ink-faint); }
.find-list { max-height: 52vh; overflow-y: auto; padding: 0 10px 12px; }
.find-flow-head { padding: 4px 5px 6px; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.find-leg { display: grid; grid-template-columns: 132px 1fr auto; gap: 10px; align-items: baseline; width: 100%;
  text-align: left; padding: 8px 6px; background: none; border: 0; border-top: 1px solid var(--edge);
  color: var(--ink-dim); font: inherit; font-size: 12.5px; cursor: pointer; }
.find-leg:hover { background: var(--panel-lift); color: var(--ink); }
.find-leg.on { color: var(--ink); }
.find-leg.on .find-when { color: var(--accent); }
.find-when { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--ink-faint); white-space: nowrap; }
.find-what { line-height: 1.45; }
.find-gap { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
@media (max-width: 820px) {
  .find-leg { grid-template-columns: 1fr; gap: 2px; }
}

.find-leg.aside { opacity: 0.62; }
.find-leg.aside:hover { opacity: 1; }
.find-role { display: block; margin-top: 2px; font-size: 10.5px; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent); }
.find-leg.aside .find-role { color: var(--ink-faint); }

.find-logs { padding: 8px 6px 2px; border-top: 1px solid var(--edge); margin-top: 6px; display: flex;
  flex-wrap: wrap; gap: 6px; align-items: baseline; }
.find-logs .find-flow-head { flex-basis: 100%; padding: 0 0 4px; }
.find-log { font-size: 11.5px; padding: 4px 9px; border-radius: 999px; border: 1px solid var(--edge);
  color: var(--ink-dim); text-decoration: none; }
.find-log:hover { color: var(--accent); border-color: var(--edge-hi); }
.find-signin { margin: 0 5px 4px; font: inherit; font-size: 11.5px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--edge-hi); background: none; color: var(--accent); cursor: pointer; }
.find-signin:disabled { opacity: 0.5; cursor: default; }

/* A filtered headline says so, in the colour the filter chips use. */
#top .caption.filtered { color: var(--accent); }

/* Where the trading happened: a share, a bar, and what it made. */
#side .side-venues + .side-venues { margin-top: 16px; }
#side .side-venues-head { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
#side .side-venue { padding: 7px 0; border-bottom: 1px solid var(--edge); }
#side .side-venue:last-child { border-bottom: 0; }
#side .side-venue-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
#side .side-venue-name { font-size: 12.5px; color: var(--ink); }
#side .side-venue-share { font-size: 12.5px; color: var(--accent); font-variant-numeric: tabular-nums; }
#side .side-venue-bar { height: 4px; border-radius: 999px; background: var(--panel-lift); margin: 5px 0 4px; overflow: hidden; }
#side .side-venue-bar span { display: block; height: 100%; background: var(--accent); opacity: 0.8; }
#side .side-venue-sub { display: flex; justify-content: space-between; gap: 10px; font-size: 11px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
#side .side-venue-made.pos { color: var(--live); }
#side .side-venue-made.neg { color: var(--danger); }
#side .side-venue-made.thin { color: var(--ink-faint); }
#side .side-seg { display: flex; gap: 4px; margin: 0 0 10px; }
#side .side-seg-b {
  appearance: none; border: 1px solid var(--edge); background: none; color: var(--ink-faint);
  font: inherit; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  border-radius: 999px; padding: 3px 9px; cursor: pointer;
}
#side .side-seg-b:hover { color: var(--ink-dim); }
#side .side-seg-b.on { color: var(--accent); border-color: var(--edge-hi); background: var(--accent-soft); }

/* Ask Claude: the same small card as the report, with room to read the
   note before it goes. */
/* Solid, not glass: this card is a page of text to be read, and a moving
   graph behind the words is what makes it unreadable. */
#ask .rp-card { width: 520px; max-width: 100%; padding: 14px 16px;
  background: var(--panel-solid); }
/* Two of these sat side by side as bare words and read as one sentence
   (Kais, 2026-09-23: "these dont look like separate buttons"), so they are
   pills, spaced, and the open one is filled. */
.ask-peek {
  appearance: none; border: 1px solid var(--edge); background: none; color: var(--ink-dim);
  font: inherit; font-size: 10.5px; border-radius: 999px; padding: 2px 9px;
  cursor: pointer; white-space: nowrap;
}
.ask-peek:hover { color: var(--ink); border-color: var(--edge-hi); }
.ask-peek.on { color: var(--accent); border-color: var(--edge-hi); background: var(--accent-soft); }
#ask .ask-whose { flex-wrap: wrap; }
#ask .ask-views { margin-left: auto; display: flex; gap: 5px; flex: none; }
.ask-pre {
  margin: 8px 0 0; max-height: 40vh; overflow: auto; white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 10.5px; line-height: 1.45; color: var(--ink-dim);
  background: var(--panel-lift); border: 1px solid var(--edge); border-radius: 8px; padding: 9px 10px;
}


/* Who is paying for the answer, and the answer itself. */
.ask-whose { margin-top: 10px; font-size: 11px; color: var(--ink-faint); display: flex; align-items: center; gap: 6px; }
.ask-whose-no { color: var(--warning); }
.ask-model { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.ask-dot { opacity: 0.5; }

/* Claude's mark, drawn in ask.js. Its own orange, which is not the page's
   accent: it stands for something that is not this page. */
.claude-mark { flex: none; }
.claude-mark path { fill: #d97757; }
#tools .ask-pill:hover .claude-mark path { fill: #e08b6f; }

/* The wheel, for the minute it can take. */
.ask-wait { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: var(--ink-dim); }
.ask-wheel {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(217, 119, 87, 0.25); border-top-color: #d97757;
  animation: ask-spin 0.8s linear infinite;
}
@keyframes ask-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ask-wheel { animation-duration: 2.4s; } }
#ask .rp-title { display: flex; align-items: center; gap: 7px; }
.ask-answer {
  margin-top: 10px; white-space: pre-wrap; font-size: 12.5px; line-height: 1.5; color: var(--ink);
  background: var(--panel-lift); border: 1px solid var(--edge); border-radius: 8px; padding: 10px 11px;
  max-height: 38vh; overflow: auto;
}
.ask-meta { margin-top: 5px; font-size: 10.5px; color: var(--ink-faint); }
.ask-buttons { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }

.tour-title { display: flex; align-items: center; gap: 8px; }

/* The conversation: what was asked, what came back, one after the other. */
.ask-talk { max-height: 46vh; overflow: auto; margin-bottom: 4px; }
.ask-turn + .ask-turn { margin-top: 12px; }
.ask-q {
  font-size: 12.5px; color: var(--ink); background: var(--accent-soft);
  border: 1px solid var(--edge-hi); border-radius: 8px; padding: 7px 10px;
}
.ask-answer-bad { color: var(--danger); }
.ask-ticket { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line, #444); border-radius: 6px; }
.ask-ticket-head { font-size: 11px; opacity: 0.7; }
.ask-ticket-title { font-weight: 600; margin: 4px 0; }
.ask-ticket-body { white-space: pre-wrap; font-size: 12px; }
.ask-ticket-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.ask-ticket-note { font-size: 11px; opacity: 0.8; }
.ask-turn .ask-answer { margin-top: 6px; max-height: none; }

/* What you asked before, and, for devops, what everyone is spending. */
.ask-usage, .ask-past { margin-top: 10px; border-top: 1px solid var(--edge); padding-top: 8px; }
.ask-usage-head { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.ask-past-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 3px 0; }
.ask-past-open {
  appearance: none; border: 0; background: none; color: var(--ink-dim); font: inherit; font-size: 12px;
  text-align: left; cursor: pointer; padding: 0; display: flex; align-items: baseline; gap: 7px;
  min-width: 0; flex: 1;
}
.ask-past-q { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ask-past-n { flex: none; font-size: 10px; color: var(--ink-faint); border: 1px solid var(--edge);
  border-radius: 999px; padding: 0 6px; }
.ask-past-open:hover { color: var(--accent); }
.ask-past-when { font-size: 10px; color: var(--ink-faint); white-space: nowrap; }
.ask-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.ask-table th { text-align: left; font-weight: 400; font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-faint); padding-bottom: 4px; }
.ask-table td { padding: 3px 0; color: var(--ink-dim); border-top: 1px solid var(--edge); }
.ask-table .ask-num { text-align: right; font-variant-numeric: tabular-nums; }

/* An answer is Markdown, drawn (ask.js render). */
.ask-md-p { margin: 0 0 8px; }
.ask-md-p:last-child, .ask-md-list:last-child, .ask-md-table:last-child { margin-bottom: 0; }
.ask-md-head { font-weight: 600; color: var(--ink); margin: 10px 0 5px; }
.ask-md > :first-child { margin-top: 0; }
.ask-md-list { margin: 0 0 8px; padding-left: 18px; }
.ask-md-list li { margin: 2px 0; }
.ask-md-table { margin: 4px 0 10px; }
.ask-md-table th, .ask-md-table td { padding-right: 14px; }
.ask-md-table td { color: var(--ink); }
.ask-code {
  font-family: var(--mono); font-size: 11px; background: var(--panel-lift);
  border: 1px solid var(--edge); border-radius: 4px; padding: 0 4px;
}
.ask-answer .ask-pre { margin: 6px 0; max-height: 30vh; }

/* Picking the model: a dropdown, because the list of models grows. */
.ask-pick {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--edge); border-radius: 999px; background: none;
  color: var(--ink-dim); font: inherit; font-size: 10.5px;
  padding: 2px 20px 2px 9px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%),
    linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: calc(100% - 11px) 55%, calc(100% - 7px) 55%;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}
.ask-pick:hover { color: var(--ink); border-color: var(--edge-hi); }
.ask-pick:disabled { opacity: 0.5; cursor: default; }
.ask-pick option { background: var(--panel-solid); color: var(--ink); }

/* --- The shell ------------------------------------------------------------ */

/* One grid owns the screen and every panel sits in a region of it, so no
   panel has to know where the others are. Last in the file, so the regions
   win over the panels' own rules above. It lies over the stage and lets
   pointer events through wherever no panel is, so the canvas still takes its
   picks and hovers in the gaps. */
#shell {
  /* The side columns scale with the screen, so a browser zoom (a narrower
     viewport) narrows them instead of squeezing the stage. */
  --col: clamp(220px, 22vw, 340px);
  container: shell / inline-size;
  position: relative;
  z-index: 20;
  height: 100dvh;
  padding: 16px;
  display: grid;
  grid-template-areas:
    "top  top   top"
    "rail stage inspector"
    "bar  bar   bar";
  /* The inspector is as wide as the card in it, so with nothing selected
     the stage gets the column back. */
  grid-template-columns: var(--col) minmax(0, 1fr) minmax(0, auto);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 16px;
  pointer-events: none;
}
#top, #top-s01, #who, .market, #chains, #symbols, #side, #chat, #detail,
#solver-box, #windows, #scrub, #tools, #tools-more, #mode, #tabbar {
  pointer-events: auto;
}

.shell-top {
  grid-area: top;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}
#top { flex: 0 1 auto; min-width: 0; }
/* T0 and S01 side by side as equals, the same width and height (Kais,
   2026-10-10: the two boxes "are not symmetrical"). A reader of one org
   sees only that org's box, which keeps its half. */
.shell-top { align-items: stretch; }
/* The login pill on its own, top right, no box (Kais, 2026-10-10). */
#who { flex: none; order: 9; margin-left: auto; align-self: flex-start; background: none; border: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; padding: 0; display: flex; align-items: center; }
#who .profile { border-left: 0; padding-left: 0; margin-left: 0; }
/* Fixed slots, never a wrap that reshuffles them (Kais, 2026-10-12): T0,
   S01 and the solver in that order, the login at the far right. A narrow
   screen moves the solver under T0, always to the same place. A reader of
   one org leaves the other's slot empty rather than sliding the rest. */
.shell-top { position: relative; display: grid; grid-template-columns: max-content max-content max-content minmax(0, 1fr);
  grid-template-areas: "t0 s01 solver ."; align-items: stretch; }
#top { grid-area: t0; }
#top-s01 { grid-area: s01; }
.shell-top > #solver-box { grid-area: solver; }
/* The login in the very top right corner, out of the row's slots. */
#who { position: absolute; top: -10px; right: 0; z-index: 40; }
@container shell (max-width: 2000px) {
  .shell-top { grid-template-columns: max-content max-content minmax(0, 1fr);
    grid-template-areas: "t0 s01 ." "solver solver ."; }
  .shell-top > #solver-box { justify-self: start; }
}
/* The on-call chat in the bottom left corner of the screen, opening upward
   over the page like a game's chat (Kais, 2026-10-12). */
@container shell (min-width: 1101px) {
  #chat { position: fixed; left: 16px; bottom: 16px; margin: 0; max-height: calc(100dvh - 32px); }
  #chat .chat-card { width: min(330px, var(--col)); }
}
/* A narrow desktop keeps the pill to one line: the market, not the small print. */
@container shell (max-width: 1100px) {
  #mode .mode-note { display: none; }
}
/* A short screen gives the graph its height back: the solver folds behind
   "..." with the tools, as it did in the bar. */
@media (min-width: 821px) and (max-height: 640px) {
  .shell-top > #solver-box { display: none; }
  #shell.tools-open .shell-top > #solver-box { display: block; }
}
#top, #top-s01 { flex: 0 0 auto; box-sizing: border-box; min-width: 0; max-width: 100%; }
#top .hud-cell { flex: none; }
.profile-menu { right: 0; left: auto; }
#top-s01 { flex: none; }
/* The figures scale with the screen, so the cells keep to a row or two. */
#top .figure, #top strong, #top b, #top-s01 .figure, #solver-box .figure { font-size: clamp(16px, 1vw + 7px, 22px); }
#top .caption, #top-s01 .caption, #solver-box .caption { font-size: clamp(8px, 0.3vw + 5px, 9.5px); }
#top .hud, #top-s01 .hud, #solver-box .hud { column-gap: clamp(12px, 1.6vw, 24px); }
/* The strip gives up height before the stage does on a short screen. */
#scrub .tl-strip { height: clamp(24px, 6dvh, 44px); min-height: 0; }

/* The flyout of an open side row is placed against this box. */
.shell-rail {
  grid-area: rail;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}
.shell-rail > * { flex: none; }
/* The two that can be long scroll inside what is left; the menu gives
   way first, so an open chat keeps its input on screen. */
#side { flex: 0 1000 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#chat { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin-top: auto; }
#chat .chat-card { max-width: 100%; }

.shell-stage { grid-area: stage; }

#detail { grid-area: inspector; width: var(--col); min-height: 0; }

.shell-bar {
  grid-area: bar;
  display: grid;
  grid-template-columns: var(--col) minmax(0, 1fr) var(--col);
  align-items: end;
  gap: 16px;
}
.shell-start, .shell-ends { container-type: inline-size; min-width: 0; }
.shell-start { grid-column: 1; display: flex; }
.shell-transport {
  grid-column: 2;
  justify-self: center;
  width: 100%;
  max-width: 720px;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.shell-ends {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}
/* Two by two when the end of the bar is narrow: a wrapped flex row would
   keep the full width and leave a hole. */
@container (max-width: 560px) {
  #solver-box .hud { display: grid; grid-template-columns: auto auto; }
}
@container (max-width: 520px) {
  #tools { display: grid; grid-template-columns: auto auto; }
}

#tabbar, #tools-more { display: none; }
#tools-more {
  appearance: none;
  background: var(--panel);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 2px 14px;
  color: var(--ink-dim);
  font: inherit;
  font-size: 14px;
  line-height: 1.2;
  cursor: pointer;
}
#tools-more[aria-expanded="true"] { color: var(--accent); border-color: var(--edge-hi); }

/* Short of room, the header drops its brand words, not its figures, and a
   long caption takes a second line rather than widening its cell. */
@container shell (max-width: 1280px) {
  #top .brand .sub, #top-s01 .brand { display: none; }
  #top, #top-s01 { gap: 14px; }
  #top .hud { padding-left: 14px; }
  #top-s01 .hud { border-left: 0; padding-left: 0; }
  #top .caption, #top-s01 .caption { white-space: normal; max-width: 14em; }
}
/* A narrow desktop (a laptop zoomed in): the solver, the tools and the
   transport buttons fold behind "...". */
@container shell (max-width: 1100px) {
  .shell-bar {
    position: relative;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: "transport more mode";
    gap: 8px;
  }
  .shell-start, .shell-ends { display: contents; }
  .shell-transport { grid-area: transport; }
  /* Open, they float over the stage above the bar: in the flow they would
     take the rail's height on a short screen. */
  #tools { position: absolute; bottom: calc(100% + 8px); z-index: 30; display: none; background: var(--panel-solid); }
  #tools { right: 0; grid-template-columns: auto auto; }
  #shell.tools-open #tools { display: grid; }
  #timeline .tl-transport { display: none; }
  #shell.tools-open #timeline .tl-transport { display: flex; }
  #tools-more { grid-area: more; display: block; }
  #mode { grid-area: mode; }
}

/* A centred sheet (sheet.js) is a native dialog: the browser gives it the
   top layer, the backdrop and the focus trap. It sits inside #shell, so it
   takes its clicks back like the panels do. */
dialog.sheet {
  pointer-events: auto;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
}
dialog.sheet::backdrop { background: rgba(3, 5, 9, 0.5); }
/* The finder's list grows as it answers, so its input stays put up top. */
dialog.sheet:has(> .find) { margin-top: 12dvh; }

/* The phone: one column, and one sheet under the graph at a time, picked
   by the tab bar (shell.js). The stage band keeps a third of the screen, a
   quarter while a sheet is open; the sheet takes the rest and scrolls. */
@media (max-width: 820px) {
  #shell {
    padding: 8px 8px 0;
    gap: 6px;
    grid-template-areas: "top" "stage" "sheet" "bar" "tabs";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(30dvh, 1fr) minmax(0, auto) auto auto;
  }
  #shell:is([data-sheet="rail"], [data-sheet="detail"], [data-sheet="chat"], [data-sheet="sheet"]) {
    grid-template-rows: auto minmax(26dvh, 1fr) minmax(0, auto) auto auto;
  }
  /* The open tools fold out of the bar into the sheet's room, and the sheet
     comes back when they fold: with both up, the rows outgrow the screen
     and the header and the sheet are clipped. */
  #shell.tools-open { grid-template-rows: auto minmax(0, 1fr) 0 auto auto; }
  #shell.tools-open .shell-rail, #shell.tools-open #detail, #shell.tools-open > dialog.sheet { display: none; }
  /* The header cells and the profile pill scroll as one row, so the pill
     never sits over a cell. Its menu is fixed, or the row would clip it. */
  .shell-top {
    align-items: center; gap: 6px; pointer-events: auto;
    overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .shell-top::-webkit-scrollbar { display: none; }
  .shell-top { flex-wrap: nowrap; }
  #top, #top-s01 { flex: none; max-width: none; }
  #top { overflow: visible; }
  /* The narrow-desktop header rules above reach a phone too; its own values. */
  #top .caption, #top-s01 .caption { white-space: nowrap; max-width: none; }
  #top { gap: 6px; }
  #top-s01 { gap: 10px; }
  #top .hud { padding-left: 0; }
  #top-s01 .hud { padding: 8px 10px 7px; border-left: 2px solid var(--s01); }
  .profile-menu { position: fixed; top: 64px; right: 8px; }
  .shell-rail, #detail { grid-area: sheet; }
  /* The chip rows go side by side when the sheet is wide enough, so a short
     landscape screen still has room for the panel list under them. */
  .shell-rail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 6px;
    overflow: hidden;
  }
  #side, #chat { grid-row: 3; grid-column: 1 / -1; }
  #detail { width: auto; }
  #chat { margin-top: 0; }
  #shell:not([data-sheet="rail"]):not([data-sheet="chat"]) .shell-rail { display: none; }
  #shell[data-sheet="chat"] .shell-rail > :not(#chat) { display: none; }
  #shell:not([data-sheet="chat"]) #chat { display: none; }
  #shell:not([data-sheet="detail"]) #detail { display: none; }
  /* On a phone a centred sheet is not modal: it is the slot's content. */
  #shell > dialog.sheet {
    grid-area: sheet;
    position: static;
    margin: 0;
    width: auto;
    height: auto;
    min-height: 0;
    max-width: none;
    max-height: 50dvh;
    border-radius: var(--r);
    overscroll-behavior: contain;
  }
  /* The widths share their line with the tools button and the live badge,
     so the bar costs one line less. */
  .shell-bar {
    grid-template-areas: "windows more mode" "scrub scrub scrub" "tools tools tools";
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0 6px;
  }
  .shell-start, .shell-transport, .shell-ends { display: contents; }
  #windows { grid-area: windows; align-self: end; }
  #scrub { grid-area: scrub; }
  #mode { grid-area: mode; }
  #tools-more { grid-area: more; display: block; }
  #tools { position: relative; inset: auto; }
  /* The top row scrolls as one line on a phone, the solver in it. */
  .shell-top { display: flex; }
  .shell-top > #solver-box { flex: none; padding: 7px 10px; }
  #who { position: static; }
  #solver-box .hud { display: flex; flex-wrap: nowrap; gap: 0 16px; }
  #solver-box .hud-cell { flex: none; }
  #tools { grid-area: tools; display: none; margin-top: 6px; min-width: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; justify-content: flex-start; }
  #shell.tools-open #tools { display: flex; }
  #tools::-webkit-scrollbar { display: none; }
  #tools .tool-sub { display: none; }
  #tools .tool-name { white-space: nowrap; }
  #windows button { flex: none; white-space: nowrap; padding: 4px 9px; }
  #windows .nav-label { display: none; }
  /* The strip alone under the widths: its empty state says what the head
     said, and the transport buttons fold behind the tools button with the
     tools. The badge stands for the live button, and a tap on it does the
     same (shell.js). */
  #scrub { padding: 6px 10px; }
  #timeline .tl-head, #timeline .tl-live { display: none; }
  #timeline .tl-transport { display: none; overflow-x: auto; scrollbar-width: none; }
  #shell.tools-open #timeline .tl-transport { display: flex; }
  #mode { cursor: pointer; }
  #mode .mode-note { display: none; }
  #tabbar {
    grid-area: tabs;
    display: flex;
    margin: 0 -8px;
    padding: 4px 8px calc(4px + env(safe-area-inset-bottom));
    background: var(--panel-solid);
    border-top: 1px solid var(--edge);
  }
  #tabbar button {
    flex: 1;
    appearance: none;
    background: none;
    border: 0;
    border-radius: 8px;
    padding: 9px 0;
    color: var(--ink-dim);
    font: inherit;
    font-size: 10.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
  }
  #tabbar button[aria-pressed="true"] { color: var(--accent); background: var(--accent-soft); }
  #tabbar button:disabled { opacity: 0.4; cursor: default; }
}

/* Approvals (pam.js): the row's panel, and the popup an approver gets. The
   veil sits above the panels (20 to 40) and under the tour (60). */
.pam-intro { font-size: 11.5px; color: var(--ink-dim); margin: 6px 0 10px; line-height: 1.45; }
.pam-line { font-size: 11px; color: var(--ink-dim); margin-top: 3px; line-height: 1.4; }
.pam-line.pam-bad, .pam-status.bad { color: var(--danger); }
.pam-status.good { color: var(--in); }
.pam-card { border: 1px solid var(--edge); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.pam-card.mine { border-color: rgba(240, 181, 70, 0.55); background: var(--accent-soft); }
.pam-card.tk-dead { opacity: 0.8; border-style: dashed; }
.pam-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pam-target { font-family: var(--mono); font-size: 11.5px; font-weight: 600; }
.pam-count { font-size: 10.5px; color: var(--ink-faint); white-space: nowrap; }
.pam-just { font-family: var(--mono); font-size: 10.5px; line-height: 1.45; white-space: pre-wrap; word-break: break-word; color: var(--ink); background: var(--panel-lift); border-radius: 6px; padding: 6px 8px; margin: 6px 0; max-height: 110px; overflow: hidden; }
.pam-just.open { max-height: none; }
.pam-just a { color: var(--accent); }
.pam-more { appearance: none; font: inherit; font-size: 10.5px; background: none; border: 0; padding: 0; color: var(--accent); cursor: pointer; }
.pam-actions { display: flex; gap: 8px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.pam-console { font-size: 10.5px; color: var(--ink-faint); margin-left: auto; }
.pam-review, .pam-approve, .pam-deny, .pam-later { appearance: none; font: inherit; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.pam-review { background: var(--accent-soft); border: 1px solid rgba(240, 181, 70, 0.5); color: var(--accent); }
.pam-approve { background: rgba(72, 199, 116, 0.12); border: 1px solid rgba(72, 199, 116, 0.55); color: var(--in); }
.pam-deny { background: rgba(238, 94, 83, 0.12); border: 1px solid rgba(238, 94, 83, 0.55); color: var(--danger); }
.pam-later { background: none; border: 1px solid var(--edge); color: var(--ink-dim); }
.pam-approve:disabled, .pam-deny:disabled, .pam-later:disabled { opacity: 0.45; cursor: default; }
.pam-input { display: block; width: 100%; box-sizing: border-box; font: inherit; font-size: 12px; color: var(--ink); background: var(--panel-lift); border: 1px solid var(--edge); border-radius: 6px; padding: 7px 9px; margin: 10px 0 8px; }
.pam-veil { position: fixed; inset: 0; z-index: 55; background: rgba(0, 0, 0, 0.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.pam-modal { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-sizing: border-box; background: var(--panel-solid); border: 1px solid var(--edge-hi); border-radius: 12px; box-shadow: var(--shadow); padding: 16px 18px; }
.pam-title { font-size: 15px; font-weight: 600; margin: 0 0 4px; }
.pam-sub { font-size: 12px; color: var(--ink-dim); margin: 0 0 10px; line-height: 1.45; }
.pam-modal .pam-just { max-height: 40vh; overflow: auto; }
.pam-status { font-size: 12px; margin-top: 8px; min-height: 1em; }
.pam-modal .pam-console { display: inline-block; margin: 8px 0 0; }
.tk-section { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--edge); }
.tk-open { text-decoration: none; display: inline-block; padding: 6px 12px; border-radius: 6px; }
/* On a phone the vote fits the screen the browser leaves visible, clear of
   the notch and the home bar, and scrolls as one box. */
@media (max-width: 820px) {
  .pam-veil { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .pam-modal { max-height: 100%; padding: 14px; }
  .pam-modal .pam-just { max-height: none; overflow: visible; }
}

/* Claude's check inside the approval popup, and its one-liner on the panel cards. */
.pam-check { margin: 8px 0 2px; padding: 8px 10px; border: 1px solid var(--edge); border-radius: 8px; background: var(--panel-lift); }
.pam-check-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.pam-check-title { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }
.pam-check-state { font-size: 11px; color: var(--ink-faint); }
.pam-verdict { display: inline-block; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 2px 9px; margin: 6px 0 4px; border: 1px solid var(--edge); color: var(--ink-dim); }
.pam-verdict.ok { color: var(--in); border-color: rgba(72, 199, 116, 0.55); background: rgba(72, 199, 116, 0.1); }
.pam-verdict.warn { color: var(--accent); border-color: rgba(240, 181, 70, 0.55); background: var(--accent-soft); }
.pam-verdict.bad { color: var(--danger); border-color: rgba(238, 94, 83, 0.55); background: rgba(238, 94, 83, 0.1); }
.pam-line.pam-verdict { margin-top: 6px; }
.pam-check-lines { list-style: none; margin: 4px 0; padding: 0; }
.pam-check-line { display: flex; gap: 8px; font-size: 11.5px; line-height: 1.4; padding: 2px 0; color: var(--ink); }
.pam-check-mark { flex: 0 0 14px; text-align: center; font-weight: 700; }
.pam-check-line.ok .pam-check-mark { color: var(--in); }
.pam-check-line.warn .pam-check-mark { color: var(--accent); }
.pam-check-line.bad .pam-check-mark { color: var(--danger); }
.pam-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.pam-kind { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); font-weight: 600; }
.pam-waiting { font-size: 11px; color: var(--ink-faint); }
.pam-hero { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin: 0 0 10px; }
.pam-hero .pam-verdict { margin: 0; font-size: 11.5px; padding: 3px 11px; }
.pam-headline { font-size: 17px; line-height: 1.35; font-weight: 600; color: var(--ink); margin: 0; }
.pam-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.pam-tag { font-size: 11.5px; color: var(--ink); background: var(--panel-lift); border: 1px solid var(--edge); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pam-tag.warn { color: var(--accent); border-color: rgba(240, 181, 70, 0.55); background: var(--accent-soft); }
.pam-tag.pam-votes { color: var(--ink-dim); }
.pam-modal .pam-check { margin: 0 0 8px; }
.pam-modal .pam-check.empty { display: none; }
.pam-modal .pam-check-line { font-size: 12.5px; padding: 3px 0; }
.pam-notes { margin-top: 6px; }
.pam-detail-title { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 3px; }
.pam-details { margin: 4px 0 2px; font-size: 12px; }
.pam-details > summary { cursor: pointer; color: var(--ink-dim); font-size: 12px; padding: 4px 0; }
.pam-details[open] > summary { margin-bottom: 4px; }
.pam-detail-block { margin: 0 0 10px; }
.pam-detail-block .pam-check-summary { margin: 0; }
.pam-check-links.pam-detail-block { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.pam-meta { font-size: 11px; color: var(--ink-faint); }
.pam-meta a { color: var(--accent); }
.pam-check-line.note .pam-check-mark { color: var(--ink-dim); font-style: italic; }
.pam-check-links { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 2px 0 4px; font-size: 11.5px; }
.pam-check-link { color: var(--accent); text-decoration: none; }
.pam-check-link:hover { text-decoration: underline; }
.pam-check-passed { margin: 2px 0 4px; font-size: 11.5px; color: var(--ink-dim); }
.pam-check-passed > summary { cursor: pointer; padding: 2px 0; }
.pam-check-summary { font-size: 12px; line-height: 1.5; margin: 6px 0 4px; color: var(--ink); }
.pam-review.pam-open { background: none; border-color: var(--edge); color: var(--ink-dim); }
.pam-card-summary { font-size: 11.5px; color: var(--ink-dim); margin: 4px 0 0; }
.pam-ask { appearance: none; font: inherit; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; background: none; border: 1px solid var(--edge); border-radius: 999px; padding: 4px 10px; color: var(--ink-dim); cursor: pointer; margin: 0 0 10px; }
.pam-ask:hover { color: var(--ink); border-color: var(--ink-faint); }
.pam-windows { margin: 4px 0 12px; }
.pam-windows-title { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 4px; }
.pam-window { font-size: 11.5px; line-height: 1.45; padding: 4px 0; border-top: 1px solid var(--edge); }
.pam-window:first-of-type { border-top: 0; }
.pam-window b { font-weight: 600; }
.pam-window .open-now { color: var(--in); }
.win-form { display: grid; grid-template-columns: max-content 1fr; gap: 8px 12px; align-items: center; margin: 8px 0; }
.win-form label { font-size: 11.5px; color: var(--ink-dim); }
.win-form .pam-input { margin: 0; }
.win-choice { display: flex; gap: 6px; flex-wrap: wrap; }
.win-choice button { appearance: none; font: inherit; font-size: 11.5px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--edge); background: none; color: var(--ink-dim); cursor: pointer; }
.win-choice button.on { color: var(--accent); border-color: rgba(240, 181, 70, 0.55); background: var(--accent-soft); }
.win-when { font-size: 12px; line-height: 1.45; color: var(--ink); margin: 2px 0 6px; }
.win-cmd { display: block; margin: 6px 0; padding: 6px 8px; border: 1px solid var(--edge); border-radius: 6px; font-size: 11px; white-space: pre-wrap; word-break: break-all; user-select: all; }
@media (max-width: 560px) { .win-form { grid-template-columns: 1fr; } }
.pam-check-foot { font-size: 10.5px; color: var(--ink-faint); margin-top: 4px; }

/* Claude's first pass under an alert (investigate.js). */
.inv { margin: 6px 0 2px; padding: 7px 9px; border: 1px solid var(--edge); border-radius: 8px; background: var(--panel-lift); font-size: 11.5px; line-height: 1.45; }
.inv-head { font-weight: 600; color: var(--ink); }
.inv-meaning { color: var(--ink-dim); margin-top: 2px; }
.inv-events { list-style: none; margin: 6px 0 4px; padding: 0; }
.inv-event { display: grid; grid-template-columns: 52px 1fr; gap: 2px 8px; padding: 2px 0; }
.inv-at { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }
.inv-what { color: var(--ink); }
.inv-evidence { grid-column: 2; font-family: var(--mono); font-size: 10.5px; color: var(--ink-dim); word-break: break-word; }
.inv-cause { margin-top: 4px; color: var(--ink); }
.inv-open { margin-top: 2px; color: var(--accent); }
.inv-foot { margin-top: 4px; font-size: 10.5px; color: var(--ink-faint); }
.inv-wait { color: var(--accent); }
.inv-failed { color: var(--danger); }

/* Sounds and notifications, in the profile menu (sound.js). */
.profile-sound { font-size: 11.5px; margin-bottom: 8px; }
.snd-master { display: flex; gap: 6px; margin-bottom: 6px; }
.snd-master button { appearance: none; font: inherit; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; cursor: pointer; background: none; border: 1px solid var(--edge); color: var(--ink-dim); }
.snd-master button.on { color: var(--accent); border-color: rgba(240, 181, 70, 0.55); background: var(--accent-soft); }
.snd-table { display: grid; grid-template-columns: 1fr 44px 44px; gap: 2px 4px; }
.snd-table.off { opacity: 0.45; }
.snd-row { display: contents; }
.snd-head .snd-col { font-size: 9.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); text-align: center; }
.snd-name { color: var(--ink); padding: 2px 0; }
.snd-col { text-align: center; }
.snd-col input { margin: 0; vertical-align: middle; }
.snd-opt { display: flex; gap: 6px; align-items: flex-start; margin-top: 6px; color: var(--ink-dim); font-size: 11px; line-height: 1.35; }
.snd-opt input { margin: 2px 0 0; }
.snd-perm { margin-top: 6px; font-size: 10.5px; color: var(--ink-faint); }
.snd-ask { appearance: none; font: inherit; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; cursor: pointer; background: none; border: 1px solid var(--edge); color: var(--accent); }

.inv-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.inv-flag { display: inline-block; font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 1px 7px; border: 1px solid var(--edge); color: var(--ink-dim); font-weight: 600; }
.inv-flag.noise { color: var(--ink-faint); }
.inv-flag.bug { color: var(--accent); border-color: rgba(240, 181, 70, 0.55); background: var(--accent-soft); }
.inv-flag.incident { color: var(--danger); border-color: rgba(238, 94, 83, 0.55); background: rgba(238, 94, 83, 0.1); }
.inv-declared { font-size: 11px; margin-top: 2px; }
.inv-declared a { color: var(--danger); }
.inv-ongoing a { color: var(--warning); }
/* The registry's open problems, above the firing alerts. */
.ongoing { margin-bottom: 8px; }
.ongoing-table td { padding-right: 6px; vertical-align: top; }
.ongoing-table .ongoing-prio { color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.ongoing-table .ongoing-P1 .ongoing-prio { color: var(--danger); }
.ongoing-table .ongoing-P2 .ongoing-prio { color: var(--warning); }
.ongoing-table .ongoing-links { white-space: nowrap; text-align: right; padding-right: 0; }
#side .ongoing-table a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--edge); }

/* The patrol's line at the top of the alerts row (investigate.js). */
.patrol { margin: 0 0 10px; padding: 7px 9px; border: 1px solid var(--edge); border-radius: 8px; background: var(--panel-lift); font-size: 11.5px; line-height: 1.45; }
.patrol-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.patrol-title { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); }
.patrol-when { font-size: 10.5px; color: var(--ink-faint); }
.patrol-sum { color: var(--ink); margin-top: 3px; }
.patrol-sum.patrol-bad, .patrol-raised { color: var(--danger); font-weight: 600; margin-top: 3px; }
.patrol-findings { list-style: none; margin: 4px 0 0; padding: 0; }
.patrol-f { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 0; color: var(--ink); }
.patrol-grade { font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); min-width: 52px; }
.patrol-f.concern .patrol-grade { color: var(--accent); }
.patrol-f.bad .patrol-grade { color: var(--danger); }
.patrol-f .inv-evidence { flex-basis: 100%; }
.patrol-held { margin-top: 3px; color: var(--ink-faint); font-size: 11px; }

.patrol-earlier { list-style: none; margin: 4px 0 0; padding: 0; }
.patrol-row { display: grid; grid-template-columns: 96px 1fr; gap: 8px; padding: 3px 0; font-size: 11px; color: var(--ink-dim); border-top: 1px solid var(--edge); }
.patrol-row.raised { color: var(--accent); }
.patrol-row.failed { color: var(--danger); }
.patrol-at { font-family: var(--mono); font-size: 10.5px; color: var(--ink-faint); }

/* The sign-in prompt (identity.js), on a page served beside a door. */
.signin-veil { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(8, 12, 20, 0.45); padding: 16px; }
.signin-card { width: 100%; max-width: 420px; background: var(--panel-solid); color: var(--ink); border: 1px solid var(--edge); border-radius: 14px; padding: 20px 22px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); }
.signin-title { font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 8px; }
.signin-note { font-size: 13px; color: var(--ink-dim); margin: 0 0 14px; line-height: 1.5; }
.signin-org { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--edge); }
.signin-org-name { font-size: 14px; }
.signin-org-who { font-size: 12.5px; color: var(--ink-dim); }
.signin-org-go, .signin-continue { appearance: none; background: none; border: 1px solid var(--edge-hi, var(--edge)); border-radius: 999px; padding: 5px 14px; color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer; }
.signin-org-go:hover, .signin-continue:hover:not(:disabled) { border-color: var(--accent, var(--edge-hi)); color: var(--accent, var(--ink)); }
.signin-continue:disabled { opacity: 0.45; cursor: default; }
.signin-actions { display: flex; justify-content: flex-end; margin-top: 14px; }

/* An org's own parts, for readers of that org only (identity.js). */
.org-off { display: none !important; }
#who:has(.profile[hidden]) { display: none; }
.signin-org-why { flex-basis: 100%; font-size: 11px; color: var(--danger); margin-top: 4px; }
.signin-org-why.step { color: var(--ink-dim); }
.signin-org { flex-wrap: wrap; }

/* A service's log lines on its card (logs-view.js). */
.svc-tools { grid-area: cfg; justify-self: end; align-self: center; display: flex; gap: 6px; }
.svc-tools .svc-config { grid-area: auto; }
.logs-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.logs-bar button { appearance: none; font: inherit; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 4px 10px; cursor: pointer; background: none; border: 1px solid var(--edge); color: var(--ink-dim); }
.logs-bar button.on { background: var(--accent-soft); border-color: rgba(240, 181, 70, 0.5); color: var(--accent); }
.logs-bar button:disabled { opacity: 0.4; cursor: default; }
.logs-search { flex: 1 1 120px; min-width: 100px; font: inherit; font-size: 11.5px; padding: 4px 8px; border-radius: 999px; border: 1px solid var(--edge); background: var(--ground-lift); color: var(--ink); }
.logs-lines { margin: 0; padding: 8px 10px; background: var(--ground-lift); border: 1px solid var(--edge); border-radius: 8px; font-family: var(--mono); font-size: 10.5px; line-height: 1.45; overflow: auto; max-height: 56vh; color: var(--ink); }
.logs-line { display: grid; grid-template-columns: 78px 40px 1fr; gap: 8px; padding: 2px 0; border-top: 1px solid transparent; }
.logs-level { color: var(--ink-faint); font-size: 9.5px; letter-spacing: 0.06em; }
.logs-warn .logs-level { color: var(--warning); } .logs-error .logs-level { color: var(--danger); }
/* Logs need the room: the card grows to most of the screen while one is open. */
#detail:has([data-logs-card]) { width: min(880px, calc(100vw - 2 * var(--col) - 64px)); }
.logs-line + .logs-line { border-top-color: rgba(128, 128, 128, 0.08); }
.logs-time { color: var(--ink-faint); white-space: nowrap; }
.logs-text { white-space: pre-wrap; word-break: break-word; }
.logs-warn .logs-text { color: var(--warning); }
.logs-error .logs-text { color: var(--danger); }

/* The colours legend: a small line at the foot of the panel, not a row of
   its own (Kais, 2026-10-10: "the left menu should not have so much shit"). */
.side-row[data-row="legend"] .side-head { padding: 5px 12px 6px; min-height: 0; font-size: 9.5px; letter-spacing: 0.08em; color: var(--ink-faint); }
.side-row[data-row="legend"] .side-dot, .side-row[data-row="legend"] .side-n, .side-row[data-row="legend"] .side-chev { display: none; }
.side-row[data-row="legend"] .side-head:hover { color: var(--ink-dim); }

/* The mark: large, faint, behind every panel, over the stage. */
.watermark { position: fixed; right: 28px; top: 50%; transform: translateY(-50%); width: 200px; height: 200px; opacity: 0.08; pointer-events: none; z-index: 5; user-select: none; }
@media (max-width: 760px) { .watermark { width: 110px; height: 110px; right: 10px; } }

/* Log lines found by the finder. */
.find-loghit { display: block; width: 100%; text-align: left; appearance: none; background: none; border: 0; border-top: 1px solid var(--edge); padding: 6px 0; font: inherit; color: var(--ink-dim); cursor: pointer; }
.find-loghit:hover { color: var(--ink); }
.find-loghit:disabled { cursor: default; opacity: 0.7; }
.find-loghit-who { display: block; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.find-loghit-line { display: block; font-family: var(--mono); font-size: 10.5px; white-space: pre-wrap; word-break: break-word; margin-top: 2px; }
.find-loghit-warn .find-loghit-line { color: var(--warning); } .find-loghit-error .find-loghit-line { color: var(--danger); }

/* What the finder looks in, ticked. */
.find-scopes { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 2px; }
.find-scope { appearance: none; font: inherit; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 999px; padding: 3px 10px; cursor: pointer; background: none; border: 1px solid var(--edge); color: var(--ink-faint); }
.find-scope.on { background: var(--accent-soft); border-color: rgba(240, 181, 70, 0.5); color: var(--accent); }
.cfg-diff .add, .cfg-diff .del { display: inline-block; width: 100%; }
.cfg-diff .ctx { color: var(--ink-faint); }
.cfg-diff .add { color: var(--in); } .cfg-diff .add::before { content: '+ '; }
.cfg-diff .del { color: var(--danger); } .cfg-diff .del::before { content: '\2212 '; }

/* --- Leave (leave.js) ------------------------------------------------------
   Days off and the on-call shifts they touch. The weeks are tables that
   scroll sideways inside the panel, so a phone keeps all seven days. */
.lv-sec { margin-bottom: 12px; }
.lv-steps { margin: 2px 0 4px; padding-left: 18px; }
.lv-steps li { margin: 1px 0; }
.lv-bal { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 4px 0 2px; }
.lv-bal-cell { border: 1px solid var(--edge); border-radius: 8px; padding: 6px 4px; text-align: center; }
.lv-bal-cell b { display: block; font-family: var(--mono); font-size: 15px; }
.lv-bal-cell span { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
.lv-bal-cell.left { border-color: rgba(72, 199, 116, 0.55); }
.lv-bal-cell.left b { color: var(--in); }
.lv-card { margin-top: 8px; }
.lv-form { display: flex; gap: 8px; flex-wrap: wrap; }
.lv-field { flex: 1 1 130px; min-width: 0; font-size: 10.5px; color: var(--ink-faint); }
.lv-field .pam-input { margin: 3px 0 6px; }
/* The date pickers' calendar button: Chromium draws it black, invisible on
   the dark panel (Kais, 2026-10-14), so it is filtered to the accent. */
.lv-field input[type="date"]::-webkit-calendar-picker-indicator { opacity: 1; cursor: pointer; filter: invert(72%) sepia(64%) saturate(520%) hue-rotate(-12deg) brightness(104%); }
.lv-field input[type="date"] { color-scheme: dark; }
.lv-check { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--ink-dim); margin: 2px 0 2px; }
.lv-note { margin-top: 6px; }
/* A coming shift of the reader's, with its "offer a swap" button. */
.lv-sub { margin: 10px 0 0; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); }
/* An open swap offer, in the popup and under "waiting on me". */
.lv-offer-text { font-size: 12.5px; line-height: 1.45; }
.lv-weeks-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.lv-nav { display: flex; gap: 10px; }
.lv-week-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-bottom: 8px; }
.lv-week { border-collapse: collapse; table-layout: fixed; width: 100%; min-width: 330px; font-size: 11px; }
.lv-week caption { text-align: left; font-size: 10.5px; color: var(--ink-dim); padding: 2px 0 4px; }
.lv-week th, .lv-week td { border-top: 1px solid var(--edge); padding: 3px 2px; }
.lv-dh { font-weight: 500; font-size: 9.5px; color: var(--ink-faint); text-align: center; white-space: nowrap; }
.lv-dh.today { color: var(--accent); }
.lv-who-h { width: 34%; }
.lv-who { text-align: left; font-weight: 400; max-width: 120px; }
.lv-who b { display: block; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lv-who-sub { display: block; font-size: 9.5px; color: var(--ink-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-day { position: relative; height: 26px; min-width: 26px; text-align: center; vertical-align: middle; }
.lv-day.we { background: var(--panel-lift); }
.lv-day.today { box-shadow: inset 0 0 0 1px rgba(240, 181, 70, 0.5); }
.lv-day.off { background: rgba(72, 199, 116, 0.55); }
.lv-day.maybe { background: repeating-linear-gradient(45deg, rgba(72, 199, 116, 0.35) 0 4px, transparent 4px 8px); }
.lv-oc { display: inline-block; font-family: var(--mono); font-size: 9.5px; font-weight: 700; line-height: 14px; min-width: 14px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(240, 181, 70, 0.55); margin: 0 1px; }
.lv-key { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 10.5px; color: var(--ink-faint); }
.lv-key-item { display: inline-flex; align-items: center; gap: 4px; }
.lv-sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--edge); }
.lv-sw.off { background: rgba(72, 199, 116, 0.55); }
.lv-sw.maybe { background: repeating-linear-gradient(45deg, rgba(72, 199, 116, 0.35) 0 3px, transparent 3px 6px); }
.lv-sw.oc { background: var(--accent-soft); border-color: rgba(240, 181, 70, 0.55); border-radius: 6px; }
.lv-mine { color: var(--ink); font-weight: 600; }
.lv-left { grid-column: 1 / -1; }
.lv-left b { font-size: 22px; font-variant-numeric: tabular-nums; }
.lv-who-left { font-weight: 400; font-variant-numeric: tabular-nums; }
.lv-rows { margin-top: 4px; }
.lv-row1 { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 4px 0; border-top: 1px solid var(--edge); font-size: 12px; }
.lv-r-day { min-width: 76px; font-weight: 600; }
.lv-r-hours { font-family: var(--mono); font-size: 11px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.lv-r-what { color: var(--ink-dim); flex: 1 1 auto; min-width: 0; }
.lv-tag { font-size: 10px; padding: 1px 6px; border-radius: 8px; border: 1px solid var(--edge); color: var(--ink-dim); }
.lv-tag.bad { color: var(--out); border-color: currentColor; }
.lv-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 11px; cursor: pointer; text-decoration: underline; }
.lv-link:disabled { opacity: 0.5; cursor: default; }
.lv-release { margin: 6px 0 8px; padding: 8px 10px; border: 1px solid var(--edge); border-radius: 8px; background: var(--panel-lift); }
.lv-plan-head { font-size: 12.5px; font-weight: 600; }
.lv-plan-sub { font-size: 11.5px; color: var(--ink-dim); margin: 4px 0 2px; }
.lv-picks { display: flex; flex-direction: column; gap: 2px; }
.lv-pick { display: flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.lv-plan-count { font-size: 11px; color: var(--ink-faint); margin-top: 4px; }
.lv-plan-count.bad { color: var(--accent); }
.lv-release .pam-actions { margin-top: 6px; }
.profile-release { margin: -2px 0 6px; font-size: 11.5px; }
.lv-menu-line { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; color: var(--ink-dim); }

/* Days off waiting on the reader: louder than a PAM request (Kais, 2026-11-18). */
.lv-veil { z-index: 60; background: rgba(0, 0, 0, 0.7); }
.lv-modal { width: min(560px, 100%); border: 2px solid rgba(72, 199, 116, 0.75); box-shadow: 0 0 0 6px rgba(72, 199, 116, 0.12), var(--shadow); padding: 22px 24px; }
.lv-pop-kind { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--in); font-weight: 600; margin-bottom: 8px; }
.lv-pop-title { font-size: 22px; line-height: 1.25; font-weight: 700; margin: 0 0 6px; color: var(--ink); }
.lv-pop-dates { font-size: 17px; font-weight: 600; color: var(--ink); margin: 0 0 12px; }
.lv-pop-span { font-size: 12px; color: var(--ink-dim); margin: -8px 0 12px; }
.lv-pop-note { font-size: 13px; color: var(--ink-dim); font-style: italic; margin: 0 0 10px; }
.lv-pop-actions .lv-pop-yes { font-size: 13px; padding: 9px 22px; }
.lv-pop-more { font-size: 11px; color: var(--ink-faint); margin-top: 8px; }

/* The timelock window (site/timelock.js): a chip in the corner while an
   operation waits on a governance timelock, and its popup. The chip takes
   the verdict's colour once the AI has checked; before that it is calm. */
.tlk-chip { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px);
  appearance: none; font: inherit; font-size: 12px; cursor: pointer; color: var(--ink); background: var(--panel-solid);
  border: 1px solid var(--edge-hi); border-radius: 999px; padding: 6px 12px 6px 10px; box-shadow: var(--shadow); }
.tlk-chip:hover { border-color: var(--accent); }
.tlk-chip-dot { flex: 0 0 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-dim); }
.tlk-chip.waiting .tlk-chip-dot { background: var(--accent); animation: tlk-pulse 2s ease-in-out infinite; }
.tlk-chip.ok .tlk-chip-dot { background: var(--in); }
.tlk-chip.warn .tlk-chip-dot { background: var(--accent); }
.tlk-chip.bad .tlk-chip-dot { background: var(--danger); }
.tlk-chip.bad { border-color: rgba(238, 94, 83, 0.7); }
.tlk-chip-label { color: var(--ink-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tlk-chip-time { font-family: var(--mono); font-weight: 600; white-space: nowrap; }
@keyframes tlk-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .tlk-chip.waiting .tlk-chip-dot { animation: none; } }
.tlk-modal { width: min(560px, 100%); }
.tlk-count { margin: 8px 0 12px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--edge); background: var(--panel-lift); }
.tlk-count-big { font-family: var(--mono); font-size: 28px; font-weight: 600; letter-spacing: 0.02em; line-height: 1.1; }
.tlk-count.waiting .tlk-count-big { color: var(--accent); }
.tlk-count.ready .tlk-count-big { color: var(--danger); }
.tlk-count-sub { font-size: 12px; color: var(--ink-dim); margin-top: 4px; line-height: 1.45; }
.tlk-what { margin: 0 0 10px; }
.tlk-headline { font-size: 13px; line-height: 1.5; margin: 4px 0 6px; color: var(--ink); }
.tlk-calls { margin: 2px 0 6px; padding-left: 18px; font-size: 12px; line-height: 1.5; color: var(--ink); }
.tlk-calls li { margin: 1px 0; }
.tlk-ids { word-break: break-word; }
.tlk-verdict .pam-check-head { flex-wrap: wrap; }
.tlk-verdict .pam-check-title { white-space: nowrap; }
/* The phone layout has a tab bar along the bottom: the chip sits above it. */
@media (max-width: 820px) {
  .tlk-chip { right: 12px; bottom: calc(56px + env(safe-area-inset-bottom, 0px)); font-size: 11.5px; padding: 5px 10px 5px 9px; }
  .tlk-count-big { font-size: 24px; }
}

/* A vote that is out (site/pam.js decide): a spinner beside the words. */
.pam-status.pam-voting { display: flex; align-items: center; gap: 8px; }
.pam-spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--edge); border-top-color: var(--in); animation: pam-spin 0.8s linear infinite; flex: none; }
@keyframes pam-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pam-spin { animation-duration: 2.4s; } }
