/* Hero: a working replica of the PILOT desktop client (Flight Deck, night
   appearance; docs/27), running on mock data. One window: a demo strip (the
   SOP plan, who is flying, take over / resume), then the client itself: the
   76px rail, the 52px top bar and the stage, laid out by the window's own
   width (container "cw" on .cw), exactly as the real client reflows: dossier from
   1100px, two columns from 761px, and below 600px the phone layout with the
   rail as a bottom tab bar.
   Colour is the client's: red is a machine at work (a lamp, the AI rule on a
   bubble, a running tag), amber is a person; selection is bone. The replica
   sets its own --signal, so the page autopilot greying its lights never
   misreports the app's state; [data-signal=off] scopes grey a paused machine.
   This file: tokens, frame, strip, shell, shared components, ghost cursor.
   Screens: client-chats.css, client-discover.css, client-ai.css, client-lab.css. */

/* ── Tokens (client night roles, docs/27 §4.2) ───────── */
.cw {
  --bg: var(--ink);
  --bg-chrome: var(--ink-1);
  --bg-read: var(--ink);
  --bg-raised: var(--ink-2);
  --bg-sunken: var(--ink-1);
  --bg-fill: var(--ink-2);
  --bg-fill-strong: var(--ink-3);
  --bg-hover: rgb(242 240 234 / .045);
  --fg: var(--bone);
  --fg-muted: rgb(242 240 234 / .70);
  --fg-faint: rgb(242 240 234 / .58);
  --rule: rgb(242 240 234 / .10);
  --rule-strong: rgb(242 240 234 / .20);
  --edge: rgb(242 240 234 / .40);
  --signal: var(--red);
  --signal-fill: var(--red-cta);
  --on-signal-fill: #fff;
  --signal-soft: rgb(254 60 114 / .12);
  --signal-edge: rgb(254 60 114 / .55);
  --off: #8f8d88;
  --human: var(--amber);
  --human-text: var(--amber);
  --on-human: var(--ink);
  --primary: var(--bone);
  --on-primary: var(--ink);
  --primary-hover: #d9d6ce;
  --ok-dot: #7ee08a;
  --danger: #ff7a6b;
  --bubble-in: var(--ink-3);
  --bubble-me: var(--bone);
  --on-bubble-me: var(--ink);
  --bubble-ai: var(--ink-2);
  --photo-chip: rgb(11 13 18 / .82);
  --font-readout: var(--font-mono);
  --fs-micro: 11px;
  --fs-xs: 12px;
  --fs-s: 13px;
  --fs-m: 14px;
  --fs-row: 15px;
  --fs-l: 16px;
  --fs-xl: 20px;
  --fs-2xl: 26px;
  --r-key: 4px;
  --r-photo: 6px;
  --r-field: 8px;
  --r-dialog: 14px;
  --r-bubble: 16px;
  --r-tail: 4px;
  --rail-w: 76px;
  --bar-h: 52px;
  --control-sm: 28px;
  --control-h: 34px;
  --lamp: 8px;
  --lamp-s: 6px;
  --cw-ease: cubic-bezier(.16, 1, .3, 1);
  --cw-h: clamp(560px, calc(100svh - 150px), 780px);
  position: relative;
  isolation: isolate;
  container: cw / inline-size;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  block-size: var(--cw-h);
  overflow: clip;
  border: 1px solid var(--line-2);
  border-radius: var(--r-dialog);
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--fs-m)/1.5 var(--font-text);
  text-align: start;
  box-shadow: 0 50px 120px -50px rgb(0 0 0 / .9), 0 0 0 1px rgb(0 0 0 / .4);
}
.cw [data-signal="off"], .cw[data-signal="off"] {
  --signal: var(--off);
  --signal-fill: var(--off);
  --on-signal-fill: var(--ink);
  --signal-soft: rgb(143 141 136 / .14);
  --signal-edge: rgb(143 141 136 / .5);
}
.cw :focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.cw button { font: inherit; color: inherit; }
.cw-noscript { display: grid; place-items: center; padding: 32px; color: var(--fg-muted); text-align: center; }

/* ── Strip: the demo's own control bar, the window's top edge ── */
.cw-strip {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 18px;
  min-block-size: 46px;
  padding-block: 6px;
  padding-inline: 16px 8px;
  border-bottom: 1px solid var(--rule);
  background: var(--ink-1);
}
.cw-state { display: inline-flex; flex: none; align-items: center; gap: 9px; max-inline-size: 30%; font-size: var(--fs-s); font-weight: 700; white-space: nowrap; }
.cw-state-text { overflow: hidden; text-overflow: ellipsis; }
.cw-state-hint { color: var(--fg-faint); font-weight: 500; }
.cw-state-hint:empty { display: none; }
.cw[data-mode="human"] .cw-state .cw-lamp { --lamp-color: var(--human); }
.cw-sops { display: flex; flex: 1; gap: 4px; min-inline-size: 0; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }
.cw-sops::-webkit-scrollbar { display: none; }
.cw-sop {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: baseline;
  gap: 7px;
  min-block-size: 34px;
  padding: 7px 10px 9px;
  border-radius: var(--r-field);
  color: var(--fg-faint);
  font-size: var(--fs-s);
  font-weight: 600;
  white-space: nowrap;
  transition: color var(--t-micro) var(--cw-ease), background-color var(--t-micro) var(--cw-ease);
}
.cw-sop:hover { color: var(--fg); background: var(--bg-hover); }
.cw-sop-no { font: 500 var(--fs-xs)/1 var(--font-mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.cw-sop[aria-current="step"] { color: var(--fg); }
.cw-sop.is-done { color: var(--fg-muted); }
/* Progress: a 2px line under the chip that fills while its SOP plays. The
   third leg (人工接管) is the human one, so its line is amber. */
.cw-sop-bar { position: absolute; inset-inline: 10px; inset-block-end: 3px; block-size: 2px; border-radius: 2px; background: var(--rule); overflow: clip; }
.cw-sop-bar > i { display: block; block-size: 100%; inline-size: 100%; background: var(--signal); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
[dir=rtl] .cw-sop-bar > i { transform-origin: 100% 50%; }
.cw-sop.is-human .cw-sop-bar > i { background: var(--human); }
.cw-sop.is-done .cw-sop-bar > i { background: var(--fg-faint); }
.cw[data-mode="human"] .cw-sop-bar > i { background: var(--fg-faint); }
.cw-take {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-block-size: 34px;
  padding-inline: 14px;
  border: 1px solid var(--edge);
  border-radius: 999px;
  font-size: var(--fs-s);
  font-weight: 700;
  white-space: nowrap;
  transition: background-color var(--t-micro) var(--cw-ease), border-color var(--t-micro) var(--cw-ease), color var(--t-micro) var(--cw-ease);
}
.cw-take:hover { border-color: var(--fg); background: var(--bg-hover); }
.cw-take .cw-icon { inline-size: 16px; block-size: 16px; }
/* Resuming is the one solid action of the strip (bone), the hand-off is an outline. */
.cw[data-mode="human"] .cw-take { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.cw[data-mode="human"] .cw-take:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.cw-take[hidden] { display: none; }
/* The phone strip: the plan collapses to five segments under the row. */
.cw-segments { display: none; }

/* ── App: rail | main (bar + stage) ──────────────────── */
.cw-app {
  position: relative;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  min-block-size: 0;
}
.cw-rail { display: flex; flex-direction: column; align-items: center; min-block-size: 0; padding-block-end: 12px; border-inline-end: 1px solid var(--rule); background: var(--bg-chrome); }
.cw-rail-brand { display: grid; flex: none; place-items: center; inline-size: 100%; block-size: var(--bar-h); }
.cw-mark { inline-size: 22px; block-size: 22px; overflow: visible; }
.cw-mark-stem { fill: var(--fg); }
.cw-mark-dot { fill: var(--off); transition: fill var(--t-ui) var(--cw-ease); }
.cw-mark-halo { fill: var(--red); opacity: 0; transform-box: fill-box; transform-origin: center; }
.cw[data-live="on"] .cw-mark-dot { fill: var(--red); }
.cw[data-live="on"] .cw-mark-halo { animation: cw-breathe 2.4s var(--cw-ease) infinite; animation-play-state: var(--run); --breathe: 2.3; }
.cw-nav { display: flex; flex-direction: column; gap: 4px; inline-size: 100%; margin: 0; padding: 16px 0 0; list-style: none; }
.cw-nav-btn { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; inline-size: 100%; min-block-size: 56px; padding: 8px 4px; color: var(--fg-faint); font-size: var(--fs-xs); font-weight: 500; line-height: 1.25; text-align: center; transition: color var(--t-micro) var(--cw-ease); }
.cw-nav-btn:hover { color: var(--fg); }
.cw-nav-btn[aria-current="page"] { color: var(--fg); }
.cw-nav-btn::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: 0; inline-size: 2px; border-start-end-radius: 2px; border-end-end-radius: 2px; background: var(--fg); opacity: 0; scale: 1 .3; transition: opacity var(--t-micro) var(--cw-ease), scale var(--t-ui) var(--cw-ease); }
.cw-nav-btn[aria-current="page"]::before { opacity: 1; scale: 1 1; }
.cw-nav-icon { position: relative; display: grid; place-items: center; }
.cw-nav-btn .cw-icon { inline-size: 20px; block-size: 20px; stroke-width: 1.75; }
.cw-nav-label { max-inline-size: 100%; overflow-wrap: anywhere; }
/* Counts are bone pills: never amber, never red. */
.cw-count { position: absolute; inset-block-start: -7px; inset-inline-start: 11px; min-inline-size: 18px; block-size: 18px; padding-inline: 5px; border-radius: 999px; background: var(--fg); color: var(--bg-chrome); font: 600 var(--fs-xs)/18px var(--font-mono); text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--bg-chrome); }
.cw-count[data-count="0"] { display: none; }
.cw-count.is-bump { animation: cw-bump .5s var(--cw-ease); }
.cw-rail-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-block-start: auto; }
.cw-device { position: relative; display: grid; place-items: center; inline-size: 40px; block-size: 40px; color: var(--fg-faint); }
.cw-device .cw-icon { inline-size: 20px; block-size: 20px; }
.cw-device::after { content: ""; position: absolute; inset-inline-end: 7px; inset-block-end: 9px; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--ok-dot); box-shadow: 0 0 0 2px var(--bg-chrome); }
/* You are a human light: an amber disc with an ink initial. */
.cw-me { display: grid; place-items: center; inline-size: 34px; block-size: 34px; border-radius: 50%; background: var(--human); color: var(--on-human); font: 800 var(--fs-m)/1 var(--font-display); font-stretch: 125%; }

.cw-main { --pane-x: 28px; display: flex; flex-direction: column; min-inline-size: 0; min-block-size: 0; }
.cw-bar { position: relative; display: flex; flex: none; align-items: center; gap: 24px; block-size: var(--bar-h); padding-inline: var(--pane-x) 14px; border-bottom: 1px solid var(--rule); }
.cw-bar-mark { display: none; inline-size: 16px; block-size: 16px; flex: none; }
.cw-title { flex: none; margin: 0; font: 800 var(--fs-xl)/1.2 var(--font-text); letter-spacing: -.01em; white-space: nowrap; }
.cw-title-crumb { color: var(--fg-muted); }
.cw-title-crumb .cw-icon { inline-size: 14px; block-size: 14px; margin-inline: 2px; vertical-align: -1px; }
.cw-search { display: flex; flex: 0 999 360px; align-items: center; gap: 8px; min-inline-size: 120px; block-size: var(--control-h); padding-inline: 2px 0; border-bottom: 1px solid var(--edge); color: var(--fg-faint); font-size: var(--fs-m); white-space: nowrap; }
.cw-search .cw-icon { inline-size: 16px; block-size: 16px; }
.cw-search-label { flex: 1; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; }
.cw-kbd { padding: 1px 6px; border: 1px solid var(--rule-strong); border-radius: var(--r-key); color: var(--fg-muted); font: 500 var(--fs-micro)/1.5 var(--font-mono); letter-spacing: .04em; }
.cw-tools { display: flex; flex: none; align-items: center; gap: 12px; margin-inline-start: auto; }
.cw-sync { display: inline-flex; align-items: center; gap: 8px; color: var(--fg-muted); font: 500 var(--fs-s)/1 var(--font-readout); letter-spacing: .04em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cw-sync::before { content: ""; inline-size: var(--lamp-s); block-size: var(--lamp-s); border-radius: 50%; background: var(--ok-dot); }
.cw-sync.is-syncing::before { background: transparent; border: 1.5px solid var(--fg-muted); border-inline-end-color: transparent; }
.cw-sync-words { font-family: var(--font-text); letter-spacing: 0; }
.cw-sync-time { color: var(--fg); }
.cw-refresh { display: grid; place-items: center; inline-size: 30px; block-size: 30px; color: var(--fg-muted); }
.cw-refresh .cw-icon { inline-size: 18px; block-size: 18px; }
.cw-sync.is-syncing + .cw-refresh .cw-icon { animation: cw-spin .7s linear infinite; animation-play-state: var(--run); }
.cw-bar-sep { inline-size: 1px; block-size: 20px; background: var(--rule-strong); }
.cw-credits { position: relative; display: inline-flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.cw-credits-num { font: 750 22px/1 var(--font-display); font-stretch: 62%; letter-spacing: -.005em; font-variant-numeric: tabular-nums lining-nums; }
.cw-credits-unit { color: var(--fg-faint); font-size: var(--fs-xs); font-weight: 500; }
/* A spend floats up from the balance: "−4", the price of one reply. */
.cw-spend { position: absolute; inset-inline-end: 0; inset-block-start: -2px; color: var(--signal); font: 600 var(--fs-xs)/1 var(--font-mono); pointer-events: none; animation: cw-spend 1.4s var(--cw-ease) forwards; }
/* Window controls, drawn as the Windows caption buttons over the bar (decorative). */
.cw-caption { display: flex; align-items: center; gap: 2px; margin-inline-start: 6px; color: var(--fg-faint); }
.cw-caption > i { display: grid; place-items: center; inline-size: 30px; block-size: 30px; }
.cw-caption > i::before { content: ""; inline-size: 10px; block-size: 10px; }
.cw-caption > i:nth-child(1)::before { block-size: 1px; background: currentColor; }
.cw-caption > i:nth-child(2)::before { border: 1px solid currentColor; }
.cw-caption > i:nth-child(3)::before { background: linear-gradient(45deg, transparent calc(50% - .6px), currentColor calc(50% - .6px), currentColor calc(50% + .6px), transparent calc(50% + .6px)), linear-gradient(-45deg, transparent calc(50% - .6px), currentColor calc(50% - .6px), currentColor calc(50% + .6px), transparent calc(50% + .6px)); }

.cw-stage { position: relative; flex: 1; min-inline-size: 0; min-block-size: 0; }
.cw-pane { position: absolute; inset: 0; display: none; overflow: auto; padding: 24px var(--pane-x) 40px; scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
.cw-pane.is-active { display: block; animation: cw-rise var(--t-micro) var(--cw-ease); }

/* A short demo note at the bottom of the stage (the replica's own toast). */
.cw-toast { position: absolute; z-index: 4; inset-block-end: 16px; inset-inline-start: 50%; translate: -50% 8px; max-inline-size: min(440px, calc(100% - 32px)); padding: 9px 16px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-size: var(--fs-s); font-weight: 600; line-height: 1.4; text-align: center; opacity: 0; pointer-events: none; transition: opacity var(--t-micro) var(--cw-ease), translate var(--t-ui) var(--cw-ease); }
[dir=rtl] .cw-toast { translate: 50% 8px; inset-inline-start: auto; inset-inline-end: 50%; }
.cw-toast.is-shown { opacity: 1; translate: -50% 0; }
[dir=rtl] .cw-toast.is-shown { translate: 50% 0; }

/* ── Shared components (one recipe each) ─────────────── */
.cw-icon { inline-size: 16px; block-size: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.cw-lamp { --lamp-color: var(--signal); position: relative; display: inline-block; flex: none; inline-size: var(--lamp); block-size: var(--lamp); border-radius: 50%; background: var(--lamp-color); }
.cw-lamp.s6 { inline-size: var(--lamp-s); block-size: var(--lamp-s); }
.cw-lamp.is-off { --lamp-color: var(--off); }
.cw-lamp.is-idle { background: transparent; box-shadow: inset 0 0 0 1.5px var(--edge); }
.cw-lamp.is-human { --lamp-color: var(--human); }
.cw-lamp.is-ok { --lamp-color: var(--ok-dot); }
.cw-lamp.is-live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--lamp-color); animation: cw-breathe 2.4s var(--cw-ease) infinite; animation-play-state: var(--run); }

.cw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-block-size: var(--control-h); padding: 6px 14px; border: 1px solid var(--edge); border-radius: 999px; background: transparent; color: var(--fg); font-size: var(--fs-s); font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background-color var(--t-micro) var(--cw-ease), border-color var(--t-micro) var(--cw-ease), color var(--t-micro) var(--cw-ease), scale var(--t-micro) var(--cw-ease); }
.cw-btn:hover { border-color: var(--fg-muted); background: var(--bg-hover); }
.cw-btn:active { scale: .97; }
.cw-btn .cw-icon { inline-size: 16px; block-size: 16px; }
.cw-btn.primary { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }
.cw-btn.primary:hover { border-color: var(--primary-hover); background: var(--primary-hover); }
.cw-btn.ghost { border-color: transparent; color: var(--fg-muted); }
.cw-btn.ghost:hover { color: var(--fg); }
.cw-btn.text { min-block-size: 28px; padding: 2px 0; border: 0; border-radius: var(--r-key); }
.cw-btn.text:hover { background: none; text-decoration: underline; text-underline-offset: 4px; }
.cw-btn.text .cw-icon { transition: translate var(--t-ui) var(--cw-ease); }
.cw-btn.text:hover .cw-icon { translate: calc(3px * var(--dir)) 0; }
[dir=rtl] .cw-btn.text .cw-icon.is-forward { scale: -1 1; }
/* The machine switch: an outline pill whose lamp is the state; the words are the action. */
.cw-btn.master .cw-lamp { box-shadow: 0 0 0 3px var(--signal-soft); }
/* The one solid red action (一键优化). */
.cw-btn.signal { border-color: var(--signal-fill); background: var(--signal-fill); color: var(--on-signal-fill); }
.cw-btn.is-pressed { scale: .96; }
.cw-btn:disabled { opacity: .42; cursor: default; }

.cw-tabs { display: flex; gap: 24px; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--rule); }
.cw-tabs::-webkit-scrollbar { display: none; }
.cw-tab { position: relative; flex: none; display: inline-flex; align-items: baseline; gap: 6px; min-block-size: 36px; padding: 6px 0 10px; color: var(--fg-faint); font-size: var(--fs-m); font-weight: 650; white-space: nowrap; }
.cw-tab:hover { color: var(--fg-muted); }
.cw-tab[aria-selected="true"] { color: var(--fg); }
.cw-tab::after { content: ""; position: absolute; inset-inline: 0; inset-block-end: 0; block-size: 2px; border-radius: 2px; background: var(--fg); opacity: 0; transition: opacity var(--t-micro) var(--cw-ease); }
.cw-tab[aria-selected="true"]::after { opacity: 1; }
.cw-tab-count { font: 500 var(--fs-xs)/1 var(--font-mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }

/* Mode capsule (AI 回复 | 手动): the selected option is a raised surface; the AI side carries a lamp. */
.cw-seg { display: inline-flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--rule-strong); border-radius: 999px; }
.cw-seg-opt { display: inline-flex; align-items: center; gap: 6px; min-block-size: 28px; padding-inline: 12px; border-radius: 999px; color: var(--fg-faint); font-size: var(--fs-s); font-weight: 650; white-space: nowrap; transition: background-color var(--t-micro) var(--cw-ease), color var(--t-micro) var(--cw-ease); }
.cw-seg-opt:hover { color: var(--fg); }
.cw-seg-opt[aria-pressed="true"] { background: var(--bg-raised); color: var(--fg); box-shadow: inset 0 0 0 1px var(--edge); }
.cw-seg-opt .cw-lamp { inline-size: var(--lamp-s); block-size: var(--lamp-s); background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; opacity: .7; }
.cw-seg-opt[aria-pressed="true"] .cw-lamp { background: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); opacity: 1; }

/* Switch 38 × 22; the AI kind is the signal fill when on (grey once its scope pauses). */
.cw-switch { position: relative; flex: none; inline-size: 38px; block-size: 22px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--edge); transition: background-color var(--t-micro) var(--cw-ease), box-shadow var(--t-micro) var(--cw-ease); }
.cw-switch::before { content: ""; position: absolute; inset: -5px -3px; }
.cw-switch::after { content: ""; position: absolute; inset-block-start: 4px; inset-inline-start: 4px; inline-size: 14px; block-size: 14px; border-radius: 50%; background: var(--fg-muted); transition: translate var(--t-ui) var(--cw-ease), background-color var(--t-micro) var(--cw-ease); }
.cw-switch[aria-checked="true"] { background: var(--primary); box-shadow: none; }
.cw-switch[aria-checked="true"]::after { translate: calc(16px * var(--dir)) 0; background: var(--ink); }
.cw-switch.is-ai[aria-checked="true"] { background: var(--signal-fill); }
.cw-switch.is-ai[aria-checked="true"]::after { background: #fff; }

.cw-tag { display: inline-flex; flex: none; align-items: center; min-block-size: 20px; padding-inline: 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--off); color: var(--fg-muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }
.cw-tag.is-running { background: var(--signal-fill); box-shadow: none; color: var(--on-signal-fill); font-weight: 700; }
.cw-badge { display: inline-flex; flex: none; align-items: center; gap: 6px; min-block-size: 20px; padding-inline: 8px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--rule-strong); color: var(--fg-muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }

.cw-section-title { display: flex; align-items: baseline; gap: 12px; margin: 0 0 4px; padding-block-end: 12px; border-bottom: 1px solid var(--rule-strong); font: 800 var(--fs-xl)/1.25 var(--font-text); letter-spacing: -.01em; }
.cw-row { display: flex; align-items: center; gap: 16px; min-block-size: 60px; padding-block: 12px; border-bottom: 1px solid var(--rule); }
.cw-row-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; min-inline-size: 0; }
.cw-row-title { font-size: var(--fs-row); font-weight: 700; line-height: 1.35; }
.cw-row-sub { color: var(--fg-muted); font-size: var(--fs-s); line-height: 1.45; }
.cw-row-value { display: inline-flex; flex: none; align-items: center; gap: 6px; color: var(--fg-muted); font-size: var(--fs-s); }

.cw-num { font: 800 1em/1 var(--font-display); font-stretch: 62%; letter-spacing: -.005em; font-variant-numeric: tabular-nums lining-nums; }
.cw-mono { font-family: var(--font-mono); letter-spacing: .04em; font-variant-numeric: tabular-nums; }

.cw-avatar { position: relative; display: inline-grid; flex: none; place-items: center; inline-size: var(--size, 40px); block-size: var(--size, 40px); overflow: hidden; border-radius: 50%; background: var(--bg-fill-strong); }
.cw-avatar img { inline-size: 100%; block-size: 100%; object-fit: cover; object-position: 50% 22%; }
.cw-avatar-initial { color: var(--fg-muted); font: 800 calc(var(--size, 40px) * .42)/1 var(--font-display); font-stretch: 125%; }
/* Your own photos are crops of the hero photograph (1536 × 1024, the man at the
   café). Each crop is a 3:4 window, centre (x, y) and width w as shares of the
   photo, placed by size and offset so it fills any 3:4 frame that clips
   (position: relative; overflow: hidden). width = 1/w, left = −(x − w/2)/w,
   top = −(y − w)/(2w) of the frame. a: his portrait (w .30 at .79, .31);
   b: him at the table (w .42 at .74, .50); c: the two of them (w .50 at .62). */
.cw-self { position: absolute; inset-block-start: 0; left: 0; max-inline-size: none; block-size: auto; }
.cw-self.crop-a { inline-size: 333.33%; left: -213.33%; inset-block-start: -1.67%; }
.cw-self.crop-b { inline-size: 238.1%; left: -126.19%; inset-block-start: -9.52%; }
.cw-self.crop-c { inline-size: 200%; left: -74%; inset-block-start: 0; }

/* ── Ghost cursor: PILOT's own pointer while the demo flies itself ── */
.cw-cursor {
  --x: 50%;
  --y: 50%;
  position: absolute;
  z-index: 5;
  inset-block-start: 0;
  left: 0;
  display: flex;
  align-items: flex-start;
  gap: 2px;
  pointer-events: none;
  translate: var(--x) var(--y);
  opacity: 0;
  transition: translate var(--glide, 700ms) cubic-bezier(.45, .05, .2, 1), opacity var(--t-ui) var(--cw-ease);
}
.cw-cursor.is-shown { opacity: 1; }
.cw-cursor-arrow { inline-size: 18px; block-size: 22px; margin: -2px 0 0 -2px; filter: drop-shadow(0 2px 4px rgb(0 0 0 / .6)); }
.cw-cursor-arrow path { fill: var(--bone); stroke: var(--ink); stroke-width: 1.2; stroke-linejoin: round; }
.cw-cursor-tag { margin-block-start: 16px; max-inline-size: 240px; padding: 4px 10px 5px; border-radius: 4px 999px 999px 999px; background: var(--red-cta); color: #fff; font-size: var(--fs-xs); font-weight: 700; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 6px 18px -6px rgb(0 0 0 / .7); }
.cw-cursor-tag b { margin-inline-end: 6px; font: 800 var(--fs-micro)/1 var(--font-display); font-stretch: 125%; letter-spacing: .02em; }
.cw-cursor-tag:empty { display: none; }
/* The cursor flips its label to the left near the window's inline end. */
.cw-cursor.is-flipped { flex-direction: row-reverse; }
.cw-cursor.is-flipped .cw-cursor-tag { border-radius: 999px 4px 999px 999px; }
.cw-cursor.is-flipped .cw-cursor-arrow { margin: -2px -2px 0 0; }
.cw-cursor::after { content: ""; position: absolute; inset-block-start: -14px; left: -14px; inline-size: 28px; block-size: 28px; border-radius: 50%; border: 2px solid var(--bone); opacity: 0; scale: .3; }
.cw-cursor.is-press::after { animation: cw-press .5s var(--cw-ease); }
.cw-cursor.is-press .cw-cursor-arrow { scale: .88; transition: scale .12s; }
.cw[data-mode="human"] .cw-cursor { opacity: 0; }

/* ── Keyframes ───────────────────────────────────────── */
@keyframes cw-breathe { 0% { transform: scale(1); opacity: .55; } 70%, 100% { transform: scale(var(--breathe, 2.8)); opacity: 0; } }
@keyframes cw-rise { from { opacity: 0; translate: 0 6px; } }
@keyframes cw-spin { to { rotate: 360deg; } }
@keyframes cw-bump { 40% { scale: 1.25; } }
@keyframes cw-press { 0% { opacity: .9; scale: .3; } 100% { opacity: 0; scale: 1.4; } }
@keyframes cw-spend { 0% { opacity: 0; translate: 0 4px; } 20% { opacity: 1; translate: 0 -6px; } 100% { opacity: 0; translate: 0 -18px; } }
@keyframes cw-in { from { opacity: 0; translate: 0 8px; } }

/* ── Container breakpoints (the window's width, like the real client's window) ── */
@container cw (max-width: 1080px) {
  .cw-sync-words { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
@container cw (max-width: 880px) {
  .cw-main { --pane-x: 16px; }
  .cw-search { flex: none; inline-size: var(--control-h); min-inline-size: 0; justify-content: center; border: 0; }
  .cw-search-label, .cw-search .cw-kbd { display: none; }
  .cw-title { flex: 1 1 auto; min-inline-size: 0; overflow: hidden; text-overflow: ellipsis; }
  .cw-caption { display: none; }
}
/* Phones: the rail becomes a labelled bottom tab bar, its index on the top edge. */
@container cw (max-width: 599px) {
  .cw-app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .cw-rail { order: 2; flex-direction: row; padding: 0 4px; border-inline-end: 0; border-top: 1px solid var(--rule); }
  .cw-rail-brand, .cw-rail-foot { display: none; }
  .cw-nav { flex-direction: row; gap: 0; padding: 0; }
  .cw-nav > li { flex: 1; min-inline-size: 0; }
  .cw-nav-btn { min-block-size: 56px; padding: 8px 2px 6px; }
  .cw-nav-btn::before { inset-block: 0 auto; inset-inline: 24%; inline-size: auto; block-size: 2px; border-radius: 0 0 2px 2px; scale: .3 1; }
  .cw-nav-btn[aria-current="page"]::before { scale: 1 1; }
  .cw-main { order: 1; }
  .cw-bar { gap: 8px; padding-inline: 16px 12px; }
  .cw-bar-mark { display: block; }
  .cw-title { font-size: var(--fs-l); }
  .cw-sync, .cw-bar-sep { display: none; }
  .cw-credits-unit { display: none; }
  .cw-pane { padding: 16px 16px 32px; }
}

/* ── Page placement and the phone strip ──────────────── */
@media (max-width: 760px) {
  .cw-strip { flex-wrap: wrap; gap: 10px 12px; padding-inline: 14px 8px; padding-block: 6px 12px; }
  .cw-state { flex: 1; max-inline-size: none; }
  .cw-state-hint { display: none; }
  .cw-sops { display: none; }
  .cw-segments { display: flex; flex-basis: 100%; gap: 4px; order: 3; }
  .cw-segments > i { flex: 1; block-size: 2px; border-radius: 2px; background: var(--rule); overflow: clip; }
  .cw-segments > i > b { display: block; block-size: 100%; background: var(--signal); transform: scaleX(var(--p, 0)); transform-origin: 0 50%; }
  [dir=rtl] .cw-segments > i > b { transform-origin: 100% 50%; }
  .cw-segments > i.is-human > b { background: var(--human); }
  .cw[data-mode="human"] .cw-segments > i > b { background: var(--fg-faint); }
}
@media (max-width: 640px) {
  .cw { --cw-h: min(700px, max(560px, calc(100svh - 120px))); border-radius: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cw *, .cw *::before, .cw *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .cw-cursor { display: none; }
}
@media (forced-colors: active) {
  .cw-lamp, .cw-mark-dot, .cw-switch { forced-color-adjust: none; }
  .cw-nav-btn[aria-current="page"], .cw-tab[aria-selected="true"], .cw-seg-opt[aria-pressed="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
}
