/* Hallmark · shape: app screen · genre: modern-minimal · theme: Console (deal 2/3, seed operations-console-where-founder-cfab·ebaed508·2026-11-16·r0) · redesign: full
 * nav: kept sidebar (8 destinations) and top line · signature: the decision ledger (Home) and the record trail (Needs you) · states: full, empty, first run (the app's own) · console: graphite (dark), paper (light)
 * axes: dark/grotesk-sans/chromatic-amber · posture: restrained · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E3 S4 R4 V4 · weakest: E, the Studio scene keeps its own illustrated palette and the lower Home sections (pipeline, crew status, week) are restyled rather than recomposed */
/* Hallmark · note: fonts · the prototype CSP is font-src none and loopback only, so the theme faces are not loaded; the system grotesk and Cascadia Mono stand in (two families) */
/* Hallmark · note: vendor/bootstrap-5.3.8 stays loaded for the grid and list classes the untouched routes use; its own findings (about 515) are outside this stylesheet and were present before */
/* Hallmark · dismissed 40 · static estimate: chip text measured in the browser at 7.0:1 or more in both colourways */
/* Hallmark · dismissed F7 · Console cuts every panel from one surface by design; a panel's role shows in its content and its amber or cool chips */
/* Hallmark · dismissed 19 · verbatim records: fixture text, user input, JSON and evidence render exactly as stored (V08-F02); the app's own copy uses commas */
/* Hallmark · dismissed 41 · accent-ink is only ever set on an amber fill, never on the ground */
/* Hallmark · dropped page pretitles ("Overview · Shadow mode · simulation data", "Decisions · ordered by importance", "Operations") · gate 9 names eyebrows; Shadow and Simulation stay as chips on Home */
@import url("./tokens.css");
@import url("./base.css");

/* Console tokens, adjusted for this app: system faces (see waiver), muted a step brighter so body text holds 7:1 on panels (the app's AAA target). */
:root {
  --color-muted: oklch(75% 0.01 250);
  --color-accent-text: var(--color-accent); --color-cool-text: oklch(80% 0.1 245);
  --color-bad: oklch(79% 0.12 25); --color-ok: oklch(80% 0.13 150);
}
/* Paper colourway (the theme's light dial): amber and cool keep their meanings, darkened for text on paper. */
:root[data-theme="light"] {
  color-scheme: light;
  --color-paper: oklch(98% 0.006 85); --color-paper-2: oklch(99.6% 0.003 85); --color-paper-3: oklch(95% 0.008 85);
  --color-ink: oklch(19% 0.01 60); --color-ink-2: oklch(30% 0.01 60); --color-muted: oklch(43% 0.012 60);
  --color-rule: oklch(89% 0.008 85); --color-rule-2: oklch(60% 0.012 70);
  --color-accent: oklch(80% 0.15 80); --color-accent-ink: oklch(19% 0.04 75); --color-accent-soft: oklch(94% 0.05 85); --color-focus: oklch(46% 0.13 70);
  --color-accent-text: oklch(41% 0.11 65);
  --color-cool: oklch(52% 0.14 250); --color-cool-soft: oklch(94% 0.03 245); --color-cool-text: oklch(42% 0.14 250);
  --color-ok: oklch(40% 0.11 150); --color-ok-soft: oklch(94% 0.04 150); --color-bad: oklch(42% 0.15 25); --color-bad-soft: oklch(94% 0.03 25);
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    color-scheme: light;
    --color-paper: oklch(98% 0.006 85); --color-paper-2: oklch(99.6% 0.003 85); --color-paper-3: oklch(95% 0.008 85);
    --color-ink: oklch(19% 0.01 60); --color-ink-2: oklch(30% 0.01 60); --color-muted: oklch(43% 0.012 60);
    --color-rule: oklch(89% 0.008 85); --color-rule-2: oklch(60% 0.012 70);
    --color-accent: oklch(80% 0.15 80); --color-accent-ink: oklch(19% 0.04 75); --color-accent-soft: oklch(94% 0.05 85); --color-focus: oklch(46% 0.13 70);
    --color-accent-text: oklch(41% 0.11 65);
    --color-cool: oklch(52% 0.14 250); --color-cool-soft: oklch(94% 0.03 245); --color-cool-text: oklch(42% 0.14 250);
    --color-ok: oklch(40% 0.11 150); --color-ok-soft: oklch(94% 0.04 150); --color-bad: oklch(42% 0.15 25); --color-bad-soft: oklch(94% 0.03 25);
  }
}

/* Token bridge: the app's own names now resolve to Console, so every route takes the system.
 * Meanings: amber is you (a decision, the primary action); cool is an instrument (an agent, a simulation, a reading); ok and bad are status only. */
:root, :root[data-theme] {
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s6: 24px; --s8: 32px; --s10: 40px; --s12: 48px; --s16: 64px;
  --bg: var(--color-paper); --surface: var(--color-paper-2); --surface-2: var(--color-paper-3); --line: var(--color-rule); --line-strong: var(--color-rule-2);
  --fg: var(--color-ink); --muted: var(--color-muted);
  --accent: var(--color-accent); --accent-ink: var(--color-accent-ink); --accent-text: var(--color-accent-text); --accent-soft: var(--color-accent-soft); --accent-ring: var(--color-accent-text);
  --focus: var(--color-focus); --select: var(--color-ink); --select-soft: var(--color-paper-3);
  --red: var(--color-bad); --red-soft: var(--color-bad-soft); --green: var(--color-ok); --green-soft: var(--color-ok-soft);
  --violet: var(--color-cool-text); --violet-soft: var(--color-cool-soft); --blue: var(--color-cool-text); --blue-soft: var(--color-cool-soft);
  --unk: var(--color-muted); --unk-soft: var(--color-paper-3);
  --ring-green: var(--color-ok); --ring-amber: var(--color-accent-text); --ring-violet: var(--color-cool); --ring-red: var(--color-bad); --ring-unk: var(--color-rule-2);
  --shadow: none; --radius: var(--radius-card); --radius-s: var(--radius-pill);
  --hatch: color-mix(in oklab, var(--color-paper-2) 30%, transparent);
  /* Studio scene art keeps its own palette (an illustration, not UI chrome). */
  --space: oklch(17% 0.02 260); --scene-focus: oklch(80% 0.14 75); --hull: oklch(91% 0.015 85); --hull-edge: oklch(76% 0.025 80); --floor: oklch(33% 0.01 70); --floor-2: oklch(37% 0.012 70); --deck-line: oklch(45% 0.012 70);
  --glow: oklch(78% 0.15 75); --cyan: oklch(80% 0.07 210); --desk: oklch(50% 0.015 75); --desk-top: oklch(60% 0.015 80);
}

* { box-sizing: border-box; }
html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; font-variant-numeric: tabular-nums; }
h1, h2, h3, p, ul, ol, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button { font: inherit; color: inherit; }
.mono, .measured { font-family: var(--font-outlier); font-size: var(--text-sm); font-variant-numeric: tabular-nums slashed-zero; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap-any { overflow-wrap: anywhere; }

/* HugeIcons: 24x24 grid, currentColor stroke; rendered 20px (inline) or 24px (nav). Decorative: aria-hidden. */
.hi { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.hi-24 { width: 24px; height: 24px; }

.skip { position: absolute; left: var(--s4); top: 0; transform: translateY(-110%); z-index: 50; background: var(--fg); color: var(--bg);
  padding: var(--s3) var(--s4); border-radius: var(--s2); text-decoration: none; }
.skip:focus { top: var(--s3); transform: none; }

.demo-banner { background: var(--color-paper-3); color: var(--color-ink-2); border-bottom: 1px solid var(--line); padding: var(--s2) var(--s8); font-size: var(--text-sm); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; } /* v0.7.1 QA1-F01: banner moved into .content */
.shell.collapsed { grid-template-columns: 80px minmax(0, 1fr); }
.sidebar { align-self: start; height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--s1); padding: var(--s6) var(--s3); border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: var(--s3); padding: var(--s1) var(--s2) var(--s6); }
.brand-mark { width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--fg); color: var(--bg);
  display: grid; place-items: center; font-weight: 800; font-size: var(--text-md); flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 600; }
.brand-sub { font-size: var(--text-sm); color: var(--muted); }
.nav-heading { font-size: var(--text-sm); color: var(--muted); font-weight: 600; padding: var(--s6) var(--s3) var(--s2); }
.nav-list { display: flex; flex-direction: column; gap: var(--s1); }
.nav-link { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 0 var(--s3); border-radius: var(--radius-pill); color: var(--color-ink-2);
  text-decoration: none; color: var(--fg); }
.nav-link .count { margin-left: auto; min-width: 24px; height: 24px; padding: 0 var(--s2); border-radius: 4px; font-family: var(--font-outlier);
  background: var(--accent); color: var(--accent-ink); font-size: var(--text-sm); font-weight: 700; display: grid; place-items: center; }
.nav-bottom { margin-top: auto; padding-top: var(--s4); border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: var(--s1); }
.collapse-btn { display: flex; align-items: center; gap: var(--s3); min-height: 48px; padding: 0 var(--s3); border: 0; background: none;
  border-radius: var(--s3); cursor: pointer; color: var(--muted); text-align: left; }
.shell.collapsed .label, .shell.collapsed .brand-text, .shell.collapsed .nav-heading, .shell.collapsed .count { display: none; }
.shell.collapsed .nav-link, .shell.collapsed .collapse-btn { justify-content: center; padding: 0; }
.tip { position: relative; }
.shell.collapsed .nav-link:hover::after, .shell.collapsed .nav-link:focus-visible::after,
.icon-btn:hover::after, .icon-btn:focus-visible::after {
  content: attr(data-tip); position: absolute; left: calc(100% + var(--s2)); top: 50%; transform: translateY(-50%); z-index: 40;
  background: var(--fg); color: var(--bg); padding: var(--s1) var(--s2); border-radius: var(--s2); font-size: var(--text-sm); white-space: nowrap; font-weight: 600; }
.icon-btn:hover::after, .icon-btn:focus-visible::after { left: 50%; top: auto; bottom: calc(100% + var(--s2)); transform: translateX(-50%); }

.content { min-width: 0; display: flex; flex-direction: column; }
.topline { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); padding: var(--s3) var(--s8); border-bottom: 1px solid var(--line); min-height: 56px; }
.topline .src { color: var(--muted); font-size: var(--text-sm); }
main { padding: var(--s8) var(--s8) var(--s16); max-width: 1280px; width: 100%; outline: none; }
.page-head { margin-bottom: var(--s6); }
.page-head h1 { font-size: var(--text-2xl); line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.page-head p { color: var(--muted); margin-top: var(--s2); max-width: 70ch; }

/* ---------- building blocks ---------- */
.section { margin-top: var(--s6); }
.section > h2 { font-size: var(--text-lg); font-weight: 650; margin-bottom: var(--s3); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--s6); }
.stack > * + * { margin-top: var(--s3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); }
.meta { color: var(--muted); font-size: var(--text-sm); }
.kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: var(--s2) var(--s6); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; overflow-wrap: anywhere; }

.badge { display: inline-flex; align-items: center; gap: var(--s1); padding: 0 var(--s2); min-height: 24px; border-radius: 4px; font-size: var(--text-sm); font-weight: 500;
  border: 1px solid transparent; line-height: 1.5; max-width: 100%; overflow-wrap: anywhere; }
.badge .hi { width: 16px; height: 16px; }
.b-red { background: var(--red-soft); color: var(--red); border-color: color-mix(in oklab, var(--red) 45%, transparent); }
.b-amber { background: var(--accent-soft); color: var(--accent-text); border-color: color-mix(in oklab, var(--accent-text) 45%, transparent); }
.b-green { background: var(--green-soft); color: var(--green); }
.b-violet { background: var(--violet-soft); color: var(--violet); border-color: color-mix(in oklab, var(--violet) 40%, transparent); }
.b-blue { background: var(--blue-soft); color: var(--blue); border-color: color-mix(in oklab, var(--blue) 40%, transparent); }
.b-unk { background: var(--unk-soft); color: var(--unk); border: 1px dashed var(--line-strong); }
.b-neutral { background: var(--surface-2); color: var(--fg); border-color: var(--line); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; text-decoration: none; font-weight: 500; white-space: nowrap; transition: background-color var(--dur-micro) var(--ease-out); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.icon-btn { width: 48px; padding: 0; position: relative; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.demo-note { font-size: var(--text-sm); color: var(--muted); }

details.disclosure { border-top: 1px solid var(--line); }
details.disclosure > summary { min-height: 48px; display: flex; align-items: center; gap: var(--s2); cursor: pointer; font-weight: 600; list-style: none; padding: var(--s1) 0; }
details.disclosure > summary::-webkit-details-marker { display: none; }
details.disclosure > summary .disc-ico { color: var(--muted); }
details.disclosure[open] > summary .disc-ico { transform: rotate(90deg); }
details.disclosure > .inner { padding: var(--s1) 0 var(--s4); }

.seg { display: inline-flex; flex-wrap: wrap; gap: 0; padding: 0; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.seg button { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; min-width: 44px; padding: 0 var(--s4); border-radius: 0;
  border: 0; border-right: 1px solid var(--line); background: transparent; cursor: pointer; color: var(--muted); font-weight: 500; }
.seg button:last-child { border-right: 0; }

/* ---------- Home / Needs you / Work (carried from v0.3, tokenised) ---------- */
.hero { border-color: var(--line-strong); }
.hero .eyebrow { color: var(--accent-text); font-weight: 650; font-size: var(--text-md); }
.hero h2 { font-size: var(--text-xl); line-height: 1.25; margin: var(--s2) 0 var(--s3); }
.why { display: grid; grid-template-columns: minmax(110px, max-content) minmax(0, 1fr); gap: var(--s2) var(--s4); margin-top: var(--s2); }
.why dt { color: var(--muted); font-weight: 600; }
.why dd { margin: 0; }
.alt h3 { font-size: var(--text-md); margin-bottom: var(--s2); }
.blocker-list li { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.blocker-list li:first-child { border-top: 0; padding-top: 0; }
.blocker-list li > * { flex: none; }
.blocker-list li > div { flex: 1 1 14rem; min-width: 0; overflow-wrap: anywhere; }
.mini-studio { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.mini-agent { padding: var(--s3); border-radius: var(--radius-s); background: var(--surface-2); }
.mini-agent .name { font-weight: 650; }
.filters { margin-bottom: var(--s4); }
.split { display: grid; grid-template-columns: minmax(300px, 384px) minmax(0, 1fr); gap: var(--s6); align-items: start; }
.need-list { display: flex; flex-direction: column; gap: var(--s2); }
.need-item { display: block; width: 100%; text-align: left; padding: var(--s4); border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; text-decoration: none; }
.need-item .t { font-weight: 650; margin: var(--s2) 0 var(--s1); overflow-wrap: anywhere; }
.need-item .m { color: var(--muted); font-size: var(--text-sm); }
.detail h2 { font-size: var(--text-xl); line-height: 1.25; overflow-wrap: anywhere; }
.layers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); margin: var(--s4) 0 var(--s2); }
.layer { padding: var(--s3) var(--s4); border-radius: var(--radius-s); background: var(--surface-2); min-width: 0; }
.layer .k { color: var(--muted); font-size: var(--text-sm); font-weight: 600; }
.layer .v { font-weight: 650; overflow-wrap: anywhere; }
.layer.you { background: var(--accent-soft); }
.back { margin-bottom: var(--s4); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-md); }
th, td { text-align: left; padding: var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
th { color: var(--muted); font-weight: 600; font-size: var(--text-sm); }
.table-wrap td .badge, .table-wrap td.nowrap { white-space: nowrap; overflow-wrap: normal; }
.task-row { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); align-items: baseline; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.task-row:first-of-type { border-top: 0; }
.task-row .title { font-weight: 600; flex: 1 1 280px; min-width: 0; overflow-wrap: anywhere; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--s4); }
.pipeline-flow { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.pipeline-flow .step { padding: var(--s2) var(--s3); border-radius: var(--s3); background: var(--surface-2); font-weight: 600; font-size: var(--text-md); }
.pipeline-flow .arrow { color: var(--muted); }
fieldset.card { margin: 0; }
fieldset.card legend { font-weight: 650; padding: 0 var(--s2); }
fieldset.card label { display: flex; align-items: center; gap: var(--s3); min-height: 44px; cursor: pointer; margin: 0; }
fieldset.card input[type="radio"] { width: 20px; height: 20px; accent-color: var(--accent-ring); }
.callout { background: var(--blue-soft); color: var(--fg); border-radius: var(--radius-s); padding: var(--s3) var(--s4); font-size: var(--text-md); }

/* ---------- Studio v0.4 ---------- */
.mission-strip { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s4) var(--s6);
  border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: var(--s6); }
.mission-strip .eyebrow { display: flex; align-items: center; gap: var(--s2); color: var(--accent-text); font-weight: 650; font-size: var(--text-md); }
.mission-strip h2 { font-size: var(--text-lg); margin-top: var(--s1); }
.mission-strip p { margin-top: var(--s1); }
.studio-bar { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); align-items: center; justify-content: space-between; margin-bottom: var(--s4); }
.source-legend { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; font-size: var(--text-sm); }
.source-legend .off { color: var(--muted); }

.scene-wrap { border-radius: 24px; overflow: hidden; border: 1px solid var(--line); background: var(--space); position: relative; }
.scene { position: relative; width: 100%; overflow: hidden; touch-action: none; }
svg.art-static { display: block; width: 100%; height: auto; }
.scene svg.art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scene .overlay { position: absolute; inset: 0; pointer-events: none; }
.scene .overlay > * { pointer-events: auto; position: absolute; transform: translate(-50%, -50%); }
.room-label { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4); border-radius: 999px;
  background: var(--surface); color: var(--fg); border: 2px solid var(--line-strong); font-weight: 700; font-size: var(--text-md); cursor: pointer; white-space: nowrap; }
.room-label.command { border-color: var(--accent-ring); }
.room-label.proposed { border-style: dashed; }
.room-label[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.room-label .sub { font-weight: 600; font-size: var(--text-sm); color: var(--muted); }
.room-label[aria-pressed="true"] .sub { color: var(--bg); }
.crew { display: flex; flex-direction: column; align-items: center; gap: var(--s1); background: none; border: 0; padding: 0; cursor: pointer; }
.crew .body { width: 56px; height: 56px; border-radius: 16px; background: var(--surface); border: 3px solid var(--ring-unk); display: grid; place-items: center; position: relative; }
.crew .body svg { width: 40px; height: 40px; }
.crew.s-working .body { border-color: var(--ring-green); }
.crew.s-waiting_founder .body { border-color: var(--ring-amber); }
.crew.s-in_review .body { border-color: var(--ring-violet); }
.crew.s-blocked .body { border-color: var(--ring-red); }
.crew.s-unknown .body, .crew.stale .body, .crew.s-planned .body, .crew.s-proposed .body { border-style: dashed; }
.crew .count, .crew .flag { position: absolute; min-width: 24px; height: 24px; border-radius: 999px; display: grid; place-items: center; font-size: var(--text-xs); font-weight: 800; padding: 0 var(--s1); }
.crew .count { top: -8px; right: -12px; background: var(--fg); color: var(--bg); }
.crew .flag { bottom: -8px; right: -12px; background: var(--ring-red); color: var(--surface); }
.crew .flag .hi { width: 16px; height: 16px; }
.crew .cap { background: var(--surface); color: var(--fg); border-radius: var(--s2); padding: 0 var(--s2); font-size: var(--text-sm); font-weight: 650; line-height: 1.5; max-width: 152px; text-align: center; }
.bay-label { background: var(--surface); color: var(--fg); border-radius: var(--s2); padding: 0 var(--s2); font-size: var(--text-sm); font-weight: 700; line-height: 1.5; white-space: nowrap; border: 1px dashed var(--line-strong); }
.crew[aria-pressed="true"] .body { box-shadow: 0 0 0 3px var(--space), 0 0 0 6px var(--scene-focus); }
/* Scene focus: two-tone ring (dark inner, amber outer) so one ring is >=3:1 against both the space backdrop and the light hull, in both themes.
   Transparent outline is kept for forced-colors mode. */
.scene .overlay :focus-visible { outline: 3px solid transparent; outline-offset: 0; box-shadow: 0 0 0 3px var(--space), 0 0 0 6px var(--scene-focus); }
.scene .overlay .crew:focus-visible { box-shadow: none; }
.scene .overlay .crew:focus-visible .body { box-shadow: 0 0 0 3px var(--space), 0 0 0 6px var(--scene-focus); }
.scene.compact .crew .cap, .scene.compact .room-label .sub, .scene.compact .bay-label { display: none; }
.scene.compact .crew .body { width: 44px; height: 44px; border-radius: 12px; }
.scene.compact .crew .body svg { width: 32px; height: 32px; }
.crew .pulse { position: absolute; inset: -8px; border-radius: 20px; border: 2px solid var(--ring-green); opacity: 0; }
.motion-on .crew .pulse { animation: pulse 2.4s ease-out 3; }
@keyframes pulse { 0% { transform: scale(.9); opacity: .7; } 100% { transform: scale(1.2); opacity: 0; } }
.desk-chip { display: inline-flex; align-items: center; min-height: 32px; padding: 0 var(--s2); border-radius: var(--s2); background: var(--surface); color: var(--fg);
  border: 1px dashed var(--line-strong); font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
button.desk-chip { min-height: 44px; padding: 0 var(--s3); cursor: pointer; } /* interactive chip meets the 44 px target; empty-desk chips are static text */

.camera { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; padding: var(--s3); background: var(--surface); border-top: 1px solid var(--line); }
.camera .zoom-level { color: var(--muted); font-size: var(--text-sm); margin-left: var(--s2); }
.camera .spacer { flex: 1; }
.room-panel, .inspector { margin-top: var(--s6); }
.room-panel h2, .inspector h2 { font-size: var(--text-xl); display: flex; align-items: center; gap: var(--s2); }
.desk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); margin-top: var(--s4); }
.desk-card { border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s3) var(--s4); background: var(--surface-2); color: var(--fg); min-width: 0; }
.desk-card.empty { border-style: dashed; background: transparent; }
.desk-card .k { font-size: var(--text-sm); color: var(--muted); font-weight: 600; }
.desk-card .v { font-weight: 650; overflow-wrap: anywhere; }
.lineage { border: 1px solid var(--line); border-radius: var(--radius-pill); padding: var(--s3) var(--s4); margin-top: var(--s3); }
.legend { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); align-items: center; }
.mission-card { border-color: var(--line-strong); }
.mission-card.main { border-color: var(--accent-text); }
.mission-card h3 { font-size: var(--text-lg); margin: var(--s1) 0 var(--s3); }
.mission-card ul.ticks li { padding-left: var(--s6); position: relative; }
.mission-card ul.ticks li::before { content: "–"; position: absolute; left: var(--s2); color: var(--muted); }
.crew-list .team { margin-top: var(--s6); }
.crew-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s3) 0; border-top: 1px solid var(--line); }
.crew-row:first-of-type { border-top: 0; }
.crew-row .who { font-weight: 650; overflow-wrap: anywhere; }
.crew-row .mini { width: 48px; height: 48px; border-radius: 14px; border: 3px solid var(--ring-unk); display: grid; place-items: center; background: var(--surface); }
.crew-row .mini svg { width: 32px; height: 32px; }
.crew-row .mini.dashed { border-style: dashed; }
.crew-row.s-working .mini { border-color: var(--ring-green); }
.crew-row.s-waiting_founder .mini { border-color: var(--ring-amber); }
.crew-row.s-in_review .mini { border-color: var(--ring-violet); }
.crew-row.s-blocked .mini { border-color: var(--ring-red); }
.map-mobile-note { padding: var(--s4); color: var(--fg); background: var(--surface); }
.room-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); padding: var(--s3); background: var(--surface); }

/* ---------- compact bar ---------- */
.tabbar { display: none; }

@media (max-width: 1199px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .layers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mini-studio { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 759px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  main { padding: var(--s6) var(--s4) 128px; }
  .topline { padding: var(--s2) var(--s4); }
  .demo-banner { padding: var(--s2) var(--s4); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .page-head h1 { font-size: var(--text-2xl); }
  .kv, .why { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .kv dd, .why dd { margin-bottom: var(--s3); }
  .card { padding: var(--s4); }
  .mission-strip { grid-template-columns: minmax(0, 1fr); padding: var(--s4); }
  .agent-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .agent-table, .agent-table tbody, .agent-table tr, .agent-table th, .agent-table td { display: block; width: 100%; }
  .tabbar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line);
    padding: var(--s2) var(--s2) calc(var(--s2) + env(safe-area-inset-bottom)); }
  .tabbar > ul { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s1); }
  .tabbar > ul.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tabbar li { min-width: 0; }
  .tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1); min-height: 56px; width: 100%;
    border-radius: var(--s3); text-decoration: none; font-size: var(--text-sm); border: 0; background: none; cursor: pointer; color: var(--fg); }
  .tab span { max-width: 100%; text-align: center; overflow-wrap: anywhere; }
  .more-menu { position: absolute; right: var(--s2); bottom: calc(100% + var(--s2)); width: min(304px, calc(100% - 16px)); background: var(--surface);
    border: 1px solid var(--line-strong); border-radius: var(--s4); box-shadow: var(--shadow); padding: var(--s2); }
  .more-title { font-weight: 700; padding: var(--s2) var(--s3); }
  .crew-row { grid-template-columns: 48px minmax(0, 1fr); }
  .crew-row > :last-child { grid-column: 2; }
}


/* ---------- R1: Home, Resources, Import, Settings ---------- */
.page-head.compact { margin-bottom: var(--s4); }
.page-head.compact p { max-width: none; }
.page-head.compact h1 { font-size: var(--text-xl); }
.home-row { margin-top: var(--s4); }
.q { display: flex; flex-direction: column; gap: var(--s2); }
.q-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.q-title, .hero h2.q-title { font-size: var(--text-md); font-weight: 700; line-height: 1.5; margin: 0; }
.happening .q-lead { font-size: var(--text-md); }
.q-more { font-size: var(--text-sm); font-weight: 600; min-height: 44px; min-width: 44px; padding: 0 var(--s2); justify-content: center; display: inline-flex; align-items: center; }
.q-head { margin: calc(-1 * var(--s2)) 0; }
.q-lead { font-size: var(--text-lg); font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.happening { flex-direction: column; }
.need-mini { display: flex; flex-direction: column; gap: 0; }
.need-mini li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); min-height: 32px; }
.need-mini li a { flex: 1 1 12rem; min-width: 0; min-height: 44px; display: inline-flex; align-items: center; }
.improve-line { margin-top: auto; padding-top: var(--s2); border-top: 1px solid var(--line); font-size: var(--text-sm); }
.cap-mini { display: flex; flex-direction: column; gap: var(--s3); }
.cap-mini li + li { border-top: 1px solid var(--line); padding-top: var(--s3); }
.cap-name { font-weight: 650; font-size: var(--text-md); }
.cap-val { font-weight: 650; }
.fict { align-self: flex-start; font-size: var(--text-xs); font-weight: 650; color: var(--muted); border: 1px dashed var(--line-strong); border-radius: var(--s2); padding: 0 var(--s2); }
.setup-card { border: 1px solid var(--line); border-radius: var(--radius-s); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; }
.setup-card h3 { font-size: var(--text-md); }
.rec-list { display: flex; flex-direction: column; gap: var(--s4); }
.rec-list > li + li { border-top: 1px solid var(--line); padding-top: var(--s4); }
.rec-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.rec-finding { flex: 1 1 100%; font-weight: 600; }
.tabs-nav { margin-bottom: var(--s6); }
.seg-link { display: inline-flex; align-items: center; min-height: 44px; padding: 0 var(--s4); border-radius: var(--s2); text-decoration: none; color: var(--fg); font-weight: 600; }
.res-intro { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: var(--s4); }
.cap-row + .cap-row, .cap-row + .section { margin-top: var(--s4); }
.cap-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.cap-title h2 { font-size: var(--text-lg); }
.win-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); }
.win-list li { display: flex; flex-direction: column; gap: var(--s1); }
.win-name { font-size: var(--text-sm); font-weight: 650; color: var(--muted); }
.win-val { font-weight: 650; overflow-wrap: anywhere; }
.bar { height: 8px; border-radius: var(--s1); background: var(--surface-2); border: 1px solid var(--line-strong); overflow: hidden; }
.bar .fill { display: block; height: 100%; width: 0; background: var(--fg); }
.bar-old .fill { background: repeating-linear-gradient(45deg, var(--muted) 0 4px, transparent 4px 8px); }
.err-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.table-wrap table { width: 100%; border-collapse: collapse; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-out td { color: var(--muted); }
.row-out td.num { text-decoration: line-through; }
.import .field { display: flex; flex-direction: column; gap: var(--s1); max-width: 32rem; }
.import label { font-weight: 650; }
.import input, .import select, .top-ctl select { min-height: 44px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--s2); background: var(--surface); color: var(--fg); font: inherit; max-width: 100%; }
.import input[aria-invalid="true"] { border-color: var(--ring-red); outline: 1px solid var(--ring-red); outline-offset: -2px; }
.field-err { display: flex; align-items: center; gap: var(--s1); color: var(--red); font-weight: 600; font-size: var(--text-sm); }
.err-summary { border: 2px solid var(--ring-red); background: var(--red-soft); color: var(--fg); border-radius: var(--s2); padding: var(--s3) var(--s4); }
.json { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--text-sm); background: var(--surface-2); padding: var(--s3); border-radius: var(--s2); }
.steps { display: flex; flex-direction: column; gap: var(--s4); }
.steps h3 { font-size: var(--text-md); }
.src-name { font-weight: 650; }
.toggle-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: var(--s1) var(--s3); align-items: center; }
.toggle-row input { width: 20px; height: 20px; margin: 0; }
.toggle-row .meta { grid-column: 2; }
.toggle-row label { min-height: 44px; display: flex; align-items: center; } /* v0.7.2 F03: controls stay disabled */
.top-ctl { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); margin-left: auto; }
.theme-toggle { min-height: 44px; color: var(--fg); } /* v0.7.1 QA1-F02 */
.sel { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-size: var(--text-sm); color: var(--muted); max-width: 100%; min-width: 0; }
.sel select { min-width: 0; max-width: 100%; }
.sel.proto select { border-style: dashed; }
.btn { white-space: normal; max-width: 100%; text-align: center; }
.b-short { display: none; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; min-height: 24px; }
h1, h2, h3 { overflow-wrap: anywhere; }
.tabbar .tab { min-width: 0; padding: 0 var(--s1); }
.tabbar .tab span { overflow-wrap: normal; word-break: normal; hyphens: none; min-width: 0; max-width: 100%; }
@media (max-width: 1023px) { .win-list { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 759px) {
  .top-ctl { margin-left: 0; width: 100%; }
  .sel, .sel select { width: 100%; }
  .tabs-nav { display: flex; }
  .b-long { display: none; }
  .top-badge { display: none; }
  .b-short { display: inline; }
  .topline { gap: var(--s1) var(--s2); }
  .view-opts { width: 100%; }
  .view-opts > summary { display: flex; align-items: center; gap: var(--s2); min-height: 44px; cursor: pointer; font-size: var(--text-sm); font-weight: 600; list-style: none; }
  .view-opts > summary::-webkit-details-marker { display: none; }
  .view-opts[open] > summary .disc-ico { transform: rotate(90deg); }
  .view-opts .top-ctl { padding-bottom: var(--s2); }
  /* Data tables become labelled stacked rows on phones (no sideways scrolling, no mid-word breaks). */
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table td { display: block; width: 100%; }
  .stack-table tr { padding: var(--s3) 0; border-top: 1px solid var(--line); }
  .stack-table td { padding: var(--s1) 0; border: 0; text-align: left; white-space: normal; }
  .stack-table td::before { content: attr(data-label); display: block; font-size: var(--text-sm); font-weight: 650; color: var(--muted); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- v0.6 Home: Agent Ops patterns, rebuilt in SP tokens (no template code, text or assets) ---------- */
.eyebrow { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--text-sm); font-weight: 500; color: var(--muted); }
.hero .eyebrow { color: var(--accent-text); font-size: var(--text-sm); }
.eyebrow-dot { display: none; }
.page-head.compact .eyebrow { margin-bottom: var(--s2); }
.sec-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s2); }
.sec-head h2 { font-size: var(--text-xl); font-weight: 500; letter-spacing: var(--tracking-display); line-height: 1.2; margin-top: var(--s1); }
.sec-lead { margin-bottom: var(--s4); max-width: 70ch; }
.section { margin-top: var(--s10); }
.btn-s { min-height: 44px; }

.status-line { display: flex; flex-direction: column; gap: var(--s2); margin-bottom: var(--s6); }
.status-main { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); font-weight: 650; }

/* P3 bento */
.bento { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); }
.bento > .card { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; min-width: 0; }
.bento > .card > * { max-width: 100%; }
.bento .q-head { width: 100%; margin: 0; }
.bento-wide { grid-column: span 2; }
.hero-lead { font-size: var(--text-lg); }
.plan-mini { list-style: decimal; padding-left: var(--s6); display: flex; flex-direction: column; gap: var(--s1); }
.studio-card .btn { text-decoration: none; }

/* P1 crew pipeline */
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--s6); }
.pipe-step { position: relative; min-width: 0; }
.pipe-step + .pipe-step::before { content: ""; position: absolute; top: 28px; left: calc(-1 * var(--s6)); width: var(--s6); height: 2px;
  background: var(--line-strong); }
.flow-on .pipe-step + .pipe-step::before { background: repeating-linear-gradient(90deg, var(--accent-ring) 0 6px, transparent 6px 12px);
  background-size: 24px 2px; animation: sp-flow 1.2s linear infinite; }
@keyframes sp-flow { from { background-position: 0 0; } to { background-position: 24px 0; } }
@keyframes sp-flow-v { from { background-position: 0 0; } to { background-position: 0 24px; } }
.pipe-card { height: 100%; display: flex; flex-direction: column; gap: var(--s3); background: var(--surface); color: var(--fg); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s4); }
.pipe-title { display: flex; align-items: center; gap: var(--s2); font-size: var(--text-md); font-weight: 700; line-height: 1.4; }
.pipe-card a { display: inline-flex; min-height: 44px; align-items: center; }
.pipe-sub { margin-top: auto; background: var(--surface-2); border-radius: var(--radius-s); padding: var(--s3); display: flex; flex-direction: column; gap: var(--s1);
  font-size: var(--text-sm); color: var(--fg); }
.pipe-sub li { padding-left: var(--s4); position: relative; }
.pipe-sub li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 6px; height: 6px; border-radius: 50%; border: 1.5px solid var(--line-strong); }

/* P2 command status tree */
.tree { display: flex; flex-direction: column; align-items: center; gap: var(--s8); }
.tree-root { text-align: center; display: flex; flex-direction: column; align-items: center; gap: var(--s2); max-width: 44ch;
  padding: var(--s4) var(--s6); border: 2px solid var(--accent-ring); border-radius: var(--radius); background: var(--accent-soft); position: relative; }
.tree-root::after { content: ""; position: absolute; left: 50%; bottom: calc(-1 * var(--s8) / 2 - 2px); width: 2px; height: calc(var(--s8) / 2); background: var(--line-strong); }
.tree-name { display: flex; align-items: center; gap: var(--s2); font-weight: 700; }
.tree-root .meta { color: var(--fg); }
.tree-branches { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s4); position: relative; padding-top: var(--s4); }
.tree-branches::before { content: ""; position: absolute; top: 0; left: 12.5%; right: 12.5%; height: 2px; background: var(--line-strong); }
.tree-pill { position: relative; display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3) var(--s4); border: 1px solid var(--line);
  border-radius: var(--radius-s); background: var(--surface-2); min-width: 0; }
.tree-pill::before { content: ""; position: absolute; top: calc(-1 * var(--s4)); left: 50%; width: 2px; height: var(--s4); background: var(--line-strong); }
.tree-agent { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); }
.tree-agent-name { font-weight: 700; }

/* P4 weekly activity */
.week-head { display: flex; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; }
.week-peak { text-align: right; }
.week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--s3); align-items: end; }
.week-col { display: flex; flex-direction: column; align-items: center; gap: var(--s1); min-width: 0; }
.week-total { font-size: var(--text-sm); font-weight: 650; }
.week-track { width: 100%; max-width: 48px; height: 160px; display: flex; align-items: flex-end; }
.week-bar { width: 100%; height: 100%; display: flex; flex-direction: column-reverse; gap: var(--space-3xs); }
.week-bar > span { display: block; width: 100%; height: 0; border-radius: 2px; }
.week-bar.unknown { border: 1.5px dashed var(--line-strong); border-radius: 8px; align-items: center; justify-content: center;
  background: repeating-linear-gradient(135deg, var(--unk-soft) 0 6px, transparent 6px 12px); }
.week-bar.unknown > span.week-unk { height: auto; background: none; font-weight: 700; color: var(--unk); text-align: center; }
.week-day { font-size: var(--text-sm); color: var(--muted); white-space: nowrap; }
.week-total .w-sm { display: none; }
.seg-mara { background: var(--ring-amber); }
.seg-tala { background: var(--blue); }
.seg-nia { background-color: var(--ring-violet); background-image: repeating-linear-gradient(45deg, var(--hatch) 0 3px, transparent 3px 7px); }
.seg-vera { background-color: var(--ring-green); background-image: repeating-linear-gradient(0deg, var(--hatch) 0 2px, transparent 2px 6px); }
.week-legend { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s6); font-size: var(--text-sm); }
.week-legend li { display: inline-flex; align-items: center; gap: var(--s2); }
.sw { width: 14px; height: 14px; border-radius: 4px; display: inline-block; flex: none; }
.sw-unk { border: 1.5px dashed var(--line-strong); background: repeating-linear-gradient(135deg, var(--unk-soft) 0 3px, transparent 3px 6px); }
table.data th, table.data td { padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); text-align: left; }

@media (max-width: 1199px) {
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tree-branches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tree-branches::before { left: 25%; right: 25%; }
}
@media (max-width: 759px) {
  .bento { grid-template-columns: minmax(0, 1fr); }
  .bento-wide { grid-column: auto; }
  .tree { align-items: stretch; gap: var(--s4); }
  .tree-root { max-width: none; text-align: left; align-items: flex-start; }
  .tree-root::after, .tree-branches::before, .tree-pill::before { display: none; }
  .tree-branches { grid-template-columns: minmax(0, 1fr); padding-top: 0; border-left: 2px solid var(--line-strong); padding-left: var(--s4); }
  .week { gap: var(--s1); }
  .week-track { height: 120px; }
  .week-day, .week-total { font-size: var(--text-xs); }
  .week-day > span { display: block; text-align: center; }
  .week-total .w-lg { display: none; }
  .week-total .w-sm { display: inline; }
  .week-peak { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-on .pipe-step + .pipe-step::before { animation: none; }
}

/* Pipeline stacks by its own width (scales with text size, not only viewport): 5 columns need about 68rem. */
.pipe-sec { container-type: inline-size; }
@container (max-width: 68rem) {
  .pipeline { grid-template-columns: minmax(0, 1fr); gap: var(--s4); }
  .pipe-step + .pipe-step::before { top: calc(-1 * var(--s4)); left: 32px; width: 2px; height: var(--s4); }
  .flow-on .pipe-step + .pipe-step::before { background: repeating-linear-gradient(180deg, var(--accent-ring) 0 6px, transparent 6px 12px);
    background-size: 2px 24px; animation: sp-flow-v 1.2s linear infinite; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-on .pipe-step + .pipe-step::before { animation: none; }
}

/* ---------- v0.7: Bootstrap 5.3.8 (local, CSS only) mapped onto SP tokens + Tabler-style patterns ---------- */
/* Bootstrap's colour variables point at our measured tokens, so contrast stays as tested in both themes. */
:root {
  --bs-body-bg: var(--bg); --bs-body-color: var(--fg); --bs-emphasis-color: var(--fg); --bs-secondary-color: var(--muted);
  --bs-tertiary-color: var(--muted); --bs-border-color: var(--line); --bs-link-color: inherit; --bs-link-hover-color: inherit; --bs-heading-color: inherit;
  --bs-body-font-family: var(--font-body); --bs-body-line-height: 1.55;
  --bs-border-radius: var(--radius-s); --bs-gutter-x: var(--s4);
}
h1, h2, h3, h4 { font-weight: 500; line-height: 1.25; font-size: inherit; max-width: none; }
/* Focus is never removed: Bootstrap's component rules (outline: 0) are overridden everywhere. */
:focus-visible, .btn:focus-visible, .nav-link:focus-visible, .list-group-item:focus-visible, a:focus-visible {
  outline: 2px solid var(--focus) !important; outline-offset: 2px; } /* v0.9: outline only; glow suppression moved to the shared state section */
fieldset.card legend { float: none; width: auto; font-size: var(--text-md); margin: 0; }
dd { margin-bottom: 0; }
.badge { line-height: 1.4; white-space: normal; text-align: left; }
.btn { --bs-btn-color: var(--fg); --bs-btn-bg: var(--surface); --bs-btn-border-color: var(--line-strong); --bs-btn-hover-color: var(--fg);
  --bs-btn-hover-bg: var(--surface-2); --bs-btn-hover-border-color: var(--line-strong); --bs-btn-active-color: var(--fg); --bs-btn-active-bg: var(--surface-2);
  --bs-btn-active-border-color: var(--fg); --bs-btn-disabled-color: var(--muted); --bs-btn-disabled-bg: var(--surface-2); --bs-btn-disabled-border-color: var(--line);
  --bs-btn-font-size: var(--text-md); --bs-btn-font-weight: 500; --bs-btn-focus-box-shadow: none; text-decoration: none; }
.btn-primary { --bs-btn-color: var(--accent-ink); --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent-ring); --bs-btn-hover-color: var(--accent-ink);
  --bs-btn-hover-bg: color-mix(in oklab, var(--accent) 88%, var(--fg)); --bs-btn-hover-border-color: var(--accent); --bs-btn-active-color: var(--accent-ink); --bs-btn-active-bg: var(--accent);
  --bs-btn-active-border-color: var(--fg); }
.nav-link { --bs-nav-link-color: var(--fg); --bs-nav-link-hover-color: var(--fg); font-weight: 400; }
.card { --bs-card-bg: var(--surface); --bs-card-color: var(--fg); --bs-card-border-color: var(--line); --bs-card-cap-bg: transparent;
  --bs-card-cap-color: var(--fg); --bs-card-border-radius: var(--radius); --bs-card-inner-border-radius: calc(var(--radius) - 1px);
  --bs-card-spacer-y: var(--s4); --bs-card-spacer-x: var(--s6); --bs-card-cap-padding-y: var(--s4); --bs-card-cap-padding-x: var(--s6); }
.list-group { --bs-list-group-bg: transparent; --bs-list-group-color: var(--fg); --bs-list-group-border-color: var(--line); --bs-list-group-item-padding-x: 0; }
.progress { --bs-progress-height: 8px; --bs-progress-bg: var(--surface-2); --bs-progress-bar-bg: var(--accent-ring); --bs-progress-border-radius: 2px;
  border: 1px solid var(--line-strong); }
.progress-bar { width: 0; }

/* Tabler-style page header */
.page-header { margin-bottom: var(--s6); }
.page-pretitle { font-size: var(--text-sm); font-weight: 500; color: var(--muted); }
.page-title { font-size: var(--text-3xl); font-weight: 500; letter-spacing: var(--tracking-display); line-height: 1.1; margin-top: 0; }
.page-sub { color: var(--muted); margin-top: var(--s2); max-width: 75ch; }
.page-actions { display: flex; flex-wrap: wrap; gap: var(--s2); }
.page-actions .btn { min-height: 48px; }
/* v0.7.2 F04: the title column keeps a minimum width; when the content column cannot fit it beside
 * the actions, the actions wrap below. Responds to available width, not to the viewport breakpoint. */
.page-header > .row > .col { flex: 1 1 0%; min-width: min(100%, 22rem); }

/* Tabler-style cards */
.card.tb { padding: 0; height: 100%; }
.card.tb > .card-header { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); border-bottom: 1px solid var(--line); }
.card.tb > .card-body { display: flex; flex-direction: column; gap: var(--s3); align-items: flex-start; }
.card.tb > .card-body > * { max-width: 100%; }
.card-title { font-size: var(--text-md); font-weight: 500; margin: 0; }
.subheader { font-size: var(--text-sm); font-weight: 500; color: var(--muted); margin: 0; }
.card.tb.hero { border-color: var(--line-strong); }
.card.tb.hero .subheader { color: var(--accent-text); }
.kpi .kpi-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); width: 100%; }
.kpi-value { font-family: var(--font-outlier); font-size: var(--text-2xl); font-weight: 400; letter-spacing: -0.02em; line-height: 1.15; overflow-wrap: anywhere; font-variant-numeric: tabular-nums slashed-zero; }
.kpi-progress { width: 100%; }
.kpi .cap-mini { width: 100%; }
.tier + .section, .tier { margin-top: 0; }
.tier { margin-bottom: var(--s2); }

/* "Needs you here" strip */
.card.tb.attn { height: auto; margin-bottom: var(--s6); }
.attn-list { width: 100%; }
.attn-item { display: grid; grid-template-columns: 9rem auto minmax(0, 1fr); align-items: center; gap: var(--s1) var(--s3); padding: var(--s2) 0; min-height: 44px; }
.attn-tier { font-size: var(--text-sm); font-weight: 500; color: var(--muted); }
.attn-text { min-height: 44px; display: inline-flex; align-items: center; }
span.attn-text { min-height: 0; }
.attn-meta { grid-column: 3; }
/* v0.7.2 F05: stack by the card's own width, before the text column becomes narrow. */
.card.tb.attn { container-type: inline-size; container-name: attn; }
@container attn (max-width: 40rem) {
  .attn-item { grid-template-columns: minmax(0, 1fr); }
  .attn-meta { grid-column: auto; }
}
.biz-id { margin-bottom: var(--s4); }
.closed-h { font-size: var(--text-md); margin-top: var(--s4); }

@media (max-width: 759px) {
  .page-title { font-size: var(--text-xl); }
  .attn-item { grid-template-columns: minmax(0, 1fr); }
  .attn-meta { grid-column: auto; }
  .card { --bs-card-spacer-x: var(--s4); --bs-card-cap-padding-x: var(--s4); }
}
.attn-item > .badge, .attn-item > .attn-tier { justify-self: start; }

/* ---------- v0.8 Hallmark (Console): shell, Home, Needs you, Work ---------- */
.content { background: var(--bg); }
.sidebar { background: var(--color-paper-3); padding: var(--s6) var(--s3); }
.nav-heading { font-weight: 500; }
.topline { min-height: 56px; padding: var(--s2) var(--s8); background: var(--bg); }
main { padding: var(--s8) var(--s8) var(--s16); max-width: 1320px; }
.page-header { margin-bottom: var(--s6); }
.page-sub { color: var(--muted); margin-top: var(--s2); max-width: 70ch; }
.page-actions .btn { min-height: 44px; }

/* Panels: hairlines cut from one surface, no shadow. */
.panel { background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius-card); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); min-height: 56px; padding: var(--s2) var(--s6); border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: var(--text-lg); font-weight: 500; letter-spacing: -0.01em; line-height: 1.25; }
.panel-body { padding: var(--s4) var(--s6) var(--s6); }
.panel-empty { padding: var(--s6); color: var(--muted); }
.card.tb { background: var(--surface); color: var(--fg); border-color: var(--line); }

/* Readings: the day's three counts, large in the measured face. */
.status-line { gap: var(--s3); margin-bottom: var(--s8); }
.status-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--s4); }
.readings { display: flex; flex-wrap: wrap; margin: 0; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); overflow: hidden; }
.reading { display: flex; flex-direction: column-reverse; gap: var(--s1); padding: var(--s3) var(--s6) var(--s4); min-width: 9.5rem; border-right: 1px solid var(--line); }
.reading:last-child { border-right: 0; }
.reading dt { font-size: var(--text-sm); font-weight: 500; color: var(--muted); }
.reading dd { margin: 0; font-size: var(--text-3xl); line-height: 1; letter-spacing: -0.04em; color: var(--fg); }
.reading.r-you dd { color: var(--accent-text); }
.reading.r-bad dd { color: var(--red); }
.reading.r-agent dd { color: var(--color-cool-text); }

/* Home lead: the decision ledger beside the next step and the plan. */
.home-lead { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s4); align-items: start; margin-bottom: var(--s2); }
.home-side { display: flex; flex-direction: column; gap: var(--s4); min-width: 0; }
.ledger .table-wrap { overflow-x: auto; }
.ledger-table th, .work-table th { font-size: var(--text-sm); font-weight: 500; color: var(--muted); white-space: nowrap; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); }
.ledger-table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.ledger-table tr:last-child td { border-bottom: 0; }
.ledger-table th:first-child, .ledger-table td:first-child { padding-left: var(--s6); }
.ledger-table th:last-child, .ledger-table td:last-child { padding-right: var(--s6); }
.ledger-what a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 500; text-decoration-color: var(--line-strong); }
.ledger-what a:hover { color: var(--accent-text); }
td.measured, .measured { font-family: var(--font-outlier); font-size: var(--text-sm); color: var(--color-cool-text); font-variant-numeric: tabular-nums slashed-zero; }
td.nowrap { white-space: nowrap; }
.next .hero-lead { font-size: var(--text-xl); font-weight: 500; letter-spacing: -0.015em; line-height: 1.25; }
.plan .panel-head .fict { align-self: center; }
.plan-mini li::marker { color: var(--muted); font-family: var(--font-outlier); }
.q-more { text-decoration-color: var(--line-strong); }

/* Section heads: heading, then a quiet chip (the old eyebrow, now sentence case beside the head). */
.sec-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2) var(--s3); }
.tier-chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 var(--s2); border: 1px solid var(--line); border-radius: 4px; font-size: var(--text-sm); font-weight: 500; color: var(--muted); background: var(--surface); }
main > .section { margin-top: var(--s12); }

/* Needs you: a list cut from one surface; the selected item carries the cool tint. */
.need-list { gap: 0; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); overflow: hidden; }
.need-list li + li { border-top: 1px solid var(--line); }
.need-item { border: 0; border-radius: 0; background: transparent; padding: var(--s4) var(--s4) var(--s4) var(--s6); }
.need-item .t { font-weight: 500; font-size: var(--text-md); }
.need-item .m { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); }
.card.detail { padding: var(--s8); }
.detail h2 { font-size: var(--text-2xl); font-weight: 500; letter-spacing: var(--tracking-display); line-height: 1.15; }
.detail .kv { margin-top: var(--s2); }

/* The record trail: four layers on one spine. */
.layers.trail { display: flex; flex-direction: column; gap: 0; margin: var(--s6) 0 var(--s4); position: relative; padding-left: var(--s6); }
.layers.trail::before { content: ""; position: absolute; left: 7px; top: var(--s4); bottom: var(--s4); width: 1px; background: var(--line-strong); }
.layers.trail .layer { position: relative; display: grid; grid-template-columns: minmax(9rem, 12rem) minmax(0, 1fr); gap: var(--s4); align-items: baseline;
  padding: var(--s3) var(--s4); border-radius: 0; background: transparent; border-bottom: 1px solid var(--line); }
.layers.trail .layer:last-child { border-bottom: 0; }
.layers.trail .layer::before { content: ""; position: absolute; left: calc(-1 * var(--s6) + 3px); top: 1.15em; width: 9px; height: 9px; border-radius: 2px;
  background: var(--surface); border: 1px solid var(--line-strong); }
.layers.trail .k { font-size: var(--text-sm); font-weight: 500; color: var(--muted); }
.layers.trail .v { font-weight: 500; }
.layers.trail .l-agent .v { font-family: var(--font-outlier); font-size: var(--text-md); color: var(--color-cool-text); }
.layers.trail .l-agent::before { border-color: var(--color-cool); }
.layers.trail .l-you { background: var(--accent-soft); border-radius: var(--radius-pill); }
.layers.trail .l-you .v { color: var(--accent-text); }
.layers.trail .l-you::before { background: var(--accent); border-color: var(--accent-text); }

/* Work: tables, horizontal rules only, no outer card. */
.work-table { width: 100%; border-collapse: collapse; }
.work-table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; }
.work-table th:first-child, .work-table td:first-child { padding-left: 0; }
.work-table th { border-bottom-color: var(--line-strong); }
.work-task { width: 52%; }
.work-task .title { font-weight: 500; padding-top: var(--s2); }
.work-task details.disclosure { border-top: 0; }
.work-task details.disclosure > summary { min-height: 44px; font-weight: 500; color: var(--muted); }
.work-table td .badge { margin-top: var(--s2); }
.work-table td[data-label="Executor"], .work-table td[data-label="Business"] { padding-top: calc(var(--s3) + var(--s2)); }
.agent-name { color: var(--color-cool-text); }
.closed-block { padding-top: var(--s2); }
.closed-block details.disclosure { margin-top: var(--s3); }

@media (max-width: 1199px) {
  .home-lead { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 759px) {
  main { padding: var(--s6) var(--s4) 128px; }
  .topline, .demo-banner { padding-inline: var(--s4); }
  .reading { min-width: 0; flex: 1 1 33%; padding: var(--s3) var(--s4); }
  .reading dd { font-size: var(--text-2xl); }
  .panel-head, .panel-body { padding-inline: var(--s4); }
  .ledger-table th:first-child, .ledger-table td:first-child { padding-left: 0; }
  .ledger-table tbody tr { padding-inline: var(--s4); }
  .card.detail { padding: var(--s4); }
  .layers.trail .layer { grid-template-columns: minmax(0, 1fr); gap: var(--s1); }
  .work-task { width: auto; }
  .work-table td[data-label="Executor"], .work-table td[data-label="Business"] { padding-top: var(--s1); }
}
.ledger-biz { font-size: var(--text-sm); color: var(--muted); margin-bottom: var(--s1); }
.ledger-what { width: 100%; }
.home-lead { grid-template-columns: minmax(0, 8fr) minmax(0, 5fr); }
.status-row { justify-content: flex-start; }
@media (max-width: 1199px) { .home-lead { grid-template-columns: minmax(0, 1fr); } }
.layers.trail .l-you .k { color: var(--color-ink-2); }
.need-item[aria-current="true"] .m { color: var(--color-ink-2); }
@media (max-width: 759px) {
  .ledger-table tbody tr { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--s1) var(--s3); align-items: center; padding: var(--s3) var(--s4); border-top: 1px solid var(--line); }
  .ledger-table tbody tr:first-child { border-top: 0; }
  .ledger-table td, .ledger-table td:first-child, .ledger-table td:last-child { padding: 0; border: 0; width: auto; }
  .ledger-table td::before { display: none; }
  .ledger-table td[data-label="Waiting"] { grid-column: 3; grid-row: 1; text-align: right; }
  .ledger-table td[data-label="Waiting"]::before { display: inline; content: "waiting "; font-family: var(--font-body); color: var(--muted); font-size: var(--text-sm); font-weight: 400; }
  .ledger-table td.ledger-what { grid-column: 1 / -1; }
}
/* Pressed state for every control (26b). */
.btn-primary:active { background: color-mix(in oklab, var(--accent) 82%, var(--fg)); }
a:active { color: var(--accent-text); }

/* ---------- v0.8 Hallmark, round 2: Crew, Businesses, Knowledge, Resources, Settings ---------- */
/* The old eyebrow survives only as a state chip (Console: a chip carries state). */
.eyebrow, .mission-strip .eyebrow, .hero .eyebrow { display: inline-flex; align-items: center; gap: var(--s1); min-height: 24px; padding: 0 var(--s2); border: 1px solid color-mix(in oklab, var(--accent-text) 45%, transparent);
  border-radius: 4px; background: var(--accent-soft); color: var(--accent-text); font-size: var(--text-sm); font-weight: 500; }
.eyebrow .hi { width: 16px; height: 16px; }

/* Section heads inside screens: one quiet weight. */
main > .section > h2, .res-body .section > h2, .biz-col > .section > h2 { font-size: var(--text-lg); font-weight: 500; letter-spacing: -0.01em; margin-bottom: var(--s3); }
.card { color: var(--fg); }
.card + .card { margin-top: var(--s3); }

/* "Needs you here": the attention strip becomes a ledger panel like Home's. */
.card.tb.attn { padding: 0; }
.card.tb.attn > .card-header { min-height: 56px; padding: var(--s2) var(--s6); background: transparent; }
.card.tb.attn > .card-header .card-title { font-size: var(--text-lg); }
.card.tb.attn > .card-body { padding: 0; gap: 0; }
.attn-list { margin: 0; }
.attn-item.list-group-item { padding: var(--s3) var(--s6); border-color: var(--line); background: transparent; color: var(--fg); }
.attn-item .attn-text { font-weight: 500; text-decoration-color: var(--line-strong); }
a.attn-text:hover { color: var(--accent-text); }
.attn-item .attn-meta { color: var(--muted); }
.card.tb.attn .card-body > p.meta { padding: var(--s4) var(--s6); }

/* Businesses: owed and aimed for, beside what is known. */
.biz-id { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.biz-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s6); align-items: start; }
.biz-col { min-width: 0; }
.biz-col > .section:first-child { margin-top: var(--s8); }
.biz-col .stack > li + li, .section .card > ul.stack > li + li { border-top: 1px solid var(--line); padding-top: var(--s3); }

/* Knowledge: the snapshot as readings. */
.kn-readings { margin-bottom: var(--s3); }
.kn-readings .reading dd { font-size: var(--text-xl); letter-spacing: -0.02em; }
.callout { background: var(--color-cool-soft); color: var(--fg); border: 1px solid color-mix(in oklab, var(--color-cool) 35%, transparent); border-radius: var(--radius-pill); }
table.data th { font-weight: 500; font-size: var(--text-sm); color: var(--muted); }
table.data td.mono { color: var(--color-cool-text); }

/* Resources: tabs as a segmented row; each plan a panel; remaining capacity as a reading. */
.tabs-nav.seg { display: inline-flex; }
.seg-link { border-radius: 0; border-right: 1px solid var(--line); font-weight: 500; color: var(--muted); }
.seg-link:last-child { border-right: 0; }
.cap-row { padding: 0; overflow: hidden; }
.cap-row > * { padding-inline: var(--s6); }
.cap-row > .cap-title { padding-top: var(--s4); padding-bottom: var(--s3); border-bottom: 1px solid var(--line); margin: 0; }
.cap-row > :last-child { padding-bottom: var(--s4); }
.cap-title h2 { font-size: var(--text-lg); font-weight: 500; }
.win-list { gap: 0; border: 1px solid var(--line); border-radius: var(--radius-pill); overflow: hidden; padding: 0 !important; margin-inline: var(--s6); }
.win-list li { padding: var(--s3) var(--s4) var(--s4); }
.win-list li + li { border-left: 1px solid var(--line); }
.win-name { font-weight: 500; }
.win-val { font-family: var(--font-outlier); font-size: var(--text-xl); font-weight: 400; letter-spacing: -0.02em; color: var(--fg); }
.bar { height: 6px; border-radius: 2px; border-color: var(--line); background: var(--surface-2); }
.bar .fill { background: var(--color-cool); }
.res-body > .card.stack, .res-body > section.card { padding: var(--s6); }
.res-body .q-lead { font-family: var(--font-outlier); font-weight: 400; font-size: var(--text-xl); letter-spacing: -0.02em; }
.value-panels { gap: 0; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; background: var(--line); grid-gap: 1px; }
.value-panels > .card { border: 0; border-radius: 0; margin: 0; }
.value-panels .q-title { font-size: var(--text-md); font-weight: 500; color: var(--muted); }
.value-panels .q-lead { font-size: var(--text-2xl); color: var(--fg); }
.tile-grid > .card { display: flex; flex-direction: column; gap: var(--s2); align-items: flex-start; }
.tile-grid .q-title { font-size: var(--text-md); font-weight: 500; }
.res-body .table-wrap.card { padding: 0 var(--s6); }

/* Settings: numbered steps on one spine. */
.steps { gap: 0; border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; background: var(--surface); counter-reset: none; }
.steps > li.card { border: 0; border-radius: 0; margin: 0; padding: var(--s6); }
.steps > li.card + li.card { border-top: 1px solid var(--line); }
.steps h3 { font-size: var(--text-md); font-weight: 500; }
fieldset.card { margin-top: var(--s12); }
fieldset.card legend { font-size: var(--text-lg); font-weight: 500; }
fieldset.card input[type="radio"] { accent-color: var(--state-edge); } /* v0.9 correction IS-F01: neutral selection, never cool */

/* Crew: the mission strip and lists as panels; the scene keeps its own art. */
.mission-strip { background: var(--surface); border-color: var(--line); padding: var(--s4) var(--s6); }
.mission-strip h2 { font-size: var(--text-xl); font-weight: 500; letter-spacing: -0.015em; margin-top: var(--s2); }
.crew-list { padding: 0; }
.crew-list .team { margin: 0; padding: var(--s4) var(--s6); }
.crew-list .team + .team { border-top: 1px solid var(--line); }
.crew-list .team > h3 { font-size: var(--text-lg); font-weight: 500; margin-bottom: var(--s2); }
.crew-list > p.meta { padding: var(--s4) var(--s6); border-top: 1px solid var(--line); margin: 0; }
.crew-row .who { font-weight: 500; }
.crew-row .mini { border-width: 2px; }
.mission-card { padding: var(--s6); }
.mission-card h3 { font-size: var(--text-lg); font-weight: 500; }
.room-panel h2, .inspector h2 { font-size: var(--text-xl); font-weight: 500; letter-spacing: -0.015em; }
.desk-card .k { font-weight: 500; }
.desk-card .v { font-weight: 500; }
.legend { gap: var(--s2) var(--s3); }

@media (max-width: 1023px) {
  .biz-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .win-list li + li { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 759px) {
  .card.tb.attn > .card-header, .attn-item.list-group-item { padding-inline: var(--s4); }
  .cap-row > * { padding-inline: var(--s4); }
  .win-list { margin-inline: var(--s4); }
  .crew-list .team, .crew-list > p.meta { padding-inline: var(--s4); }
  .steps > li.card { padding: var(--s4); }
  .value-panels { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- v0.8 top nav: below 60rem the sidebar gives way to one sticky top bar (founder decision, 16 Nov 2026) ---------- */
.tabbar.topnav { display: none; }
/* Wide screens: the sidebar is fixed to the viewport (full height, no second sticky bar); the content keeps the second grid column. */
@media (width >= 960px) {
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 232px; z-index: var(--z-raised); }
  .shell.collapsed .sidebar { width: 80px; }
  .shell > .content { grid-column: 2; }
}
@media (width < 960px) {
  .shell, .shell.collapsed { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  html { scroll-padding-top: 72px; }
  .tabbar.topnav { display: flex; align-items: center; gap: var(--s3); position: sticky; top: 0; left: auto; right: auto; bottom: auto; z-index: var(--z-sticky-nav);
    min-height: 56px; padding: var(--s1) var(--s4); background: var(--color-paper-3); border-top: 0; border-bottom: 1px solid var(--line); }
  .topnav-brand { display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; min-width: 44px; text-decoration: none; color: var(--fg); font-weight: 600; flex: none; }
  .topnav-brand .brand-mark { width: 32px; height: 32px; font-size: var(--text-sm); }
  .tabbar.topnav > ul { display: flex; flex: 1 1 auto; min-width: 0; gap: var(--s1); overflow: hidden; margin: 0; padding: 0; list-style: none; grid-template-columns: none; }
  .tabbar.topnav li { flex: none; min-width: 0; }
  .tabbar.topnav .tab { display: inline-flex; flex-direction: row; align-items: center; gap: var(--s2); min-height: 44px; width: auto; padding: 0 var(--s3);
    border: 0; border-radius: var(--radius-pill); background: none; color: var(--color-ink-2); font-size: var(--text-md); font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; }
  .tabbar.topnav .tab span { max-width: none; overflow-wrap: normal; text-align: left; }
  .tabbar.topnav .count { min-width: 22px; height: 22px; padding: 0 var(--s1); border-radius: 4px; background: var(--accent); color: var(--accent-ink);
    font-family: var(--font-outlier); font-size: var(--text-xs); display: inline-grid; place-items: center; }
  .tabbar.topnav .more-btn { flex: none; margin-left: auto; border: 1px solid var(--line-strong); }
  .tabbar.topnav .more-btn .hi { width: 18px; height: 18px; }
  .tabbar.topnav .more-menu { position: absolute; top: calc(100% + var(--s1)); bottom: auto; right: var(--s2); left: auto; width: min(320px, calc(100% - 16px));
    max-height: calc(100vh - 72px); max-height: calc(100dvh - 72px); overflow-y: auto; overscroll-behavior: contain; /* v0.8.1 V08-F01 */
    background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-card); box-shadow: none; padding: var(--s2); z-index: var(--z-dropdown); }
  .tabbar.topnav .more-menu .nav-link .count { margin-left: auto; }
  .more-title { font-weight: 500; color: var(--muted); font-size: var(--text-sm); padding: var(--s2) var(--s3); }
  main { padding-bottom: var(--s16); }
  .topline { padding-inline: var(--s4); }
}
@media (max-width: 759px) {
  main { padding: var(--s6) var(--s4) var(--s12); }
}
@media (max-width: 380px) {
  .topnav-name { display: none; }
}

/* ---------- v0.8.2 Step C: Studio historical-run view (record, not live) ---------- */
.studio-source { margin-bottom: var(--s4); }
.hist { display: flex; flex-direction: column; gap: var(--s4); }
.hist-facts p { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.hist-runs { display: flex; flex-direction: column; gap: 0; margin: 0; }
.hist-run { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) 0; border-top: 1px solid var(--line); }
.hist-run:first-child { border-top: 0; }
.hist-run.selected { margin-inline: calc(-1 * var(--s6)); padding-inline: var(--s6); } /* v0.9: state drawn by the shared section */
.hist-run-main { display: flex; flex-direction: column; gap: var(--s1); min-width: 0; }
.hist-run-title { font-weight: 500; overflow-wrap: anywhere; }
.hist-reasons { display: flex; flex-direction: column; gap: var(--s1); margin: var(--s1) 0 0; font-size: var(--text-sm); overflow-wrap: anywhere; }
.hist-run.rejected { flex-direction: column; align-items: flex-start; }
.hist-summary, .hist-path { overflow-wrap: anywhere; }
.hist-path { font-size: var(--text-sm); }
.hist-annot td { background: var(--accent-soft); color: var(--fg); }
.hist-table td { vertical-align: top; }
.hist-quals > li { overflow-wrap: anywhere; }
@media (width < 960px) { .hist-run.selected { margin-inline: calc(-1 * var(--s4)); padding-inline: var(--s4); } }

/* ---------- v0.9 shared interaction states (direction B adopted) ----------
   One state layer for every interactive component outside the Studio scene. Each state is two inset shadows:
   an edge marker (--fx-edge) over a fill overlay (--fx-fill). It keeps each component's own background, animates
   smoothly and never changes size. The overlay is ink at low strength, so it lifts in dark mode and deepens in light.
   Cool blue is never used for selection; it stays reserved for agent and instrument signals. */
:root {
  --fx-edge: inset 0 0 0 0 transparent; --fx-fill: transparent;
  --state-hover: color-mix(in oklab, var(--color-ink) 6%, transparent);
  --state-pressed: color-mix(in oklab, var(--color-ink) 11%, transparent);
  --state-selected: color-mix(in oklab, var(--color-ink) 8%, transparent);
  --state-selected-hover: color-mix(in oklab, var(--color-ink) 11%, transparent);
  --state-edge: var(--color-ink);
  --state-line: color-mix(in oklab, var(--color-ink) 52%, transparent); /* build 1 check: 34% measured 2.87:1 dark, 2.21:1 light; raised to meet 3:1 */
  --state-intent: var(--focus);
  --state-in: var(--dur-micro); --state-out: var(--dur-short);
}
.nav-link, .collapse-btn, .btn:not(.btn-primary), .seg button, .seg-link, .tab, .more-btn,
.need-item, .list-group-item, .ledger-table tbody td, .hist-run, details.disclosure > summary, details.view-opts > summary {
  --fx-edge: inset 0 0 0 0 transparent; --fx-fill: transparent; /* reset per component: custom properties inherit (build 1 check) */
  box-shadow: var(--fx-edge), inset 0 0 0 100vmax var(--fx-fill);
  transition: box-shadow var(--state-out) var(--ease-out), border-color var(--state-out) var(--ease-out),
    color var(--state-out) var(--ease-out), background-color var(--state-out) var(--ease-out);
}
/* Selected / current: neutral fill plus a 2px ink edge. Lists and side nav mark the leading edge; horizontal controls mark the bottom. */
.nav-link[aria-current="page"], .need-item[aria-current="true"], .hist-run.selected {
  --fx-fill: var(--state-selected); --fx-edge: inset 2px 0 0 0 var(--state-edge); color: var(--fg); font-weight: 500;
}
.seg button[aria-pressed="true"], .seg button[aria-selected="true"], .seg-link[aria-current="page"],
.tab[aria-current="page"], .more-btn.is-current, .theme-toggle[aria-pressed="true"] {
  --fx-fill: var(--state-selected); --fx-edge: inset 0 -2px 0 0 var(--state-edge); color: var(--fg); font-weight: 500;
}
.tab[aria-expanded="true"], .more-btn[aria-expanded="true"] { --fx-fill: var(--state-pressed); color: var(--fg); }
/* Hover: only on devices that really hover, so a tap never leaves a stuck state. */
@media (hover: hover) and (pointer: fine) {
  .nav-link:hover, .collapse-btn:hover, .btn:not(.btn-primary):hover, .seg button:hover, .seg-link:hover, .tab:hover, .more-btn:hover,
  .need-item:hover, .list-group-item:hover, .ledger-table tbody tr:hover > td, .hist-run:not(.rejected):hover, details.disclosure > summary:hover, details.view-opts > summary:hover {
    --fx-fill: var(--state-hover); color: var(--fg); transition-duration: var(--state-in);
  }
  .nav-link[aria-current="page"]:hover, .need-item[aria-current="true"]:hover, .hist-run.selected:hover,
  .seg button[aria-pressed="true"]:hover, .seg button[aria-selected="true"]:hover, .seg-link[aria-current="page"]:hover,
  .tab[aria-current="page"]:hover, .more-btn.is-current:hover, .theme-toggle[aria-pressed="true"]:hover { --fx-fill: var(--state-selected-hover); }
  .btn:not(.btn-primary):hover, .need-item:hover { border-color: var(--state-line); }
  .btn-primary:hover { background: color-mix(in oklab, var(--accent) 90%, var(--fg)); transition: background-color var(--state-in) var(--ease-out); }
  /* The signature (direction B, adopted): an amber leading edge grows in on rows where a decision or action lives. */
  .need-item:not([aria-current="true"]):hover,
  .attn-item.list-group-item:hover,
  .hist-run:not(.rejected):not(.selected):hover,
  .ledger-table tbody tr:hover > td:first-child { --fx-edge: inset 3px 0 0 0 var(--state-intent); }
}
/* Pressed: one step deeper, immediate, no movement. */
.nav-link:active, .collapse-btn:active, .btn:not(.btn-primary):active, .seg button:active, .seg-link:active, .tab:active, .more-btn:active,
.need-item:active, .list-group-item:active, .hist-run:not(.rejected):active, details.disclosure > summary:active, details.view-opts > summary:active { --fx-fill: var(--state-pressed); transition-duration: 0s; }

/* v0.9 focus: outline only (above). Glows are suppressed without touching the state layer. */
.form-control:focus, .form-select:focus, .form-check-input:focus, .btn-close:focus, .page-link:focus, .scene :focus-visible,
:focus-visible:not(.nav-link, .collapse-btn, .btn, .seg button, .seg-link, .tab, .more-btn, .need-item, .list-group-item, .hist-run, .ledger-table td, details.disclosure > summary, details.view-opts > summary) { box-shadow: none !important; }
.btn { --bs-btn-focus-box-shadow: inset 0 0 0 0 transparent, inset 0 0 0 100vmax transparent; }
.nav-link:not(.sp-never) { box-shadow: var(--fx-edge), inset 0 0 0 100vmax var(--fx-fill); } /* outranks Bootstrap .nav-link:focus-visible glow */

/* v0.9: Bootstrap swaps the button background on hover, active and focus; keep the resting surface so only the shared overlay moves. */
.btn:not(.btn-primary) { --bs-btn-hover-bg: var(--surface); --bs-btn-active-bg: var(--surface); --bs-btn-hover-border-color: var(--state-line); --bs-btn-active-border-color: var(--state-line); }

/* ---------- v0.10 UX audit fixes ---------- */
/* UX-02: prose keeps a readable measure (about 65-75 characters); rows, cards and tables keep their width. */
main p, main li:not([class]) { max-width: 70ch; }
/* UX-04: plain-text label for normal states and categories (badges are kept for decisions, risk and uncertainty). */
.fact { font-size: var(--text-sm); color: var(--muted); }
/* UX-01: the reference blocks on Home sit in one disclosure, closed by default. */
.home-more { margin-top: var(--s6); }
.home-more > summary { flex-wrap: wrap; row-gap: 0; }
.home-more-title { font-size: var(--text-lg); }
.home-more-list { flex-basis: 100%; padding-left: calc(1em + var(--s2)); font-weight: 400; }
/* UX-07: no transitions for the two frames of a theme change. */
.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }

/* ---------- v0.10.1 row targets (scope addition, founder instruction 24 Nov) ---------- */
/* A row that shows the hover state must act on a click anywhere in it: its one link or button is stretched over the row.
   Focus, tab order and the accessible name stay on that link or button. */
.has-link { position: relative; cursor: pointer; }
.has-link .row-link { position: static; }
.has-link .row-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
/* Information-only rows are not controls: no hover fill, no decision edge, no pressed state. */
@media (hover: hover) and (pointer: fine) {
  .list-group-item.attn-item.is-static:hover { --fx-fill: transparent; --fx-edge: inset 0 0 0 0 transparent; }
}
.list-group-item.attn-item.is-static:active { --fx-fill: transparent; }
/* Pressed ledger row, like the other rows. */
.ledger-table tbody tr.has-link:active > td { --fx-fill: var(--state-pressed); transition-duration: 0s; }
/* Under 760px the ledger row is a grid: draw the state on the row so the fill reaches its edges and the decision edge sits at its left. */
@media (max-width: 759px) {
  .ledger-table tbody tr { --fx-edge: inset 0 0 0 0 transparent; --fx-fill: transparent;
    box-shadow: var(--fx-edge), inset 0 0 0 100vmax var(--fx-fill); transition: box-shadow var(--state-out) var(--ease-out); }
  .ledger-table tbody tr > td { box-shadow: none; }
  .ledger-table tbody tr.has-link:active { --fx-fill: var(--state-pressed); transition-duration: 0s; }
}
@media (max-width: 759px) and (hover: hover) and (pointer: fine) {
  .ledger-table tbody tr.has-link:hover { --fx-fill: var(--state-hover); --fx-edge: inset 3px 0 0 0 var(--state-intent); transition-duration: var(--state-in); }
}
