/* =========================================================================
   SWARMIO — Season 2

   Colour, type, wood and theme live in /tokens.css (loaded first), shared by
   every surface. This sheet lays the app out on top of those tokens. The
   pre-Season-2 names (--paper, --ink-faint, --amber, --mono…) are aliased
   there, so older rules resolve to the new palette without a rewrite.
   ========================================================================= */

:root {
  --gutter: clamp(1.25rem, 4vw, 4rem);
  --maxw: 1180px;

  /* Minimum hit targets — Fitts's Law. Coarse pointers get 44px (Apple HIG /
     WCAG 2.2 spacing-exception threshold), fine pointers 32px, a primary CTA
     40px. Floors applied with min-height/min-width, so a control can still be
     visually small: the box grows, the ink does not. --target-gap is the
     minimum distance between two ADJACENT targets. */
  --target-touch: 44px;
  --target-pointer: 32px;
  --target-cta: 40px;
  --target-gap: 8px;
  --target-min: var(--target-pointer);
}

/* Any coarse pointer — phone, tablet, touchscreen laptop — gets the 44px floor
   regardless of viewport width; `pointer: coarse` rather than a width
   breakpoint is what covers a tablet in landscape, which is wide enough to look
   like a desktop and is still driven by a thumb.

   The width clause is not redundant with it. The stylesheet's existing mobile
   block already gives every `button` a 44px floor under 40rem, and the rules
   that read --target-min are more specific than a bare `button`, so without
   this they would come along LATER and quietly lower those controls to 32.
   Measured that exact regression: .credits, .status-dot, .back-link,
   .adv__toggle and .footer__motion all went 44 -> 32 on a 390px viewport. */
@media (pointer: coarse), (max-width: 40rem) {
  :root {
    --target-min: var(--target-touch);
  }
}

/* Capability identity. Season 2 keeps one loud colour (ochre, for actions);
   a capability's own colour is an identity hue read by --cap / .idot — a dot
   beside its name, never a repaint of the page. Each hue is today's capability
   colour converted to OKLCH hue, so people still recognise their modes.
   Research (50) is the default from tokens.css. */
[data-mode="news"] { --cap-h: 232; }
[data-mode="ask"] { --cap-h: 253; }
[data-mode="plan"] { --cap-h: 188; }
[data-mode="finance"] { --cap-h: 84; }
[data-mode="seo"] { --cap-h: 297; }
[data-mode="product"] { --cap-h: 156; }
[data-mode="security"] { --cap-h: 26; }

/* Phase-3 verticals. Each needs an accent distinct from the six above and
   from its neighbours, or the capability grid reads as one colour. */
/* The life modes. The palette is dense by this point — sixteen hues are already
   spoken for — so these six were chosen to be unmistakable from EACH OTHER,
   which is what matters: the homepage groups them together, so they are seen
   side by side and rarely next to their nearest neighbour elsewhere. */
[data-mode="trainer"] { --cap-h: 38; }
[data-mode="meals"] { --cap-h: 131; }
[data-mode="wellness"] { --cap-h: 208; }
[data-mode="mentor"] { --cap-h: 298; }
[data-mode="money"] { --cap-h: 349; }
[data-mode="trips"] { --cap-h: 85; }
[data-mode="scholar"] { --cap-h: 269; }
[data-mode="leads"] { --cap-h: 53; }
[data-mode="grants"] { --cap-h: 171; }
[data-mode="diligence"] { --cap-h: 314; }
[data-mode="supply"] { --cap-h: 1; }
[data-mode="resume"] { --cap-h: 229; }
[data-mode="brief"] { --cap-h: 97; }
[data-mode="quote"] { --cap-h: 141; }
[data-mode="policy"] { --cap-h: 278; }

/* ------------------------------------------------------------------ reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  /* clip, never hidden: overflow-x:hidden on html/body makes both scroll
     containers and WebKit/iOS then refuses to scroll the document at all —
     users could not reach the signup form on mobile. */
  overflow-x: clip;
  max-width: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  background: none;
  border: none;
}
a {
  color: var(--amber);
  text-decoration: none;
}
a:hover {
  color: var(--amber-bright);
}
::selection {
  background: color-mix(in oklab, var(--fill) 35%, transparent);
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ------------------------------------------------------------- atmosphere */
/* Season 2 is a flat seafoam room: no gradient wall, glow, contour canvas,
   grain or vignette. The layers stay in the markup (index.html) but never
   paint, and app.js skips the contour loop when this is hidden. */
.atmosphere { display: none; }
.halftone { position: relative; }

/* --------------------------------------------------------------- shell */
.app {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 inline;
  margin-left: auto;
  margin-right: auto;
  padding-inline: var(--gutter);
}

/* Editorial label — small uppercase tracked text */
.eyebrow {
  font-family: var(--sans);
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.serif {
  font-family: var(--serif);
}

/* ---------------------------------------------------------- top masthead */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  /* Was 1.4rem. The masthead is on every screen and never holds content, so
     its padding is pure overhead repeated everywhere. */
  padding: 0.75rem var(--gutter);
  border-bottom: 1px solid var(--line-soft);
  /* Sits over the live background, so it gets the scrim rather than relying on
     whatever happens to be behind it. */
  background: var(--scrim);
  -webkit-backdrop-filter: var(--scrim-blur);
  backdrop-filter: var(--scrim-blur);
  /* backdrop-filter makes the masthead its own stacking context, so the inbox
     dropdown's z-index:60 only competed INSIDE it — and in the page context
     the whole masthead painted as a plain in-flow block, UNDER positioned
     page content like the hero subject (z-index: 1). Lifting the masthead
     itself carries its children with it: above page content (z ≤ 3), below
     the real overlays (More sheet 70, auth wall 80). */
  position: relative;
  z-index: 40;
}
.masthead__brand {
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--text-lede);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.masthead__brand b {
  color: var(--amber);
}
.masthead__meta {
  display: flex;
  gap: 1.2rem;
  align-items: center;
}
.masthead__link {
  /* The bar mixes <button>s with anchors (Code, Admin). Inside the min-height
     tap floor further down, a button centres its own content but an anchor does
     not — it sat at the top of the box and rode above the other links. So centre
     explicitly, and state the padding the buttons were only ever getting from the
     UA stylesheet (the button reset above clears border/background, not padding).
     Every entry is now the same box, in every browser, whatever element it is. */
  display: inline-flex;
  align-items: center;
  padding: 1px 6px 2px;
  font-size: var(--text-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
  border-bottom: 1px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.masthead__link:hover {
  color: var(--ink);
  border-color: var(--amber-deep);
}
/* The Admin badge is the one masthead item that must be unmistakable — a
   signed-in admin should see at a glance that they are one. */
.masthead__admin {
  color: var(--amber-bright);
  border: 1px solid var(--amber-deep);
  padding: 2px 0.55rem;
  text-decoration: none;
}
.masthead__admin:hover {
  color: var(--black);
  background: var(--amber);
  border-color: var(--amber);
}
button.status-dot {
  cursor: pointer;
}
.status-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--text-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.status-dot i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-faint);
  box-shadow: 0 0 0 0 currentColor;
}
.status-dot.is-ok i {
  background: var(--ok);
}
.status-dot.is-warn i {
  background: var(--warn);
}
.status-dot.is-live i {
  background: var(--amber-bright);
  animation: pulse 1.4s var(--ease) infinite;
}
@keyframes pulse {
  0% {  }
  70% {
    box-shadow: 0 0 0 7px transparent;
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}

/* =====================================================================
   HOME / LAUNCH
   ===================================================================== */
/* The hero is a masthead, not the product. It used to take 574px of an 844px
   phone screen, which pushed the prompt box — the thing people actually came
   to use — mostly below the fold. Everything here is scaled to roughly 30% of
   its former footprint so the panels are what you land on. */
.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(0.6rem, 1.8vh, 1.5rem) var(--gutter) clamp(0.45rem, 1.2vh, 0.9rem);
  /* Full-bleed: no max-width here. The light field runs out to the viewport
     edges and feathers into the page background, so there is no box edge
     anywhere that can visibly cut it. The CONTENT stays constrained — that
     moved to .hero__grid below. `overflow: hidden` stays as the
     no-horizontal-scroll guard. */
  width: 100%;
}
/* warm studio light thrown across the WHOLE viewport width. Two failure modes
   came before this: a masked spotlight blob whose mask edge was a visible
   line, and a content-box-clipped field whose right edge hard-cut to the dark
   page background. Now the field is full-bleed and a symmetric edge feather
   (NOT a shaped mask) takes it to zero exactly at the viewport edges — the
   light melts into the page instead of stopping at a rectangle. */
.hero::before {
  content: none;
}
/* type left, off-center; the lit subject to the right */
.hero__grid {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: clamp(0.5rem, 1.5vw, 1.2rem);
  align-items: center;
  /* Was min(56vh, 500px) — a half-screen reservation before a single pixel of
     content had been measured. */
  min-height: min(17vh, 150px);
}
.hero__copy {
  align-self: center;
}
.hero__wordmark {
  font-family: var(--display);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.03em;
  /* 30% of the old clamp(3.6rem, 11vw, 8rem). The lower bound is held a
     little above a literal 30% (1.08rem) so the wordmark still reads as a
     wordmark rather than as body copy on a narrow phone. */
  font-size: clamp(1.3rem, 3.3vw, 2.4rem);
  margin: 0.15rem 0 0;
  /* White, not the accent. The wordmark used to be amber-bright over an amber
     bloom, which put the loudest colour on the page directly on top of the
     warmest part of the background. Plain ink reads cleaner and lets the
     accent do its work where it means something. The glow stays — it is what
     separates the wordmark from the gradient behind it — but cooled, since it
     is no longer tinting type that was already orange. */
  color: var(--ink);
}
.hero__wordmark .dot {
  /* The colours swapped: with a white wordmark, an ink dot is invisible as a
     feature. The accent moves to the full stop, which keeps the brand's one
     spot of orange in the mark at a size that cannot shout. */
  color: var(--amber);
}
/* bold italic sans subtitle, echoing the ad's "sunset glow" line */
.hero__tagline {
  font-family: var(--sans);
  font-weight: 700;
  letter-spacing: -0.01em;
  /* Copy shrinks to ~60%, not 30%: below about 0.75rem this stops being
     readable, and an unreadable line saves no space worth having. */
  font-size: clamp(0.78rem, 1.1vw, 0.98rem);
  color: var(--ink);
  max-width: 40ch;
  margin: 0.35rem 0 0;
  text-wrap: balance;
}
/* lighter "ingredients" detail line */
.hero__ingredients {
  font-family: var(--sans);
  font-size: clamp(0.68rem, 0.9vw, 0.78rem);
  color: var(--ink-dim);
  margin: 0.2rem 0 0;
  letter-spacing: 0.02em;
}

/* the lit "subject": a swarm of glossy orbs on a reflective studio floor */
.hero__subject {
  position: relative;
  justify-self: center;
  width: clamp(66px, 9.6vw, 129px);
  aspect-ratio: 4 / 5;
  z-index: 1;
}
.hero__photo {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 34px 46px color-mix(in oklab, var(--shadow) 88%, transparent));
}
.hero__subject.has-photo .hero__photo {
  display: block;
}
.hero__subject.has-photo .orb,
.hero__subject.has-photo .hero__floor {
  display: none;
}
/* A capability's identity disc: flat, in its quiet identity hue (--cap).
   Reused by the hero orbs and the hub cards. */
.sphere {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--cap);
  box-shadow: inset 0 -3px 0 color-mix(in oklab, #000 12%, transparent);
}
.orb {
  position: absolute;
  animation: float 7s var(--ease) infinite;
}
.orb--main {
  width: 52%;
  left: 26%;
  top: 12%;
}
/* satellites — the "swarm" clustered around the hero */
.orb--s1 {
  width: 23%;
  left: 2%;
  top: 50%;
  animation-delay: 0.5s;
}
.orb--s2 {
  width: 18%;
  left: 68%;
  top: 2%;
  animation-delay: 1.1s;
}
.orb--s3 {
  width: 14%;
  left: 74%;
  top: 72%;
  animation-delay: 1.7s;
}
.hero__floor {
  display: none;
}
@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-11px);
  }
}
@media (prefers-reduced-motion: reduce) {
  :root:not(.motion-on) .orb {
    animation: none;
  }
}

/* the launch console */
.console {
  max-width: var(--maxw);
  margin: clamp(0.9rem, 2vh, 1.5rem) auto 0;
  width: 100%;
  padding-inline: var(--gutter);
}
.panel {
  position: relative;
  /* The panel is the reading surface, so it darkens and blurs whatever the
     live background is doing underneath. Without this the backdrop shows
     through the gradient's lighter stop and text contrast changes as the
     background animates — legible one moment, washed the next. */
  background: var(--card);
  -webkit-backdrop-filter: var(--scrim-blur);
  backdrop-filter: var(--scrim-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -40px color-mix(in oklab, var(--shadow) 100%, transparent);
}
.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Wrap rather than squeeze: on a phone "Continue this run" and "the whole
     thread comes with it" were each broken into two lines and set side by
     side, reading as one smashed heading. Wrapped, the sub-label drops to
     its own line; a short pair still shares one. */
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--line-soft);
}
.panel__body {
  padding: 1rem;
}

.ask {
  display: block;
}
.ask__label {
  display: block;
  margin-bottom: 0.7rem;
}
.ask__input {
  width: 100%;
  min-height: 132px;
  resize: vertical;
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--text-title);
  line-height: 1.5;
  padding: 1.1rem 1.2rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.ask__input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}
.ask__input:focus {
  border-color: var(--amber-deep);
  outline: none;
}

.ask__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}
.spacer {
  flex: 1;
}

/* primary action — a stamped, letter-pressed button */
.btn {
  --bg: var(--ink);
  --fg: var(--black);
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.85rem 1.6rem;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--text-meta);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: transform 0.12s var(--ease), filter 0.2s var(--ease),
    background 0.2s var(--ease);
}
.btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0) scale(0.98);
}
.btn--amber {
  --bg: var(--ochre);
  --fg: var(--ochre-ink);
}
.btn--amber:hover {
  --bg: var(--ochre-hi);
  filter: none;
}
.btn--ghost {
  --bg: transparent;
  --fg: var(--ink);
  border: 1px solid var(--line);
}
.btn--ghost:hover {
  border-color: var(--ink-faint);
  filter: none;
}
.btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  filter: none;
}
.btn__arrow {
  font-size: 1.05em;
  transition: transform 0.2s var(--ease);
}
.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* advanced options disclosure */
.adv {
  margin-top: 1rem;
  border-top: 1px solid var(--line-soft);
  padding-top: 1rem;
}
.adv__toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink-dim);
  font-size: var(--text-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.adv__toggle:hover {
  color: var(--ink);
}
.adv__grid {
  display: grid;
  /* Two columns, never more: auto-fit/minmax(150px) packed four-plus skinny
     inputs per row on a wide panel, which read as a spreadsheet, not a form.
     minmax(0, …) keeps tracks from forcing horizontal overflow on mobile. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
@media (max-width: 720px) {
  .adv__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* daily recap drawer — the hub's nightly one-paragraph brief */
.recap {
  margin: 1rem auto 0;
  max-width: 46rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--ink) 2%, transparent);
}
.recap__head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.recap__chev {
  color: var(--amber);
  font-size: var(--text-meta);
}
.recap__title {
  color: var(--ink);
  font-size: var(--text-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.recap__hint {
  color: var(--ink-faint);
  font-size: var(--text-label);
}
.recap__head:hover .recap__title {
  color: var(--amber-bright);
}
/* The drawer eases open instead of snapping: grid-rows 1fr→0fr animates the
   height, the inner collapses with it (min-height:0 + overflow:hidden), and
   the border fades so a hard line doesn't linger over a zero-height body.
   `.recap__body.hidden` out-specifies the global `.hidden{display:none}` —
   the element stays grid so the rows track has something to animate. */
.recap__body {
  display: grid;
  grid-template-rows: 1fr;
  padding: 0 0.9rem;
  transition: grid-template-rows 0.28s var(--ease);
}
.recap__body.hidden {
  display: grid !important;
  grid-template-rows: 0fr;
}
.recap__inner {
  min-height: 0;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  padding: 0.75rem 0 0.85rem;
  transition: border-color 0.28s var(--ease);
}
.recap__body.hidden .recap__inner {
  border-top-color: transparent;
}
.recap__text {
  color: var(--ink-dim);
  font-size: var(--text-body);
  line-height: 1.55;
  margin: 0 0 0.6rem;
}
.recap__text--dim {
  color: var(--ink-faint);
}
.recap__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.recap__stamp {
  color: var(--ink-faint);
  font-size: var(--text-micro);
}
.recap__regen {
  background: none;
  border: 0;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: var(--text-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.recap__regen:hover {
  color: var(--amber-bright);
}
.recap__make {
  margin-top: 0.25rem;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.field > span {
  font-size: var(--text-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
/* `.field__input` is the same control built by hand instead of by `field()`:
   the show's talkback box, the Following add row, the settings pickers, the
   calendar link. It was styled by NOTHING — no rule anywhere carried that
   class — so those twenty controls rendered in the browser's own chrome, a
   white box with system type dropped into the middle of a dark page. Listing
   it beside the descendant selectors keeps the two identical by construction
   rather than by a copy that drifts. */
.field input,
.field select,
.field__input {
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--text-body);
  padding: 0.6rem 0.7rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.field input:focus,
.field select:focus,
.field__input:focus {
  border-color: var(--amber-deep);
  outline: none;}
/* A placeholder at full --ink reads as a filled-in value. */
.field input::placeholder,
.field__input::placeholder,
.field textarea::placeholder {
  color: var(--ink-faint);
}
.hidden {
  display: none !important;
}

/* ------------------------------------------------------------- presets */
.presets {
  margin-top: 1.6rem;
}
.presets__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
}
.search {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
}
.search input {
  flex: 1;
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--text-body);
}
.search input:focus {
  outline: none;
}
.search__icon {
  color: var(--ink-faint);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: var(--text-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  white-space: nowrap;
  transition: all 0.18s var(--ease);
}
.chip:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}
.chip.is-active {
  background: var(--amber);
  border-color: var(--amber);
  color: var(--black);
  font-weight: 700;
}

.pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.7rem;
  max-height: 340px;
  overflow-y: auto;
  padding: 0.2rem 0.2rem 0.4rem;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.pack {
  text-align: left;
  padding: 0.85rem 0.95rem;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  transition: all 0.16s var(--ease);
}
.pack:hover {
  border-color: var(--amber-deep);
  background: var(--paper-raise);
  transform: translateY(-2px);
}
.pack__name {
  font-family: var(--sans);
  font-weight: 700;
  font-size: var(--text-body);
  margin-bottom: 0.25rem;
}
.pack__cat {
  font-size: var(--text-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
}
.pack__q {
  margin-top: 0.4rem;
  font-size: var(--text-label);
  color: var(--ink-faint);
  font-family: var(--mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pack-empty {
  padding: 2rem;
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--serif);
}

/* =====================================================================
   RUNNING / DASHBOARD
   ===================================================================== */
.run {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: clamp(0.9rem, 2vh, 1.5rem) var(--gutter) 2rem;
}
.run__head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.3rem;
  margin-bottom: 1.6rem;
}
.run__q {
  font-family: var(--serif);
  font-size: clamp(1.3rem, 3vw, 2rem);
  line-height: 1.24;
  max-width: 40ch;
  margin: 0.5rem 0 0;
}
.run__timer {
  font-family: var(--code);
  font-size: var(--text-meta);
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

/* the big "what's happening" headline */
.now {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1.1rem;
  align-items: center;
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  margin-bottom: 1.4rem;
}
.now__spin {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--amber-bright);
  animation: spin 0.9s linear infinite;
}
.now.is-done .now__spin {
  border: 2px solid var(--ok);
  border-top-color: var(--ok);
  animation: none;
  position: relative;
}
.now.is-done .now__spin::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ok);
  font-weight: 700;
}
.now.is-error .now__spin {
  border-color: var(--err);
  border-top-color: var(--err);
  animation: none;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.now__text .k {
  font-size: var(--text-micro);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.now__text .v {
  font-size: var(--text-lede);
  font-weight: 600;
  margin-top: 0.15rem;
}

/* stage tracker */
.stages {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.6rem;
  flex-wrap: wrap;
}
.stage {
  flex: 1;
  min-width: 120px;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper);
  opacity: 0.5;
  transition: all 0.3s var(--ease);
}
.stage.is-active {
  opacity: 1;
  border-color: var(--amber-deep);
  background: var(--paper-raise);
}
.stage.is-done {
  opacity: 1;
  border-color: var(--line);
}
.stage__n {
  font-family: var(--mono);
  font-size: var(--text-micro);
  color: var(--amber);
  letter-spacing: 0.1em;
}
.stage__t {
  font-size: var(--text-meta);
  font-weight: 600;
  margin-top: 0.2rem;
}
.stage.is-done .stage__n::after {
  content: " ✓";
  color: var(--ok);
}

/* metric row */
.metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.7rem;
  margin-bottom: 1.6rem;
}
.metric {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper);
}
.metric__v {
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--text-display);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.metric__k {
  margin-top: 0.4rem;
  font-size: var(--text-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* two-column: sub-questions/workers on left, activity ticker right */
.run__cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.2rem;
}
@media (max-width: 820px) {
  .run__cols {
    grid-template-columns: 1fr;
  }
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
}
.card__head {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.card__title {
  font-size: var(--text-micro);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.card__body {
  padding: 0.6rem;
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

/* worker / subquestion rows */
.wrow {
  display: flex;
  gap: 0.7rem;
  padding: 0.7rem 0.6rem;
  border-radius: var(--radius);
  border-bottom: 1px solid var(--line-soft);
  animation: fadein 0.4s var(--ease);
}
.wrow:last-child {
  border-bottom: none;
}
.wrow__dot {
  margin-top: 0.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
  background: var(--amber-bright);}
.wrow.is-active .wrow__dot {
  animation: pulse 1.4s var(--ease) infinite;
}
.wrow.is-done .wrow__dot {
  background: var(--ok);
  box-shadow: none;
}
.wrow.is-fail .wrow__dot {
  background: var(--err);
}
.wrow__main {
  min-width: 0;
}
.wrow__t {
  font-size: var(--text-meta);
  line-height: 1.4;
}
.wrow__meta {
  margin-top: 0.2rem;
  font-family: var(--mono);
  font-size: var(--text-micro);
  color: var(--ink-faint);
}

/* live activity ticker */
.tick {
  display: flex;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  font-family: var(--mono);
  font-size: var(--text-label);
  line-height: 1.4;
  border-bottom: 1px solid var(--line-soft);
  animation: fadein 0.3s var(--ease);
}
.tick:last-child {
  border-bottom: none;
}
.tick__t {
  color: var(--ink-faint);
  flex: none;
  font-size: var(--text-micro);
  padding-top: 0.08rem;
}
.tick__m {
  color: var(--ink-dim);
  min-width: 0;
  overflow-wrap: anywhere;
}
.tick.lv-warn .tick__m {
  color: var(--warn);
}
.tick.lv-error .tick__m {
  color: var(--err);
}
.tick.lv-browser .tick__m {
  color: var(--amber);
}
.tick__tag {
  color: var(--ink-faint);
  flex: none;
}
@keyframes fadein {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* =====================================================================
   REPORT
   ===================================================================== */
.report {
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
  padding: clamp(0.9rem, 2vh, 1.5rem) var(--gutter) 2rem;
}

/* The design studio is a workbench, not a prose report: the composer,
   inspiration panel, and template gallery need room to breathe, and the
   user reported the 900px measure "very squished". Specificity 0-2-0 so
   the wide-display .report media queries below cannot claw it back.
   Run reports keep the reading measure. */
.report.report--wide {
  max-width: 1560px;
}
.report__head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
}
.report__title {
  font-family: var(--serif);
  font-size: var(--text-display); /* fixed product-UI step, not vw fluid */
  line-height: 1.18;
  margin: 0.6rem 0 0;
}
.report__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.1rem;
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  font-family: var(--mono);
  font-size: var(--text-label);
  color: var(--ink-dim);
}
.badge b {
  color: var(--ink);
}
.badge.is-ok {
  border-color: color-mix(in oklab, var(--ok) 40%, transparent);
}

/* rendered markdown */
.md {
  font-size: var(--text-body);
  line-height: 1.7;
  color: var(--ink);
  overflow-wrap: break-word; /* long tokens/URLs wrap instead of widening the page */
}
.md h1,
.md h2,
.md h3,
.md h4 {
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 2.2rem 0 0.8rem;
}
.md h1 {
  font-size: var(--text-display);
}
.md h2 {
  font-size: var(--text-title);
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--line-soft);
}
.md h3 {
  font-size: var(--text-lede);
}
.md p {
  margin: 0.9rem 0;
}
.md ul,
.md ol {
  margin: 0.9rem 0;
  padding-left: 1.4rem;
}
.md li {
  margin: 0.35rem 0;
}
.md li::marker {
  color: var(--amber);
}
.md a {
  border-bottom: 1px solid var(--amber-deep);
}
.md code {
  font-family: var(--code);
  font-size: 0.86em;
  background: var(--paper-raise);
  padding: 0.12em 0.4em;
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
}
.md pre {
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  overflow-x: auto;
}
.md pre code {
  background: none;
  border: none;
  padding: 0;
}
.md blockquote {
  margin: 1rem 0;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink) 3.5%, transparent);
  color: var(--ink-dim);
  font-family: var(--serif);
  font-style: italic;
}
.md hr {
  border: none;
  border-top: 1px solid var(--line-soft);
  margin: 2rem 0;
}
.md table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: var(--text-body);
}
.md th,
.md td {
  border: 1px solid var(--line-soft);
  padding: 0.5rem 0.7rem;
  text-align: left;
}
.md th {
  background: var(--paper-raise);
}

/* sources bibliography */
.sources {
  margin-top: 3rem;
  border-top: 1px solid var(--line);
  padding-top: 1.6rem;
}
.sources h3 {
  font-size: var(--text-micro);
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 1rem;
}
.source {
  display: flex;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--text-meta);
}
.source__n {
  font-family: var(--mono);
  color: var(--amber);
  flex: none;
}
.source__u {
  overflow-wrap: anywhere;
  color: var(--ink-dim);
}

/* -------------------------------------------------------------- footer */
.footer {
  margin-top: auto;
  padding: 2rem var(--gutter);
  border-top: 1px solid var(--line-soft);
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.4rem;
  justify-content: space-between;
  color: var(--ink-faint);
  font-size: var(--text-label);
  letter-spacing: 0.06em;
}
/* Per-browser motion override. Reads as another footer line, but it is the
   one control a reduce-motion user needs to discover on an otherwise static
   site — so it keeps the faint ink, gains the hover affordance of a link. */
.footer__motion {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  letter-spacing: inherit;
  color: var(--ink-faint);
  cursor: pointer;
  text-transform: none;
}
.footer__motion b {
  font-weight: inherit;
  color: var(--ink-dim);
  border-bottom: 1px dotted var(--ink-faint);
}
.footer__motion:hover b,
.footer__motion:focus-visible b {
  color: var(--amber-bright);
  border-bottom-color: var(--amber-bright);
}

/* toast / banners */
.banner {
  margin: 1rem auto 0;
  max-width: var(--maxw);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--paper-2);
  font-size: var(--text-meta);
  color: var(--ink-dim);
}
/* A passing message (alertBanner): bottom centre, and on a phone above the
   tab bar, which it used to cover. */
.banner--toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  z-index: 75;
  transform: translateX(-50%);
  width: max-content;
  max-width: min(560px, calc(100vw - 2rem));
  margin: 0;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
@media (max-width: 48rem) {
  .banner--toast {
    bottom: calc(56px + 0.75rem + env(safe-area-inset-bottom, 0px));
  }
  html.kb-open .banner--toast,
  body:has(main.stu) .banner--toast {
    bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  }
}
.banner.is-warn {
  border-color: color-mix(in oklab, var(--warn) 40%, transparent);
  color: var(--warn);
}
.banner.is-error {
  border-color: color-mix(in oklab, var(--err) 40%, transparent);
  color: var(--err);
}
.banner__cta {
  color: var(--amber);
  font-weight: 700;
  white-space: nowrap;
}
.banner__cta:hover {
  color: var(--amber-bright);
}

/* settings */
.settings__note {
  margin: 1rem 0 0;
  color: var(--ink-dim);
  font-size: var(--text-body);
}
/* A note introduces the control under it; measured at 0px between the two on
   four profile panels (LinkedIn field, portrait, feed link, connect chips).
   The gap belongs to the pair, so it is set on the follower, not the note —
   a note that closes a panel keeps its tidy bottom edge. */
.settings__note + * {
  margin-top: 0.75rem;
}
.settings__persist {
  margin: 1rem 0 0;
  font-family: var(--mono);
  font-size: var(--text-label);
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  place-items: center;
  background: var(--black);
  color: var(--ink);
  font-family: var(--serif);
  padding: 2rem;
  text-align: center;
}

/* responsive */
@media (max-width: 720px) {
  .hero__grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .hero__subject {
    grid-row: 1;
    /* 30% of clamp(180px, 60vw, 280px): on a 390px phone this goes from a
       293px-tall centrepiece to an 88px mark above the wordmark. */
    width: clamp(54px, 18vw, 84px);
    margin: 0 auto 0.25rem;
  }
  .hero__copy {
    text-align: left;
  }
  .masthead__meta .status-dot span.long {
    display: none;
  }
}

/* =====================================================================
   CAPABILITY HUB + shared nav/result helpers
   ===================================================================== */
.hub {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: clamp(0.9rem, 2vh, 1.5rem) var(--gutter) 2rem;
}
.hub__lead {
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2.2vw, 1.5rem);
  color: var(--ink-dim);
  max-width: 34ch;
  margin: 0.8rem 0 0;
}
/* 20 capabilities. The card was sized like a feature tile when its job is to
   be scanned and picked out of a list, so everything here is about 20% down
   from where it was — more of the set on screen at once, same information. */
.caps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 0.9rem;
  margin-top: 1.6rem;
}
.cap {
  position: relative;
  overflow: hidden;
  text-align: left;
  padding: 1.2rem 1.15rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.18s var(--ease), border-color 0.2s var(--ease),
    box-shadow 0.22s var(--ease);
}
.cap::after {
  content: "";
  position: absolute;
  right: -30%;
  top: -45%;
  width: 75%;
  height: 90%;
  background: transparent;
  pointer-events: none;
}
.cap:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
  box-shadow: 0 10px 28px color-mix(in oklab, var(--shadow) 60.8%, transparent);
}
.cap__orb {
  position: relative;
  width: 46px;
  height: 46px;
  margin-bottom: 0.8rem;
}
.cap__label {
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--text-title);
  line-height: 1.05;
  color: var(--amber-bright);
}
.cap__blurb {
  color: var(--ink-dim);
  font-size: var(--text-meta);
  line-height: 1.45;
  margin-top: 0.4rem;
  max-width: 34ch;
  /* Grid rows stretch to their tallest card, so a single long blurb was
     setting the height of an entire row — measured 275px to 373px across one
     screen at 1280. Three lines caps that and makes the rows uniform, which is
     what makes a grid scannable. */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cap__go {
  margin-top: 0.8rem;
  display: inline-flex;
  gap: 0.45rem;
  color: var(--amber);
  font-weight: 700;
  font-size: var(--text-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* Live homepage samples strip (#38) — freshest showcase runs, free to read. */
.samples {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: clamp(0.7rem, 1.6vh, 1.1rem) var(--gutter) 0;
}
.samples__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-top: 1.4rem;
}
.sample {
  display: block;
  text-decoration: none;
  padding: 1.15rem 1.25rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: transform 0.18s var(--ease), border-color 0.2s var(--ease);
}
.sample:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--amber) 55%, var(--line));
}
.sample__tag {
  display: inline-block;
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber);
}
.sample__title {
  font-family: var(--serif);
  font-size: var(--text-body);
  line-height: 1.35;
  color: var(--ink);
  margin-top: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sample__meta {
  color: var(--ink-dim);
  font-size: var(--text-label);
  margin-top: 0.7rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-dim);
  font-size: var(--text-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.back-link:hover {
  color: var(--amber);
}

/* result helpers (build / ctf / product) */
.flags {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 1.2rem 0;
}
.flag {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  padding: 0.8rem 1rem;
  border: 1px solid color-mix(in srgb, var(--amber) 40%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber) 9%, var(--paper));
  font-family: var(--mono);
  font-size: var(--text-body);
  overflow-wrap: anywhere;
}
.flag__i {
  color: var(--amber);
  flex: none;
}
.files {
  font-family: var(--mono);
  font-size: var(--text-meta);
  color: var(--ink-dim);
  margin-top: 0.5rem;
}
.files div {
  padding: 0.28rem 0;
  border-bottom: 1px solid var(--line-soft);
  overflow-wrap: anywhere;
}
/* Codebase result: branch meta rows + the raw diff-stat block. */
.cbmeta {
  font-size: var(--text-body);
}
.cbmeta__k {
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: var(--text-meta);
}
.cbmeta code {
  font-family: var(--code);
  font-size: var(--text-meta);
}
.cbdiff {
  font-family: var(--code);
  font-size: var(--text-meta);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0;
}

/* Continue-PR composer (codebase result, PR panel) */
.cbpr {
  margin-top: 12px;
}
.cbpr__row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.cbpr__hint {
  margin: 0;
  font-size: var(--text-meta);
  color: var(--ink-dim);
}
.cbpr__hint code {
  font-family: var(--code);
  font-size: var(--text-label);
}
.cbpr__composer {
  margin-top: 4px;
}
.cbpr__input {
  min-height: 72px;
  font-size: var(--text-body);
}
.cbpr__actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.raw {
  margin-top: 2.2rem;
}
.raw summary {
  cursor: pointer;
  color: var(--ink-faint);
  font-size: var(--text-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.raw pre {
  margin-top: 0.8rem;
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  font-size: var(--text-label);
  color: var(--ink-dim);
  max-height: 440px;
}

/* =====================================================================
   MOTION — cross-screen transitions + staggered reveals
   ===================================================================== */
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* every screen fades + rises in as it mounts */
.view {
  animation: viewIn 0.5s var(--ease) both;
}

/* first paint: the whole app fades in once on load, so booting straight into
   a screen (or over the server-rendered landing copy) never pops. */
@keyframes bootIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
#app {
  animation: bootIn 0.5s var(--ease) both;
}

/* navigation pulse — a thin accent sweep across the very top of the page. It
   starts the instant a route change is REQUESTED (pushRoute / popstate) and
   fades when the destination screen actually mounts (frame / authScreen).
   Screens that fetch before they frame used to read as a dead click followed
   by a pop; the bar turns that window into visible progress.

   The sweep rides a ::before band animated with transform only. Animating
   background-position (the first cut) repainted a fixed, glowing bar every
   frame for the whole navigation — the single biggest jank source on
   lower-end GPUs. transform runs on the compositor: zero paint. */
.navpulse {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 45; /* just above the masthead (40), below dropdowns (60) */
  pointer-events: none;
  overflow: hidden; /* the band travels through and out of this track */
  transition: opacity 0.35s var(--ease);
}
.navpulse::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 45%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--fill) 45%, var(--fill) 55%, transparent);
  animation: navpulseSweep 1.05s linear infinite;
  will-change: transform;
}
@keyframes navpulseSweep {
  /* translateX % is relative to the band's own 45%-of-viewport width:
     -102% parks it just off the left edge, 230% clears the right. */
  from {
    transform: translateX(-102%);
  }
  to {
    transform: translateX(230%);
  }
}
.navpulse.is-done {
  opacity: 0;
}
.navpulse.is-done::before {
  animation-play-state: paused;
}
.navpulse.hidden {
  display: none;
}

/* …and the outgoing screen eases OUT over it. `crossfadeTo` (app.js) pins the
   previous screen over the fresh layout as a fading ghost, so navigation never
   hard-cuts to bare background: old fades out while new fades in. */
@keyframes viewOut {
  from {
    opacity: 1;
    transform: none;
  }
  to {
    opacity: 0;
    transform: scale(0.985);
  }
}
.view--out {
  animation: viewOut 0.45s var(--ease) both;
  /* above swapping content, below the masthead (40) and overlays (60+) */
  z-index: 6;
  /* A full-screen clone fading + scaling: force its own compositor layer up
     front so the dissolve never repaints the page underneath it. */
  will-change: transform, opacity;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
/* children of a .stagger container reveal in a quick cascade */
.stagger > * {
  animation: rise 0.5s var(--ease) both;
}
.stagger > *:nth-child(1) {
  animation-delay: 0.04s;
}
.stagger > *:nth-child(2) {
  animation-delay: 0.09s;
}
.stagger > *:nth-child(3) {
  animation-delay: 0.14s;
}
.stagger > *:nth-child(4) {
  animation-delay: 0.19s;
}
.stagger > *:nth-child(5) {
  animation-delay: 0.24s;
}
.stagger > *:nth-child(6) {
  animation-delay: 0.29s;
}
.stagger > *:nth-child(7) {
  animation-delay: 0.34s;
}
.stagger > *:nth-child(8) {
  animation-delay: 0.39s;
}
.stagger > *:nth-child(n + 9) {
  animation-delay: 0.44s;
}

/* live-run progress bar (fills across the stage tracker) */
.progress {
  height: 3px;
  border-radius: 100px;
  background: var(--line-soft);
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.progress__fill {
  height: 100%;
  width: 0;
  border-radius: 100px;
  background: var(--fill);
  transition: width 0.6s var(--ease);
}

/* the "what's happening" headline crossfades when it changes */
@keyframes headlineIn {
  from {
    opacity: 0.15;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.now__text .v.flash {
  animation: headlineIn 0.4s var(--ease);
}

@media (prefers-reduced-motion: reduce) {
  :root:not(.motion-on) .view,
  :root:not(.motion-on) .view--out,
  :root:not(.motion-on) #app,
  :root:not(.motion-on) .navpulse::before,
  :root:not(.motion-on) .stagger > *,
  :root:not(.motion-on) .now__text .v.flash {
    animation: none;
  }
  :root:not(.motion-on) .navpulse {
    transition: none;
  }
  :root:not(.motion-on) .progress__fill {
    transition: none;
  }
}

/* =====================================================================
   CREDITS PILL (masthead) + launch cost hint
   ===================================================================== */
.credits {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.72rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-dim);
  font-size: var(--text-label);
  letter-spacing: 0.06em;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.credits:hover {
  border-color: var(--amber-deep);
  color: var(--ink);
}
.credits__coin {
  color: var(--amber);
}
.credits__v {
  font-family: var(--code);
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.credits__k {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  font-size: var(--text-micro);
}
.credits.is-low {
  border-color: color-mix(in oklab, var(--warn) 50%, transparent);
  color: var(--warn);
}
.credits.is-low .credits__coin,
.credits.is-low .credits__v {
  color: var(--warn);
}

.cost-hint {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
  margin-right: 0.3rem;
  text-align: right;
  line-height: 1.3;
}
.cost-hint__est {
  font-size: var(--text-label);
  color: var(--ink-dim);
}
.cost-hint__est b {
  color: var(--amber);
  font-family: var(--code);
}
.cost-hint__bal {
  font-size: var(--text-micro);
  color: var(--ink-faint);
  font-family: var(--code);
  letter-spacing: 0.04em;
}
.cost-hint__warn {
  max-width: 22rem;
  font-size: var(--text-micro);
  color: var(--amber-deep, var(--amber));
  line-height: 1.35;
  margin-top: 0.1rem;
}

/* Hosted engine chip on the launch panel: a pinned note for codebase (the
   platform runs it on the strongest engine) or a picker when the platform
   advertises more than one. Sits in the cost-hint column, above the quote. */
.engine-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: var(--text-micro);
  line-height: 1.2;
  margin-bottom: 0.15rem;
}
.engine-chip__tag {
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}
.engine-chip__name {
  color: var(--ink);
  font-weight: 600;
}
.engine-chip__effort {
  color: var(--ink-dim);
  font-family: var(--code);
  font-size: var(--text-micro);
}
.engine-chip--pinned {
  border-color: color-mix(in srgb, var(--amber) 35%, var(--line));
}
.engine-chip__select {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  padding-right: 0.9rem;
  cursor: pointer;
  /* Chevron, since the native marker is hidden with appearance:none. */
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-dim) 50%),
    linear-gradient(135deg, var(--ink-dim) 50%, transparent 50%);
  background-position: calc(100% - 0.55rem) 55%, calc(100% - 0.35rem) 55%;
  background-size: 0.28rem 0.28rem;
  background-repeat: no-repeat;
}
.engine-chip__select:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: var(--radius);
}
/* The OPEN dropdown's list is painted by the OS, and option text inherits the
   select's themed --ink — near-white — so a light popup put white on white.
   `color-scheme: dark` on :root now makes that popup dark; both colours are
   still pinned here so the pair stays legible even where it is ignored. */
.engine-chip__select option,
.field__input option,
.field select option {
  color: var(--ink);
  background-color: var(--card);
}

/* "Fast swarm" / "Deep reasoning" opt-in switches on the launch screen. */
.deep-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
  user-select: none;
}
.deep-toggle:hover {
  border-color: color-mix(in srgb, var(--amber) 40%, var(--line));
}
/* The whole pill is the switch (it is the label): a finger-sized one. */
@media (pointer: coarse) {
  .deep-toggle {
    min-height: 2.75rem;
  }
}
/* Whole control lights up amber when its switch is on. */
.deep-toggle:has(.deep-toggle__box:checked) {
  border-color: color-mix(in srgb, var(--amber) 60%, var(--line));
  background: color-mix(in oklab, var(--ochre) 8%, var(--card));
}
/* The native checkbox, restyled into a sliding switch. */
.deep-toggle__box {
  appearance: none;
  -webkit-appearance: none;
  flex: 0 0 auto;
  position: relative;
  width: 38px;
  height: 22px;
  margin: 0;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.deep-toggle__box::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--ink-dim);
  transform: translateY(-50%);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
  box-shadow: 0 1px 2px color-mix(in oklab, var(--shadow) 40%, transparent);
}
.deep-toggle__box:checked {
  background: color-mix(in srgb, var(--amber) 35%, var(--paper));
  border-color: var(--amber);
}
.deep-toggle__box:checked::before {
  transform: translateY(-50%) translateX(16px);
  background: var(--amber-bright);
}
.deep-toggle__box:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
/* Title + sub-note stacked to the right of the switch. */
.deep-toggle__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.deep-toggle__label {
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--ink);
}
.deep-toggle:has(.deep-toggle__box:checked) .deep-toggle__label {
  color: var(--amber-bright);
}
.deep-toggle__note {
  font-size: var(--text-micro);
  color: var(--ink-dim);
  margin-top: 0.1rem;
}

/* Finance "price movement (%)" chart parsed from the summary table. */
.fin-chart-wrap {
  margin: 1.1rem 0 0.4rem;
}
.fin-chart__title {
  margin-bottom: 0.3rem;
  opacity: 0.8;
}
.fin-chart {
  display: block;
  color: var(--fg);
}

/* Per-run save/delete controls on a history row. */
.run-hist__actions {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
  margin-left: 0.4rem;
}
.run-hist__act {
  cursor: pointer;
  opacity: 0.4;
  font-size: 0.95em;
  line-height: 1;
  /* A real box around the glyph: 0.1rem of padding put the star and the bin
     a hair apart and made the hover highlight a sliver. */
  padding: 0.35rem 0.45rem;
  min-width: 28px;
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  transition: opacity 0.12s ease, color 0.12s ease;
}
.run-hist__act:hover {
  opacity: 1;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
}
.run-hist__act.is-on {
  opacity: 1;
  color: var(--amber);
}
.run-hist__act--del:hover {
  color: var(--err);
}

/* =====================================================================
   BILLING / WALLET
   ===================================================================== */
.billing__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-top: 1.2rem;
}
.wallet__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.wallet__bal {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.wallet__coin {
  color: var(--amber);
  font-size: var(--text-display);
}
.wallet__num {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(2.6rem, 7vw, 4rem);
  line-height: 1;
  color: var(--amber-bright);
  font-variant-numeric: tabular-nums;
}
.wallet__unit {
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: var(--text-micro);
}
.wallet__bal.is-low .wallet__num,
.wallet__bal.is-low .wallet__coin {
  color: var(--warn);
}
.wallet__stats {
  display: flex;
  gap: 1.6rem;
}
.wallet__stat-v {
  font-family: var(--code);
  font-size: var(--text-lede);
  color: var(--ink);
}
.wallet__stat-k {
  font-size: var(--text-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.2rem;
}

.pack-buys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
}
.pack-buy {
  text-align: left;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  transition: transform 0.18s var(--ease), border-color 0.2s var(--ease),
    background 0.2s var(--ease);
}
.pack-buy:hover {
  transform: translateY(-3px);
  border-color: var(--amber-deep);
  background: var(--paper-raise);
}
.pack-buy__c {
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--text-title);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.pack-buy__coin {
  color: var(--amber);
  font-size: var(--text-body);
}
.pack-buy__l {
  font-size: var(--text-micro);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 0.25rem;
}
.pack-buy__cta {
  margin-top: 0.75rem;
  color: var(--amber);
  font-weight: 700;
  font-size: var(--text-micro);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.price-list {
  display: flex;
  flex-direction: column;
}
.price-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.15rem;
  border-bottom: 1px solid var(--line-soft);
}
.price-row:last-child {
  border-bottom: none;
}
.price-row__dot {
  width: 15px;
  height: 15px;
  flex: none;
}
.price-row__m {
  flex: 1;
  font-weight: 600;
  font-size: var(--text-body);
}
.price-row__v {
  font-family: var(--code);
  font-size: var(--text-meta);
  color: var(--amber);
}

.tx-list {
  max-height: 440px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.tx {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem 0.15rem;
  border-bottom: 1px solid var(--line-soft);
}
.tx:last-child {
  border-bottom: none;
}
.tx__k {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  border: 1px solid var(--line);
}
.tx__k--grant {
  color: var(--ok);
  border-color: color-mix(in oklab, var(--ok) 40%, transparent);
}
.tx__k--debit {
  color: var(--ink-dim);
}
.tx__main {
  flex: 1;
  min-width: 0;
}
.tx__note {
  font-size: var(--text-meta);
  text-transform: capitalize;
}
.tx__ts {
  font-family: var(--code);
  font-size: var(--text-micro);
  color: var(--ink-faint);
  margin-top: 0.15rem;
}
.tx__amt {
  text-align: right;
  flex: none;
}
.tx__amt-v {
  font-family: var(--code);
  font-weight: 700;
}
.tx__bal {
  display: block;
  font-family: var(--code);
  font-size: var(--text-micro);
  color: var(--ink-faint);
}

@media (max-width: 720px) {
  .masthead__meta .credits__k.long {
    display: none;
  }
  .billing__grid {
    grid-template-columns: 1fr;
  }
  .wallet__top {
    align-items: flex-start;
  }
}

/* =====================================================================
   LOGIN GATE (hosted build)
   ===================================================================== */
.login__card {
  max-width: 460px;
  margin: 0 auto;
}
.login__lead {
  color: var(--ink-dim);
  margin: 0.6rem 0 1.4rem;
  font-size: var(--text-body);
}
.login__label {
  display: block;
  margin: 1rem 0 0.4rem;
}
.login__in {
  width: 100%;
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--text-body);
  padding: 0.8rem 0.9rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.login__in::placeholder {
  color: var(--ink-faint);
}
.login__in:focus {
  border-color: var(--amber-deep);
  outline: none;
}
.login__row {
  margin-top: 1.4rem;
}
.login__row .btn {
  width: 100%;
  justify-content: center;
}
.login__msg {
  margin-top: 0.9rem;
  font-size: var(--text-meta);
  min-height: 1.1em;
}
.login__msg.is-err {
  color: var(--err);
}
.login__msg.is-ok {
  color: var(--ok);
}
.login__toggle {
  margin-top: 1.1rem;
  color: var(--ink-dim);
  font-size: var(--text-meta);
  border-bottom: 1px solid transparent;
}
.login__toggle:hover {
  color: var(--amber);
}
.login__row {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.login__forgot {
  align-self: flex-end;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--dim);
  font-size: var(--text-meta);
}
.login__forgot:hover {
  color: var(--amber);
}
.login__oauth {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.login__oauth.hidden {
  display: none;
}
.login__or {
  text-align: center;
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--dim);
}
.login__oauth-btn {
  width: 100%;
  justify-content: center;
}
/* terms agreement — email signup gates on the checkbox; OAuth carries the
   same notice as small print (a provider redirect can create an account). */
.login__agree {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.9rem 0 0;
  font-size: var(--text-meta);
  color: var(--ink-dim);
  line-height: 1.45;
  cursor: pointer;
}
.login__agree input {
  margin-top: 0.15rem;
  accent-color: var(--amber);
  flex-shrink: 0;
}
.login__agree a,
.login__consent a {
  color: var(--amber);
}
.login__consent {
  font-size: var(--text-label);
  color: var(--dim);
  margin: 0.2rem 0 0;
  line-height: 1.5;
  text-align: center;
}

/* =====================================================================
   LIVE BROWSER VIEW (hosted)
   ===================================================================== */
.live {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--rail-plate);
  overflow: hidden;
  margin-top: 1rem;
  box-shadow: 0 30px 80px -40px color-mix(in oklab, var(--shadow) 100%, transparent);
}
.live__stage {
  position: relative;
  min-height: 320px;
  display: grid;
  place-items: center;
}
.live__frame {
  display: block;
  max-width: 100%;
  height: auto;
  cursor: crosshair;
  user-select: none;
  -webkit-user-drag: none;
  outline: none;
}
.live__frame:focus {
  outline: 2px solid var(--amber);
  outline-offset: -2px;
}
.live__status {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  font-family: var(--serif);
  font-style: italic;
  z-index: 2;
  pointer-events: none;
}
.live__status.is-err {
  color: var(--err);
}
.live__badge {
  position: absolute;
  top: 0.7rem;
  left: 0.7rem;
  z-index: 3;
  font-family: var(--mono);
  font-size: var(--text-micro);
  color: var(--err);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: color-mix(in oklab, var(--shadow) 88%, transparent);
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
}
/* ---- browser panel embedded in the run dashboard ------------------------ */
/* The run's own browser sits beside the activity log, so "what it is doing"
   and "what it is looking at" are readable at a glance. */
.runbrowser .card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}
.runbrowser__badge {
  position: static;
  background: none;
  padding: 0;
}
.runbrowser__bar {
  padding: 0.4rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  background: var(--paper);
}
.runbrowser__url {
  display: block;
  font-family: var(--mono);
  font-size: var(--text-label);
  color: var(--ink-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: rtl; /* keep the meaningful tail of a long URL visible */
  text-align: left;
}
.runbrowser__live {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
.runbrowser__live .live__stage {
  min-height: 220px;
}
/* Pulse the panel when a human-check needs the user's attention. */
.runbrowser.is-alert {
  border-color: var(--warn);
  animation: runbrowser-pulse 1.2s ease-in-out 3;
}
@keyframes runbrowser-pulse {
  50% {
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 25%, transparent);
  }
}
@media (prefers-reduced-motion: reduce) {
  :root:not(.motion-on) .runbrowser.is-alert {
    animation: none;
  }
}
/* Agents card spans the full width under the browser/activity pair. */
.run__workers {
  margin-top: 1.2rem;
}

/* "take control" prompt shown on the run dashboard when a challenge appears */
.challenge {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1.4rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--warn) 10%, var(--paper));
}
.challenge__t {
  flex: 1;
  min-width: 0;
  color: var(--warn);
  font-size: var(--text-body);
}

/* Auth-wall modal: the credential hand-off when a security run pauses at a
   login wall. The bar reuses .challenge; the modal sits above the run view. */
.authwall {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in oklab, var(--shadow) 88%, transparent);
}
.authwall__card {
  width: min(520px, 92vw);
  max-height: 88vh;
  overflow: auto;
  padding: 1.4rem 1.5rem;
  border: 1px solid color-mix(in srgb, var(--warn) 55%, var(--line));
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 18px 50px color-mix(in oklab, var(--shadow) 72%, transparent);
}
.authwall__card h3 {
  margin: 0.2rem 0 0.5rem;
}
.authwall__lead {
  font-size: var(--text-body);
  opacity: 0.85;
}
.authwall__why {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.2rem;
  font-size: var(--text-meta);
  color: var(--warn);
}
.authwall__captcha {
  font-size: var(--text-meta);
  color: var(--warn);
  border: 1px dashed color-mix(in srgb, var(--warn) 55%, var(--line));
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
}
.authwall__hint {
  font-size: var(--text-meta);
  opacity: 0.7;
  margin-top: 0.3rem;
  word-break: break-all;
}
.authwall__fields textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: var(--text-body);
  resize: vertical;
}
.authwall__note {
  min-height: 1.3em;
  margin-top: 0.7rem;
  font-size: var(--text-meta);
}
.authwall__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.9rem;
}

/* Plan-gate modal (codebase runs paused for plan approval): wider card so the
   plan markdown is readable, with the plan itself in its own scroll region. */
.authwall__card--wide {
  width: min(760px, 94vw);
}
.plangate__plan {
  max-height: 46vh;
  overflow: auto;
  margin: 0.6rem 0 0.9rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  font-size: var(--text-meta);
}
.plangate__hint {
  font-size: var(--text-meta);
  opacity: 0.7;
  margin: 0.2rem 0;
}
.plangate__questions {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.8rem;
}

/* -------------------------------------------- session pivots + carried context */
/* "Continue in →" row under a result: hand findings to another capability. */
.pivots {
  margin-top: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.pivots__label {
  color: var(--dim);
  margin-right: 0.2rem;
}
.btn--sm {
  padding: 0.35rem 0.7rem;
  font-size: var(--text-meta);
}
/* Each pivot button glows in its TARGET capability's accent, previewing the
   colour the launcher will switch to. */
.pivots .btn[data-mode] {
  border-color: color-mix(in srgb, var(--amber) 45%, transparent);
  color: var(--amber-bright);
}
.pivots .btn[data-mode]:hover {
  background: var(--amber-glow);
  border-color: var(--amber);
}

/* "Listen as a podcast" — inline audio player + collapsible transcript. */
.podcast {
  margin-top: 1.1rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid color-mix(in srgb, var(--amber) 30%, transparent);
  border-radius: var(--radius);
  background: var(--amber-glow);
}
.podcast[hidden] {
  display: none;
}
.podcast__audio {
  width: 100%;
  height: 40px;
  display: block;
}
.podcast__script {
  margin-top: 0.7rem;
  font-size: var(--text-body);
}
.podcast__script > summary {
  cursor: pointer;
  color: var(--dim);
}
.podcast__script p {
  margin: 0.6rem 0 0;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* The context chip shown on the launcher when a pivot carries findings in. */
.ctx-chip {
  margin-bottom: 1rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid color-mix(in srgb, var(--amber) 35%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber) 7%, var(--paper));
}
.ctx-chip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}
.ctx-chip__tag {
  font-size: var(--text-label);
  letter-spacing: 0.02em;
  color: var(--amber-bright);
  text-transform: uppercase;
}
.ctx-chip__x {
  border: 0;
  background: none;
  color: var(--dim);
  cursor: pointer;
  font-size: var(--text-label);
  padding: 0.1rem 0.3rem;
  border-radius: var(--radius);
}
.ctx-chip__x:hover {
  color: var(--ink);
  background: color-mix(in oklab, var(--ink) 6%, transparent);
}
.ctx-chip__body {
  max-height: 5.5rem;
  overflow: hidden;
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--dim);
  white-space: pre-wrap;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent);
  mask-image: linear-gradient(180deg, #000 60%, transparent);
}

/* ---------------------------------------------------------- run history list */
.run-hist {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.4rem;
}
.run-hist__row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber) 4%, var(--paper));
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
}
.run-hist__row:hover {
  border-color: color-mix(in srgb, var(--amber) 55%, transparent);
  background: var(--amber-glow);
  transform: translateX(2px);
}
.run-hist__row.is-pending {
  cursor: default;
  opacity: 0.72;
}
.run-hist__row.is-pending:hover {
  border-color: color-mix(in oklab, var(--ink) 8%, transparent);
  background: color-mix(in srgb, var(--amber) 4%, var(--paper));
  transform: none;
}
.run-hist__dot {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}
.run-hist__main {
  flex: 1;
  min-width: 0;
  /* Block, whatever element carries the class. The chat list builds its rows
     from spans, and inline title + meta ran together as one line —
     "Best 5k plan for a beginner4 MESSAGES" — measured on both widths. */
  display: block;
}
.run-hist__title {
  display: block;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.run-hist__meta {
  display: block;
  font-size: var(--text-label);
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: 0.2rem;
}
.run-hist__status {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
  flex: none;
}
.run-hist__status.is-completed {
  color: var(--ok);
}
.run-hist__status.is-running {
  color: var(--amber-bright);
}
.run-hist__status.is-failed {
  color: var(--err);
}
.run-hist__credits {
  font-size: var(--text-meta);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
  flex: none;
  min-width: 3.5rem;
  text-align: right;
}

/* ----------------------------------------------------- schedules (Epic D) */
/* The launch-form "schedule this" panel: same spec, fired on a cadence. */
.schedbox {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber) 3%, var(--paper));
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.schedbox__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1rem;
  align-items: end;
}
.schedbox__custom {
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--text-body);
  padding: 0.6rem 0.7rem;
  width: 100%;
}
.schedbox__custom:focus {
  outline: none;
  border-color: var(--amber-deep);
}
.schedbox__channels {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  flex-wrap: wrap;
}
.schedbox__winbox {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.schedbox__window {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.schedbox__time {
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--text-body);
  padding: 0.5rem 0.6rem;
}
.schedbox__time:focus {
  outline: none;
  border-color: var(--amber-deep);
}
.schedbox__to {
  color: var(--dim);
  font-size: var(--text-meta);
}
.schedbox__tz {
  color: var(--dim);
  font-size: var(--text-label);
  font-family: var(--mono);
}
.schedbox__note {
  font-size: var(--text-meta);
  color: var(--dim);
  margin: 0;
}
.schedbox__row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}
.schedbox__est {
  font-size: var(--text-label);
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}
.schedbox__status {
  font-size: var(--text-meta);
  color: var(--dim);
  min-height: 0;
}
.schedbox__status--err {
  color: var(--err);
}
.schedbox__done {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.schedbox__done .serif {
  color: var(--dim);
  font-size: var(--text-meta);
  flex: 1;
  min-width: 16rem;
}
.schedbox__ok {
  color: var(--ok);
  font-weight: 600;
  white-space: nowrap;
}

/* The management view: one card per schedule. */
.sched-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin-top: 1.4rem;
}
.sched {
  border: 1px solid color-mix(in oklab, var(--ink) 8%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber) 4%, var(--paper));
  padding: 0.95rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  transition: border-color 0.15s var(--ease);
}
.sched:hover {
  border-color: color-mix(in srgb, var(--amber) 45%, transparent);
}
.sched.is-paused {
  opacity: 0.68;
}
.sched.is-paused:hover {
  opacity: 0.85;
}
.sched__head {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.sched__mode {
  font-size: var(--text-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-bright);
}
.sched__state {
  font-size: var(--text-micro);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}
.sched__state.is-on {
  color: var(--ok);
}
.sched__state.is-off {
  color: var(--dim);
}
.sched__cad {
  font-family: var(--mono);
  font-size: var(--text-label);
  color: var(--dim);
}
.sched__prompt {
  font-weight: 600;
  font-size: var(--text-body);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sched__meta {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-size: var(--text-label);
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  align-items: center;
}
.sched__last {
  font-size: var(--text-label);
  color: var(--amber-bright);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s var(--ease);
}
.sched__last:hover {
  border-color: var(--amber-bright);
}
.sched__err {
  font-size: var(--text-meta);
  color: var(--err);
  font-family: var(--mono);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.sched__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.15rem;
}
.sched__del:hover {
  color: var(--err);
  border-color: var(--err);
}
.sched__edit {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.sched__hist {
  margin-top: 0.4rem;
  border-top: 1px solid var(--line-soft);
  padding-top: 0.8rem;
}
.sched__hist .run-hist {
  margin-top: 0;
}

/* --------------------------------------------------------- inbox (Epic D) */
.inbox {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.inbox__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.inbox__n {
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0;
  background: var(--amber-bright);
  color: var(--black);
  border-radius: 999px;
  padding: 0.05rem 0.38rem;
  line-height: 1.5;
}
.inbox__drop {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  width: min(24rem, 86vw);
  max-height: 26rem;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px color-mix(in oklab, var(--shadow) 88%, transparent);
  z-index: 60;
  overflow: hidden;
}
.inbox__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
}
.inbox__clear {
  font-size: var(--text-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
  transition: color 0.15s var(--ease);
}
.inbox__clear:hover {
  color: var(--amber-bright);
}
.inbox__list {
  overflow-y: auto;
  scrollbar-width: thin;
}
.inbox__empty {
  padding: 1.4rem 1rem;
  color: var(--dim);
  font-size: var(--text-meta);
  text-align: center;
}
.notif {
  display: flex;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink);
  transition: background 0.15s var(--ease);
  cursor: pointer;
}
.notif:hover {
  background: var(--amber-glow);
}
.notif__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  flex: none;
  margin-top: 0.4rem;
}
.notif.is-unread .notif__dot {
  background: var(--amber-bright);
}
.notif.is-unread.is-bad .notif__dot {
  background: var(--err);
}
.notif__main {
  flex: 1;
  min-width: 0;
}
.notif__title {
  font-size: var(--text-meta);
  font-weight: 600;
}
.notif.is-bad .notif__title {
  color: var(--err);
}
.notif__body {
  font-size: var(--text-label);
  color: var(--dim);
  margin-top: 0.2rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.notif__when {
  font-size: var(--text-micro);
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.3rem;
}

/* --------------------------------------------- sandbox browser tab strip */
.runbrowser__tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.5rem 0.75rem 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.runbrowser__tabs.hidden {
  display: none;
}
.rbtab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
  max-width: 14rem;
  padding: 0.3rem 0.6rem;
  font-size: var(--text-label);
  white-space: nowrap;
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  background: color-mix(in srgb, var(--amber) 4%, transparent);
  color: var(--dim);
  cursor: pointer;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.rbtab:hover {
  color: var(--ink);
  background: var(--amber-glow);
}
.rbtab.is-active {
  color: var(--amber-bright);
  background: var(--amber-glow);
  border-color: color-mix(in srgb, var(--amber) 45%, transparent);
}
.rbtab__dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  opacity: 0.6;
}
.rbtab.is-active .rbtab__dot {
  opacity: 1;
}

/* -------------------------------------------------- live sessions overview */
.sess__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
  margin-top: 1.4rem;
}
.sess__card {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.9rem;
  text-align: left;
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--amber) 4%, var(--paper));
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}
.sess__card:hover {
  border-color: color-mix(in srgb, var(--amber) 55%, transparent);
  transform: translateY(-2px);
}
.sess__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sess__mode {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber-bright);
}
.sess__title {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sess__thumb {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--rail-plate);
  pointer-events: none; /* the whole card is the click target */
}
.sess__thumb .live__frame {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =====================================================================
   LONG-REPORT VIEW — a huge report renders as a Contents jump-list plus
   collapsible sections, so it reads as an outline instead of a wall.
   ===================================================================== */
/* Wide markdown tables scroll inside their own box, never the whole page. */
.md-tablewrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}
.md-tablewrap > table {
  margin: 0;
}
.md th,
.md td {
  overflow-wrap: break-word;
}

.report__doc {
  margin-top: 0.5rem;
}
.rtoc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.1rem;
  margin: 0.5rem 0 1.6rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper);
}
.rtoc__label {
  color: var(--ink-faint);
  margin-right: 0.3rem;
}
.rtoc__chip {
  font-size: var(--text-label);
  line-height: 1.2;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink-dim);
  background: var(--paper-raise);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.rtoc__chip[data-lvl="2"] {
  font-size: var(--text-label);
  opacity: 0.85;
}
.rtoc__chip:hover {
  color: var(--ink);
  border-color: var(--amber-deep);
}
.rtoc__all {
  margin-left: auto;
  font-family: var(--mono);
  font-size: var(--text-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
  border-bottom: 1px solid transparent;
}
.rtoc__all:hover {
  border-bottom-color: var(--amber-deep);
}

.rsec {
  border-top: 1px solid var(--line-soft);
}
.rsec:last-of-type {
  border-bottom: 1px solid var(--line-soft);
}
.rsec__sum {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.95rem 0.2rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.rsec__sum::-webkit-details-marker {
  display: none;
}
.rsec__sum::after {
  content: "▸";
  margin-left: auto;
  color: var(--ink-faint);
  font-size: var(--text-meta);
  transition: transform 0.2s var(--ease);
}
.rsec[open] > .rsec__sum::after {
  transform: rotate(90deg);
}
.rsec__lvl {
  font-family: var(--mono);
  color: var(--amber);
  flex: none;
}
.rsec__h {
  font-weight: 700;
  font-size: var(--text-body);
  overflow-wrap: anywhere;
}
.rsec[open] > .rsec__sum .rsec__h {
  color: var(--ink);
}
.rsec__body {
  padding: 0 0.2rem 1.4rem;
}
.rsec__body > :first-child {
  margin-top: 0;
}
.src-more {
  margin-top: 1rem;
}

/* long single-token titles must wrap, not push the page sideways */
.report__title,
.run__q {
  overflow-wrap: anywhere;
}

/* =====================================================================
   DISTILLED REPORT VIEW — the narrative is the report: stats tiles, a hero
   summary, per-round finding cards, and the engine's raw appendix behind one
   collapsed run log. Tokens only, so [data-mode] accents recolor it for free.
   ===================================================================== */
/* Hero summary — the distilled bottom line, spotlighted with a quiet
   amber wash over the panel ground (no side stripe). */
.rhero {
  background: color-mix(in srgb, var(--amber) 6%, var(--card));
}
.rhero .panel__body > :first-child {
  margin-top: 0;
}
.rhero .panel__body > :last-child {
  margin-bottom: 0;
}
/* Long hero summaries clamp like finding cards (~2,400 chars ≈ 30rem). */
.rhero__body {
  position: relative;
  overflow: hidden;
}
.rhero__body.is-clamped {
  max-height: 30rem;
}
.rhero__body.is-clamped::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4.5rem;
  pointer-events: none;
  background: linear-gradient(transparent, var(--paper));
}
.rhero__body.is-open {
  max-height: none;
}
.rhero__body.is-open::after {
  content: none;
}

/* In-report "summary unavailable" banner (the toast-style .banner base centers
   itself; inside a report it should sit flush in the flow). */
.rmiss {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  margin: 0 auto 1.4rem;
  max-width: var(--maxw);
}

/* Key-finding cards, grouped per round. */
.kfinds {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.kfinds__round {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}
.kfinds__rchip {
  font-family: var(--mono);
  font-size: var(--text-label);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  border: 1px solid var(--amber-deep);
  border-radius: 100px;
  padding: 0.25rem 0.7rem;
}
.kfinds__rcount {
  font-size: var(--text-label);
  color: var(--ink-faint);
}
.kfinds__cards {
  display: grid;
  gap: 0.9rem;
}
.kfinds__note {
  margin: 0;
  color: var(--ink-faint);
  font-size: var(--text-meta);
}
.kfind {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 1rem 1.2rem 1.1rem;
}
.kfind__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.35rem 0.7rem;
  margin-bottom: 0.6rem;
}
.kfind__chip {
  flex: none;
  font-family: var(--mono);
  font-size: var(--text-micro);
  letter-spacing: 0.08em;
  color: var(--amber);
  background: var(--amber-glow);
  border-radius: var(--radius);
  padding: 0.15rem 0.45rem;
}
.kfind__title {
  font-weight: 700;
  font-size: var(--text-body);
  overflow-wrap: anywhere;
  min-width: 0;
}
.kfind__conf {
  margin-left: auto;
  font-size: var(--text-label);
  color: var(--ink-faint);
  white-space: nowrap;
}
.kfind__body {
  position: relative;
  overflow: hidden;
}
.kfind__body > :first-child {
  margin-top: 0;
}
.kfind__body > :last-child {
  margin-bottom: 0;
}
/* Long bodies start clamped (~1,500 chars of prose ≈ 22rem) behind a fade. */
.kfind__body.is-clamped {
  max-height: 22rem;
}
.kfind__body.is-clamped::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4.5rem;
  pointer-events: none;
  background: linear-gradient(transparent, var(--paper));
}
.kfind__body.is-open {
  max-height: none;
}
.kfind__body.is-open::after {
  content: none;
}
.kfind__more {
  margin-top: 0.6rem;
}
.kfind__empty {
  color: var(--ink-faint);
  font-size: var(--text-meta);
}

/* The raw engine appendix lives behind one collapsed section. */
.rlog {
  margin-top: 2.2rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: var(--paper);
}
.rlog > .rsec__sum {
  padding: 0.95rem 1.2rem;
}
.rlog > .rsec__body {
  padding: 0 1.2rem 1.4rem;
}

@media (max-width: 820px) {
  .kfind {
    padding: 0.85rem 0.9rem 0.95rem;
  }
  .kfind__body.is-clamped {
    max-height: 18rem;
  }
  .rlog > .rsec__sum {
    padding: 0.85rem 0.9rem;
  }
  .rlog > .rsec__body {
    padding: 0 0.9rem 1.1rem;
  }
}

/* =====================================================================
   MOBILE — kill horizontal scroll and let the nav wrap instead of overflow.
   ===================================================================== */
@media (max-width: 720px) {
  .masthead {
    flex-wrap: wrap;
    row-gap: 0.6rem;
    align-items: center;
  }
  .masthead__meta {
    flex-wrap: wrap;
    gap: 0.8rem;
    row-gap: 0.5rem;
    justify-content: flex-start;
  }
  .rtoc__all {
    margin-left: 0;
  }
  .pivots {
    flex-wrap: wrap;
  }
  .md {
    font-size: var(--text-body);
  }
}

/* --- file & checkbox fields (jobs mode's resume upload) ------------------ */
/* `primary` fields sit above the fold instead of inside Advanced options,
   because a jobs run without a resume has nothing to match against. */
/* The primary picker grid now opens the launch panel, so it must not wear the
   `.adv` divider — a rule immediately under the panel head reads as a stray
   line rather than a separator between two things. */
.adv--primary {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  margin-bottom: 0.9rem;
}

/* The free-text prompt when it FOLLOWS the pickers: still there, deliberately
   quieter. On these modes the buttons carry the request and this box is for
   whatever they could not express, so it gets a separator and about half the
   height rather than the full-bleed treatment it has when it is a mode's only
   input. */
.ask--secondary {
  display: block;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line-soft);
}
.ask--secondary .ask__input {
  min-height: 76px;
  font-size: var(--text-body);
  padding: 0.8rem 0.9rem;
}
.ask--secondary .ask__label {
  margin-bottom: 0.5rem;
  color: var(--ink-dim);
}
.field--file input[type="file"] {
  cursor: pointer;
  font-size: var(--text-label);
  padding: 0.5rem 0.6rem;
}
.field--file input[type="file"]::file-selector-button {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  cursor: pointer;
  font-family: var(--mono);
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  margin-right: 0.7rem;
  padding: 0.35rem 0.7rem;
  text-transform: uppercase;
}
.field__status {
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: var(--text-label);
  min-height: 1em;
}
.field__status--err {
  color: var(--err);
}
.field--check {
  align-items: center;
  flex-direction: row;
  gap: 0.55rem;
}
.field--check input[type="checkbox"] {
  accent-color: var(--amber);
  height: 1rem;
  padding: 0;
  width: 1rem;
}
.field--check > span {
  margin: 0;
}

/* ---- Jobs phase 2: select-&-apply next step ---------------------------- */
.jobs-next {
  margin-top: 1.2rem;
  border: 1px solid var(--amber-glow);
}
.jn__intro {
  margin: 0 0 0.9rem;
  color: var(--ink-dim);
  font-size: var(--text-body);
  line-height: 1.5;
}
.jn__list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.jn__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line-soft);
}
.jn__row:last-child {
  border-bottom: none;
}
.jn__row--manual {
  opacity: 0.82;
}
.jn__check,
.jn__check-spacer {
  flex: 0 0 auto;
  width: 1rem;
  height: 1rem;
}
.jn__check {
  accent-color: var(--amber);
  cursor: pointer;
}
.jn__score {
  flex: 0 0 auto;
  min-width: 2ch;
  text-align: center;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--amber-bright);
}
.jn__role {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.jn__title {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.jn__co {
  font-size: var(--text-meta);
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}
.jn__tag {
  flex: 0 0 auto;
  font-size: var(--text-label);
  color: var(--ok);
  white-space: nowrap;
}
.jn__method {
  flex: 0 0 auto;
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
  white-space: nowrap;
}
.jn__method--browser_form {
  color: var(--amber-bright);
  border-color: var(--amber-glow);
}
.jn__method--needs_login,
.jn__method--manual {
  color: var(--ink-faint);
}
.jn__open {
  flex: 0 0 auto;
  font-size: var(--text-meta);
  color: var(--amber);
  text-decoration: none;
  white-space: nowrap;
}
.jn__open:hover {
  text-decoration: underline;
}
.jn__status {
  flex: 0 0 auto;
  min-width: 8ch;
  text-align: right;
  font-size: var(--text-meta);
  color: var(--ink-faint);
}
.jn__status.is-ok {
  color: var(--ok);
}
.jn__status.is-staged {
  color: var(--warn);
}
.jn__status.is-err {
  color: var(--err);
}
.jn__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}
.jn__note {
  margin-top: 0.8rem;
  font-size: var(--text-meta);
  color: var(--ink-dim);
  min-height: 1em;
}
.jn__note.is-busy {
  color: var(--amber-bright);
}
.jn__note.is-done {
  color: var(--ink);
}
.jn__note.is-err {
  color: var(--err);
}
.jn__foot {
  margin: 0.7rem 0 0;
  font-size: var(--text-label);
  color: var(--ink-faint);
}
@media (max-width: 720px) {
  .jn__row {
    flex-wrap: wrap;
  }
  .jn__status {
    text-align: left;
    min-width: 0;
  }
}

/* ============================================================================
   Shared result panels — artifact shelf, evidence, coverage, sidecar health.
   Rendered by web/panels.js and attached to every mode's result view.
   ========================================================================== */

/* --- artifact shelf ------------------------------------------------------ */

.shelf {
  margin: 2.5rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}
.shelf-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}
.shelf-head h3 {
  font-family: var(--display);
  font-size: var(--text-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0;
}
.shelf-all {
  font-size: var(--text-meta);
  color: var(--amber);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.shelf-all:hover { border-bottom-color: var(--amber); }

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.6rem;
}
.artifact {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  background: var(--paper-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease;
  min-width: 0;
}
.artifact:hover {
  border-color: var(--amber-deep);
  background: var(--paper-raise);
}
.artifact-kind {
  flex: none;
  font-family: var(--mono);
  font-size: var(--text-micro);
  letter-spacing: 0.06em;
  color: var(--amber);
  border: 1px solid var(--amber-deep);
  border-radius: var(--radius);
  padding: 0.2rem 0.3rem;
  min-width: 2.4rem;
  text-align: center;
}
.artifact-name {
  flex: 1 1 auto;
  font-size: var(--text-meta);
  /* A long generated filename must not blow out the grid column. */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.artifact-size {
  flex: none;
  font-size: var(--text-label);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* --- evidence ------------------------------------------------------------ */

.evidence {
  margin: 2.5rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}
.evidence-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.evidence-head h3 {
  font-family: var(--display);
  font-size: var(--text-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0;
}
.evidence-counts {
  font-family: var(--mono);
  font-size: var(--text-label);
  color: var(--ink-faint);
}
.evidence-warn { color: var(--warn); font-size: var(--text-meta); margin: 0 0 0.7rem; }
.evidence-ok { color: var(--ok); font-size: var(--text-meta); margin: 0; }

.evidence-list { list-style: none; margin: 0; padding: 0; }
.evidence-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: var(--text-meta);
  line-height: 1.5;
}
.ev-tag {
  flex: none;
  font-family: var(--mono);
  font-size: var(--text-micro);
  letter-spacing: 0.07em;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius);
  border: 1px solid currentColor;
}
.ev-ok .ev-tag { color: var(--ok); }
.ev-attr .ev-tag { color: var(--ink-faint); }
.ev-warn .ev-tag { color: var(--warn); }
.ev-bad .ev-tag { color: var(--err); }
.ev-text { flex: 1 1 20rem; min-width: 0; }
.ev-missing { color: var(--err); font-family: var(--mono); font-size: var(--text-label); }
.ev-src { color: var(--ink-faint); font-size: var(--text-label); }

.evidence-more { margin-top: 0.9rem; }
.evidence-more summary {
  cursor: pointer;
  color: var(--ink-dim);
  font-size: var(--text-meta);
  padding: 0.3rem 0;
}
.evidence-more summary:hover { color: var(--ink); }

/* --- source coverage ----------------------------------------------------- */

.coverage {
  margin: 2.5rem 0 0;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
}
.coverage h3 {
  font-family: var(--display);
  font-size: var(--text-body);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0 0 0.8rem;
}
.coverage-row {
  display: grid;
  grid-template-columns: minmax(6rem, 14rem) 1fr 2.5rem;
  align-items: center;
  gap: 0.7rem;
  padding: 0.22rem 0;
  font-size: var(--text-meta);
}
.coverage-host {
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.coverage-bar {
  display: block;
  height: 0.4rem;
  background: var(--ink-ghost);
  border-radius: 999px;
  overflow: hidden;
}
.coverage-bar i {
  display: block;
  height: 100%;
  background: var(--amber-deep);
}
.coverage-n {
  text-align: right;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* --- sidecar health ------------------------------------------------------ */

.sidecars {
  margin-top: 0.9rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line-soft);
  font-size: var(--text-label);
}
.sidecars-head {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: var(--text-micro);
  margin-bottom: 0.5rem;
}
.sidecars-ok { color: var(--ok); }
.sidecars-warn { color: var(--warn); }

.sidecar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.22rem 0;
  color: var(--ink-dim);
}
.sidecar.is-missing { color: var(--ink-faint); }
.sidecar-dot {
  flex: none;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--ink-ghost);
}
.sidecar-dot.is-ready { background: var(--ink-faint); }
.sidecar-dot.is-live { background: var(--ok); }
.sidecar-dot.is-off { background: var(--err); }
.sidecar-name { flex: none; min-width: 3.6rem; color: var(--ink); }
.sidecar.is-missing .sidecar-name { color: var(--ink-faint); }
.sidecar-purpose {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--text-label);
}
.sidecar-state { flex: none; color: var(--ok); font-size: var(--text-micro); }

/* Narrow screens: the shelf goes single-column and coverage drops its bar so
   the host name keeps its room. */
@media (max-width: 40rem) {
  .shelf-grid { grid-template-columns: 1fr; }
  .coverage-row { grid-template-columns: 1fr 2.5rem; }
  .coverage-bar { display: none; }
  .sidecar-purpose { display: none; }
}

/* ---- API keys (Billing page) ------------------------------------------- */
.apikeys__create {
  display: flex;
  gap: 0.6rem;
  margin: 0.6rem 0 0.4rem;
  flex-wrap: wrap;
}
.apikeys__name {
  flex: 1 1 14rem;
  min-width: 0;
  background: var(--paper-raise);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  font: inherit;
}
.apikeys__name:focus {
  outline: none;
  border-color: var(--amber);
}
.apikeys__reveal {
  border: 1px solid var(--amber-glow);
  background: var(--amber-glow);
  border-radius: var(--radius);
  padding: 0.7rem 0.8rem;
  margin: 0.6rem 0;
}
.apikeys__reveal-warn {
  color: var(--amber-bright);
  font-size: var(--text-meta);
  margin-bottom: 0.4rem;
}
.apikeys__reveal-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.apikeys__key {
  flex: 1 1 20rem;
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, monospace;
  font-size: var(--text-meta);
  color: var(--ink);
}
.apikeys__list {
  display: flex;
  flex-direction: column;
  margin-top: 0.4rem;
}

/* the morning show: hub player + profile settings */
.show {
  margin: 1rem auto 0;
  max-width: 46rem;
  padding: 0.8rem 0.9rem 0.9rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--ink) 2%, transparent);
}
.show__head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.45rem;
}
.show__mark {
  color: var(--amber);
  font-size: var(--text-label);
}
.show__title {
  color: var(--ink);
  font-size: var(--text-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.show__hint {
  color: var(--ink-faint);
  font-size: var(--text-label);
}
.show__text {
  color: var(--ink-dim);
  font-size: var(--text-body);
  line-height: 1.55;
  margin: 0 0 0.6rem;
}
.show__text--dim {
  color: var(--ink-faint);
}
.show__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.show__ep-title {
  font-size: var(--text-lede);
  line-height: 1.25;
  color: var(--ink);
  margin: 0 0 0.5rem;
}
.show__audio {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 0.2rem 0 0.6rem;
}
.show__read {
  margin: 0.2rem 0 0.6rem;
}
.show__read summary {
  cursor: pointer;
  color: var(--ink-faint);
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.show__seg {
  color: var(--ink-dim);
  font-size: var(--text-body);
  line-height: 1.6;
  margin: 0.5rem 0 0;
}
.show__sugg {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin: 0.4rem 0 0.6rem;
}
.show__sugg-btn {
  display: flex;
  gap: 0.6rem;
  align-items: baseline;
  width: 100%;
  min-width: 0;
  text-align: left;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: color-mix(in oklab, var(--ink) 3%, transparent);
  color: var(--ink-dim);
  cursor: pointer;
  font-size: var(--text-meta);
}
.show__sugg-btn:hover {
  border-color: var(--amber-glow);
  color: var(--ink);
}
.show__sugg-mode {
  flex: 0 0 auto;
  color: var(--amber);
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.show__sugg-q {
  min-width: 0;
  overflow-wrap: anywhere;
}
.show__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}
.show__stamp {
  color: var(--ink-faint);
  font-size: var(--text-micro);
}
.show__opts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  margin: 0.8rem 0 0.4rem;
}
.show__opt {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--ink-dim);
  font-size: var(--text-meta);
}
.show__feed {
  margin-top: 0.6rem;
}

/* following (P3): chips, the add row, and shelf toggles */
.follows {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.5rem 0;
}
.follow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
  padding: 0.3rem 0.3rem 0.3rem 0.6rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: color-mix(in oklab, var(--ink) 3%, transparent);
  color: var(--ink);
  font-size: var(--text-meta);
}
.follow.is-muted {
  opacity: 0.55;
}
.follow.is-muted .follow__value {
  text-decoration: line-through;
}
.follow__kind {
  color: var(--amber);
  font-size: var(--text-micro);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.follow__value {
  min-width: 0;
  overflow-wrap: anywhere;
}
.follow__btn {
  background: none;
  border: 0;
  color: var(--ink-faint);
  cursor: pointer;
  font-size: var(--text-meta);
  line-height: 1;
  padding: 0.25rem 0.35rem;
  min-width: 1.6rem;
  min-height: 1.6rem;
}
.follow__btn:hover {
  color: var(--amber-bright);
}
.follows__add {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.6rem 0;
}
.shelf {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: none;
  color: var(--ink-dim);
  cursor: pointer;
  font-size: var(--text-meta);
}
.shelf:hover {
  border-color: var(--amber-glow);
  color: var(--ink);
}
.shelf.is-on {
  border-color: var(--amber);
  color: var(--ink);
}
.shelf__mark {
  color: var(--amber);
  font-size: var(--text-meta);
}
.show__speaker {
  color: var(--amber);
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-family: var(--sans, inherit);
}
.show__reply {
  margin: 0.4rem 0 0.6rem;
}
.show__reply-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.show__reply-in {
  flex: 1 1 auto;
  min-width: 0;
}
.show__reply-out {
  margin-top: 0.4rem;
}
.show__reply-out .show__sugg-btn {
  margin-top: 0.4rem;
}

/* episode share (P18) */
.show__share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* story watches (P9) in the Following panel */
.follows__watches {
  margin-top: 0.4rem;
}
.watch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.8rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border-top: 1px solid var(--line-soft);
  font-size: var(--text-meta);
}
.watch__title {
  color: var(--ink);
  min-width: 0;
  overflow-wrap: anywhere;
}
.watch__meta {
  color: var(--ink-faint);
  font-size: var(--text-label);
}

/* capture (P5): the /share screen and the profile panel */
.capture__url {
  margin-top: 0.4rem;
  font-size: var(--text-meta);
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}
.capture__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.2rem;
  margin: 0.8rem 0 0.6rem;
}
.capture__bm {
  cursor: grab;
}
.capture__steps {
  margin: 0.4rem 0 0.8rem 1.2rem;
  padding: 0;
  color: var(--ink-dim);
  font-size: var(--text-body);
  line-height: 1.55;
}
.capture__steps li {
  margin: 0.25rem 0;
}
.capture__steps code {
  font-family: var(--mono);
  font-size: var(--text-meta);
  overflow-wrap: anywhere;
}

/* reach (hosted): the after-run nudge card, and the Connect panel's snippet */
.nudge {
  margin-top: 1.2rem;
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--amber-glow);
  background: var(--amber-glow);
  border-radius: var(--radius);
  max-width: 34rem;
}
.nudge.is-done {
  border-color: var(--line);
  background: var(--paper-2);
}
.nudge__title {
  font-family: var(--serif);
  font-size: var(--text-lede);
  line-height: 1.25;
  margin: 0.25rem 0 0.35rem;
  color: var(--ink);
}
.nudge__body {
  margin: 0 0 0.8rem;
  font-size: var(--text-body);
  color: var(--ink-dim);
}
.nudge__actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.connect__out {
  margin-top: 0.8rem;
  min-width: 0;
}
.connect__snippet {
  margin: 0.5rem 0 0;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  font-family: var(--mono);
  font-size: var(--text-label);
  line-height: 1.5;
  color: var(--ink);
  overflow-x: auto;
  white-space: pre;
  max-width: 100%;
}
.apikey {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line-soft);
}
.apikey:last-child {
  border-bottom: none;
}
.apikey.is-revoked {
  opacity: 0.55;
}
.apikey__main {
  min-width: 0;
}
.apikey__name {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.apikey__meta {
  margin-top: 0.2rem;
  font-size: var(--text-label);
  line-height: 1.45;
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}
.apikey__badge {
  flex: 0 0 auto;
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--err);
}
.apikeys__usage code {
  display: block;
  margin-top: 0.4rem;
  overflow-x: auto;
  white-space: pre;
  font-size: var(--text-label);
  color: var(--ink-dim);
}

/* ---- MCP connectors ---------------------------------------------------- */
/* Reuses the `.apikey` row wholesale — same shape, same job. What it adds is a
   group for the row's several actions (test / disable / remove): the row is
   `space-between`, so three loose buttons would each be flung to a different
   part of the line instead of reading as one control cluster. */
.apikey__actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

.mcp-headers {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
/* Header name / value / remove. `minmax(0, …)` rather than a bare fraction is
   the whole reason this does not overflow on a phone: a grid track defaults to
   `min-content`, and a pasted token has no wrap opportunities, so an `auto`
   or `1fr` track would grow to the width of the token and push the page
   sideways. The floor of 0 lets the input shrink and scroll its own value. */
.mcp-header-row {
  display: grid;
  grid-template-columns: minmax(0, 8rem) minmax(0, 1fr) auto;
  gap: 0.4rem;
  align-items: center;
}
.mcp-header-row input {
  min-width: 0;
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--mono);
  font-size: var(--text-body);
  padding: 0.6rem 0.7rem;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.mcp-header-row input:focus {
  border-color: var(--amber-deep);
  outline: none;}
/* Below this the two fields sit on top of each other rather than squeezing the
   value field down to a few characters. */
@media (max-width: 30rem) {
  .mcp-header-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .mcp-header-row input:first-child {
    grid-column: 1 / -1;
  }
}

/* ---- Security assessment report --------------------------------------- */
.sec-overview .panel__body { padding-top: 1rem; padding-bottom: 1rem; }
.sec-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
  gap: 0.6rem;
}
.sec-stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.7rem 0.6rem;
  text-align: center;
  background: var(--paper-raise);
}
.sec-stat__v {
  font-size: var(--text-title);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.sec-stat__l {
  margin-top: 0.2rem;
  font-size: var(--text-micro);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-faint);
}
.sec-stat--good .sec-stat__v { color: var(--ok); }
.sec-stat--warn .sec-stat__v { color: var(--warn); }
.sec-stat--bad .sec-stat__v { color: var(--err); }
.sec-stat--good { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.sec-stat--bad { border-color: color-mix(in srgb, var(--err) 45%, transparent); }

.sec-meta {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.sec-meta__row {
  display: flex;
  gap: 0.8rem;
  align-items: baseline;
  font-size: var(--text-meta);
}
.sec-meta__k {
  flex: 0 0 4.5rem;
  color: var(--ink-faint);
  text-transform: uppercase;
  font-size: var(--text-label);
  letter-spacing: 0.04em;
}
.sec-meta__v { overflow-wrap: anywhere; min-width: 0; }
.sec-meta__link { color: var(--amber); text-decoration: none; }
.sec-meta__link:hover { text-decoration: underline; }

.sec-timeline .panel__body { display: flex; flex-direction: column; gap: 0.4rem; }
.sec-round { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sec-round__sum {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.8rem;
  cursor: pointer;
  list-style: none;
}
.sec-round__sum::-webkit-details-marker { display: none; }
.sec-round__sum::after { content: "▸"; color: var(--ink-faint); transition: transform 0.15s; }
.sec-round[open] .sec-round__sum::after { transform: rotate(90deg); }
.sec-round__n { font-weight: 600; }
.sec-round__meta { margin-left: auto; margin-right: 0.4rem; font-size: var(--text-meta); color: var(--ink-faint); }
.sec-round__body { padding: 0.2rem 0.8rem 0.7rem; border-top: 1px solid var(--line-soft); }

.sec-check {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: var(--text-meta);
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.sec-check:last-child { border-bottom: none; }
.sec-check__dot { flex: 0 0 auto; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--ink-faint); align-self: center; }
.sec-check--exploited .sec-check__dot { background: var(--err); }
.sec-check--cleared .sec-check__dot { background: var(--ok); }
.sec-check--error .sec-check__dot { background: var(--warn); }
.sec-check__vuln { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.sec-check__out {
  flex: 0 0 auto;
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-faint);
}
.sec-check--exploited .sec-check__out { color: var(--err); font-weight: 600; }
.sec-check--cleared .sec-check__out { color: var(--ok); }
.sec-check__hint { flex: 1 1 100%; font-size: var(--text-label); color: var(--ink-faint); overflow-wrap: anywhere; }

.sec-fp { margin-top: 1.2rem; }
.sec-fp__sum { display: flex; align-items: baseline; gap: 0.8rem; cursor: pointer; list-style: none; }
.sec-fp__sum::-webkit-details-marker { display: none; }
.sec-fp__hint { color: var(--ink-faint); font-size: var(--text-meta); }
.sec-fp__list { margin: 0; padding-left: 1.1rem; columns: 2; column-gap: 1.5rem; }
.sec-fp__list li { font-size: var(--text-meta); overflow-wrap: anywhere; break-inside: avoid; }

.sec-block { margin-top: 1.2rem; }
.sec-block--bad { border: 1px solid color-mix(in srgb, var(--err) 40%, transparent); }
.sec-finding { padding: 0.5rem 0; border-bottom: 1px solid var(--line-soft); }
.sec-finding:last-child { border-bottom: none; }
.sec-finding__name { font-weight: 600; color: var(--err); overflow-wrap: anywhere; }
.sec-finding__d { font-size: var(--text-meta); color: var(--ink-dim); margin-top: 0.2rem; }
.sec-report { margin-top: 1.2rem; }
@media (max-width: 560px) {
  .sec-fp__list { columns: 1; }
}

/* ---- "Swarm anything" box (homepage router) -------------------------------- */
.swarm-any {
  max-width: var(--maxw);
  margin: 1.4rem auto 2.4rem;
  padding: 1.3rem;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 30px 80px -46px color-mix(in oklab, var(--shadow) 100%, transparent), inset 0 1px 0 var(--line-soft);
}
.swarm-any__eyebrow {
  display: block;
  margin-bottom: 0.7rem;
  color: var(--amber);
}
.swarm-any__bar {
  display: flex;
  gap: 0.9rem;
  align-items: stretch;
}
.swarm-any__input {
  flex: 1;
  min-height: 62px;
  resize: vertical;
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--text-lede);
  line-height: 1.5;
  padding: 0.95rem 1.1rem;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.swarm-any__input::placeholder {
  color: var(--ink-faint);
  font-style: italic;
}
.swarm-any__input:focus {
  border-color: var(--amber-deep);
  outline: none;
}
.swarm-any__go {
  align-self: stretch;
  white-space: nowrap;
}
.swarm-any__hint {
  margin-top: 0.7rem;
  font-size: var(--text-meta);
  color: var(--ink-faint);
}
.swarm-any__result:empty {
  display: none;
}
.swarm-any__pick {
  margin-top: 1.1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  animation: swarmAnyIn 0.24s var(--ease);
}
.swarm-any__pick.is-sure {
  border-color: var(--amber-bright);
}
@keyframes swarmAnyIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.swarm-any__pickhead {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}
.swarm-any__mode {
  font-family: var(--serif);
  font-size: var(--text-title);
  color: var(--ink);
}
.swarm-any__conf {
  font-size: var(--text-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.swarm-any__tag {
  margin: 0.35rem 0 0.9rem;
  color: var(--ink-dim);
  font-size: var(--text-body);
}
.swarm-any__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
}
.swarm-any__or {
  color: var(--ink-faint);
  font-size: var(--text-meta);
}
.swarm-any__alt {
  padding: 0.5rem 0.95rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  font-size: var(--text-body);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.swarm-any__alt:hover {
  border-color: var(--amber);
  color: var(--ink);
}
.swarm-any__err {
  margin-top: 1rem;
  color: var(--err);
  font-size: var(--text-body);
}
.linklike {
  background: none;
  border: none;
  padding: 0;
  color: var(--amber);
  cursor: pointer;
  font: inherit;
  text-decoration: underline;
}
@media (max-width: 620px) {
  .swarm-any__bar { flex-direction: column; }
  .swarm-any__go { align-self: flex-end; }
  /* The placeholder is three lines on a phone and the box showed two and a
     half — the third example was cut mid-word along the bottom edge. */
  .swarm-any__input { min-height: 8rem; }
}

/* ---- structured chip picker (e.g. News categories) ------------------------- */
.field--chips {
  grid-column: 1 / -1; /* span the full launch-form grid row */
}
.chips-field {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}
.chips-field__chip {
  padding: 0.42rem 0.85rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-dim);
  font-family: var(--mono);
  font-size: var(--text-meta);
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease), background 0.15s var(--ease);
}
.chips-field__chip:hover {
  border-color: var(--amber);
  color: var(--ink);
}
.chips-field__chip.is-on {
  background: var(--amber-glow);
  border-color: var(--amber);
  color: var(--ink);
}

/* ---- failed / partial run banner (top of a recalled failed report) --------- */
/* People dossier (F5): the compliance framing that leads every dossier. */
.dossier-note {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-dim);
  font-size: var(--text-meta);
  margin: 0 0 1.2rem;
  padding: 0.5rem 0.9rem;
}
.dossier-note b {
  color: var(--ink);
}

.run-failbanner {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0 auto 1.4rem;
  max-width: var(--maxw);
}
.run-failbanner__tag {
  font-weight: 600;
}
.run-failbanner__err {
  font-family: var(--mono);
  font-size: var(--text-meta);
  opacity: 0.92;
  word-break: break-word;
}
.run-failbanner__note {
  color: var(--ink-faint);
  font-size: var(--text-meta);
}
.run-failbanner__restart {
  align-self: flex-start;
  margin-top: 0.6rem;
}

/* ---------------------------------------------- executive lead + mobile ---
   The lead card: every report now opens with its conclusion (declared by the
   model, or derived from the opening prose when it didn't write one), so the
   reader meets the answer before the working. */
.rlead {
  margin: 0.25rem 0 1.5rem;
  padding: 1.15rem 1.3rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
.rlead__eyebrow {
  display: block;
  margin-bottom: 0.55rem;
  opacity: 0.7;
}
.rlead__body > :first-child { margin-top: 0; }
.rlead__body > :last-child { margin-bottom: 0; }
.rlead__body {
  font-size: var(--text-body);
  line-height: 1.65;
}

/* Wide content must scroll inside itself, never the page. A report table on a
   phone used to push the whole document sideways. */
.md table { display: block; width: 100%; overflow-x: auto; }

/* ---- reports on a wide display -------------------------------------------
   Reports are now mostly TABLES — a training block is six columns wide and a
   grocery list is four — and 900px was set when they were mostly prose. On a
   1440p display that left a table crushed into half the screen with the rest
   empty, columns wrapping mid-word for no reason.

   The container widens in two steps rather than one so a 13" laptop is not
   handed a line length meant for a 27" monitor. */
@media (min-width: 78rem) {
  .report { max-width: 1240px; }
}
@media (min-width: 100rem) {
  .report { max-width: 1460px; }
}

/* Prose does NOT get longer lines along with it. Past roughly 80 characters
   the eye loses its place returning to the start of the next line, so text
   keeps a readable measure while tables, code, and images take the full width
   the container now offers. Scoped to direct children so a paragraph inside a
   table cell is unaffected. */
@media (min-width: 78rem) {
  .md > p,
  .md > ul,
  .md > ol,
  .md > dl,
  .md > blockquote,
  .md > h1,
  .md > h2,
  .md > h3,
  .md > h4,
  .md > h5,
  .md > h6 {
    max-width: 84ch;
  }
  /* Wider columns mean fewer forced breaks, so cells can breathe a little. */
  .md table { font-size: var(--text-body); }
  .md th,
  .md td { padding: 0.6rem 0.85rem; }
}

@media (max-width: 40rem) {
  /* Touch targets: 44px is the smallest reliably-hittable control on a phone.
     Applied to everything interactive rather than a list of components, so a
     control added later inherits it instead of shipping too small. */
  .btn,
  button,
  select,
  input[type="submit"],
  .rtoc__chip,
  .rtoc__all {
    min-height: 44px;
  }
  input,
  textarea,
  select {
    /* iOS zooms the viewport when a focused field is under 16px. */
    font-size: max(16px, 1rem);
  }
  .rlead { padding: 1rem 1.05rem; }

  /* Bottom-anchored actions clear the home indicator. Without the safe-area
     inset the last control sits under it and is genuinely untappable. */
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
  /* This row used to be `position: sticky; bottom: …`, pinned to the foot of
     the viewport. It sits in the MIDDLE of the panel — prompt, then this row,
     then the schedule box and the advanced options — so sticking it meant it
     floated over whichever of those happened to be beneath it as you scrolled,
     the prompt field included. It is in normal flow now: it stays under the
     prompt where it was put, and nothing moves while you scroll. The thumb
     zone is already served by the fixed tab bar. */
  .ask__actions {
    flex-wrap: wrap;
    padding-top: 0.7rem;
  }
  /* The commit action goes full width and last; the secondary controls keep
     their natural size on the row above it. */
  .ask__actions > .btn--amber {
    flex: 1 0 100%;
    justify-content: center;
    order: 2;
  }
  .ask__actions > .spacer { display: none; }
}

/* Numeric table cells carry a proportional bar behind the value — magnitude at
   a glance, without a charting dependency. The bar sits under the text, so the
   number stays the primary read. */
.md td.cell--num {
  position: relative;
  isolation: isolate;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.md td.cell--num .cell__bar {
  position: absolute;
  z-index: -1;
  right: 0;
  top: 12%;
  bottom: 12%;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent, var(--ink)) 22%, transparent);
}
.md td.cell--num .cell__bar--neg {
  background: color-mix(in oklab, var(--err) 26%, transparent);
}

@media (max-width: 40rem) {
  /* Reports on a phone. The document itself must never scroll sideways — any
     wide child scrolls inside its own box instead, which is what keeps the
     narrative column readable while a table or a code block stays intact. */
  .report__doc { max-width: 100%; }
  .report__doc pre,
  .md pre {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: var(--text-meta);
  }
  .md table { font-size: var(--text-meta); }
  .md td, .md th { white-space: nowrap; }
  .md td:first-child, .md th:first-child { white-space: normal; min-width: 8rem; }
  /* Long URLs and identifiers are the usual culprit for a sideways page. */
  .md a, .md code { overflow-wrap: anywhere; }

  /* The section index is a chip list; let it wrap and keep each chip tappable
     instead of squeezing a dozen onto one scrolling line. */
  .rtoc { padding: 0.75rem 0.8rem; gap: 0.4rem; }
  .rtoc__chip { min-height: 34px; font-size: var(--text-label); }
  .rsec__sum { padding: 0.7rem 0.55rem; }
  .rsec__body { padding: 0 0.55rem 0.8rem; }
  .rlead__body { font-size: var(--text-body); }

  /* Numeric bars read as clutter at phone width where the number is the whole
     point — keep them, but lighter, so the digits stay legible. */
  .md td.cell--num .cell__bar { opacity: 0.6; }
}

/* ------------------------------------------- no sideways page, as a rule ---
   Chasing individual wide elements never converges — one long URL, one grid,
   one absolutely-positioned decoration and the page pans again. So state the
   invariant instead: below 40rem the DOCUMENT never scrolls horizontally, and
   anything genuinely wide scrolls inside its own box (a table) or is made to
   fit (everything else).

   `overflow-x: clip` rather than `hidden` on purpose: `hidden` makes the body a
   scroll container, which silently kills `position: sticky` anywhere inside it.
   Nothing in the launcher relies on that any more, but the rule stands: `clip`
   costs nothing and `hidden` breaks sticky wherever it is next used. */
@media (max-width: 40rem) {
  html,
  body {
    overflow-x: clip;
    max-width: 100%;
  }

  /* Flex and grid children default to min-width:auto, so a single long word or
     an oversized child refuses to shrink and pushes the whole row wider than
     the screen. This one line is the usual cause of a page that pans. */
  *:not(table):not(thead):not(tbody):not(tr):not(td):not(th) {
    min-width: 0;
  }

  /* Replaced elements and embeds fit the column rather than defining it. */
  img,
  svg,
  video,
  canvas,
  iframe,
  embed,
  object {
    max-width: 100%;
    height: auto;
  }

  /* Unbroken strings — URLs, hashes, run ids, tokens — are the other classic
     cause. Break them rather than let one widen the page. */
  p, li, td, dd, dt, h1, h2, h3, h4, h5, h6, blockquote, figcaption, label, summary {
    overflow-wrap: anywhere;
  }

  /* The sanctioned exception: tabular data keeps its shape and scrolls inside
     its own box. Everything else above guarantees the page itself does not. */
  .md table,
  .list > table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* Price and volume bonus on a buy card. The dollar figure is the commitment,
   so it reads at the same weight as the credit count; the bonus is the reason
   to size up, so it gets the accent. */
.pack-buy__usd {
  font-family: var(--code);
  font-size: var(--text-body);
  opacity: 0.85;
  margin-top: 0.15rem;
}
.pack-buy__bonus {
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-top: 0.2rem;
}

/* Volume-deal framing on the buy cards. The bonus credits are the argument for
   sizing up, so they read louder than the percentage; the dollar value anchors
   it in the unit the buyer is thinking in. */
.pack-buy { position: relative; }
.pack-buy__bonus-n {
  display: block;
  color: var(--amber);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.pack-buy__bonus-v {
  display: block;
  font-size: var(--text-micro);
  opacity: 0.7;
  text-transform: none;
  letter-spacing: 0.02em;
}
.pack-buy__badge {
  position: absolute;
  top: -0.55rem;
  right: 0.6rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--amber);
  color: var(--room);
  font-size: var(--text-micro);
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* =====================================================================
   MOBILE BOTTOM NAVIGATION
   The masthead is a desktop pattern: ten links along the top edge, which on a
   phone is both cramped and the hardest place on the screen to reach. Below
   48rem the primary destinations move to a fixed bottom bar within thumb
   reach, and the masthead keeps only what it is uniquely good at — identity,
   provider health, and the credit balance.

   The bar is `display: none` outside the mobile range, so this adds nothing to
   the desktop layout; it is the same four ROUTE_RENDER destinations either way.
   ===================================================================== */
.tabbar {
  display: none;
}
.msheet {
  display: none;
}

@media (max-width: 48rem) {
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    align-items: stretch;
    gap: 0;
    background: color-mix(in oklab, var(--room) 94%, transparent);
    /* The bar sits over scrolling content; without a backdrop the text behind
       it shows through the translucency and both become unreadable. */
    border-top: 1px solid var(--line);
    /* The inset keeps the row above the iPhone home indicator instead of
       under it, where the bottom third of every target is unhittable. */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tabbar__btn {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.18rem;
    /* 52px of height before the safe-area inset: comfortably past the 44px
       minimum, and the whole cell is the target — not just the glyph. */
    min-height: 52px;
    padding: 0.35rem 0.15rem;
    background: none;
    border: 0;
    color: var(--ink-dim);
    font: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar__btn.hidden {
    display: none;
  }
  .tabbar__icon {
    display: block;
    line-height: 0;
  }
  .tabbar__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .tabbar__label {
    font-size: var(--text-micro);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
  }
  .tabbar__btn.is-on {
    color: var(--amber-bright);
  }
  /* The active tab also gets a bar along the top edge — colour alone is not a
     reliable signal for a colour-blind viewer, and at 0.64rem it is subtle. */
  .tabbar__btn.is-on::before {
    content: "";
    position: absolute;
    top: 0;
    width: 1.9rem;
    height: 2px;
    background: currentColor;
  }
  .tabbar__btn {
    position: relative;
  }
  .tabbar__btn:active {
    background: color-mix(in srgb, var(--ink) 8%, transparent);
  }

  /* Content must not end underneath the bar — reserve its height plus the
     safe-area inset at the foot of the document. 56, not 52: the bar is 52px
     of buttons plus a 1px top border, and measuring it found the footer
     overlapping by exactly that 1px. The rest is air. */
  body {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }
  /* While the on-screen keyboard is up (app.js flags <html>.kb-open) the bar
     would sit directly above the keys, taking a row of the little screen
     left for the field being typed into — and nobody navigates mid-word.
     Hide it, and give the reserved foot back to the content. */
  html.kb-open .tabbar {
    display: none;
  }
  html.kb-open body {
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  /* The masthead links now live in the bar (or its More sheet), so showing
     both would be two navigations for the same destinations. */
  .masthead__link,
  .masthead__admin {
    display: none;
  }
  /* The inbox is opened from the More sheet, so its BUTTON goes but the
     wrapper stays — it owns the dropdown. Anchored to a now-invisible button,
     the dropdown would open somewhere arbitrary, so on a phone it becomes a
     bottom sheet of its own: full width, above the tab bar, capped so a long
     feed scrolls inside itself rather than running off the screen. */
  .masthead .inbox {
    position: static;
  }
  .masthead .inbox__btn {
    display: none;
  }
  .masthead .inbox__drop {
    /* Was position:fixed bottom-anchored — but the masthead's backdrop-filter
       makes the MASTHEAD the containing block for fixed descendants, so
       bottom:53px measured from the header's own bottom edge and the sheet
       grew upward off the top of the screen. Absolute anchors under the
       header instead (the masthead is position:relative at desktop level). */
    position: absolute;
    top: calc(100% + 0.5rem);
    bottom: auto;
    left: 0.5rem;
    right: 0.5rem;
    width: auto;
    max-height: min(60vh, 26rem);
    z-index: 65;
  }
  .masthead {
    padding: 0.85rem var(--gutter);
    align-items: center;
  }
  .masthead__meta {
    gap: 0.6rem;
  }

  /* ---- the More sheet ---- */
  .msheet {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: flex;
    align-items: flex-end;
    background: color-mix(in oklab, var(--shadow) 80%, transparent);
    transition: opacity 0.16s ease;
  }
  .msheet.hidden {
    opacity: 0;
    pointer-events: none;
  }
  .msheet__panel {
    width: 100%;
    background: var(--paper-2);
    border-top: 1px solid var(--line);
    padding: 0.5rem 0 calc(53px + 0.5rem + env(safe-area-inset-bottom, 0px));
    transform: translateY(0);
    transition: transform 0.18s ease;
  }
  .msheet.hidden .msheet__panel {
    transform: translateY(100%);
  }
  /* The bar stays on top of an open sheet: More closes it again and every
     tab still goes where it says. The panel's foot is padded for it. */
  body:has(.msheet:not(.hidden)) .tabbar {
    z-index: 71;
  }
  .msheet__panel {
    max-height: calc(100dvh - 3rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .msheet__grip {
    width: 2.5rem;
    height: 3px;
    border-radius: 999px;
    background: var(--ink-faint);
    margin: 0.25rem auto 0.6rem;
  }
  .msheet__item {
    display: block;
    width: 100%;
    min-height: 48px;
    padding: 0 1.1rem;
    background: none;
    border: 0;
    border-top: 1px solid var(--line-soft);
    color: var(--ink);
    font: inherit;
    font-size: var(--text-body);
    text-align: left;
    text-decoration: none;
    line-height: 48px;
    cursor: pointer;
  }
  .msheet__item--warn {
    color: var(--err);
  }
}

@media (prefers-reduced-motion: reduce) {
  :root:not(.motion-on) .msheet,
  :root:not(.motion-on) .msheet__panel {
    transition: none;
  }
}

/* A table whose header survived but whose body is empty — a run that built its
   output scaffold and found nothing to fill it. Shown as an explicit empty
   state rather than a header bar over blank space, which reads as a bug. */
.md-empty {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.7rem;
  margin: 0.9rem 0;
  padding: 0.75rem 0.9rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink) 3%, transparent);
}
.md-empty__t {
  font-weight: 700;
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.md-empty__c {
  font-family: var(--mono);
  font-size: var(--text-label);
  color: var(--ink-faint);
  overflow-wrap: anywhere;
}

/* Run history on a phone. The row is six columns — dot, title+meta, status,
   credits, actions, arrow — which at 375px leaves the title a few characters
   wide. It wraps instead: identity on the first line, the numbers and controls
   on a second. Nothing is dropped except the arrow, which was decoration for a
   row that is entirely tappable anyway. */
@media (max-width: 48rem) {
  .run-hist__row {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.55rem;
    padding: 0.7rem 0.8rem;
  }
  .run-hist__dot {
    flex: 0 0 auto;
  }
  .run-hist__main {
    flex: 1 1 60%;
    min-width: 0;
  }
  .run-hist__title {
    overflow-wrap: anywhere;
  }
  .run-hist__status,
  .run-hist__credits {
    font-size: var(--text-label);
  }
  /* Push the controls to the end of the wrapped line so they line up down the
     list rather than floating after titles of differing length. */
  .run-hist__actions {
    margin-left: auto;
    gap: 0.15rem;
  }
  /* 0.1rem of padding is a ~14px target. These are destructive (delete, pin) —
     they need real area, and separation from each other. */
  .run-hist__act {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.75;
  }
  .run-hist__row > .btn__arrow {
    display: none;
  }
  /* The hover nudge reads as a jitter on touch, where there is no hover to
     leave — and it happens on tap. */
  .run-hist__row:hover {
    transform: none;
  }
}

/* Stop control. A run in flight is spending credits, so stopping it must be
   reachable — but it is not the primary action on the screen, so it reads as a
   quiet control until hovered rather than competing with the live activity. */
.run__headside {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}
.run__stop {
  white-space: nowrap;
}
.run__stop:hover:not(:disabled) {
  border-color: var(--err);
  color: var(--err);
}
.run-hist__act--stop {
  color: var(--err);
  opacity: 0.75;
}
.run-hist__act--stop:hover {
  opacity: 1;
}
/* A stopped run is not an error — it did what was asked. Neutral, not red. */
.run-hist__status.is-cancelled {
  color: var(--ink-dim);
}

@media (max-width: 48rem) {
  /* The head stacks on a phone; keep the timer and Stop on one line together
     so Stop stays where the thumb already is. */
  .run__headside {
    width: 100%;
    justify-content: space-between;
  }
  .run__stop {
    min-height: 44px;
    padding-inline: 1rem;
  }
}

/* =====================================================================
   CREDITS / BILLING ON A PHONE
   `.pack-buys` was `repeat(3, 1fr)` at every width, with no mobile override.
   At 375px that is ~110px a card, and each card carries a credit figure
   ("172,500") at 1.5rem display weight, a dollar line, and a bonus badge. The
   document did not pan — `overflow-x: clip` saw to that — so the text was
   simply cut off at the card edge, which is what "overflowing the screen"
   looks like from the outside.

   One card per row below 30rem, two up to 48rem, and the type comes down to
   fit what is left.
   ===================================================================== */
@media (max-width: 48rem) {
  .pack-buys {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .pack-buy {
    padding: 0.7rem 0.65rem;
  }
  .pack-buy__c {
    font-size: var(--text-body);
    gap: 0.25rem;
    /* The figure is the point of the card; let it wrap rather than clip. */
    flex-wrap: wrap;
    overflow-wrap: anywhere;
  }
  .pack-buy__coin {
    font-size: var(--text-meta);
  }
  .pack-buy__l {
    font-size: var(--text-micro);
    letter-spacing: 0.12em;
  }
  .pack-buy__usd {
    font-size: var(--text-meta);
  }
  .pack-buy__bonus {
    font-size: var(--text-micro);
    letter-spacing: 0.04em;
  }
  .pack-buy__badge {
    font-size: var(--text-micro);
    padding: 0.1rem 0.35rem;
    right: 0.35rem;
  }

  /* The balance is the largest number on the page — at clamp(2.6rem, …) a
     six-figure balance plus its coin glyph ran past the card. */
  .wallet__num {
    font-size: clamp(1.6rem, 8vw, 2.4rem);
  }
  .wallet__coin {
    font-size: var(--text-lede);
  }
  .wallet__bal {
    gap: 0.3rem;
    flex-wrap: wrap;
  }
  .wallet__stats {
    gap: 1rem;
    flex-wrap: wrap;
  }
  .wallet__stat-v {
    font-size: var(--text-body);
  }
}

/* Narrow phones: two columns still crushes a six-figure credit count, so the
   cards become full-width rows where the figure has the room it needs. */
@media (max-width: 30rem) {
  .pack-buys {
    grid-template-columns: 1fr;
  }
  .pack-buy {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.6rem;
  }
  .pack-buy__c {
    font-size: var(--text-title);
  }
  /* On one line: figure, then price, then the bonus — reading order matches
     the decision order (how much, what it costs, what you get extra). */
  .pack-buy__usd {
    margin-top: 0;
  }
  .pack-buy__l {
    flex: 1 0 100%;
    order: -1;
  }
  .pack-buy__bonus {
    margin-top: 0;
  }
}


/* =====================================================================
   CAPABILITY CARDS ON A PHONE
   One column of 20 full-size cards measured 6131px — picking the last one
   meant scrolling most of a novel. Two per row, and each card trimmed to the
   part you actually choose by: the name, and a couple of lines saying what it
   does. The whole card stays the tap target, so shrinking it costs no
   reachability — it is still far larger than the 44px minimum.
   ===================================================================== */
@media (max-width: 48rem) {
  .caps {
    /* Not a hard 2-up: that held two columns all the way to 768px, where the
       cards came out 349px wide by 112 tall — letterboxed. This gives two on a
       phone and four on a tablet, from the same rule. */
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.55rem;
    margin-top: 1.1rem;
  }
  .cap {
    padding: 0.75rem 0.7rem 0.8rem;
  }
  .cap__orb {
    width: 26px;
    height: 26px;
    margin-bottom: 0.45rem;
  }
  .cap__label {
    font-size: var(--text-body);
  }
  .cap__blurb {
    font-size: var(--text-label);
    line-height: 1.35;
    margin-top: 0.25rem;
    /* Two lines, then ellipsis: enough to tell two capabilities apart without
       letting one long blurb set the height of its whole row. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  /* The card IS the button — a "Launch →" line inside it repeats that and
     costs a line of height on every one of the twenty. */
  .cap__go {
    display: none;
  }
  /* The corner glow is sized in percentages, so on a card a third the width it
     reads as a wash over the label rather than a highlight. */
  .cap::after {
    width: 55%;
    height: 60%;
  }
}

/* Very narrow phones (320px, the long-standing floor) lose the blurb — at
   135px a card, two lines of 0.72rem text is noise and the name is what you
   pick by.

   The column count is pinned to 2 here rather than left to auto-fit: a 150px
   floor does not fit twice into 280px of usable width, so auto-fit dropped to
   a SINGLE column and the grid measured 1696px — taller than the same list at
   360px. Without the blurb the card is an orb and a label, which is perfectly
   legible at 135px. */
@media (max-width: 22rem) {
  .cap__blurb {
    display: none;
  }
  .caps {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* =====================================================================
   CONTINUE THIS RUN
   A report is rarely the end of the thought. This sits under every result:
   ask the next thing, and the whole conversation goes with it. Styled as a
   composer rather than a row of buttons, because that is what it is.
   ===================================================================== */
.cont__input {
  width: 100%;
  min-height: 3.2rem;
  resize: vertical;
  background: var(--black);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--text-body);
  line-height: 1.5;
  padding: 0.7rem 0.85rem;
}
.cont__input::placeholder {
  color: var(--ink-faint);
}
.cont__input:focus {
  border-color: var(--amber-deep);
  outline: none;
}
.cont__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}
.cont__mode {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--text-meta);
  padding: 0.4rem 0.55rem;
}
/* The branch/PR note is the load-bearing detail on a repo thread — it is how
   you know the follow-up updates the SAME pull request. */
.cont__note {
  color: var(--ink-dim);
  font-size: var(--text-label);
  overflow-wrap: anywhere;
}
.cont__go {
  white-space: nowrap;
}

@media (max-width: 48rem) {
  /* Thumb-sized controls, and the commit action gets its own full-width line
     below the picker rather than being squeezed beside it. */
  .cont__row {
    gap: 0.45rem;
  }
  .cont__mode {
    min-height: 44px;
    flex: 1 1 auto;
  }
  .cont__go {
    flex: 1 0 100%;
    justify-content: center;
    min-height: 44px;
    order: 3;
  }
  .cont__note {
    flex: 1 0 100%;
    order: 2;
  }
  .cont__row > .spacer {
    display: none;
  }
}

/* Codebase "finish the remaining steps" one-click action. A partial run lists
   what's left; this launches a follow-up pre-loaded with exactly those steps on
   the same branch/PR, so continuing to completion is one click, not a retype. */
.cbpr__finish-row {
  margin-bottom: 0.7rem;
}
.cbpr__finish {
  width: 100%;
  justify-content: center;
  text-align: center;
  font-weight: 700;
}
@media (max-width: 48rem) {
  .cbpr__finish {
    min-height: 44px;
  }
}

/* ---- chat -------------------------------------------------------------
   The conversational surface. Deliberately plain next to the report views:
   a chat is a place to think, not a document to present, so the thread gets
   the width and the chrome gets out of the way. */
.chat__thread {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 1.4rem 0;
  /* The composer is pinned below, so the thread — not the page — is what
     scrolls. Capped rather than fixed so a two-message chat doesn't open as a
     mostly-empty box. */
  max-height: 60vh;
  overflow-y: auto;
  overflow-x: clip;
  padding-right: 0.3rem;
}
.chat__msg {
  max-width: 82%;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  /* Long URLs and code must wrap rather than push the page sideways — mobile
     never scrolls horizontally. */
  min-width: 0;
  overflow-wrap: anywhere;
}
.chat__msg--me {
  align-self: flex-end;
  background: var(--amber-dim);
  border-color: var(--amber);
}
.chat__msg--them {
  align-self: flex-start;
  background: var(--panel);
}
.chat__text {
  font-size: var(--text-body);
  line-height: 1.55;
  white-space: pre-wrap; /* the user's own newlines survive */
}
.chat__text.md {
  white-space: normal; /* rendered markdown brings its own block layout */
}
.chat__text.md > :first-child { margin-top: 0; }
.chat__text.md > :last-child { margin-bottom: 0; }
/* The streaming caret: sits at the end of a reply while it is still painting
   in, and goes away with the class when the full text lands. */
.chat__text--live::after {
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 1em;
  margin-left: 2px;
  vertical-align: -0.12em;
  background: currentColor;
  animation: chat-caret 0.9s steps(2, jump-none) infinite;
}
@keyframes chat-caret {
  50% { opacity: 0; }
}
.chat__composer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* Breathing room on every side — top-only padding read as a hard-edged
     slab once the scrim background went on below. */
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--line);
}
/* On the chat landing the composer follows the head directly, and the head
   already draws a rule under itself: two lines 30px apart read as a slip. */
.report__head + .chat__composer {
  border-top: 0;
  padding-top: 0.4rem;
}

/* ---- chat as an app ------------------------------------------------------
   The thread was capped at a fraction of the viewport (60vh, 52vh on a phone),
   which reads as a widget embedded in a page. Installed to a home screen there
   is no browser chrome to leave room for, and a messaging surface that uses
   half the screen while the rest sits empty is the clearest possible tell that
   this is a website in a shell rather than an app.

   So the screen becomes a real column: head, a thread that takes whatever is
   left, and a composer that stays put. */
.report.chat {
  display: flex;
  flex-direction: column;
  /* dvh, not vh. Mobile browser chrome grows and shrinks as you scroll and
     `vh` is frozen at the LARGEST viewport, so a vh-sized column hides its own
     last rows behind the URL bar — exactly where the newest message is. */
  min-height: calc(100dvh - 4.5rem);
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
}
.report.chat .chat__thread {
  flex: 1 1 auto;
  max-height: none;
  /* The flex-child rule that actually makes it scroll. Without it the default
     `min-height: auto` lets the thread grow to its content and push the
     composer off-screen instead of scrolling inside itself. */
  min-height: 0;
  overflow-y: auto;
  margin: 1rem 0 0;
}
/* The composer stays reachable while the thread scrolls under it, and carries
   the scrim so text never scrolls into it illegibly. Padded and rounded like a
   floating card — an edge-to-edge black rectangle read as a bare slab, not a
   composer. */
.report.chat .chat__composer {
  position: sticky;
  /* iOS overlays the keyboard on the layout viewport instead of shrinking it,
     so `bottom: 0` is under the keys. app.js measures the overlay and the
     composer lifts by exactly that; Android (resizes-content) reports 0. */
  bottom: var(--kb-overlay, 0px);
  z-index: 2;
  margin-top: 0.6rem;
  padding: 1rem 1.25rem max(1.1rem, env(safe-area-inset-bottom));
  background: var(--scrim-strong);
  -webkit-backdrop-filter: var(--scrim-blur);
  backdrop-filter: var(--scrim-blur);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Installed. No browser chrome to subtract, so take the rest of it, and trim
   the head that a real app would not repeat on every screen. */
@media (display-mode: standalone) {
  .report.chat {
    min-height: calc(100dvh - 3rem);
    padding-top: 0.4rem;
  }
  .report.chat .report__head {
    padding-bottom: 0.7rem;
    margin-bottom: 0.5rem;
  }
  .report.chat .report__title {
    font-size: var(--text-lede);
  }
}
.chat__input {
  width: 100%;
  min-width: 0;
  resize: vertical;
  font: inherit;
  padding: 0.7rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--panel);
  color: inherit;
}
.chat__actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: flex-end;
}
.chat__note {
  color: var(--dim);
  font-size: var(--text-meta);
}
/* Web search toggle. Sits at the left of the action row, away from Send, so
   reaching for the live web is never a mis-tap on the way to sending. Off is
   the resting state and reads as off — outlined and dim, not merely a shade
   quieter than on. `margin-right: auto` is what pushes Send and the credit note
   to the far edge without a spacer element. */
.chat__web {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: auto;
  padding: 0.35rem 0.7rem;
  font: inherit;
  font-size: var(--text-meta);
  color: var(--dim);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
}
.chat__web:hover {
  color: var(--ink, inherit);
  border-color: var(--dim);
}
.chat__web-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.4;
}
.chat__web.is-on {
  color: var(--amber);
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 12%, transparent);
}
.chat__web.is-on .chat__web-dot {
  opacity: 1;
}
.chat__web:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}
@media (max-width: 48rem) {
  .chat__msg { max-width: 92%; }
  /* No 52vh cap any more — the thread is a flex child that takes whatever the
     head and composer leave, so on a phone it gets MORE room rather than a
     fixed half-screen. The old cap existed to leave space for the bottom tab
     bar; that is now handled by the column's own padding and the safe-area
     inset, which is correct on a notched device where a vh fraction was not. */
  .chat__send { min-height: 44px; }
  /* The toggle is a real tap target too, and the row must be allowed to wrap
     rather than squeezing the note to nothing on a narrow phone. */
  .chat__actions { flex-wrap: wrap; }
  .chat__web { min-height: 44px; }
}

/* ---- diary ------------------------------------------------------------
   The profile is shown verbatim: it is a description of the user, written by
   a machine, and they are entitled to read exactly what it says. Presented as
   preformatted text rather than rendered markdown so nothing in it can style
   the page it is displayed on. */
.diary__profile {
  margin-top: 0.9rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  white-space: pre-wrap;
  overflow-wrap: anywhere; /* never push the page sideways on a phone */
  min-width: 0;
  font: inherit;
  font-size: var(--text-body);
  line-height: 1.6;
}
.diary__opt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.2rem;
}
.diary__opt .field__hint {
  flex-basis: 100%;
}

/* Profile (persona): the portrait editor and the per-link extracts. Shares the
   diary's panel look — both are "what the platform knows about you" surfaces. */
/* The answers form is a column of `.field`s with nothing between them: a
   chip row ended and the next question's label began 8px below it, and an
   input's bottom edge was 6px from the label under it. Measured on the
   phone slice — the whole form read as one slab. Rhythm belongs to the
   container: one gap, every pair. */
.persona-form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.persona-form > .settings__note {
  margin-top: 0.4rem;
}
.persona-form > .settings__note + * {
  margin-top: 0;
}
.persona__sub {
  margin: 1.4rem 0 0.6rem;
  font-size: var(--text-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--dim);
}
.persona__portrait {
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  font: inherit;
  font-size: var(--text-body);
  line-height: 1.6;
  resize: vertical;
}
.persona-extract {
  margin-top: 0.7rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  min-width: 0;
}
.persona-extract__src {
  font-size: var(--text-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 0.3rem;
}
.persona-extract p {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 48rem) {
  /* Touch-sized checkbox target. */
  .diary__opt input[type="checkbox"] {
    width: 20px;
    height: 20px;
  }
}

/* ---- chat: motion + live activity ------------------------------------
   A tool-using turn runs 20-40s, so the interface has to keep saying what is
   happening. Everything here is either feedback about real work or the small
   settling motion that makes a message feel placed rather than teleported. */

/* Messages arrive rather than appear. Short and eased-out so a fast exchange
   never feels like it is waiting on decoration. */
@keyframes chat-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.chat__msg {
  animation: chat-in 180ms ease-out both;
}

/* The live activity pane: one line per tool call, the current one pulsing. */
.chat__activity {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.2rem 0 0.9rem;
  padding: 0.7rem 0.9rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  animation: chat-in 180ms ease-out both;
}
.chat__act {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--dim);
  font-size: var(--text-meta);
  min-width: 0;
  animation: chat-in 160ms ease-out both;
}
.chat__act-text {
  overflow-wrap: anywhere;
  min-width: 0;
}
.chat__act-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--amber);
  animation: chat-pulse 1.1s ease-in-out infinite;
}
@keyframes chat-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.8); }
  50%      { opacity: 1;
  transform: scale(1.15); }
}
/* A finished step stops pulsing and dims — the pane reads as a sequence of
   completed work with one thing currently in flight. */
.chat__act.is-done .chat__act-dot {
  animation: none;
  opacity: 0.45;
  background: var(--dim);
}
.chat__act.is-done .chat__act-text {
  opacity: 0.6;
}

/* The swarm proposal card. */
.prop {
  animation: chat-in 200ms ease-out both;
  margin-top: 0.4rem;
}
.prop__input {
  margin-top: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  background: var(--panel);
  overflow-wrap: anywhere;
  min-width: 0;
  font-size: var(--text-body);
}
.prop__why { color: var(--dim); }
.prop__cont {
  margin-top: 0.5rem;
  color: var(--dim);
  font-size: var(--text-meta);
}
.prop__row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.9rem;
}
.prop__note { color: var(--dim); font-size: var(--text-meta); }
.prop.is-started { border-color: var(--amber); }

@media (max-width: 48rem) {
  .prop__go { min-height: 44px; }
}

/* Motion is feedback here, not flourish — but a user who has asked for less of
   it gets the states without the movement. */
@media (prefers-reduced-motion: reduce) {
  :root:not(.motion-on) .chat__msg,
  :root:not(.motion-on) .chat__activity,
  :root:not(.motion-on) .chat__act,
  :root:not(.motion-on) .prop {
    animation: none;
  }
  :root:not(.motion-on) .chat__act-dot {
    animation: none;
    opacity: 1;
  }
}

/* ---- grouped capabilities --------------------------------------------
   The homepage used to be one grid of twenty-plus tiles, which reads as a wall
   to get through rather than a menu to choose from. Grouping keeps every tile
   one click away but turns the first decision into "which shelf". */
.caps.capgroups {
  /* Overrides the single grid above; the grid moves down to each group. */
  display: flex;
  flex-direction: column;
  gap: 2.1rem;
}
.capgroup__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.7rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--line);
}
.capgroup__title {
  margin: 0;
  font-size: var(--text-meta);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--ink);
}
.capgroup__blurb {
  margin: 0;
  color: var(--dim);
  font-size: var(--text-body);
  min-width: 0;
}
.capgroup__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 0.9rem;
}
@media (max-width: 48rem) {
  .caps.capgroups { gap: 1.7rem; }
  /* On a phone the blurb costs a line per group for little gain — the header
     and the tiles under it already say what the shelf is. */
  .capgroup__blurb { display: none; }
}

/* Display tracking. The titles are flat --ink: a dither over them was tried
   and removed — at wordmark size a 4px screen mostly reads as a slightly
   dirty edge, and clean white is simply better here. The dither machinery
   went with it rather than being left behind commented out. */
.hero__wordmark,
.report__title,
.capgroup__title,
.cap__label {
  letter-spacing: var(--display-track);
}

/* ===========================================================================
   Ground — C2 index contours, blurred and drifting

   The only pattern in the atmosphere. It is drawn to a canvas in app.js
   because the field has to be recomputed on resize and animated, and a
   hand-authored SVG path at this density would be tens of kilobytes that are
   correct at exactly one viewport size.

   The blur is what makes it liveable. Sharp contour lines behind an interface
   compete with the text for the eye; blurred, they become depth. It also buys
   the animation for free: because the result is soft, the canvas backing
   store is rendered at roughly a third of viewport resolution and scaled up,
   so each animated frame costs about a ninth of the pixels. Do not "fix" the
   low resolution — it is load-bearing, and the blur hides it completely.

   Blur on a fixed, composited layer is GPU work and does not touch layout. */
.atmosphere__contour {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.62;
  filter: blur(2.5px);
}

/* ---- Code workspace + Mission Control as app screens ----------------------
   Each fills the window beside the rail; the footer would only sit under
   them. main.* outranks the page rules in code.css / mission-control.css,
   which load after this sheet. */
body.is-embed .footer {
  display: none;
}
main.cw--embed,
main.mc--embed {
  width: 100%;
  height: 100vh;
  height: 100dvh;
}
/* Narrow: the ops room stacks and scrolls with the page, as it always has. */
@media (max-width: 1100px) {
  main.mc--embed {
    height: auto;
    min-height: 0;
  }
}
/* Phone: the workspace fits exactly between the walnut masthead and the tab
   bar (and the docked player when one is up), so its composer is never under
   either and the page itself never scrolls. */
@media (max-width: 48rem) {
  body:has(> #app main.cw--embed) {
    padding-bottom: 0;
  }
  main.cw--embed {
    height: calc(100dvh - 140px - env(safe-area-inset-bottom, 0px));
  }
  body:has(.s2-mini:not(.hidden)) main.cw--embed {
    height: calc(100dvh - 202px - env(safe-area-inset-bottom, 0px));
  }
  /* Keyboard up: the tab bar and docked player hide (kb-open), so their share
     goes back to the workspace. Subtracting it anyway left a strip of bare
     page background — the "big green bar" — sitting on the keyboard. */
  html.kb-open main.cw--embed,
  html.kb-open body:has(.s2-mini:not(.hidden)) main.cw--embed {
    height: calc(100dvh - 70px);
  }
}

/* Reduced motion, globally: the scoped blocks above handle the components
   their authors remembered; this backstop covers everything else. Every
   reduced-motion rule is gated on :root:not(.motion-on) — the footer's
   "Motion: always on" toggle sets that class (via localStorage
   "swarmio_motion") so a user whose OS reports reduce can still opt this
   site back into motion, per browser. */
@media (prefers-reduced-motion: reduce) {
  :root:not(.motion-on) *,
  :root:not(.motion-on) *::before,
  :root:not(.motion-on) *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================================
   HIT-TARGET FLOORS — Fitts's Law
   =========================================================================
   Measured in headless Chrome against this bundle, then fixed here rather
   than component by component, because every one of these had the same cause:
   the control was sized by its TYPE (0.7rem uppercase) and nothing ever
   asserted a minimum BOX. What was measured, desktop at 1440 unless noted:

     .masthead__link    49x21 .. 107x21   (x10 in the bar)
     .status-dot        79x19
     .credits           128x30
     .footer__motion    151x18
     .back-link         153x20
     .adv__toggle       185x19
     .field input       316x40           (mobile 390 — every launch form field)
     .field--check box  13x16 desktop, 4x16 mobile

   All of them are already WIDE enough; only the height was short, so these are
   height-only floors. That matters: growing the width of an item in a flex row
   would push into its neighbour's hit area and trade one Fitts's problem for
   another. Growing the height costs a couple of pixels of chrome and nothing
   else.

   --target-min resolves to 32px for a mouse and 44px for any coarse pointer,
   so one token moves every control between the two floors. */

/* Deliberately min-height ONLY. Setting `display` here would land after the
   max-width:40rem block above and un-hide .masthead__link on phones, where the
   tab bar already owns those destinations. A <button> centres its own content,
   and the three inline-flex controls already centre theirs, so the floor needs
   nothing else. */
.masthead__link,
.masthead__brand,
.status-dot,
.back-link,
.adv__toggle,
.footer__motion {
  min-height: var(--target-min);
}

/* The credits pill is a bordered box, so its floor is visible rather than
   invisible padding — it simply becomes a slightly taller pill. */
.credits {
  min-height: var(--target-min);
}

/* Text, number, date and select inputs. 0.6rem of padding against a 0.9rem
   face lands at 40px, which clears a mouse and misses a thumb by 4px.

   By TYPE rather than by component, for the same reason the mobile block above
   sizes `button` rather than a list of classes: the first pass here scoped this
   to `.field` and immediately missed .apikeys__name (316x43) and the connector
   header inputs, which are the same control wearing a different class. A field
   added tomorrow inherits the floor instead of shipping 4px short.

   Checkbox and radio are excluded on purpose — they are square controls sized
   just below, and a min-height would stretch the box away from its glyph. */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="number"],
input[type="search"],
input[type="tel"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
select,
textarea {
  min-height: var(--target-min);
}

/* The checkbox was the worst target in the app, and on a phone it was also
   unreadable: `width: 1rem` is a size, not a minimum, so as a flex item with
   the mobile `min-width: 0` in play it shrank to FOUR PIXELS wide next to a
   long label — a control you cannot see the checked state of. `flex: 0 0 auto`
   is the actual fix (it refuses to shrink); 24px is the WCAG 2.2 floor.

   The wrapping <label> is 316x48 and takes the click either way, so this is
   about being able to READ the control's state, not about hitting it. */
/* Every native checkbox and radio, not just the ones `field()` builds — the
   Profile page's API toggle is a bare `h("input", { type: "checkbox" })` and
   measured 13x13 on desktop and 20x20 on a phone.

   `.deep-toggle__box` is excluded because it is not a native checkbox any more:
   `appearance: none` turns it into a 38x22 sliding switch, and this rule is
   more specific than its own, so without the exclusion it would square the
   switch off. Its <label> is 226x47 and takes the press, so the switch is
   already inside a target well over the floor. */
input[type="checkbox"]:not(.deep-toggle__box),
input[type="radio"] {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

/* Adjacent-target separation. Chips sat 7.2px apart and the connector rows
   6.4px — both under the 8px that keeps a mis-tap off the neighbour. */
.chips-field {
  gap: var(--target-gap);
}

/* Empty states — peak-end.

   The first screen of Runs, Chats and Schedules on a new account. Centred,
   with the sentence and its way out reading as one block: the CTA is the
   proximity partner of the text, not a stray button below it. */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-8) var(--space-4);
  text-align: center;
}
.empty__text {
  max-width: 46ch;
  margin: 0;
  color: var(--dim);
}

/* Account menu — anchored to its own trigger, so the travel from the button to
   the row you want stays inside ~200px instead of crossing the viewport. Built
   on the same geometry as the inbox dropdown next to it; two popovers in one
   bar that open differently would read as two different mechanisms. */
.acct {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.acct__btn {
  gap: var(--space-1);
}
.acct__chev {
  font-size: var(--text-micro);
  opacity: 0.7;
}
.acct__drop {
  position: absolute;
  top: calc(100% + 0.6rem);
  right: 0;
  min-width: 12rem;
  display: flex;
  flex-direction: column;
  padding: var(--space-1);
  background: var(--paper);
  border: 1px solid color-mix(in oklab, var(--ink) 12%, transparent);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px color-mix(in oklab, var(--shadow) 88%, transparent);
  z-index: 60;
}
/* Rows, not links-in-a-box: full-width targets at the touch floor, so the whole
   row is the target rather than the word inside it. */
.acct__drop .acct__item {
  display: flex;
  align-items: center;
  min-height: var(--target-touch);
  padding: 0 var(--space-3);
  border-radius: var(--radius);
  border-bottom: 0;
  text-align: left;
  white-space: nowrap;
}
.acct__drop .acct__item:hover {
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  color: var(--ink);
}
/* Sign out is the one destructive-ish row, so it sits last and reads warm —
   and gets its own separation from the row above rather than being one more
   identical line to slip onto. */
.acct__drop .acct__item:last-child {
  margin-top: var(--space-1);
  padding-top: var(--space-1);
  border-top: 1px solid var(--line-soft);
  color: var(--warn);
}
/* The Admin badge keeps its border inside the menu but stops being a pill in a
   row of plain rows. */
.acct__drop .masthead__admin {
  border: 0;
  color: var(--amber-bright);
}
@media (max-width: 40rem) {
  /* The More sheet owns these destinations on a phone. */
  .acct {
    display: none;
  }
}

/* Reduce-motion navigation feedback.

   The sweeping band is motion, so it is withheld under prefers-reduced-motion —
   but the ACKNOWLEDGEMENT is not motion, and withholding that left those users
   pressing a nav item and getting nothing back. Same bar, same place, same
   timing; a still band instead of a travelling one. */
.navpulse.is-static::before {
  animation: none;
  width: 100%;
  background: var(--amber-bright);
  opacity: 0.85;
  box-shadow: none;
}

/* Connector header rows. 0.4rem is 6.4px, and these are three adjacent targets
   in a row — two inputs and a Remove — so the gap that separates them was under
   the 8px that keeps a slip off the neighbour. The neighbour here deletes the
   row. */
.mcp-headers,
.mcp-header-row {
  gap: var(--target-gap);
}

/* Icon-only small buttons. `btn--sm` is used for row actions like the connector
   header's Remove — a 34x44 target on a phone, short on the axis that matters
   because the label is a single glyph. Width floor only: the height already
   comes from the mobile button rule. */
.btn--sm {
  min-width: var(--target-min);
  justify-content: center;
}

/* =========================================================================
   SECOND SWEEP — the screens the first pass never drove
   =========================================================================
   The first audit measured the hub, the launch forms and the account screens.
   It never opened a finished REPORT, which is the screen people actually spend
   their time on, or a Runs list with rows in it. Both were worse than anything
   already fixed. Measured, desktop 1440 / mobile 390:

     .run-hist__act        19x18 and 21x18   (save, delete, stop — per row)
     .run-hist__actions    4px between save and delete
     details > summary     1125x18           ("Raw report (JSON)")
     .source__u            284x21            (the sources list)
*/

/* Row actions. Icon-only controls at 19x18 are the smallest targets in the app,
   and one of them deletes a run. The glyph stays its own size; the box around
   it grows to the floor. */
.run-hist__act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--target-min);
  min-height: var(--target-min);
  padding: 0;
}
/* 0.25rem is 4px between Save and Delete. Delete is confirmation-gated, so this
   is not a data-loss risk — but a 4px gap between two 19px targets means the
   confirm dialog is doing work the layout should have done. */
.run-hist__actions {
  gap: var(--target-gap);
}
/* Destructive gets its own separation on top of the shared gap: reaching for
   Delete should be a decision, not a slip off Save. */
.run-hist__act--del {
  margin-inline-start: var(--space-2);
}
/* An ARIA control needs a visible focus ring as much as a native one — these
   only just became reachable by keyboard, and an invisible tab stop is barely
   better than no tab stop. */
.run-hist__act:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  opacity: 1;
}

/* Disclosure triangles. `<summary>` is natively focusable and natively
   clickable, so it was never a keyboard problem — it was an 18px-tall one. */
summary {
  display: flex;
  align-items: center;
  min-height: var(--target-min);
}

/* The sources list under a report. These are not links inside a sentence — the
   WCAG inline exception does not cover them — they are a list of targets, one
   per line, at 21px. */
.source__u {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}

/* The artifact shelf's "All N · zip". A standalone link in a flex header, not a
   link inside a sentence — WCAG 2.5.8's inline exception does not cover it, and
   it was 212x21. The four remaining short links in the app ARE inline in a
   paragraph of prose and are correctly left alone. */
.shelf-all {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}
/* `baseline` alignment stops working once the link is a taller flex box — the
   heading would sit oddly high against it. */
.shelf-head {
  align-items: center;
}

/* The codebase report's metadata rows. "repo · <link>" reads like a sentence,
   but the link is the VALUE of a key/value row rather than a word inside prose,
   so the inline exception is a stretch — 172x18 measured. The four links left
   under the floor after this are genuinely inside paragraphs of report text,
   which is exactly what WCAG 2.5.8's inline exception is for. */
.cbmeta a {
  display: inline-flex;
  align-items: center;
  min-height: var(--target-min);
}

/* The general button floor, and why it is general.

   Everything above named its offenders — .masthead__link, .back-link, and so
   on. Driving the DEPLOYED sign-in page then turned up two more, .login__forgot
   at 117x22 and .login__toggle at 188x23, and the reason they were missed is
   the useful part: the local audit probed the sign-in screen at 390px only, and
   the mobile block already gives every `button` 44px there. On a wide screen
   nothing did. A bare <button> with no .btn class got whatever its font
   measured, and naming offenders one at a time was never going to find the next
   one.

   So: the same floor the mobile block has always applied, applied on desktop
   too. `.btn` already clears it at 49px, so this changes only the unstyled
   text-buttons that were short. `unset` on min-width keeps it height-only —
   widening a button in a flex row pushes into its neighbour's hit area. */
button {
  min-height: var(--target-min);
}
/* The two exceptions, both already correct and both sized by a rule that must
   win: the tab bar sets its own height, and the row icons above set both axes. */
.tabbar__btn,
.run-hist__act {
  min-height: var(--target-min);
}

/* Season 2 chrome (walnut rail, phone masthead + tab bar, Appearance
   control) lives in /chrome.css, shared with every page. App-only bits: */
body {
  letter-spacing: 0;
}
.eyebrow {
  letter-spacing: 0.14em;
  font-weight: 600;
}
.acct__drop {
  min-width: 19rem;
}
.msheet .appear {
  border-bottom: 0;
  border-top: 1px solid var(--line-soft);
  margin: var(--space-2) 0 0;
  padding: var(--space-4) var(--space-2) var(--space-2);
}

/* =====================================================================
   SEASON 2 — THE RUN PANEL
   A console: a seafoam frame holding the screen (instruments, annunciators,
   agents, trace), with the walnut control strip underneath.
   ===================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* A secondary button: a raised plate, quieter than ochre. */
.btn--plate {
  --bg: var(--card-2);
  --fg: var(--ink);
  border: 1px solid var(--line);
}
.btn--plate:hover {
  --bg: var(--card);
  filter: none;
}

.run.rp {
  max-width: 1320px;
  display: grid;
  gap: var(--space-4);
}
.rp__status {
  display: grid;
  gap: var(--space-2);
}
.rp__statusrow {
  display: flex;
  align-items: center;
  gap: var(--space-3) var(--space-4);
  flex-wrap: wrap;
  min-width: 0;
}
.rp__id {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.rp__title {
  margin: 0;
  flex: 1 1 22rem;
  min-width: 0;
  font-size: clamp(1.15rem, 1.6vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.25;
  text-wrap: balance;
}
.rp__state {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.rp__led {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fill);
}
.rp__state[data-s="running"] .rp__led {
  animation: rpBreathe 2.8s var(--ease) infinite;
}
.rp__state[data-s="stopping"] .rp__led,
.rp__state[data-s="stopped"] .rp__led {
  background: var(--terra);
}
.rp__state[data-s="failed"] .rp__led {
  background: var(--err);
}
.rp__state[data-s="done"] .rp__led {
  background: var(--done);
}
@keyframes rpBreathe {
  50% { opacity: 0.35; }
}
.rp__acts {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}
.rp__hold {
  position: relative;
  overflow: hidden;
  color: var(--terra);
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}
.rp__hold::before {
  content: "";
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, var(--terra) 24%, transparent);
  transform-origin: left;
  transform: scaleX(var(--hold, 0));
}
.rp__hold span {
  position: relative;
}

/* console frame + screen */
.rp-console {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--bezel-edge), 0 24px 44px -36px var(--shadow);
}
.rp-bezel {
  padding: 11px 11px 0;
  background: var(--bezel);
  transition: background-color 0.7s var(--ease);
}
.rp-screen {
  display: grid;
  border-radius: var(--radius);
  background: var(--scr);
  color: var(--scr-ink);
  box-shadow: inset 0 0 0 1px var(--scr-line);
  transition: background-color 0.7s var(--ease), color 0.7s var(--ease);
}

/* instruments */
.rp-insts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--scr-line);
}
.rp-inst {
  display: grid;
  gap: 7px;
  align-content: start;
  padding: var(--space-4) var(--space-6);
  border-left: 1px solid var(--scr-line);
  min-width: 0;
}
.rp-inst:first-child {
  border-left: 0;
}
.rp-inst__k {
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--scr-ink-3);
}
.rp-inst__row {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  min-width: 0;
}
.rp-inst__v {
  font-weight: var(--read-w);
  font-size: clamp(1.9rem, 2.6vw, 2.6rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--scr-hi);
  font-variant-numeric: tabular-nums;
}
.rp-inst__u {
  font-size: var(--text-meta);
  color: var(--scr-ink-2);
  white-space: nowrap;
}
.rp-inst__sub {
  font-size: var(--text-meta);
  color: var(--scr-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-gauge {
  position: relative;
  height: 6px;
  border-radius: var(--radius);
  background: var(--track);
}
.rp-gauge__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--fill);
  transition: width 1.2s var(--ease), background-color 0.4s var(--ease);
}
.rp-gauge__fill.is-over {
  background: var(--warn);
}
.rp-gauge__tick {
  position: absolute;
  top: -3px;
  width: 1.5px;
  height: 12px;
  background: var(--scr-ink-2);
  transition: left 1.2s var(--ease);
}

/* annunciators */
.rp-annrow {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--scr-line);
}
.rp-ann {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}
.rp-tile {
  min-height: 40px;
  padding: 0 4px;
  border-radius: var(--radius);
  background: var(--ann-off);
  color: var(--ann-off-ink);
  box-shadow: inset 0 1px 2px color-mix(in oklab, #000 8%, transparent);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: default;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}
.rp-tile[data-lit="caution"] { background: var(--caution-bg); color: var(--caution-ink); cursor: pointer; }
.rp-tile[data-lit="alarm"] { background: var(--alarm-bg); color: var(--alarm-ink); cursor: pointer; }
.rp-tile[data-lit="notice"] { background: var(--notice-bg); color: var(--notice-ink); cursor: pointer; }
.rp-tile.is-flash {
  animation: rpFlash 1.1s steps(1) infinite;
}
@keyframes rpFlash {
  50% { background: var(--ann-off); color: var(--ann-off-ink); }
}
.rp-annmsg {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-3);
  min-height: 34px;
  font-size: var(--text-body);
  color: var(--scr-ink-2);
}
.rp-annmsg b {
  font-weight: 600;
  color: var(--scr-hi);
}
.rp-annmsg__acts {
  display: flex;
  gap: var(--space-2);
  margin-left: auto;
}
.rp-annmsg__more {
  color: var(--scr-ink-3);
  font-size: var(--text-meta);
}

/* agents + side pane */
.rp-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  min-height: 360px;
}
.rp-agents {
  padding: var(--space-3) var(--space-6) var(--space-4);
  border-right: 1px solid var(--scr-line);
  min-width: 0;
}
.rp-ag {
  display: grid;
  grid-template-columns: 150px 88px minmax(0, 1fr) 70px;
  gap: var(--space-4);
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--scr-line);
  font-size: var(--text-body);
  border-radius: var(--radius);
}
.rp-ag:last-child {
  border-bottom: 0;
}
.rp-ag--head {
  padding: 4px 0 9px;
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--scr-ink-3);
}
.rp-ag--head span:last-child,
.rp-ag__tok {
  text-align: right;
}
.rp-ag__role {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-weight: 500;
  color: var(--scr-hi);
}
.rp-ag__role span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-ag__st {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-meta);
  color: var(--scr-ink-3);
}
.rp-ag__st::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--scr-ink-3);
  flex: none;
}
.rp-ag[data-st="work"] .rp-ag__st { color: var(--scr-ink); }
.rp-ag[data-st="work"] .rp-ag__st::before { background: var(--fill); animation: rpBreathe 2.4s var(--ease) infinite; }
.rp-ag[data-st="done"] .rp-ag__st::before { background: var(--done); }
.rp-ag[data-st="fail"] .rp-ag__st { color: var(--err); }
.rp-ag[data-st="fail"] .rp-ag__st::before { background: var(--err); }
.rp-ag__do {
  color: var(--scr-ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rp-ag__tok {
  font-size: var(--text-meta);
  color: var(--scr-ink-2);
  font-variant-numeric: tabular-nums;
}
.rp-side {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}
.rp-panetabs {
  display: flex;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-6) 0;
}
.rp-panetab {
  padding: 6px 12px;
  border-radius: var(--radius);
  font-size: var(--text-meta);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--scr-ink-3);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
}
.rp-panetab[aria-selected="true"] {
  background: var(--scr-2);
  color: var(--scr-ink);
}
.rp-trace {
  max-height: 420px;
  overflow-y: auto;
  padding: var(--space-2) var(--space-6) var(--space-4);
  font-family: var(--f-code);
  font-size: var(--text-meta);
  line-height: 1.5;
  color: var(--scr-ink-2);
  scrollbar-width: thin;
}
.rp-tr {
  display: grid;
  grid-template-columns: 62px 96px minmax(0, 1fr);
  gap: var(--space-3);
  margin: 0;
  padding: 4px 0;
}
.rp-tr__t {
  color: var(--scr-ink-3);
}
.rp-tr__tag {
  color: var(--scr-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rp-tr__m {
  overflow-wrap: anywhere;
}
.rp-tr.lv-warn .rp-tr__m { color: var(--warn); }
.rp-tr.lv-error .rp-tr__m { color: var(--err); }
.rp-tr.is-you .rp-tr__tag,
.rp-tr.is-you .rp-tr__m {
  color: var(--scr-hi);
  font-weight: 600;
}
.rp-browser {
  padding: var(--space-2) var(--space-4) var(--space-4);
  min-width: 0;
}

/* control strip: walnut frame, one plate */
.rp-strip {
  padding: 13px;
  background: var(--walnut) var(--wood-h) center / 2400px 220px;
  box-shadow: inset 0 1px 0 rgba(255, 238, 210, 0.25);
}
.rp-strip__plate {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: 7px;
  border-radius: var(--radius);
  background: var(--plate);
  color: var(--plate-ink);
  box-shadow: inset 0 1px 3px color-mix(in oklab, #000 28%, transparent), 0 1px 0 rgba(255, 238, 210, 0.2);
  transition: background-color 0.7s var(--ease);
}
.rp-which {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--plate-line);
  flex: none;
}
.rp-which button {
  padding: 8px 13px;
  border-radius: var(--radius);
  font-size: var(--text-meta);
  font-weight: 500;
  color: var(--plate-ink-2);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.rp-which button[aria-checked="true"] {
  background: var(--plate-ink);
  color: var(--plate);
}
.rp-strip__in {
  flex: 1 1 260px;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--text-body);
  color: var(--plate-ink);
  outline: none;
  padding: 8px 4px;
}
.rp-strip__in::placeholder {
  color: var(--plate-ink-2);
}
.rp-modes {
  display: inline-flex;
  gap: 2px;
  flex-wrap: wrap;
}
.rp-modes button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: var(--text-meta);
  color: var(--plate-ink-2);
  box-shadow: inset 0 0 0 1px transparent;
  transition: box-shadow 0.25s var(--ease), color 0.25s var(--ease);
}
.rp-modes button[aria-checked="true"] {
  color: var(--plate-ink);
  box-shadow: inset 0 0 0 1px var(--plate-line);
}
.rp-strip__est {
  font-size: var(--text-meta);
  color: var(--plate-ink-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.rp-strip__go {
  flex: none;
}

@media (max-width: 1100px) {
  .rp-insts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rp-inst:nth-child(3) { border-left: 0; }
  .rp-inst:nth-child(n + 3) { border-top: 1px solid var(--scr-line); }
  .rp-body { grid-template-columns: minmax(0, 1fr); }
  .rp-agents { border-right: 0; border-bottom: 1px solid var(--scr-line); }
}
@media (max-width: 48rem) {
  .rp-inst { padding: var(--space-3) var(--space-4); }
  .rp-annrow { padding: var(--space-3) var(--space-4); }
  .rp-ann { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .rp-annmsg__acts { margin-left: 0; width: 100%; }
  .rp-annmsg__acts .btn { flex: 1; }
  .rp-agents { padding: var(--space-3) var(--space-4); }
  .rp-ag { grid-template-columns: minmax(0, 1fr) auto 56px; gap: 4px var(--space-3); }
  .rp-ag--head span:nth-child(3) { display: none; }
  .rp-ag__do { grid-column: 1 / -1; grid-row: 2; font-size: var(--text-meta); }
  .rp-panetabs, .rp-trace { padding-inline: var(--space-4); }
  .rp-tr { grid-template-columns: 54px minmax(0, 1fr); }
  .rp-tr__tag { display: none; }
  .rp-bezel { padding: 8px 8px 0; }
  .rp-strip { padding: 9px; }
  .rp-which { width: 100%; }
  .rp-which button { flex: 1; }
  .rp__acts { margin-left: 0; width: 100%; }
  .rp__acts .btn { flex: 1; }
}

/* Season 2 buttons: sentence case, weight not shouting. */
.btn {
  font-family: var(--f-ui);
  font-weight: 600;
  font-size: var(--text-body);
  letter-spacing: 0;
  text-transform: none;
  padding: 0.7rem 1.25rem;
}
.btn--sm {
  font-size: var(--text-meta);
  padding: 0.45rem 0.8rem;
}
@media (max-width: 48rem) {
  .rp-tr { grid-template-columns: 64px minmax(0, 1fr); }
}

/* The swarm-anything box sits in the content column like everything else. */
.swarm-any {
  width: calc(100% - 2 * var(--gutter));
  max-width: calc(var(--maxw) - 2 * var(--gutter));
  box-shadow: none;
}

/* Readouts: large numbers are instruments — light weight, ink, even digits. */
.wallet__num {
  font-family: var(--f-ui);
  font-weight: var(--read-w);
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.wallet__coin {
  color: var(--ink-3);
}
.wallet__stat-v {
  font-family: var(--f-ui);
  font-variant-numeric: tabular-nums;
}

/* Chat: send-or-swarm switch, the message queue, sharing. */
.chat__which {
  display: inline-flex;
  padding: 2px;
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px var(--line);
  flex: none;
}
.chat__which button {
  min-height: 32px;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  font-size: var(--text-meta);
  font-weight: 500;
  color: var(--ink-2);
  transition: background-color 0.3s var(--ease), color 0.3s var(--ease);
}
.chat__which button[aria-checked="true"] {
  background: var(--ink);
  color: var(--room);
}
.chat__queue {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0;
}
.chat__msg--queued {
  opacity: 0.72;
  border-style: dashed;
}
.chat__queued-meta {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-1);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.chat__unqueue {
  font-size: var(--text-label);
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.chat__headrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.chat__share-btn.is-on {
  color: var(--ok);
}
.chat__share {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 0 0 1px var(--line);
}
.chat__share-note {
  margin: 0;
  font-size: var(--text-meta);
  color: var(--ink-2);
}
.chat__share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.chat__share-url {
  flex: 1 1 16rem;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius);
  background: var(--card-2);
  font-family: var(--f-code);
  font-size: var(--text-meta);
  overflow-wrap: anywhere;
}
.chat__unshare {
  color: var(--terra);
}
@media (max-width: 48rem) {
  .chat__actions {
    flex-wrap: wrap;
  }
}

/* =========================================================================
   Design Studio (#/design)

   Composer + inspiration surface, the project grid, the live pipeline
   timeline, and the gate panel (mockup iframe beside the native picker,
   fork bar at the bottom).
   ========================================================================= */

.dsgn__hint {
  font-size: var(--text-label);
  opacity: 0.7;
}

/* Studio-local tokens (critique pass, 2026-11-03): --brass/--danger had NO
   token-layer definition — their var() "fallbacks" were the live values,
   vestigial from the warm-gray theme. Re-derived from the spruce palette
   so the stale hexes could be dropped. */
:root {
  --brass: var(--accent-ink);
  --danger: var(--err);
}

/* Type pairing: the studio ran one face end to end. The metadata rails —
   panel-head hints and shortcuts, cost pills, territory labels, card meta,
   the page-head run price — speak Geist Mono, already loaded for code. */
.panel__head .dsgn__hint,
.dsgn__cost,
.dsgn__cardmeta,
.dsgn__pagehead-side {
  font-family: var(--code);
}

/* Wide-canvas page head: title stack left, run price right-aligned, so the
   first band of the 1560px screen stops reading empty. */
.dsgn__pagehead {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
}
.dsgn__pagehead-main {
  min-width: 0;
}
.dsgn__pagehead-side {
  flex: none;
  padding-bottom: 0.5rem;
  white-space: nowrap;
}
.dsgn__cost {
  display: inline-block;
  width: fit-content;
  margin-top: 0.5rem;
  padding: 0.28rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 9%, transparent);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.dsgn__card .dsgn__cost {
  margin-top: 0.55rem;
}
.dsgn__share {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.7rem;
}
.dsgn__sharebtn {
  font-size: var(--text-meta);
  padding: 0.4rem 0.9rem;
}
.dsgn__sharebtn.is-on {
  border-color: var(--ok);
  color: var(--ok);
}
.dsgn__input {
  width: 100%;
  resize: vertical;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--card);
  color: inherit;
  font: inherit;
}
.dsgn__input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.dsgn__bucket {
  margin-top: 0.4rem;
  resize: none;
  font-size: var(--text-meta);
  color: var(--dim);
}
.dsgn__go {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.7rem;
  animation: fadein 160ms ease-out;
}
.dsgn__drop {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.4rem;
  padding: 0.55rem 0.7rem;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  color: var(--dim);
  font-size: var(--text-meta);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dsgn__drop:hover,
.dsgn__drop:focus-visible,
.dsgn__drop.is-over {
  border-color: var(--brass);
  background: color-mix(in oklab, var(--brass) 7%, transparent);
  outline: none;
}
.dsgn__dropico {
  font-size: var(--text-body);
  line-height: 1;
}
.dsgn__upchips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.dsgn__upchip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.16rem 0.5rem;
  border: 1px solid var(--brass);
  border-radius: 999px;
  background: color-mix(in oklab, var(--brass) 9%, transparent);
  font-size: var(--text-label);
  white-space: nowrap;
}
.dsgn__upchipx {
  border: 0;
  background: transparent;
  color: inherit;
  opacity: 0.65;
  font: inherit;
  font-size: var(--text-label);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  /* Tick 89 review: chip controls never shrink under a long label. */
  flex: none;
}
/* Tick 89 review: the promote control is constructive — it must not inherit
   the remove button's danger-red hover. Accent it with the focus ink. */
.dsgn__upchipx.is-up:hover,
.dsgn__upchipx.is-up:focus-visible {
  opacity: 1;
  color: var(--focus);
}
.dsgn__upchipx:hover,
.dsgn__upchipx:focus-visible {
  opacity: 1;
  color: var(--bad);
}
.dsgn__start {
  font-weight: 600;
}
/* Pick chips: stacked template/chip selections riding under the brief.
   Brass like the upload chips — picked material, not typed text. */
/* Tick 88: the recipe readout — the verbatim composed goal the engine will
   read, live under the picks row. Visual mirror (aria-hidden in the DOM):
   mono body so the joined brief reads as a document, hairline frame like
   the fork cluster, meter in the head. */
.dsgn__recipe {
  margin-top: 0.45rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  background: var(--card);
}
.dsgn__recipehead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}
/* Tick 88 review: the head reuses .dsgn__hint (0.7 opacity ≈ 4.48:1, just
   under AA) — the recipe head is a label the user must read, so it carries
   full-opacity ink here. */
.dsgn__recipehead .dsgn__hint {
  opacity: 1;
}
.dsgn__recipebody {
  margin: 0;
  /* Tick 88 review: --mono aliases the UI sans (--f-ui) — --code is the
     real mono stack (Geist Mono). --ink-2 on --card measures ~5:1; --ink-3
     was 2.9-3.7:1 across themes — below AA for a paragraph. */
  font-family: var(--code);
  font-size: var(--text-label);
  line-height: 1.5;
  color: var(--ink-2);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 9rem;
  overflow-y: auto;
}
.dsgn__picks {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.dsgn__pick {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  max-width: 100%;
  padding: 0.16rem 0.5rem;
  border: 1px solid var(--brass);
  border-radius: 999px;
  background: color-mix(in oklab, var(--brass) 9%, transparent);
  font-size: var(--text-label);
  white-space: nowrap;
  overflow: hidden;
}
/* Tick 89 review: the label is a real element (app.js wraps it) so an
   over-long one ellipsizes inside the wrapper instead of hard-clipping the
   chip controls; min-width:0 lets the flex item shrink below content width.
   (text-overflow moved off the flex container — it was inert there.) */
.dsgn__picklabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Tick 90: the cap is visible in the room. A picked source the cap will
   drop rides PROVISIONAL — picked accent dims (compose with any family's
   is-on) — and the chip's dashed pill + dim says "not riding" at a glance.
   The hint's polite region names the picks for AT; promoting a dimmed pick
   back into the kept region is the escape hatch and stays fully enabled. */
[data-pick].is-dropped {
  opacity: 0.6;
}
/* Tick 90 review: .dsgn__rcard.is-on / .is-near / .is-dealt set opacity:1
   ~500 lines below at EQUAL specificity (0-2-0) — the provisional dim must
   outrank them or the rail, the primary pick source, never dims. */
.dsgn__rcard.is-on.is-dropped,
.dsgn__rcard.is-near.is-dropped,
.dsgn__rcard.is-dealt.is-dropped {
  opacity: 0.6;
}
.dsgn__pick.is-dropped {
  border-style: dashed;
  opacity: 0.7;
}
/* Tick 90 review: 0.7 chip x 0.65 arrow ~ 0.46 composites the live promote
   escape hatch into the panel's disabled look (.dsgn__fchip:disabled 0.4).
   Rest the arrow near the enabled 0.65 (composite 0.63); hover/focus still
   lifts it to full — the hatch stays glanceable on a provisional chip. */
.dsgn__pick.is-dropped .dsgn__upchipx {
  opacity: 0.9;
}
.dsgn__pick.is-dropped .dsgn__upchipx:hover,
.dsgn__pick.is-dropped .dsgn__upchipx:focus-visible {
  opacity: 1;
}
/* Product thinker: concrete things to include, not another visual-style
   picker. Quiet ledger rows keep the suggestion text primary and the Add
   action secondary; selected ideas remain removable in the brief's pick row. */
.dsgn__thinker {
  margin-top: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.dsgn__thinkerhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.dsgn__thinkerhead .dsgn__linkbtn {
  margin-left: auto;
}
.dsgn__thinkertopics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.65rem;
}
.dsgn__thinkertopic {
  min-height: 2rem;
}
.dsgn__thinkersaid:not(:empty) {
  margin-top: 0.65rem;
  color: var(--ink-2);
  font-size: var(--text-meta);
}
.dsgn__thinkerlist:not(:empty) {
  margin-top: 0.55rem;
  border-top: 1px solid var(--line);
}
.dsgn__thinkerrow {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}
.dsgn__thinkerrow.is-added {
  opacity: 0.66;
}
.dsgn__thinkertext {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.45;
}
.dsgn__thinkeradd {
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  font-size: var(--text-label);
  white-space: nowrap;
}
.dsgn__thinkeradd:disabled {
  opacity: 1;
  color: var(--ok);
}
.dsgn__thinkernote {
  margin-top: 0.55rem;
}
.dsgn__thinkeraskrow {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.6rem;
}
.dsgn__thinkerask {
  flex: 1 1 auto;
  min-width: 0;
  resize: none;
  font-size: var(--text-meta);
}
@media (max-width: 44rem) {
  .dsgn__thinkerrow {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.45rem;
  }
  .dsgn__thinkeraskrow {
    flex-direction: column;
  }
  .dsgn__thinkeraskrow .btn,
  .dsgn__thinkeradd {
    align-self: flex-start;
  }
}

/* Quick-plan panel: the personalized ideas pass. Flat surfaces, full borders,
   ochre for picked directions, brass for the locked palette. */
.dsgn__ideas {
  margin-top: 0.7rem;
  padding: 0.75rem 0.85rem;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: color-mix(in oklab, var(--brass) 5%, transparent);
}
.dsgn__ideashead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}
.dsgn__ideashead .eyebrow {
  margin-right: auto;
}
.dsgn__ideapals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.6rem;
}
.dsgn__pal {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.28rem 0.6rem 0.28rem 0.32rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dsgn__pal:hover,
.dsgn__pal:focus-visible {
  border-color: var(--brass);
  outline: 2px solid var(--brass);
  outline-offset: 1px;
}
.dsgn__pal.is-on {
  border-color: var(--brass);
  border-width: 1.5px;
  background: color-mix(in oklab, var(--brass) 10%, transparent);
  font-weight: 600;
}
.dsgn__palsw {
  display: inline-flex;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.dsgn__palsw i {
  width: 14px;
  height: 14px;
  display: block;
}
.dsgn__error {
  margin-top: 0.6rem;
  padding: 0.55rem 0.8rem;
  border: 1px solid var(--terra);
  border-radius: 0.5rem;
  color: var(--terra);
  font-size: var(--text-meta);
}
.dsgn__linkbtn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}
/* Design ↔ code round-trip links: the row under a project's header naming
   the code run it grew out of and every code run it flowed into. Small
   pill links, accent-tinted like the cost chip — garnish, quiet by design. */
.dsgn__coderuns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.55rem;
}
.dsgn__coderun {
  display: inline-block;
  width: fit-content;
  padding: 0.24rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 7%, transparent);
  color: var(--ink);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.dsgn__coderun:hover {
  border-color: var(--accent);
}
.dsgn__coderun--from {
  background: color-mix(in oklab, var(--ok) 10%, transparent);
}
/* List-card round-trip markers: one small hint line before the dots. */
.dsgn__cardtrip {
  display: inline-block;
  width: fit-content;
  margin-top: 0.3rem;
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--accent);
  opacity: 0.85;
}
/* Panel-head clustering: eyebrow + live counter as one group, cost +
   shortcuts as the other, so space-between distributes two tight clusters
   instead of scattering four orphans across the wide canvas. */
.dsgn__headgrp {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
}
.dsgn__chiptint {
  display: inline-flex;
  gap: 0.18rem;
  margin-bottom: 0.22rem;
  opacity: 1;
}
.dsgn__chiptint i {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 50%;
  border: 1px solid var(--line);
}
/* Tick 81 B5: twist cards — the dashed border carries the deleted twist
   pill's off-canon read inside the specimen deck; is-on commits to solid
   like every other picked card. */
.dsgn__rcard.is-twist {
  border-style: dashed;
}
.dsgn__rcard.is-twist.is-on {
  border-style: solid;
}
/* Tick 83: layout-pattern wireframes — the specimen is the family read
   (tag chip + structure diagram), so the border stays solid like canon
   cards: dashed is proposed/ghost, and a third border language would be
   noise. Children are drawn inline by railWire(); only the host + the
   shared rounding live here. */
.dsgn__rlayout {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  height: 2.9rem;
  margin: 0.12rem 0;
}
.dsgn__rlayout div {
  border-radius: 1px;
  min-height: 2px;
}
/* Tick 84: motion-direction demos. The specimen replays its entrance when
   the card is hovered or keyboard-focused (a re-applied animation restarts);
   `both` fill holds the from-state through each box's delay so the stagger
   reads as a cascade. Everything is no-preference gated — reduced-motion
   viewers see the settled wireframes, and the "instant" intent is the same
   for everyone. Keyframes end at each box's natural state so the settled
   specimen is the animation's final frame. */
@media (prefers-reduced-motion: no-preference) {
  .dsgn__rcard.is-motion:hover .dsgn__w-fade,
  .dsgn__rcard.is-motion:focus-visible .dsgn__w-fade {
    animation: dsgnFade 480ms ease-out both;
  }
  .dsgn__rcard.is-motion:hover .dsgn__w-rise,
  .dsgn__rcard.is-motion:focus-visible .dsgn__w-rise {
    animation: dsgnRise 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }
  .dsgn__rcard.is-motion:hover .dsgn__w-slide,
  .dsgn__rcard.is-motion:focus-visible .dsgn__w-slide {
    animation: dsgnSlide 460ms ease-out both;
  }
  .dsgn__rcard.is-motion:hover .dsgn__w-drift-f,
  .dsgn__rcard.is-motion:focus-visible .dsgn__w-drift-f {
    animation: dsgnDrift 500ms ease-out both;
  }
  .dsgn__rcard.is-motion:hover .dsgn__w-drift-s,
  .dsgn__rcard.is-motion:focus-visible .dsgn__w-drift-s {
    animation: dsgnDrift 950ms ease-out both;
  }
  .dsgn__rcard.is-motion:hover .dsgn__w-snap,
  .dsgn__rcard.is-motion:focus-visible .dsgn__w-snap {
    animation: dsgnSnap 240ms linear both;
  }
}
/* Review fix: the app's motion-on override (footer "Motion: always on",
   styles.css 6465-6479) opts an OS-reduce user back into every animation
   via :root:not(.motion-on) carve-outs. The no-preference gate above can't
   see that class, so mirror the triggers — with .motion-on set, the global
   backstop stands down and these run. */
:root.motion-on .dsgn__rcard.is-motion:hover .dsgn__w-fade,
:root.motion-on .dsgn__rcard.is-motion:focus-visible .dsgn__w-fade {
  animation: dsgnFade 480ms ease-out both;
}
:root.motion-on .dsgn__rcard.is-motion:hover .dsgn__w-rise,
:root.motion-on .dsgn__rcard.is-motion:focus-visible .dsgn__w-rise {
  animation: dsgnRise 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
:root.motion-on .dsgn__rcard.is-motion:hover .dsgn__w-slide,
:root.motion-on .dsgn__rcard.is-motion:focus-visible .dsgn__w-slide {
  animation: dsgnSlide 460ms ease-out both;
}
:root.motion-on .dsgn__rcard.is-motion:hover .dsgn__w-drift-f,
:root.motion-on .dsgn__rcard.is-motion:focus-visible .dsgn__w-drift-f {
  animation: dsgnDrift 500ms ease-out both;
}
:root.motion-on .dsgn__rcard.is-motion:hover .dsgn__w-drift-s,
:root.motion-on .dsgn__rcard.is-motion:focus-visible .dsgn__w-drift-s {
  animation: dsgnDrift 950ms ease-out both;
}
:root.motion-on .dsgn__rcard.is-motion:hover .dsgn__w-snap,
:root.motion-on .dsgn__rcard.is-motion:focus-visible .dsgn__w-snap {
  animation: dsgnSnap 240ms linear both;
}
@keyframes dsgnFade {
  from { opacity: 0; }
}
@keyframes dsgnRise {
  from { opacity: 0; transform: translateY(14px); }
}
@keyframes dsgnSlide {
  from { opacity: 0; transform: translateX(-12px); }
}
@keyframes dsgnDrift {
  from { transform: translateX(-10px); }
}
@keyframes dsgnSnap {
  0% { transform: translateX(-8px); }
  70% { transform: translateX(1.5px); }
  100% { transform: translateX(0); }
}
/* Tick 85: state-behavior demos. Same contract as the motion demos: the
   specimen replays its behavior on hover/focus (a re-applied animation
   restarts), `both` fill holds the from-state through each delay, and the
   settled specimen is the behavior's resting frame. No-preference gated
   WITH the :root.motion-on mirror from the start (tick 84 review lesson) —
   the footer's "Motion: always on" override opts an OS-reduce user back in
   (styles.css 6465-6479). dsgnPulse runs infinite for the hover duration (a
   skeleton breathes for as long as you watch it); dsgnTick eases back to the
   tick box's resting opacity (0.25, set inline in the tree) so the flash
   reads as an echo, not a lamp. */
@media (prefers-reduced-motion: no-preference) {
  .dsgn__rcard.is-state:hover .dsgn__w-pulse,
  .dsgn__rcard.is-state:focus-visible .dsgn__w-pulse {
    animation: dsgnPulse 1.6s ease-in-out infinite;
  }
  .dsgn__rcard.is-state:hover .dsgn__w-nudge,
  .dsgn__rcard.is-state:focus-visible .dsgn__w-nudge {
    animation: dsgnNudge 320ms linear both;
  }
  .dsgn__rcard.is-state:hover .dsgn__w-fade,
  .dsgn__rcard.is-state:focus-visible .dsgn__w-fade {
    animation: dsgnFade 480ms ease-out both;
  }
  .dsgn__rcard.is-state:hover .dsgn__w-ring,
  .dsgn__rcard.is-state:focus-visible .dsgn__w-ring {
    animation: dsgnRing 300ms ease-out both;
  }
  .dsgn__rcard.is-state:hover .dsgn__w-tick,
  .dsgn__rcard.is-state:focus-visible .dsgn__w-tick {
    animation: dsgnTick 900ms ease-out both;
  }
  .dsgn__rcard.is-state:hover .dsgn__w-settle,
  .dsgn__rcard.is-state:focus-visible .dsgn__w-settle {
    animation: dsgnSettle 500ms ease-out both;
  }
  .dsgn__rcard.is-state:hover .dsgn__w-reveal,
  .dsgn__rcard.is-state:focus-visible .dsgn__w-reveal {
    animation: dsgnReveal 320ms ease-out both;
  }
}
:root.motion-on .dsgn__rcard.is-state:hover .dsgn__w-pulse,
:root.motion-on .dsgn__rcard.is-state:focus-visible .dsgn__w-pulse {
  animation: dsgnPulse 1.6s ease-in-out infinite;
}
:root.motion-on .dsgn__rcard.is-state:hover .dsgn__w-nudge,
:root.motion-on .dsgn__rcard.is-state:focus-visible .dsgn__w-nudge {
  animation: dsgnNudge 320ms linear both;
}
:root.motion-on .dsgn__rcard.is-state:hover .dsgn__w-fade,
:root.motion-on .dsgn__rcard.is-state:focus-visible .dsgn__w-fade {
  animation: dsgnFade 480ms ease-out both;
}
:root.motion-on .dsgn__rcard.is-state:hover .dsgn__w-ring,
:root.motion-on .dsgn__rcard.is-state:focus-visible .dsgn__w-ring {
  animation: dsgnRing 300ms ease-out both;
}
:root.motion-on .dsgn__rcard.is-state:hover .dsgn__w-tick,
:root.motion-on .dsgn__rcard.is-state:focus-visible .dsgn__w-tick {
  animation: dsgnTick 900ms ease-out both;
}
:root.motion-on .dsgn__rcard.is-state:hover .dsgn__w-settle,
:root.motion-on .dsgn__rcard.is-state:focus-visible .dsgn__w-settle {
  animation: dsgnSettle 500ms ease-out both;
}
:root.motion-on .dsgn__rcard.is-state:hover .dsgn__w-reveal,
:root.motion-on .dsgn__rcard.is-state:focus-visible .dsgn__w-reveal {
  animation: dsgnReveal 320ms ease-out both;
}
@media (prefers-reduced-motion: no-preference) {
  .dsgn__benchclip.is-pulse {
    animation: dsgnBezel 420ms ease-out both;
  }
}
:root.motion-on .dsgn__benchclip.is-pulse {
  animation: dsgnBezel 420ms ease-out both;
}
@keyframes dsgnPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
@keyframes dsgnNudge {
  0% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  50% { transform: translateX(3px); }
  75% { transform: translateX(-1px); }
  100% { transform: translateX(0); }
}
@keyframes dsgnRing {
  from { outline-offset: 7px; }
}
@keyframes dsgnTick {
  0% { opacity: 0.25; }
  20% { opacity: 1; }
  100% { opacity: 0.25; }
}
@keyframes dsgnSettle {
  from { opacity: 0.3; }
}
@keyframes dsgnReveal {
  from { opacity: 0; transform: translateX(6px); }
}
/* Phase 3 polish: the device-bench bezel flash on apply — box-shadow ring so
   there is no transform to re-root the scaled iframe's fixed descendants. */
@keyframes dsgnBezel {
  0% { box-shadow: 0 0 0 0 transparent; }
  35% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 55%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.dsgn__metamiss {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.dsgn__retry {
  padding: 0.25rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
  cursor: pointer;
}
.dsgn__retry:hover {
  border-color: var(--accent);
}
/* Fork preview + the glance (Phase 1.6): one hero specimen from live
   tokens, forked per stacked pick under scoped --fp-* color overrides
   (hexes only, per the vision). Hovering a rail card re-skins the base
   specimen in ~80ms via transitions; reduced motion cuts them. */
.dsgn__forks {
  display: flex;
  flex-wrap: wrap;
  /* Tick 86 review: stretch, not flex-start — the glyph specimen runs ~2rem
     taller than the wireframe specimen, and top-aligned rows of bordered
     tiles read ragged. Stretch makes one row share the tallest tile's
     height; the fork label's margin-top:auto pins it to the bottom edge so
     labels align across tiles and the slack absorbs above the label. */
  align-items: stretch;
  gap: 0.5rem;
  margin-top: 0.55rem;
}
.dsgn__forkcap {
  flex-basis: 100%;
  margin: 0 0 0.05rem;
  font-size: var(--text-micro);
  letter-spacing: 0.04em;
  opacity: 0.55;
}
.dsgn__forktile {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  width: 8.2rem;
  padding: 0.45rem 0.55rem 0.42rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--fp-ground, var(--card));
  color: var(--fp-ink, var(--ink));
  transition:
    background-color 80ms ease-out,
    color 80ms ease-out,
    border-color 80ms ease-out;
}
.dsgn__forktile--base {
  border-style: dashed;
}
.dsgn__forktile.is-glancing {
  border-color: var(--fp-accent, var(--accent));
  border-style: solid;
}
.dsgn__forkchrome {
  display: flex;
  gap: 0.18rem;
}
.dsgn__forkchrome i {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
  background: var(--fp-accent, var(--accent));
  opacity: 0.9;
}
.dsgn__forkchrome i + i {
  background: currentColor;
  opacity: 0.22;
}
.dsgn__forkglyph {
  font-size: var(--text-title);
  line-height: 1;
  font-weight: 700;
  color: var(--fp-accent, var(--accent));
}
.dsgn__forkrule {
  height: 1px;
  background: color-mix(in oklab, currentColor 30%, transparent);
}
.dsgn__forkline {
  height: 0.22rem;
  border-radius: 999px;
  background: color-mix(in oklab, currentColor 16%, transparent);
}
.dsgn__forkline--short {
  width: 62%;
}
.dsgn__forkcta {
  align-self: flex-start;
  margin-top: 0.1rem;
  padding: 0.14rem 0.55rem;
  border-radius: 999px;
  background: var(--fp-accent, var(--accent));
  /* Chip text uses the max-contrast ink vs the accent fill (--fp-cta-ink),
     not the ground: ground-on-accent measured 2.46:1 on neo-pop, failing
     WCAG AA on 4 of 18 shipped pairs (review finding, tick 71). */
  color: var(--fp-cta-ink, var(--fp-ground, var(--card)));
  font-size: var(--text-micro);
  font-weight: 600;
}
.dsgn__forklabel {
  /* Tick 86 review: pinned to the tile's bottom edge (the fork row is
     align-items:stretch) so labels align across glyph and wireframe tiles. */
  margin-top: auto;
  font-size: var(--text-micro);
  /* 0.68, not 0.6: at 0.6 the label composited to ~4.42:1 on the lightest
     shipped grounds — a hair under the 4.5 AA floor (review, tick 71). */
  opacity: 0.68;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
/* Tick 86: the wireframe host inside family fork tiles (layout/motion/state
   picks). Column flex so railWire's root div (flex:1) stretches to the host
   height; children get the same rounding floor as the rail specimens.
   Family tiles carry no --fp-* tint (forkTintFor returns null for these
   prefixes), so the tree's var(--line)/var(--ink-3)/var(--accent) fills
   resolve through the page tokens on the tile's --card ground. */
.dsgn__forkwire {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  height: 2.3rem;
  margin: 0.1rem 0;
}
.dsgn__forkwire div {
  border-radius: 1px;
  min-height: 2px;
}
/* Tick 87: the transient hover-preview slot at the end of the fork row.
   display:contents so the glance tile inside joins the flex row directly;
   JS toggles an inline display:none — the stylesheet value is what the
   inline empty-string falls back to when shown. */
.dsgn__forkglance {
  display: contents;
}
/* Muse rail (Phase 1): the always-drifting specimen strip between the brief
   cluster and the rest. Transform/opacity-only motion; paused on hover;
   all animation off under prefers-reduced-motion. */
.dsgn__rail {
  margin-top: 0.55rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: color-mix(in oklab, var(--card) 65%, transparent);
  overflow: hidden;
  /* The drifting track is as wide as its cards. Without this its width
     reaches up through the page grid and pushes the whole Studio wider
     than the window when a deal holds one card more than fits. */
  contain: inline-size;
}
.dsgn__railtrack {
  display: inline-flex;
  /* Tick 83: natural heights, not stretch — a layout specimen (~7.7rem with
     its wireframe) forced ~3rem of dead card into every sibling whenever it
     was in the window. Cards are content-top columns; flex-start keeps the
     specimen's height its own. */
  align-items: flex-start;
  gap: 0.5rem;
  /* Lead pad = drift apex distance: at translateX(-2.2rem) the first card
     sits flush at the content edge instead of being clipped ~1.55rem into
     its label (review finding, tick 70). */
  padding-left: 2.2rem;
  animation: dsgnRailDrift 16s ease-in-out infinite;
  will-change: transform;
}
.dsgn__rail:hover .dsgn__railtrack {
  animation-play-state: paused;
}
/* Tick 134: the rail drifts on a hover-paused animation — meaningless on a
   touch screen, where hover never fires and the overflow:hidden clip made
   the off-screen specimens unreachable. Coarse pointers get a plain
   horizontal scroll strip instead. */
@media (pointer: coarse) {
  .dsgn__rail {
    overflow-x: auto;
  }
  .dsgn__railtrack {
    animation: none;
    padding-left: 0;
  }
}
/* Tick 92: the topic tab bar — a slim chip row over the rail. The buttons
   reuse .dsgn__fchip (same pill, same is-on ring) so the bar inherits the
   panel's chip language; this wrapper only sets the row's rhythm. */
.dsgn__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}
@keyframes dsgnRailDrift {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(-2.2rem);
  }
}
.dsgn__rcard {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.14rem;
  flex: 0 0 auto;
  min-width: 8.2rem;
  max-width: 8.2rem;
  padding: 0.42rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  opacity: 0.9;
}
.dsgn__rcard--scale {
  cursor: default;
}
.dsgn__rcard b {
  font-size: var(--text-label);
  line-height: 1.15;
}
.dsgn__rcardcap {
  font-size: var(--text-micro);
  line-height: 1.25;
  opacity: 0.62;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dsgn__rratio {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-body);
  font-weight: 600;
}
.dsgn__rladder {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--text-micro);
  opacity: 0.7;
}
.dsgn__rcard.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  opacity: 1;
}
.dsgn__rcard.is-near {
  opacity: 1;
}
/* the quick-plan "proposed" cluster (Phase 1.7): dashed accent border + tag
   chip; the cards deal as one contiguous leading block */
.dsgn__rcard.is-proposed {
  border-style: dashed;
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
}
/* the cold-start ghost card (Phase 1.8): the composer's door to reference
   ingest — dashed and quieter than a real specimen, wakes on hover/focus */
.dsgn__rcard--ghost {
  /* No card-wide opacity: 0.72 compounded the caption (0.62) to ~2.2:1 Day
     — an AA fail (review finding, tick 74). The dashed border alone carries
     the "not yet real" read; text stays at full card strength, the same
     bar as the tick-73 chip-contrast fix. */
  border-style: dashed;
}
.dsgn__rcard--ghost:hover,
.dsgn__rcard--ghost:focus-visible {
  border-color: var(--accent);
}
/* Tick 127: the rebuild lane — the action rides as a sibling of the
   pinned card (a button nested in a button would break out of the card in
   the DOM). The wrapper keeps the pair in one flex item; the action reads
   as a quiet dashed affordance under the card. */
.dsgn__refwrap {
  display: inline-flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 0 0 auto;
}
.dsgn__rebuild {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.08rem;
  padding: 0.3rem 0.55rem;
  border: 1px dashed color-mix(in oklab, var(--accent) 55%, var(--line));
  border-radius: 0.55rem;
  background: transparent;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.dsgn__rebuild:hover,
.dsgn__rebuild:focus-visible {
  border-color: var(--accent);
}
.dsgn__rebuild b {
  font-size: var(--text-micro);
  line-height: 1.15;
}
/* Tick 127 review: the caption is NOT .dsgn__rcardcap — 0.62 opacity on the
   accent button is an AA fail. Full-strength tertiary ink on --card holds
   ~5.4:1 Day / ~5.3:1 Night (the documented --ink-3 bar from annotation
   mode), and the middle-dot separators stay readable at caption size. */
.dsgn__rebuildcap {
  font-size: var(--text-micro);
  line-height: 1.25;
  color: var(--ink-3);
}

.dsgn__rghostico {
  display: inline-grid;
  place-items: center;
  width: 1.05rem;
  height: 1.05rem;
  border: 1px dashed color-mix(in oklab, var(--accent) 60%, var(--line));
  border-radius: 999px;
  color: var(--accent);
  font-size: var(--text-meta);
  line-height: 1;
}
/* Annotation mode (Phase 2, item 9): the running stage's doctrine
   footnote on every deck card while a design run is live — mono, caption
   size, wrapped to two lines so the doctrine tail survives (the host
   card's title attr carries the full text for hover). Color is the
   defined tertiary ink token: 0.66rem is below the 14pt large-text cutoff,
   so the 4.5:1 AA bar applies — Day --ink-3 #6a8d80 on --card #d8e9e0 is
   ~5.4:1, Night ~5.3:1. The note is aria-hidden: the studio ticker's
   aria-live narrates the run for AT, the footnote is the visual layer. */
/* version contact-sheet strip: one live mini-mockup per version */
.dsgn__verthumbs {
  display: flex;
  gap: 0.55rem;
  overflow-x: auto;
  padding-bottom: 0.35rem;
  margin-bottom: 0.6rem;
}
.dsgn__verthumb {
  position: relative;
  flex: 0 0 auto;
  width: 9rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  cursor: pointer;
}
.dsgn__verthumb.is-latest {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
}
.dsgn__verthumb:hover,
.dsgn__verthumb:focus-visible {
  border-color: var(--accent);
}
.dsgn__verthumbframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 0;
  pointer-events: none; /* the thumb div is the hit target; the frame is decorative */
}
.dsgn__verthumb > i {
  position: absolute;
  left: 0.3rem;
  bottom: 0.25rem;
  font-style: normal;
  font-size: var(--text-micro);
  letter-spacing: 0.06em;
  /* Opaque chip, not a translucent one over the live mockup: 82% card over
     an arbitrary mockup backdrop measured 3.2:1 (Day, dark content) and
     3.3:1 (Night, light content) for ~10px text — AA fail (review finding
     P2I10-4). --ink on opaque --card is ~8:1 in both themes. */
  color: var(--ink);
  background: var(--card);
  padding: 0 0.28rem;
  border-radius: 999px;
}

/* Phase 3 reference ingest (docs/DESIGN_REFERENCE_INGEST.md): the pinned
   digest row above the specimen track. Cards mirror the rail card grammar
   (same radius/border/press affordances) so the row reads as rail family. */
.dsgn__refrow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}
.dsgn__rcard--ref {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  text-align: left;
  /* The digest card carries favicon + text + swatches + tag — it sizes to
     its content instead of the specimen card's fixed 8.2rem (REF-CSS-1). */
  min-width: 0;
  max-width: none;
  width: auto;
}
.dsgn__rcard--ref.is-picked {
  border-color: var(--accent);
  border-style: solid;
  box-shadow: 0 0 0 1px var(--accent);
}
.dsgn__reffav {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  flex: none;
}

/* Tick 129: an upload:// digest has no favicon — a local glyph stands in. */
.dsgn__reffav--shot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  line-height: 1;
  color: var(--ink-2);
  background: var(--fill, rgba(127, 127, 127, 0.14));
}

/* Tick 129: the screenshot-import action keeps its own row position. */
.dsgn__refimport {
  flex: none;
}
.dsgn__refmain {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 11rem;
}
.dsgn__refmain > b {
  font-size: var(--text-label);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dsgn__refswatches {
  display: flex;
  gap: 2px;
  flex: none;
}
.dsgn__refswatches > i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid color-mix(in oklab, var(--ink) 18%, transparent);
}
.dsgn__reftag {
  flex: none;
  font-family: var(--mono, ui-monospace, "SF Mono", Consolas, monospace);
  font-size: var(--text-micro);
  letter-spacing: 0.04em;
  padding: 0.05rem 0.32rem;
  border-radius: 999px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
}
.dsgn__refadd {
  align-self: center;
  width: 2rem;
  min-height: 2.4rem;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: var(--text-body);
  cursor: pointer;
}
.dsgn__refadd:hover {
  border-color: var(--accent);
  color: var(--ink);
}
.dsgn__refeditor {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  flex: 1 1 16rem;
}
.dsgn__refinput {
  flex: 1 1 12rem;
  min-width: 10rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-meta);
}
.dsgn__refinput:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.dsgn__refcancel {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  cursor: pointer;
  font-size: var(--text-meta);
  text-decoration: underline;
}

.dsgn__refselection {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.6rem;
  align-items: baseline;
  padding: 0.35rem 0.1rem;
  color: var(--ink-2);
  font-size: var(--text-meta);
}
.dsgn__refselection strong { color: var(--ink); }

/* Selected-site rebuild context: one working set, never a site-history deck. */
.rebrand-context {
  display: block;
  width: min(44rem, calc(100vw - 2rem));
  margin-block: 0.35rem 0.7rem;
  color: var(--ink);
}
.rebrand-context__toggle {
  min-height: 44px;
  padding-inline: 0;
}
.rebrand-context__body {
  display: grid;
  gap: 0.85rem;
  padding: 0.85rem 0 0.25rem;
  border-top: 1px solid var(--line);
}
.rebrand-context__body[hidden] { display: none; }
.rebrand-context__summary,
.rebrand-context__selects,
.rebrand-context__addrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.8rem;
}
.rebrand-context__summary { justify-content: space-between; }
.rebrand-context__summary span,
.rebrand-context__imagefields > small,
.rebrand-context__alt {
  color: var(--ink-2);
  font-size: var(--text-meta);
}
.rebrand-context__preserve,
.rebrand-context__use {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 44px;
  cursor: pointer;
}
.rebrand-context__preserve input,
.rebrand-context__use input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.2rem;
  accent-color: var(--accent);
}
.rebrand-context__preserve span { display: grid; gap: 0.15rem; }
.rebrand-context__preserve small { color: var(--ink-2); }
.rebrand-context__copy summary {
  min-height: 44px;
  cursor: pointer;
  color: var(--accent);
}
.rebrand-context__copy pre {
  max-height: 20rem;
  overflow: auto;
  margin: 0.45rem 0 0;
  padding: 0.75rem;
  border: 1px solid var(--line);
  background: var(--surface-2, var(--panel));
  color: var(--ink);
  font: 0.82rem/1.55 inherit;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.rebrand-context__images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: 0.75rem;
}
.rebrand-context__image {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.7rem;
  padding-block: 0.65rem;
  border-top: 1px solid var(--line);
}
.rebrand-context__thumb {
  width: 6.5rem;
  height: 6.5rem;
  object-fit: cover;
  background: var(--surface-2, var(--panel));
  border: 1px solid var(--line);
}
.rebrand-context__image.is-excluded .rebrand-context__thumb { opacity: 0.45; }
.rebrand-context__imagefields { display: grid; gap: 0.35rem; min-width: 0; }
.rebrand-context__use { align-items: center; }
.rebrand-context__alt {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rebrand-context__selects { align-items: end; }
.rebrand-context__selects label { display: grid; gap: 0.15rem; flex: 1 1 6rem; }
.rebrand-context__select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  background: var(--surface, var(--panel));
  color: var(--ink);
  font: inherit;
  font-size: var(--text-meta);
}
.rebrand-context__add { display: grid; gap: 0.35rem; margin-top: 0.25rem; }
.rebrand-context__add p { margin: 0; }
.rebrand-context__addrow { align-items: stretch; }
.rebrand-context__addinput { flex: 1 1 15rem; min-height: 44px; }
.rebrand-context__addrow .btn { min-height: 44px; }
.rebrand-context__error { color: var(--danger, #a33); margin: 0; }
.rebrand-context__project {
  width: 100%;
  padding-block: 0.55rem;
  border-block: 1px solid var(--line);
}
.rebrand-context__projectstatus { margin: 0.35rem 0 0.55rem; }
.rebrand-context__projectbrands { display: grid; gap: 0.25rem; }
.rebrand-context__projectbrands .rebrand-context {
  width: 100%;
  margin-block: 0;
}
.rebrand-context__projectbrands .rebrand-context__body {
  max-height: min(32rem, 65vh);
  overflow: auto;
  padding-right: 0.25rem;
}
.rebrand-context__project > .rebrand-context__addrow { margin-block: 0.45rem; }
@media (max-width: 520px) {
  .rebrand-context { width: calc(100vw - 1.5rem); }
  .rebrand-context__image { grid-template-columns: 5rem minmax(0, 1fr); }
  .rebrand-context__thumb { width: 5rem; height: 5rem; }
  .rebrand-context__summary { align-items: flex-start; flex-direction: column; gap: 0.15rem; }
  .rebrand-context__addrow .btn { width: 100%; }
}
.dsgn__referr {
  flex-basis: 100%;
  color: var(--err);
  font-size: var(--text-label);
}
/* Day-theme error text at 0.78rem must hit AA: the global --err is tuned
   for large/graphic use; small body copy gets a deeper red in light
   contexts (review REF-CSS-2 — measured ~3.8:1 against the ~4.5:1 bar). */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .dsgn__referr { color: #8f3520; }
}
:root[data-theme="light"] .dsgn__referr { color: #8f3520; }

/* The spec'd type pairing line rides under the domain in mono. */
.dsgn__reftype {
  font-family: var(--mono, ui-monospace, "SF Mono", Consolas, monospace);
  font-size: var(--text-micro);
  letter-spacing: 0.02em;
}
.dsgn__refadd:focus-visible,
.dsgn__refcancel:focus-visible,
.dsgn__rcard--ref:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.dsgn__rnote {
  font-family: var(--mono, ui-monospace, "SF Mono", Consolas, monospace);
  font-size: var(--text-micro);
  line-height: 1.3;
  color: var(--ink-3);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dsgn__rprop {
  align-self: flex-end;
  font-size: var(--text-micro);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid color-mix(in oklab, var(--accent) 45%, transparent);
  border-radius: 999px;
  padding: 0 0.3rem;
  line-height: 1.4;
  /* No opacity here: 0.9 blended the Day-theme accent to 4.03:1 on --card
     (AA fail, review finding tick 73) — full-strength is 4.8:1. */
}
.dsgn__rcard.is-dealt {
  /* Static opacity 1 + backwards fill: the dealt card fades in and SETTLES
     at full opacity — with the default fill:none the frame after
     animationend reverted to the base 0.9 and visibly popped (review
     finding, tick 70). */
  opacity: 1;
  animation: dsgnRailDeal 0.5s cubic-bezier(0.2, 0, 0, 1) backwards;
}
@keyframes dsgnRailDeal {
  from {
    opacity: 0;
    transform: translateY(0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dsgn__railtrack,
  .dsgn__rcard.is-dealt {
    animation: none;
  }
  .dsgn__forktile {
    transition: none;
  }
}
.dsgn__tmplgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: 0.6rem;
}
/* ---- The numbered steps of the new-design page ---- */
/* The title gives way (it wraps) before the "optional" tag does: with the
   title sized to its text, a long one pushed the tag off a 360px screen.
   The tag's column is a plain 1fr (its floor is the one-word tag): a
   max-content floor took the width of the note below, which spans it, and
   squeezed the title to a letter a line. */
.dsgn__stephead {
  display: grid;
  grid-template-columns: auto minmax(0, max-content) 1fr;
  align-items: center;
  column-gap: 0.6rem;
  row-gap: 0.15rem;
  margin: 0 0 0.7rem;
}
.dsgn__stepnum {
  grid-row: 1 / span 2;
  align-self: start;
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.85rem;
  font-weight: 700;
}
.dsgn__steptitle {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.dsgn__stepopt {
  justify-self: start;
  white-space: nowrap;
  padding: 0.08rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.dsgn__stepnote {
  grid-column: 2 / -1;
  margin: 0;
  font-size: var(--text-label);
  line-height: 1.45;
  opacity: 0.72;
  max-width: 70ch;
}
.dsgn__step {
  margin-top: 1.6rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line);
}
/* "Add more": the optional steps, folded under the brief. */
.dsgn__more {
  margin-top: 1.4rem;
  border-top: 1px solid var(--line);
}
.dsgn__moresum {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  min-height: 2.75rem;
  padding: 0.9rem 0 0.2rem;
  cursor: pointer;
  list-style: none;
}
.dsgn__moresum::-webkit-details-marker {
  display: none;
}
.dsgn__moresum::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-weight: 700;
  align-self: center;
}
.dsgn__more[open] > .dsgn__moresum::before {
  content: "\2212";
}
.dsgn__moresum:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.4rem;
}
.dsgn__moretitle {
  font-weight: 700;
  font-size: var(--text-body);
}
.dsgn__morenote {
  min-width: 0;
  flex: 1 1 14rem;
  font-size: var(--text-label);
  opacity: 0.72;
}
.dsgn__morecount {
  color: var(--accent);
  font-size: var(--text-label);
  font-weight: 700;
}
.dsgn__morecount[hidden] {
  display: none;
}
.dsgn__more > .dsgn__step:first-of-type {
  border-top: 0;
  margin-top: 0.6rem;
}
.dsgn__stepbody {
  min-width: 0;
}
/* The style gallery brings its own top rule and heading; inside a step the
   step's heading already says it. */
.dsgn__step .dsgn-styles {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.dsgn__step .dsgn-styles__head > .eyebrow {
  display: none;
}
/* Step 2: two named ways to hand over material. */
.dsgn__material {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.dsgn__matcard {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-width: 0;
  padding: 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--card);
}
.dsgn__mathead {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-body);
}
.dsgn__matico {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.4rem;
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 0.95rem;
}
.dsgn__matnote {
  margin: 0;
  font-size: var(--text-label);
  line-height: 1.45;
  opacity: 0.75;
}
.dsgn__matcard .dsgn__refeditor,
.dsgn__matcard .dsgn__refrow,
.dsgn__matcard .dsgn__drop,
.dsgn__matcard .dsgn__bucket {
  margin: 0;
}
.dsgn__matcard .dsgn__refeditor {
  /* In the rail this grew along a row; in a card's column the same basis
     became 16rem of empty height. */
  flex: 0 0 auto;
  flex-wrap: wrap;
}
/* The field is part of the step here, not a popover to dismiss. */
.dsgn__matcard .dsgn__refcancel {
  display: none;
}
.dsgn__matcard .dsgn__refeditor input {
  flex: 1 1 12rem;
  min-width: 0;
}
.dsgn__matcard .dsgn__drop {
  min-height: 4.6rem;
  justify-content: center;
  text-align: center;
  border-style: dashed;
}
.dsgn__matadd {
  align-self: flex-start;
}
/* Step 3: layouts as drawn pages. */
.dsgn__layouts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
  gap: 0.6rem;
}
.dsgn__layout {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.4rem 0.4rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, transform 160ms ease;
}
.dsgn__layoutart {
  display: block;
  aspect-ratio: 8 / 5;
  margin-bottom: 0.25rem;
  border-radius: 0.4rem;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
  contain: paint;
}
.dsgn__layoutart svg {
  display: block;
  width: 100%;
  height: 100%;
}
.dsgn__layout b {
  padding-inline: 0.25rem;
  font-size: var(--text-body);
}
.dsgn__layoutcap {
  padding-inline: 0.25rem;
  font-size: var(--text-label);
  line-height: 1.35;
  opacity: 0.7;
}
.dsgn__layout:hover,
.dsgn__layout:focus-visible {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.dsgn__layout.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
  background: color-mix(in oklab, var(--accent) 8%, var(--card));
}
.dsgn__fxcontrols {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.85rem;
  margin: 0 0 0.7rem;
}
.dsgn__fxcontrols label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: var(--text-label);
}
.dsgn__fxcontrols input[type="range"] {
  width: 5.5rem;
  accent-color: var(--accent);
}
.dsgn__fxcontrols select {
  max-width: 12rem;
}
.dsgn__fxcontrols output {
  min-width: 2.7rem;
  font-variant-numeric: tabular-nums;
}
.dsgn__fxcontrols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 0.55rem 0.65rem;
  margin: 0.55rem 0 0.7rem;
}
.dsgn__fxcontrols > label {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
}
.dsgn__fxcontrols select {
  width: 100%;
  max-width: none;
  min-height: 2.25rem;
}
.dsgn__motiontune {
  grid-column: 1 / -1;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}
.dsgn__motiontune summary,
.dsgn__motioncatalog summary {
  min-height: 2rem;
  color: var(--ink-2);
  font-size: var(--text-label);
  cursor: pointer;
}
.dsgn__motiontunebody {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.8rem;
  padding: 0.5rem 0 0.2rem;
}
.dsgn__motiontunebody label {
  display: inline-flex;
  min-width: 0;
}
.dsgn__fxbrowse {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
  font-size: var(--text-label);
}
.dsgn__fxbrowse[hidden] { display: none; }
.dsgn__fxbrowse label { display: flex; align-items: center; gap: 0.35rem; flex: 1; min-width: 0; }
.dsgn__fxbrowse select { flex: 1; min-width: 0; min-height: 2.25rem; }
.dsgn__fxbrowsecount { color: var(--ink-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dsgn__fxchosen {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 0.5rem;
}
.dsgn__fxchosen:empty { display: none; }
.dsgn__fxchip {
  min-height: 1.9rem;
  padding: 0.25rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.35rem;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-micro);
  cursor: pointer;
}
.dsgn__fxchip:hover,
.dsgn__fxchip:focus-visible { border-color: var(--accent); color: var(--ink); }
.dsgn__fxpick:disabled { cursor: not-allowed; opacity: 0.45; }
.dsgn__motioncatalog {
  margin-top: 0.65rem;
  padding-top: 0.45rem;
  border-top: 1px solid var(--line);
}
.dsgn__motioncatalog[open] summary { margin-bottom: 0.5rem; }
.stu__side .dsgn__styleforktoprow--scene {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 640px), (pointer: coarse) {
  .dsgn__motiontune summary,
  .dsgn__motioncatalog summary,
  .dsgn__fxchip { min-height: 2.75rem; }
  .dsgn__fxcontrols select,
  .dsgn__fxbrowse select { min-height: 2.75rem; }
}
.dsgn__motionnote {
  margin: 0 0 0.6rem;
  font-size: var(--text-label);
  line-height: 1.5;
  opacity: 0.78;
  max-width: 78ch;
}
/* Step 6: questions. */
.dsgn__askhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  margin-bottom: 0.8rem;
}
.dsgn__asknote {
  flex: 1 1 14rem;
  min-width: 0;
  font-size: var(--text-label);
  line-height: 1.45;
  opacity: 0.8;
}
.dsgn__asknote--err {
  flex-basis: 100%;
  color: var(--danger, #c0392b);
  opacity: 1;
}
.dsgn__asknote--err:empty {
  display: none;
}
/* A question that belongs to this brief, not to every brief. */
.dsgn__answer--own {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
}
.dsgn__answer--own legend::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
  vertical-align: 0.08em;
}
@media (max-width: 44rem) {
  .dsgn__askbtn {
    width: 100%;
  }
}
.dsgn__answers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.dsgn__answer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
  margin: 0;
  padding: 0.8rem 0.9rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--card);
}
.dsgn__answer legend {
  padding: 0 0.35rem;
  font-size: var(--text-body);
  font-weight: 650;
}
.dsgn__answeropts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.dsgn__answeropt {
  min-height: 2rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dsgn__answeropt:hover,
.dsgn__answeropt:focus-visible {
  border-color: var(--accent);
}
.dsgn__answeropt.is-on {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 16%, transparent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.dsgn__answerfree {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
}
.dsgn__answerfree:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.dsgn__endrow {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.dsgn__finetune {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--line);
}
.dsgn__finetunehead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}
@media (max-width: 44rem) {
  .dsgn__material,
  .dsgn__answers {
    grid-template-columns: minmax(0, 1fr);
  }
  .dsgn__layouts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .dsgn__layoutcap {
    display: none;
  }
  .dsgn__endrow {
    justify-content: stretch;
  }
  .dsgn__endrow .dsgn__startend {
    width: 100%;
  }
  .dsgn__answeropt {
    min-height: 2.4rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .dsgn__layout {
    transition: none;
  }
  .dsgn__layout:hover,
  .dsgn__layout:focus-visible {
    transform: none;
  }
}
.dsgn__tmplpeek {
  display: grid;
  grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.8rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--card);
}
.dsgn__tmplpeekart {
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 0.45rem;
  overflow: hidden;
  contain: paint;
}
.dsgn__tmplpeekart svg {
  display: block;
  width: 100%;
  height: 100%;
}
.dsgn__tmplpeektext {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.dsgn__tmplpeektext b {
  font-size: var(--text-title, 1.1rem);
}
.dsgn__tmplpeekbrief {
  margin: 0.2rem 0 0;
  font-size: var(--text-label);
  line-height: 1.5;
  opacity: 0.8;
  max-width: 68ch;
  /* A fixed room for the longest briefs: the grid below must not jump as
     the pointer moves from a short brief to a long one. */
  min-height: 7.5em;
}
@media (max-width: 44rem) {
  .dsgn__tmplpeek {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
  }
  .dsgn__tmplpeekbrief {
    min-height: 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
}
/* Phones: two previews across, never one long column of 39. */
@media (max-width: 30rem) {
  .dsgn__tmplgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
  }
  .dsgn__tmplgrid .dsgn__tmplblurb {
    display: none;
  }
}
/* The card is display:flex, which beats the hidden attribute — spell it out. */
.dsgn__tmpl[hidden] {
  display: none;
}
/* Family filter row above the gallery (first tag segment = family). */
.dsgn__tmplfilters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.6rem;
}
.dsgn__tmplfilter {
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}
.dsgn__tmplfilter:hover,
.dsgn__tmplfilter:focus-visible {
  border-color: var(--accent);
}
/* Active state follows the dsgn chip idiom (idea/pal/variant): accent
   border + 8% tint, never a full fill. */
.dsgn__tmplfilter.is-on {
  border-color: var(--accent);
  border-width: 1.5px;
  background: color-mix(in oklab, var(--accent) 8%, transparent);
}
.dsgn__tmpl {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.3rem;
  padding: 0.45rem 0.45rem 0.6rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.dsgn__tmpl > b,
.dsgn__tmpl > .dsgn__tmpltag,
.dsgn__tmpl > .dsgn__tmplblurb {
  padding-inline: 0.25rem;
}
.dsgn__tmplprev {
  display: block;
  aspect-ratio: 16 / 9;
  margin-bottom: 0.3rem;
  border-radius: 0.4rem;
  overflow: hidden;
  border: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
  contain: paint;
}
.dsgn__tmplprev svg {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 220ms ease;
}
.dsgn__tmpl:hover .dsgn__tmplprev svg,
.dsgn__tmpl:focus-visible .dsgn__tmplprev svg {
  transform: scale(1.03);
}
@media (prefers-reduced-motion: reduce) {
  .dsgn__tmplprev svg {
    transition: none;
  }
  .dsgn__tmpl:hover .dsgn__tmplprev svg,
  .dsgn__tmpl:focus-visible .dsgn__tmplprev svg {
    transform: none;
  }
}
.dsgn__tmpl b {
  font-size: var(--text-body);
}
.dsgn__tmpltag {
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.55;
}
.dsgn__tmplblurb {
  font-size: var(--text-label);
  opacity: 0.75;
  line-height: 1.35;
}
.dsgn__tmplswatches {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 0.25rem;
}
.dsgn__tmplswatches i {
  flex: 1;
  height: 1.1rem;
  border-radius: 0.3rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.dsgn__tmpl:hover,
.dsgn__tmpl.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.dsgn__tmpl.is-on {
  background: color-mix(in oklab, var(--accent) 8%, var(--card));
}
.dsgn__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.7rem;
}
.dsgn__card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: flex-start;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 0.7rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
}
.dsgn__card:hover {
  border-color: var(--accent);
}
.dsgn__card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* Gallery thumb: the live mockup rendered at quarter scale inside a clipped
   strip. zoom is the reliable CSS scaler here (supported Chrome/Safari/
   Firefox 126+); the iframe is decorative, inert, and click-transparent. */
.dsgn__thumb {
  display: block;
  width: calc(100% + 1.8rem);
  margin: -0.8rem -0.9rem 0.35rem;
  height: 165px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  border-radius: 0.7rem 0.7rem 0 0;
  background: var(--ink);
  pointer-events: none;
}
.dsgn__thumbframe {
  width: 1280px;
  height: 800px;
  border: 0;
  zoom: 0.25;
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  .dsgn__thumbframe {
    transition: transform 0.4s ease;
  }
  .dsgn__card:hover .dsgn__thumbframe {
    transform: translateY(-12px);
  }
}
.dsgn__cardgoal {
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dsgn__cardmeta {
  font-size: var(--text-label);
  opacity: 0.65;
}
.dsgn__dots {
  display: flex;
  gap: 0.3rem;
}
.dsgn__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: inline-block;
}
.dsgn__dot--completed {
  background: var(--ok);
  border-color: var(--ok);
}
.dsgn__dot--running,
.dsgn__dot--awaitingconfirmation {
  background: var(--accent);
  border-color: var(--accent);
}
/* Tick 152 review (live walkthrough): the running dot was a static disc —
   indistinguishable from a finished accent state at a glance. A slow breathe
   marks "work is happening" from across the page; the pop below still fires
   on the status flip. */
.dsgn__dot--running {
  animation: dsgn-dot-breathe 1.6s ease-in-out infinite;
}
@keyframes dsgn-dot-breathe { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.dsgn__dot--failed {
  background: var(--terra);
  border-color: var(--terra);
}
/* one-shot pop when a step's status flips (gated by .is-shift on the step;
   paintDesignStages rebuilds every poll tick, so this must stay change-gated) */
.dsgn__stage.is-shift .dsgn__dot { animation: dsgn-dot-pop 0.5s cubic-bezier(.2, 0, 0, 1); }
@keyframes dsgn-dot-pop { 0% { transform: scale(0.4); } 60% { transform: scale(1.3); } 100% { transform: scale(1); } }
.dsgn__stages {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.dsgn__stage {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  font-size: var(--text-body);
}
.dsgn__stage b {
  text-transform: capitalize;
  min-width: 4.5rem;
}
.dsgn__stagedetail {
  font-size: var(--text-meta);
  opacity: 0.65;
  overflow-wrap: anywhere;
}
.dsgn__gatehost {
  margin-top: 0.9rem;
}
.dsgn__gatepanel {
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--card);
  overflow: hidden;
}
.dsgn__standin {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: 0 0 0.6rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--danger, #c0392b);
  border-radius: 0.6rem;
  background: color-mix(in oklab, var(--danger, #c0392b) 12%, var(--card));
  font-size: var(--text-body);
  line-height: 1.45;
}
.dsgn__standintext {
  flex: 1 1 16rem;
  min-width: 0;
}
@media (max-width: 44rem) {
  .dsgn__standinbtn {
    width: 100%;
  }
}
.dsgn__gatebody {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 0;
}
.dsgn__split {
  display: none;
}
@media (min-width: 60.001rem) {
  .dsgn__split {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--dsgn-split, 58.333%);
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    transform: translateX(-50%);
    cursor: col-resize;
    touch-action: none;
  }
  .dsgn__split::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--line);
  }
  .dsgn__split i {
    position: relative;
    width: 6px;
    height: 28px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    box-shadow: var(--shadow);
  }
  .dsgn__split i::before {
    content: "⋮";
    display: block;
    color: var(--ink-3);
    font: 14px/24px var(--f-code);
    text-align: center;
  }
  .dsgn__split:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }
}
.dsgn__mockcol {
  border-right: 1px solid var(--line);
  background: var(--paper);
}
.dsgn__mock {
  width: 100%;
  /* Tick 93: the mockup is the designer's canvas — it earns the viewport's
     height, not a fixed 34rem slit. The pick column matches it. */
  height: clamp(38rem, 82vh, 62rem);
  border: 0;
  display: block;
  background: #fff;
}
.dsgn__pickcol {
  padding: 0.9rem;
  max-height: clamp(38rem, 82vh, 62rem);
  overflow-y: auto;
}
.dsgn__picked {
  margin-bottom: 0.65rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}
.dsgn__picked > summary {
  cursor: pointer;
  font-size: var(--text-meta);
  font-weight: 600;
  list-style: none;
}
.dsgn__picked > summary::-webkit-details-marker { display: none; }
.dsgn__picked > summary::before { content: "▸ "; }
.dsgn__picked[open] > summary::before { content: "▾ "; }
.dsgn__pickedlist {
  display: grid;
  gap: 0.25rem;
  max-height: 8rem;
  margin-top: 0.45rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  font-size: var(--text-label);
}
.dsgn__pickedrow {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dsgn__pickedrow::before {
  content: "✓";
  margin-right: 0.35rem;
  color: var(--ok);
}
.dsgn__pickerextra {
  display: contents;
}
.dsgn__pickmore {
  display: none;
}
.dsgn__picker.is-delivered {
  opacity: 0.6;
  pointer-events: none;
}
.dsgn__dim {
  padding: 0.45rem 0;
  border-bottom: 1px dashed var(--line);
}
.dsgn__dimhead {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  font-weight: 600;
  font-size: var(--text-meta);
  margin-bottom: 0.3rem;
}
/* Tick 93: the per-row liveness badge. Invisible until the frame's load sweep
   reports what clicking the row will actually do on THIS mockup; "live" =
   the apply visibly lands, "baked in" = no hook (the pick still rides into
   the build). The overlay rail reuses the same badge. */
.dsgn__livemark {
  margin-left: auto;
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  flex: none;
}
.dsgn__livemark.is-live {
  opacity: 0.9;
  color: var(--ok);
}
.dsgn__livemark.is-baked {
  opacity: 0.62;
  color: var(--ink-faint);
}
.dsgn__dimnum {
  opacity: 0.55;
  margin-right: 0.3rem;
}
.dsgn__variants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.dsgn__variant {
  display: inline-flex;
  align-items: baseline;
  gap: 0.3rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--text-meta);
  cursor: pointer;
}
.dsgn__variant b {
  text-transform: uppercase;
}
.dsgn__variant em {
  font-style: normal;
  font-size: var(--text-micro);
  opacity: 0.55;
}
.dsgn__variant:hover,
.dsgn__variant.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.dsgn__group {
  margin-top: 0.7rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dsgn__groupname {
  font-size: var(--text-label);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}
.dsgn__toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--text-meta);
  cursor: pointer;
}
.dsgn__toggle input {
  accent-color: var(--accent);
  width: 1rem;
  height: 1rem;
}
.dsgn__slot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}
.dsgn__slotlabel {
  font-size: var(--text-meta);
  min-width: 4.5rem;
  opacity: 0.75;
}
.dsgn__swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.dsgn__swatch {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 0.35rem;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.dsgn__swatch.is-on {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--card) inset;
}
.dsgn__notes {
  font-size: var(--text-meta);
}
.dsgn__fork {
  border-top: 1px solid var(--line);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  background: color-mix(in oklab, var(--paper) 55%, var(--card));
}
.dsgn__forklede {
  font-size: var(--text-meta);
  opacity: 0.75;
}
.dsgn__forkbtns {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.dsgn__forkbtn {
  font-weight: 600;
  padding: 0.6rem 1.1rem;
}
.dsgn__forkbtn--mock {
  background: transparent;
  border: 1px solid var(--line-strong, var(--ink));
  /* Tick 151 UI review: the .btn stamp's foreground is designed to sit on
     its own filled background — on transparent it vanishes (light-on-light
     by day, dark-on-dark by night). An outlined button takes the theme's
     text ink instead. */
  color: var(--ink);
}
.dsgn__forkbtn--mock:hover {
  background: var(--ink-ghost);
}
.dsgn__forkbtn--build {
  border: 1px solid var(--accent);
}
.dsgn__forkdone {
  background: transparent;
  border: 0;
  color: var(--ok);
  font-weight: 500;
  cursor: default;
  text-align: left;
}
/* Mobile Phase 1 guard (user decision, DESIGN_MOBILE_STUDIO.md §6): the
   metered forks (build / reimagine) swap the button row for this confirm
   bar on coarse pointers — a fat-thumb tap cannot spend money. */
.dsgn__forkconfirm {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}
.dsgn__forkconfirmnote {
  flex-basis: 100%;
  font-size: var(--text-meta);
  opacity: 0.8;
}
/* The bench toolbar is a phone-only surface; desktop keeps the slim
   frame bar. */
.dsgn__benchbar {
  display: none;
}

/* Phone studio (frozen doc §2): the versions block collapses to a slim
   scrollable chip strip; the full contact sheet hides behind a native
   disclosure. Desktop keeps today's layout (strip hidden, details open). */
.dsgn__verstrip {
  display: none;
}
.dsgn__vermore > summary {
  display: none;
}
.dsgn__vermore > summary::-webkit-details-marker {
  display: none;
}
/* Mobile Phase 1 (docs/DESIGN_MOBILE_STUDIO.md): the mock column becomes
   the device bench. The framed mockup renders at a TRUE device size inside
   a clip sized by the letterbox fit — the old clamp slit reflowed every
   mockup to phone width (dishonest type, broken position:fixed). Desktop
   is untouched: every bench rule lives inside this media query, and the
   JS sets the three --dsgn-* vars on the column. */
@media (max-width: 60rem) {
  .dsgn__gatebody {
    grid-template-columns: 1fr;
  }
  .dsgn__mockcol {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem;
    overflow: hidden;
  }
  .dsgn__bench {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
    max-width: 100%;
  }
  .dsgn__benchclip {
    /* clip box = device box x fit; the iframe inside keeps the DEVICE
       layout size so the mockup's own media queries fire exactly as on
       the preset device, while transform:scale letterboxes it into the
       clip. */
    width: calc(var(--dsgn-device-w, 390px) * var(--dsgn-fit, 1));
    height: calc(var(--dsgn-device-h, 844px) * var(--dsgn-fit, 1));
    overflow: hidden;
    border-radius: 0.8rem;
    background: var(--paper);
  }
  .dsgn__mock {
    width: var(--dsgn-device-w, 390px);
    height: var(--dsgn-device-h, 844px);
    max-width: none;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    transform: scale(var(--dsgn-fit, 1));
    transform-origin: top left;
  }
  .dsgn__benchbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.35rem;
  }
  .dsgn__fitbadge {
    font-size: var(--text-micro);
    opacity: 0.7;
    padding: 0.14rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    white-space: nowrap;
  }
  .dsgn__devicechip {
    font: inherit;
    font-size: var(--text-label);
    padding: 0.2rem 0.55rem;
    min-height: 2rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }
  .dsgn__devicechip[aria-pressed="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
  }
  .dsgn__pickcol {
    max-height: min(70dvh, 46rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .dsgn__pickmore {
    display: block;
    width: 100%;
    margin: 0.55rem 0;
    padding: 0.55rem 0.75rem;
    border: 1px dashed var(--line);
    border-radius: 0.45rem;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: var(--text-meta);
    cursor: pointer;
  }
  .dsgn__pickmore:hover,
  .dsgn__pickmore:focus-visible {
    border-color: var(--accent);
  }
  .dsgn__pickerextra {
    display: none;
  }
  .dsgn__pickerextra.is-open {
    display: block;
  }
  /* The fork block is the phone's way forward — pin it as a sticky bottom
     bar (house pattern: the composer lifts by --kb-overlay the same way),
     above pickcol content, below every modal band (msheet 60, auth 80,
     gate overlay 90, toast 99). */
  .dsgn__fork {
    position: sticky;
    bottom: 0;
    z-index: 30;
    padding-bottom: calc(0.55rem + env(safe-area-inset-bottom, 0px) + var(--kb-overlay, 0px));  }
}

/* Touch targets: the 44px floor rides the existing --target-min contract,
   taps must not stick hover states, and iOS must not zoom on focus
   (16px input font). */
.dsgn__sugg {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}
.dsgn__sugginput {
  flex: 1 1 16rem;
  min-width: 12rem;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: var(--text-meta);
}
.dsgn__sugginput:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.dsgn__suggbtn,
.dsgn__previewbtn {
  padding: 0.5rem 0.9rem;
  font-size: var(--text-meta);
}
.dsgn__suggnote {
  flex-basis: 100%;
  font-size: var(--text-meta);
  color: var(--ok);
}
.dsgn__forkerr { margin: 0.5rem 0; }
.dsgn__layouts--fork { margin-top: 0.4rem; }
/* The two optional folds under the suggestion box. They were one grey line
   of meta text each, easy to read as a footnote; they are steps a designer
   can take, so each is a full-width row with a name and what it does. */
.dsgn__stylefork {
  margin-top: 0.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.dsgn__stylefork + .dsgn__stylefork { margin-top: 0.4rem; }
.dsgn__stylefork[open] { padding-bottom: 0.75rem; }
.dsgn__stylefork > :not(summary) { margin-left: 0.85rem; margin-right: 0.85rem; }
.dsgn__stylefork > summary {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.15rem 0.6rem;
  min-height: 44px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  color: var(--ink-3);
  font-size: var(--text-meta);
  list-style: none;
  border-radius: 10px;
}
.dsgn__stylefork > summary span { min-width: 0; }
.dsgn__stylefork > summary b { flex: none; color: var(--ink); font-weight: 600; font-size: var(--text-body, 0.95rem); }
.dsgn__stylefork > summary:hover { background: color-mix(in srgb, var(--ink) 5%, transparent); }
.dsgn__stylefork > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dsgn__stylefork > summary::-webkit-details-marker { display: none; }
.dsgn__stylefork > summary::after { content: "+"; margin-left: auto; color: var(--ink-3); font-size: 1.1rem; line-height: 1; }
.dsgn__stylefork[open] > summary::after { content: "–"; }
.dsgn__styleforkopt {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.5rem 0 0.6rem;
  color: var(--ink-3);
  font-size: var(--text-meta);
  cursor: pointer;
}
.dsgn__styleforkopt input { flex: none; width: 1.15rem; height: 1.15rem; margin: 0.1rem 0 0; accent-color: var(--accent); }
.dsgn__styleforkopt b { color: var(--ink); font-weight: 600; }
.dsgn__styleforkgrid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.45rem;
  max-height: min(60dvh, 42rem);
  margin-top: 0.55rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.dsgn__styleforkthumb {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: var(--text-micro);
  text-align: left;
  cursor: pointer;
}
.dsgn__styleforkthumb:hover,
.dsgn__styleforkthumb:focus-visible {
  border-color: var(--accent);
}
.dsgn__styleforkmini {
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 8 / 5;
  pointer-events: none;
}
.dsgn__styleforkmini svg { display: block; width: 100%; height: 100%; }
.dsgn__styleforkpick {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin-top: 0.55rem;
}
.dsgn__styleforkpick label {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  color: var(--ink-3);
  font-size: var(--text-micro);
}
.dsgn__styleforksel {
  width: 100%;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.3rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: var(--text-meta);
}
.dsgn__styleforksel:focus-visible { border-color: var(--accent); }
.dsgn__styleforksel:disabled { opacity: 0.55; }
.dsgn__styleforktop:empty { display: none; }
.dsgn__styleforktop { margin-top: 0.6rem; }
.dsgn__styleforksaved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 1rem;
  margin-top: 0.6rem;
  color: var(--ink-3);
  font-size: var(--text-micro);
}
.dsgn__styleforkpeek {
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  cursor: pointer;
}
.dsgn__styleforkpeek:hover,
.dsgn__styleforkpeek:focus-visible { border-color: var(--accent); }
.dsgn__styleforksaved.is-error { color: var(--terra); }
.dsgn__styleforktophead {
  margin: 0.5rem 0 0.3rem;
  color: var(--ink-3);
  font-size: var(--text-micro);
}
.dsgn__styleforktophead--bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.dsgn__styleforkshuffle {
  min-height: 1.75rem;
  padding: 0.15rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.dsgn__styleforkshuffle:hover,
.dsgn__styleforkshuffle:focus-visible { border-color: var(--accent); }
.dsgn__styleforktoprow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.dsgn__styleforktoprow--scene {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}
.dsgn__styleforkpickbtn {
  display: grid;
  gap: 0.25rem;
  min-width: 0;
  min-height: 2.25rem;
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: var(--text-micro);
  text-align: left;
  cursor: pointer;
}
.dsgn__styleforkpickbtn--scene { padding: 0.25rem; }
.dsgn__styleforkpickbtn > span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsgn__styleforkpickbtn:hover,
.dsgn__styleforkpickbtn:focus-visible,
.dsgn__styleforkpickbtn.is-on { border-color: var(--accent); }
.dsgn__styleforkpickbtn.is-on { box-shadow: inset 0 0 0 1px var(--accent); }
.dsgn__styleforkpickthumb {
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 0.25rem;
}
.dsgn__styleforkpickthumb canvas { display: block; width: 100%; height: 100%; }
.dsgn__styleforkpickthumb--none { display: grid; place-items: center; background: transparent; border: 1px dashed currentColor; opacity: .55; font-size: 1.4rem; }
@media (max-width: 640px) {
  .dsgn__styleforkpick { grid-template-columns: minmax(0, 1fr); }
  .dsgn__styleforktoprow--scene { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dsgn__styleforkshuffle { min-height: 2.75rem; padding-inline: 0.9rem; }
}
/* Touch: every control in the style section is a full-size target. */
@media (max-width: 640px), (pointer: coarse) {
  .dsgn__styleforksel,
  .dsgn__styleforkpickbtn,
  .dsgn__styleforkpeek { min-height: 2.75rem; }
}
/* Desktop: the full-screen button sits above the mockup, not on top of the
   mockup's own navigation. */
@media (min-width: 60.01rem) {
  .dsgn__mockcol { display: flex; flex-direction: column; }
  .dsgn__mockcol > .dsgn__expand { position: static; order: -1; align-self: flex-end; margin: 0.45rem 0.55rem; }
}
.dsgn__quick {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.65rem;
  padding-top: 0.55rem;
  border-top: 1px dashed var(--line);
}
.dsgn__quickhead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.4rem;
}
.dsgn__quickitem {
  display: grid;
  grid-template-columns: auto minmax(0, 0.8fr) minmax(0, 1.6fr) auto auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--card);
  font-size: var(--text-label);
}
.dsgn__quicktarget,
.dsgn__quicktext {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dsgn__quicktarget { color: var(--ink-3); }
.dsgn__quickstatus { color: var(--ok); white-space: nowrap; }
.dsgn__quickitem--working .dsgn__quickstatus { color: var(--accent); }
.dsgn__quickitem--failed .dsgn__quickstatus { color: var(--danger); }
.dsgn__quickitem--removed { opacity: 0.45; }
.dsgn__quickremove {
  width: 1.6rem;
  height: 1.6rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.dsgn__quickremove:hover,
.dsgn__quickremove:focus-visible { background: var(--ink-ghost); }
@media (max-width: 60rem) {
  .dsgn__styleforkgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dsgn__quickitem { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .dsgn__quicktarget { display: none; }
}

.dsgn__mockcol {
  position: relative;
}
.dsgn__expand {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  padding: 0.3rem 0.6rem;
  font-size: var(--text-label);
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--card);
  color: inherit;
  cursor: pointer;
  opacity: 0.85;
}
.dsgn__expand:hover,
.dsgn__expand:focus-visible {
  opacity: 1;
  border-color: var(--accent);
}
@media (pointer: coarse) {
  .dsgn__variant {
    min-height: var(--target-min, 44px);
  }
  .dsgn__swatch {
    width: max(1.5rem, var(--target-min, 44px));
    height: max(1.5rem, var(--target-min, 44px));
  }
  .dsgn__toggle {
    min-height: var(--target-min, 44px);
  }
  .dsgn__toggle input {
    width: 1.25rem;
    height: 1.25rem;
  }
  .dsgn__forkbtn {
    min-height: 48px;
  }
  .dsgn__suggbtn,
  .dsgn__previewbtn {
    min-height: var(--target-min, 44px);
  }
  .dsgn__sugginput {
    font-size: 16px;
  }
  .dsgn__expand {
    opacity: 1;
    min-height: var(--target-min, 44px);
    padding: 0.3rem 0.8rem;
  }
  /* Versions: slim scrollable chip strip; the contact sheet lives behind
     the native disclosure (the summary is the "All versions" toggle). */
  .dsgn__versions {
    display: block;
  }
  .dsgn__verstrip {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 0.2rem;
  }
  .dsgn__verchip {
    flex: none;
    scroll-snap-align: start;
    min-height: var(--target-min, 44px);
    padding: 0 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    color: inherit;
    font: inherit;
    font-size: var(--text-meta);
    cursor: pointer;
    white-space: nowrap;
  }
  .dsgn__verchip.is-latest {
    border-color: var(--accent);
  }
  .dsgn__verchip.is-bound {
    box-shadow: 0 0 0 1px var(--accent);
  }
  .dsgn__vermore {
    margin-top: 0.35rem;
  }
  .dsgn__vermore > summary {
    display: flex;
    align-items: center;
    min-height: var(--target-min, 44px);
    font-size: var(--text-meta);
    opacity: 0.75;
    cursor: pointer;
  }
  .dsgn__vermore[open] > summary {
    margin-bottom: 0.35rem;
  }
  .dsgn__gatebody,
  .dsgn__pickcol {
    touch-action: manipulation;
  }
}
/* Tick 141 follow-up (2026-11-08, verified live via CDP): the fork does NOT
   pin on phones. The ≤60rem sticky rule above is inert because
   .dsgn__gatepanel sets overflow:hidden, which confines sticky to a box that
   never scrolls — and that is the DESIRED outcome: the operator asked for no
   always-on bottom bar on the project page. The fork stays in-flow at the
   gate's bottom edge; the only bottom chrome on the page is the app taskbar.
   (If a future change switches the panel to overflow:clip, the sticky would
   come alive and pin a 383px block over the picks — do not ship that without
   a slim pinned row instead.) */
@media (hover: none) {
  /* The variant hover accent sticks after a tap on touch screens — split
     the shared rule so .is-on keeps its accent and plain :hover does not. */
  .dsgn__variant:hover {
    border-color: var(--line);
    box-shadow: none;
  }
  .dsgn__variant.is-on {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
  }
  .dsgn__expand:hover {
    opacity: 0.85;
    border-color: var(--line);
  }
}

/* === Mobile Phase 2: the control deck (docs/DESIGN_MOBILE_STUDIO.md) ===
   One bottom sheet hosting the SAME pick column + fork — the JS teleports
   the nodes under (max-width:60rem) and (pointer:coarse). dsgn-lab__*
   namespace; the deck takes z-65 per the verified layer ladder (msheet
   family: above the tabbar, below the auth wall 80, the gate overlay 90,
   and the toast 99). The scrim rides INSIDE the deck's own stacking
   context — locally below the panel. */
.dsgn-lab__deck,
.dsgn-lab__scrim {
  display: none;
}

@media (max-width: 60rem) and (pointer: coarse) {
  .dsgn-lab__deck {
    display: block;
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--kb-overlay, 0px));
    z-index: 65;
  }
  /* The scrim rides INSIDE the deck's z-65 stacking context: locally it must
     sit BELOW the panel (z-index:1) or it veils the sheet and eats every
     tap at half/full. The page-level ladder number lives on .dsgn-lab__deck. */
  .dsgn-lab__scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }
  .dsgn-lab__deck.is-half .dsgn-lab__scrim,
  .dsgn-lab__deck.is-full .dsgn-lab__scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .dsgn-lab__panel {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: var(--dsgn-lab-h, var(--dsgn-lab-peek, 5.4rem));
    overflow: hidden;
    background: var(--paper-2);
    color: var(--ink);
    border-top: 1px solid var(--line);
    border-radius: 0.9rem 0.9rem 0 0;
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.22);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: height 0.18s ease;
  }
  :root:not(.motion-on) .dsgn-lab__panel,
  :root:not(.motion-on) .dsgn-lab__scrim {
    transition: none;
  }
  .dsgn-lab__deck.is-half .dsgn-lab__panel {
    height: var(--dsgn-lab-h, 55dvh);
  }
  .dsgn-lab__deck.is-full .dsgn-lab__panel {
    height: var(--dsgn-lab-h, 92dvh);
  }
  .dsgn-lab__deck.is-dragging .dsgn-lab__panel {
    transition: none;
  }
  /* At rest-peek the body/foot unmount visually: the clipped controls leave
     the tab order and the AT tree, and the dock animates down to the
     MEASURED head height (--dsgn-lab-peek, published by paint() — a fixed
     length so the height transition interpolates; height:auto cannot).
     During a drag the is-dragging class restores both so the sheet grows. */
  .dsgn-lab__deck.is-peek:not(.is-dragging) .dsgn-lab__deckbody,
  .dsgn-lab__deck.is-peek:not(.is-dragging) .dsgn-lab__deckfoot {
    display: none;
  }
  .dsgn-lab__head {
    position: relative;
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    min-height: var(--target-min, 44px);
    padding: 0.5rem 0.9rem 0.55rem;
  }
  .dsgn-lab__grip {
    position: absolute;
    top: 0.3rem;
    left: 50%;
    transform: translateX(-50%);
    width: 2.6rem;
    height: 0.28rem;
    border-radius: 999px;
    background: var(--ink-faint);
    cursor: grab;
    touch-action: none;
  }
  /* 44px slop: the visual pill stays small; the hit box does not. */
  .dsgn-lab__grip::before {
    content: "";
    position: absolute;
    inset: -1.25rem 0;
  }
  .dsgn-lab__grip:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
  .dsgn-lab__title {
    font-size: var(--text-meta);
    font-weight: 600;
    white-space: nowrap;
    /* The title is the sheet's programmatic focus target on open — it must
       show that focus (a bare outline:none left keyboard users nowhere). */
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-radius: 0.3rem;
  }
  .dsgn-lab__title:focus {
    outline-color: var(--accent);
  }
  .dsgn-lab__summary {
    flex: 1;
    min-width: 0;
    font-size: var(--text-label);
    opacity: 0.65;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .dsgn-lab__chev {
    flex: none;
    min-width: var(--target-min, 44px);
    min-height: var(--target-min, 44px);
    margin: -0.35rem -0.5rem -0.35rem 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    opacity: 0.75;
  }
  .dsgn-lab__deckbody {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 0 0.9rem;
  }
  /* The teleported pick column must not scroll itself — the deck body owns
     the scroll (specificity 0-2-0 beats the pickcol base rules). */
  .dsgn-lab__deckbody > .dsgn__pickcol {
    max-height: none;
    overflow: visible;
    padding: 0.1rem 0 1rem;
  }
  .dsgn-lab__deckfoot {
    flex: none;
    border-top: 1px solid var(--line);
    background: var(--paper-2);
  }
  /* The phase-1 sticky fork bar is superseded inside the deck: the foot is
     the pin (0-2-0 beats the 0-1-0 60rem sticky rule). */
  .dsgn-lab__deckfoot > .dsgn__fork {
    position: static;
    z-index: auto;
    padding-bottom: 0.3rem;
  }
  /* Variant rows become a snap strip instead of wrapping chips. */
  .dsgn__variants {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    padding-bottom: 0.2rem;
  }
  .dsgn__variants .dsgn__variant {
    flex: none;
    scroll-snap-align: start;
  }
}



.dsgn__overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: color-mix(in oklab, var(--ink) 82%, transparent);
  display: flex;
  flex-direction: column;
  padding: clamp(0.6rem, 2.5vw, 2rem);
  gap: 0.6rem;
}
.dsgn__overlaybar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--paper);
}
.dsgn__overlaytitle {
  font-size: var(--text-meta);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.8;
}
.dsgn__overlayclose,
.dsgn__overlayfs {
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 0.45rem;
  color: inherit;
  font: inherit;
  padding: 0.25rem 0.6rem;
  cursor: pointer;
}
.dsgn__overlayclose:hover,
.dsgn__overlayclose:focus-visible,
.dsgn__overlayfs:hover,
.dsgn__overlayfs:focus-visible {
  opacity: 0.65;
}
.dsgn__overlayactions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: none;
}
.dsgn__overlayframe {
  flex: 1;
  width: 100%;
  border: 0;
  border-radius: 0.7rem;
  background: #fff;
}
.dsgn__overlaybody {
  position: relative;
  flex: 1;
  display: flex;
  min-height: 0;
}
/* The live-edit rail floats over the framed mockup (inside the overlay, so
   native fullscreen keeps it). Scrolls independently; the frame keeps the
   remaining width. */
.dsgn__overlaypick {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  bottom: 0.6rem;
  width: min(300px, 46vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: color-mix(in oklab, var(--paper) 95%, transparent);
  color: var(--ink);
  border: 1px solid color-mix(in oklab, var(--ink) 16%, transparent);
  border-radius: 0.7rem;
  padding: 0.65rem;
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.38);
}
.dsgn__overlaypick .dsgn__picker {
  display: block;
}
.dsgn__overlaypickhead {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.85;
}
/* The rail folds to just its head so fullscreen review can see the mockup's
   right column; the head button re-expands it. */
.dsgn__overlaypickfold {
  background: transparent;
  border: 1px solid color-mix(in oklab, var(--ink) 30%, transparent);
  border-radius: 0.4rem;
  color: inherit;
  font: inherit;
  line-height: 1;
  padding: 0.1rem 0.45rem;
  cursor: pointer;
  flex: none;
}
.dsgn__overlaypickfold:hover,
.dsgn__overlaypickfold:focus-visible {
  opacity: 0.65;
}
.dsgn__overlaypick.is-folded {
  width: auto;
  max-width: min(300px, 46vw);
}
.dsgn__overlaypick.is-folded .dsgn__picker,
.dsgn__overlaypick.is-folded .dsgn__hint {
  display: none;
}
.dsgn__overlaypick.is-folded .dsgn__overlaypickhead {
  margin-bottom: 0;
}
.dsgn__overlaypick.is-folded .dsgn__bref {
  display: none;
}
@media (max-width: 60rem) {
  .dsgn__overlaypick:not(.is-folded) {
    top: auto;
    right: 0.4rem;
    bottom: 0.4rem;
    left: 0.4rem;
    width: auto;
    max-width: none;
    max-height: 48%;
    padding: 0.6rem;
  }
  .dsgn__overlaypick.is-folded {
    top: auto;
    right: 0.4rem;
    bottom: 0.4rem;
    max-width: calc(100% - 0.8rem);
  }
  .dsgn__overlaypickhead {
    position: sticky;
    top: -0.6rem;
    z-index: 2;
    padding: 0.35rem 0;
    background: color-mix(in oklab, var(--paper) 96%, transparent);
  }
}

/* The Edit-full-screen rail re-skins as the same deck component under a
   coarse pointer: overlay padding collapses to 0 (safe-area preserved at
   the top for the bar) and the native element-fullscreen button stands
   down (phones make it janky, no Esc); exits are X + backdrop per the
   frozen doc. Scoped to the EDIT overlay via --edit — the compare view
   shares the base class and keeps its own padding + fullscreen button.
   Placed AFTER the base .dsgn__overlay / .dsgn__overlayfs rules — same
   specificity, later wins. The media query repeats the FULL AND query the
   JS gate uses (mockupOverlay coarseRail) — bare (pointer:coarse) collapsed
   the overlay on >60rem tablets that never build a deck (tick-99 verify). */
@media (max-width: 60rem) and (pointer: coarse) {
  .dsgn__overlay--edit {
    padding: 0;
    padding-top: env(safe-area-inset-top, 0px);
  }
  .dsgn__overlay--edit .dsgn__overlayfs {
    display: none;
  }
  /* The deck's scrim is fixed inset-0, which would veil and tap-block the
     overlay bar (its X); start the dim just below the bar instead. */
  .dsgn__overlay .dsgn-lab__scrim {
    /* 3rem clears the 44px (2.75rem) coarse-pointer button floor under
       40rem — at 2.4rem the scrim still covered the X's lower edge. */
    top: calc(3rem + env(safe-area-inset-top, 0px));
  }
  .dsgn-lab__deck,
  .dsgn-lab__scrim {
    display: block;
  }
}

/* Tick 93: "borrow from another version" — the gate's cross-mockup reference.
   A native <details> keeps it quiet until asked; the rows it paints list
   what the chosen version chose, each adoptable where the current options
   allow. */
.dsgn__bref {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--line);
}
.dsgn__brefsum {
  cursor: pointer;
  font-size: var(--text-meta);
  font-weight: 600;
}
.dsgn__brefbody {
  margin-top: 0.45rem;
  display: grid;
  gap: 0.4rem;
}
.dsgn__breftop {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.dsgn__brefsel {
  font: inherit;
  font-size: var(--text-meta);
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.2rem 0.4rem;
}
.dsgn__brefrows {
  display: grid;
  gap: 0.3rem;
}
.dsgn__brefrow {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: var(--text-label);
}
.dsgn__brefrow.is-still {
  opacity: 0.62;
}
.dsgn__brefwhat {
  flex: 1 1 auto;
  min-width: 0;
}
.dsgn__brefdot {
  width: 0.8rem;
  height: 0.8rem;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.dsgn__brefbtn {
  flex: none;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
  padding: 0.08rem 0.45rem;
  cursor: pointer;
  white-space: nowrap;
}
.dsgn__brefbtn:hover,
.dsgn__brefbtn:focus-visible {
  border-color: var(--accent);
}
.dsgn__brefbtn[disabled] {
  opacity: 0.6;
  cursor: default;
}
.dsgn__brefall {
  justify-self: start;
  border: 1px dashed var(--line);
  border-radius: 0.45rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
  padding: 0.22rem 0.6rem;
  cursor: pointer;
}
.dsgn__brefall:hover,
.dsgn__brefall:focus-visible {
  border-color: var(--accent);
}
/* The no-visible-preview line under the picker (reference-picker parity).
   Day-theme small text at --err measures ~3.5:1 — below AA — so light
   contexts get the deeper red, the established .dsgn__breferr pattern. */
.dsgn__livestatus {
  display: block;
  min-height: 1.1em;
  margin-top: 0.35rem;
  font-size: var(--text-label);
  color: var(--err, #b3432b);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .dsgn__livestatus { color: #8f3520; }
}
:root[data-theme="light"] .dsgn__livestatus { color: #8f3520; }
.dsgn__liveinline:empty { display: none; }
.dsgn__liveinline {
  flex: 0 0 100%;
  margin: 0.2rem 0 0;
  line-height: 1.4;
}
.dsgn__togglewrap {
  display: grid;
  gap: 0.15rem;
}
.dsgn__versions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}
.dsgn__verchips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.dsgn__verpair {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.dsgn__versel {
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: var(--text-meta);
  cursor: pointer;
}
.dsgn__versel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
/* Tick 151 UI review: the versions disclosure read as plain dim text — the
   JS inline display:flex killed the native ▸ marker, so nothing said
   "clickable". A chip + a CSS chevron (survives display:flex) fixes the
   affordance; the inline styles moved here. */
.dsgn__vermore > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  width: fit-content;
  margin: 0.35rem 0 0;
  padding: 0.32rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: var(--text-meta);
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.dsgn__vermore > summary::-webkit-details-marker {
  display: none;
}
.dsgn__vermore > summary::before {
  content: "▸";
  font-size: 0.85em;
  transition: transform 0.15s var(--ease);
}
.dsgn__vermore[open] > summary::before {
  transform: rotate(90deg);
}
.dsgn__vermore > summary:hover {
  border-color: var(--ink-3);
  background: var(--card-2);
}
.dsgn__vermore > summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}
/* Tick 81: per-thumb actions (Edit binds the gate to that version's exact
   options; Reimagine forks it into a fresh version) — the row replaces the
   old absolute version label inside each contact-sheet thumb. */
.dsgn__veractions {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.35rem 0.4rem;
  background: var(--card);
}
.dsgn__veractions i {
  font-style: normal;
  font-size: var(--text-micro);
  letter-spacing: 0.06em;
  color: var(--ink);
  margin-right: auto;
}
.dsgn__verbtn {
  padding: 0.22rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
  cursor: pointer;
}
.dsgn__verbtn:hover,
.dsgn__verbtn:focus-visible {
  border-color: var(--accent);
}
.dsgn__verbtn.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  color: var(--accent);
}
.dsgn__verthumb.is-bound {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
/* Tick 81: the gate panel bound to an old version — explain the mode and
   offer the way back. Full accent border (no side stripes): the banner is
   a mode switch, it should read as a frame, not a callout. */
.dsgn__bindbanner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.7rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  background: var(--card);
}
.dsgn__bindtext {
  flex: 1 1 16rem;
  font-size: var(--text-meta);
  line-height: 1.45;
}
.dsgn__forkbtn--save {
  border: 1px solid var(--accent);
}
.dsgn__forkbtn--save.is-dirty:not([disabled]) {
  --bg: var(--ochre);
  --fg: var(--ochre-ink);
}
.dsgn__forkbtn--save:disabled {
  border-color: var(--line-strong, var(--line));
}
/* Tick 81: the reimagine recovery button — dashed accent border reads as
   "branch off", distinct from the solid stay/build commits. */
.dsgn__forkbtn--reimagine {
  border: 1px dashed var(--accent);
  background: transparent;
  color: var(--accent);
}
.dsgn__forkbtn--reimagine:hover {
  background: var(--ink-ghost);
}
.dsgn__reimaginestatus {
  margin-top: 0.4rem;
}
.dsgn__tokens {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}
.dsgn__toktools {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}
.dsgn__tokswatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}
.dsgn__tokswatch {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 5.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: copy;
}
.dsgn__tokswatch:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.45rem;
}
.dsgn__tokswatch.is-copied code {
  color: var(--ok);
  font-weight: 700;
}
.dsgn__tokswatch i {
  height: 2rem;
  border-radius: 0.45rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
}
.dsgn__tokswatchname {
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}
.dsgn__tokswatch code {
  font-size: var(--text-label);
  opacity: 0.8;
}
.dsgn__tokswatch em {
  font-style: normal;
  font-size: var(--text-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ok);
}
.dsgn__tokrows {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.dsgn__tokrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.dsgn__tokname {
  flex: 0 0 11rem;
  font-size: var(--text-label);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.dsgn__tokval {
  font-size: var(--text-body);
  font-weight: 600;
}
.dsgn__tokdraft {
  font-size: var(--text-label);
  opacity: 0.55;
}
.dsgn__toktoggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.dsgn__toktoggle {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: var(--text-label);
}
.dsgn__toktoggle--on {
  border-color: color-mix(in oklab, var(--ok) 55%, var(--line));
  background: color-mix(in oklab, var(--ok) 10%, transparent);
}
.dsgn__toktoggle--off {
  opacity: 0.55;
}
.dsgn__toknote {
  margin: 0;
  font-size: var(--text-meta);
  opacity: 0.7;
}
.dsgn__audit {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}
.dsgn__audithead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.7rem;
}
.dsgn__grade {
  font-size: var(--text-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.dsgn__grade--good {
  color: var(--ok);
}
.dsgn__grade--mid {
  color: var(--terra);
}
.dsgn__grade--low {
  color: var(--danger);
}
.dsgn__auditmeta {
  font-size: var(--text-meta);
  opacity: 0.7;
}
.dsgn__trendwrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.4rem 0 0.5rem;
}
.dsgn__trend {
  width: 15rem;
  max-width: 60vw;
  height: auto;
  flex: none;
}
.dsgn__trendgrid {
  stroke: var(--line-soft, rgba(0, 0, 0, 0.08));
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.dsgn__trendline {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.dsgn__trenddot {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 2;
}
.dsgn__trenddot.is-latest {
  fill: var(--accent);
  stroke: var(--accent);
}
.dsgn__trendlabel {
  fill: var(--ink-faint);
  font-size: 8px;
}
.dsgn__trendlabel--value {
  fill: var(--ink);
  font-size: 9px;
  font-weight: 700;
}
.dsgn__trenddelta {
  font-size: var(--text-label);
  color: var(--ink-dim);
  white-space: nowrap;
}
.dsgn__finding {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.dsgn__fchips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.dsgn__fchip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.22rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
  cursor: pointer;
}
.dsgn__fchip:hover:not(:disabled),
.dsgn__fchip:focus-visible {
  border-color: var(--accent);
}
.dsgn__fchip.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  color: var(--accent);
}
.dsgn__fchip:disabled {
  opacity: 0.4;
  cursor: default;
}
.dsgn__fchip i {
  font-style: normal;
  font-size: var(--text-micro);
  opacity: 0.65;
}
.dsgn__sev {
  flex: 0 0 auto;
  margin-top: 0.1rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: var(--text-micro);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dsgn__sev--major {
  border-color: color-mix(in oklab, var(--danger) 55%, var(--line));
  color: var(--danger);
}
.dsgn__sev--minor {
  opacity: 0.7;
}
.dsgn__sev--pick {
  border-color: color-mix(in oklab, var(--accent) 55%, var(--line));
  color: var(--accent);
}
.dsgn__findingbody {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.dsgn__findingbody b {
  font-size: var(--text-meta);
}
.dsgn__surface {
  font-size: var(--text-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
}
.dsgn__evidence {
  font-size: var(--text-label);
  padding: 0.1rem 0.4rem;
  border-radius: 0.35rem;
  background: color-mix(in oklab, var(--ink) 6%, transparent);
  width: fit-content;
}
.dsgn__fix {
  font-size: var(--text-meta);
  opacity: 0.8;
}
.dsgn__overlay--split .dsgn__panes {
  flex: 1;
  display: flex;
  gap: 0.6rem;
  min-height: 0;
}
.dsgn__pane {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}
.dsgn__panelabel {
  font-size: var(--text-label);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: 0.75;
}
@media (max-width: 720px) {
  .dsgn__overlay--split .dsgn__panes {
    flex-direction: column;
  }
}
.dsgn__closednote {
  margin: 0 0 0.7rem;
  font-size: var(--text-body);
}
.dsgn__closedbtns {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.dsgn__closedhint {
  font-size: var(--text-meta);
  opacity: 0.65;
  margin: 0;
}


/* Studio empty-state specimens: a "made with this" row that teaches the
   design language by rendering it. Token-driven — recolour the theme and
   the specimens follow. */
.dsgn__empty {
  display: grid;
  gap: 1.1rem;
  padding: 0.4rem 0 1rem;
}
.dsgn__empty .pack-empty {
  margin: 0;
}
.dsgn__specimens {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 0.9rem;
}
.dsgn__specimen {
  margin: 0;
  display: grid;
  gap: 0.55rem;
  align-content: start;
  padding: 0.9rem 1rem 0.75rem;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
}
.dsgn__specimen figcaption {
  font-family: var(--display);
  font-size: var(--text-micro);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.dsgn__spec-type-lg {
  font-family: var(--display);
  font-weight: 900;
  font-size: var(--text-display);
  line-height: 1;
  letter-spacing: var(--display-track);
  color: var(--ink);
}
.dsgn__spec-type-md {
  font-family: var(--display);
  font-size: var(--text-body);
  line-height: 1.35;
  color: var(--ink-2);
  max-width: 24ch;
}
.dsgn__spec-type-sm {
  font-family: var(--display);
  font-size: var(--text-micro);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.dsgn__spec-chips {
  display: flex;
  gap: 0.4rem;
  align-items: flex-end;
  min-height: 1.9rem;
}
.dsgn__spec-chips i {
  display: block;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.dsgn__spec-chips i:nth-child(2) {
  width: 1.9rem;
  height: 1.9rem;
}
.dsgn__spec-chips i:nth-child(4) {
  width: 1.15rem;
  height: 1.15rem;
}
.dsgn__spec-card {
  display: grid;
  gap: 0.4rem;
  padding: 0.7rem 0.75rem;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  justify-items: start;
}
.dsgn__spec-card-bar {
  display: block;
  width: 34%;
  height: 0.5rem;
  border-radius: 3px;
  background: var(--fill);
}
.dsgn__spec-card-line {
  display: block;
  width: 100%;
  height: 0.3rem;
  border-radius: 2px;
  background: var(--line);
}
.dsgn__spec-card-line.short {
  width: 62%;
}
.dsgn__spec-card-btn {
  margin-top: 0.15rem;
  padding: 0.28rem 0.7rem;
  border-radius: calc(var(--radius) - 4px);
  background: var(--ochre);
  color: var(--ochre-ink);
  font-family: var(--display);
  font-size: var(--text-micro);
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}


/* Hub resume rail — recent projects + pending decisions, FIRST. The rail
   is the answer to "what was I doing": decisions (amber, action-needed)
   outrank the neutral project chips. Token-driven like everything else. */
.hubresume {
  display: grid;
  gap: 0.7rem;
  margin: 0 0 1.1rem;
}
.hubresume__decs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.7rem;
}
.hubdec {
  display: grid;
  gap: 0.3rem;
  justify-items: start;
  text-align: left;
  padding: 0.8rem 1rem;
  background: var(--caution-bg);
  color: var(--caution-ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.12s var(--ease), filter 0.2s var(--ease);
}
.hubdec:hover {
  filter: brightness(1.03);
  transform: translateY(-1px);
}
.hubdec--design {
  background: var(--notice-bg);
  color: var(--notice-ink);
}
.hubdec__kick {
  font-family: var(--display);
  font-size: var(--text-micro);
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
}
.hubdec b {
  font-family: var(--display);
  font-size: var(--text-body);
  font-weight: 700;
  line-height: 1.25;
}
.hubdec__act {
  font-family: var(--display);
  font-size: var(--text-label);
  font-weight: 800;
  letter-spacing: 0.06em;
}
.hubresume__row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
}
.hubresume__chip {
  display: grid;
  gap: 0.25rem;
  justify-items: start;
  text-align: left;
  padding: 0.7rem 0.9rem;
  background: var(--card);
  color: var(--ink);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.12s var(--ease), border-color 0.2s var(--ease);
}
.hubresume__chip:hover {
  border-color: var(--ink-3);
  transform: translateY(-1px);
}
.hubresume__chip b {
  font-family: var(--display);
  font-size: var(--text-meta);
  font-weight: 700;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hubresume__chip span {
  font-size: var(--text-label);
  color: var(--ink-3);
}


/* Design → code bridge sheet: the hand-off dialog. A dim scrim under a
   regular panel — the design system's own chrome, because the sheet IS the
   product voice. */
.dsgn__bridge {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: color-mix(in srgb, var(--room) 62%, transparent);
}
.dsgn__bridgepanel {
  width: min(34rem, 100%);
  box-shadow: var(--shadow);
}
.dsgn__bridgelede {
  margin: 0 0 0.8rem;
  font-size: var(--text-meta);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 58ch;
}
.dsgn__bridgebtns {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 0.9rem;
}

/* Full-style gallery — a live specimen and compact thumbnails, not another
   strip of tint-only chips. The large stage changes on hover/focus; selection
   is always a separate explicit action. */
.dsgn-styles {
  display: grid;
  gap: 0.85rem;
  margin: 1rem 0;
  padding: 1rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.dsgn-styles__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}
.dsgn-styles__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.dsgn-styles__body {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
  gap: 1.2rem;
}
.dsgn-styles__stage {
  position: sticky;
  top: 1rem;
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  margin: 0;
}
.dsgn-styles__large {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.75rem;
  background: var(--card);
}
.dsgn-styles__large svg,
.dsgn-styles__mini svg {
  display: block;
  width: 100%;
  height: 100%;
}
.dsgn-styles__caption {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}
.dsgn-styles__caption h3,
.dsgn-styles__caption p {
  margin: 0;
}
.dsgn-styles__caption h3 {
  font-size: 1.35rem;
  line-height: 1.15;
}
.dsgn-styles__family {
  color: var(--ink-3);
  font-size: var(--text-micro);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.dsgn-styles__tagline {
  color: var(--ink-2);
  font-size: var(--text-body);
}
.dsgn-styles__palette {
  display: flex;
  gap: 0.35rem;
}
.dsgn-styles__palette i {
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.dsgn-styles__doctrine {
  max-width: 62ch;
  color: var(--ink-3);
  font-size: var(--text-label);
  line-height: 1.55;
}
.dsgn-styles__choices {
  display: grid;
  gap: 0.7rem;
  min-width: 0;
}
.dsgn-styles__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.55rem;
}
.dsgn-styles__thumb {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease);
}
.dsgn-styles__thumb:hover,
.dsgn-styles__thumb:focus-visible {
  z-index: 1;
  border-color: var(--accent);
  transform: translateY(-2px);
}
.dsgn-styles__thumb:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.dsgn-styles__thumb.is-on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.dsgn-styles__mini {
  overflow: hidden;
  width: 100%;
  aspect-ratio: 8 / 5;
  border-radius: 0.3rem;
  pointer-events: none;
}
.dsgn-styles__name {
  overflow: hidden;
  padding: 0 0.2rem 0.2rem;
  font-size: var(--text-label);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dsgn-styles__thumb.is-fit {
  position: relative;
}
.dsgn-styles__fit {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  background: var(--accent);
  color: var(--bg);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
}
/* Suits the imported site's own pictures: a quiet line under the name (the
   reason rides in the title and on the stage caption), never a second loud
   pill beside "Fits brief". Static: no motion of its own. */
.dsgn-styles__suits {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  margin-top: -0.25rem;
  padding: 0 0.2rem 0.2rem;
  overflow: hidden;
  color: var(--ink-3);
  font-size: var(--text-micro, 0.68rem);
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.dsgn-styles__suits::before {
  content: "";
  flex: none;
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--accent);
}
.dsgn-styles__suitsline {
  color: var(--ink-2);
  font-size: var(--text-label);
  line-height: 1.45;
}
.dsgn-styles__suitsline b {
  color: var(--ink);
  font-weight: 700;
}
.dsgn-styles__more {
  justify-self: start;
}
.dsgn-styles__foot {
  min-height: 1.2em;
}
/* Motion beside the full style: a 3D scene and a page change, picked before
   the design exists and played on a small specimen (design_inspire.js). */
.dsgn-motion {
  margin-top: 0.4rem;
  padding-top: 0.7rem;
  border-top: 1px solid var(--line);
}
.dsgn-motion > summary {
  display: flex;
  align-items: center;
  min-height: 2rem;
  color: var(--ink);
  font-size: var(--text-small, 0.85rem);
  cursor: pointer;
  list-style: none;
}
.dsgn-motion > summary::-webkit-details-marker { display: none; }
.dsgn-motion > summary::before { content: "▸"; margin-right: 0.45rem; color: var(--ink-3); }
.dsgn-motion[open] > summary::before { content: "▾"; }
.dsgn-motion > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dsgn-motion__body {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  align-items: start;
  gap: 1.2rem;
  margin-top: 0.6rem;
}
.dsgn-motion__stage {
  overflow: hidden;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  aspect-ratio: 16 / 10;
}
.dsgn-motion__frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.dsgn-motion__rows { min-width: 0; margin-top: 0; }
.dsgn-motion__panel { min-width: 0; }
@media (min-width: 1051px) {
  /* The specimen stays in view while the layers are tuned. */
  .dsgn-motion__stage { position: sticky; top: 4.5rem; }
}
.dsgn-motion__rows > .dsgn__styleforktophead:first-child { margin-top: 0; }
.dsgn-motion__status { margin: 0.5rem 0 0; }
.dsgn-styles__surprise { margin-left: auto; white-space: nowrap; }
@media (max-width: 1050px) {
  .dsgn-motion__body { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; }
  .dsgn-motion__stage { max-width: 34rem; }
}
@media (max-width: 640px), (pointer: coarse) {
  .dsgn-motion > summary { min-height: 2.75rem; }
}
@media (max-width: 640px) {
  .dsgn-motion__stage { aspect-ratio: 4 / 3; }
}
.dsgn__gridmore {
  grid-column: 1 / -1;
  justify-self: start;
}
@media (max-width: 1050px) {
  .dsgn-styles__body { grid-template-columns: 1fr; }
  .dsgn-styles__stage { position: static; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); align-items: center; }
  .dsgn-styles__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .dsgn-styles__stage { grid-template-columns: 1fr; }
  .dsgn-styles__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dsgn-styles__doctrine { display: none; }
  .dsgn-styles__head { align-items: flex-start; }
}

/* ---- design studio: the designer at work ------------------------------- */
.dsgn-work {
  position: relative;
  display: grid;
  /* Row 1 is the live mockup at full width; the geo + ticker band takes the
     row beneath the token strip. */
  grid-template-columns: auto minmax(0, 1fr);
  gap: 18px 22px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in oklab, var(--card, var(--paper)) 70%, transparent);
  overflow: hidden;
  min-width: 0;
}
.dsgn-geo {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 30px);
  grid-auto-rows: 30px;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 12px 12px;
  overflow: hidden;
}
.dsgn-geo__cell {
  --c: var(--accent);
  display: block;
  background: var(--c);
  transform-origin: 50% 50%;
  animation: dsgn-geo 4.8s cubic-bezier(.7, 0, .2, 1) infinite;
  animation-delay: calc(var(--i) * 0.4s);
  transition: background-color 0.6s;
}
.dsgn-geo__cell--circ { border-radius: 50%; }
.dsgn-geo__cell--tri { clip-path: polygon(0 100%, 50% 0, 100% 100%); }
.dsgn-geo__cell--quart { border-radius: 100% 0 0 0; }
.dsgn-geo__cell--bar { clip-path: inset(36% 0 36% 0); }
.dsgn-geo__cell--ring { background: none; border: 6px solid var(--c); border-radius: 50%; }
@keyframes dsgn-geo {
  0% { transform: scale(0) rotate(-90deg); opacity: 0; }
  14% { transform: scale(1) rotate(0); opacity: 1; }
  62% { transform: scale(1) rotate(0); opacity: 1; }
  78% { transform: scale(0.2) rotate(90deg); opacity: 0; }
  100% { transform: scale(0) rotate(90deg); opacity: 0; }
}
.dsgn-geo__scan {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: dsgn-scan 2.4s linear infinite;
}
@keyframes dsgn-scan {
  from { transform: translateX(0); }
  to { transform: translateX(150px); }
}
.dsgn-work__side { min-width: 0; display: grid; align-content: start; gap: 8px; }
/* The wait view's progress bar: full width above the live draft. */
.dsgn-prog { grid-column: 1 / -1; display: grid; gap: 6px; min-width: 0; }
.dsgn-prog__row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; min-width: 0; }
.dsgn-prog__text { min-width: 0; color: var(--ink-2); font-size: var(--text-meta); overflow-wrap: anywhere; }
.dsgn-prog__pct { flex: none; color: var(--ink); font-size: var(--text-title); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.dsgn-prog__track { position: relative; height: 8px; border-radius: 999px; background: color-mix(in oklab, var(--ink) 12%, transparent); overflow: hidden; }
.dsgn-prog__fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; background: var(--ochre); transition: width 0.9s var(--ease); }
@media (prefers-reduced-motion: reduce) {
  .dsgn-prog__fill { transition: none; }
}
.dsgn-work__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.dsgn-work__stage { font-size: var(--text-body); }
.dsgn-work__clock { font: 400 0.74rem var(--f-code); opacity: 0.6; font-variant-numeric: tabular-nums; }
.dsgn-work__ticker {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 3px;
  font: 400 0.8rem/1.45 var(--f-code);
  max-height: 9.6em;
  overflow: hidden;
  -webkit-mask: linear-gradient(transparent, #000 30%);
  mask: linear-gradient(transparent, #000 30%);
}
.dsgn-work__line { display: flex; justify-content: space-between; gap: 12px; opacity: 0.72; min-width: 0; }
.dsgn-work__line > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dsgn-work__line time { opacity: 0.6; flex: none; }
/* Clock time, then the seconds the step took: fixed-width figures so the
   column does not jitter as lines arrive. */
.dsgn-work__line > .dsgn-work__times { flex: none; overflow: visible; display: inline-flex; gap: 8px; font: 400 0.72rem var(--f-code); font-variant-numeric: tabular-nums; }
.dsgn-work__took { min-width: 3.2em; text-align: right; opacity: 0.9; }
.dsgn-work__line:nth-last-child(2) { opacity: 1; }
.dsgn-work__line.is-new { animation: dsgn-line-in 0.5s cubic-bezier(.2, .7, .2, 1); }
@keyframes dsgn-line-in {
  from { transform: translateY(0.9em); opacity: 0; }
  to { transform: none; }
}
.dsgn-work__now { height: 1.2em; }
.dsgn-work__caret { display: inline-block; width: 0.55em; height: 1em; vertical-align: -0.12em; background: var(--accent); animation: dsgn-caret 1s steps(1) infinite; }
@keyframes dsgn-caret { 50% { opacity: 0; } }
.dsgn-work__marquee {
  grid-column: 1 / -1;
  overflow: hidden;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.dsgn-work__track { display: flex; width: max-content; animation: dsgn-marquee var(--dur, 30s) linear infinite; }
.dsgn-work__run { display: flex; flex: none; }
.dsgn-work__run > span {
  padding: 0 14px;
  font: 500 0.7rem var(--f-code);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.7;
}
.dsgn-work__run > span::after { content: "\25C6"; margin-left: 28px; opacity: 0.35; font-size: 0.6em; vertical-align: 0.2em; }
@keyframes dsgn-marquee { to { transform: translateX(-50%); } }
@media (max-width: 34rem) {
  .dsgn-work { grid-template-columns: minmax(0, 1fr); }
  .dsgn-geo { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .dsgn-geo__cell, .dsgn-geo__scan, .dsgn-work__track, .dsgn-work__caret, .dsgn-work__line.is-new { animation: none; }
  .dsgn-geo__scan { display: none; }
  .dsgn-work__track { flex-wrap: wrap; width: auto; }
}
.dsgn-stall {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid color-mix(in oklab, var(--terra, #b5552b) 45%, var(--line));
  border-left-width: 4px;
  border-radius: 8px;
  display: grid;
  gap: 6px;
}
.dsgn-stall__title { font-size: var(--text-body); }
.dsgn-stall__msg { margin: 0; font-size: var(--text-meta); opacity: 0.8; overflow-wrap: anywhere; }
.dsgn-stall__row { margin-top: 4px; }
.dsgn__dot--stopped { background: none; border: 2px solid var(--terra, #b5552b); }

/* ---- design studio: the live draft -------------------------------------- */
.dsgn-live { grid-column: 1 / -1; display: grid; gap: 8px; min-width: 0; }
.dsgn-live { grid-column: 1 / -1; }
.dsgn-live__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.dsgn-live__meta { font: 400 0.74rem var(--f-code); opacity: 0.6; font-variant-numeric: tabular-nums; }
.dsgn-live__grew { font: 600 0.74rem var(--f-code); color: var(--ok, var(--accent)); opacity: 0; }
.dsgn-live__grew.is-flash { animation: dsgn-grew 2.4s ease-out; }
@keyframes dsgn-grew { 0% { opacity: 0; transform: translateY(4px); } 12% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; } }
.dsgn-live__stage {
  --scale: 0.5;
  position: relative;
  width: 100%;
  /* Taller hero: 16/9.5 (was 16/10) with a 640 cap — at full panel width the
     stage shows markedly more of the page than the old side-column layout. */
  aspect-ratio: 16 / 9.5;
  max-height: 640px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper, #fff);
}
.dsgn-live__frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 1280px;
  max-width: none;
  height: calc(100% / var(--scale));
  border: 0;
  transform: scale(var(--scale));
  transform-origin: 0 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.dsgn-live__frame.is-front { opacity: 1; z-index: 1; }
.dsgn-live__frame.is-in { animation: dsgn-wipe 1.1s cubic-bezier(.6, 0, .2, 1); }
@keyframes dsgn-wipe { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
/* the "a piece just landed" sweep — crosses the stage in step with the wipe */
.dsgn-live__sweep {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  z-index: 4;
  pointer-events: none;
  transform: translateX(-101%);
  background: linear-gradient(90deg, transparent, var(--accent) 30%, var(--accent) 70%, transparent);
  opacity: 0.9;
}
.dsgn-live__sweep.is-run { animation: dsgn-live-sweep 1.05s cubic-bezier(.3, 0, .2, 1); }
/* the landing glow: the frame flashes an inset accent ring as a piece lands */
.dsgn-live__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px var(--accent);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}
.dsgn-live__stage.is-land::after { animation: dsgn-land-glow 1.1s ease-out; }
@keyframes dsgn-land-glow { 0% { opacity: 0.85; } 100% { opacity: 0; } }
@keyframes dsgn-live-sweep { from { transform: translateX(-101%); } to { transform: translateX(101%); } }
/* the wireframe sketch: blocks draw in, hold, and redraw */
.dsgn-sketch {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: 8% 30% 5% 5% 7% 1fr 7%;
  gap: 3% 2.4%;
  padding: 4% 5%;
  background-color: var(--paper, #fff);
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  transition: opacity 0.6s;
}
.dsgn-sketch.is-hidden { opacity: 0; pointer-events: none; }
.dsgn-sketch__b {
  display: block;
  border: 1.5px solid color-mix(in oklab, var(--accent) 70%, transparent);
  border-radius: 4px;
  background: color-mix(in oklab, var(--accent) 10%, transparent);
  transform-origin: 0 50%;
  animation: dsgn-sketch 6s cubic-bezier(.6, 0, .2, 1) infinite;
}
.dsgn-sketch__nav { grid-column: 1 / -1; grid-row: 1; animation-delay: 0s; }
.dsgn-sketch__hero { grid-column: 1 / 8; grid-row: 2; animation-delay: 0.35s; }
.dsgn-sketch__l1 { grid-column: 1 / 7; grid-row: 3; animation-delay: 0.7s; }
.dsgn-sketch__l2 { grid-column: 1 / 5; grid-row: 4; animation-delay: 0.85s; }
.dsgn-sketch__btn { grid-column: 1 / 3; grid-row: 5; border-radius: 99px; animation-delay: 1.05s; background: color-mix(in oklab, var(--accent) 35%, transparent); }
.dsgn-sketch__c1 { grid-column: 1 / 5; grid-row: 6; animation-delay: 1.4s; }
.dsgn-sketch__c2 { grid-column: 5 / 9; grid-row: 6; animation-delay: 1.6s; }
.dsgn-sketch__c3 { grid-column: 9 / 13; grid-row: 6; animation-delay: 1.8s; }
.dsgn-sketch__foot { grid-column: 1 / -1; grid-row: 7; animation-delay: 2.1s; }
.dsgn-sketch::after {
  content: "";
  grid-column: 8 / 13;
  grid-row: 2 / 6;
  border-radius: 50%;
  border: 1.5px dashed color-mix(in oklab, var(--ink) 30%, transparent);
  animation: dsgn-spin 14s linear infinite;
}
@keyframes dsgn-sketch {
  0% { transform: scaleX(0); opacity: 0; }
  12% { transform: scaleX(1); opacity: 1; }
  78% { transform: scaleX(1); opacity: 1; }
  92%, 100% { transform: scaleX(1); opacity: 0; }
}
@keyframes dsgn-spin { to { transform: rotate(360deg); } }
.dsgn-live__quiet { display: flex; align-items: center; gap: 10px; font: 400 0.78rem/1.4 var(--f-code); opacity: 0.75; min-width: 0; }
.dsgn-live__quiet > span:last-child { overflow-wrap: anywhere; }
.dsgn-live__bars { display: inline-flex; gap: 3px; flex: none; }
.dsgn-live__bars i { width: 4px; height: 12px; border-radius: 2px; background: var(--accent); opacity: 0.35; }
.dsgn-live__quiet.is-busy .dsgn-live__bars i { animation: dsgn-bars 1.1s ease-in-out infinite; }
.dsgn-live__bars i:nth-child(2) { animation-delay: 0.15s; }
.dsgn-live__bars i:nth-child(3) { animation-delay: 0.3s; }
@keyframes dsgn-bars { 0%, 100% { transform: scaleY(0.5); opacity: 0.35; } 50% { transform: scaleY(1.2); opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .dsgn-sketch__b, .dsgn-sketch::after, .dsgn-live__frame.is-in, .dsgn-live__quiet.is-busy .dsgn-live__bars i, .dsgn-live__grew.is-flash, .dsgn-live__sweep.is-run, .dsgn-live__stage.is-land::after, .dsgn__stage.is-shift .dsgn__dot, .dsgn__dot--running { animation: none; }
  .dsgn-live__grew { opacity: 1; }
}

/* ---- Design Studio streamline pass (2026-11-11) --------------------------
   One primary action per screen, next to the thing it acts on. */
/* The brief's action row sits directly under the brief and pins to the top
   of the viewport while the optional menus (styles, rail, uploads) scroll —
   picking a style a screen down never strands the Start button. Opaque so
   the gallery never shows through; sticky is scoped to the New design
   panel body, so it lets go once that panel scrolls away. */
.dsgn__go {
  position: sticky;
  top: 0;
  z-index: 6;
  margin: 0.6rem 0 0.2rem;
  padding: 0.5rem 0.6rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 0 0 8px 8px;
  box-shadow: 0 6px 14px -10px rgba(0, 0, 0, 0.55);
}
/* Phone: both actions on ONE row — a two-row pinned bar ate 110px of a
   390x844 screen. Start takes the slack; the labels tighten to fit. */
@media (max-width: 720px) {
  .dsgn__go { gap: 0.4rem; padding: 0.4rem; }
  .dsgn__go .btn { padding-inline: 0.6rem; letter-spacing: 0.02em; white-space: nowrap; min-width: 0; }
  .dsgn__go .dsgn__start { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; }
}
/* SW-1 wraps the page under a display strip that already carries the
   eyebrow + title; the sheet's own copy repeated both one line below.
   Kept in the DOM for the outline, out of the picture. */
.sw-page > .report.sw-wrapped .dsgn__pagehead .eyebrow,
.sw-page > .report.sw-wrapped .dsgn__pagehead .report__title {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.dsgn__pagehead .hero__tagline {
  max-width: 68ch;
  margin-top: 0 !important;
  font-weight: 500;
  text-wrap: pretty;
}
/* Phone: the run-price aside is nowrap and used to squeeze the lede into a
   four-word column beside it — stack them. */
@media (max-width: 720px) {
  .dsgn__pagehead { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  .dsgn__pagehead-side { padding-bottom: 0; }
}
@media (pointer: coarse) {
  .dsgn__kbdhint { display: none; }
}
/* Project page: the way back to the list (SW-1's frame() strips .back-link). */
.dsgn__back { margin-bottom: 0.4rem; }

/* ---- Design Studio phone editor pass (2026-11-11) ------------------------ */
/* Live editing means SEEING the edit: the half/full sheet used to dim the
   very mockup the picks were changing. The scrim stays as the tap-to-collapse
   target, just clear. */
.dsgn__overlay--edit .dsgn-lab__scrim {
  background: transparent;
}
@media (max-width: 60rem) {
  /* The page behind showed through the bar (a bright link sat under the
     overlay title). */
  .dsgn__overlay {
    background: var(--ink);
  }
}
@media (max-width: 60rem) and (pointer: coarse) {
  /* The ×0.38 bench is a tap target into the editor, not a tiny browser. */
  .dsgn__benchclip { cursor: pointer; }
  .dsgn__benchclip .dsgn__mock { pointer-events: none; }
  .dsgn-lab__deckfoot:not(:empty) { padding: 0.5rem 0.9rem; }
  .dsgn-lab__done { width: 100%; min-height: 2.9rem; }
}
/* The pinned Start bar must not sit on a step's heading when a step is
   scrolled to. */
.dsgn__step {
  scroll-margin-top: 5rem;
}
/* The editor paints itself inside its host of the same class; in the card
   the inner one must take the card's width, not its own content's. */
.dsgn__matcard .dsgn__refeditor .dsgn__refeditor {
  flex: 1 1 100%;
  min-width: 0;
  max-width: 100%;
}
.dsgn__matcard .dsgn__refinput {
  flex: 1 1 100%;
  min-width: 0;
}

/* ---- The new-design page: the step map in the pinned bar ---- */
.dsgn__go {
  justify-content: space-between;
  gap: 0.6rem;
  animation: none;
}
.dsgn__gobtns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}
.dsgn__stepnav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.dsgn__stepnav::-webkit-scrollbar {
  display: none;
}
.dsgn__stepchip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
  min-height: 2.25rem;
  padding: 0.2rem 0.6rem 0.2rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 99px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
  cursor: pointer;
  opacity: 0.62;
  transition: opacity 120ms ease, border-color 120ms ease;
}
.dsgn__stepchip:hover,
.dsgn__stepchip:focus-visible {
  opacity: 1;
  border-color: var(--line);
}
.dsgn__stepchipnum {
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  font-family: var(--mono, ui-monospace, monospace);
  font-size: 0.72rem;
  font-weight: 700;
}
.dsgn__stepchip.is-done {
  opacity: 0.9;
}
.dsgn__stepchip.is-done .dsgn__stepchipnum {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--card);
}
.dsgn__stepchip.is-here {
  opacity: 1;
  border-color: var(--accent);
}
/* The brief's own readout: one quiet line until opened. */
.dsgn__recipe > summary {
  cursor: pointer;
  list-style: none;
}
.dsgn__recipe > summary::-webkit-details-marker {
  display: none;
}
.dsgn__recipe > summary .dsgn__hint:first-child::before {
  content: "\25B8  ";
}
.dsgn__recipe[open] > summary .dsgn__hint:first-child::before {
  content: "\25BE  ";
}
.dsgn__recipe:not([open]) {
  border-color: transparent;
  background: transparent;
  padding-inline: 0;
}
/* Your designs, leading the page: one row. */
.dsgn__yours--top {
  margin-bottom: 1.2rem;
}
.dsgn__yours .panel__head {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}
@media (max-width: 44rem) {
  .dsgn__stepchipname {
    display: none;
  }
  .dsgn__stepchip {
    padding: 0.2rem 0.25rem;
    min-width: 2.25rem;
    justify-content: center;
  }
  .dsgn__stepchip.is-here .dsgn__stepchipname {
    display: inline;
    padding-right: 0.35rem;
  }
  .dsgn__go {
    flex-wrap: wrap;
  }
  .dsgn__gobtns {
    flex: 1 1 100%;
  }
  /* On a phone the shelf is one swipeable row, not three screens of cards
     above the brief. The row scrolls inside itself; the page does not. */
  .dsgn__yours--top .dsgn__grid {
    display: flex;
    overflow-x: auto;
    gap: 0.6rem;
    scroll-snap-type: x proximity;
    padding-bottom: 0.3rem;
  }
  .dsgn__yours--top .dsgn__grid > .dsgn__card {
    flex: 0 0 68%;
    min-width: 0;
    scroll-snap-align: start;
  }
  .dsgn__yours--top .dsgn__grid > .dsgn__gridmore {
    flex: 0 0 auto;
    align-self: center;
  }
}
/* The pinned bar is two rows on a phone; a step scrolled to must clear it. */
@media (max-width: 44rem) {
  .dsgn__step,
  .dsgn__stephead {
    scroll-margin-top: 7.5rem;
  }
}
.dsgn__stephead {
  scroll-margin-top: 5rem;
}

/* ---- Sound packs: one closed line under the brief; open, the packs that suit
   the chosen style come first, then the whole catalog by material. Each pack
   is a name (pick) and a play button (hear it without picking). */
.dsgn__snd {
  margin-top: 0.6rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-width: 0;
}
.dsgn__sndsum {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  min-height: 44px;
  box-sizing: border-box;
  cursor: pointer;
  font-size: var(--text-label);
  list-style: none;
}
.dsgn__sndsum::-webkit-details-marker { display: none; }
.dsgn__sndsum::after {
  content: "+";
  margin-left: auto;
  color: var(--ink-3);
}
.dsgn__snd[open] > .dsgn__sndsum::after { content: "\2212"; }
.dsgn__sndhint { color: var(--ink-3); }
.dsgn__sndbody {
  padding: 0 0.75rem 0.75rem;
  max-height: min(60vh, 26rem);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dsgn__sndnote {
  margin: 0 0 0.5rem;
  color: var(--ink-2);
  font-size: var(--text-label);
}
.dsgn__sndstatus { color: var(--ink-3); }
.dsgn__sndgroup { margin-top: 0.6rem; }
.dsgn__sndfam {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--ink-3);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.dsgn__sndrow {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.dsgn__sndchip {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  max-width: 100%;
}
.dsgn__sndchip.is-on {
  border-color: var(--brass);
  background: color-mix(in oklab, var(--brass) 10%, transparent);
}
.dsgn__sndpick,
.dsgn__sndplay {
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: var(--text-label);
  cursor: pointer;
  min-height: 36px;
}
.dsgn__sndpick { padding: 0.25rem 0.35rem 0.25rem 0.75rem; }
.dsgn__sndchip.is-on .dsgn__sndpick { font-weight: 600; }
.dsgn__sndplay {
  padding: 0.25rem 0.7rem 0.25rem 0.5rem;
  color: var(--ink-3);
  font-size: 10px;
  border-left: 1px solid var(--line);
}
.dsgn__sndpick:hover,
.dsgn__sndplay:hover { background: color-mix(in oklab, var(--brass) 14%, transparent); color: var(--ink); }
.dsgn__sndpick:focus-visible,
.dsgn__sndplay:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: -2px;
}
@media (max-width: 640px) {
  .dsgn__sndpick,
  .dsgn__sndplay { min-height: 44px; }
  .dsgn__sndplay { padding-right: 0.9rem; padding-left: 0.7rem; }
}

/* ---- "You can leave this page": shown in the Studio while a version is made. */
.dsgn__leave {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
  margin-top: 0.6rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: var(--text-label);
  color: var(--ink-2);
  min-width: 0;
}
.dsgn__leave[hidden] { display: none; }
.dsgn__leavetext { flex: 1 1 16rem; min-width: 0; }
.dsgn__leavebtn {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  padding: 0.3rem 0.8rem;
  min-height: 36px;
  cursor: pointer;
}
.dsgn__leavebtn[hidden] { display: none; }
.dsgn__leavebtn:hover,
.dsgn__leavebtn:focus-visible { border-color: var(--brass); outline: 2px solid var(--brass); outline-offset: 1px; }
@media (max-width: 640px) {
  .dsgn__leavebtn { min-height: 44px; }
}

/* ---- "Your design is ready": the note that calls you back from any screen. */
.dsgn-toast {
  position: fixed;
  z-index: 1200;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: max-content;
  max-width: min(34rem, calc(100vw - 32px));
  box-sizing: border-box;
  padding: 0.6rem 0.6rem 0.6rem 0.9rem;
  border: 1px solid var(--brass);
  border-radius: 14px;
  background: var(--card-2, var(--card));
  color: var(--ink);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  font-size: var(--text-label);
  animation: dsgn-toast-in 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.dsgn-toast--failed { border-color: var(--line); }
.dsgn-toast__text { display: flex; flex-direction: column; min-width: 0; }
.dsgn-toast__text span {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dsgn-toast__open {
  flex: none;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--card-2, var(--card));
  font: inherit;
  font-weight: 600;
  padding: 0.4rem 0.9rem;
  min-height: 40px;
  cursor: pointer;
}
.dsgn-toast__close {
  flex: none;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 18px;
  line-height: 1;
  width: 40px;
  height: 40px;
  cursor: pointer;
}
.dsgn-toast__open:focus-visible,
.dsgn-toast__close:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
@keyframes dsgn-toast-in {
  from { opacity: 0; transform: translate(-50%, -10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .dsgn-toast { animation: none; }
}

/* ---- A change in flight: a moving bar, a clock, and what is happening. */
.dsgn__revprog {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 100%;
  margin-top: 0.5rem;
  font-size: var(--text-label);
  color: var(--ink-2);
  min-width: 0;
}
.dsgn__revbar {
  position: relative;
  height: 3px;
  border-radius: 999px;
  background: var(--track, var(--line));
  overflow: hidden;
}
.dsgn__revbar i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -40%;
  width: 40%;
  border-radius: inherit;
  background: var(--brass);
  animation: dsgn-revbar 1.6s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
.dsgn__revprog.is-done .dsgn__revbar i { animation: none; left: 0; width: 100%; }
.dsgn__revprog.is-done { color: var(--ink); }
@keyframes dsgn-revbar {
  from { left: -40%; }
  to { left: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .dsgn__revbar i { animation: none; left: 0; width: 100%; opacity: 0.5; }
}

/* ---- Options this mockup draws all the same: out of the list, behind one line. */
.dsgn__dim.is-flat { display: none; }
.dsgn__picker.show-flat .dsgn__dim.is-flat { display: block; opacity: 0.7; }
.dsgn__variant.is-same { opacity: 0.55; border-style: dashed; }
.dsgn__flatnote {
  display: block;
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.5rem 0.7rem;
  min-height: 44px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-label);
  text-align: left;
  cursor: pointer;
}
.dsgn__flatnote:hover,
.dsgn__flatnote:focus-visible { border-color: var(--brass); color: var(--ink); outline: none; }

/* Export sits with the fork buttons but is not a fork: quieter, never the
   widest thing in the row, full width on a phone like its neighbours. */
.dsgn__forkbtn--export {
  background: transparent;
  border: 1px dashed var(--line-strong, currentColor);
  color: inherit;
  opacity: 0.9;
}
.dsgn__forkbtn--export:hover { opacity: 1; }
.dsgn__forkbtn--export:disabled { opacity: 0.55; }

/* What the readability guard did to the preview: one quiet line under the
   mockup, wrapping on a phone. */
.dsgn__readnote {
  margin: 6px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  opacity: 0.78;
  overflow-wrap: anywhere;
}

/* ---- Your designs: search, order, and rename / duplicate / delete on a card */
.dsgn__gridtools {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.dsgn__gridtools[hidden] {
  display: none;
}
.dsgn__gridfind,
.dsgn__gridsort {
  min-width: 0;
  height: 2.5rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: 16px;
}
.dsgn__gridfind {
  flex: 1 1 12rem;
}
.dsgn__gridsort {
  flex: none;
}
.dsgn__gridfind:focus-visible,
.dsgn__gridsort:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.dsgn__gridnone {
  grid-column: 1 / -1;
}
.dsgn__card {
  position: relative;
}
.dsgn__cardtools {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  z-index: 2;
}
/* On a touch screen the menu button is always showing: the card's first line
   gives it room instead of running under it. */
@media (hover: none), (pointer: coarse) {
  .dsgn__card:not(:has(.dsgn__thumb)) > .dsgn__cardgoal {
    padding-right: 2.9rem;
  }
}
.dsgn__cardmore {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.92;
}
@media (hover: hover) and (pointer: fine) {
  .dsgn__cardmore {
    width: 2rem;
    height: 2rem;
    opacity: 0;
  }
  .dsgn__card:hover .dsgn__cardmore,
  .dsgn__card:focus-within .dsgn__cardmore,
  .dsgn__cardmore[aria-expanded="true"] {
    opacity: 1;
  }
}
.dsgn__cardmore:focus-visible,
.dsgn__cardact:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.dsgn__cardmenu {
  position: absolute;
  top: calc(100% + 0.3rem);
  right: 0;
  display: flex;
  flex-direction: column;
  min-width: 12.5rem;
  max-width: calc(100vw - 2rem);
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: var(--card);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  white-space: nowrap;
}
.dsgn__cardmenu[hidden] {
  display: none;
}
.dsgn__cardact {
  min-height: 2.75rem;
  padding: 0 0.7rem;
  border: 0;
  border-radius: 0.4rem;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.dsgn__cardact:hover {
  background: color-mix(in srgb, currentColor 9%, transparent);
}
.dsgn__cardact--bad {
  color: var(--bad, #c0392b);
}
.dsgn__cardact.is-armed {
  background: var(--bad, #c0392b);
  color: #fff;
  font-weight: 700;
}
.dsgn__cardrename {
  width: 100%;
  min-width: 0;
  height: 2.5rem;
  padding: 0 0.5rem;
  border: 1px solid var(--accent);
  border-radius: 0.4rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 16px;
}
.dsgn__cardmeta--bad {
  color: var(--bad, #c0392b);
  opacity: 1;
}

/* Touch floor (owner, 2026-11-16: "ensure that the buttons are actually
   usable"). On a touch screen every control here is at least 44px each way,
   measured on every screen by e2e/mobile.spec.mjs. */
@media (pointer: coarse) {
  .rp-tile,
  .dsgn__stepchip,
  .dsgn__sugginput {
    min-height: 44px;
  }
  .dsgn__stepchip {
    min-width: 44px;
  }
  /* 16px or more: a phone zooms the whole page into a smaller field. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  select,
  textarea {
    font-size: max(16px, 1em) !important;
  }
}

/* ── Motion panel (motion_panel.js) ─────────────────────────────────────────
   One compact row per layer a page has: amount, background shader, hero 3D
   scene, FX, page change, element motion. A row shows what is on (or a plain
   "Off"); opening it shows that layer's picker. */
.mp { display: grid; gap: 0.6rem; min-width: 0; }
.mp__head { display: grid; gap: 0.4rem; }
.mp__headrow { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.mp__eyebrow { color: var(--ink-3); font-size: var(--text-micro); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.mp__tools { display: inline-flex; gap: 0.3rem; }
.mp__tool {
  min-height: var(--target-min, 2rem);
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-micro);
  cursor: pointer;
}
.mp__tool:hover:not(:disabled) { border-color: var(--accent); color: var(--ink); }
.mp__tool:disabled { opacity: 0.45; cursor: default; }
.mp__amount {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--card-2, var(--card));
}
.mp__seg {
  min-height: var(--target-min, 2rem);
  border: 0;
  border-radius: 0.4rem;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-label);
  cursor: pointer;
}
.mp__seg:hover { color: var(--ink); }
.mp__seg[aria-checked="true"] { background: var(--card); color: var(--ink); font-weight: 600; box-shadow: 0 0 0 1px var(--line), 0 1px 2px color-mix(in srgb, var(--ink) 12%, transparent); }
.mp__hint { margin: 0; color: var(--ink-3); font-size: var(--text-micro); line-height: 1.45; }
.mp__summary {
  margin: 0;
  padding: 0.45rem 0.6rem;
  border-radius: 0.45rem;
  background: color-mix(in srgb, var(--ink) 4%, transparent);
  color: var(--ink-2);
  font-size: var(--text-micro);
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.mp__layers { display: grid; border: 1px solid var(--line); border-radius: 0.55rem; overflow: hidden; }
.mp__row + .mp__row { border-top: 1px solid var(--line); }
.mp__row.is-open { background: color-mix(in srgb, var(--ink) 2.5%, transparent); }
.mp__rowhead { display: flex; align-items: stretch; min-width: 0; }
.mp__rowbtn {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  min-height: 3.1rem;
  padding: 0.4rem 0.4rem 0.4rem 0.55rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mp__rowbtn:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); }
.mp__thumb {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  overflow: hidden;
  border-radius: 0.35rem;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
  color: var(--ink-2);
  font-size: 0.95rem;
  font-weight: 600;
}
.mp__thumb canvas, .mp__thumb svg { display: block; width: 100%; height: 100%; }
.mp__thumb.is-empty { background: transparent; border: 1px dashed var(--line); color: var(--ink-3); }
.mp__rowtext { display: grid; min-width: 0; flex: 1; }
.mp__name { color: var(--ink); font-size: var(--text-label); font-weight: 600; }
.mp__val { overflow: hidden; color: var(--ink-2); font-size: var(--text-micro); text-overflow: ellipsis; white-space: nowrap; }
.mp__val.is-off { color: var(--ink-3); }
.mp__chev { flex: none; width: 0.5rem; height: 0.5rem; margin-right: 0.3rem; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(-45deg); transition: transform 160ms var(--ease, ease); }
.mp__row.is-open .mp__chev { transform: rotate(45deg); }
.mp__off {
  flex: none;
  align-self: center;
  min-height: var(--target-min, 2rem);
  margin-right: 0.45rem;
  padding: 0 0.55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-micro);
  cursor: pointer;
}
.mp__off:hover { border-color: var(--accent); color: var(--ink); }
.mp__off[hidden] { display: none; }
.mp__body { display: grid; gap: 0.55rem; padding: 0.15rem 0.6rem 0.75rem; }
.mp__body[hidden] { display: none; }
.mp__grid { display: grid; gap: 0.4rem; }
.mp__grid--shader { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mp__grid--entrance { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mp__grid--entrance .mp__tilethumb { aspect-ratio: 2 / 1; display: grid; place-items: center; font-size: 1.35rem; color: var(--ink-2); }
.mp__grid--scene { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mp__grid--fx { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mp__tile {
  display: grid;
  gap: 0.3rem;
  min-width: 0;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  background: var(--card);
  color: inherit;
  font: inherit;
  font-size: var(--text-micro);
  text-align: left;
  cursor: pointer;
}
.mp__tile:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.mp__tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.mp__tile:disabled { opacity: 0.4; cursor: not-allowed; }
.mp__tile.is-muted:not([aria-pressed="true"]) { opacity: 0.6; }
.mp__tilethumb { position: relative; display: block; overflow: hidden; width: 100%; aspect-ratio: 4 / 3; border-radius: 0.3rem; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.mp__grid--scene .mp__tilethumb { aspect-ratio: 1; }
/* On the new-design page the panel is wide: more, smaller tiles per row. */
.dsgn-motion .mp__grid--shader, .dsgn-motion .mp__grid--fx { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); }
.dsgn-motion .mp__grid--scene { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
.mp__tilethumb--wide { aspect-ratio: 2 / 1; }
.mp__tilethumb--none { display: grid; place-items: center; border: 1px dashed var(--line); background: transparent; color: var(--ink-3); font-size: var(--text-micro); }
.mp__tilethumb canvas, .mp__tilethumb svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.mp__tilelabel { display: flex; align-items: center; gap: 0.3rem; min-width: 0; }
.mp__tilelabel > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp__tag {
  flex: none;
  padding: 0 0.3rem;
  border-radius: 0.25rem;
  background: color-mix(in srgb, var(--warn, #b7791f) 16%, transparent);
  color: var(--ink-2);
  font-size: 0.65rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.mp__tilethumb > .mp__tag { position: absolute; top: 0.25rem; left: 0.25rem; background: color-mix(in srgb, var(--card) 85%, transparent); box-shadow: 0 0 0 1px var(--line); }
.mp__chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.mp__chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-height: var(--target-min, 2rem);
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--text-micro);
  cursor: pointer;
}
.mp__chip:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--ink); }
.mp__chip.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: var(--ink); }
.mp__chip.is-muted:not(.is-on) { opacity: 0.6; }
.mp__sub { margin: 0.15rem 0 0; color: var(--ink-3); font-size: var(--text-micro); }
.mp__dirs { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.mp__dir {
  width: var(--target-min, 2rem);
  height: var(--target-min, 2rem);
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--card);
  color: var(--ink-2);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.mp__dir:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line)); }
.mp__dir.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--card)); color: var(--ink); }
.mp__field { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.5rem; color: var(--ink-2); font-size: var(--text-micro); }
.mp__select { min-width: 0; min-height: var(--target-min, 2rem); padding: 0.2rem 0.4rem; border: 1px solid var(--line); border-radius: 0.4rem; background: var(--card); color: var(--ink); font: inherit; font-size: var(--text-micro); }
.mp__range { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) 2.8rem; align-items: center; gap: 0.5rem; color: var(--ink-2); font-size: var(--text-micro); }
.mp__range input { width: 100%; min-width: 0; accent-color: var(--accent); }
.mp__range output { color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }
.mp__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.mp__bar .mp__select { flex: 1; }
.mp__switch {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--target-min, 2rem);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--text-label);
  text-align: left;
  cursor: pointer;
}
.mp__switchtrack { position: relative; flex: none; width: 2.2rem; height: 1.25rem; border-radius: 999px; background: color-mix(in srgb, var(--ink) 18%, transparent); transition: background 160ms var(--ease, ease); }
.mp__switchtrack::after { content: ""; position: absolute; top: 2px; left: 2px; width: calc(1.25rem - 4px); height: calc(1.25rem - 4px); border-radius: 50%; background: var(--card); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2); transition: transform 160ms var(--ease, ease); }
.mp__switch[aria-checked="true"] .mp__switchtrack { background: var(--accent); }
.mp__switch[aria-checked="true"] .mp__switchtrack::after { transform: translateX(0.95rem); }
.mp__tune summary { min-height: var(--target-min, 2rem); display: flex; align-items: center; color: var(--ink-2); font-size: var(--text-micro); cursor: pointer; }
.mp__tune[open] { display: grid; gap: 0.4rem; }
.mp :is(button, select, input, summary):focus-visible { outline: 2px solid var(--focus, var(--accent)); outline-offset: 2px; }
.mp__rowbtn:focus-visible { outline-offset: -2px; }
.mp__reduced[hidden] { display: none; }
/* In the Studio's Motion tab the panel is the tab: no fold of its own. */
.stu__pane .dsgn__motionfork { border: 0; background: transparent; }
.stu__pane .dsgn__motionfork > summary { display: none; }
.stu__pane .dsgn__motionfork > :not(summary) { margin-left: 0; margin-right: 0; }
@media (prefers-reduced-motion: reduce) {
  .mp__chev, .mp__switchtrack, .mp__switchtrack::after { transition: none; }
}
@media (max-width: 640px), (pointer: coarse) {
  .mp__tool, .mp__seg, .mp__off, .mp__chip, .mp__select, .mp__tune summary, .mp__switch { min-height: 2.75rem; }
  .mp__dir { width: 2.75rem; height: 2.75rem; }
}
