/* ======================================================================
   ValueSight Component Primitives — v1.0 (May 2026)
   Source of truth: docs/design/valuesight-design.md §10–§13.
   Loads after base.css, before styles.css. Surface-specific rules in
   styles.css can override individual selectors when needed.
   ====================================================================== */

/* ── §10.3 Cell input (in data grids) ──────────────────────────────
   Cells are not form fields. Different treatment.
   - No border in default state (only the cell's grid lines)
   - On focus: 2px inset focus border, panel background
   - On selected (no focus): 2px inset brand border, fade background
   - Editable cells get a 1px subtle bg tint to distinguish from
     formula/output cells.
   ──────────────────────────────────────────────────────────────── */
.cell-input {
  width: 100%;
  height: 100%;
  min-height: 24px;
  border: 0;
  background: transparent;
  font: 400 12px/1.4 var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero", "ss01";
  color: var(--text-primary);
  text-align: right;
  padding: 0 4px;
  outline: none;
}
.cell-input.editable { background: var(--surface-raised); }
.cell-input:hover { background: var(--surface-raised); }
.cell-input:focus {
  background: var(--surface-panel);
  box-shadow: inset 0 0 0 2px var(--border-focus);
}
.cell-input.selected {
  background: var(--brand-primary-fade);
  box-shadow: inset 0 0 0 2px var(--border-brand);
}

/* ── §10.4 Tabs ────────────────────────────────────────────────────
   Two variants — segmented (top-bar scenarios) and underline
   (canvas section tabs).
   ──────────────────────────────────────────────────────────────── */

/* Segmented — pill-style group with shared container. */
.tabs-segmented {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px;
  background: var(--surface-dim);
  border-radius: var(--radius-sm);
}
.tabs-segmented .tab {
  font: 500 12px/1 var(--font-sans);
  letter-spacing: -0.003em;
  padding: 4px 10px;
  height: 24px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.tabs-segmented .tab:hover { color: var(--text-primary); }
.tabs-segmented .tab.active {
  background: var(--surface-panel);
  color: var(--brand-primary);
  box-shadow: inset 0 -1px 0 var(--brand-primary);
}

/* Underline — section tabs anchored to a baseline rule. */
.tabs-underline {
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border-subtle);
}
.tabs-underline .tab {
  font: 400 13px/1.45 var(--font-sans);
  letter-spacing: -0.003em;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard);
}
.tabs-underline .tab:hover { color: var(--text-primary); }
.tabs-underline .tab.active {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-primary);
  font-weight: 500;
}

/* ── §10.7 Card (default) ────────────────────────────────────────
   Hairline panel. No shadow. Padding per density mode.
   ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* ── §10.11 Tooltip ──────────────────────────────────────────────
   Inverse-surface tooltip with anchor text.
   ──────────────────────────────────────────────────────────────── */
.tooltip {
  background: var(--surface-inverse);
  color: var(--text-on-anchor);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font: 400 12px/1.4 var(--font-sans);
  letter-spacing: 0;
  max-width: 240px;
  pointer-events: none;
  z-index: 1000;
}
[data-theme="dark"] .tooltip {
  background: var(--anchor);
  color: var(--text-primary);
}

/* ── §10.13 Popover / Dropdown ────────────────────────────────────
   Built on Radix in React land — here a styling primitive only.
   ──────────────────────────────────────────────────────────────── */
.popover {
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  padding: 8px;
  z-index: 900;
}

/* ── §10.12 Modal / Dialog ────────────────────────────────────────
   Class hook for new modals. Existing .modal in styles.css is the
   primary surface and stays as-is for back-compat.
   ──────────────────────────────────────────────────────────────── */
.dialog {
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
}
.dialog-backdrop {
  background: var(--surface-overlay);
}

/* ── §9.3 Causality pulse keyframe ───────────────────────────────
   Brief brand-fade flash to mark a value CHANGE (recalculation
   choreography). Trigger by toggling .pulse on the cell. */
@keyframes causality-pulse {
  0%   { background-color: var(--brand-primary-fade); }
  100% { background-color: transparent; }
}
.pulse {
  animation: causality-pulse 120ms var(--ease-out);
}
/* Batch 7 — vega-workflow-spec §5.5 / foundational §9.4: pulses become
   single-frame highlights (or disabled) under reduced-motion. */
@media (prefers-reduced-motion: reduce) {
  .pulse { animation: none; background-color: var(--brand-primary-fade); }
}

/* ── §9.3 Navigation pulse keyframe ──────────────────────────────
   Outline-only pulse in --border-brand fading to transparent. Used
   to draw the eye to a target the user just *navigated to* (e.g. a
   ledger row reached via the sensitivity heatmap). Semantically
   distinct from .pulse — the value didn't change; we're flagging
   "look here". 200ms duration to feel slightly slower / more
   deliberate than the cell-change pulse.
   (Batch 5b refinement: outline-only — no box-shadow.) */
@keyframes navigation-pulse {
  0%   { outline: 1px solid var(--border-brand); outline-offset: 0; }
  60%  { outline: 1px solid var(--brand-primary-fade); }
  100% { outline: 1px solid transparent; }
}
.nav-pulse {
  animation: navigation-pulse 200ms var(--ease-out);
}
/* Batch 7 — same canon as .pulse above. */
@media (prefers-reduced-motion: reduce) {
  .nav-pulse { animation: none; outline: 1px solid var(--border-brand); }
}

/* ── §12 Vega rail (structural right rail) ────────────────────────
   Design system primitive. Header (40px) + status line (28px) +
   filter chips + card stack + optional command input (44px).
   This class hook is ready for HTML adoption — instantiating the
   rail in index.html is a separate restructure.
   ──────────────────────────────────────────────────────────────── */
.vega-rail {
  width: 360px;
  min-width: 360px;
  background: var(--surface-panel);
  border-left: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width var(--duration-base) var(--ease-standard),
              min-width var(--duration-base) var(--ease-standard);
}
.vega-rail.collapsed { width: 40px; min-width: 40px; }
.vega-rail-header {
  height: 40px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  font: 500 13px/1 var(--font-sans);
  color: var(--text-primary);
}
.vega-rail-status {
  height: 28px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  font: 400 11px/1 var(--font-sans);
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-subtle);
}
.vega-rail-chips {
  padding: 8px 12px;
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border-subtle);
}
.vega-rail-stack {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* §12.1 (revised): the rail ends at the card stack. Free-form Vega
   interaction lives in ⌘J (cell popover) and ⌘K (global commands) — not
   in a rail-bottom command input. The .vega-rail-command class hook is
   intentionally absent. */

/* ── Vega rail chrome (header buttons, status text, chips, empty) ─ */
.vega-rail-mark {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: 0;
  border-radius: var(--radius-sm);
  color: var(--brand-primary);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.vega-rail-mark:hover { background: var(--surface-raised); }
.vega-rail-name {
  flex: 1;
  font: 500 13px/1 var(--font-sans);
  letter-spacing: -0.005em;
  color: var(--text-primary);
}
.vega-rail-collapse {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; padding: 0;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard),
              transform var(--duration-base) var(--ease-standard);
}
.vega-rail-collapse:hover { background: var(--surface-raised); color: var(--text-primary); }
/* G17 (2026-08-25) — the collapsed strip's control must be REACHABLE.
   `.vega-rail-header` keeps `padding: 0 12px` and holds two 22px buttons with
   an 8px gap = 52px of content in a 40px rail whose content box is 16px. The
   chevron was pushed to 1397->1411 in a 1400px viewport: `elementFromPoint` at
   its own centre (1404, 64) returned NULL, leaving a ~3px hittable sliver at
   the screen edge. The composer's Send button fared worse — it started at
   1401, entirely offscreen. Width-independent: the strip is flush right at any
   viewport.
   ⭐ BOTH header buttons carry `data-vega-collapse` and call the SAME
   toggleCollapsed(), so showing one of them loses no function. The mark is
   the one kept: it is the only control that also says WHAT the strip is, and
   it was already the one fully inside the viewport (1373->1389, centre
   hit-tests to itself). Its aria-label flips to "Expand rail" in
   vega-rail.js toggleCollapsed() — see G9 there.
   ⚠️ The rotate(180deg) below is therefore INERT while collapsed (its subject
   is hidden). Kept, not deleted: it is the expanded->collapsed transition's
   own styling and costs nothing, but do not read its presence as evidence the
   chevron is visible in the strip. */
.vega-rail.collapsed .vega-rail-header { padding: 0; gap: 0; justify-content: center; }
.vega-rail.collapsed .vega-rail-collapse { display: none; }

.vega-rail.collapsed .vega-rail-collapse { transform: rotate(180deg); }
.vega-rail.collapsed .vega-rail-name,
.vega-rail.collapsed .vega-rail-status,
.vega-rail.collapsed .vega-rail-chips,
.vega-rail.collapsed .vega-rail-stack,
.vega-rail.collapsed .vega-rail-chat-region { display: none; }

/* ═══ Vega rail chat region — Stage 3.5 Tier 3 V2-B (2026-05-15) ═══
   Spec: docs/specs/2026-05-15-stage-3-5-tier-3-vega-chat-rail-region.md
   Lives at the bottom of .vega-rail, below .vega-rail-stack.
   Collapsed = composer-only (~60px). Expanded = transcript visible
   (max-height 320px). Per V2 design Q1: separate region but same
   rail container — "one Vega". */
.vega-rail-chat-region {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  flex-shrink: 0;
}
.vega-rail-chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font: 500 11px/1 var(--font-sans);
  color: var(--text-tertiary);
}
.vega-rail-chat-label {
  flex: 1;
  color: var(--text-secondary);
}
.vega-rail-chat-status {
  display: none;
  font: 400 11px/1 var(--font-sans);
  color: var(--text-tertiary);
  font-style: italic;
}
/* "How deep now" (spec 2026-10-30): Brief / Full, chosen per request. Shared by the
   rail chat header and the Generate menu's top row. */
.vega-rail-chat-depth,
.vega-generate-depth {
  display: inline-flex;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-left: auto;
}
.vega-generate-depth { margin: 4px 10px 6px; align-self: flex-start; }
.vega-rail-chat-depth-opt,
.vega-generate-depth-opt {
  background: transparent;
  border: 0;
  padding: 3px 8px;
  font: 500 11px/1.2 var(--font-sans);
  color: var(--text-secondary);
  cursor: pointer;
}
.vega-rail-chat-depth-opt + .vega-rail-chat-depth-opt,
.vega-generate-depth-opt + .vega-generate-depth-opt { border-left: 1px solid var(--border-default); }
.vega-rail-chat-depth-opt.active,
.vega-generate-depth-opt.active {
  background: var(--surface-dim);
  color: var(--text-primary);
}
.vega-rail-chat-halt {
  background: transparent;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 2px 8px;
  font: 500 11px/1 var(--font-sans);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.vega-rail-chat-halt:hover { background: var(--surface-raised); }

.vega-rail-chat-transcript {
  display: none;
  overflow-y: auto;
  padding: 12px;
  font: 400 13px/1.5 var(--font-sans);
  color: var(--text-primary);
  max-height: 320px;
  min-height: 80px;
}
.vega-rail-chat-region.expanded .vega-rail-chat-transcript {
  display: block;
}

.vega-rail-chat-msg {
  margin-bottom: 12px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  font-size: 13px;
  line-height: 1.5;
}
.vega-rail-chat-msg p { margin: 0 0 6px 0; }
.vega-rail-chat-msg p:last-child { margin-bottom: 0; }
.vega-rail-chat-msg-user {
  background: var(--brand-primary-fade);
  color: var(--text-primary);
  margin-left: 24px;
}
.vega-rail-chat-msg-assistant {
  background: transparent;
  color: var(--text-primary);
  margin-right: 24px;
}
/* (h11b) "Lead with this" under a Vega reply — VegaRailLeadOptions.tsx */
.vega-rail-lead-options { margin: -4px 24px 12px 0; }
.vega-rail-lead-option { padding: 8px 10px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); margin-bottom: 6px; }
.vega-rail-lead-option-why { font-size: 12px; line-height: 1.5; margin-bottom: 6px; }
.vega-rail-lead-option-note { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
/* 2026-10-30: quotes and tables in a Vega reply (vegaRailChatModel.ts renderChatMarkdown). */
.vega-rail-chat-quote {
  margin: 4px 0 8px 0;
  padding: 2px 0 2px 10px;
  border-left: 3px solid var(--border-default);
  color: var(--text-secondary);
  font-style: italic;
}
.vega-rail-chat-table {
  width: 100%;
  margin: 4px 0 8px 0;
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.4;
}
.vega-rail-chat-table th,
.vega-rail-chat-table td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--border-default);
  text-align: left;
  vertical-align: top;
}
.vega-rail-chat-table th { font-weight: 600; background: var(--surface-raised); }
.vega-rail-chat-msg code {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  padding: 1px 4px;
  background: var(--surface-raised);
  border-radius: var(--radius-sm);
}
.vega-rail-chat-caret {
  display: inline-block;
  width: 1ch;
  color: var(--brand-primary);
  animation: vegaCaretBlink 1s steps(2, start) infinite;
}
@keyframes vegaCaretBlink {
  to { visibility: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .vega-rail-chat-caret { animation: none; }
}

.vega-rail-chat-composer-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 8px 12px 12px;
  border-top: 1px solid var(--border-subtle);
}
.vega-rail-chat-region:not(.expanded) .vega-rail-chat-composer-row {
  border-top: 0;
}
.vega-rail-chat-composer {
  flex: 1;
  resize: none;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font: 400 13px/1.4 var(--font-sans);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-standard);
}
.vega-rail-chat-composer:focus { border-color: var(--brand-primary); }
.vega-rail-chat-composer::placeholder { color: var(--text-tertiary); }
.vega-rail-chat-send {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-primary);
  border: 0;
  border-radius: var(--radius-md);
  color: var(--text-on-brand);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
              opacity var(--duration-fast) var(--ease-standard);
}
.vega-rail-chat-send:hover { background: var(--brand-primary-hover, var(--brand-primary)); }
.vega-rail-chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

.vega-rail-status .vega-rail-context {
  color: var(--text-secondary);
  font-weight: 500;
}

.vega-rail-chip {
  font: 400 11px/1 var(--font-sans);
  letter-spacing: 0;
  height: 22px;
  padding: 0 8px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.vega-rail-chip:hover { background: var(--surface-raised); color: var(--text-primary); }
.vega-rail-chip.active {
  background: var(--brand-primary-fade);
  color: var(--brand-primary);
  border-color: rgba(45, 90, 76, 0.3);
}

.vega-rail-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-tertiary);
}
.vega-rail-empty-headline {
  font: 500 13px/1.3 var(--font-sans);
  letter-spacing: -0.005em;
  color: var(--text-secondary);
  margin: 0 0 4px;
}
.vega-rail-empty-body {
  font: 400 12px/1.5 var(--font-sans);
  color: var(--text-tertiary);
  margin: 0;
}

/* ── §10.6 KPI pill ──────────────────────────────────────────────
   Inline metric pill: [label] [value] [delta?]. Used in deal headers
   and chart legends. Primary KPI variant gets brand-primary fade
   background and brand-coloured value. */
.kpi-pill {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  min-width: 0;
}
.kpi-pill-label {
  font: 400 10px/1 var(--font-sans);
  letter-spacing: 0.02em;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.kpi-pill-value {
  font: 500 14px/1.1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "zero";
  color: var(--text-primary);
  white-space: nowrap;
}
.kpi-pill-delta {
  font: 400 10px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.kpi-pill-delta.is-positive { color: var(--positive); }
.kpi-pill-delta.is-negative { color: var(--negative); }
.kpi-pill-primary {
  background: var(--brand-primary-fade);
  border-color: rgba(45, 90, 76, 0.3);
}
.kpi-pill-primary .kpi-pill-value { color: var(--brand-primary); }

/* ── §10.9 Tier dot (provenance indicator) ───────────────────────
   5px diameter, inline 4px to the right of any sourced number.
   Filled for validated / corpus / inferred; hollow for override. */
.tier-dot {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tier-dot.tier-validated { background: var(--tier-validated); }
.tier-dot.tier-corpus    { background: var(--tier-corpus); }
.tier-dot.tier-inferred  { background: var(--tier-inferred); }
/* #3 (2026-07-13) — a lever riding a non-verified research fact (or a
   research_derived value). Amber, matching the inputs-panel "Estimated" chrome
   (.bcv2-prov-estimated → --tier-inferred): amber consistently reads "grounded
   but not verified". The distinct LABEL ("Estimated") carries the meaning. */
.tier-dot.tier-estimated { background: var(--tier-inferred); }
.tier-dot.tier-override  { background: transparent; border: 1.5px solid var(--tier-override); width: 8px; height: 8px; }

/* ── §10.8 Vega card archetypes ──────────────────────────────────
   Four archetypes: insight / diff / suggestion / synthesis.
   Common grammar: 2px left stripe, hairline on remaining sides,
   tier dot + label, title, body, optional metrics, actions.
   Newest-on-top stacking handled by vega-rail-stack flex order. */
.vega-card {
  position: relative;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-left-width: 2px;
  border-left-color: var(--vega-stripe);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Slide-down 8px with fade over 160ms (§12.2). */
@keyframes vega-card-enter {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vega-card { animation: vega-card-enter var(--duration-fast) var(--ease-standard); }
@media (prefers-reduced-motion: reduce) {
  .vega-card { animation: none; }
}
.vega-card-meta {
  display: flex; align-items: center; gap: 6px;
  font: 500 10px/1 var(--font-sans);
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  text-transform: none;
}
.vega-card-tier { color: var(--text-tertiary); }
.vega-card-archetype {
  margin-left: auto;
  margin-right: 4px;
  color: var(--text-tertiary);
}
.vega-card-dismiss {
  background: transparent; border: 0; padding: 2px;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.vega-card-dismiss:hover { background: var(--surface-raised); color: var(--text-primary); }
.vega-card-title {
  font: 500 13px/1.35 var(--font-sans);
  letter-spacing: -0.005em;
  color: var(--text-primary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vega-card-body {
  font: 400 12px/1.45 var(--font-sans);
  color: var(--text-secondary);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 2026-07-14 — clamped card text is clickable to expand (title= gives a hover
   reveal too). Without this, bodies over 4 lines were silently cut with no way
   to read the rest. */
.vega-card-title, .vega-card-body { cursor: pointer; }
.vega-card-title.is-expanded, .vega-card-body.is-expanded {
  -webkit-line-clamp: unset;
  overflow: visible;
}
.vega-card-metrics {
  border-top: 1px solid var(--border-subtle);
  padding-top: 8px;
  margin-top: 2px;
  /* Wraps (plan 3D, 2026-10-27): a realization card carries five figures, and in one
     unwrapped row of shrinkable cells "$12,400,000" printed over its neighbour. */
  display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 8px;
}
.vega-card-metric { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; max-width: 100%; }
.vega-card-metric-label {
  font: 400 10px/1.25 var(--font-sans);
  color: var(--text-tertiary);
  letter-spacing: 0.04em;
}
.vega-card-metric-value {
  white-space: nowrap;
  font: 500 12px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.vega-card-actions { display: flex; gap: 4px; margin-top: 2px; }

/* §10.8 archetype variations.
   Synthesis cards in the rail are otherwise identical to insight cards
   except they carry an over-title "Vega Synthesis" label. The 16px
   padding for synthesis applies only to analysis-view exports (§13.5),
   not to the rail. */
/* §5.3 (foundational-updates): default stripe color is --brand-primary
   for every archetype. Suggestion may shift to --warning only when the card
   is rendering a Caution variant; Insight may shift to --negative for an
   Alert variant. Default = brand. */
.vega-card-insight    { border-left-color: var(--brand-primary); }
.vega-card-diff       { border-left-color: var(--brand-primary); }
.vega-card-suggestion { border-left-color: var(--brand-primary); }
.vega-card-synthesis  { border-left-color: var(--brand-primary); }
/* Variant overrides when explicitly tagged. */
.vega-card-suggestion.is-caution { border-left-color: var(--warning); }
.vega-card-insight.is-alert      { border-left-color: var(--negative); }
.vega-card.is-pinned  { background: var(--brand-primary-fade); }

.vega-card-overtitle {
  font: 500 10px/1 var(--font-sans);
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-top: -2px;
}

/* ── §13.6 Empty state ───────────────────────────────────────────
   Centered single-column. No oversized illustrations, no pastel
   gradients. Composition: small mark, headline, body, two buttons,
   optional quick-start grid below.
   ──────────────────────────────────────────────────────────────── */
.empty-state {
  max-width: 640px;
  margin: 0 auto;
  padding: 64px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.empty-state-mark {
  width: 24px;
  height: 24px;
  background: var(--brand-primary-tint);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.empty-state-headline {
  font: 500 24px/1.25 var(--font-sans);
  letter-spacing: -0.018em;
  color: var(--text-primary);
}
.empty-state-body {
  font: 400 13px/1.45 var(--font-sans);
  color: var(--text-secondary);
  max-width: 420px;
}
.empty-state-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* ── Modal + form primitives ─────────────────────────────────────
   Spec: docs/design/form-modal-spec.md §2 (frame), §3 (form), §4
   (provenance tags), §5 (inputs), §8 (animation), §9 (confirmation),
   §10 (picker), §13.1 (locked tokens).

   Class prefix: vs- (valuesight workspace primitive). Coexists with
   legacy .modal/.modal-overlay/.form-row CSS until Batch 3 sweeps it.
   ─────────────────────────────────────────────────────────────── */

/* ── §2.3 Scrim ──────────────────────────────────────────────── */
.vs-modal-scrim {
  position: fixed; inset: 0;
  background: var(--surface-overlay); /* §13.1 — --text-primary at 40% via token */
  z-index: 1000;
  opacity: 0;
  transition: opacity 80ms var(--ease-standard);
}
.vs-modal-scrim[data-state="open"]    { opacity: 1; }
.vs-modal-scrim[data-state="closing"] { opacity: 0; transition-duration: 60ms; transition-timing-function: var(--ease-in); }

/* ── §2.2 Frame ──────────────────────────────────────────────── */
.vs-modal-frame-wrap {
  position: fixed; inset: 0;
  z-index: 1001;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 80px;          /* §2.2 vertical positioning */
  pointer-events: none;
}
.vs-modal-frame-wrap > * { pointer-events: auto; }
.vs-modal-frame {
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
  overflow: hidden;
  width: 640px;               /* default; inline width overrides */
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 80ms var(--ease-out), transform 80ms var(--ease-out);
}
.vs-modal-frame-wrap[data-state="open"] .vs-modal-frame   { opacity: 1; transform: translateY(0); }
.vs-modal-frame-wrap[data-state="closing"] .vs-modal-frame {
  opacity: 0; transform: translateY(4px);
  transition-duration: 60ms;
  transition-timing-function: var(--ease-in);
}
@media (prefers-reduced-motion: reduce) {
  .vs-modal-scrim,
  .vs-modal-frame { transition: none !important; }
}

/* ── §2.4 Header ─────────────────────────────────────────────── */
.vs-modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex; align-items: flex-start; gap: 12px;
}
.vs-modal-header-text { flex: 1; min-width: 0; }
.vs-modal-title {
  font: 500 19px/1.3 var(--font-sans);
  letter-spacing: -0.015em;
  color: var(--text-primary);
}
.vs-modal-subtitle {
  font: 400 13px/1.4 var(--font-sans);
  color: var(--text-secondary);
  margin-top: 4px;
}
.vs-modal-close {
  width: 24px; height: 24px;
  background: transparent; border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
  flex-shrink: 0;
}
.vs-modal-close:hover { background: var(--surface-raised); color: var(--text-primary); }

/* ── §6.5 Error banner slot ──────────────────────────────────── */
.vs-modal-error-slot:empty { display: none; }
.vs-modal-error-banner {
  margin: 12px 24px 0;
  padding: 12px;
  background: var(--negative-tint);
  border: 1px solid var(--negative);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; gap: 8px;
  color: var(--negative);
  font: 400 13px/1.4 var(--font-sans);
}
.vs-modal-error-message { flex: 1; }
.vs-modal-error-dismiss {
  background: transparent; border: 0; padding: 2px; cursor: pointer;
  color: var(--negative);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
}
.vs-modal-error-dismiss:hover { background: rgba(184, 39, 59, 0.10); }

/* ── §2.5 Body ──────────────────────────────────────────────── */
.vs-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* ── §2.6 Footer ────────────────────────────────────────────── */
.vs-modal-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 16px;
}
.vs-modal-footer-actions {
  display: flex; gap: 8px; justify-content: flex-end;
}
.vs-btn {
  font: 500 13px/1 var(--font-sans);
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background-color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.vs-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.vs-btn-ghost { color: var(--text-secondary); }
.vs-btn-ghost:hover:not(:disabled) { background: var(--surface-raised); color: var(--text-primary); }
.vs-btn-secondary {
  border-color: var(--border-default);
  color: var(--text-primary);
}
.vs-btn-secondary:hover:not(:disabled) {
  background: var(--surface-raised);
  border-color: var(--border-strong);
}
.vs-btn-primary {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: var(--text-on-brand);
}
.vs-btn-primary:hover:not(:disabled) {
  background: var(--brand-primary-hover);
  border-color: var(--brand-primary-hover);
}
.vs-btn-destructive {
  background: var(--negative);
  border-color: var(--negative);
  color: var(--text-on-brand);
}
.vs-btn-destructive:hover:not(:disabled) {
  filter: brightness(0.95);
}

/* ── §9.1 Confirmation dialog (compact) ─────────────────────── */
/* §9 compact frame — no header at all. Body owns the title. */
.vs-modal-frame-compact .vs-modal-footer { border-top: 0; padding-top: 0; }
.vs-modal-frame-compact .vs-modal-body { padding-bottom: 0; }
/* Back-compat: legacy .vs-modal-frame-confirmation kept while older code
   paths still reference it. Behaves identically to .vs-modal-frame-compact. */
.vs-modal-frame-confirmation .vs-modal-header { display: none; }
.vs-modal-frame-confirmation .vs-modal-footer { border-top: 0; padding-top: 0; }
.vs-confirm-body { padding: 4px 0 16px; }
.vs-confirm-title {
  font: 500 15px/1.35 var(--font-sans);
  color: var(--text-primary);
}
.vs-confirm-message {
  margin-top: 8px;
  font: 400 13px/1.5 var(--font-sans);
  color: var(--text-secondary);
}

/* ── §3 Form composition ─────────────────────────────────────── */
.vs-form { display: flex; flex-direction: column; }
.vs-form-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.vs-form-section:first-child { padding-top: 0; }
.vs-form-section:last-child  { padding-bottom: 0; border-bottom: 0; }
.vs-form-section-heading {
  font: 500 13px/1.2 var(--font-sans);
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 6px;
}
.vs-form-section-heading-trail {
  color: var(--text-tertiary);
  font-weight: 400;
}
.vs-form-section-fields {
  display: flex; flex-direction: column; gap: 16px;
}
.vs-form-section-grid .vs-form-section-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ── §3.3 Field row ─────────────────────────────────────────── */
.vs-field { display: flex; flex-direction: column; gap: 6px; }
.vs-field-label-row {
  display: flex; align-items: center; gap: 8px;
}
.vs-field-label {
  font: 500 13px/1.3 var(--font-sans);
  color: var(--text-primary);
  display: inline-flex; align-items: center; gap: 6px;
}
.vs-field-prov-slot {
  display: inline-flex; gap: 4px;
}
.vs-field-help {
  margin-left: auto;
  color: var(--text-tertiary);
  cursor: help;
  display: inline-flex; align-items: center;
}
.vs-field-help:hover { color: var(--text-secondary); }
.vs-field-desc {
  font: 400 12px/1.45 var(--font-sans);
  color: var(--text-secondary);
}
.vs-field-message {
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-tertiary);
  margin-top: 2px;
}
.vs-field-message[data-state="error"]   { color: var(--negative); }
.vs-field-message[data-state="warning"] { color: var(--warning); }
.vs-field-message[data-state="success"] { color: var(--positive); }

/* ── §4 Provenance tag ──────────────────────────────────────── */
.vs-provenance-tag {
  display: inline-flex; align-items: center;
  height: 16px;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--surface-dim);
  color: var(--text-secondary);
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.02em;
}
.vs-provenance-tag[data-tag-type="l1"] {
  background: var(--surface-dim);
  color: var(--text-secondary);
}
.vs-provenance-tag[data-tag-type="l2"] {
  background: var(--brand-primary-fade);
  color: var(--brand-primary);
  border-color: rgba(45, 90, 76, 0.20);
}
.vs-provenance-tag[data-tag-type="customer"],
.vs-provenance-tag[data-tag-type="benchmark"],
.vs-provenance-tag[data-tag-type="inferred"] {
  background: var(--surface-dim);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-weight: 500;
}
.vs-provenance-tag[data-tag-type="required"] {
  background: var(--warning-tint);
  color: var(--warning);
  border-color: rgba(194, 138, 28, 0.25);
  font-family: var(--font-sans);
}
.vs-provenance-tag[data-tag-type="override"] {
  background: var(--brand-primary-fade);
  color: var(--brand-primary);
  border-color: rgba(45, 90, 76, 0.20);
  font-family: var(--font-sans);
}

/* ── §5 Inputs ──────────────────────────────────────────────── */
.vs-input,
.vs-textarea,
.vs-select {
  width: 100%;
  height: 36px;
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font: 400 14px/1.4 var(--font-sans);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-standard),
              background-color var(--duration-fast) var(--ease-standard);
  font-family: inherit;
}
.vs-input::placeholder,
.vs-textarea::placeholder { color: var(--text-tertiary); }
.vs-input:focus,
.vs-textarea:focus,
.vs-select:focus { border-color: var(--brand-primary); }
.vs-textarea {
  height: auto;
  min-height: 96px;
  max-height: 240px;
  padding: 10px 12px;
  resize: vertical;
}
.vs-input:disabled,
.vs-textarea:disabled,
.vs-select:disabled {
  background: var(--surface-dim);
  color: var(--text-tertiary);
  cursor: not-allowed;
}
.vs-input[readonly],
.vs-textarea[readonly] {
  background: var(--surface-dim);
  color: var(--text-secondary);
}
/* §5.3 Select wrap (chevron overlay) */
.vs-select-wrap {
  position: relative;
}
.vs-select { padding-right: 32px; appearance: none; -webkit-appearance: none; cursor: pointer; }
.vs-select-chevron {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
/* §5.5 Number input */
.vs-number-wrap { position: relative; }
/* --vs-number-pad is set inline by NumberInput from the unit's length, so
   a wide affix ("hrs / mo") can't sit on top of the right-aligned value.
   The 32px fallback is the historical fit for a ~2-char unit ("$M", "%")
   and is what a unit-less number input uses. */
/* ⛔ `.vs-input.vs-number`, NOT `.vs-number` (2026-10-18): styles.css loads LAST
   and its `input[type="number"] { padding: 0 10px }` (specificity 0,1,1) beat
   the single class (0,1,0), so every unit affix sat ON the value — "wee46",
   a tangled "10%" — on My Method and every number field. Two classes win. */
.vs-input.vs-number { text-align: right; font-variant-numeric: tabular-nums; padding-right: var(--vs-number-pad, 32px);
  /* Room for a 5-digit value beside its unit: the small ramp boxes clipped "100" to "10(" once the unit's space was honoured. */
  min-width: calc(12px + 5ch + var(--vs-number-pad, 32px)); }
.vs-input-unit {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  font: 400 12px/1 var(--font-sans);
  pointer-events: none;
}

/* §5.7 Validation states (set on .vs-field via data-field-state) */
.vs-field[data-field-state="error"] .vs-input,
.vs-field[data-field-state="error"] .vs-textarea,
.vs-field[data-field-state="error"] .vs-select {
  border-color: var(--negative);
  background: var(--negative-tint);
}
.vs-field[data-field-state="warning"] .vs-input,
.vs-field[data-field-state="warning"] .vs-textarea,
.vs-field[data-field-state="warning"] .vs-select {
  border-color: var(--warning);
  background: var(--warning-tint);
}
.vs-field[data-field-state="success"] .vs-input,
.vs-field[data-field-state="success"] .vs-textarea,
.vs-field[data-field-state="success"] .vs-select {
  border-color: var(--positive);
}

/* ── §5.6 Toggle / checkbox ─────────────────────────────────── */
.vs-toggle-row {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  padding: 4px 0;
}
.vs-checkbox {
  width: 16px; height: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-base);
  flex-shrink: 0;
}
.vs-checkbox:checked {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-position: center; background-repeat: no-repeat; background-size: 10px;
}
.vs-toggle-label {
  font: 400 14px/1.4 var(--font-sans);
  color: var(--text-primary);
}
.vs-toggle-desc {
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-tertiary);
  display: block;
  width: 100%;
  margin-left: 24px;
  margin-top: -2px;
}

/* §5.6 Switch variant */
.vs-switch-row { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.vs-switch {
  width: 32px; height: 16px;
  border-radius: 999px;
  background: var(--border-default);
  position: relative;
  transition: background-color 120ms var(--ease-standard);
  flex-shrink: 0;
}
.vs-switch.is-on { background: var(--brand-primary); }
.vs-switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 12px; height: 12px;
  background: var(--text-tertiary);
  border-radius: 50%;
  transition: left 120ms var(--ease-standard), background-color 120ms var(--ease-standard);
}
.vs-switch.is-on .vs-switch-thumb { left: 18px; background: var(--text-on-brand); }
.vs-switch-input { position: absolute; opacity: 0; pointer-events: none; }
.vs-switch-label { font: 400 14px/1.4 var(--font-sans); color: var(--text-primary); }

/* ── §5.4 Multi-tag selector ────────────────────────────────── */
.vs-multitag {
  width: 100%;
  min-height: 36px;
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  display: flex; flex-wrap: wrap; gap: 4px; align-items: center;
}
.vs-multitag:focus-within { border-color: var(--brand-primary); }
.vs-multitag-tags { display: contents; }
.vs-tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px;
  padding: 0 6px;
  background: var(--brand-primary-fade);
  color: var(--brand-primary);
  border-radius: var(--radius-sm);
  font: 500 12px/1 var(--font-sans);
}
.vs-tag-remove {
  background: transparent; border: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--brand-primary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  width: 14px; height: 14px;
  opacity: 0.7;
}
.vs-tag-remove:hover { opacity: 1; background: rgba(45, 90, 76, 0.10); }
.vs-multitag-input {
  flex: 1;
  min-width: 100px;
  border: 0; outline: 0;
  background: transparent;
  font: 400 14px/1 var(--font-sans);
  color: var(--text-primary);
}
.vs-multitag-input::placeholder { color: var(--text-tertiary); }

/* Repeating list row (input + remove button) */
.vs-repeating-row {
  display: flex; gap: 6px; align-items: stretch;
}
.vs-repeating-row .vs-input-row { flex: 1; }
.vs-repeating-remove {
  width: 32px; height: 36px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
  flex-shrink: 0;
}
.vs-repeating-remove:hover {
  border-color: var(--negative);
  color: var(--negative);
  background: var(--negative-tint);
}

/* ── Repeating list (used by Profile modal value drivers etc.) ─ */
.vs-repeating-list {
  display: flex; flex-direction: column; gap: 6px;
}
.vs-repeating-list-items {
  display: flex; flex-direction: column; gap: 6px;
}
.vs-repeating-add {
  align-self: flex-start;
  background: transparent;
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font: 500 12px/1 var(--font-sans);
  padding: 6px 10px;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard),
              border-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.vs-repeating-add:hover {
  background: var(--surface-raised);
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* ── §10 Picker modal ────────────────────────────────────────── */
.vs-picker { display: flex; flex-direction: column; gap: 12px; }
.vs-picker-search-row {
  position: relative;
  display: flex; align-items: center;
}
.vs-picker-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.vs-picker-search-input {
  width: 100%;
  height: 36px;
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0 12px 0 32px;
  font: 400 14px/1 var(--font-sans);
  color: var(--text-primary);
  outline: none;
}
.vs-picker-search-input:focus { border-color: var(--brand-primary); }
.vs-picker-list {
  max-height: 360px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.vs-picker-group { display: flex; flex-direction: column; }
.vs-picker-group-head {
  font: 500 11px/1.2 var(--font-sans);
  color: var(--text-tertiary);
  padding: 4px 8px;
  letter-spacing: 0.02em;
}
.vs-picker-item {
  display: flex; align-items: center; gap: 8px;
  height: 32px;
  padding: 0 8px;
  background: transparent;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: 400 14px/1.2 var(--font-sans);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.vs-picker-item:hover { background: var(--surface-raised); }
.vs-picker-item[aria-selected="true"] { background: var(--brand-primary-fade); }
.vs-picker-item-check { width: 14px; height: 14px; color: var(--brand-primary); flex-shrink: 0; }
.vs-picker-item-check-empty { display: inline-block; }
.vs-picker-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vs-picker-item-desc { color: var(--text-tertiary); font: 400 12px/1 var(--font-sans); flex-shrink: 0; }
.vs-picker-empty {
  padding: 24px;
  text-align: center;
  color: var(--text-tertiary);
  font: 400 13px/1.4 var(--font-sans);
}
.vs-picker-match { background: var(--warning-tint); color: inherit; padding: 0 1px; border-radius: 2px; }

/* ── Dense list view primitive ──────────────────────────────────
   Spec: docs/design/dense-list-view-spec.md §3 (layout), §4 (selection),
   §5 (filter chips), §6 (sort), §8.1 (locked tokens).
   ─────────────────────────────────────────────────────────────── */
.vs-list-view {
  display: flex; flex-direction: column;
  background: var(--surface-base);
  height: 100%;
  position: relative;
}

/* §3.2 Toolbar */
.vs-list-toolbar {
  height: 56px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-base);
}
.vs-list-title {
  font: 500 24px/1.2 var(--font-sans);
  letter-spacing: -0.018em;
  color: var(--text-primary);
}
.vs-list-toolbar-actions {
  display: flex; align-items: center; gap: 8px;
}
.vs-list-search-wrap {
  position: relative;
  display: flex; align-items: center;
}
.vs-list-search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--text-tertiary);
  pointer-events: none;
}
.vs-list-search {
  width: 280px; height: 32px;
  background: var(--surface-base);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 10px 0 32px;
  font: 400 13px/1 var(--font-sans);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-standard);
}
/* Coherence S2 smoke (2026-10-21): styles.css loads AFTER this file and its
   input[type="search"] rule (0,1,1) out-ranks .vs-list-search (0,1,0), so its
   `padding: 0 10px` won and the 14px icon at left:10px covered the placeholder's
   first letter on every ListView. Two classes (0,2,0) win the left padding back. */
.vs-list-search-wrap .vs-list-search { padding-left: 32px; }
.vs-list-search:focus { border-color: var(--border-default); background: var(--surface-panel); }
.vs-list-search::placeholder { color: var(--text-tertiary); }
.vs-list-filter-btn {
  width: 32px; height: 32px;
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.vs-list-filter-btn:hover { background: var(--surface-raised); color: var(--text-primary); }
.vs-list-new {
  height: 32px;
  padding: 0 12px;
}

/* §5.2 Filter chips */
.vs-list-chip-row {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 16px 0;
}
.vs-list-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px;
  padding: 0 8px;
  background: var(--surface-dim);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  font: 500 11px/1 var(--font-sans);
  color: var(--text-primary);
}
.vs-list-chip-x {
  background: transparent; border: 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  width: 14px; height: 14px;
}
.vs-list-chip-x:hover { background: var(--surface-raised); color: var(--text-primary); }
.vs-list-chip-clear-all {
  background: transparent; border: 0;
  font: 500 11px/1 var(--font-sans);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
}
.vs-list-chip-clear-all:hover { color: var(--text-primary); }
.vs-list-result-count {
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-tertiary);
  padding: 4px 16px 0;
}

/* §3.3-3.4 Table / header / rows */
/* G21 (2026-08-26) - THE TABLE OWNS THE TRACKS; HEADER AND ROWS INHERIT THEM.
   The header and every row used to be SEPARATE grid containers that shared
   only the template STRING, not the resolved tracks. An `auto` track sizes to
   its OWN container's content, so every row resolved different columns and
   nothing lined up with the header or with any other row.
   Measured live before the fix: all 6 list surfaces misaligned, worst
   header-row delta 159.66px (Outputs), and on Accounts 6 sampled rows
   produced 6 DISTINCT templates.
   `subgrid` was chosen over deterministic `minmax(0,1fr)` tracks BY
   MEASUREMENT, not preference: both align perfectly, but 1fr tracks share
   space equally instead of sizing to content and clipped 50 of 192 sampled
   cells (26.0%) against the pre-fix 29 (15.1%), where subgrid clips 8 (4.2%)
   - it aligns AND truncates less than the build it replaces.
   The three `grid-column: 1 / -1` declarations below are LOAD-BEARING, not
   tidying: a subgrid child must span the parent tracks it means to adopt, and
   without them each collapses into a single 32px first column. */
.vs-list-table {
  flex: 1;
  display: grid;
  grid-template-columns: var(--vs-list-cols);
  align-content: start;
  overflow-y: auto;
  min-height: 0;
}
/* The grid-template-columns is set per-surface by list-view.js as
   --vs-list-cols on the container. Default fallback covers the
   3-middle-column case when the variable is unset. */
.vs-list-view {
  --vs-list-cols: 32px minmax(160px, 1.6fr) auto auto auto auto 110px 60px;
}
.vs-list-header {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  height: 36px;
  padding: 0 16px;
  background: var(--surface-dim);
  border-bottom: 1px solid var(--border-default);
  position: sticky; top: 0;
  z-index: 5;
  flex-shrink: 0;
}
.vs-list-rows {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  /* §6.3's `content-visibility: auto` IS DELIBERATELY GONE, and it CANNOT
     COME BACK while these rows are a subgrid.
     `content-visibility: auto` applies SIZE containment, and a size-contained
     box cannot pass track sizing to a subgrid child - `subgrid` silently
     degrades to `none`. The chain then collapses: rows lose the parent
     tracks, every cell auto-places onto its own line, and a 32px row renders
     118px tall with all eight cells stacked at the same left edge.
     Shipped that way for one deploy on 2026-08-26 and it took a SCREENSHOT to
     see it - the track strings still compared equal, because every row
     reported the literal string `subgrid`. Measured after removing it: row
     cell left edges [288, 304, 464, 541, 722, 825, 1113, 1223] match the
     header's EXACTLY, and row height is back to 32px.
     Cost measured rather than assumed, on the largest live list (Value
     Library, 50 rows): median forced layout 6.3ms without containment vs
     7.4ms with it - no regression at this scale, because every row is
     on or near screen and containment only adds bookkeeping. If lists ever
     grow large enough to need this, the answer is row VIRTUALISATION, not
     containment, which is incompatible with the alignment by construction. */
}
.vs-list-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: subgrid;
  align-items: center;
  min-height: 32px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-base);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
  outline: none;
  contain-intrinsic-size: 32px;
}
.vs-list-row.vs-list-row-even { background: var(--surface-panel); }
.vs-list-row:hover { background: var(--surface-raised); }
.vs-list-row.vs-list-row-focused { box-shadow: inset 0 0 0 1px var(--border-strong); }
.vs-list-row.vs-list-row-selected {
  background: var(--brand-primary-fade);
  box-shadow: inset 2px 0 0 0 var(--brand-primary);
}
.vs-list-cell {
  display: flex; align-items: center;
  font: 400 13px/1.3 var(--font-sans);
  color: var(--text-primary);
  padding-right: 12px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vs-list-cell-numeric {
  justify-content: flex-end;
  font-variant-numeric: tabular-nums;
}
.vs-list-cell-select { padding-right: 8px; }
.vs-list-cell-prov { justify-content: flex-end; padding-right: 0; position: relative; }
.vs-list-name { font-weight: 500; }

/* G12 (2026-08-25) — truncated cell text must show an ELLIPSIS, not a hard cut.
   `.vs-list-cell` above already declares `text-overflow: ellipsis`, and it
   could never apply: the cell is `display: flex`, and text-overflow acts on a
   block's own inline content, never on its flex ITEMS. So every overflowing
   value was clipped mid-glyph with no "…". Measured on Outputs: three names at
   369/184, 534/160 and 635/160 — 50%, 70% and 75% hidden. That is also what
   produced the "Business case summageneric" reading in the walkthrough: a Type
   value hard-cut at its cell edge butts straight against the next column's
   text, so two values read as one word.
   The rule therefore has to live on the ITEM. Two shapes exist: an element
   child (`.vs-list-name`, which set only `font-weight` — it inherits
   `white-space: nowrap` from the cell but keeps the INITIAL `overflow:
   visible` / `text-overflow: clip`, so it overflows its cell and is cut by the
   cell's own `overflow: hidden` with no mark), and — for middle/date columns —
   a bare text node, which is an ANONYMOUS flex item and cannot be selected at
   all. ListView.tsx wraps those in `.vs-list-cell-text` so this rule reaches
   them; that wrapper is load-bearing, not decoration.
   ⚠️ `min-width: 0` is required: a flex item's default `min-width: auto`
   refuses to shrink below min-content, which is what lets it overflow in the
   first place. */
.vs-list-cell > .vs-list-name,
.vs-list-cell > .vs-list-cell-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.vs-list-checkbox {
  width: 16px; height: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  appearance: none; -webkit-appearance: none;
  cursor: pointer;
  background: var(--surface-base);
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
}
.vs-list-checkbox:checked {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
  background-position: center; background-repeat: no-repeat; background-size: 10px;
}

/* Header cells / sort */
.vs-list-header-cell {
  background: transparent; border: 0; padding: 0 12px 0 0;
  font: 500 12px/1 var(--font-sans);
  color: var(--text-tertiary);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
  height: 100%;
  /* Merge smoke 2026-10-21: the Deals list printed ")pportunity maps". `.vs-list-cell`'s
     `min-width: 0` let an `auto` track shrink below its header label, and a right-aligned
     (numeric) label then overflowed LEFT under `overflow: hidden`, cutting its first glyph.
     A header's minimum is now its longest word, and a long label wraps (two 12px lines fit
     the 36px header) instead of being cut. Body cells keep their ellipsis rules. */
  min-width: min-content;
  white-space: normal;
}
.vs-list-header-cell:hover { color: var(--text-primary); }
.vs-list-header-cell:disabled { cursor: default; }
.vs-list-header-cell-sorted { color: var(--text-primary); }
.vs-list-header-cell.vs-list-cell-numeric { justify-content: flex-end; text-align: right; }
.vs-list-sort-icon { display: inline-flex; }

/* Status pill (uses §10.7 pattern) */
.vs-list-status-pill {
  display: inline-flex; align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 10px;
  font: 500 11px/1 var(--font-sans);
  font-variant-numeric: tabular-nums;
  background: var(--surface-dim);
  color: var(--text-secondary);
}
.vs-list-status-pill[data-status="active"], .vs-list-status-pill[data-status="finalized"], .vs-list-status-pill[data-status="complete"] {
  background: var(--brand-primary-fade);
  color: var(--brand-primary);
}
.vs-list-status-pill[data-status="drafting"], .vs-list-status-pill[data-status="modeling"] {
  background: var(--surface-dim);
  color: var(--text-secondary);
}
.vs-list-status-pill[data-status="warning"], .vs-list-status-pill[data-status="under_review"], .vs-list-status-pill[data-status="stale"] {
  background: var(--warning-tint);
  color: var(--warning);
}
.vs-list-status-pill[data-status="archived"], .vs-list-status-pill[data-status="closed"] {
  background: var(--surface-dim);
  color: var(--text-tertiary);
}
.vs-list-status-pill[data-status="failed"], .vs-list-status-pill[data-status="errored"] {
  background: var(--negative-tint);
  color: var(--negative);
}

/* Tier dot per §10.9 */
.vs-list-tier-dot {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--tier-corpus);
  flex-shrink: 0;
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.vs-list-tier-dot[data-tier="validated"] { background: var(--tier-validated); }
.vs-list-tier-dot[data-tier="corpus"]    { background: var(--tier-corpus); }
.vs-list-tier-dot[data-tier="inferred"]  { background: var(--tier-inferred); }
.vs-list-tier-dot[data-tier="override"]  { background: transparent; border: 1px solid var(--tier-override); width: 6px; height: 6px; }
.vs-list-tier-label {
  margin-left: 6px;
  font: 400 12px/1 var(--font-sans);
  color: var(--text-secondary);
}

/* Tag pill in middle cells */
.vs-list-tag {
  display: inline-flex; align-items: center;
  height: 20px;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: var(--surface-dim);
  font: 500 11px/1 var(--font-sans);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

/* §3.6 Hover-revealed actions */
.vs-list-row-actions {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  gap: 4px;
  align-items: center;
  background: var(--surface-raised);
  padding-left: 8px;
}
.vs-list-row:hover .vs-list-row-actions { display: inline-flex; }
.vs-list-row:hover .vs-list-tier-dot { opacity: 0; }
.vs-list-row-action {
  width: 24px; height: 24px;
  background: transparent; border: 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.vs-list-row-action:hover { background: var(--surface-dim); color: var(--text-primary); }

/* §3.7 Empty state */
.vs-list-empty {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 64px 20px;
  text-align: center;
  gap: 12px;
}
.vs-list-empty-icon { color: var(--text-tertiary); margin-bottom: 12px; }
.vs-list-empty-headline {
  font: 500 19px/1.3 var(--font-sans);
  letter-spacing: -0.005em;
  color: var(--text-primary);
}
.vs-list-empty-body {
  font: 400 14px/1.55 var(--font-sans);
  color: var(--text-secondary);
  max-width: 420px;
}
.vs-list-empty-actions {
  display: flex; gap: 16px; margin-top: 20px;
}

/* §4.2 Bulk action bar (floating) */
.vs-list-bulk-bar {
  position: fixed;
  bottom: 80px; left: 50%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px;
  height: 48px;
  padding: 0 16px;
  background: var(--anchor);
  color: var(--text-on-anchor);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  z-index: 100;
  animation: vs-bulk-in 160ms var(--ease-out);
}
@keyframes vs-bulk-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
/* Batch 7 — foundational §9.4: panel slides become instant under reduced-motion. */
@media (prefers-reduced-motion: reduce) {
  .vs-list-bulk-bar { animation: none; }
}
.vs-list-bulk-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px;
  padding: 0 6px;
  height: 20px;
  background: var(--brand-primary-fade);
  color: var(--text-on-anchor);
  border-radius: 10px;
  font: 500 11px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.vs-list-bulk-count-label {
  font: 400 13px/1 var(--font-sans);
  color: rgba(255,255,255,0.7);
}
.vs-list-bulk-divider {
  width: 1px; height: 16px;
  background: rgba(255,255,255,0.10);
  display: inline-block;
}
.vs-list-bulk-action {
  background: transparent; border: 0; padding: 6px 10px;
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255,255,255,0.85);
  border-radius: var(--radius-sm);
  font: 500 13px/1 var(--font-sans);
  cursor: pointer;
}
.vs-list-bulk-action:hover { background: rgba(255,255,255,0.10); color: var(--text-on-anchor); }
.vs-list-bulk-action-destructive { color: rgba(255, 122, 138, 0.9); }
.vs-list-bulk-action-destructive:hover { background: rgba(184, 39, 59, 0.20); color: #fff; }

/* ── Filter popover (companion to list-view-filters.js) ───────── */
.vs-list-filter-popover {
  width: 320px;
  max-height: calc(100vh - 100px);
  display: flex; flex-direction: column;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  z-index: 1100;
  overflow: hidden;
}
.vs-list-filter-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 40px;
  padding: 0 12px 0 16px;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}
.vs-list-filter-title {
  font: 500 13px/1 var(--font-sans);
  color: var(--text-primary);
}
.vs-list-filter-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 16px;
}
.vs-list-filter-section {
  display: flex; flex-direction: column; gap: 6px;
}
.vs-list-filter-section-label {
  font: 500 12px/1 var(--font-sans);
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.vs-list-filter-checkbox {
  display: flex; align-items: center; gap: 8px;
  font: 400 13px/1 var(--font-sans);
  color: var(--text-primary);
  padding: 4px 0;
  cursor: pointer;
}
.vs-list-filter-seg {
  display: inline-flex; align-items: center;
  height: 24px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font: 500 11px/1 var(--font-sans);
  margin-right: 4px;
}
.vs-list-filter-seg.is-active {
  background: var(--brand-primary-fade);
  color: var(--brand-primary);
  border-color: rgba(45, 90, 76, 0.20);
}
.vs-list-filter-range {
  display: flex; align-items: center; gap: 8px;
}
.vs-list-filter-range .vs-input { flex: 1; }
.vs-list-filter-range-sep { color: var(--text-tertiary); font: 400 12px/1 var(--font-sans); }
.vs-list-filter-range-unit { font: 400 11px/1 var(--font-sans); color: var(--text-tertiary); }
.vs-list-filter-empty { font: 400 12px/1.4 var(--font-sans); color: var(--text-tertiary); padding: 4px 0; }
.vs-list-filter-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

/* ───────────────────────────────────────────────────────
 * HOME DASHBOARD (home-dashboard-spec.md)
 * ─────────────────────────────────────────────────────── */
.home-dashboard {
  display: flex; flex-direction: column;
  padding: 24px 24px 32px;
  gap: 24px;
  background: var(--surface-base);
}

/* Shared icon */
.home-dash-icon {
  width: 16px; height: 16px;
  color: var(--text-tertiary);
  display: inline-block; vertical-align: middle;
}
.home-dash-icon--tertiary { color: var(--text-tertiary); }
.home-dash-icon--warning  { color: var(--warning); }
.home-dash-icon--negative { color: var(--negative); }
.home-dash-icon--vega     { color: var(--brand-primary); }
.home-dash-icon--vega-mark { color: var(--brand-primary); }

/* Section heading shared across zones (§4.1, §5.1) */
.home-section-heading {
  font: 500 19px/1.3 var(--font-sans);
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 0 0 16px 0;
  padding: 0;
}

/* ─── Zone 1: Header band (§2) ─────────────────────────── */
.home-dash-header {
  font: 400 14px/1.4 var(--font-sans);
  color: var(--text-secondary);
  padding: 8px 0;
  min-height: 24px;
}

/* ─── Zone 2: KPI strip (§3) ──────────────────────────── */
.home-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.home-kpi-tile {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 96px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}
.home-kpi-tile[aria-disabled="true"] { cursor: default; }
.home-kpi-tile:hover { background: var(--surface-raised); }
.home-kpi-tile:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.home-kpi-icon {
  position: absolute;
  top: 12px; right: 12px;
  display: inline-flex;
}
.home-kpi-label {
  font: 500 12px/1.3 var(--font-sans);
  color: var(--text-tertiary);
  /* Room for .home-kpi-icon (16px at right: 12px): first-run walk 2026-11-28 saw the pencil over "draft". */
  padding-right: 28px;
  /* Sentence case enforced at the renderer; no text-transform here.
     Tighter weight + tertiary color reads as "tile-contained" rather than canvas body. */
}
.home-kpi-count-wrap {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: end;
}
.home-kpi-count {
  font: 500 24px/1 var(--font-mono);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums slashed-zero;
}
.home-kpi-count--zero { color: var(--text-tertiary); }
.home-kpi-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brand-primary);
  display: inline-block;
}
.home-kpi-dot--corpus { background: var(--tier-corpus); }

/* ─── Zone 3: Continue working (§4) ───────────────────── */
.home-continue-section { margin-top: 8px; }
.home-continue-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.home-continue-card {
  display: flex; flex-direction: column;
  gap: 6px;
  min-height: 96px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}
.home-continue-card:hover { background: var(--surface-raised); }
.home-continue-card:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.home-continue-type {
  display: inline-flex; align-items: center; gap: 8px;
}
.home-continue-type-label {
  font: 500 12px/1.3 var(--font-sans);
  color: var(--text-tertiary);
}
.home-continue-name {
  font: 500 19px/1.3 var(--font-sans);
  letter-spacing: -0.015em;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.home-continue-context {
  font: 400 13px/1.4 var(--font-sans);
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Empty state for Continue working (§4.4) */
.home-continue-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  min-height: 192px;
  padding: 24px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  gap: 8px;
}
.home-continue-empty-icon { width: 32px; height: 32px; }
.home-continue-empty-icon .home-dash-icon { width: 32px; height: 32px; }
.home-continue-empty-headline {
  font: 500 19px/1.3 var(--font-sans);
  color: var(--text-primary);
}
.home-continue-empty-body {
  font: 400 14px/1.55 var(--font-sans);
  color: var(--text-secondary);
  max-width: 360px;
}
.home-continue-empty-actions {
  display: flex; gap: 8px;
  margin-top: 8px;
}

/* ─── Zone 4: Two-column (§5) ─────────────────────────── */
.home-two-col {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: 32px;
  margin-top: 8px;
}
.home-col { min-width: 0; }

/* Activity feed (§5.2) */
/* Hairline above the row stack so the section heading is visually anchored
   as a column header (not floating body text). Same treatment on the empty
   state and on Vega's queue below. */
.home-activity-rows { display: flex; flex-direction: column; border-top: 1px solid var(--border-subtle); padding-top: 4px; }
.home-activity-row {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  background: transparent;
}
.home-activity-row:hover .home-activity-text { color: var(--text-primary); }
.home-activity-row:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.home-activity-icon { display: inline-flex; }
.home-activity-text {
  font: 400 13px/1.4 var(--font-sans);
  color: var(--text-primary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
/* The text cell is a column so a second, quieter line can sit under the description
   (which case of a deal a business-case row is about). min-width 0 lets the ellipsis work. */
.home-activity-main { display: flex; flex-direction: column; min-width: 0; }
.home-activity-detail {
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-secondary);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.home-activity-ts {
  font: 400 13px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
  white-space: nowrap;
}
.home-activity-empty {
  font: 400 13px/1.4 var(--font-sans);
  color: var(--text-tertiary);
  padding: 16px 0;
  border-top: 1px solid var(--border-subtle);
}
.home-activity-viewall {
  display: inline-flex; align-items: center;
  margin-top: 12px;
  padding: 0;
  background: transparent;
  border: none;
  font: 400 13px/1 var(--font-sans);
  color: var(--text-secondary);
  cursor: pointer;
}
.home-activity-viewall:hover:not([aria-disabled="true"]) { color: var(--text-primary); }
.home-activity-viewall[aria-disabled="true"] { cursor: default; opacity: 0.6; }

/* Vega's queue (§5.3) */
.home-vega-cards { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--border-subtle); padding-top: 12px; }
.home-vega-card {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--brand-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 16px;
}
.home-vega-card-title {
  font: 500 14px/1.3 var(--font-sans);
  color: var(--text-primary);
  margin-bottom: 6px;
}
.home-vega-card-body {
  font: 400 13px/1.5 var(--font-sans);
  color: var(--text-secondary);
}
.home-vega-empty {
  display: flex; align-items: center; justify-content: center;
  height: 64px;
  gap: 8px;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-subtle);
}
.home-vega-empty-text {
  font: 400 13px/1 var(--font-sans);
  color: var(--text-tertiary);
}
.home-vega-empty-mark .home-dash-icon { width: 18px; height: 18px; }

/* ─── Zone 5: Footer nudge (§6) ───────────────────────── */
.home-footer-nudge {
  display: inline-flex; align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 32px;
  padding: 16px 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--border-subtle);
  text-align: left;
  cursor: pointer;
}
.home-footer-nudge-text {
  font: italic 400 14px/1.55 var(--font-sans);
  color: var(--text-secondary);
}
.home-footer-nudge:hover .home-footer-nudge-text { color: var(--text-primary); }
.home-footer-nudge:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Responsive: collapse the two-column zone on narrow viewports */
@media (max-width: 960px) {
  .home-two-col { grid-template-columns: 1fr; gap: 24px; }
  .home-kpi-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-continue-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .home-kpi-strip { grid-template-columns: 1fr; }
  .home-continue-row { grid-template-columns: 1fr; }
}

/* ───────────────────────────────────────────────────────
 * VEGA WORKFLOW (vega-workflow-spec.md)
 * Batch 6A — Generate affordance, document surface, rail
 * states B/C/D, refinement popover.
 * ─────────────────────────────────────────────────────── */

/* §2 Generate button on canvas top-right ────────────────── */
.bcv2-canvas-top-right {
  display: flex; justify-content: flex-end; align-items: center;
  gap: 8px;
  padding: 0 0 12px 0;
}
/* Session 11 — value narrative button sits alongside Vega Generate */
.bcv2-narrative-btn {
  height: 32px;
  padding: 0 12px;
  font: 500 13px/1 var(--font-sans);
}
.vega-generate-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: var(--brand-primary);
  color: var(--text-on-brand);
  border: 0;
  border-radius: var(--radius-sm);
  font: 500 13px/1 var(--font-sans);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}
.vega-generate-btn:hover { background: var(--brand-primary-hover, #244a40); }
.vega-generate-btn:disabled { opacity: 0.4; cursor: default; }
.vega-generate-label { letter-spacing: -0.005em; }
.vega-generate-chev { display: inline-flex; align-items: center; }

/* §2.3 Generate menu ────────────────────────────────────── */
.vega-generate-menu {
  z-index: 1100;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  padding: 4px 0;
  display: flex; flex-direction: column;
}
.vega-generate-menu-item {
  display: flex; align-items: center; gap: 10px;
  height: 32px;
  padding: 0 12px;
  background: transparent; border: 0;
  font: 400 13px/1 var(--font-sans);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}
.vega-generate-menu-item:hover { background: var(--surface-raised); }
.vega-generate-menu-icon { display: inline-flex; color: var(--text-tertiary); }
.vega-generate-menu-label { flex: 1; }

/* §5.1 Source-receding fade during invocation ───────────── */
.vega-source-receding { opacity: 0.4; transition: opacity 80ms var(--ease-out); }
@media (prefers-reduced-motion: reduce) {
  .vega-source-receding { opacity: 1; transition: none; }
}

/* §4 Document surface ───────────────────────────────────── */
#view-vega-document.active { display: block; }
.document-surface {
  max-width: 880px;
  margin: 0 auto;
  padding: 16px 16px 64px;
  position: relative;
}
.document-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
  padding: 8px 0;
}
.document-toolbar-back {
  background: transparent; border: 0;
  font: 400 13px/1 var(--font-sans);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
}
.document-toolbar-back:hover { color: var(--text-primary); background: var(--surface-raised); }
.document-toolbar-actions { display: inline-flex; gap: 8px; }
.document-toolbar-action {
  background: transparent; border: 0;
  font: 400 13px/1 var(--font-sans);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.document-toolbar-action:hover:not(:disabled) { color: var(--text-primary); background: var(--surface-raised); }
.document-toolbar-action:disabled { opacity: 0.4; cursor: default; }

.document-frame {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--surface-panel);
  padding: 48px 40px;
}
.document-eyebrow {
  font: 500 12px/1 var(--font-sans);
  color: var(--text-tertiary);
  margin-bottom: 16px;
}
.document-headline {
  font: 500 32px/1.15 var(--font-sans);
  letter-spacing: -0.022em;
  color: var(--text-primary);
  margin: 0 0 12px 0;
}
.document-prose {
  font: 400 15px/1.55 var(--font-sans);
  color: var(--text-primary);
  margin: 0 0 16px 0;
  max-width: 70ch;
}
.document-section-heading {
  font: 500 19px/1.3 var(--font-sans);
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin: 32px 0 12px 0;
}
.document-list {
  margin: 0 0 16px 24px;
  padding: 0;
  font: 400 15px/1.55 var(--font-sans);
  color: var(--text-primary);
}
.document-list li { margin-bottom: 6px; }
/* Narrative tables (2026-10-11) — the wrap scrolls sideways on a narrow
   screen so a wide table never pushes the page into horizontal scroll. */
.document-table-wrap { overflow-x: auto; margin: 0 0 16px 0; }
.document-table {
  border-collapse: collapse;
  font: 400 14px/1.45 var(--font-sans);
  color: var(--text-primary);
  min-width: 60%;
}
.document-table th,
.document-table td {
  text-align: left;
  vertical-align: top;
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid var(--border-default);
}
.document-table th { font-weight: 600; border-bottom-color: var(--text-secondary); }
.document-rule { border: 0; border-top: 1px solid var(--border-default); margin: 24px 0; }
.document-cite {
  color: var(--brand-primary);
  font-size: 0.85em;
  margin-left: 1px;
}

/* Streaming reveal — fade-in per §4.2 */
.document-block-streaming { opacity: 0; transform: translateY(4px); }
.document-block-revealed {
  opacity: 1; transform: translateY(0);
  transition: opacity 160ms var(--ease-out), transform 160ms var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  .document-block-streaming, .document-block-revealed { opacity: 1; transform: none; transition: none; }
}

/* §4.9 Vega-edited inline marker */
.document-surface .vega-edited {
  border-left: 2px solid var(--brand-primary);
  padding-left: 16px;
  margin-left: -18px;
}

/* §4.11 Skeleton */
.document-skeleton { padding: 0; }
.document-skel {
  background: linear-gradient(90deg, var(--surface-dim), var(--surface-raised), var(--surface-dim));
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: documentSkel 2s linear infinite;
  margin-bottom: 16px;
}
@keyframes documentSkel { 0% { background-position: 0% 0; } 100% { background-position: -200% 0; } }
.document-skel-headline { height: 36px; width: 70%; }
.document-skel-summary  { height: 18px; width: 90%; margin-bottom: 32px; }
.document-skel-divider  { height: 1px; background: var(--border-subtle); margin: 24px 0; }
.document-skel-section-h{ height: 22px; width: 40%; margin-top: 32px; }
.document-skel-para     { height: 14px; width: 100%; }
.document-skel-para-95  { width: 95%; }
.document-skel-para-90  { width: 90%; }
.document-skel-para-87  { width: 87%; }
.document-skel-spacer   { height: 16px; }
@media (prefers-reduced-motion: reduce) {
  .document-skel { animation: none; background: var(--surface-dim); }
}

/* Known Issue #7 fix (2026-05-16) — BC seeding pop-to-workspace insights
   loading affordance. Painted on the Vega rail card with id
   "bcv2-insights-loading" while bcv2.workspaceInsightsLoading is true.
   Reuses the documentSkel keyframe for visual consistency with the
   existing document-surface skeleton (no new animation introduced). */
.vega-card[data-vega-id="bcv2-insights-loading"] .vega-card-body {
  position: relative;
  color: var(--text-tertiary);
}
.vega-card[data-vega-id="bcv2-insights-loading"] .vega-card-body::after {
  content: '';
  display: block;
  height: 8px;
  margin-top: 10px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface-dim), var(--surface-raised), var(--surface-dim));
  background-size: 200% 100%;
  animation: documentSkel 2s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .vega-card[data-vega-id="bcv2-insights-loading"] .vega-card-body::after {
    animation: none;
    background: var(--surface-dim);
  }
}

/* §4.12 Halted banner */
.document-halted-banner {
  background: var(--warning-tint);
  border: 1px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: -16px 0 24px 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.document-halted-text { font: 400 13px/1.4 var(--font-sans); color: var(--text-primary); }
.document-halted-actions { display: inline-flex; gap: 8px; }

/* Error state */
.document-error {
  padding: 24px;
  background: var(--negative-tint);
  border: 1px solid var(--negative);
  border-radius: var(--radius-sm);
  color: var(--negative);
}
.document-error-title { font: 500 14px/1 var(--font-sans); margin-bottom: 6px; }

/* Sources block */
.document-sources { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.document-sources-heading {
  font: 500 12px/1 var(--font-sans);
  color: var(--text-tertiary);
  margin: 0 0 8px 0;
}
.document-sources-list { margin: 0; padding-left: 20px; font: 400 12px/1.55 var(--font-mono); }
.document-sources-list a { color: var(--text-secondary); word-break: break-all; }
.document-sources-list a:hover { color: var(--brand-primary); }
/* KI #48 — footnote markers and the Assumptions & Sources appendix they link to (lib/provenanceFootnotes.ts) */
.provenance-cite a { color: inherit; text-decoration: none; }
.provenance-cite a:hover { text-decoration: underline; }
.document-sources-list.provenance-appendix { list-style: none; padding-left: 0; font: 400 13px/1.55 var(--font-sans); color: var(--text-primary); }
.provenance-appendix li { margin: 0 0 10px; scroll-margin-top: 16px; }
.provenance-appendix-id { font: 500 12px/1 var(--font-mono); color: var(--brand-primary); margin-right: 6px; }
.provenance-appendix-why { color: var(--text-secondary); margin-top: 2px; }

/* §3 Rail States B/C/D ─────────────────────────────────── */
.vega-rail-footer {
  flex-shrink: 0;
  padding: 8px 12px;
  border-top: 1px solid var(--border-subtle);
}
.vega-rail-halt {
  width: 100%;
  height: 32px;
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font: 500 12px/1 var(--font-sans);
  cursor: pointer;
}
.vega-rail-halt:hover { background: var(--surface-raised); }

.vega-active-op-card {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin: 8px 8px 12px;
}
.vega-active-op-name {
  font: 500 13px/1.2 var(--font-sans);
  color: var(--text-primary);
  margin-bottom: 4px;
}
.vega-active-op-desc {
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-tertiary);
  margin-bottom: 10px;
}
.vega-progress-track {
  height: 4px;
  background: var(--surface-dim);
  border-radius: 2px;
  overflow: hidden;
}
.vega-progress-fill {
  height: 100%;
  background: var(--brand-primary);
  transition: width 240ms var(--ease-standard);
}

.vega-step-list { padding: 0 8px 8px; display: flex; flex-direction: column; gap: 6px; }
.vega-step-row { display: flex; align-items: center; gap: 8px; padding: 4px 8px; }
.vega-step-name { flex: 1; font: 400 12px/1.4 var(--font-sans); color: var(--text-primary); }
.vega-step-time { font: 400 11px/1 var(--font-mono); color: var(--text-tertiary); }
.vega-step-pending .vega-step-name { color: var(--text-tertiary); }
.vega-step-icon { color: var(--brand-primary); display: inline-flex; }
.vega-step-icon-complete { color: var(--brand-primary); }
.vega-step-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.vega-step-dot-active { background: var(--brand-primary); animation: vegaPulse 2s ease-in-out infinite; }
.vega-step-dot-pending { border: 1px solid var(--border-default); }
@keyframes vegaPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .vega-step-dot-active { animation: none; } }

/* State C — reasoning trace + sources + history */
.vega-section-label {
  font: 500 11px/1 var(--font-sans);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  padding: 12px 12px 6px;
}
.vega-trace-stack { display: flex; flex-direction: column; gap: 6px; padding: 0 8px; }
.vega-trace-card {
  display: flex;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.vega-trace-card-stripe { width: 2px; background: var(--brand-primary); flex-shrink: 0; }
.vega-trace-card-body { padding: 8px 10px; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vega-trace-card-name { font: 400 12px/1.3 var(--font-sans); color: var(--text-primary); }
.vega-trace-card-time { font: 400 11px/1 var(--font-mono); color: var(--text-tertiary); }

.vega-active-sources { padding: 0 12px; display: flex; flex-direction: column; gap: 4px; }
.vega-active-source {
  font: 400 11px/1.4 var(--font-mono);
  color: var(--text-secondary);
  word-break: break-all;
}
.vega-active-source-num { color: var(--text-tertiary); margin-right: 4px; }
.vega-active-source a { color: var(--text-secondary); }
.vega-active-source a:hover { color: var(--brand-primary); }

.vega-history-list { padding: 0 8px 8px; display: flex; flex-direction: column; gap: 2px; }
.vega-history-row {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}
.vega-history-row:hover { background: var(--surface-raised); }
.vega-history-row.is-active {
  background: var(--brand-primary-fade);
  box-shadow: inset 2px 0 0 0 var(--brand-primary);
}
.vega-history-name { font: 500 12px/1.3 var(--font-sans); color: var(--text-primary); }
.vega-history-meta { font: 400 11px/1 var(--font-sans); color: var(--text-tertiary); margin-top: 2px; }

/* State D quote card */
.vega-state-d { padding: 8px; }
.vega-refinement-quote {
  background: var(--surface-dim);
  border-left: 2px solid var(--brand-primary);
  padding: 8px 10px;
  margin-bottom: 10px;
  font: italic 400 12px/1.4 var(--font-sans);
  color: var(--text-secondary);
  max-height: 4.5em;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* §7 Refinement popover (Batch 10 — width narrowed to 240px per §7.2 after
   removing the §7.4-violating free-form input; hairline divider added before
   "Edit manually" per §7.2 and §7.3). */
.vega-refinement-popover {
  z-index: 1200;
  width: 240px;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  padding: 4px;
  display: flex; flex-direction: column; gap: 0;
  animation: vegaPopoverIn 120ms var(--ease-out);
}
@keyframes vegaPopoverIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.vega-refinement-popover-actions { display: flex; flex-direction: column; }
.vega-refinement-action {
  display: flex; align-items: center; gap: 8px;
  height: 32px;
  padding: 0 12px;
  background: transparent; border: 0;
  font: 400 13px/1 var(--font-sans);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.vega-refinement-action:hover { background: var(--surface-raised); }
.vega-refinement-divider {
  height: 1px;
  margin: 4px 8px;
  background: var(--border-subtle);
}
@media (prefers-reduced-motion: reduce) {
  .vega-refinement-popover { animation: none; }
}

/* 6C — Legacy session banner (§6.5.4) ──────────────────── */
.document-legacy-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  background: var(--surface-dim);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font: 400 13px/1.4 var(--font-sans);
  color: var(--text-secondary);
}
.document-legacy-icon { color: var(--text-tertiary); flex-shrink: 0; }
.document-legacy-text { flex: 1; }

/* 6C — Reasoning trace card expand/collapse ─────────────── */
.vega-trace-card { cursor: pointer; transition: background var(--duration-fast) var(--ease-standard); }
.vega-trace-card:hover { background: var(--surface-raised); }
.vega-trace-card-static { cursor: default; }
.vega-trace-card-static:hover { background: var(--surface-panel); }
.vega-trace-card-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%;
}
.vega-trace-card-chev {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-left: 4px;
  transition: transform var(--duration-fast) var(--ease-standard);
}
.vega-trace-card.is-expanded .vega-trace-card-chev { transform: rotate(180deg); }
.vega-trace-card-detail {
  display: none;
  font: 400 12px/1.45 var(--font-sans);
  color: var(--text-secondary);
  padding-top: 6px;
  margin-top: 6px;
  border-top: 1px solid var(--border-subtle);
}
.vega-trace-card.is-expanded .vega-trace-card-detail { display: block; }
@media (prefers-reduced-motion: reduce) {
  .vega-trace-card-chev { transition: none; }
}

/* 6C — vega-edited hover indicator (§4.9) ───────────────── */
.document-surface .vega-edited {
  position: relative;
  cursor: help;
}
.document-surface .vega-edited::after {
  content: 'Edited by Vega';
  position: absolute;
  top: -1.6em;
  right: 0;
  font: 400 10px/1 var(--font-mono);
  color: var(--text-tertiary);
  background: var(--surface-panel);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.document-surface .vega-edited:hover::after { opacity: 1; }

/* Batch 10 — manual edit provenance (§7.5) ────────────────
   Dotted left border at 1px in --text-tertiary distinguishes manual edits
   from the solid 2px --brand-primary Vega-edited marker. The "last touched"
   rule (Q2) — if a block previously carried .vega-edited, refinement-popover
   strips that class before applying .vega-manual-edited, so a block can never
   carry both markers simultaneously. */
.document-surface .vega-manual-edited {
  border-left: 1px dotted var(--text-tertiary);
  padding-left: 17px;
  margin-left: -18px;
  position: relative;
  cursor: help;
}
.document-surface .vega-manual-edited::after {
  content: 'Manually edited';
  position: absolute;
  top: -1.6em;
  right: 0;
  font: 400 10px/1 var(--font-mono);
  color: var(--text-tertiary);
  background: var(--surface-panel);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.document-surface .vega-manual-edited:hover::after { opacity: 1; }
/* Active editing state — solid border in brand-primary so the user sees
   exactly which block accepts keystrokes. Reverts to dotted on blur. */
.document-surface .vega-manual-editing {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
  background: var(--surface-base);
  cursor: text;
}
.document-surface .vega-manual-editing:focus { outline-color: var(--brand-primary); }
@media (prefers-reduced-motion: reduce) {
  .document-surface .vega-manual-edited::after { transition: none; }
}

/* ═══════════════════════════════════════════════════════
   Batch 11 — ⌘K command palette (§10.14)
   Navy surface (one of four allowed locations per §3.1 / foundational
   updates §2). White-on-navy text via inverse alpha (92/60/50%).
   ═══════════════════════════════════════════════════════ */

/* §11.1 topbar trigger */
.vs-cmdk-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  margin-right: 12px;
  padding: 0 10px;
  background: var(--anchor-raised);
  color: rgba(255,255,255,0.78);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-sm);
  font: 400 12px/1 var(--font-sans);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.vs-cmdk-trigger:hover { background: rgba(255,255,255,0.06); color: #fff; }
.vs-cmdk-trigger:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
.vs-cmdk-trigger-icon { color: rgba(255,255,255,0.6); }
.vs-cmdk-trigger-label { color: inherit; }
.vs-cmdk-trigger-kbd kbd {
  font: 500 10px/1 var(--font-mono);
  color: rgba(255,255,255,0.6);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
  padding: 2px 5px;
}

/* §10.14.1 overlay */
.vs-cmdk-wrap {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 18vh;
}
.vs-cmdk-scrim {
  position: absolute;
  inset: 0;
  background: var(--surface-overlay);
}
.vs-cmdk-panel {
  position: relative;
  width: 640px;
  max-width: calc(100vw - 32px);
  min-width: 480px;
  background: var(--anchor);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-popover);
  overflow: hidden;
  animation: vsCmdkIn 120ms var(--ease-out);
}
@keyframes vsCmdkIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Input row (52px) */
.vs-cmdk-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.vs-cmdk-input-icon { color: rgba(255,255,255,0.5); flex: 0 0 auto; }
.vs-cmdk-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: none;
  color: rgba(255,255,255,0.92);
  font: 400 15px/1 var(--font-sans);
}
.vs-cmdk-input::placeholder { color: rgba(255,255,255,0.4); }

/* Results region */
.vs-cmdk-list {
  max-height: 60vh;
  overflow-y: auto;
  padding: 4px 0;
}
.vs-cmdk-section-label {
  padding: 10px 16px 6px;
  font: 500 10px/1 var(--font-mono);
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
}
.vs-cmdk-row {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  padding: 0 16px;
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: background var(--duration-fast) var(--ease-standard);
}
.vs-cmdk-row:hover { background: rgba(255,255,255,0.04); }
.vs-cmdk-row-selected {
  background: rgba(255,255,255,0.06);
  border-left-color: var(--brand-primary);
}
.vs-cmdk-row-icon {
  color: rgba(255,255,255,0.7);
  flex: 0 0 16px;
}
.vs-cmdk-row-icon-blank { display: inline-block; width: 16px; height: 16px; }
.vs-cmdk-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.vs-cmdk-row-title {
  font: 500 13px/1.2 var(--font-sans);
  color: rgba(255,255,255,0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vs-cmdk-row-sub {
  font: 400 11px/1.2 var(--font-sans);
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vs-cmdk-row-kind {
  font: 500 10px/1 var(--font-mono);
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
  flex: 0 0 auto;
}
/* Subtitle present → 56px row per spec §10.14.4 */
.vs-cmdk-row:has(.vs-cmdk-row-sub) { height: 56px; }

/* Empty states (§10.14.6) */
.vs-cmdk-empty {
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}
.vs-cmdk-empty-msg {
  font: 400 13px/1.4 var(--font-sans);
  color: rgba(255,255,255,0.7);
  max-width: 360px;
}
.vs-cmdk-empty-btn {
  height: 32px;
  padding: 0 14px;
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius-sm);
  font: 500 12px/1 var(--font-sans);
  cursor: pointer;
}
.vs-cmdk-empty-btn:hover { background: rgba(255,255,255,0.12); }

/* Footer hint (28px) */
.vs-cmdk-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
  padding: 0 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  font: 400 11px/1 var(--font-sans);
  color: rgba(255,255,255,0.5);
}
.vs-cmdk-footer-overflow { color: rgba(255,255,255,0.6); }
.vs-cmdk-footer-hints { display: inline-flex; align-items: center; gap: 4px; }
.vs-cmdk-kbd {
  display: inline-block;
  padding: 1px 5px;
  font: 500 10px/1 var(--font-mono);
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .vs-cmdk-panel { animation: none; }
  .vs-cmdk-trigger,
  .vs-cmdk-row { transition: none; }
}

/* ═══════════════════════════════════════════════════════
   Batch 12a — Model editor spreadsheet grid (§13.3)
   Replaces the legacy .bcv2-lever-table layout with a frozen
   header / first-column grid + canvas-top formula bar.
   Editing path still routes through the legacy popover/drawer
   in 12a (Vega rail state E ships in 12b).
   ═══════════════════════════════════════════════════════ */

/* Outer model editor wrap — same outer mount points as the legacy
   workspace (deal header, fin bar, viz panel, footer) so sibling
   modules continue to work. */
.bcv2-model-editor-v1 {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  min-height: 100%;
}

/* §13.3.3 formula bar at canvas top */
.bcv2-formula-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 36px;
  padding: 0 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font: 400 12px/1 var(--font-sans);
  color: var(--text-primary);
}
.bcv2-fb-fx { color: var(--text-tertiary); flex: 0 0 auto; }
.bcv2-fb-eyebrow {
  font: 400 11px/1 var(--font-sans);
  color: var(--text-tertiary);
  flex: 0 0 auto;
  white-space: nowrap;
}
.bcv2-fb-expr {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}
.bcv2-fb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 8px;
  background: var(--brand-primary-fade);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  font: 500 11px/1 var(--font-sans);
}
.bcv2-fb-chip-key { color: var(--text-primary); }
.bcv2-fb-chip-val { color: var(--text-tertiary); font-weight: 400; }
.bcv2-fb-op { color: var(--text-tertiary); font: 400 13px/1 var(--font-mono); padding: 0 2px; }
.bcv2-fb-lit { color: var(--text-secondary); font: 400 12px/1 var(--font-mono); }
.bcv2-fb-raw { color: var(--text-tertiary); font: 400 12px/1 var(--font-mono); }
.bcv2-fb-eq { color: var(--text-tertiary); font: 500 12px/1 var(--font-mono); flex: 0 0 auto; }
.bcv2-fb-result { color: var(--text-primary); font: 500 13px/1 var(--font-mono); flex: 0 0 auto; }
.bcv2-fb-todo {
  font: 500 10px/1 var(--font-mono);
  color: var(--text-tertiary);
  background: var(--surface-base);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 2px 6px;
  flex: 0 0 auto;
  letter-spacing: 0.04em;
}

/* Grid container */
/* 🔴 MEASURED ON PRODUCTION 2026-08-24: `overflow: hidden` here — the AREA, not
   the grid — is what made the clip silent. The grid declared 796px of columns
   into this 697px container with the Vega rail open, so Annual rendered 54 of
   96px with its header cut mid-word and ROI rendered 0 of 56px: absent from the
   screen, with no scrollbar and no affordance of any kind. A user could not know
   the column existed. ⛔ The reachable overflow is the LOAD-BEARING half of the
   fix — the narrower floors below make the common case fit, but a narrower
   window must degrade to a SCROLLBAR rather than to silence.
   ⚠️ overflow-y stays hidden so the border-radius still clips the corners. */
.bcv2-model-grid-area {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-base);
  overflow-x: auto;
  overflow-y: hidden;
}
.bcv2-model-grid-empty {
  padding: 32px 24px;
  text-align: center;
  color: var(--text-tertiary);
  font: 400 13px/1.5 var(--font-sans);
}

/* §13.3.1 grid layout — CSS grid with 8 columns.
   The two 76px tracks are Starts (the go-live month) and Ends (the month the
   lever stops delivering), both added 2026-08-24 between the timing block and Y1.
   ⭐ THE 56px ROI TRACK SITS SECOND ON PURPOSE (owner call, 2026-08-24). The
   declared floors exceed the rail-open container, so SOMETHING falls off the
   right edge; the only question is what. It used to be ROI — a CONTROL the
   practitioner clicks, rendered 0 of 56px and unreachable without knowing it
   was there. With ROI beside the lever name the column that falls off is
   ANNUAL, which is Y1+Y2+Y3 added up and already printed in the header KPIs.
   ⛔ The narrow-the-columns alternative was considered and REJECTED: the lever
   names are already clipping, and squeezing makes that worse.
   ⛔ NOTHING ELSE MAY HARDCODE THIS COLUMN COUNT. `.bcv2-mg-row` is
   `display: contents`, so the full-width sub-rows below (.bcv2-mg-missing,
   .bcv2-mg-expanded) are DIRECT children of this grid and span with
   `grid-column: 1 / -1`, which follows the track list on its own. A pixel
   width written anywhere else is how a label ends up eleven pixels outside
   its own cell. */
/* ⚠️ FLOORS WERE NARROWED 2026-08-24 (280→220 on the name, 96→84 on the four
   number columns) and ⛔ MUST NOT BE NARROWED FURTHER to make the 8th track
   fit. With Ends the declared floors exceed the measured 697px rail-open
   container ON PURPOSE — `.bcv2-model-grid-area` is `overflow-x: auto` and the
   scrollbar carries it. Silently clipped is the one state that is not allowed
   (that was the defect: Annual rendered 54 of 96px and ROI rendered 0 of 56).
   ⛔ AND THE TRACK MUST NEVER LAND WITHOUT ITS MARKUP. `.bcv2-mg-row` is
   `display: contents`, so a track with no matching cell is not an empty column
   — auto-placement shifts every following cell by one and the whole grid
   shreds (verified in a real browser, not inferred). The track, the header cell
   and every row variant's cell are ONE change. */
.bcv2-model-grid {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 56px 76px 76px repeat(4, minmax(84px, 1fr));
  background: var(--surface-base);
}
.bcv2-model-grid-body { display: contents; }

/* ─── Value timeline (step 2) ──────────────────────────────────────
   Bar LENGTH is time, never money — value-height was considered in the
   design walk and rejected, because a short bar must not be able to
   squeeze out a large figure. The two total columns carry the money. */
.bcv2-tl-toggle {
  display: flex;
  gap: 2px;
  padding: 8px 12px 0;
  background: var(--surface-base);
}
.bcv2-tl-toggle-btn {
  padding: 4px 14px;
  font-size: 12px;
  border: 1px solid var(--border-subtle);
  background: var(--surface-base);
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 4px;
}
.bcv2-tl-toggle-btn.is-active {
  background: var(--surface-raised);
  color: var(--text-primary);
  border-color: var(--border-strong);
  font-weight: 600;
}
.bcv2-tl {
  display: grid;
  /* Use case · track · gross total · risk-adj. The two number columns are
     112px, not the grid's 96px — "Needs input" measures ~92px and KI #31
     shipped an 11px LEFT spill inside a 96px cell that no overflow check
     could see, because a left spill leaves scrollWidth === clientWidth. */
  grid-template-columns: minmax(120px, 1.6fr) minmax(140px, 2.5fr) 120px 120px;
  background: var(--surface-base);
}
.bcv2-tl-header, .bcv2-tl-body, .bcv2-tl-row, .bcv2-tl-footer { display: contents; }
.bcv2-tl-cell {
  display: flex;
  align-items: center;
  height: 34px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-base);
  font-size: 12px;
  color: var(--text-primary);
}
.bcv2-tl-head {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
/* ⛔ THE TRUNCATION LIVES ON THE CHILD, NOT ON THIS CELL, AND THAT IS THE
   WHOLE FIX. `.bcv2-tl-cell` is `display: flex`, so bare text inside it becomes
   an ANONYMOUS flex item — a box no selector can reach — and `text-overflow` on
   a flex CONTAINER never paints. This rule declared the ellipsis for months and
   production still cut names mid-glyph ("Knowledge Worker Time Re"), while
   `getComputedStyle(cell).textOverflow` read "ellipsis" the entire time.
   ⭐ The working control was ten lines away in this same file: the Grid's name
   cell truncates because its text sits in `.bcv2-mg-name-text`. This is that
   pattern, not a new one. `min-width: 0` on BOTH boxes is load-bearing — a flex
   item's automatic minimum is its CONTENT, so without it neither can shrink far
   enough for an ellipsis to be reached. */
.bcv2-tl-name { gap: 8px; overflow: hidden; min-width: 0; }
.bcv2-tl-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bcv2-tl-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.bcv2-tl-num { justify-content: flex-end; font-variant-numeric: tabular-nums; }
.bcv2-tl-num-risk { color: var(--text-secondary); }
.bcv2-tl-absent { color: var(--text-tertiary); font-style: italic; }
/* ⛔ LOAD-BEARING, NOT DECORATIVE: every segment is absolutely placed against
   this box. Without it they position against the nearest positioned ancestor
   and escape the row entirely — the same class of failure as KI #29's
   grid-column: 1 / -1, a layout property that looks like styling. */
.bcv2-tl-track { position: relative; padding: 0 12px; cursor: pointer; }
.bcv2-tl-track:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -2px; }
.bcv2-tl-seg {
  position: absolute;
  top: 9px;
  height: 16px;
  border-radius: 2px;
  border: 1px solid transparent;
  /* ⛔ `touch-action: none` IS LOAD-BEARING, NOT POLISH. Without it a touch
     or trackpad drag PANS THE PAGE instead of moving the bar, and the feature
     is unusable on exactly the devices that find the Grid's number box
     hardest to use. Same for .bcv2-tl-grip below. */
  touch-action: none;
  cursor: grab;
}
.bcv2-tl-seg:active { cursor: grabbing; }
/* Past the contract end: visible so the practitioner knows it exists, and
   unmistakably not counted (spec §1(b), owner: "A is all that is important
   for the business case"). */
.bcv2-tl-seg-past {
  border-style: dashed;
  background: transparent !important;
  opacity: 0.55 !important;
}
.bcv2-tl-termline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--border-strong);
  opacity: 0.6;
}
.bcv2-tl-tick {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  color: var(--text-tertiary);
}
/* The end-month handle. Transparent, and exactly the RESIZE_ZONE_PX the pointer
   handler tests against, so the cursor tells the truth about where the resize
   gesture lives — an 8px zone nothing marks is an 8px zone nobody finds. It is a
   HIT TARGET, not a decoration: never give it pointer-events: none. */
.bcv2-tl-grip {
  position: absolute;
  top: 9px;
  height: 16px;
  width: 8px;
  margin-left: -8px;
  background: transparent;
  cursor: ew-resize;
  touch-action: none;
}
/* Where the bar will land. The real bar stays put and dims, so one gesture shows
   both where the use case is today and where it is being moved to. */
.bcv2-tl-ghost {
  position: absolute;
  top: 9px;
  height: 16px;
  border-radius: 2px;
  border: 1px dashed var(--brand-primary);
  background: var(--brand-primary);
  opacity: 0.3;
  /* ⛔ The ghost must never eat a pointermove — it sits UNDER the cursor for
     the whole gesture, and swallowing the move would freeze the drag. */
  pointer-events: none;
}
/* !important because each segment carries its ramp opacity INLINE, and inline
   wins over a class rule without it. The same reason .bcv2-tl-seg-past uses it. */
.bcv2-tl-track-dragging .bcv2-tl-seg { opacity: 0.25 !important; }
.bcv2-tl-footer .bcv2-tl-cell {
  font-weight: 600;
  border-top: 1px solid var(--border-strong);
  border-bottom: none;
}

/* ── The cost band (value timeline step 4) ──────────────
   Spec: docs/specs/2026-08-24-bc-timeline-cost-band.md §4 */
.bcv2-tl-cost-row { display: contents; }
/* ⛔ position: relative is LOAD-BEARING, exactly as on .bcv2-tl-track: every
   block is absolutely placed against this box, and without it they position
   against the nearest positioned ancestor and escape the row entirely. */
.bcv2-tl-costtrack { position: relative; padding: 0 12px; }
.bcv2-tl-costblock {
  position: absolute;
  top: 8px;
  height: 18px;
  border-radius: 3px;
  background: var(--surface-dim);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  overflow: hidden;
  white-space: nowrap;
}
.bcv2-tl-costmarker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--brand-primary);
}
.bcv2-tl-costlink {
  font-size: 11px;
  color: var(--brand-primary);
  cursor: pointer;
  flex: 0 0 auto;
}
/* ⛔ THE AUTO MARGIN IS SCOPED TO THE NAME CELL ON PURPOSE — DO NOT HOIST IT
   BACK ONTO .bcv2-tl-costlink. In the name cell it pushes `edit ›` to the right
   of "Investment", which is right. Unscoped it ALSO applies inside
   .bcv2-tl-payback, which is a flex row of sentence fragments — it shoved the
   link 346px to the far end and left the trailing "·" orphaned in mid-air
   (measured on production 2026-08-24: last separator ended at x=603, the link
   began at x=949). ⚠️ NO TEST CAUGHT THAT AND NONE CAN: JSDOM does no layout,
   so every DOM assertion stayed green and the geometry probes — which measured
   the LINE's width, not its children — passed too. It was found by looking at a
   screenshot. The gate below is structural for that reason. */
.bcv2-tl-name > .bcv2-tl-costlink { margin-left: auto; }
/* 🔴 grid-column IS LOAD-BEARING, NOT STYLING. Every row in .bcv2-tl is
   `display: contents`, so this line is a DIRECT CHILD of the 4-column grid;
   without the span it renders as a narrow 5th cell. That is precisely how a
   note once came out 90x70 in a 320px sidebar with its own test green. */
.bcv2-tl-payback {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--surface-base);
}
/* 🔴 grid-column IS LOAD-BEARING HERE FOR THE SAME REASON AS .bcv2-tl-payback
   ABOVE — `.bcv2-tl-row` is `display: contents`, so this note is a DIRECT CHILD
   of the 4-column grid and without the span it renders as a narrow 5th cell,
   shredding the row. Do not "tidy" it into a padding rule. */
.bcv2-tl-shortfall {
  grid-column: 1 / -1;
  padding: 4px 12px 6px 28px;
  font-size: 11px;
  color: var(--text-secondary);
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-subtle);
}
/* ⛔ `flex: 0 0 auto` IS THE RULE, NOT THE FONT SIZE. `.bcv2-tl-name` is a flex
   row with `overflow: hidden`; a tag left shrinkable is squashed to a sliver
   instead of shrinking the name, which has `min-width: 0` precisely so IT is
   the box that gives way. Same reason .bcv2-tl-dot and .bcv2-tl-costlink carry
   it. ⚠️ And no `margin-left: auto` — that is scoped to the cost link on
   purpose; unscoped it flung `edit ›` 346px across the payback line. */
.bcv2-tl-tag-oneoff {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 3px;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  background: var(--surface-raised);
  white-space: nowrap;
}


/* Header row + frozen first column via sticky */
.bcv2-model-grid-header {
  display: contents;
}
.bcv2-mg-row {
  display: contents;
}
.bcv2-mg-cell {
  display: flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-base);
  font: 400 12px/1 var(--font-sans);
  color: var(--text-primary);
  cursor: cell;
  user-select: none;
  outline: none;
}
.bcv2-mg-cell-header {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 32px;
  background: var(--surface-raised);
  font: 500 11px/1 var(--font-sans);
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  border-bottom: 1px solid var(--border-default);
}
.bcv2-mg-cell-name {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface-base);
  border-right: 1px solid var(--border-subtle);
  gap: 8px;
}
.bcv2-mg-cell-header.bcv2-mg-cell-name {
  z-index: 3;
  background: var(--surface-raised);
}
.bcv2-mg-cell-num {
  justify-content: flex-end;
  font: 400 12px/1 var(--font-mono);
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.bcv2-mg-cell-roi {
  justify-content: center;
}

/* Starts · Ends — the per-lever go-live month and the month it stops
   delivering (2026-08-24). Right-aligned like the numeric columns so the
   headers and the digits sit on the same edge.
   ⭐ ONE RULE FOR BOTH, deliberately: the two cells are the same control on the
   same axis, and a second copy of these declarations is a second thing to
   drift the first time one of them is adjusted. */
.bcv2-mg-start,
.bcv2-mg-end {
  justify-content: flex-end;
  padding: 0 8px;
}
.bcv2-mg-start-input,
.bcv2-mg-end-input {
  /* ⛔ box-sizing IS LOAD-BEARING HERE, not tidiness. This stylesheet has NO
     universal border-box reset (base.css sets it on one tier-dot only), so
     `width: 100%` would resolve to 100% of the CELL'S CONTENT BOX and then add
     10px of its own padding + border on top — an input wider than the cell it
     sits in, which is how the last defect in this grid escaped every gate that
     was not measuring an edge. Stated in px: the track is 76, the cell's own
     padding leaves 60, and this makes the input exactly 60 rather than 70. */
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 3px 4px;
  text-align: right;
  font: 400 12px/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  background: var(--surface-base);
  cursor: text;
}
.bcv2-mg-start-input:focus,
.bcv2-mg-end-input:focus {
  border-color: var(--brand-primary);
  outline: none;
}

/* Hover */
.bcv2-mg-cell:hover { background: var(--surface-dim); }
.bcv2-mg-cell-name:hover { background: var(--surface-dim); }

/* Selection (§13.3.2) — 2px brand-primary inset ring + 4% brand-fade tint */
.bcv2-mg-cell-selected {
  box-shadow: inset 0 0 0 2px var(--brand-primary);
  background: var(--brand-primary-fade);
  z-index: 4;
}
.bcv2-mg-cell-name.bcv2-mg-cell-selected { background: var(--brand-primary-fade); }

/* Lever name cell internals */
.bcv2-mg-cat-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: var(--text-tertiary);
}
.bcv2-mg-cat-dot-other { background: var(--text-tertiary); }
.bcv2-mg-name-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}
/* Name on line 1, tags on line 2, inside the fixed 36px cell (2026-10-17):
   15px name line + 3px gap + 14px tag line = 32px. ⛔ min-width: 0 on the stack
   AND the tag line is load-bearing — a flex item's automatic minimum is its
   content, so without it the ellipsis on the name is never reached (the same
   trap .bcv2-tl-name documents above). */
.bcv2-mg-name-stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}
.bcv2-mg-name-stack > .bcv2-mg-name-text { flex: 0 0 auto; line-height: 15px; }
.bcv2-mg-name-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.bcv2-mg-name-tags:empty { display: none; }
.bcv2-mg-name-tags .bcv2-mg-name-tag { padding: 1px 5px; }
.bcv2-mg-name-icon {
  display: inline-flex;
  flex: 0 0 auto;
  color: var(--text-tertiary);
}
.bcv2-mg-name-tag {
  font: 500 10px/1 var(--font-mono);
  color: var(--text-tertiary);
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  padding: 2px 5px;
  flex: 0 0 auto;
  letter-spacing: 0.04em;
}
.bcv2-mg-name-tag-hours { color: var(--brand-primary); }
/* Dollar lever (revenue/risk/cost) sitting at $0 because a driver input is
   missing — prompt for input rather than showing "$0". Display-only; the lever
   still contributes to ROI once valued (2026-07-08 owner clarification). */
.bcv2-mg-name-tag-needs { color: var(--gold, #e8b84b); border-color: color-mix(in srgb, var(--gold, #e8b84b) 40%, transparent); }
/* #112 — lever-level "Estimated" tier (a driving input is a non-verified research
   fact). Filled gold chip so it reads distinctly from the outline "Needs input". */
.bcv2-mg-name-tag-estimated {
  color: var(--gold, #e8b84b);
  border-color: color-mix(in srgb, var(--gold, #e8b84b) 40%, transparent);
  background: color-mix(in srgb, var(--gold, #e8b84b) 12%, transparent);
}
/* Not hard money BY DESIGN (financial_type non_financial / option_value) — the
   lever will never carry a dollar figure, so it must NOT wear the gold chip,
   which says "one more input and a number appears". Deliberately neutral: this
   is a CLASSIFICATION, not an alert. Reads as a sibling of "Hours" — another
   row measured on a different axis — rather than of "Needs input". */
.bcv2-mg-name-tag-directional {
  color: var(--text-secondary);
  border-color: var(--border-default);
}
/* Programme item 3 (deferred half) — what this lever's value RESTS ON, from
   lib/provenanceComposition.ts `leverBadge`. Replaces the absence left by
   `bcLeverTier` answering "Corpus" (its FALLTHROUGH) on 69 of 89 live rows.
   ⚠️ Neutral by default ON PURPOSE: "Benchmark" is a CLASSIFICATION, not an
   alert, and 66 of 89 rows carry it — an alert colour on three quarters of the
   grid trains the reader to ignore it. Sibling of "Directional", not of
   "Needs input". */
.bcv2-mg-name-tag-prov {
  color: var(--text-secondary);
  border-color: var(--border-default);
}
/* ⛔ THE ONE THAT IS AN ALERT. A benchmark standing in for a company figure
   nobody supplied (ADR 0025) — 9 live levers carrying $31.1M whose defence
   rests on it, with no surface anywhere naming it before this. Same gold as
   .bcv2-mg-name-tag-estimated so the grid reads as one vocabulary; the WORD
   carries the difference, which is this file's existing precedent. */
.bcv2-mg-name-tag-prov[data-prov-token="stand_in"] {
  color: var(--gold, #e8b84b);
  border-color: color-mix(in srgb, var(--gold, #e8b84b) 40%, transparent);
  background: color-mix(in srgb, var(--gold, #e8b84b) 12%, transparent);
}
.bcv2-mg-needs-input {
  font: 500 11px/1 var(--font-mono);
  color: var(--gold, #e8b84b);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* Same slot as .bcv2-mg-needs-input, opposite meaning — muted, because there
   is nothing to chase. Wording matches the narrative's aggregate table. */
.bcv2-mg-not-quantified {
  font: 500 11px/1 var(--font-mono);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ROI checkbox cell */
.bcv2-mg-roi-check {
  width: 14px;
  height: 14px;
  cursor: pointer;
}

/* Expanded lever bridge (§13.3 12a — clicking name cell expands the
   legacy lever-detail UI inline until rail state E lands in 12b) */
.bcv2-mg-row-expanded { /* row stays in normal flow — expanded panel rides below */ }
.bcv2-mg-expanded {
  grid-column: 1 / -1;
  background: var(--surface-dim);
  border-bottom: 1px solid var(--border-default);
}
.bcv2-mg-expanded-inner {
  padding: 16px;
}

/* Names the drivers a "Needs input" lever could not resolve, so the tag is a
   next action rather than a dead end (2026-08-23, owner-chosen).
   ⛔ `grid-column: 1 / -1` is REQUIRED — `.bcv2-mg-row` is `display: contents`,
   so this element is a direct grid child and without the span it renders as a
   narrow 7th cell. Same failure the value-basis note hit in the fin sidebar. */
.bcv2-mg-missing {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 0 12px 6px 28px;
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-subtle);
  font: 400 11px/1.4 var(--font-sans);
  min-width: 0;
}
.bcv2-mg-missing-label {
  flex: 0 0 auto;
  color: var(--gold, #e8b84b);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.bcv2-mg-missing-names {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

/* TCO2 4.6 — the two retirement rows expand to their current-state lines.
   ⛔ grid-column: 1 / -1 is load-bearing (the row is display: contents; KI #29). */
.bcv2-mg-retire {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px 6px 28px;
  background: var(--surface-base);
  border-bottom: 1px solid var(--border-subtle);
  font: 400 11px/1.4 var(--font-sans);
  min-width: 0;
}
.bcv2-mg-retire-lines { margin: 0; padding: 0; list-style: none; }
.bcv2-mg-retire-line { color: var(--text-secondary); overflow-wrap: anywhere; }
.bcv2-mg-retire-line.is-incomplete { color: var(--warning); }
.bcv2-mg-retire-actions { display: flex; gap: 6px; }
/* Both moves ("Move into the case" / "Move back to upside") are the one secondary
   button — the panel's 11px secondary text must never be read as its colour. */
.bcv2-mg-retire-move { color: var(--text-primary); border-color: var(--border-default); background: transparent; }
.bcv2-mg-retire-toggle {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  padding: 0 4px 0 0;
  color: var(--text-secondary);
  font: 400 11px/1 var(--font-sans);
  cursor: pointer;
}
.bcv2-mg-retire-toggle:hover { color: var(--text-primary); }

@media (prefers-reduced-motion: reduce) {
  .bcv2-mg-cell { transition: none; }
}

/* ─── Batch 12b — Model editor +row + Vega rail state E ─── */

/* Inline custom-lever +row at the bottom of the model grid (§13.3.5). */
.bcv2-mg-row-add {
  border-top: 1px dashed var(--border-default);
}
.bcv2-mg-add-cta {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer;
  color: var(--text-tertiary);
  font: 400 12px/1 var(--font-sans);
  padding: 0 12px;
}
.bcv2-mg-add-cta:hover { color: var(--text-primary); background: var(--surface-raised); }
.bcv2-mg-add-plus {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px;
  border-radius: 4px; background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  font: 600 12px/1 var(--font-sans); color: var(--text-secondary);
}
.bcv2-mg-add-cta:hover .bcv2-mg-add-plus { color: var(--brand-primary); border-color: var(--border-brand); }
.bcv2-mg-add-blank { background: transparent; }

.bcv2-mg-row-draft .bcv2-mg-add-name-cell { padding: 4px 8px; gap: 6px; }
.bcv2-mg-add-name-input,
.bcv2-mg-add-value-input {
  flex: 1;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 4px 6px;
  font: 400 12px/1 var(--font-sans); color: var(--text-primary);
  background: var(--surface-base);
}
.bcv2-mg-add-name-input:focus,
.bcv2-mg-add-value-input:focus {
  border-color: var(--brand-primary); outline: none;
}
.bcv2-mg-add-meta {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px;
}
.bcv2-mg-add-cat-select {
  flex: 1;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 4px 6px;
  font: 400 12px/1 var(--font-sans); color: var(--text-primary);
  background: var(--surface-base);
}

/* Formula bar chips become click-to-edit in 12b. */
.bcv2-fb-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 999px;
  padding: 2px 8px;
  font: 400 11px/1 var(--font-sans); color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), border-color var(--duration-fast) var(--ease-standard);
}
.bcv2-fb-chip:hover { background: var(--brand-primary-fade); border-color: var(--border-brand); color: var(--text-primary); }
@media (prefers-reduced-motion: reduce) { .bcv2-fb-chip { transition: none; } }
.bcv2-fb-chip-key { font-weight: 500; color: var(--text-primary); }
.bcv2-fb-chip-val { font-family: var(--font-mono); color: var(--text-tertiary); }

/* ─── Vega rail state E (§13.3.4 Model context) ─── */
.vega-state-e { padding: 8px 4px; display: flex; flex-direction: column; gap: 12px; }
.vega-state-e-header { padding: 0 8px; }
.vega-state-e-eyebrow {
  display: flex; align-items: center; gap: 6px;
  font: 400 11px/1 var(--font-sans); color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.vega-state-e-cat-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.vega-state-e-title {
  margin-top: 4px;
  font: 500 14px/1.3 var(--font-sans); color: var(--text-primary);
}
.vega-state-e-empty {
  font: 400 11px/1.4 var(--font-sans); color: var(--text-tertiary);
  padding: 8px 8px 0;
}

/* Formula expression block */
.vega-e-formula { padding: 0 8px; }
.vega-e-formula-expr {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 8px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.vega-e-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: 999px;
  padding: 2px 8px;
  font: 400 11px/1 var(--font-sans); color: var(--text-secondary);
  cursor: pointer;
  position: relative;
}
.vega-e-chip:hover { background: var(--brand-primary-fade); border-color: var(--border-brand); }
.vega-e-chip-key { font-weight: 500; color: var(--text-primary); }
.vega-e-chip-val { font-family: var(--font-mono); color: var(--text-tertiary); }
.vega-e-chip-x {
  margin-left: 2px;
  background: transparent; border: none;
  width: 12px; height: 12px; padding: 0;
  font: 400 12px/1 var(--font-sans); color: var(--text-tertiary);
  cursor: pointer; opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-standard);
}
.vega-e-chip:hover .vega-e-chip-x { opacity: 1; }
.vega-e-chip-x:hover { color: var(--negative); }
@media (prefers-reduced-motion: reduce) { .vega-e-chip-x { transition: none; } }
.vega-e-op {
  font: 500 12px/1 var(--font-mono);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  padding: 0 2px;
}
.vega-e-op:hover { color: var(--brand-primary); }
.vega-e-eq { font: 500 12px/1 var(--font-mono); color: var(--text-tertiary); margin-left: 4px; }
.vega-e-result { font: 500 12px/1 var(--font-mono); color: var(--text-primary); }
.vega-e-add-chip {
  display: inline-flex; align-items: center; gap: 2px;
  background: transparent;
  border: 1px dashed var(--border-default);
  border-radius: 999px;
  padding: 2px 8px;
  font: 400 11px/1 var(--font-sans); color: var(--text-tertiary);
  cursor: pointer;
}
.vega-e-add-chip:hover { color: var(--brand-primary); border-color: var(--border-brand); }
.vega-e-add-panel {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 4px 6px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.vega-e-add-select,
.vega-e-add-const {
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 2px 6px;
  font: 400 11px/1 var(--font-sans); color: var(--text-primary);
  background: var(--surface-base);
  min-width: 80px;
}
.vega-e-formula-save { margin-top: 6px; display: flex; gap: 6px; align-items: center; }

/* Variables list */
.vega-e-vars { display: flex; flex-direction: column; gap: 8px; padding: 0 8px; }
.vega-e-var {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px;
}
.vega-e-var-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.vega-e-var-label { font: 500 12px/1.3 var(--font-sans); color: var(--text-primary); }
.vega-e-var-prov {
  font: 400 10px/1 var(--font-sans);
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 999px;
  /* ⭐ `capitalize` MOVED TO `none` 2026-09-08, and a SCREENSHOT is the only
     reason it was caught. Every one of the seven words this badge can render is
     already correctly cased at source, so `capitalize` could only ever CORRUPT
     one — and it did: "Stand-in" rendered "Stand-In", because capitalize starts
     a new word after the hyphen. Invisible on the three incumbents ("Customer",
     "Research", "Benchmark") precisely because they are single capitalised
     words, which is why it survived until a hyphenated word arrived.
     ⚠️ It also silently threatened "My number" -> "My Number".
     ⛔ The `text-transform: none` on .vega-e-prov-unresolved below is now
     redundant and STAYS: item 1's U7 probe reads that rule body for it, and a
     redundant declaration is cheaper than a gate that stops meaning anything. */
  text-transform: none;
}
.vega-e-prov-customer  { background: var(--brand-primary-fade); color: var(--brand-primary); }
.vega-e-prov-research  { background: var(--surface-raised);     color: var(--text-secondary); }
.vega-e-prov-benchmark { background: var(--surface-raised);     color: var(--text-tertiary); }
/* ⭐ NOTHING SUPPLIED THIS FIGURE (resolver Priority 7, `provenance: 'unresolved'`).
   It used to render in the .vega-e-prov-benchmark slot reading "Benchmark" — KI
   #21/#29's falsehood, on the rail the practitioner reads while modelling.
   ⛔ NOT a new colour: `var(--gold, #e8b84b)` is the established "chase this"
   expression, copied verbatim from the modeler grid's .bcv2-mg-needs-input and
   .bcv2-mg-name-tag-needs, so the two surfaces read as one state rather than two.
   ⚠️ MEASURED 2026-09-06: --gold is DEFINED NOWHERE in public/styles/*.css, so the
   #e8b84b fallback is what actually paints — here and on both incumbents. Kept as
   the var() form deliberately: defining the token later moves all three together.
   ⚠️ text-transform is reset because the pill capitalises every word and the
   established copy is "Needs input", not "Needs Input". */
.vega-e-prov-unresolved {
  background: color-mix(in srgb, var(--gold, #e8b84b) 12%, transparent);
  color: var(--gold, #e8b84b);
  text-transform: none;
}
.vega-e-var-current {
  margin-top: 4px;
  display: flex; align-items: baseline; gap: 6px;
  font: 400 11px/1 var(--font-sans);
}
.vega-e-var-current-val { font-family: var(--font-mono); color: var(--text-primary); font-weight: 500; }
/* A citation can carry one long unbroken token (an XBRL tag, a URL): it must wrap
   inside the card, not run past it (production screenshot 2026-10-15). */
.vega-e-var-source { color: var(--text-tertiary); font-size: 10px; min-width: 0; overflow-wrap: anywhere; }
.vega-e-var-edit {
  margin-top: 6px;
  display: flex; align-items: center; gap: 4px;
}
.vega-e-var-input {
  flex: 1; min-width: 0;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 3px 6px;
  font: 400 12px/1 var(--font-mono); color: var(--text-primary);
  background: var(--surface-base);
}
.vega-e-var-input:focus { border-color: var(--brand-primary); outline: none; }
.vega-e-var-unit { font: 400 11px/1 var(--font-sans); color: var(--text-tertiary); }
.vega-e-var-bench { margin-top: 4px; font: 400 10px/1.4 var(--font-sans); color: var(--text-tertiary); }
.vega-e-var-labor-rate { margin-top: 2px; font: 400 10px/1.4 var(--font-sans); color: var(--text-secondary); }
/* Benchmark context PR 4 — how the figure is applied: one line by default, the stated figures on demand. */
.vega-e-var-applied { margin-top: 4px; }
.vega-e-var-applied-line { font: 400 10px/1.4 var(--font-sans); color: var(--text-secondary); overflow-wrap: anywhere; }
.vega-e-var-applied.is-not-applied .vega-e-var-applied-line { color: var(--warning); }
.vega-e-var-applied-toggle { margin-top: 2px; padding-left: 0; padding-right: 0; }
.vega-e-var-applied-depth { margin-top: 4px; padding: 6px 8px; border: 1px solid var(--border-subtle); border-radius: 6px; }
.vega-e-var-applied-points { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 6px; }
.vega-e-var-applied-points li.is-context { opacity: 0.75; }
.vega-e-var-applied-point-head { font: 400 10px/1.4 var(--font-sans); color: var(--text-secondary); }
.vega-e-var-applied-quote { font: italic 400 10px/1.4 var(--font-sans); color: var(--text-tertiary); overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.vega-e-var-applied-src { font: 400 10px/1.4 var(--font-sans); overflow-wrap: anywhere; }
.vega-e-var-applied-options { display: flex; flex-wrap: wrap; gap: 4px; }
.vega-e-var-applied-adoption { display: flex; gap: 4px; align-items: flex-start; margin-top: 6px; font: 400 10px/1.4 var(--font-sans); color: var(--text-secondary); }
.vega-e-var-cascade { margin-top: 4px; font: 400 10px/1.4 var(--font-sans); color: var(--warning); }
/* 🔴 KI #39 — the blind-spot line. Reuses --warning like the cascade line one
   rule up: it is a caveat, not an error, and it must not read as a failure of
   the number beside it. ⚠️ Terse on purpose — this file is inlined into every
   design preview (KI #57). */
.vega-e-var-nobasis { margin-top: 4px; font: 400 10px/1.4 var(--font-sans); color: var(--warning); }
/* One home per figure PR 3: what the figure IS here; an exception reads as a caveat. */
.vega-e-var-figure { margin-top: 4px; font: 400 10px/1.4 var(--font-sans); color: var(--text-secondary); overflow-wrap: anywhere; }
.vega-e-var-figure.is-exception { color: var(--warning); }
.vega-e-var-justification { margin-top: 2px; font: italic 400 10px/1.4 var(--font-sans); color: var(--text-secondary); overflow-wrap: anywhere; }
.vega-e-var-scope { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.vega-e-var-reason { margin-top: 6px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.vega-e-var-reason-label { font: 400 10px/1.4 var(--font-sans); color: var(--text-secondary); }
.vega-e-var-reason-input { flex: none; width: 100%; font-family: var(--font-sans); }
.vega-e-var-reason-missing { font: 400 10px/1.4 var(--font-sans); color: var(--negative); }
/* TCO2 4.7 — a ledger line / "what they spend today" driver: no input box. */
.vega-e-spend-working, .vega-e-spend-reason { margin-top: 2px; font: 400 11px/1.4 var(--font-sans); color: var(--text-secondary); overflow-wrap: anywhere; }
.vega-e-spend-working.is-incomplete { color: var(--warning); }
.vega-e-spend-actions { display: flex; gap: 6px; margin-top: 4px; }
.vega-e-spend-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.vega-e-spend-line { flex: 1 1 100%; min-width: 0; font: 400 11px/1.4 var(--font-sans); }
.vega-e-spend-share { width: 64px; font: 400 11px/1.4 var(--font-sans); }
.vega-e-spend-bench { margin-top: 8px; padding: 6px 8px; border: 1px solid var(--border-subtle); border-radius: 6px; font: 400 11px/1.4 var(--font-sans); }
.vega-e-spend-bench-head { color: var(--text-primary); margin-bottom: 4px; }
.vega-e-spend-bench-help { margin-top: 4px; color: var(--text-secondary); }
.vega-e-spend-problems { margin: 6px 0 0; padding-left: 16px; font: 400 11px/1.4 var(--font-sans); color: var(--warning); }
/* 🔴 KI #39 surface — "record a better benchmark" on a driver row. Terse for
   the same reason as the objection panel below: this file is inlined into
   every design preview. */
.vega-e-var-capture-link { display: block; margin-top: 4px; padding: 0; border: 0; background: none; font: 400 10px/1.4 var(--font-sans); color: var(--brand-primary); cursor: pointer; text-align: left; }
.vega-e-bench-capture { margin-top: 6px; padding: 8px; border: 1px solid var(--border-default); border-radius: 4px; background: var(--surface-raised); }
.vega-e-bench-capture label { display: block; margin-bottom: 2px; font: 500 10px/1.4 var(--font-sans); color: var(--text-secondary); }
.vega-e-bench-capture input[type="text"], .vega-e-bench-capture input[type="number"] { width: 100%; margin-bottom: 6px; border: 1px solid var(--border-default); border-radius: 4px; padding: 3px 6px; font: 400 12px/1 var(--font-mono); color: var(--text-primary); background: var(--surface-base); }
.vega-e-bench-capture-note { margin: 2px 0 6px; font: 400 10px/1.4 var(--font-sans); color: var(--text-tertiary); }
.vega-e-bench-capture-scope { display: flex; gap: 10px; margin-bottom: 6px; font: 400 11px/1.4 var(--font-sans); color: var(--text-primary); }
.vega-e-bench-capture-scope label { display: inline; margin: 0; font: inherit; color: inherit; }
.vega-e-bench-capture-actions { display: flex; gap: 6px; justify-content: flex-end; }
/* "⟲ was X · 8 Aug · <reason>" — the system telling you it changed one of
   its own stored numbers (CLAUDE.md auto-heal rule). Read-only, not
   dismissible; deliberately quieter than the cascade warning above. */
.vega-e-var-change { margin-top: 4px; font: 400 10px/1.4 var(--font-sans); color: var(--text-tertiary); font-variant-numeric: tabular-nums; }
.vega-e-var-corpus { margin-top: 4px; }

/* Objection panel — public/modules/workspace/assumption-causal-unit.js. Terse:
   components.css is inlined into every design preview, ~1.4 KB from a hard cap. */
.vega-e-var-objections, .vs-acu-body, .vs-acu-list, .vs-acu-status-line { margin-top: 4px; }
.vs-acu-toggle, .vs-acu-empty, .vs-acu-objection-meta, .vs-acu-status-line { font: 400 10px/1.4 var(--font-sans); color: var(--text-tertiary); }
.vs-acu-toggle { width: 100%; padding: 2px 0; background: none; border: 0; cursor: pointer; text-align: left; }
.vs-acu.has-objections .vs-acu-toggle { color: var(--warning); font-weight: 500; }
.vs-acu-body { padding: 6px; border: 1px solid var(--border-subtle); border-radius: 4px; background: var(--surface-dim); }
.vs-acu-toggle, .vs-acu-header, .vs-acu-add, .vs-acu-objection-meta, .vs-acu-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.vs-acu-draft-btn, .vs-acu-add-btn, .vs-acu-ctrl select, .vs-acu-add input { padding: 2px 5px; border: 1px solid var(--border-default); border-radius: 3px; background: var(--surface-raised); font: 400 10px/1.4 var(--font-sans); }
.vs-acu-list { list-style: none; padding: 0; }
.vs-acu-objection { padding: 4px 0; border-top: 1px solid var(--border-subtle); }
.vs-acu-objection-text { font: 400 11px/1.45 var(--font-sans); color: var(--text-primary); }
.vs-acu-add input { flex: 1 1 auto; min-width: 0; }
.vs-acu-status-line.is-error { color: var(--negative); }
.vs-acu-handling { margin-top: 6px; }
/* The number under this rebuttal has moved since it was written. Warning-toned
   but NOT alarm-toned: the rebuttal is usually still mostly right, and the
   practitioner decides. Rendered only when there is something honest to say —
   there is deliberately no empty state, because a permanently-visible warning
   slot teaches people to stop seeing it. */
.vs-acu-moved { margin-bottom: 4px; padding: 4px 6px; border-left: 2px solid var(--warning); border-radius: 2px; background: var(--warning-tint); font: 400 10px/1.4 var(--font-sans); color: var(--text-primary); }
/* Leg 2 — the accepted rationale, above the objections it will be argued against.
   Quiet by default: this is supporting reasoning, not a warning. The moved
   notice inside it borrows the same warning treatment as .vs-acu-moved. */
.vs-acu-rationale { margin-bottom: 6px; padding: 6px; border-left: 2px solid var(--border-default); border-radius: 2px; background: var(--surface-dim, var(--surface-raised)); }
.vs-acu-rationale-label { font: 400 9px/1.4 var(--font-sans); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-tertiary); margin-bottom: 2px; }
.vs-acu-rationale-text { font: 400 11px/1.5 var(--font-sans); color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
/* Leg 4 — what actually happened. Neutral by default: a miss is information,
   not an alarm. `.held` reads positive because a prediction that landed is the
   one thing in this panel worth celebrating. */
.vs-acu-borne-out { margin-top: 4px; padding: 4px 6px; border-left: 2px solid var(--text-tertiary); border-radius: 2px; background: var(--surface-dim, var(--surface-raised)); font: 400 10px/1.4 var(--font-sans); color: var(--text-primary); }
.vs-acu-borne-out.held { border-left-color: var(--positive); }
.vs-acu-rationale-moved { margin-top: 4px; padding: 4px 6px; border-left: 2px solid var(--warning); border-radius: 2px; background: var(--warning-tint); font: 400 10px/1.4 var(--font-sans); color: var(--text-primary); }
.vs-acu-rebuttal { width: 100%; min-height: 44px; padding: 4px 6px; border: 1px solid var(--border-default); border-radius: 3px; background: var(--surface-raised); color: var(--text-primary); font: 400 11px/1.4 var(--font-sans); resize: vertical; }
.vs-acu-handling-actions { display: flex; gap: 6px; margin-top: 4px; }
.vs-acu-suggest-btn { padding: 2px 5px; border: 1px solid var(--border-default); border-radius: 3px; background: var(--surface-raised); font: 400 10px/1.4 var(--font-sans); cursor: pointer; }
.vs-acu-suggest-btn:disabled { opacity: 0.5; cursor: default; }
.vs-acu-compare { margin-top: 6px; padding: 6px; border: 1px solid var(--warning); border-radius: 4px; background: var(--warning-tint); }
.vs-acu-compare-head { font: 400 10px/1.4 var(--font-sans); font-weight: 500; color: var(--text-primary); margin-bottom: 4px; }
.vs-acu-compare-pair { display: flex; gap: 8px; flex-wrap: wrap; }
.vs-acu-compare-col { flex: 1 1 160px; min-width: 0; }
.vs-acu-compare-label { font: 400 9px/1.4 var(--font-sans); text-transform: uppercase; color: var(--text-tertiary); }
.vs-acu-compare-text { font: 400 11px/1.4 var(--font-sans); color: var(--text-primary); white-space: pre-wrap; word-break: break-word; }
.vs-acu-compare-actions { display: flex; gap: 6px; margin-top: 6px; }
.vs-acu-compare-keep, .vs-acu-compare-use { padding: 2px 5px; border: 1px solid var(--border-default); border-radius: 3px; background: var(--surface-raised); font: 400 10px/1.4 var(--font-sans); cursor: pointer; }
.vega-e-corpus-label { font: 400 10px/1 var(--font-sans); color: var(--text-tertiary); margin-bottom: 2px; }
.vega-e-corpus-bar { display: flex; gap: 8px; font: 400 10px/1 var(--font-mono); color: var(--text-secondary); }
.vega-e-corpus-p.is-mid { color: var(--text-primary); font-weight: 500; }

/* Ramp section */
.vega-e-ramp { padding: 0 8px; }
.vega-e-ramp-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.vega-e-ramp-mode {
  font: 400 10px/1 var(--font-sans);
  padding: 2px 6px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.vega-e-ramp-mode.is-default { background: var(--surface-raised); color: var(--text-tertiary); }
.vega-e-ramp-mode.is-custom { background: var(--brand-primary-fade); color: var(--brand-primary); }
.vega-e-ramp-inputs { display: flex; gap: 4px; }
.vega-e-ramp-cell {
  flex: 1;
  display: flex; align-items: center; gap: 2px;
  padding: 4px 6px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
}
.vega-e-ramp-y { font: 500 10px/1 var(--font-sans); color: var(--text-tertiary); }
.vega-e-ramp-input {
  flex: 1; min-width: 0;
  border: none; outline: none;
  font: 400 12px/1 var(--font-mono); color: var(--text-primary);
  background: transparent;
}
.vega-e-ramp-pct { font: 400 11px/1 var(--font-sans); color: var(--text-tertiary); }

/* Context (realization + corpus + benchmark note) */
.vega-e-real-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 8px; }
.vega-e-real-tag {
  font: 400 11px/1 var(--font-sans);
  padding: 3px 8px;
  background: var(--brand-primary-fade);
  color: var(--brand-primary);
  border-radius: 999px;
}
.vega-e-real-default { font: 400 11px/1 var(--font-sans); color: var(--text-tertiary); }
.vega-e-real-panel {
  padding: 8px;
  margin: 0 8px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  display: flex; flex-direction: column; gap: 6px;
}
.vega-e-real-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; font: 400 11px/1 var(--font-sans); color: var(--text-secondary); }
.vega-e-real-input,
.vega-e-real-label-input {
  flex: 1; min-width: 0;
  border: 1px solid var(--border-default);
  border-radius: 4px;
  padding: 3px 6px;
  font: 400 12px/1 var(--font-sans); color: var(--text-primary);
  background: var(--surface-base);
}
.vega-e-real-input { max-width: 80px; font-family: var(--font-mono); }
.vega-e-real-actions { display: flex; gap: 6px; }
.vega-e-bench-note {
  margin: 8px;
  font: 400 11px/1.4 var(--font-sans); color: var(--text-tertiary);
  padding: 6px 8px;
  background: var(--surface-raised);
  border-radius: 4px;
}
.vega-e-corpus { padding: 0 8px; }

/* ── Stage 3 Session 6 — Realization review block in rail E ── */
#vega-e-realization-block { padding: 0 8px; display: flex; flex-direction: column; gap: 8px; }
.vega-e-real-review-row {
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--surface-panel);
  display: flex; flex-direction: column; gap: 6px;
}
.vega-e-real-review-row.is-favorable { border-left: 3px solid #16a34a; }
.vega-e-real-review-row.is-unfavorable { border-left: 3px solid #dc2626; }
.vega-e-real-review-row.is-neutral { border-left: 3px solid var(--border-default); }
.vega-e-real-review-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.vega-e-real-review-name {
  font: 500 12px/1.2 var(--font-sans); color: var(--text-primary);
  text-transform: capitalize;
}
.vega-e-real-review-pct {
  font: 500 12px/1 var(--font-mono); color: var(--text-secondary);
}
.is-favorable .vega-e-real-review-pct { color: #16a34a; }
.is-unfavorable .vega-e-real-review-pct { color: #dc2626; }
.vega-e-real-review-vals {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.vega-e-real-review-cell {
  display: flex; flex-direction: column; gap: 1px; min-width: 0;
}
.vega-e-real-review-cell label {
  font: 400 10px/1 var(--font-sans);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
  text-transform: capitalize;
}
.vega-e-real-review-cell span {
  font: 400 12px/1.2 var(--font-mono); color: var(--text-primary);
}
.vega-e-real-review-note {
  font: 400 11px/1.4 var(--font-sans); color: var(--text-secondary);
  font-style: italic;
  padding: 4px 6px;
  background: var(--surface-raised);
  border-radius: 4px;
}
.vega-e-real-review-foot { display: flex; justify-content: flex-end; }

/* Stage 3 Session 7 (rewired 2026-05-09) — dual-trend sparkline.
 * Realized series in mineral green; assumed step function in tertiary
 * dashed. Replaces the old baseline-drift sparkline (which read from
 * value_assumptions.baseline_history). */
.vega-e-real-revised {
  display: inline-block;
  padding: 1px 6px;
  font: 500 10px/1 var(--font-sans);
  color: var(--text-tertiary);
  border: 1px dashed var(--border-default);
  border-radius: 999px;
  margin-right: 6px;
}
.vega-e-real-spark {
  display: block;
  width: 100%;
  max-width: 200px;
  height: 36px;
  margin-top: 4px;
}
.vega-e-real-spark-assumed {
  stroke: var(--text-tertiary);
  stroke-width: 1;
  stroke-dasharray: 2 2;
  fill: none;
}
.vega-e-real-spark-realized {
  stroke: var(--brand-primary);
  stroke-width: 1.5;
  fill: none;
}
.vega-e-real-spark-dot {
  fill: var(--brand-primary);
}

/* ── Stage 3 Session 7 — Baseline drift sparkline (in rail-E review row) ── */
.vega-e-bsl {
  display: flex; flex-direction: column; gap: 4px;
  padding: 6px 8px;
  background: var(--surface-raised);
  border-radius: 4px;
  margin-top: 2px;
}
.vega-e-bsl-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.vega-e-bsl-label {
  font: 500 10px/1 var(--font-sans);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.vega-e-bsl-summary {
  font: 400 10px/1 var(--font-mono);
  color: var(--text-secondary);
}
.vega-e-bsl-svg {
  width: 100%;
  height: 28px;
  display: block;
}
.vega-e-bsl-line {
  stroke: var(--brand-primary);
  stroke-width: 1.25;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.vega-e-bsl-pt {
  fill: var(--surface-panel);
  stroke: var(--brand-primary);
  stroke-width: 1;
  cursor: pointer;
  transition: r 120ms ease, stroke-width 120ms ease;
}
.vega-e-bsl-pt:hover { stroke-width: 1.5; }
.vega-e-bsl-pt.is-selected {
  fill: var(--brand-primary);
  stroke: var(--brand-primary);
  stroke-width: 1.5;
}
.vega-e-bsl-detail {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: baseline;
  padding: 4px 6px;
  background: var(--surface-base);
  border-radius: 3px;
  font: 400 10px/1.3 var(--font-sans);
  color: var(--text-secondary);
}
.vega-e-bsl-detail-val {
  font-family: var(--font-mono);
  color: var(--text-primary);
  font-weight: 500;
}
.vega-e-bsl-detail-date { color: var(--text-tertiary); }
.vega-e-bsl-detail-source { color: var(--text-secondary); }
.vega-e-bsl-detail-reason {
  flex-basis: 100%;
  font-style: italic;
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .vega-e-bsl-pt { transition: none; }
}

/* ── Stage 3 Session 9 — Promote signal to evidence modal ─────────
   Modal opened from companies-signals.js promoteSignalToEvidence().
   Reuses .vs-field/.vs-field-label primitives; adds three internals:
   the read-only signal preview block, the credibility-score slider,
   and the chip-based claim multiselect. */
.vs-promote-signal-form { display: flex; flex-direction: column; gap: 18px; }
.vs-promote-signal-preview {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 14px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-left: 2px solid var(--brand-primary, var(--accent));
  border-radius: 6px;
}
.vs-promote-signal-text {
  font: 500 13px/1.5 var(--font-sans);
  color: var(--text-primary);
}
.vs-promote-signal-inference {
  font: 400 12px/1.5 var(--font-sans);
  color: var(--text-secondary);
}
.vs-promote-signal-basis {
  font: 400 11px/1.45 var(--font-sans);
  color: var(--text-tertiary);
  font-style: italic;
}
.vs-field-hint {
  font: 400 11px/1.4 var(--font-sans);
  color: var(--text-tertiary);
  font-weight: 400;
}
/* Credibility-score slider — vanilla range with a mineral-green track.
   Native range styling is ungovernable cross-browser; keep the track
   neutral and rely on the numeric display next to the label for
   precision. */
.vs-promote-cred-slider {
  width: 100%;
  margin: 4px 0;
  accent-color: var(--brand-primary, var(--accent));
}
.vs-promote-cred-display {
  font-family: var(--font-mono, monospace);
  font-size: 12px;
  color: var(--text-secondary);
  margin-left: 6px;
}
.vs-promote-cred-scale {
  display: flex; justify-content: space-between;
  font: 400 10px/1 var(--font-sans);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
/* Claim multiselect — chip-based; click toggles is-selected. */
.vs-promote-claims {
  display: flex; flex-wrap: wrap; gap: 6px;
  min-height: 38px;
  padding: 8px;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.vs-promote-claims-loading,
.vs-promote-claims-empty {
  font: 400 12px/1.45 var(--font-sans);
  color: var(--text-tertiary);
  padding: 4px 2px;
}
.vs-promote-claim-chip {
  display: inline-flex; align-items: center;
  font: 500 11px/1 var(--font-sans);
  padding: 6px 10px;
  background: var(--surface-panel, var(--surface, #fff));
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color 160ms, border-color 160ms, background 160ms;
}
.vs-promote-claim-chip:hover { color: var(--text-primary); border-color: var(--text-tertiary); }
.vs-promote-claim-chip.is-selected {
  background: var(--accent-light, rgba(45,90,76,0.10));
  color: var(--brand-primary, var(--accent));
  border-color: var(--brand-primary, var(--accent));
}
@media (prefers-reduced-motion: reduce) {
  .vs-promote-claim-chip { transition: none; }
}

/* ─── Vega rail state F (V4.x — Reasoning trace viewer) ─── */
.vega-state-f { padding: 8px 4px; display: flex; flex-direction: column; gap: 12px; }
.vega-state-f-header { padding: 0 8px; }
.vega-state-f-eyebrow {
  display: flex; align-items: center; gap: 8px;
  font: 400 11px/1 var(--font-sans); color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.vega-state-f-title {
  margin-top: 4px;
  font: 500 14px/1.3 var(--font-sans); color: var(--text-primary);
}
.vega-state-f-source-label {
  padding: 0 8px;
  font: 400 11px/1.4 var(--font-sans);
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}
.vega-state-f-context {
  padding: 8px 10px;
  margin: 0 8px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font: 400 12px/1.5 var(--font-sans);
  color: var(--text-secondary);
}
.vega-state-f-output {
  padding: 0 8px;
}
.vega-state-f-output-body {
  padding: 8px 10px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font: 400 12px/1.5 var(--font-sans);
  color: var(--text-secondary);
  white-space: pre-line;
}
.vega-state-f-steps {
  padding: 0 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vega-state-f-empty {
  padding: 12px 8px;
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-tertiary);
  font-style: italic;
}
.vega-state-f-error {
  padding: 12px;
  margin: 0 8px;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font: 400 12px/1.5 var(--font-sans);
  color: var(--text-secondary);
}
.vega-state-f-error-actions {
  padding: 0 8px;
  display: flex;
  justify-content: flex-end;
}

/* Outcome pill — uses outcome_status values from reasoning_traces */
.vega-state-f-outcome-pill {
  display: inline-flex;
  align-items: center;
  font: 500 10px/1 var(--font-sans);
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-panel);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  text-transform: capitalize;
}
.vega-state-f-outcome-pill[data-outcome="accepted"],
.vega-state-f-outcome-pill[data-outcome="accepted_with_changes"] {
  background: var(--accent-light, rgba(45,90,76,0.10));
  color: var(--brand-primary, var(--accent));
  border-color: var(--brand-primary, var(--accent));
}
.vega-state-f-outcome-pill[data-outcome="rejected"],
.vega-state-f-outcome-pill[data-outcome="overridden"] {
  background: rgba(204, 85, 73, 0.10);
  color: var(--negative);
  border-color: var(--negative);
}
.vega-state-f-outcome-pill[data-outcome="pending"] {
  color: var(--text-tertiary);
}

/* Reasoning step card (rendered inside .vega-state-f-steps) */
.reasoning-step-card {
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--surface-panel);
}
.reasoning-step-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}
.reasoning-step-number {
  font: 500 11px/1 var(--font-mono);
  color: var(--text-tertiary);
  min-width: 14px;
}
.reasoning-step-type-badge {
  font: 500 10px/1 var(--font-sans);
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--surface-raised, var(--surface, #fff));
  color: var(--text-secondary);
  letter-spacing: 0.02em;
}
.reasoning-step-type-badge[data-step-type="alternative"] {
  background: rgba(204, 85, 73, 0.08);
  color: var(--negative);
}
.reasoning-step-type-badge[data-step-type="decision"],
.reasoning-step-type-badge[data-step-type="conclusion"] {
  background: var(--accent-light, rgba(45,90,76,0.10));
  color: var(--brand-primary, var(--accent));
}
.reasoning-step-chosen-badge {
  font: 500 10px/1 var(--font-sans);
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--accent-light, rgba(45,90,76,0.10));
  color: var(--brand-primary, var(--accent));
}
.reasoning-step-chosen-badge.is-rejected {
  background: rgba(204, 85, 73, 0.10);
  color: var(--negative);
}
.reasoning-step-content {
  font: 400 12px/1.5 var(--font-sans);
  color: var(--text-primary);
  white-space: pre-line;
}
.reasoning-step-entities {
  font: 400 11px/1.4 var(--font-sans);
  color: var(--text-tertiary);
}
.reasoning-step-entities strong {
  color: var(--text-primary);
  font-weight: 500;
}

/* Loading skeleton inside state F */
.vega-state-f-skel {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
}
.vega-state-f-skel-line {
  height: 10px;
  background: linear-gradient(90deg, var(--surface-raised, #f3f3f3) 0%, var(--surface, #fafafa) 50%, var(--surface-raised, #f3f3f3) 100%);
  background-size: 200% 100%;
  border-radius: 4px;
  margin: 4px 0;
  animation: vega-state-f-skel-pulse 1.2s ease-in-out infinite;
}
.vega-state-f-skel-title {
  color: var(--text-tertiary);
  font-style: italic;
}
@keyframes vega-state-f-skel-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .vega-state-f-skel-line { animation: none; background: var(--surface-raised, #f3f3f3); }
}

/* Discovery affordance — Lucide route-icon button on artifact cards.
   Phase 2 cleanup (2026-05-16) — bumped default visibility per
   user feedback that the icon was hard to find at 0.6/14px+4pad. */
.vs-reasoning-trace-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid transparent;
  padding: 7px;
  margin: 0;
  cursor: pointer;
  color: var(--text-tertiary, var(--text2));
  opacity: 0.85;
  border-radius: 4px;
  transition: color 160ms ease, opacity 160ms ease, background 160ms ease, border-color 160ms ease;
  vertical-align: middle;
}
.vs-reasoning-trace-btn:hover {
  opacity: 1;
  color: var(--brand-primary, var(--accent));
  background: var(--accent-light, rgba(45,90,76,0.10));
  border-color: var(--brand-primary, var(--accent));
}
.vs-reasoning-trace-btn:focus-visible {
  outline: 2px solid var(--brand-primary, var(--accent));
  outline-offset: 2px;
  opacity: 1;
}
@media (prefers-reduced-motion: reduce) {
  .vs-reasoning-trace-btn { transition: none; }
}

/* ─── Tooltip primitive (§10.11) ─────────────────────────────────────────── */
/* Spec: docs/specs/2026-05-16-popover-and-tooltip-primitives.md             */

.vs-tooltip {
  position: fixed;
  z-index: 9000;
  background: var(--surface-inverse);
  color: var(--text-on-anchor);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font: 400 12px/1.4 var(--font-sans);
  max-width: 320px;
  box-shadow: var(--shadow-popover);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  /* Transitions only fire when prefers-reduced-motion: no-preference */
}
@media (prefers-reduced-motion: no-preference) {
  .vs-tooltip {
    transition: opacity 120ms ease-out, transform 120ms ease-out;
  }
}
.vs-tooltip--visible {
  opacity: 1;
  transform: translateY(0);
}
.vs-tooltip--hiding {
  opacity: 0;
  transform: translateY(4px);
}
.vs-tooltip[data-placement="bottom"] { transform: translateY(-4px); }
.vs-tooltip[data-placement="bottom"].vs-tooltip--visible { transform: translateY(0); }
.vs-tooltip[data-placement="left"]   { transform: translateX(4px); }
.vs-tooltip[data-placement="left"].vs-tooltip--visible   { transform: translateX(0); }
.vs-tooltip[data-placement="right"]  { transform: translateX(-4px); }
.vs-tooltip[data-placement="right"].vs-tooltip--visible  { transform: translateX(0); }

/* Arrow — 4px triangle pointing toward the anchor */
.vs-tooltip-arrow {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--surface-inverse);
  transform: rotate(45deg);
  pointer-events: none;
}
.vs-tooltip[data-placement="top"]    .vs-tooltip-arrow { bottom: -4px; }
.vs-tooltip[data-placement="bottom"] .vs-tooltip-arrow { top: -4px; }
.vs-tooltip[data-placement="left"]   .vs-tooltip-arrow { right: -4px; top: 50%; margin-top: -4px; }
.vs-tooltip[data-placement="right"]  .vs-tooltip-arrow { left: -4px;  top: 50%; margin-top: -4px; }

/* ─── Popover primitive (§10.13) ─────────────────────────────────────────── */
/* Spec: docs/specs/2026-05-16-popover-and-tooltip-primitives.md             */

.vs-popover {
  position: fixed;
  z-index: 8500;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-popover);
  max-width: 480px;
  opacity: 0;
  transform: translateY(4px);
  outline: none;
}
@media (prefers-reduced-motion: no-preference) {
  .vs-popover {
    transition: opacity 120ms ease-out, transform 120ms ease-out;
  }
}
.vs-popover--visible {
  opacity: 1;
  transform: translateY(0);
}
.vs-popover--hiding {
  opacity: 0;
  transform: translateY(4px);
}
.vs-popover[data-placement="top"]   { transform: translateY(4px); }
.vs-popover[data-placement="top"].vs-popover--visible  { transform: translateY(0); }
.vs-popover[data-placement="left"]  { transform: translateX(4px); }
.vs-popover[data-placement="left"].vs-popover--visible  { transform: translateX(0); }
.vs-popover[data-placement="right"] { transform: translateX(-4px); }
.vs-popover[data-placement="right"].vs-popover--visible { transform: translateX(0); }

/* Scrollable variant — consumers opt-in via opts.scrollable */
.vs-popover--scrollable {
  overflow-y: auto;
  max-height: 70vh;
}

/* Reduced-motion: instant show/hide for both primitives (§9.4) */
@media (prefers-reduced-motion: reduce) {
  .vs-tooltip,
  .vs-popover {
    transition: none;
  }
  .vs-tooltip, .vs-tooltip--visible, .vs-tooltip--hiding,
  .vs-tooltip[data-placement="bottom"], .vs-tooltip[data-placement="bottom"].vs-tooltip--visible,
  .vs-tooltip[data-placement="left"],   .vs-tooltip[data-placement="left"].vs-tooltip--visible,
  .vs-tooltip[data-placement="right"],  .vs-tooltip[data-placement="right"].vs-tooltip--visible {
    transform: none;
  }
  .vs-popover, .vs-popover--visible, .vs-popover--hiding,
  .vs-popover[data-placement="top"],   .vs-popover[data-placement="top"].vs-popover--visible,
  .vs-popover[data-placement="left"],  .vs-popover[data-placement="left"].vs-popover--visible,
  .vs-popover[data-placement="right"], .vs-popover[data-placement="right"].vs-popover--visible {
    transform: none;
  }
}

/* ─── ⌘J cell-popover content (§12.4 Inline Vega popover) ──────────────────── */
/* Spec: docs/specs/2026-05-17-phase-5-sensitivity-cmdj-transition.md         */
/* Consumed by public/modules/workspace/cmdj-cell-popover.js. The Popover     */
/* primitive owns the surface chrome (border, shadow, radius, fade-in); this  */
/* cluster only handles internal layout (header + stacked action buttons).   */

.vs-cmdj-popover-header {
  padding: 10px 12px 8px 12px;
  border-bottom: 1px solid var(--border-default);
}
.vs-cmdj-popover-name {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.35;
  word-break: break-word;
}
.vs-cmdj-popover-meta {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.35;
}
.vs-cmdj-popover-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
}
.vs-cmdj-popover-action {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.vs-cmdj-popover-action:hover {
  background: var(--surface-raised);
}
.vs-cmdj-popover-action:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
  background: var(--brand-primary-fade, rgba(45, 90, 76, 0.08));
}
.vs-cmdj-popover-footer {
  display: flex;
  justify-content: flex-end;
  padding: 6px 8px 8px 8px;
  border-top: 1px solid var(--border-default);
}
.vs-cmdj-popover-close {
  padding: 4px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.vs-cmdj-popover-close:hover {
  background: var(--surface-raised);
  color: var(--text-primary);
}
.vs-cmdj-popover-close:focus-visible {
  outline: none;
  border-color: var(--brand-primary);
}
@media (prefers-reduced-motion: no-preference) {
  .vs-cmdj-popover-action,
  .vs-cmdj-popover-close {
    transition: background-color 120ms ease-out, border-color 120ms ease-out, color 120ms ease-out;
  }
}

/* ─── BC Modeler v2 — Diff card Revert popover body (Phase 5) ────────────── */
/* Spec: docs/specs/2026-05-17-phase-5-diff-card-revert-popover.md            */
.bcv2-revert-popover {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-primary);
}
.bcv2-revert-popover-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.bcv2-revert-popover-summary {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 10px;
}
.bcv2-revert-popover-kpis {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}
.bcv2-revert-popover-kpi-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
}
.bcv2-revert-popover-kpi-label {
  color: var(--text-secondary);
  font-weight: 500;
}
.bcv2-revert-popover-kpi-value {
  color: var(--text-primary);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}
.bcv2-revert-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.bcv2-revert-popover-actions .btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ─── BC Modeler v2 — Diff card Explain trace popover body (Phase 5) ──── */
/* Spec: docs/specs/2026-05-17-phase-5-diff-card-explain-trace-popover.md  */
.bcv2-explain-popover {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-primary);
}
.bcv2-explain-popover-section {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle, var(--border-default));
}
.bcv2-explain-popover-section:first-child {
  padding-top: 0;
}
.bcv2-explain-popover-section:last-of-type {
  border-bottom: 0;
}
.bcv2-explain-popover-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary, var(--text-secondary));
  margin-bottom: 6px;
}
.bcv2-explain-popover-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.bcv2-explain-popover-body-line {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.bcv2-explain-popover-prov-line {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-tertiary, var(--text-secondary));
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}
.bcv2-explain-popover-empty {
  font-size: 12.5px;
  font-style: italic;
  color: var(--text-tertiary, var(--text-secondary));
  line-height: 1.4;
}
.bcv2-explain-popover-cascade-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bcv2-explain-popover-cascade-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bcv2-explain-popover-cascade-head {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-primary);
}
.bcv2-explain-popover-cascade-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.bcv2-explain-popover-cascade-name {
  font-weight: 500;
}
.bcv2-explain-popover-cascade-cat {
  color: var(--text-tertiary, var(--text-secondary));
}
.bcv2-explain-popover-cascade-sub {
  font-size: 12px;
  color: var(--text-secondary);
  padding-left: 14px;
}
.bcv2-explain-popover-kpi-table {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}
.bcv2-explain-popover-kpi-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 12px;
  font-size: 12.5px;
}
.bcv2-explain-popover-kpi-label {
  color: var(--text-secondary);
  font-weight: 500;
}
.bcv2-explain-popover-kpi-value {
  color: var(--text-primary);
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
}
.bcv2-explain-popover-kpi-delta {
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  color: var(--text-secondary);
}
.bcv2-explain-popover-kpi-delta.is-positive {
  color: var(--brand-primary);
}
.bcv2-explain-popover-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
}

/* ── Vega rail locked empty-state card ────────────────────────────
   Spec: docs/specs/2026-05-17-pre-testing-rollout-readiness-empty-state.md.
   Three families surface a locked card on the Vega rail when their
   threshold hasn't been met yet:
     - Cohort benchmarks    (assumed, MIN_COHORT_N=5)
     - Realization benchmarks (realization, MIN_COHORT_N=5)
     - Library health       (library defaults, threshold=3 per ADR 0013)
   The card uses the standard insight archetype chrome plus an
   `is-locked` modifier that dims the icon row, adds a lock glyph in
   the meta row, and makes the whole card a clickable trigger for the
   "Why the threshold?" popover. No mineral green — locked cards use
   text-tertiary per CLAUDE.md's "mineral green is precise emphasis"
   constraint.
   ──────────────────────────────────────────────────────────────── */
.vega-card.is-locked {
  background: var(--surface-panel);
  /* Replace the standard 2px brand-primary stripe with a dimmed
     dashed accent so the card visually reads as "not active yet". */
  border-left-style: dashed;
  border-left-color: var(--border-subtle);
  cursor: pointer;
}
.vega-card.is-locked .vega-card-meta {
  color: var(--text-tertiary);
}
.vega-card.is-locked .vega-card-archetype {
  /* Eyebrow ("Cohort benchmarks" / "Realization benchmarks" /
     "Library health") replaces the archetype slot. Keep it tertiary. */
  color: var(--text-tertiary);
}
.vega-card.is-locked .tier-dot {
  /* Tier dot dimmed to match the locked treatment. */
  opacity: 0.45;
}
.vega-card.is-locked .vega-card-title {
  color: var(--text-secondary);
}
.vega-card.is-locked .vega-card-body {
  color: var(--text-tertiary);
}
.vega-card.is-locked:hover {
  /* Subtle elevation hint on hover since the whole card is a click
     target for the "Why the threshold?" popover. */
  background: var(--surface-raised);
}

/* Lock glyph button sits in the meta row beside the dismiss button.
   12px outline icon; tertiary color; subtle hover highlight matching
   the dismiss-button hover treatment. */
.vega-card-lock-glyph {
  background: transparent;
  border: 0;
  padding: 2px;
  color: var(--text-tertiary);
  cursor: pointer;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}
.vega-card-lock-glyph:hover,
.vega-card-lock-glyph:focus-visible {
  background: var(--surface-raised);
  color: var(--text-secondary);
  outline: none;
}
@media (prefers-reduced-motion: reduce) {
  .vega-card-lock-glyph { transition: none; }
}

/* "Why the threshold?" popover content. Renders inside the standard
   .vs-popover frame (Phase 5 primitive). The popover body itself owns
   sizing + scroll behavior; this cluster owns the text rhythm. */
.vega-locked-popover {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
}
.vega-locked-popover-title {
  font: 500 13px/1.3 var(--font-sans);
  color: var(--text-primary);
  letter-spacing: -0.005em;
}
.vega-locked-popover-body {
  margin: 0;
  font: 400 12px/1.5 var(--font-sans);
  color: var(--text-secondary);
}
.vega-locked-popover-body strong {
  color: var(--text-primary);
  font-weight: 500;
}
.vega-locked-popover-footer {
  padding-top: 4px;
  border-top: 1px solid var(--border-subtle);
}
.vega-locked-popover-footer a {
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-secondary);
  text-decoration: none;
}
.vega-locked-popover-footer a:hover,
.vega-locked-popover-footer a:focus-visible {
  color: var(--text-primary);
  text-decoration: underline;
  outline: none;
}

/* ───────────────────────────────────────────────────────────
 * Stage 3.5 Tier 5 (2026-05-23) — Usage view + banner.
 * Spec: docs/specs/2026-05-23-stage-3-5-tier-5-cost-ceilings-usage-view.md
 * Settings → Usage section + view-agnostic workspace banner.
 * ─────────────────────────────────────────────────────────── */

.vs-usage-head {
  margin-bottom: 14px;
}
.vs-usage-title {
  font: 600 14px/1.3 var(--font-sans);
  color: var(--text-primary);
  margin-bottom: 3px;
}
.vs-usage-sub {
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-tertiary);
}
.vs-usage-empty {
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-tertiary);
  padding: 8px 0;
}
.vs-usage-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 14px;
  margin-bottom: 12px;
}
.vs-usage-row {
  padding: 10px 12px;
  background: var(--surface-raised);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
}
.vs-usage-row[data-status="near"] { border-color: var(--warning); }
.vs-usage-row[data-status="over"] { border-color: var(--negative); }
.vs-usage-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.vs-usage-row-label {
  font: 500 13px/1.3 var(--font-sans);
  color: var(--text-primary);
}
.vs-usage-badge {
  font: 600 10px/1 var(--font-sans);
  text-transform: none;
  padding: 3px 7px;
  border-radius: 9px;
  letter-spacing: 0.02em;
}
.vs-usage-badge.under { background: var(--surface-dim, #f3f4f6); color: var(--text-tertiary); }
.vs-usage-badge.near  { background: rgba(217,119,6,0.12); color: #b45309; }
.vs-usage-badge.over  { background: rgba(185,28,28,0.12); color: #b91c1c; }
.vs-usage-row-meter {
  height: 4px;
  background: var(--surface-dim, #f3f4f6);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.vs-usage-row-bar {
  height: 100%;
  background: var(--brand-primary, #2D5A4C);
  border-radius: 2px;
  transition: width 200ms ease;
}
.vs-usage-row[data-status="near"] .vs-usage-row-bar { background: #d97706; }
.vs-usage-row[data-status="over"] .vs-usage-row-bar { background: #b91c1c; }
.vs-usage-row-foot {
  font: 500 12px/1.3 var(--font-sans);
  color: var(--text-secondary);
}
.vs-usage-count {
  color: var(--text-primary);
  font-weight: 600;
}
.vs-usage-sep {
  color: var(--text-tertiary);
  margin: 0 4px;
}
.vs-usage-foot {
  font: 400 11px/1.5 var(--font-sans);
  color: var(--text-tertiary);
}

/* Adoption rows (Settings → Adoption). Deliberately NOT the
   under/near/over vocabulary above — that one scores spend against a
   threshold, this one reports whether a moment happened at all. */
.vs-adopt-row[data-adoption="never"] { border-style: dashed; }
.vs-adopt-row[data-adoption="unavailable"] { opacity: 0.7; }
.vs-adopt-badge.active      { background: rgba(45,90,76,0.12); color: var(--brand-primary, #2D5A4C); }
.vs-adopt-badge.idle        { background: var(--surface-dim, #f3f4f6); color: var(--text-tertiary); }
.vs-adopt-badge.never       { background: rgba(217,119,6,0.12); color: #b45309; }
.vs-adopt-badge.unavailable { background: var(--surface-dim, #f3f4f6); color: var(--text-tertiary); }
.vs-adopt-months {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.vs-adopt-month {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 2px 5px;
  border-radius: 4px;
  background: var(--surface-dim, #f3f4f6);
  font: 500 10px/1.2 var(--font-sans);
  color: var(--text-tertiary);
}
.vs-adopt-month[data-current="true"] {
  background: rgba(45,90,76,0.10);
  color: var(--brand-primary, #2D5A4C);
}
.vs-adopt-month-count { font-weight: 700; }
.vs-adopt-note { color: var(--text-tertiary); font-style: italic; }

/* Workspace banner — shown when overThreshold non-empty + not dismissed. */
#vs-usage-banner { padding: 0; }
.vs-usage-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 16px 0;
  padding: 10px 14px;
  background: rgba(217,119,6,0.08);
  border: 1px solid rgba(217,119,6,0.3);
  border-radius: 6px;
  font: 500 13px/1.3 var(--font-sans);
  color: #92400e;
}
.vs-usage-banner-icon { color: #b45309; flex-shrink: 0; }
.vs-usage-banner-text { flex: 1; }
.vs-usage-banner-link {
  background: transparent;
  border: none;
  color: #92400e;
  font: 600 12px/1.3 var(--font-sans);
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 6px;
}
.vs-usage-banner-link:hover { color: #78350f; }
.vs-usage-banner-dismiss {
  background: transparent;
  border: none;
  color: #92400e;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vs-usage-banner-dismiss:hover { color: #78350f; }

@media (prefers-reduced-motion: reduce) {
  .vs-usage-row-bar { transition: none; }
}

/* ───────────────────────────────────────────────────────────
   Stage 3.5 Tier 5 spec 4 — Demo plan staleness banner + rail card
   Spec: docs/specs/2026-05-23-stage-3-5-tier-5-demo-plan-refresh-triggers.md
   ─────────────────────────────────────────────────────────── */
.vs-staleness-banner {
  border: 1px solid #fde68a;
  background: #fffbeb;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex; flex-direction: column;
  gap: 8px;
}
.vs-staleness-banner-loading {
  font-size: 11px;
  color: var(--text-tertiary, #6b7280);
  padding: 6px 8px;
}
.vs-staleness-banner-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.vs-staleness-banner-title {
  font-size: 13px;
  font-weight: 600;
  color: #92400e;
}
.vs-staleness-banner-age {
  font-size: 11px;
  color: var(--text-tertiary, #6b7280);
}
.vs-staleness-banner-reasons {
  list-style: disc;
  padding-left: 18px;
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary, #4b5563);
  line-height: 1.5;
}
.vs-staleness-banner-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

/* Rail empty/stack — born for rail state H (deleted 2026-10-23, owner-approved);
   still used by state J (VegaRailStateJ.tsx). */
.vs-staleness-rail-empty {
  font-size: 12px;
  color: var(--text-tertiary, #6b7280);
  padding: 8px 10px;
}
.vs-staleness-rail-stack {
  display: flex; flex-direction: column;
  gap: 8px;
}

/* ───────────────────────────────────────────────────────────
   Draft curation — Vega rail state J
   Spec: docs/specs/2026-08-11-vega-draft-curation-rail.md

   Why this block exists rather than reusing what was already here: the
   two candidates both fail on a load-bearing point. `.vs-staleness-rail-card`
   (state H, since deleted) was amber-on-amber because it means STALE — a warning semantic,
   wrong for a neutral review queue. `.vega-card-body` is
   `-webkit-line-clamp: 4`, and clamping is precisely what this surface
   must not do: the owner's decision (2026-08-11) was that batch accept is
   group-scoped so nothing enters the practitioner's record unread, and
   truncated prose makes that claim false.

   So this is deliberately the SAME tokens as .vega-card with the clamp
   removed — not a new design language. A designed treatment belongs in
   docs/design/, same as the stale-basis marker.
   ─────────────────────────────────────────────────────────── */
.vega-draft-group {
  width: 100%;
  text-align: left;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-standard);
}
.vega-draft-group:hover { background: var(--surface-raised); }
.vega-draft-group-title {
  font: 500 13px/1.35 var(--font-sans);
  color: var(--text-primary);
}
.vega-draft-card {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-left-width: 2px;
  border-left-color: var(--vega-stripe);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.vega-draft-kind {
  font: 600 10px/1 var(--font-sans);
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
}
/* The number this prose was written against has moved.
   Spec: docs/specs/2026-08-13-draft-value-moved-gate.md.
   Deliberately quiet — this is a "read this before you accept" note, not an
   error. It sits above the prose so it is read first. */
.vega-draft-moved {
  font: 500 11px/1.4 var(--font-sans);
  color: var(--text-primary);
  background: var(--warning-tint);
  border: 1px solid var(--warning);
  border-radius: 4px;
  padding: 5px 7px;
  margin: 4px 0 2px;
}
/* NO line-clamp, NO overflow:hidden, and it must stay that way. */
.vega-draft-text {
  font: 400 12px/1.5 var(--font-sans);
  color: var(--text-secondary);
  margin: 0;
  white-space: pre-wrap;
}
/* Vega's suggested handling, drafted alongside the objection.
   Spec: docs/specs/2026-08-18-draft-time-objection-handling.md.
   Indented and rule-marked so it reads as a nested response to the objection
   above it rather than more of the objection — the practitioner is about to
   decide whether to make these words their own, and must be able to see where
   Vega's proposal starts.
   ⛔ NO line-clamp and NO max-height here either: the adopt button commits
   exactly this text, so anything hidden would break the read-before-you-accept
   guarantee this whole surface exists to keep. */
.vega-draft-handling {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0 2px;
  padding-left: 8px;
  border-left: 2px solid var(--border-subtle, #e5e7eb);
}
.vega-draft-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
  /* Three buttons fit where two did; wrap rather than overflow the rail. */
  flex-wrap: wrap;
}
/* The reject-reason form, revealed inline under the draft it belongs to.
   Inline rather than a modal on purpose: a modal would cover the objection
   you are reacting to, which is the one thing you need in view while you
   say why you are rejecting it. Replaced a window.prompt() on 2026-08-12. */
.vega-draft-reject-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* ───────────────────────────────────────────────────────────
   Stage 3.5 Tier 5 spec 3 — Advisory panel + modal + reading view
   Spec: docs/specs/2026-05-23-stage-3-5-tier-5-advisory-artifact-persistence.md
   ─────────────────────────────────────────────────────────── */
.vs-advisory-panel {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 10px;
  background: var(--surface-panel, #ffffff);
  display: flex; flex-direction: column;
  gap: 12px;
}
.vs-advisory-loading {
  margin-top: 24px;
  padding: 16px;
  font-size: 12px;
  color: var(--text-tertiary, #6b7280);
}
.vs-advisory-head {
  display: flex; flex-direction: column;
  gap: 4px;
}
.vs-advisory-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary, #6b7280);
}
.vs-advisory-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}
.vs-advisory-sub {
  font-size: 12px;
  color: var(--text-secondary, #4b5563);
}
.vs-advisory-list {
  display: flex; flex-direction: column;
  gap: 8px;
}
.vs-advisory-row {
  text-align: left;
  background: var(--surface-raised, #f9fafb);
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex; flex-direction: column;
  gap: 4px;
  transition: background-color 160ms ease;
}
.vs-advisory-row:hover { background: #f3f4f6; }
.vs-advisory-row-headline {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}
.vs-advisory-row-snippet {
  font-size: 12px;
  color: var(--text-secondary, #4b5563);
  line-height: 1.4;
}
.vs-advisory-row-meta {
  font-size: 11px;
  color: var(--text-tertiary, #6b7280);
}
.vs-advisory-actions {
  display: flex; gap: 8px;
  margin-top: 4px;
}

/* Modal */
.vs-advisory-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.vs-advisory-modal {
  width: 100%; max-width: 560px;
  max-height: 90vh;
  background: var(--surface-panel, #ffffff);
  border-radius: 10px;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  overflow: hidden;
}
.vs-advisory-modal-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-default, #e5e7eb);
  display: flex; align-items: center; justify-content: space-between;
}
.vs-advisory-modal-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}
.vs-advisory-modal-body {
  padding: 18px;
  overflow-y: auto;
  display: flex; flex-direction: column;
  gap: 16px;
}
.vs-advisory-modal-row {
  display: flex; flex-direction: column;
  gap: 6px;
}
.vs-advisory-modal-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary, #4b5563);
  letter-spacing: 0.02em;
}
.vs-advisory-modal-input {
  font-size: 13px;
  padding: 8px 10px;
  border: 1px solid var(--border-default, #d1d5db);
  border-radius: 6px;
  background: var(--surface-panel, #ffffff);
  font-family: inherit;
  color: var(--text-primary, #111827);
}
.vs-advisory-modal-input:focus { outline: 2px solid #2d5a4c; outline-offset: -1px; }
.vs-advisory-modal-radios {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.vs-advisory-modal-radio,
.vs-advisory-modal-checkbox {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-primary, #111827);
}
.vs-advisory-modal-checkbox span { display: flex; flex-direction: column; gap: 2px; }
.vs-advisory-modal-checkbox em {
  font-style: normal;
  font-size: 11px;
  color: var(--text-tertiary, #6b7280);
}
.vs-advisory-modal-checkboxes {
  display: flex; flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}
.vs-advisory-modal-empty {
  font-size: 12px;
  color: var(--text-tertiary, #6b7280);
  padding: 8px 10px;
}
.vs-advisory-modal-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--border-default, #e5e7eb);
  display: flex; justify-content: flex-end;
  gap: 8px;
}
.vs-advisory-modal-error {
  font-size: 12px;
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  padding: 8px 10px;
  border-radius: 6px;
}

/* Reading view */
.vs-advisory-reading-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 24px;
}
.vs-advisory-reading-card {
  width: 100%; max-width: 720px;
  max-height: 90vh;
  background: var(--surface-panel, #ffffff);
  border-radius: 10px;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.2);
  overflow: hidden;
}
.vs-advisory-reading-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-default, #e5e7eb);
  display: flex; align-items: center; justify-content: space-between;
}
.vs-advisory-reading-headline {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #111827);
}
.vs-advisory-reading-body {
  padding: 20px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary, #111827);
}

@media (prefers-reduced-motion: reduce) {
  .vs-advisory-row { transition: none; }
}

/* ───────────────────────────────────────────────────────────
   Stage 3.5 Tier 5 spec 5 — AE workspace panel + preparing badge
   (the first-visit map panel was deleted 2026-10-23, S5 (n))
   Spec: docs/specs/2026-05-23-stage-3-5-tier-5-ae-on-add-generation-pipeline.md
   ─────────────────────────────────────────────────────────── */

/* Preparing badge */
.vs-preparing-banner {
  margin: 12px 0;
  padding: 10px 14px;
  border: 1px solid var(--border-default, #e5e7eb);
  background: linear-gradient(0deg, rgba(45,90,76,0.06), rgba(45,90,76,0.04));
  border-radius: 8px;
  display: flex; flex-direction: column;
  gap: 6px;
}
.vs-preparing-banner-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-secondary, #4b5563);
}
.vs-preparing-pills {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.vs-preparing-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-raised, #f3f4f6);
  color: var(--text-tertiary, #6b7280);
  border: 1px solid var(--border-default, #e5e7eb);
}
.vs-preparing-pill.is-running {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.vs-preparing-pill.is-done {
  background: rgba(45, 90, 76, 0.12);
  color: #2d5a4c;
  border-color: rgba(45, 90, 76, 0.25);
}
.vs-preparing-pill.is-failed {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}

/* AE workspace panel */
.vs-ae-panel {
  margin-top: 24px;
  padding: 20px;
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 10px;
  background: var(--surface-panel, #ffffff);
  display: flex; flex-direction: column;
  gap: 12px;
}
.vs-ae-loading {
  margin-top: 24px; padding: 16px;
  font-size: 12px; color: var(--text-tertiary, #6b7280);
}
.vs-ae-head {
  display: flex; flex-direction: column; gap: 4px;
}
.vs-ae-eyebrow {
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-tertiary, #6b7280);
}
.vs-ae-title {
  font-size: 15px; font-weight: 600;
  color: var(--text-primary, #111827);
}
/* Stage I impl-3 (C7): read-only "backed by N facts" provenance chip. Light,
   never alarming — the empty state is muted, not a warning. */
.vs-ae-facts-chip {
  align-self: flex-start;
  margin-top: 2px;
  font-size: 10px;
  font-family: 'DM Mono', ui-monospace, monospace;
  letter-spacing: 0.02em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(45, 90, 76, 0.10);
  color: #2d5a4c;
  border: 1px solid rgba(45, 90, 76, 0.22);
}
.vs-ae-facts-chip.is-empty {
  background: var(--surface-raised, #f3f4f6);
  color: var(--text-tertiary, #6b7280);
  border-color: var(--border-default, #e5e7eb);
}
.vs-ae-hypo-list {
  display: flex; flex-direction: column; gap: 8px;
}
.vs-ae-hypo-row {
  border: 1px solid var(--border-default, #e5e7eb);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-raised, #f9fafb);
  display: flex; flex-direction: column; align-items: stretch;
  gap: 6px;
}
/* The hypothesis itself leads the card (practitioner review 2026-10-14). */
.vs-ae-hypo-statement {
  font-size: 13px; font-weight: 600; line-height: 1.4;
  color: var(--text-primary, #111827);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.vs-ae-hypo-statement.is-missing {
  font-weight: 400; font-style: italic;
  color: var(--text-tertiary, #6b7280);
}
.vs-ae-hypo-quote {
  margin: 0; padding-left: 10px;
  border-left: 2px solid var(--border-default, #e5e7eb);
  font-size: 12px; line-height: 1.45;
  color: var(--text-secondary, #4b5563);
}
.vs-ae-hypo-quote-by {
  font-style: normal;
  color: var(--text-tertiary, #6b7280);
}
.vs-ae-hypo-from {
  align-self: flex-start;
  font-size: 11px;
  color: var(--text-secondary, #4b5563);
  background: none; border: 0; padding: 0;
  text-decoration: underline; text-underline-offset: 2px;
  cursor: pointer;
}
.vs-ae-hypo-from.is-static { text-decoration: none; cursor: default; }
.vs-ae-hypo-context {
  font-size: 12px; line-height: 1.45;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--surface-base, #ffffff);
  border: 1px solid var(--border-default, #e5e7eb);
}
.vs-ae-hypo-context[hidden] { display: none; }
.vs-ae-hypo-context-line {
  margin: 0 0 4px;
  color: var(--text-tertiary, #6b7280);
}
.vs-ae-hypo-context-line.is-match {
  color: var(--text-primary, #111827);
  font-weight: 600;
}
.vs-ae-hypo-context-miss {
  margin: 0;
  color: var(--text-tertiary, #6b7280);
  font-style: italic;
}
.vs-ae-hypo-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.vs-ae-hypo-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.vs-ae-hypo-conf {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--surface-raised, #f3f4f6);
  color: var(--text-tertiary, #6b7280);
  border: 1px solid var(--border-default, #e5e7eb);
}
.vs-ae-hypo-conf.is-high {
  background: rgba(45, 90, 76, 0.12);
  color: #2d5a4c;
  border-color: rgba(45, 90, 76, 0.25);
}
.vs-ae-hypo-conf.is-low {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
/* Nobody rated it — muted grey text, not a pill that reads like a rating. */
.vs-ae-hypo-conf.is-unrated {
  background: transparent;
  border-color: transparent;
  padding-left: 0;
  color: var(--text-tertiary, #9ca3af);
}
.vs-ae-hypo-areas {
  font-size: 12px;
  color: var(--text-secondary, #4b5563);
}
.vs-ae-hypo-no-trace {
  font-size: 11px;
  color: var(--text-tertiary, #9ca3af);
}
.vs-ae-hypo-empty {
  font-size: 12px;
  color: var(--text-tertiary, #6b7280);
  padding: 8px 10px;
}
/* Coherence S5c — on a deal's Discover tab, the account's unlinked items sit
   under this sub-heading, after the deal's own. */
.vs-ae-hypo-subhead,
.vs-advisory-subhead {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary, #6b7280);
  margin: 10px 0 6px;
}
.vs-ae-actions {
  display: flex; gap: 8px;
  margin-top: 4px;
}

/* ── Drift-flag resolution modal ──────────────────────────────────────────────
   2026-07-14: this modal shipped with full markup (drift-flag-resolution-modal.js)
   but NO stylesheet, so its .dfr-* elements rendered unstyled at the bottom of
   <body> and read as "won't open." Styled here to match the .vs-modal token set. */
.dfr-backdrop {
  position: fixed; inset: 0;
  background: var(--surface-overlay);
  z-index: 1000;
}
.dfr-modal {
  position: fixed;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  display: flex; flex-direction: column;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}
.dfr-head { position: relative; padding: 20px 44px 16px 20px; border-bottom: 1px solid var(--border-subtle); }
.dfr-eyebrow {
  font-family: var(--font-mono, monospace);
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-tertiary); margin-bottom: 6px;
}
.dfr-title { font: 600 16px/1.35 var(--font-sans); color: var(--text-primary); margin: 0; }
.dfr-subtitle { font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; }
.dfr-reasoning { font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); margin: 8px 0 0; }
.dfr-source { font-size: 12px; margin-top: 8px; }
.dfr-source a { color: var(--brand-primary); text-decoration: none; }
.dfr-source a:hover { text-decoration: underline; }
.dfr-close {
  position: absolute; top: 12px; right: 12px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  color: var(--text-tertiary); font-size: 20px; line-height: 1;
  border-radius: var(--radius-md); cursor: pointer;
}
.dfr-close:hover { background: var(--surface-raised); color: var(--text-primary); }
.dfr-tabs { display: flex; gap: 4px; padding: 12px 20px 0; }
.dfr-tab {
  flex: 1; padding: 8px 10px;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md); cursor: pointer;
}
.dfr-tab:hover { border-color: var(--border-default); color: var(--text-primary); }
.dfr-tab[aria-selected="true"], .dfr-tab.is-active {
  color: var(--brand-primary);
  border-color: var(--brand-primary);
  background: color-mix(in srgb, var(--brand-primary) 8%, transparent);
}
.dfr-body, .dfr-body-confirmed, .dfr-body-dismissed, .dfr-body-monitoring {
  padding: 16px 20px; overflow-y: auto;
}
.dfr-field { margin-bottom: 14px; }
.dfr-field-label { display: block; font-size: 11px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.dfr-value, .dfr-reason {
  width: 100%; padding: 8px 10px;
  font: 400 13px var(--font-sans); color: var(--text-primary);
  background: var(--surface-raised);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
}
.dfr-reason { min-height: 64px; resize: vertical; }
.dfr-unit { font-size: 12px; color: var(--text-tertiary); margin-left: 6px; }
.dfr-help, .dfr-suggested-note { font-size: 11.5px; color: var(--text-tertiary); margin-top: 6px; }
.dfr-said-by { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.dfr-radio { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-primary); margin: 6px 0; cursor: pointer; }
/* The Inputs-tab field note, now a textarea that grows with its text (it carries a
   drift-confirmed figure's source sentence). Mirrors the input it replaced. */
textarea.bcv2-field-note {
  display: block; width: 100%; box-sizing: border-box; margin: 0; padding: 6px 10px;
  font: 400 13px/1.4 var(--font-sans); color: var(--text-primary); background: var(--surface-panel);
  border: 1px solid var(--border-subtle); border-radius: 4px; resize: vertical; field-sizing: content;
}
.dfr-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--border-subtle);
}

/* ───────────────────────────────────────────────────────
 * DOSSIER FACTS SURFACE (React migration W4-B)
 * Spec: docs/specs/2026-07-20-react-migration-w4b-facts-surface-impl.md
 * Locked treatment: docs/design/claude-design-bundle/previews/facts-surface.html
 * (owner-locked 2026-07-20). Transcription of the locked inline styles into
 * vs-fact-* classes — TOKENS ONLY, dark mode free via tokens (no
 * dark-specific rules). Rendered by FactsSurfaceIsland.tsx.
 * ─────────────────────────────────────────────────────── */
.vs-fact-surface { margin: 16px 0; }
.vs-fact-row {
  display: flex; flex-wrap: wrap; gap: 10px;
}
.vs-fact-row + .vs-fact-row { margin-top: 10px; }

/* One fact card (headline slot or additional fact). */
.vs-fact-card {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-width: 150px;
  flex: 1 1 150px;
  background: var(--surface-panel);
}
.vs-fact-card.is-expandable { cursor: pointer; }
.vs-fact-card.is-expandable:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}
/* Projected (L4 unpark): dashed border + italic value + ◇ marker. */
.vs-fact-card.is-projected { border-style: dashed; }
.vs-fact-card.is-projected .vs-fact-value em { font-style: italic; }
/* Expanded evidence detail: brand border, roomier padding. */
.vs-fact-card.is-expanded {
  border-color: var(--border-brand);
  padding: 14px 16px;
  cursor: default;
  flex-basis: 100%;
}

.vs-fact-label {
  font: 500 10px/1 var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.vs-fact-value {
  font: 600 18px/1.2 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.vs-fact-fy {
  font: 400 11px/1 var(--font-mono);
  color: var(--text-tertiary);
}

/* Provenance badge row — tier colors keyed by data-tier (state matrix). */
.vs-fact-badge-row { margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vs-fact-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font: 500 10px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.vs-fact-badge[data-tier="sec-filing"],
.vs-fact-badge[data-tier="verified"]      { color: var(--positive); }
.vs-fact-badge[data-tier="market-data"],
.vs-fact-badge[data-tier="sourced"],
.vs-fact-badge[data-tier="projected"]     { color: var(--text-secondary); }
.vs-fact-badge[data-tier="estimate"]      { color: var(--warning); }
.vs-fact-badge[data-tier="couldnt-verify"] { color: var(--negative); }
.vs-fact-badge[data-tier="confirmed"]     { color: var(--brand-primary); }
.vs-fact-badge[data-tier="gap"]           { color: var(--text-tertiary); }
/* Stale overlay — composes with any tier. */
.vs-fact-stale {
  display: inline-flex; align-items: center; gap: 4px;
  font: 500 10px/1 var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warning);
  cursor: help;
}

/* Sub-note (rejected raw figure · corrected-by-you · labeled gap reason). */
.vs-fact-note {
  font: 400 11px/1.4 var(--font-sans);
  color: var(--text-tertiary);
  margin-top: 6px;
}

/* Expanded evidence detail. */
.vs-fact-excerpt {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 2px solid var(--border-default);
  font: 400 12px/1.5 var(--font-sans);
  color: var(--text-secondary);
}
.vs-fact-evidence-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  font: 400 11px/1 var(--font-sans);
  margin-top: 10px;
}
.vs-fact-src-link {
  color: var(--brand-primary);
  text-decoration: underline;
}
.vs-fact-cite { color: var(--text-tertiary); }
.vs-fact-evidence-spacer { flex: 1; }
/* Failure posture (design brief: never silent) — visible error line. */
.vs-fact-error {
  font: 400 11px/1.4 var(--font-sans);
  color: var(--negative);
  margin-top: 8px;
}

/* Fact-sources footnote block. */
.vs-fact-sources { margin-top: 12px; }
/* Company website line (label definitions 2026-10-15) — CompanyWebsiteLine.tsx */
.vs-fact-website {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  margin-top: 12px; font: 400 12px/1.5 var(--font-sans); color: var(--text-secondary);
}
.vs-fact-website-label {
  font: 500 10px/1 var(--font-sans); text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary);
}
.vs-fact-website-value, .vs-fact-website-edit { display: inline-flex; align-items: center; gap: 8px; color: var(--text-primary); }
.vs-fact-website-edit .vs-input { width: 200px; }
.vs-fact-website-hint { flex-basis: 100%; color: var(--text-tertiary); font-size: 11px; }
.vs-fact-website-error { flex-basis: 100%; color: var(--negative); font-size: 11px; }
.vs-fact-sources-head {
  font: 500 10px/1 var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-tertiary);
  margin-bottom: 6px;
}
.vs-fact-source-item {
  font: 400 11px/1.5 var(--font-mono);
  color: var(--text-secondary);
  word-break: break-all;
}
.vs-fact-source-item a { color: var(--text-secondary); }
.vs-fact-source-item a:hover { color: var(--brand-primary); }
.vs-fact-source-num { color: var(--text-tertiary); margin-right: 4px; }
/* The row breaks anywhere (long URLs); the label must not — "Published by the
   company" split mid-word on production 2026-10-15. Whole, or on the next line. */
.vs-fact-source-tier {
  display: inline-block;
  white-space: nowrap;
  word-break: normal;
  color: var(--text-tertiary);
  font: 400 10px/1 var(--font-sans);
  margin-left: 6px;
}

/* ── BC Stress Test section ────────────────────────────────────────── */
.bcv2-stress { display: flex; flex-direction: column; gap: 16px; }
.bcv2-stress-head { margin-bottom: 4px; }
.bcv2-stress-title { margin: 0 0 4px; font-size: 18px; }
.bcv2-stress-subtitle { margin: 0; font-size: 13px; opacity: 0.75; max-width: 62ch; }
.bcv2-stress-empty {
  padding: 20px;
  border: 1px dashed var(--border-default);
  border-radius: 8px;
  font-size: 13px;
  opacity: 0.85;
}
.bcv2-stress-empty.is-error { border-color: var(--negative); opacity: 1; }
.bcv2-stress-card {
  border: 1px solid var(--border-default);
  border-radius: 8px;
  padding: 14px 16px;
  background: var(--surface-raised);
}
.bcv2-stress-card-head { margin-bottom: 10px; }
.bcv2-stress-card-title { font-size: 15px; font-weight: 600; }
.bcv2-stress-card-sub { font-size: 12px; font-family: var(--font-mono); opacity: 0.8; margin-top: 2px; }
.bcv2-stress-card-counts { font-size: 12px; opacity: 0.7; margin-top: 4px; }

/* ── BC deal-level pushback (sits above the number cards) ──────────── */
.bcv2-pushback {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-panel);
}
.bcv2-pushback-head { display: flex; flex-direction: column; gap: var(--space-1); }
.bcv2-pushback-title { margin: 0; font: 500 16px/1.3 var(--font-sans); color: var(--text-primary); }
.bcv2-pushback-hint {
  margin: 0;
  font: 400 13px/1.5 var(--font-sans);
  color: var(--text-secondary);
  max-width: 68ch;
}
.bcv2-pushback-form { display: flex; flex-direction: column; gap: var(--space-2); }
.bcv2-pushback-form-row {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}
.bcv2-pushback-textarea,
.bcv2-pushback-input {
  font: 400 13px/1.5 var(--font-sans);
  color: var(--text-primary);
  background: var(--surface-base);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  width: 100%;
  transition: border-color var(--duration-fast) var(--ease-standard);
}
.bcv2-pushback-textarea { resize: vertical; }
.bcv2-pushback-input { flex: 1 1 220px; width: auto; min-width: 0; }
.bcv2-pushback-textarea:focus,
.bcv2-pushback-input:focus { outline: none; border-color: var(--border-focus); }
.bcv2-pushback-textarea:disabled,
.bcv2-pushback-input:disabled { color: var(--text-disabled); }
.bcv2-pushback-submit {
  font: 500 13px/1 var(--font-sans);
  color: var(--text-on-brand);
  background: var(--brand-primary);
  border: 1px solid var(--brand-primary);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-4);
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}
.bcv2-pushback-submit:hover:not(:disabled) { background: var(--brand-primary-hover); }
.bcv2-pushback-submit:disabled { opacity: 0.45; cursor: default; }
.bcv2-pushback-secondary {
  font: 500 12px/1 var(--font-sans);
  color: var(--text-accent);
  background: transparent;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  cursor: pointer;
  align-self: flex-start;
}
.bcv2-pushback-secondary:hover { border-color: var(--border-brand); }
.bcv2-pushback-note { font: 400 12px/1.4 var(--font-sans); color: var(--text-tertiary); }
.bcv2-pushback-note.is-bad { color: var(--negative); }
/* Out of band INFORMS, it does not block — a caution tone, never the negative
   tone used for "nothing was saved". A customer's own figure is allowed to beat
   an authored benchmark. */
.bcv2-pushback-note.is-warn { color: var(--warning); }
/* The two-step apply. Sits inside .bcv2-pushback-adjust, which is already a
   column, so this only needs its own spacing and alignment. */
.bcv2-pushback-apply-confirm {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  padding-top: var(--space-2);
}
.bcv2-pushback-empty {
  font: 400 13px/1.5 var(--font-sans);
  color: var(--text-secondary);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-4);
}
.bcv2-pushback-list { display: flex; flex-direction: column; gap: var(--space-3); }
.bcv2-pushback-entry {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  padding: var(--space-4);
}
.bcv2-pushback-entry-head {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  flex-wrap: wrap;
}
.bcv2-pushback-chip {
  font: 500 11px/1 var(--font-sans);
  border-radius: var(--radius-sm);
  padding: var(--space-1) var(--space-2);
  background: var(--surface-dim);
  color: var(--text-secondary);
}
.bcv2-pushback-chip.is-good { background: var(--positive-tint); color: var(--positive); }
.bcv2-pushback-chip.is-warn { background: var(--warning-tint); color: var(--warning); }
.bcv2-pushback-chip.is-bad { background: var(--negative-tint); color: var(--negative); }
.bcv2-pushback-chip.is-unknown { background: var(--surface-dim); color: var(--text-tertiary); }
.bcv2-pushback-role { font: 400 12px/1 var(--font-sans); color: var(--text-tertiary); }
.bcv2-pushback-quote {
  margin: 0;
  padding-left: var(--space-3);
  border-left: 2px solid var(--border-strong);
  font: 400 14px/1.5 var(--font-sans);
  color: var(--text-primary);
}
.bcv2-pushback-reason { margin: 0; font: 400 13px/1.5 var(--font-sans); color: var(--text-secondary); }
.bcv2-pushback-affected { font: 400 12px/1.4 var(--font-sans); color: var(--text-tertiary); }

/* "Same objection as…" — an ACTION control, not a stored field. Sized like the
   other row meta so it reads as one of them rather than as a form. */
.bcv2-pushback-thread {
  display: flex; align-items: center; gap: 6px;
  font: 400 12px/1.4 var(--font-sans); color: var(--text-tertiary);
}
.bcv2-pushback-thread select {
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-secondary);
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 6px;
  max-width: 320px;
}
/* The objection KIND — shown and correctable, 2026-09-18. Sized like the other
   row meta (and like .bcv2-pushback-thread) so it reads as part of the line
   rather than as a form the practitioner is obliged to fill in. */
.bcv2-pushback-kind {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font: 400 12px/1.4 var(--font-sans); color: var(--text-tertiary);
}
.bcv2-pushback-kind select {
  font: 400 12px/1.4 var(--font-sans);
  color: var(--text-secondary);
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: 4px;
  padding: 2px 6px;
  max-width: 220px;
}
.bcv2-pushback-kind select:disabled { color: var(--text-disabled); }

.bcv2-pushback-counter,
.bcv2-pushback-unanalyzed { display: flex; flex-direction: column; gap: var(--space-1); }
.bcv2-pushback-field-label {
  font: 500 12px/1.3 var(--font-sans);
  color: var(--text-secondary);
  display: block;
}
.bcv2-pushback-adjust {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  border-top: 1px solid var(--border-subtle);
  padding-top: var(--space-2);
  font: 400 13px/1.5 var(--font-sans);
  color: var(--text-secondary);
}

/* ── Demo-prep panel (spec 2026-09-17-demo-prep-surface) ─────────────────
   Wrapper reuses .od-curation-panel / -summary / -body so the two panels on
   the map view read as siblings. Everything below is the panel's own. */
.vs-demo-prep-body { display: flex; flex-direction: column; gap: 16px; padding: 16px 18px 20px; }
.vs-demo-prep-group { display: flex; flex-direction: column; gap: 6px; }
.vs-demo-prep-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 12px; border: 1px solid var(--border-default, #e5e7eb); border-radius: 8px;
  background: var(--surface-raised, #f9fafb);
}
.vs-demo-prep-row.is-open { border-color: #2d5a4c; }
.vs-demo-prep-row.is-superseded, .vs-demo-prep-row.is-archived { opacity: 0.6; }
.vs-demo-prep-row-meta { font-size: 12px; color: var(--text-secondary, #4b5563); }
.vs-demo-prep-form { display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border-default, #e5e7eb); }
.vs-demo-prep-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-demo-prep-pill {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border-default, #e5e7eb); background: var(--surface-panel, #fff); color: var(--text-secondary, #4b5563);
}
.vs-demo-prep-pill.is-active { background: rgba(45, 90, 76, 0.12); color: #2d5a4c; border-color: rgba(45, 90, 76, 0.25); }
.vs-demo-prep-form select, .vs-demo-prep-form textarea, .vs-demo-plan-edit select, .vs-demo-plan-edit textarea, .vs-demo-plan-edit input {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 13px; padding: 6px 8px;
  border: 1px solid var(--border-default, #e5e7eb); border-radius: 6px; background: var(--surface-panel, #fff); color: var(--text-primary, #111827);
}
.vs-demo-plan { display: flex; flex-direction: column; gap: 14px; padding-top: 14px; border-top: 1px solid var(--border-default, #e5e7eb); }
.vs-demo-plan-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.vs-demo-plan-title { font-size: 15px; font-weight: 600; color: var(--text-primary, #111827); display: flex; align-items: center; gap: 8px; }
.vs-demo-plan-status { font-size: 10px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border-default, #e5e7eb); color: var(--text-tertiary, #6b7280); background: var(--surface-raised, #f3f4f6); font-weight: 500; }
.vs-demo-plan-meta { font-size: 12px; color: var(--text-tertiary, #6b7280); }
/* Flow S4-3: why a plan was rebuilt, and the offer on an edited plan the record has moved past. Full row. */
.vs-demo-plan-rebuilt { flex-basis: 100%; }
.vs-demo-plan-record-changed { flex-basis: 100%; font-size: 12px; color: var(--text-secondary); background: var(--warning-tint); border: 1px solid var(--warning); border-radius: 6px; padding: 8px 10px; }
.vs-demo-plan-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }
.vs-demo-plan-close { margin-left: 4px; }
.vs-demo-plan-error { font-size: 12px; color: #92400e; background: #fef3c7; border: 1px solid #fde68a; border-radius: 6px; padding: 8px 10px; }
.vs-demo-plan-section { display: flex; flex-direction: column; gap: 8px; }
.vs-demo-plan-label { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; color: var(--text-tertiary, #6b7280); display: flex; flex-direction: column; gap: 4px; }
.vs-demo-plan-sublabel { font-size: 11px; color: var(--text-tertiary, #6b7280); display: flex; flex-direction: column; gap: 4px; }
.vs-demo-plan-eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; color: #2d5a4c; }
.vs-demo-plan-rests { white-space: pre-wrap; font-family: 'DM Mono', ui-monospace, monospace; font-size: 12px; line-height: 1.5; margin: 0; padding: 12px; border-radius: 8px; background: rgba(45, 90, 76, 0.06); border: 1px solid rgba(45, 90, 76, 0.18); color: var(--text-primary, #111827); }
.vs-demo-plan-rests.is-absent { background: var(--surface-raised, #f3f4f6); border-color: var(--border-default, #e5e7eb); color: var(--text-secondary, #4b5563); }
.vs-demo-plan-muted { font-size: 12px; color: var(--text-tertiary, #6b7280); }
.vs-demo-plan-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-demo-plan-chip { font-size: 11px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-default, #e5e7eb); background: var(--surface-raised, #f9fafb); color: var(--text-secondary, #4b5563); }
.vs-demo-plan-segment { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border-default, #e5e7eb); border-radius: 8px; background: var(--surface-panel, #fff); }
.vs-demo-plan-segment-title { font-size: 14px; font-weight: 600; color: var(--text-primary, #111827); }
.vs-demo-plan-beats { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; color: var(--text-primary, #111827); display: flex; flex-direction: column; gap: 4px; }
.vs-demo-plan-framing { font-size: 12px; color: var(--text-secondary, #4b5563); display: flex; flex-direction: column; gap: 3px; padding-top: 4px; }
.vs-demo-plan-objection { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-left: 3px solid #d97706; background: var(--surface-raised, #f9fafb); border-radius: 0 8px 8px 0; }
.vs-demo-plan-objection-q { font-size: 13px; font-weight: 600; color: var(--text-primary, #111827); }
.vs-demo-plan-objection-a { font-size: 13px; line-height: 1.5; color: var(--text-secondary, #4b5563); }
.vs-demo-plan-edit { display: flex; flex-direction: column; gap: 12px; }
.vs-demo-plan-edit-row { display: flex; gap: 12px; }
.vs-demo-plan-edit-row > label { flex: 1; }
.vs-demo-plan-segment.is-editing, .vs-demo-plan-objection.is-editing { gap: 8px; }

/* ── Demo outcome (post-demo capture) ─────────────────────────────────── */
.vs-demo-outcome { padding: 12px; border: 1px solid rgba(45, 90, 76, 0.25); border-radius: 8px; background: rgba(45, 90, 76, 0.04); }
.vs-demo-outcome-meta { font-size: 12px; color: var(--text-secondary, #4b5563); }
.vs-demo-outcome-nudge { font-size: 12px; color: #92400e; }
.vs-demo-outcome-form, .vs-demo-outcome-questions, .vs-demo-outcome-scored { display: flex; flex-direction: column; gap: 10px; }
.vs-demo-outcome-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vs-demo-outcome-about { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; color: #2d5a4c; }
.vs-demo-outcome textarea, .vs-demo-outcome input[type="text"], .vs-demo-outcome input[type="date"], .vs-demo-outcome select {
  font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--border-default, #e5e7eb); border-radius: 6px; background: var(--surface-panel, #fff); color: var(--text-primary, #111827); width: 100%; box-sizing: border-box;
}
.vs-demo-outcome-overall { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.vs-demo-outcome-score { font-size: 28px; font-weight: 700; color: #2d5a4c; font-variant-numeric: tabular-nums; }
.vs-demo-outcome-line { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border: 1px solid var(--border-default, #e5e7eb); border-radius: 6px; background: var(--surface-panel, #fff); font-size: 13px; }
.vs-demo-outcome-line-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vs-demo-outcome-line-head select { width: auto; }
.vs-demo-outcome-rests { font-size: 11px; color: var(--text-tertiary, #6b7280); font-style: italic; }
.vs-demo-outcome-chip { font-size: 10px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--border-default, #e5e7eb); background: var(--surface-raised, #f3f4f6); color: var(--text-tertiary, #6b7280); font-weight: 500; }
.vs-demo-outcome-chip.is-landed { color: #166534; background: #dcfce7; border-color: #bbf7d0; }
.vs-demo-outcome-chip.is-partial { color: #92400e; background: #fef3c7; border-color: #fde68a; }
.vs-demo-outcome-chip.is-fell_flat { color: #991b1b; background: #fee2e2; border-color: #fecaca; }

/* ── demo plan compare + predicted landing (2026-09-18, spec 2026-09-18-demo-plan-compare) ── */
.vs-demo-assess { padding: 12px; border: 1px solid rgba(45, 90, 76, 0.25); border-radius: 8px; background: rgba(45, 90, 76, 0.04); display: flex; flex-direction: column; gap: 10px; }
.vs-demo-assess.is-stale { border-style: dashed; }
.vs-demo-assess-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.vs-demo-assess-replaced { font-size: 12px; color: #92400e; }
.vs-demo-outcome-chip.is-unknown { color: var(--text-tertiary, #6b7280); }
.vs-demo-compare-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; margin-bottom: 8px; }
.vs-demo-compare-row > * { min-width: 0; }
.vs-demo-compare-head { display: flex; flex-direction: column; gap: 2px; }
.vs-demo-compare-realized { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.vs-demo-compare-only { font-size: 11px; color: var(--text-tertiary, #6b7280); font-style: italic; padding: 6px 0; }
.vs-demo-compare-item { font-size: 13px; padding: 4px 0; }
.vs-demo-compare-chips { display: inline-flex; gap: 4px; margin-left: 6px; }
.vs-demo-plan-compare-select { font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--border-default, #e5e7eb); border-radius: 6px; background: var(--surface-panel, #fff); color: var(--text-primary, #111827); max-width: 260px; }
@media (max-width: 900px) { .vs-demo-compare-row { grid-template-columns: 1fr; } }

/* Typed pushback (phase 3). Reasoning: DemoPushbackView.tsx. Chip reuses
   .vs-demo-outcome-chip; is-none = not judged, dashed not coloured. */
.vs-demo-outcome-chip.is-holds{color:#166534;background:#dcfce7;border-color:#bbf7d0}
.vs-demo-outcome-chip.is-vulnerable{color:#92400e;background:#fef3c7;border-color:#fde68a}
.vs-demo-outcome-chip.is-fails{color:#991b1b;background:#fee2e2;border-color:#fecaca}
.vs-demo-outcome-chip.is-undetermined{color:#3730a3;background:#e0e7ff;border-color:#c7d2fe}
.vs-demo-outcome-chip.is-none{border-style:dashed;background:transparent}
.vs-demo-pushback{border-top:1px solid var(--border-subtle,#f3f4f6);padding-top:12px}
.vs-demo-pushback-row{border:1px solid var(--border-subtle,#f3f4f6);border-radius:8px;padding:10px 12px;margin-bottom:8px}
.vs-demo-pushback-add,.vs-demo-pushback-actions,.vs-demo-plan-objection-actions,.vs-demo-pushback-verdict-head{display:flex;gap:6px;align-items:center;flex-wrap:wrap;margin-top:6px}
.vs-demo-pushback-add{align-items:flex-start}
.vs-demo-pushback-why,.vs-demo-pushback-input{width:100%;flex:1;min-width:0;font:inherit;font-size:12px;line-height:1.5;color:var(--text-secondary,#374151);background:var(--surface-raised,#f9fafb);border:1px solid var(--border-subtle,#f3f4f6);border-radius:6px;padding:6px 8px;resize:vertical;margin:4px 0}
.vs-demo-pushback-threats,.vs-demo-pushback-notes{margin:6px 0;padding-left:18px;font-size:12px;color:var(--text-secondary,#374151)}
.vs-demo-pushback-stale{font-size:10px;color:#92400e;background:#fef3c7;border:1px solid #fde68a;border-radius:999px;padding:2px 7px}
.vs-demo-compare-verdict,.vs-demo-compare-pushback-q{font-size:12px;margin:6px 0 4px}

/* -- "Pushback you've already met here" (spec 2026-09-18-objection-ledger-phase-4)
   Wrapper reuses .od-curation-panel / -summary / -body so the three panels on
   the map view read as siblings. KI #57: every preview inlines this file, so
   the panel reuses .btn / .vs-demo-plan-error rather than declaring its own. */
.vs-obj-prep-body { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 20px; }
.vs-obj-prep-item { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border-default, #e5e7eb); border-radius: 8px; background: var(--surface-raised, #f9fafb); }
.vs-obj-prep-item.is-raised { border-left: 3px solid #2d5a4c; }
.vs-obj-prep-text { font-size: 13px; font-weight: 600; color: var(--text-primary, #111827); }
.vs-obj-prep-eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 0.02em; color: #2d5a4c; }
.vs-obj-prep-appearances { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.vs-obj-prep-appearance { display: flex; flex-direction: column; gap: 4px; padding: 8px 10px; border-left: 2px solid var(--border-default, #e5e7eb); }
.vs-obj-prep-appearance.is-raised { border-left-color: #2d5a4c; }
.vs-obj-prep-standing { font-size: 12px; color: var(--text-secondary, #4b5563); }
.vs-obj-prep-facts { display: flex; flex-wrap: wrap; gap: 6px; }
.vs-obj-prep-chip { font-size: 10px; padding: 2px 7px; border-radius: 999px; border: 1px solid rgba(45, 90, 76, 0.25); background: rgba(45, 90, 76, 0.1); color: #2d5a4c; font-weight: 500; }
.vs-obj-prep-chip.is-quiet { border-color: var(--border-default, #e5e7eb); background: var(--surface-panel, #fff); color: var(--text-tertiary, #6b7280); }
.vs-obj-prep-said { font-size: 12px; font-style: italic; color: var(--text-secondary, #4b5563); }
.vs-obj-prep-responses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-secondary, #4b5563); }
.vs-obj-prep-muted { font-size: 12px; color: var(--text-tertiary, #6b7280); }
.vs-obj-prep-bad { font-size: 11px; color: #92400e; }
.vs-obj-prep-outcome { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; color: var(--text-tertiary, #6b7280); }
.vs-obj-prep-outcome select { font: inherit; font-size: 12px; padding: 3px 6px; border: 1px solid var(--border-default, #e5e7eb); border-radius: 6px; background: var(--surface-panel, #fff); color: var(--text-primary, #111827); }

/* Coherence S0 (2026-10-20): Admin is shown only to the platform owner.
   public/app.js sets body[data-platform-owner] from GET /api/data's
   is_platform_owner (the server's requirePlatformOwnerCapabilityOr404).
   Absent attribute = hidden (fail closed). A UI hint only — every admin
   route still enforces the check itself. CSS, not a React conditional
   (hard rule #4). */
body:not([data-platform-owner="true"]) [data-admin-nav] { display: none; }

/* Coherence S0 item 9: a claim's lever code shown quietly beside its name. */
.vg-lever-code { font: 400 11px/1.3 var(--font-mono); color: var(--text-tertiary); margin-left: 4px; }

/* Account merge screen (merge smoke 2026-10-21). The first cut borrowed .vs-list-table (a
   display:grid list class) and .detail-meta (a flex chip row), so it rendered largely
   unstyled. Tokens only; two weights (400/500); sentence case. */
.vs-account-merge { max-width: 960px; display: flex; flex-direction: column; gap: var(--space-4); padding-bottom: var(--space-8); }
.vs-account-merge-lede { margin: 0; font: 400 13px/1.45 var(--font-sans); color: var(--text-secondary); max-width: 720px; }
.vs-account-merge-section { display: flex; flex-direction: column; gap: var(--space-3); }
.vs-account-merge-body { display: flex; flex-direction: column; gap: var(--space-5); }
.vs-account-merge-section-head { display: flex; flex-direction: column; gap: 2px; }
.vs-account-merge-eyebrow { font: 500 11px/1.25 var(--font-sans); letter-spacing: 0.02em; color: var(--text-tertiary); }
.vs-account-merge-heading { font: 500 15px/1.3 var(--font-sans); letter-spacing: -0.005em; color: var(--text-primary); }
.vs-account-merge-note { margin: 0; font: 400 12px/1.4 var(--font-sans); color: var(--text-secondary); }
.vs-account-merge-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Records: Keep | Merge in | Record, one card row per record, columns aligned by one track list. */
.vs-account-merge-records { display: flex; flex-direction: column; gap: var(--space-2); }
.vs-account-merge-records-head,
.vs-account-merge-record { display: grid; grid-template-columns: 64px 72px minmax(0, 1fr); align-items: center; column-gap: var(--space-3); }
.vs-account-merge-records-head { padding: 0 var(--space-3); font: 500 11px/1.25 var(--font-sans); color: var(--text-tertiary); }
.vs-account-merge-records-head > span:nth-child(-n+2) { text-align: center; }
.vs-account-merge-record {
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-panel);
}
.vs-account-merge-record.is-keep { border-color: var(--border-brand); box-shadow: inset 3px 0 0 0 var(--brand-primary); }
.vs-account-merge-record.is-merge-in { background: var(--surface-raised); }
.vs-account-merge-choice { display: flex; justify-content: center; }
.vs-account-merge-choice input[type="radio"],
.vs-account-merge-version-pick input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--brand-primary); cursor: pointer; }
.vs-account-merge-choice input[type="radio"]:disabled { cursor: not-allowed; opacity: 0.4; }
.vs-account-merge-record-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vs-account-merge-record-label { font: 500 11px/1.25 var(--font-sans); letter-spacing: 0.02em; color: var(--text-tertiary); }
.vs-account-merge-record-name { font: 500 13px/1.3 var(--font-sans); color: var(--text-primary); overflow-wrap: anywhere; }
.vs-account-merge-record-meta { font: 400 12px/1.4 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-secondary); }

.vs-account-merge-list { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font: 400 13px/1.45 var(--font-sans); color: var(--text-primary); }

/* A conflict: a card, the two versions side by side, aligned at the TOP. */
.vs-account-merge-conflict {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-3);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--surface-panel);
}
.vs-account-merge-conflict-title { font: 500 13px/1.3 var(--font-sans); color: var(--text-primary); }
.vs-account-merge-versions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.vs-account-merge-version {
  display: flex; flex-direction: column; gap: 4px;
  padding: var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: var(--surface-base);
  min-width: 0;
}
.vs-account-merge-version.is-chosen { border-color: var(--border-brand); background: var(--brand-primary-fade); }
.vs-account-merge-version-pick { display: flex; align-items: center; gap: var(--space-2); font: 500 12px/1.3 var(--font-sans); color: var(--text-primary); }
.vs-account-merge-version-pick label { cursor: pointer; }
.vs-account-merge-version-line { font: 400 12px/1.4 var(--font-sans); color: var(--text-secondary); overflow-wrap: anywhere; }
@media (max-width: 720px) { .vs-account-merge-versions { grid-template-columns: minmax(0, 1fr); } }

.vs-account-merge-actions { display: flex; align-items: center; gap: var(--space-2); padding-top: var(--space-2); }
.vs-account-merge-reason { font: 400 12px/1.4 var(--font-sans); color: var(--text-secondary); }

/* The kept account's banner: the sentence, then what moved, on a second line. */
.vs-account-merge-banner-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.vs-account-merge-banner-moved { font-size: 12px; color: var(--text-secondary); }

/* ValueSight's own notices inside a rendered document (public/modules/utils.js renderMarkdown,
   plan 3D 2026-10-27): the figure check and the invented-marker notice. A callout, not body text. */
.vs-md-notice {
  margin: var(--space-3) 0;
  padding: var(--space-2) var(--space-3);
  background: var(--warning-tint);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-style: normal;
}
/* 2026-11-01 — optional range + "what backs this" on the benchmark capture (spec range-edit-with-evidence). */
.vega-e-bench-capture-kind { flex-wrap: wrap; }
.vega-e-bench-capture-kind-q { width: 100%; font: 500 10px/1.4 var(--font-sans); color: var(--text-secondary); }
.vega-e-bench-capture-range { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; margin-top: 4px; }
.vega-e-bench-capture-range[hidden] { display: none; }
.vega-e-bench-capture-range .vega-e-bench-capture-note { grid-column: 1 / -1; }
