/* SHELEG Design, Phosphor token layer.
   Copy verbatim; consume only var(--…) in components. */
:root {
  /* ---- Field and ink ------------------------------------------------------
     MEASURED 2026-11-18 off https://assessment.passioncode.ai/ with
     getComputedStyle through CDP at 1440x900, an emulated 768x1024x2 and an
     emulated 390x844x2. The page's own palette lives in ONE authored block
     (the `html.matrix` rule in /story/matrix.css), which remaps the host design
     system's roles locally; every value below was read off a painted element
     and cross-checked against that block. Text-node census at 1440: #e6ffee on
     563 nodes, #00ff66 on 372, #8fbf9f on 242.

     One field and no light twin. The register is a lit terminal: the field is
     a green-black, never a neutral one, so even the darkest step carries the
     phosphor's hue. */
  color-scheme: dark;
  --bg: #020604; /* MEASURED, the body field, 68 painted backgrounds */
  --panel: #06100a; /* 1.05:1 on --bg, MEASURED, the instrument cell, 34 elements */
  --panel-raised: #0a1a10; /* 1.13:1 on --bg, MEASURED, a chat line's fill */
  --face: #1d3326; /* 1.51:1 on --bg, MEASURED, the initials disc and an idle bar */

  --ink: #e6ffee; /* 19.32:1 on --bg, MEASURED, body and headings */
  --ink-muted: #8fbf9f; /* 9.82:1 on --bg, MEASURED, the lede and every secondary line */
  --ink-caption: #bfffd6; /* 17.95:1 on --bg, MEASURED, mono captions over the scene */
  --ink-bright: #d6ffe2; /* 18.69:1 on --bg, MEASURED, the rain's leading glyph and the light end of every gradient */

  /* ---- The hairline ladder ------------------------------------------------
     A dark green rule and a brighter one. Neither is ever a word.
     @role non-text: --line, --line-strong, rules and control borders. */
  --line: #14331f; /* 1.48:1 on --bg, MEASURED, the quiet border */
  --line-strong: #2e6a45; /* 3.17:1 on --bg, MEASURED, a control's border */

  /* ---- THE phosphor -------------------------------------------------------
     One green does every functional job: the action fill, a heading in a mono
     panel, a link, the focus ring, a chart line, the glow. It is text-safe at
     15.04:1, which is what lets it set a word as well as fill a button. The
     label ON a filled phosphor is the near-black green, never white. */
  --accent: #00ff66; /* 15.04:1 on --bg, MEASURED, 372 text nodes and 34 fills */
  --accent-hover: #5cff9a; /* 15.75:1 on --bg, MEASURED, the hover step */
  --on-accent: #001a09; /* 13.45:1 on --accent, MEASURED, the label on a filled phosphor */
  --accent-deep: #00a63e; /* 6.33:1 on --bg, MEASURED, the dark stop of the core's radial */
  /* @role non-text: --accent-soft, --face, fills under a word, never the word. */
  --accent-soft: #063a1a; /* 1.58:1 on --bg, MEASURED, a quiet phosphor fill */

  /* The phosphor's alpha ladder. Each step was measured as a hex-alpha
     literal in the reference (#00ff6614 to #00ff66aa) and is written here as
     the same channels at the same alpha. Written as literals, not relative
     colour, so a browser without relative colour still paints every glow; if
     --accent moves, move these with it.
     @role non-text: --accent-haze, --accent-wash, --accent-trace, --accent-edge, --accent-rim, --accent-halo, washes, rules, glows, never a word. */
  --accent-haze: rgba(0, 255, 102, 0.08); /* MEASURED #00ff6614, an inset glow */
  --accent-wash: rgba(0, 255, 102, 0.133); /* MEASURED #00ff6622, a panel's offset shadow, a window's glow */
  --accent-trace: rgba(0, 255, 102, 0.2); /* MEASURED #00ff6633, the agent line's glow, the bar's rule */
  --accent-edge: rgba(0, 255, 102, 0.25); /* MEASURED #00ff6640, dashed rules and cell offset shadows */
  --accent-rim: rgba(0, 255, 102, 0.333); /* MEASURED #00ff6655, a panel's border, the chip border */
  --accent-halo: rgba(0, 255, 102, 0.533); /* MEASURED #00ff6688, the glow colour */

  /* ---- Glass --------------------------------------------------------------
     A window over the scene is the field itself at 85% with a blur behind it,
     so the rain shows through and the text still clears AA (see the pack's
     Gotchas for the arithmetic). The channels are --bg's; measured as rgba. */
  --glass: rgba(2, 6, 4, 0.85); /* MEASURED, the chat window, 0.85 */
  --glass-panel: rgba(2, 6, 4, 0.88); /* MEASURED, a story panel, #020604e0 */
  --glass-bar: rgba(2, 6, 4, 0.82); /* MEASURED, the top bar, 82% mix */
  --blur-glass: 8px; /* MEASURED, the chat window's backdrop blur */
  --blur-bar: 10px; /* MEASURED, the top bar's backdrop blur */

  /* ---- The comic keyline --------------------------------------------------
     The reference calls this token ink and sets it to pure black: the outline
     around a balloon and the hard offset shadow under a pressed control. It is
     renamed here because in this library `--ink` is the text colour, and pure
     black as text is banned. It is never a text colour and never a field.
     @role non-text: --keyline, an outline and an offset shadow only. */
  --keyline: #000000; /* MEASURED, the reference's comic ink (pure black), outlines and offset shadows */

  /* The speech balloon is the one light object on the page.
     @role non-text: --balloon, a fill; its text is --on-balloon. */
  --balloon: #e9fff1; /* MEASURED, the balloon fill, 16 balloons */
  --on-balloon: #06110b; /* 18.34:1 on --balloon, MEASURED as declared; see Gotchas for what actually painted */
  --balloon-who: #2a6a44; /* 6.18:1 on --balloon, MEASURED, the speaker label */

  /* ---- Status -------------------------------------------------------------
     The reference maps its host's positive role straight onto the phosphor, so
     --ok IS the accent (an alias, not a second green). --danger is MEASURED:
     the cost line, the stamp and the falling arrow, 20 text nodes. --warn is
     SELECTED: the reference paints this gold on 20 nodes as the marker of the
     guarded thing (the vault, the loop's core), and the pack assigns it the warn
     role because it is the only third hue the page owns. There is no info role:
     a fourth would be a second phosphor or an invented hue. */
  --ok: var(--accent); /* MEASURED, the host's positive role remapped to the phosphor */
  --warn: #ffd21a; /* 14.06:1 on --bg, SELECTED, a measured hue given the warn role */
  --danger: #ff4d6d; /* 6.34:1 on --bg, MEASURED */

  /* ---- Glow ---------------------------------------------------------------
     The signature light. Every glow is the phosphor at --accent-halo, centred
     (zero offset), and the blur names its job. MEASURED off the reference's
     `--glow:0 0 12px #00ff6688` and the text shadows beside it. */
  --glow: 0 0 12px var(--accent-halo); /* MEASURED, a lit control, a live dot */
  --glow-text: 0 0 18px var(--accent-halo); /* MEASURED, a mono headline or the hero's emphasis */
  --glow-action: 0 0 24px var(--accent-rim); /* MEASURED, the primary button's light */
  --glow-window: 0 0 60px var(--accent-wash); /* MEASURED, the chat window's ambient light */

  /* The comic offsets: hard, unblurred, down and to the right. */
  --offset-keyline: 4px 4px 0 var(--keyline); /* MEASURED, a balloon, a pressed control */
  --offset-panel: 8px 8px 0 var(--accent-wash); /* MEASURED, a story panel */
  --offset-cell: 4px 4px 0 var(--accent-edge); /* MEASURED, an instrument cell */

  /* The halftone dot screen behind a scene. MEASURED: 1.1px dots of the
     phosphor at #00ff6626 on a 7px pitch. */
  --halftone: radial-gradient(rgba(0, 255, 102, 0.15) 1.1px, transparent 1.4px) 0 0 / 7px 7px;

  /* ---- Radii: a ramp from a 3px tag to a 999px control --------------------
     Counted over the painted page. Not proportional: each step is an object.
     A control is a pill; a story panel is nearly square; a window is soft. */
  --r-tag: 3px; /* MEASURED, the panel number tag */
  --r-glass: 4px; /* MEASURED, a glass panel docked over a full-screen scene */
  --r-panel: 6px; /* MEASURED, the story panel */
  --r-cell: 8px; /* MEASURED, instrument cells and the solid card */
  --r-window: 14px; /* MEASURED, a floating chat window and a chat line's three soft corners */
  --r-balloon: 18px; /* MEASURED, the speech balloon */
  --r-pill: 999px; /* MEASURED, every control: the action, the toggle, the chip */

  /* ---- Motion -------------------------------------------------------------
     The interface clock is the host's: one curve, two short steps. The story
     clock is longer and stepped where it imitates a terminal. Durations in ms
     are MEASURED off the stylesheets; nothing here is interpolated. */
  --ease-ui: cubic-bezier(0.2, 0, 0, 1); /* MEASURED, the host's one curve */
  --ease-settle: cubic-bezier(0.2, 1, 0.3, 1); /* MEASURED, a story frame settling into place */
  --dur-hover: 120ms; /* MEASURED, colour on hover */
  --dur-state: 180ms; /* MEASURED, a control changing state */
  --dur-line: 0.35s; /* MEASURED, a chat line arriving */
  --dur-enter: 0.7s; /* MEASURED, a story frame entering the view */
  --dur-type: 0.7s; /* MEASURED, a headline typed on in 24 steps */
  --dur-draw: 1s; /* MEASURED, the connector arrow drawing itself */
  --dur-cursor: 1.6s; /* MEASURED, the waiting cursor's blink, two steps */
  --dur-glyph: 140ms; /* MEASURED, the rain's leading glyph changing */
  --stagger: 160ms; /* MEASURED, instruments inside a story frame, one after another */

  /* ---- The rain -----------------------------------------------------------
     MEASURED off /story/rain.js: a canvas of falling glyph columns behind the
     page at half opacity. Columns are one glyph wide; each falls at 40 to 130
     px a second, trails 8 to 30 glyphs, its head in --ink-bright and its tail in
     --accent fading to nothing. A canvas cannot read a custom property's
     colour by itself; the component reads these with getComputedStyle. */
  --rain-opacity: 0.5; /* MEASURED, the canvas element's opacity */
  --rain-glyph: 16px; /* MEASURED, glyph size and column pitch; 13px below 700px */
  --rain-glyph-narrow: 13px; /* MEASURED */
}

/* ---- Reduced motion -------------------------------------------------------
   MOTION_DOCTRINE.md §9. Every duration collapses, and the stagger with them.

   TWO THINGS THIS BLOCK CANNOT DO, stated here because each is a trap:
   1. The rain is a canvas drawn by requestAnimationFrame. A custom property
      stops nothing in it. The component layer must not start the loop at all
      under this query and must hide the canvas; the reference does both
      (`display:none` on the canvas, and no frame is drawn).
   2. The waiting cursor's blink is an infinite animation. Its duration
      collapses here like every other, and a collapsed infinite animation
      strobes, so the component layer must also stop it: the kit does it with
      `animation-play-state: paused` inside its own reduced-motion branch. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-hover: 0.01ms;
    --dur-state: 0.01ms;
    --dur-line: 0.01ms;
    --dur-enter: 0.01ms;
    --dur-type: 0.01ms;
    --dur-draw: 0.01ms;
    --dur-cursor: 0.01ms;
    --dur-glyph: 0.01ms;
    --stagger: 0s;
  }
}

/* @adapter, the semantic token contract. Pack comparison mounts packs through
   these roles, so two packs can carry one component without a shared native
   vocabulary. NO CSS-swap promise: components keep consuming the pack's own
   tokens; the adapter exists for the comparison harness, and a role neither
   mapped nor declared @absent blocks the comparison BEFORE any render. */
:root {
  --sem-surface: var(--bg);
  --sem-surface-raised: var(--panel);
  --sem-text: var(--ink);
  --sem-text-muted: var(--ink-muted);
  --sem-line: var(--line);
  --sem-primary: var(--accent);
  --sem-on-primary: var(--on-accent);
  --sem-positive: var(--ok);
  --sem-caution: var(--warn);
  --sem-negative: var(--danger);
}

/* ── components ── */
/* Measured off https://assessment.passioncode.ai/ on 2026-11-18. No colour
   literal appears below this line: every value is a token, so moving a token
   moves the whole kit. Every component declares border-box, because a button
   and an anchor default to different box models and a pill that grows by its
   own padding breaks the measured heights. */

.ph-btn,
.ph-card,
.ph-chip,
.ph-glass,
.ph-line,
.ph-balloon,
.ph-panel,
.ph-cell,
.ph-empty,
.ph-duotone {
  box-sizing: border-box;
}

/* ---- The rain: fixed, behind everything, never interactive. */
.ph-rain {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  z-index: 0;
  pointer-events: none;
  opacity: var(--rain-opacity);
}

/* ---- Buttons. The phosphor fills; its label is the near-black green. */
.ph-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font: 700 14px/21px Inter, ui-sans-serif, -apple-system, system-ui, sans-serif;
  padding: 8px 14px;
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  text-decoration: none;
  transition: background-color var(--dur-hover) var(--ease-ui),
    color var(--dur-hover) var(--ease-ui),
    box-shadow var(--dur-hover) var(--ease-ui),
    transform var(--dur-hover) var(--ease-ui);
}
.ph-btn--primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 0 2px var(--keyline), var(--offset-keyline), var(--glow-action);
}
.ph-btn--primary:hover { background: var(--accent-hover); }
/* The press sits the button into its own offset: it moves by the offset and the
   offset shrinks to nothing, so the shadow and the button meet. */
.ph-btn--primary:active {
  transform: translate(4px, 4px);
  box-shadow: 0 0 0 2px var(--keyline), 0 0 0 var(--keyline), var(--glow-action);
}
.ph-btn--secondary {
  background: none;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
}
.ph-btn--secondary:hover,
.ph-btn--secondary[aria-pressed='true'] {
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent), var(--glow);
}
.ph-btn--ghost { background: none; color: var(--ink); padding-inline: 6px; }
.ph-btn--ghost:hover { color: var(--accent); }
.ph-btn--sm { font-size: 12px; line-height: 18px; padding: 5px 12px; }
.ph-btn--lg { font-size: 18px; line-height: 27px; padding: 14px 22px; }
.ph-btn:disabled {
  background: var(--panel-raised);
  color: var(--ink-muted);
  box-shadow: none;
  transform: none;
  cursor: not-allowed;
}

/* ---- Focus: a PACK DECISION. The reference declares no focus-visible outline. */
.ph-btn:focus-visible,
.ph-chip:focus-visible,
.ph-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---- The solid instrument card. */
.ph-card {
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: var(--r-cell);
  padding: 12px 14px;
  color: var(--ink);
}
.ph-card__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.ph-card__title { margin: 0; font: 700 13px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--accent); }
.ph-card__meta { font: 400 12px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink-muted); }
.ph-card__body { font: 400 16px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; }

/* ---- The chip. */
.ph-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid var(--accent-rim);
  border-radius: var(--r-pill);
  background: var(--panel);
  font: 600 12px/1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ph-chip--accent { color: var(--accent); }
.ph-chip.is-selected { box-shadow: var(--glow); }

/* ---- Headings: the human voice and the machine voice. */
.ph-h { margin: 0; }
.ph-h--1 {
  font: 800 clamp(38px, 4.4vw, 68px) / 1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 16ch;
  text-wrap: balance;
}
.ph-h--1 em { font-style: normal; color: var(--accent); text-shadow: var(--glow-text); }
.ph-h--2 {
  font: 700 clamp(20px, 2.2vw, 28px) / 1.15 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: var(--accent);
}
.ph-h--3 {
  font: 700 12px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

/* ---- Rules. */
.ph-rule { border: 0; border-top: 1px dashed var(--accent-edge); margin: 0; }
.ph-rule--strong { border-top: 1px solid var(--line-strong); }

/* ---- The figure. */
.ph-stat { display: flex; flex-direction: column; gap: 4px; }
.ph-stat__value { font: 800 40px/1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--accent); text-shadow: var(--glow-text); }
.ph-stat__label { font: 400 16px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; color: var(--ink); }
.ph-stat__source { font: 400 12px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink-muted); }

/* ---- Glass: a window over the rain. Functional glass, so the rain stays legible
   behind a thing that must be read. A container: its lines size by its width. */
.ph-glass {
  position: relative;
  container-type: inline-size;
  width: min(640px, 100%);
  background: var(--glass);
  backdrop-filter: blur(var(--blur-glass));
  border: 1px solid var(--accent-rim);
  border-radius: var(--r-window);
  box-shadow: var(--glow-window);
  color: var(--ink);
}
.ph-glass__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px dashed var(--accent-edge);
  font: 700 17px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
.ph-glass__meta { margin-left: auto; font: 400 12px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink-muted); }
.ph-glass__body { display: flex; flex-direction: column; gap: 14px; padding: 18px 20px; }
.ph-glass--brackets::before,
.ph-glass--brackets::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2px solid var(--accent);
  pointer-events: none;
}
.ph-glass--brackets::before { left: -2px; top: -2px; border-right: 0; border-bottom: 0; }
.ph-glass--brackets::after { right: -2px; bottom: -2px; border-left: 0; border-top: 0; }

/* ---- A chat line. */
.ph-line { display: flex; gap: 12px; align-items: flex-start; }
.ph-line__face {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  background: var(--face);
  color: var(--ink-bright);
  font: 700 15px/1 Inter, ui-sans-serif, system-ui, sans-serif;
}
.ph-line__who { display: block; margin-bottom: 3px; font: 600 13px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink-muted); }
.ph-line__text {
  margin: 0;
  padding: 10px 14px;
  font: 400 19px/1.4 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
  background: var(--panel-raised);
  border: 1px solid var(--line);
  border-radius: 4px var(--r-window) var(--r-window) var(--r-window);
}
.ph-line--agent .ph-line__text { border-color: var(--accent); box-shadow: 0 0 18px var(--accent-trace); }
.ph-line--system { justify-content: center; }
.ph-line--system .ph-line__text {
  padding: 0;
  background: none;
  border: 0;
  font: 600 15px/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  color: var(--accent);
}
/* CONTAINER: the window decides, not the screen. */
@container (max-width: 560px) {
  .ph-line__text { font-size: 16px; }
}

/* ---- The balloon: the one light object. The text selector is two classes deep on
   purpose, so a surrounding `.ph-panel p` (or the reference's `.panel p`) cannot
   repaint it pale on a pale fill. */
.ph-say { display: flex; gap: 12px; align-items: flex-end; margin: 12px 0; }
.ph-say--right { flex-direction: row-reverse; }
.ph-balloon {
  position: relative;
  max-width: 520px;
  padding: 10px 16px;
  background: var(--balloon);
  border: 2px solid var(--keyline);
  border-radius: var(--r-balloon);
  box-shadow: var(--offset-keyline);
}
.ph-balloon::after {
  content: '';
  position: absolute;
  bottom: 10px;
  left: -12px;
  border: 8px solid transparent;
  border-right-color: var(--keyline);
  border-bottom-color: var(--keyline);
}
.ph-say--right .ph-balloon::after { left: auto; right: -12px; border-right-color: transparent; border-left-color: var(--keyline); }
.ph-balloon .ph-balloon__who {
  display: block;
  font: 700 11px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--balloon-who);
}
.ph-balloon .ph-balloon__text { margin: 2px 0 0; font: 400 18px/1.35 Inter, ui-sans-serif, system-ui, sans-serif; color: var(--on-balloon); }

/* ---- The story panel: this pack's card, and a container for its instruments. */
.ph-panel {
  container-type: inline-size;
  width: min(760px, 100%);
  padding: 26px 28px;
  background: var(--glass-panel);
  border: 2px solid var(--accent-rim);
  border-radius: var(--r-panel);
  box-shadow: var(--offset-panel);
  color: var(--ink);
}
.ph-panel--wide { width: min(1000px, 100%); }
.ph-panel p { color: var(--ink); }
.ph-panel__title { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.ph-panel__tag {
  padding: 2px 8px;
  border-radius: var(--r-tag);
  background: var(--accent);
  color: var(--on-accent);
  font: 700 12px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}
.ph-panel__heading { margin: 0; font: 700 clamp(20px, 2.2vw, 28px) / 1.15 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--accent); }
.ph-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0; padding: 0; list-style: none; }
.ph-cell {
  padding: 8px 12px;
  background: var(--panel);
  border: 1px solid var(--accent);
  border-radius: var(--r-cell);
  box-shadow: var(--offset-cell);
  font: 600 14px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
  color: var(--ink);
}
/* SELF: the panel's own padding steps at the reference's one breakpoint. The
   panel establishes the container, so it cannot query itself; a viewport query
   is the only answer, and it touches nothing but the panel's padding. */
@media (max-width: 860px) {
  .ph-panel { padding: 18px 16px; }
}
/* CONTAINER: a balloon steps down by the panel's width, not the screen's. */
@container (max-width: 560px) {
  .ph-balloon .ph-balloon__text { font-size: 16px; }
}
/* CONTAINER: four, then two, then one, by the panel's own width. */
@container (max-width: 560px) {
  .ph-cells { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 300px) {
  .ph-cells { grid-template-columns: minmax(0, 1fr); }
}

/* ---- The connector: one stroke, drawn once. */
.ph-connector { display: flex; align-items: center; gap: 6px; }
.ph-connector__arrow {
  width: 120px;
  height: 110px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 240;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 6px var(--accent-halo));
  animation: ph-draw var(--dur-draw) cubic-bezier(0, 0, 0.58, 1) both;
}
@keyframes ph-draw { from { stroke-dashoffset: 240; } to { stroke-dashoffset: 0; } }
.ph-connector__carries { max-width: 240px; font: 600 13px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--accent); }

/* ---- Duotone portraits. */
.ph-duotone { display: block; flex: none; overflow: hidden; }
.ph-duotone img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.ph-duotone--round { border-radius: var(--r-pill); box-shadow: 0 0 0 1px var(--line-strong); }
.ph-duotone--tile { border-radius: var(--r-balloon); box-shadow: 0 0 0 2px var(--accent), var(--glow-window); }

/* ---- The terminal headline. */
.ph-prompt { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ph-prompt__chapter { font: 600 11px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.14em; color: var(--accent); }
.ph-prompt__chapter::before { content: '[ CH '; opacity: 0.6; }
.ph-prompt__chapter::after { content: ' ]'; opacity: 0.6; }
.ph-prompt__line { margin: 0; font: 700 clamp(22px, 2.4vw, 34px) / 1.1 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--accent); text-shadow: var(--glow-text); }
.ph-prompt__line::before { content: '> '; opacity: 0.55; }
.ph-prompt--typed .ph-prompt__line { animation: ph-type var(--dur-type) steps(24, end) both; }
@keyframes ph-type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

/* ---- The loader: a waiting line and a blinking block cursor. */
.ph-waiting { margin: 0; font: 400 12px/1.3 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); }
.ph-waiting__cursor { display: inline-block; width: 0.6em; height: 1.1em; margin-left: 6px; vertical-align: -0.2em; background: var(--accent); animation: ph-blink var(--dur-cursor) steps(2) infinite; }
@keyframes ph-blink { 50% { opacity: 0.35; } }

/* ---- The empty state. */
.ph-empty { padding: 16px 20px; border: 1px dashed var(--accent-edge); border-radius: var(--r-cell); }
.ph-empty__prompt { margin: 0 0 6px; font: 400 13px/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; color: var(--ink-muted); }
.ph-empty__prompt::before { content: '> '; }
.ph-empty__text { margin: 0; font: 400 16px/1.5 Inter, ui-sans-serif, system-ui, sans-serif; color: var(--ink); }

/* ---- The select, the reference's only field. */
.ph-select {
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  padding: 4px 8px;
  font: 600 12px/1.3 Inter, ui-sans-serif, system-ui, sans-serif;
}
.ph-select:hover { border-color: var(--accent); }

/* ---- Touch: a PACK DECISION. The measured bar button is 37px; on a coarse
   pointer every button reaches the 44px tap floor. A pointer query, not a width. */
@media (pointer: coarse) {
  .ph-btn { min-height: 44px; }
}

/* ---- Degrade to calm: MOTION_DOCTRINE.md §9. The token layer collapses every
   duration; this branch does what a custom property cannot. The rain is hidden
   (and Rain.tsx never starts its loop). The cursor's infinite blink is paused
   rather than collapsed, which would strobe. The connector and the typed line
   render finished. */
@media (prefers-reduced-motion: reduce) {
  .ph-rain { display: none; }
  .ph-waiting__cursor { animation-play-state: paused; opacity: 1; }
  .ph-connector__arrow { animation: none; stroke-dashoffset: 0; }
  .ph-prompt--typed .ph-prompt__line { animation: none; clip-path: none; }
  .ph-btn { transition: none; }
}
