/* Chat-first demo page layout. Loaded after workstation.css and site.css and
   reuses their tokens (:root custom properties), result-card, solver, trace,
   and composer styles. Only the demo skeleton — single conversation column +
   deal-state rail — is defined here. The site bar, frame and footer are the
   shared ones (web/site.css); the desk sits in the same frame as every other
   page, so nothing moves when you switch pages. */

/* The desk follows the system theme like every other page (the same dark
   tokens as how-it-works.html and connect.html), so switching pages never
   flips between light and dark. workstation.css stays light for the parked
   workstation page. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: oklch(20% 0.006 264);
    --paper-deep: oklch(16.5% 0.006 264);
    --surface: oklch(24% 0.006 264);
    --ink: oklch(92% 0.006 264);
    --ink-muted: oklch(68% 0.006 264);
    --line: oklch(34% 0.006 264);
    --line-strong: oklch(62% 0.006 264);
    --accent: oklch(66% 0.09 262);
    --accent-dark: oklch(58% 0.09 262);
    --accent-soft: oklch(32% 0.05 262);
    --positive: oklch(68% 0.11 151);
    --negative: oklch(66% 0.15 29);
    --warning: oklch(72% 0.12 78);
    --shadow: 0 18px 45px oklch(5% 0.006 264 / 45%);
  }
  /* A 2 px ink rule is the brightest line on a dark page; it steps down. */
  :root:not([data-theme="light"]) .uw .demo-shell .result-block { border-top-color: var(--line-strong); }
}

/* ---------- motion ----------
   One vocabulary, from site.css: --dur-1 respond, --dur-2 swap, --dur-3
   settle, --dur-4 arrive; --ease-out for anything arriving, --ease-move for
   travel and loops; --rise and --stagger for entrances. Reduced motion
   shortens the long durations and zeroes the rise and the stagger there;
   loops stop below. workstation.css's blanket .01 ms rule skips the desk. */
@keyframes desk-rise {
  from { opacity: 0; transform: translateY(var(--from-y, var(--rise))); }
}
@keyframes desk-fade { from { opacity: 0; } }
@keyframes desk-fade-out { to { opacity: 0; } }

.uw .demo-tools .model-control { flex: 0 1 auto; min-width: 0; gap: 8px; }
.uw .demo-tools .model-control select { min-height: 32px; padding: 4px 30px 4px 10px; width: min(240px, 100%); font-size: 12px; }
/* The bar's controls share one hairline (--line) and answer a hover in
   --dur-1, like the nav. */
.uw .demo-tools .ghost-button {
  min-height: 32px;
  padding: 6px 12px;
  border-color: var(--line);
  transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.uw .demo-tools .ghost-button:hover:not(:disabled) { border-color: var(--accent); }
/* The status pill keeps one width from "Loading" to "Ready"; its colour
   cross-fades and the new label fades in (demo.js setStatusPill). */
.uw .demo-tools .status-pill {
  min-width: 66px;
  text-align: center;
  transition: color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
.uw .demo-tools .status-pill.swap { animation: desk-fade var(--dur-2) var(--ease-out); }

/* Narrator picker sits beside the model select; premium rows are locked.
   Deliberately quiet — it's a setting, not a headline (GTM review 2026-09-21). */
.uw .model-control #llm-select {
  width: min(150px, 100%);
  flex: 0 1 auto;
  font-size: 11px;
  min-height: 32px;
  padding: 4px 26px 4px 8px;
  border-color: transparent;
  background: transparent;
  color: var(--ink-muted);
}
.uw .model-control #llm-select:hover,
.uw .model-control #llm-select:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.uw .story-links { list-style: none; margin: 0; padding: 12px 18px 16px; display: grid; gap: 10px; }
.uw .story-links a { color: var(--accent-dark); text-decoration: none; }
.uw .story-links a:hover { text-decoration: underline; }

.uw .demo-rail-toggle[aria-expanded="true"] { color: var(--accent-dark); }

.uw .demo-workspace {
  position: relative;
  display: flex;
  min-height: 0;
  flex: 1;
  width: 100%;
  max-width: var(--site-max);
  margin: 0 auto;
}
/* The frame's left rule is drawn inside the box (a shadow, not a border),
   so the desk's content starts on the same pixel as the bar's. */
@media (min-width: 1181px) {
  .uw .demo-workspace { box-shadow: inset 1px 0 var(--line); }
}

/* A calmer focus ring than workstation.css's 2 px: thinner, nearer, and a
   touch translucent. */
.uw .demo-shell :focus-visible {
  outline: 1.5px solid color-mix(in oklch, var(--accent) 70%, transparent);
  outline-offset: 2px;
}

.uw .demo-conversation {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

/* min-height: 0 lets the feed shrink below its content so it scrolls
   internally; without it the composer dock gets pushed out of the viewport.
   No CSS smooth scrolling: demo.js follows new content itself (small steps
   at once, a landing card in a short glide), keeps a stable thin warm scrollbar gutter
   so the first card never narrows the column, and fades its top and bottom
   edges on an eased ramp. The right 16 px stay opaque for the scrollbar. */
.uw .demo-activity {
  flex: 1;
  min-height: 0;
  padding: 28px var(--site-pad) 28px;
  overflow-y: auto;
  scroll-behavior: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  mask:
    linear-gradient(#000, #000) right / 16px 100% no-repeat,
    linear-gradient(#0000 0, #0004 6px, #000a 12px, #000e 18px, #000 24px, #000 calc(100% - 24px), #000e calc(100% - 18px), #000a calc(100% - 12px), #0004 calc(100% - 6px), #0000 100%);
}
/* The workstation's grid paper stays on the workstation. */
.uw .demo-activity::before { content: none; }

.uw .demo-welcome {
  max-width: 720px;
  margin: 0 0 26px;
  transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
/* The welcome leaves: a fade and a small lift, while the request is
   already in flight. */
.uw .demo-welcome.leaving {
  opacity: 0;
  transform: translateY(calc(var(--rise) * -.75));
}

.uw .demo-welcome h1 {
  margin: 10px 0 12px;
  font-family: var(--serif);
  font-size: clamp(26px, 3.4vw, 34px);
  /* the display weight Connect uses; one family of headings across the site */
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -.012em;
  text-wrap: balance;
}

/* Static positioning line (the pitch) reads stronger than the dynamic
   instruction line under it. */
.uw .demo-welcome .demo-positioning { color: var(--ink); margin-bottom: 8px; }
.uw .demo-welcome .demo-instruction { font-size: 14px; }
.uw .demo-welcome .demo-hire { font-size: 13px; color: var(--ink-muted); margin-top: 4px; }
.uw .demo-welcome .demo-hire a { color: var(--accent-dark); }

/* The transcript and the composer share one right edge: the same column
   (auto width, max 860 px) and the same scrollbar gutter (the dock reserves
   one too). Every card stays inside the column: tracks and turns may shrink
   below their content, and wide tables scroll inside their card. */
.uw .demo-transcript,
.uw .demo-shell .working {
  width: auto;
  max-width: 860px;
  margin: 0;
}
.uw .demo-transcript {
  grid-template-columns: minmax(0, 1fr);
  padding: 24px 0 28px;
}
.uw .demo-transcript:empty { padding: 0; }
.uw .demo-shell .working { padding: 0 0 28px; }
.uw .demo-shell .working:not([hidden]) { animation: desk-fade var(--dur-2) var(--ease-out) backwards; }
.uw .demo-transcript .turn { grid-template-columns: minmax(0, 1fr); }
.uw .demo-transcript .turn > * { min-width: 0; }

/* Arrivals. A card rises --rise over --dur-2; the question fades in; the
   trace fades in. The landing after a card, all timed from it: narration
   one --stagger later (demo.js marks .follows when it lands within --dur-1
   of the card), the footer stamp at --dur-1, rail values at --dur-2, the
   trace folds at --dur-3, the Tab hint at --dur-4. */
.uw .demo-transcript > .turn { animation: desk-rise var(--dur-2) var(--ease-out) backwards; }
.uw .demo-transcript > .turn.user-row,
.uw .demo-transcript > .turn.trace-turn { animation-name: desk-fade; }
.uw .demo-transcript > .turn.user-row { animation-duration: var(--dur-1); }
.uw .demo-transcript > .turn.narration-turn { --from-y: calc(var(--rise) * .75); }
.uw .demo-transcript > .turn.narration-turn.follows { animation-delay: var(--stagger); }
.uw .demo-transcript .result-footer,
.uw .demo-transcript .solver-caveat { animation: desk-fade var(--dur-2) var(--ease-out) var(--dur-1) backwards; }

/* Narration is prose under the card, not another boxed card. */
.uw .demo-narration { max-width: 68ch; }
.uw .demo-narration .result-narrative {
  max-width: none;
  padding: 0;
  font-size: 15px;
  line-height: 1.6;
}
.uw .demo-narration-meta {
  margin: 10px 0 0;
  color: var(--ink-muted);
  font: 10px/1.4 var(--mono);
}

/* Cards: a softer, shorter shadow than the workstation's. */
.uw .demo-shell .result-block {
  box-shadow: 0 1px 0 var(--line), 0 10px 24px -14px oklch(25% 0.006 264 / 12%);
}

/* Wide tables scroll inside the card; an edge fades only on a side with
   more to show (demo.js marks .more-left / .more-right). */
.uw .table-scroll,
.uw .demo-shell .sensitivity-table-wrap,
.uw .demo-shell .solver-table-wrap {
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.uw .table-scroll.more-right,
.uw .demo-shell .sensitivity-table-wrap.more-right,
.uw .demo-shell .solver-table-wrap.more-right {
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), #0000);
}
.uw .table-scroll.more-left,
.uw .demo-shell .sensitivity-table-wrap.more-left,
.uw .demo-shell .solver-table-wrap.more-left {
  mask-image: linear-gradient(to left, #000 calc(100% - 40px), #0000);
}
.uw .table-scroll.more-left.more-right,
.uw .demo-shell .sensitivity-table-wrap.more-left.more-right,
.uw .demo-shell .solver-table-wrap.more-left.more-right {
  mask-image: linear-gradient(to right, #0000, #000 40px, #000 calc(100% - 40px), #0000);
}
.uw .demo-transcript .metric-label { min-width: 14ch; }
.uw .result-narrative--md .table-scroll { margin: 0 0 14px; }
.uw .result-narrative--md .table-scroll .metrics-table { margin: 0; }

/* The jump button: a quiet circle above the composer, shown only while the
   reader has scrolled up from new content. */
.uw .demo-jump-anchor {
  position: relative;
  z-index: 2;
  height: 0;
  max-width: 860px;
  margin: 0 var(--site-pad);
}
.uw .demo-jump {
  position: absolute;
  bottom: 12px;
  left: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 6px 16px -8px oklch(25% 0.006 264 / 30%);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 6px);
  transition:
    opacity var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    visibility 0s linear var(--dur-2);
}
.uw .demo-jump.on {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
  transition-delay: 0s;
}
.uw .demo-jump:hover { border-color: var(--accent); }
.uw .demo-jump svg { display: block; }

/* No separator rule above the composer (ChatGPT/Claude do without one): the
   pill itself is the boundary, held by an even border plus a soft shadow.
   The dock reserves the feed's scrollbar gutter (overflow hidden + stable
   gutter, same thin width), so the composer ends where the cards end. No
   background: the frame's left rule runs through it. */
.uw .demo-composer-dock {
  padding: 8px var(--site-pad) 14px;
  overflow: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
}

.uw .demo-composer-note {
  margin: 6px 0 0;
  font-size: 11px;
  text-align: left;
  color: var(--ink-muted);
}

/* ChatGPT/Claude-style pill composer: one rounded row — growing textarea +
   a compact send key. No label row, no hints, no secondary actions. */
.uw .demo-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  max-width: 860px;
  margin: 0;
  padding: 5px 5px 5px 16px;
  /* A crisp, even 1px rule on all four sides — no directional shadow: a
     downward offset made the top edge read as missing against the paper. */
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  transition: border-color var(--dur-1) var(--ease-out);
}

.uw .demo-composer:focus-within { border-color: var(--accent); }

.uw .demo-composer .composer-input-wrap {
  flex: 1;
  min-width: 0;
  align-self: center;
}

/* A block textarea has no inline baseline gap under it, so its line sits
   on the send key's centre. */
.uw .demo-composer textarea {
  display: block;
  padding: 7px 0;
  border-bottom: 0;
}
.uw .demo-composer textarea::placeholder { color: var(--ink-muted); opacity: .7; }

.uw .demo-composer .composer-suggestion { padding: 7px 0; }

.uw .demo-send-button {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out), opacity var(--dur-1) var(--ease-out);
}

.uw .demo-send-button:hover { background: var(--accent-dark); }
.uw .demo-send-button:disabled { opacity: .35; cursor: not-allowed; }

/* Slim footer: one quiet line, not a second bar; phones give the space to
   the composer. */
.uw .demo-shell .site-foot > .site-frame { padding-top: 6px; padding-bottom: 6px; }
@media (max-width: 820px) {
  .uw .demo-shell .site-foot { display: none; }
}

/* Lives inside the welcome section: initial screen only. It leaves with the
   welcome copy the moment the conversation starts; afterwards the composer's
   grey Tab hint carries the next askable question. */
.uw .demo-preset-panel {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
/* The starter panels arrive together with the catalog, by fading in. */
.uw .demo-preset-panel:not([hidden]) { animation: desk-fade var(--dur-2) var(--ease-out) backwards; }

.uw .demo-preset-kicker { margin: 0 0 8px; }

.uw .demo-preset-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.uw .demo-preset-button {
  padding: 6px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  text-align: left;
  transition:
    border-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    background-color var(--dur-1) var(--ease-out);
}

.uw .demo-preset-button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent-dark);
}

/* Pressed: the chip takes the accent tint at once, before the welcome
   leaves with it. */
.uw .demo-preset-button:active:not(:disabled) {
  background: var(--accent-soft);
  transition-duration: 0s;
}

/* Deal-state rail — the invariant beside the stream. Only its width moves
   (--dur-3, --ease-move); the body keeps its 300 px, so nothing in it
   reflows, and fades out fast on close and in a beat after the width starts
   on open. The header button stays anchored to the rail's fixed right edge.
   The move runs only while demo.js marks the rail .moving (a toggle after
   html.ready, set on the second frame), so the page arrives at rest and a
   window resize never animates the rail. */
.uw .demo-deal-rail {
  --rail-w: 300px;
  display: flex;
  width: var(--rail-w);
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--paper-deep);
}
html.ready .uw .demo-deal-rail.moving { transition: width var(--dur-3) var(--ease-move); }

.uw .demo-deal-rail[data-collapsed="true"] { width: 60px; }

.uw .demo-rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--line);
}

.uw .demo-rail-header .eyebrow {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
}
.uw .demo-rail-header .icon-button { flex: none; }

.uw .demo-shell .icon-button {
  transition: color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.uw .demo-shell .icon-button span[aria-hidden] {
  display: inline-block;
  transition: transform var(--dur-3) var(--ease-move);
}
.uw .demo-deal-rail[data-collapsed="true"] .icon-button span[aria-hidden] {
  transform: rotate(180deg);
}

.uw .demo-rail-body {
  flex: 1 1 auto;
  width: calc(var(--rail-w) - 1px);
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding: 14px;
  display: grid;
  gap: 18px;
  align-content: start;
}
.uw .demo-rail-body,
.uw .demo-rail-header .eyebrow {
  transition: opacity var(--dur-2) var(--ease-out) var(--dur-1), visibility 0s;
}
.uw .demo-deal-rail[data-collapsed="true"] .demo-rail-body,
.uw .demo-deal-rail[data-collapsed="true"] .demo-rail-header .eyebrow {
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-1) var(--ease-out), visibility 0s linear var(--dur-1);
}

/* Rail values when a run lands: the new value cross-fades in over the old
   at --dur-2 after the card, under a 1 px accent underline that fades over
   --dur-4. A value with nothing before it fades in. */
@keyframes rail-mark {
  from { box-shadow: inset 0 -1px var(--accent); }
  to { box-shadow: inset 0 -1px transparent; }
}
.uw .rail-swap {
  display: inline-grid;
  justify-items: start;
  justify-self: start;
  animation: rail-mark var(--dur-4) var(--ease-out) var(--dur-2) both;
}
.uw .rail-swap > .rail-v { grid-area: 1 / 1; }
.uw .rail-swap > .rail-v:not(.rail-v-old) { animation: desk-fade var(--dur-2) var(--ease-out) var(--dur-2) backwards; }
.uw .rail-swap > .rail-v-old { animation: desk-fade-out var(--dur-2) var(--ease-out) var(--dur-2) both; }
.uw .rail-fresh { animation: desk-fade var(--dur-2) var(--ease-out) var(--dur-2) backwards; }

.uw .demo-deal-section { display: grid; gap: 4px; }

.uw .demo-deal-label {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.uw .demo-deal-value {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.uw .demo-deal-count {
  font-family: var(--mono);
  font-size: 18px;
}

.uw .demo-deal-meta {
  margin: 0;
  color: var(--ink-muted);
  font-size: 11px;
}

.uw .demo-deal-overrides {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.uw .demo-override-chip {
  padding: 2px 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 10px;
}

.uw .demo-deal-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.uw .demo-deal-metric {
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.uw .demo-deal-metric-label {
  color: var(--ink-muted);
  font-size: 10px;
  line-height: 1.3;
}

.uw .demo-deal-metric-value {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.uw .demo-deal-metric-delta {
  font-family: var(--mono);
  font-size: 10px;
}

.uw .demo-deal-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--ink-muted);
  font-size: 11px;
}

/* No provenance yet, no rule: an empty line under the metrics read as a stray divider. */
.uw .demo-deal-provenance:empty { display: none; }

.uw .demo-deal-provenance {
  margin: 0;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
}

/* Instance layer (docs/INSTANCE_LAYER.md §5) — rail list of saved deal
   states for the current model. Compact rows: name + relative time open the
   frozen snapshot; rename and delete are quiet inline affordances. */
.uw .demo-deal-instances {
  display: grid;
  gap: 4px;
  margin-top: 4px;
}

.uw .instance-item {
  display: flex;
  align-items: stretch;
  gap: 2px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.uw .instance-open {
  flex: 1;
  display: grid;
  gap: 1px;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color var(--dur-1) var(--ease-out);
}

.uw .instance-open:hover { background: var(--accent-soft); }

.uw .instance-name {
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uw .instance-updated {
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
}

.uw .instance-action {
  flex: none;
  width: 26px;
  border: 0;
  border-left: 1px solid var(--line);
  background: none;
  color: var(--ink-muted);
  font-size: 11px;
  cursor: pointer;
  transition: color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}

.uw .instance-action:hover { background: var(--accent-soft); color: var(--accent-dark); }
.uw .instance-action-delete:hover { color: var(--negative); }

.uw .instance-rename-input {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--accent);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

/* Save-instance actions on results cards: local browser actions, styled as
   quiet workstation controls — distinct from the prefill (ask-drafting)
   buttons. */
.uw .instance-save-button,
.uw .instance-export-button {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .02em;
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}

.uw .instance-save-button:hover,
.uw .instance-export-button:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.uw .instance-export-button:disabled { opacity: .45; cursor: progress; }

/* Snapshot card chrome: the fingerprint pin reads as a provenance strip
   directly under the card header. */
.uw .instance-pin-row {
  padding: 8px 18px;
  border-bottom: 1px solid var(--line);
}

.uw .instance-pin {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  max-width: 100%;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
}

.uw .instance-pin-kicker { flex: none; color: var(--accent-dark); }

.uw .instance-pin-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uw .instance-pin-unpinned {
  font-style: italic;
  letter-spacing: .02em;
}

.uw .instance-overrides { padding: 10px 18px 4px; }

.uw .instance-section-label {
  margin: 0 0 6px;
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.uw .instance-footer-note { font-style: italic; }

/* Boundary card: one ruled informational artifact in the stream — a
   gradient, not a wall. No controls, no sign-up prompt. */
.uw .instance-boundary-card {
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-left: 3px solid var(--accent);
  background: var(--paper-deep);
}

.uw .instance-boundary-card .result-kicker { margin: 0 0 6px; }

.uw .instance-boundary-copy {
  margin: 0 0 6px;
  max-width: 640px;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.5;
}

.uw .instance-boundary-copy:last-child { margin-bottom: 0; }

/* Card action row — prefill-only follow-up buttons inside result cards. */
.uw .demo-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid var(--line);
}

.uw .demo-prefill-button {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out);
}

.uw .demo-prefill-button:hover { border-color: var(--accent); color: var(--accent-dark); }

/* Inline ghost suggestion (Claude/ChatGPT-style): grey text sits directly in
   the input line where typed text would go, with a small Tab pill at the end.
   The overlay mirrors the textarea's metrics (padding 5px 0, line-height
   1.45) and only shows while the input is empty, so alignment is exact. It is
   non-interactive — Tab accepts, and accepting only prefills the input. */
.uw .composer-input-wrap { position: relative; }

.uw .composer-suggestion {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  overflow: hidden;
  color: var(--ink-muted);
  line-height: 1.45;
  white-space: nowrap;
  pointer-events: none;
}

.uw #composer-suggestion-text {
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: .6;
  transition: color var(--dur-1) var(--ease-out), opacity var(--dur-1) var(--ease-out);
}

.uw .composer-suggestion-key {
  flex: none;
  padding: 0 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: .06em;
  text-transform: uppercase;
  opacity: .75;
  transition: opacity var(--dur-1) var(--ease-out);
}

/* The hint is the last thing to land after a run (demo.js sets
   --ghost-delay as it appears), and never shows mid-run. */
.uw .composer-suggestion:not([hidden]) {
  animation: desk-fade var(--dur-2) var(--ease-out) var(--ghost-delay, 0ms) backwards;
}
/* Tab: the ghost warms to ink where it stands and the key fades; then the
   same words become the draft. */
.uw .composer-suggestion.accepting #composer-suggestion-text { color: var(--ink); opacity: 1; }
.uw .composer-suggestion.accepting .composer-suggestion-key { opacity: 0; }

/* Boundary strip points are buttons on this page (prefill on click). */
.uw .solver-boundary-strip button.solver-boundary-point {
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.uw .solver-boundary-strip button.solver-boundary-point:hover {
  background: var(--accent-soft);
}

/* The selects are hidden on a single-model deployment. As the bar narrows,
   the status pill, the brand title, then the secondary nav links give way;
   the footer still carries every link. */
@media (max-width: 1100px) {
  .uw .demo-tools .model-control { display: none; }
}
/* Phones: the rail is a drawer under the site bar (it is positioned in the
   workspace, so it starts where the bar ends at any bar height), closed by
   default in CSS so it never shows on arrival, sliding in over a tap-to-close
   scrim. The slide only switches on after the first paint (html.ready). */
.uw .demo-rail-scrim { display: none; }
@media (max-width: 900px) {
  .uw .demo-deal-rail,
  .uw .demo-deal-rail[data-collapsed="true"] {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    width: min(var(--rail-w), 86vw);
    box-shadow: var(--shadow);
    transform: translateX(100%);
    visibility: hidden;
  }
  .uw .demo-deal-rail[data-collapsed="false"] {
    transform: none;
    visibility: visible;
  }
  html.ready .uw .demo-deal-rail.moving {
    transition: transform var(--dur-3) var(--ease-move), visibility 0s linear var(--dur-3);
  }
  html.ready .uw .demo-deal-rail.moving[data-collapsed="false"] {
    transition: transform var(--dur-3) var(--ease-move), visibility 0s;
  }
  /* Inside the drawer the body is simply there; the drawer itself moves. */
  .uw .demo-deal-rail .demo-rail-body,
  .uw .demo-deal-rail .demo-rail-header .eyebrow,
  .uw .demo-deal-rail[data-collapsed="true"] .demo-rail-body,
  .uw .demo-deal-rail[data-collapsed="true"] .demo-rail-header .eyebrow {
    width: auto;
    opacity: 1;
    visibility: inherit;
    transition: none;
  }
  .uw .demo-rail-scrim {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 29;
    background: oklch(20% 0.006 264 / 18%);
    opacity: 0;
    visibility: hidden;
  }
  html.ready .uw .demo-rail-scrim {
    transition: opacity var(--dur-3) var(--ease-out), visibility 0s linear var(--dur-3);
  }
  .uw .demo-deal-rail[data-collapsed="false"] ~ .demo-rail-scrim {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
  }
}

/* Teaching cards (precomputed engine grids ported from /teach.html) */
.uw .teach-console {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 16px;
  padding: 14px 16px;
}
.uw .teach-dials { display: flex; flex-direction: column; gap: 10px; }
.uw .teach-dial-row { display: flex; flex-direction: column; gap: 4px; }
.uw .teach-dial-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.uw .teach-seg { display: flex; flex-wrap: wrap; gap: 4px; }
.uw .teach-seg-button {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--surface);
  color: var(--ink-muted);
  cursor: pointer;
  transition: border-color var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), background-color var(--dur-1) var(--ease-out);
}
.uw .teach-seg-button.on {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-dark);
}
.uw .teach-readout {
  border-left: 1px solid var(--line);
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.uw .teach-gp { font-family: var(--mono); font-size: 28px; font-weight: 600; }
.uw .teach-gp.up { color: var(--positive); }
.uw .teach-gp.down { color: var(--negative); }
.uw .teach-delta { font-family: var(--mono); font-size: 11px; color: var(--ink-muted); }
.uw .teach-sub {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink);
}
.uw .teach-lamps { display: flex; flex-wrap: wrap; gap: 4px; }
.uw .teach-lamp {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--ink-muted);
}
.uw .teach-lamp.lit {
  border-color: var(--negative);
  background: color-mix(in oklab, var(--negative) 14%, var(--surface));
  color: var(--negative);
}
.uw .teach-lamp.warn.lit {
  border-color: var(--warning);
  background: color-mix(in oklab, var(--warning) 16%, var(--surface));
  color: var(--warning);
}
.uw .teach-verdict { font-style: italic; font-size: 12px; color: var(--ink); margin: 2px 0 0; }
.uw .teach-foot {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-muted);
  margin: 4px 16px 12px;
}
.uw .teach-console + .teach-foot, .uw .teach-cloud + .teach-foot { margin-top: 0; }
.uw .teach-cloud { display: block; margin: 10px 16px 0; max-width: calc(100% - 32px); }
@media (max-width: 720px) {
  .uw .teach-console { grid-template-columns: 1fr; }
  .uw .teach-readout { border-left: 0; padding-left: 0; }
}

/* Phones: workstation.css lets its shell grow with the page below 820px,
   which pushed the composer below the fold. The desk keeps the app-height
   shell so the feed scrolls and the composer stays put; wide result tables
   scroll inside their card instead of widening the whole feed
   (UAT QA 2026-10-11, 375px). */
@media (max-width: 820px) {
  .uw .demo-shell {
    height: 100vh;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .uw .demo-activity { overflow-x: hidden; overflow-y: auto; }
}

/* Reverse-question scan: the feasible set as text, then as a curve. */
.uw .feasible-summary { padding: 10px 14px 4px; }
.uw .feasible-headline { margin: 0 0 4px; font-weight: 600; color: var(--ink); }
.uw .feasible-edge { margin: 0 0 2px; font-family: var(--mono); font-size: 12px; color: var(--ink-muted); }
.uw .feasible-chart { display: block; width: 100%; height: auto; max-height: 220px; padding: 4px 8px 0; }
.uw .feasible-band { fill: color-mix(in oklch, var(--positive) 22%, transparent); }
.uw .feasible-base { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 2 3; }
.uw .feasible-error-band { fill: color-mix(in oklch, var(--line) 45%, transparent); }
.uw .feasible-hurdle { stroke: var(--accent); stroke-width: 1.2; stroke-dasharray: 5 4; }
.uw .feasible-line { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.uw .feasible-dot { fill: var(--ink); }
.uw .feasible-axis-label { font-family: var(--mono); font-size: 11px; fill: var(--ink-muted); }
.uw .feasible-points { margin: 4px 14px 8px; }
.uw .feasible-points > summary { cursor: pointer; font-size: 13px; color: var(--ink-muted); padding: 4px 0; }

/* ---------- the trace, on the desk's rhythm ----------
   workstation.css draws the trace; the desk retimes it on the tokens. */
.uw .demo-shell .trace-head {
  border-radius: 4px;
  transition: color var(--dur-1) var(--ease-out);
}
/* The timer sits after the icon, before the label, in a fixed slot, so a
   new status line never pushes it sideways; settled, it leaves no gap. */
.uw .demo-shell .trace-icon { position: relative; order: -2; }
.uw .demo-shell .trace-elapsed { order: -1; min-width: 4ch; }
.uw .demo-shell .trace-elapsed:empty { display: none; }
.uw .demo-shell .trace-chevron,
.uw .demo-shell .row-chevron {
  display: inline-flex;
  align-items: center;
  font-size: 0;
}
.uw .demo-shell .trace-chevron svg,
.uw .demo-shell .row-chevron svg { display: block; }
.uw .demo-shell .trace-chevron { transition: transform var(--dur-2) var(--ease-out); }
.uw .demo-shell .trace-row .row-chevron {
  align-self: center;
  transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.uw .demo-shell button.trace-row { border-radius: 4px; }
.uw .demo-shell .trace-body {
  transition: grid-template-rows var(--dur-3) var(--ease-move), opacity var(--dur-2) var(--ease-out);
}
.uw .demo-shell .trace-detail {
  transition: grid-template-rows var(--dur-3) var(--ease-move), opacity var(--dur-2) var(--ease-out);
}
.uw .demo-shell .trace-item {
  --from-y: calc(var(--rise) / 2);
  animation: desk-rise var(--dur-2) var(--ease-out) backwards;
}

/* After a long wait, one quiet line under the head (demo.js, 12 s). It
   folds away with the trace when the run settles. */
.uw .trace-note {
  display: grid;
  grid-template-rows: 1fr;
  margin: 0 0 2px 24px;
  color: var(--ink-muted);
  font: 10px/1.5 var(--mono);
  animation: trace-note-in var(--dur-3) var(--ease-out);
  transition: grid-template-rows var(--dur-3) var(--ease-move), opacity var(--dur-1) var(--ease-out);
}
.uw .trace-note > span { overflow: hidden; }
@keyframes trace-note-in { from { grid-template-rows: 0fr; opacity: 0; } }
.uw .trace.settled .trace-note { grid-template-rows: 0fr; opacity: 0; }

/* One heartbeat: the shimmer, the pixel loader and the live tick all keep
   --beat (the loader and tick at half-beats). */
.uw .demo-shell .trace-label.active,
.uw .demo-shell #working-label { animation-duration: var(--beat); }
.uw .demo-shell .pixel-loader span {
  animation-duration: calc(var(--beat) / 2);
  animation-delay: calc(var(--wave, 0) * var(--stagger));
}
/* the chevron wavefront driving right: (col + |row - 1|) staggers */
.uw .demo-shell .pixel-loader span:nth-child(1),
.uw .demo-shell .pixel-loader span:nth-child(5),
.uw .demo-shell .pixel-loader span:nth-child(7) { --wave: 1; }
.uw .demo-shell .pixel-loader span:nth-child(2),
.uw .demo-shell .pixel-loader span:nth-child(6),
.uw .demo-shell .pixel-loader span:nth-child(8) { --wave: 2; }
.uw .demo-shell .pixel-loader span:nth-child(3),
.uw .demo-shell .pixel-loader span:nth-child(9) { --wave: 3; }
.uw .demo-shell .trace-row .tick.live {
  animation: tick-pulse calc(var(--beat) / 2) var(--ease-move) infinite alternate;
}

/* Settling: the pixels light in the same wavefront, then the ✓ (× on a
   failure, in the negative colour) fades in as the loader fades out. */
@keyframes pixel-lit { to { opacity: 1; } }
.uw .demo-shell .trace-check {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
}
.uw .demo-shell .trace.settled .pixel-loader span {
  animation: pixel-lit var(--dur-1) var(--ease-out) calc(var(--wave, 0) * var(--stagger)) both;
}
.uw .demo-shell .trace.settled .pixel-loader {
  animation: desk-fade-out var(--dur-2) var(--ease-out) calc(3 * var(--stagger)) both;
}
.uw .demo-shell .trace.settled .trace-check {
  opacity: 1;
  animation: desk-fade var(--dur-2) var(--ease-out) calc(3 * var(--stagger)) backwards;
}
.uw .demo-shell .trace.failed .trace-icon { color: var(--negative); font-size: 12px; }

@media (prefers-reduced-motion: reduce) {
  /* loops stop; the settle and the arrivals stay as short fades */
  .uw .demo-shell .trace-row .tick.live { animation: none; }
  .uw .demo-shell .pixel-loader span { animation: none; }
}

/* The toast rises in over --dur-2 and fades out over --dur-1, above the
   composer and the footer rather than on them. */
.uw .toast {
  bottom: 64px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(calc(var(--rise) * .75));
  transition:
    opacity var(--dur-1) var(--ease-out),
    transform var(--dur-1) var(--ease-out),
    visibility 0s linear var(--dur-1);
}
.uw .toast.on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition:
    opacity var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-out),
    visibility 0s;
}
