/* THEME: the only file that holds colors, fonts, sizes and radii. Edit the tokens below to restyle the whole app.
   Everything after the tokens uses var(--...) only. The palette is the analyst viewer's light palette (slate + blue). */
:root {
  color-scheme: light;
  --font-body: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, Menlo, monospace;
  --text-base: 14px;
  --text-small: 12px;
  --text-big: 28px;
  --text-title: 24px;

  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --accent: #0a192f;            /* COMPASS primary navy */
  --accent-strong: #1e293b;
  --accent-active: #020617;
  --accent-contrast: #ffffff;
  --scrim: rgba(10, 25, 47, 0.5);   /* the dimmed page behind a guide spotlight */
  --accent-soft: rgba(10, 25, 47, 0.08);
  --teal: #0d9488;              /* COMPASS governed teal: verified, selected, approved */
  --teal-strong: #0f766e;
  --teal-soft: #f0fdfa;
  --teal-border: #5eead4;
  /* provenance tags */
  --tag-observed: #166534;     --tag-observed-bg: #f0fdf4;     --tag-observed-border: #86efac;
  --tag-published: #0f766e;    --tag-published-bg: #f0fdfa;    --tag-published-border: #5eead4;
  --tag-assumption: #b45309;   --tag-assumption-bg: #fffbeb;   --tag-assumption-border: #fcd34d;
  --tag-llm_proposed: #be123c; --tag-llm_proposed-bg: #fff1f2; --tag-llm_proposed-border: #fecdd3;
  /* diagram */
  --node-fill: #ffffff;
  --node-lit: #f0fdfa;
  --node-stroke: #cbd5e1;
  --node-lit-stroke: #0d9488;
  --edge: #94a3b8;
  --chip-bg: #f1f5f9;

  /* chart series */
  --series-baseline: #94a3b8;
  --series-s0: #64748b;  --series-s1: #0a192f;  --series-s2: #0d9488;  --series-s3: #d97706;  /* scenario comparison: the status quo, then each option */
  --series-scenario: var(--accent);
  --band: var(--accent-soft);
  --grid: #e2e8f0;
  --point-inside: #0369a1;
  --point-outside: #c2410c;

  /* Direction colors are deliberately neutral: the data does not say whether "up" is good for an outcome. */
  --dir-up: #0f766e;
  --dir-down: #b45309;
  --dir-flat: var(--text-muted);
  --ok: #065f46;
  --ok-soft: #d1fae5;
  --warn: #92400e;
  --warn-soft: #fef3c7;

  --text-strong: #334155;
  --text-faint: #64748b;
  --info: #075985;
  --info-soft: #e0f2fe;
  --info-border: #bae6fd;
  --ok-border: #a7f3d0;
  --warn-border: #fde68a;
  --bad-border: #fecaca;
  --metric: 22px;
  --bad: #991b1b;
  --bad-soft: #fee2e2;
  --code-bg: #0f172a;
  --code-text: #e2e8f0;

  --radius: 4px;
  --radius-small: 4px;
  --radius-large: 8px;
  --gap: 16px;
  --gutter: 16px;
  --shadow: none;                /* tier 1: containers have a border and no shadow */
  --hero-from: #0a192f;
  --hero-to: #0f172a;
  --hero-text: #ffffff;
  --shadow-lift: 0 8px 20px rgba(15, 23, 42, 0.10);   /* tier 3: popovers and tooltips only */
  --shadow-bar: 0 1px 3px 0 rgba(15, 23, 42, 0.04);   /* tier 2: sticky headers */
  --page-width: 1080px;
  --topbar-h: 58px;     /* the pinned top bar; the step sidebar sits right under it */
  --page-wide: 1440px;   /* the setup flow: wide enough for two columns on a large monitor */
}

/* Dark mode: the same tokens with dark values. The main buttons turn light so they stay visible on the dark canvas. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1220;
  --surface: #111a2e;
  --text: #e2e8f0;
  --text-muted: #a3b1c6;
  --text-strong: #cbd5e1;
  --text-faint: #8493ab;
  --border: #1e2b44;
  --border-strong: #2d3d5c;
  --chip-bg: #16213a;
  --accent: #e2e8f0;
  --accent-strong: #cbd5e1;
  --accent-active: #94a3b8;
  --accent-contrast: #0a192f;
  --scrim: rgba(0, 0, 0, 0.6);
  --accent-soft: rgba(226, 232, 240, 0.10);
  --teal: #0d9488;
  --teal-strong: #14b8a6;
  --teal-soft: rgba(13, 148, 136, 0.16);
  --teal-border: #115e59;
  --tag-observed: #86efac;     --tag-observed-bg: rgba(34, 197, 94, 0.12);     --tag-observed-border: #166534;
  --tag-published: #5eead4;    --tag-published-bg: rgba(20, 184, 166, 0.12);   --tag-published-border: #115e59;
  --tag-assumption: #fcd34d;   --tag-assumption-bg: rgba(245, 158, 11, 0.12);  --tag-assumption-border: #92400e;
  --tag-llm_proposed: #fda4af; --tag-llm_proposed-bg: rgba(244, 63, 94, 0.12); --tag-llm_proposed-border: #9f1239;
  --node-fill: #16213a;
  --node-lit: rgba(13, 148, 136, 0.18);
  --node-stroke: #3b4d6e;
  --node-lit-stroke: #2dd4bf;
  --edge: #64748b;
  --series-baseline: #64748b;
  --series-s0: #94a3b8;  --series-s1: #e2e8f0;  --series-s2: #2dd4bf;  --series-s3: #fbbf24;
  --grid: #1e2b44;
  --point-inside: #38bdf8;
  --point-outside: #fb923c;
  --dir-up: #2dd4bf;
  --dir-down: #fbbf24;
  --ok: #6ee7b7;      --ok-soft: rgba(16, 185, 129, 0.15);   --ok-border: #065f46;
  --warn: #fcd34d;    --warn-soft: rgba(245, 158, 11, 0.14); --warn-border: #92400e;
  --bad: #fca5a5;     --bad-soft: rgba(239, 68, 68, 0.15);   --bad-border: #991b1b;
  --info: #7dd3fc;    --info-soft: rgba(14, 165, 233, 0.14); --info-border: #075985;
  --code-bg: #020617;
  --code-text: #e2e8f0;
  --hero-from: #15294a;
  --hero-to: #0f1d36;
  --shadow-lift: 0 8px 20px rgba(0, 0, 0, 0.4);
  --shadow-bar: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
h1, h2, h3, p { margin: 0; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
a.btn { display: inline-flex; align-items: center; align-self: flex-start; text-decoration: none; }
.muted { color: var(--text-muted); }
.small { font-size: var(--text-small); }
.mono { font-family: var(--font-mono); }

/* ---------- header, sidebar, shell ---------- */
.topbar { position: sticky; top: 0; z-index: 20; min-height: var(--topbar-h); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 24px; background: var(--surface); border-bottom: 1px solid var(--border-strong); box-shadow: var(--shadow-bar); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { display: inline-flex; align-items: center; padding: 4px 10px; border-radius: var(--radius); background: var(--hero-from); }  /* the logo has white lettering, so it sits on the navy surface in both themes */
.brand-logo { display: block; height: 20px; width: auto; }
.brand-divider { width: 1px; height: 28px; background: var(--border-strong); }
.logo { width: 32px; height: 32px; border-radius: var(--radius); background: var(--text); color: var(--surface); display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; }
.title { font-size: 15px; font-weight: 700; }
.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 10px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; white-space: nowrap; }
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.shell { display: flex; flex-wrap: wrap; align-items: stretch; min-height: calc(100vh - var(--topbar-h)); }
.sidebar { flex: 1 1 250px; max-width: 260px; padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.side-title { font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); padding: 4px 12px; }
.side-foot { margin-top: auto; padding: 12px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.page { flex: 999 1 640px; min-width: 0; padding: 20px 28px 40px; display: flex; flex-direction: column; gap: var(--gap); }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field > span { font-size: var(--text-small); font-weight: 600; color: var(--text-muted); }
select, .btn {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-small);
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.btn:hover, select:hover { border-color: var(--accent); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-small); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--accent); }
.has-tip { position: relative; }
.has-tip:hover::after, .has-tip:focus-visible::after { content: attr(data-tip) "\A" attr(data-sub); position: absolute; top: calc(100% + 8px); right: 0; z-index: 60; width: max-content; max-width: 220px; padding: 6px 10px; border-radius: var(--radius); background: var(--hero-from); color: var(--hero-text); font-size: 12px; font-weight: 500; line-height: 1.4; text-align: left; white-space: pre-line; box-shadow: var(--shadow-lift); pointer-events: none; }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.guide-kicker { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--teal-strong); }
.coach { position: fixed; inset: 0; z-index: 50; overflow: hidden; pointer-events: none; }
.coach[hidden] { display: none; }
.coach-hole { position: absolute; border-radius: var(--radius-large); box-shadow: 0 0 0 9999px var(--scrim); }
.coach-hole::after { content: ""; position: absolute; inset: -3px; border: 3px solid var(--teal); border-radius: var(--radius-large); animation: coach-ring 1.6s ease-out infinite; }
.coach-bubble { position: absolute; width: 340px; max-width: calc(100vw - 24px); display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius-large); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lift); pointer-events: auto; }
.coach-pointer { position: absolute; width: 14px; height: 14px; background: var(--surface); border: 1px solid var(--border-strong); transform: rotate(45deg); }
.coach-pointer[hidden] { display: none; }
.coach-pointer.top { top: -8px; border-right: 0; border-bottom: 0; }
.coach-pointer.bottom { bottom: -8px; border-left: 0; border-top: 0; }
.coach-pointer.left { left: -8px; border-top: 0; border-right: 0; }
.coach-pointer.right { right: -8px; border-bottom: 0; border-left: 0; }
.coach-head { display: flex; align-items: center; justify-content: space-between; }
.coach-count { font-size: var(--text-small); color: var(--text-faint); }
.coach-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.coach-text { font-size: var(--text-base); color: var(--text-strong); }
.coach-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 4px; }
@keyframes coach-ring { 0% { opacity: 0.9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .coach-hole::after { animation: none; } }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-small); overflow: hidden; background: var(--surface); }
.segmented button {
  min-height: 40px; padding: 0 14px; border: 0; border-right: 1px solid var(--border);
  background: transparent; color: var(--text); font: inherit; cursor: pointer;
}
.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); font-weight: 600; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--gap); display: flex; flex-direction: column; gap: 12px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.card-title { font-size: 13px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.notice { padding: 10px 14px; border-radius: var(--radius-small); background: var(--warn-soft); color: var(--warn); font-size: var(--text-small); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.toast { position: fixed; right: var(--gutter); bottom: var(--gutter); padding: 10px 14px; border-radius: var(--radius-small); background: var(--accent); color: var(--accent-contrast); box-shadow: var(--shadow); }

/* ---------- impact cards ---------- */
.impact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.impact { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); }
.impact-name { font-size: var(--text-small); font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.impact-delta { font-size: 22px; font-weight: 650; font-family: var(--font-mono); display: flex; align-items: baseline; gap: 6px; }
.impact.up .impact-delta { color: var(--dir-up); }
.impact.down .impact-delta { color: var(--dir-down); }
.impact.flat .impact-delta { color: var(--dir-flat); }
.impact-sub { font-size: var(--text-small); color: var(--text-muted); }
.pill { align-self: flex-start; font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border); color: var(--text-muted); }
.pill.clear { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- explanation ---------- */
.explain { display: flex; flex-direction: column; gap: 8px; }
.explain p { max-width: 70ch; }

/* ---------- charts ---------- */
.chart-wrap { position: relative; overflow-x: auto; }
.stack-tight { display: flex; flex-direction: column; gap: 12px; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { fill: var(--text-muted); font-size: 11px; font-family: var(--font-body); }
.chart .axis-title { fill: var(--text-muted); font-size: 11px; }
.chart .band { fill: var(--band); stroke: none; }
.chart .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.baseline { stroke: var(--series-baseline); stroke-dasharray: 5 4; }
.chart .line.scenario { stroke: var(--series-scenario); }
.chart .guide { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot.baseline { fill: var(--series-baseline); }
.chart .dot.scenario { fill: var(--series-scenario); }
.chart .diagonal { stroke: var(--series-baseline); stroke-dasharray: 5 4; stroke-width: 1.5; }
.chart .pt { opacity: 0.8; }
.chart .pt.inside { fill: var(--point-inside); }
.chart .pt.outside { fill: var(--point-outside); }
.tooltip { position: absolute; pointer-events: none; transform: translate(-50%, -100%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-small); box-shadow: var(--shadow-lift); padding: 6px 10px; font-size: var(--text-small); white-space: nowrap; }
.tooltip .row { display: flex; gap: 8px; align-items: center; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch.baseline { background: var(--series-baseline); }
.swatch.scenario { background: var(--series-scenario); }
.swatch.inside { background: var(--point-inside); }
.swatch.outside { background: var(--point-outside); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: var(--text-small); color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- metric tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.tile { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.tile-label { font-size: var(--text-small); color: var(--text-muted); }
.tile-value { font-size: var(--text-big); font-weight: 650; font-family: var(--font-mono); }
.tile-value-small { font-size: var(--text-base); }
.hidden { display: none !important; }

/* ---------- stepper ---------- */
.stepper { display: flex; flex-direction: column; gap: 8px; }
.stepper-bar { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-bar); }
.step-count { font-family: var(--font-mono); font-size: var(--text-small); font-weight: 600; color: var(--accent); white-space: nowrap; }
.progress { flex: 1 1 160px; height: 6px; appearance: none; border: 0; border-radius: 2px; overflow: hidden; background: var(--border); }
.progress::-webkit-progress-bar { background: var(--border); }
.progress::-webkit-progress-value { background: var(--accent); }
.progress::-moz-progress-bar { background: var(--accent); }
.step-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.step-pill { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 4px 12px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.step-pill:hover:not(:disabled) { background: var(--chip-bg); }
.step-pill[aria-current="step"] { background: var(--accent-soft); box-shadow: inset 2px 0 0 var(--accent); font-weight: 600; }
.step-num { width: 18px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.stepnav { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.btn.primary { background: var(--accent); border-color: var(--accent-strong); color: var(--accent-contrast); font-weight: 600; }
.btn.primary:hover { background: var(--accent-strong); }
.lead { font-size: 16px; max-width: 70ch; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: var(--radius); background: var(--chip-bg); border: 1px solid var(--border); color: var(--text); font-family: var(--font-mono); font-size: var(--text-small); }

/* ---------- hero, options ---------- */
.hero { border-radius: var(--radius-large); padding: 18px 22px; color: var(--hero-text); background: var(--hero-from); display: flex; flex-direction: column; gap: 10px; }
.hero-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.85; }
.hero-text { font-size: 16px; font-weight: 600; line-height: 1.45; max-width: 70ch; }
.hero-sub { font-size: var(--text-small); opacity: 0.85; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--gap); }
.section-title { font-size: 14px; font-weight: 700; letter-spacing: 0.01em; }
.answer { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; border: 2px solid var(--info); border-radius: var(--radius-large); background: var(--surface); box-shadow: var(--shadow); }
.answer-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.answer-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--info); }
.answer-text { padding: 0; border: 0; background: none; text-align: left; font: inherit; font-size: 16px; font-weight: 600; line-height: 1.45; color: var(--text-strong); cursor: pointer; max-width: 70ch; }
.answer-note { font-size: var(--text-small); color: var(--text-muted); }
.link { padding: 0; border: 0; background: none; font: inherit; color: var(--info); cursor: pointer; text-decoration: underline; }
.option-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.option-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; padding: 16px 18px; border-top: 3px solid var(--border-strong); border-radius: var(--radius-large); border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; box-shadow: var(--shadow); transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease; }
.option-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); border-color: var(--accent); }
.option-name { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); }
.option-number { font-family: var(--font-mono); font-size: 32px; font-weight: 600; line-height: 1.1; color: var(--accent); }
.option-number.muted { font-family: var(--font-body); font-size: 16px; color: var(--text-muted); }
.option-what { font-size: var(--text-small); color: var(--text-muted); }
.option-cta { margin-top: auto; font-size: 12px; font-weight: 600; color: var(--accent); }
.spark { align-self: stretch; width: 100%; height: 44px; }
.spark-line { fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.spark-line.baseline { stroke: var(--series-baseline); stroke-dasharray: 4 3; }
.spark-line.scenario { stroke: var(--series-scenario); }

/* ---------- what changes ---------- */
.headline { font-size: 15px; font-weight: 600; line-height: 1.5; max-width: 72ch; }
.headline-block { display: flex; flex-direction: column; gap: 6px; }
.chart.bars { min-width: 560px; }
.bars .center { stroke: var(--border-strong); stroke-width: 1.5; }
.bars .hit { fill: transparent; }
.bars .row:hover .hit { fill: var(--accent-soft); }
.bars .bar-label { fill: var(--text); font-size: 13px; font-weight: 600; }
.bars .bar-sub { fill: var(--text-muted); font-size: 11px; }
.bars .bar-value { fill: var(--text); font-family: var(--font-mono); font-size: 16px; font-weight: 600; }
.bars .bar-none { fill: var(--text-muted); font-size: 12px; }
.bars .bar-pct { fill: var(--text-muted); font-size: 11px; }
.bars .bar { transform-box: fill-box; }
.bars .bar.pos { fill: var(--dir-up); transform-origin: left center; }
.bars .bar.neg { fill: var(--dir-down); transform-origin: right center; }
.bars .bar.unclear { opacity: 0.35; }
.bars.play .bar { animation: grow 0.7s ease-out both; }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- detail drawer and table ---------- */
.drawer { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.drawer > summary { padding: 12px 16px; cursor: pointer; font-weight: 600; color: var(--accent); }
.drawer-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: var(--gap); }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; min-width: 480px; }
.table th { padding: 8px 12px; text-align: left; font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-muted); background: var(--chip-bg); border-bottom: 2px solid var(--border-strong); white-space: nowrap; }
.table td { padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: 13.5px; }

/* ---------- can we trust it ---------- */
.dots { display: grid; grid-template-columns: repeat(auto-fill, 18px); gap: 6px; }
.dot-cell { width: 14px; height: 14px; border-radius: 999px; }
.dot-cell.inside { background: var(--point-inside); }
.dot-cell.outside { background: var(--point-outside); }
.dots.play .dot-cell { animation: pop 0.5s ease-out both; }
@keyframes pop { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }

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

/* ---------- fixed role label (shown instead of the dropdown when the role cannot be switched) ---------- */
.field .static { display: flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius-small); background: var(--chip-bg); font-weight: 600; }

/* ---------- analyst describe screen, greyed steps ---------- */
.step-pill[disabled] { color: var(--text-muted); border-style: dashed; cursor: not-allowed; }
.step-pill[disabled]:hover { border-color: var(--border-strong); }
.statement { padding: 16px 18px; border-radius: var(--radius); background: var(--chip-bg); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.pill.ok { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.pill.warn { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }

/* ---------- drafted files ---------- */
.pill.bad { border-color: var(--bad); color: var(--bad); background: var(--bad-soft); }
.bad-text { color: var(--bad); }
.ok-text { color: var(--ok); }
.inline { display: inline-flex; align-items: center; gap: 8px; }
.chip.start { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-strong); }
.code { margin: 0; padding: 14px; background: var(--code-bg); color: var(--code-text); border-radius: var(--radius); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.65; overflow-x: auto; min-height: 160px; white-space: pre; }
.scenario-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.scenario { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface); }
.scenario.rejected { border-color: var(--bad); background: var(--bad-soft); }
.scenario-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

/* ---------- evidence registry ---------- */
.split { display: flex; flex-wrap: wrap; gap: var(--gap); align-items: flex-start; }
.split-main { flex: 2 1 560px; min-width: 0; }
.split-side { flex: 1 1 260px; min-width: 0; }
.table.narrow { min-width: 0; }


/* ---------- viewer look: header, chips, pills, tiles, tables, buttons ---------- */
.subtitle { font-size: 12px; color: var(--text-faint); }
.topbar .chips { flex: 1 1 auto; justify-content: center; }
.role-tag { font-size: 12px; color: var(--text-strong); padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius); }
.topbar .segmented button { min-height: 30px; padding: 0 12px; font-size: 12px; font-weight: 600; }
.chip { height: 22px; min-height: 22px; padding: 0 6px; color: var(--text-strong); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; font-size: 12px; font-weight: 600; white-space: nowrap; border-radius: 999px; background: var(--chip-bg); border: 1px solid var(--border); color: var(--text-strong); }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pill.clear { background: var(--info-soft); border-color: var(--info-border); color: var(--info); }
.pill.ok { background: var(--ok-soft); border-color: var(--ok-border); color: var(--ok); }
.pill.warn { background: var(--warn-soft); border-color: var(--warn-border); color: var(--warn); }
.pill.bad { background: var(--bad-soft); border-color: var(--bad-border); color: var(--bad); }
.btn, .btn.primary { min-height: 44px; padding: 0 16px; font-size: 13px; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; }
.btn.primary { background: var(--accent); border: 1px solid var(--accent-strong); color: var(--accent-contrast); }
.btn.primary:hover { background: var(--accent-strong); }
.stepper-bar .btn { min-height: 44px; }
.step-name { flex: 1 1 auto; }
.step-owner { font-size: 12px; color: var(--text-faint); }
.page-head { display: flex; flex-direction: column; gap: 4px; }
.crumb { font-size: 12px; color: var(--text-faint); }
.crumb .sep { color: var(--series-baseline); }
.crumb strong { color: var(--text); font-weight: 600; }
.page-title { font-size: 24px; font-weight: 600; letter-spacing: -0.015em; }
.card { padding: 0 0 16px; gap: 12px; }
.card-head { padding: 10px 16px; border-bottom: 1px solid var(--border); }
.card > :not(.card-head) { margin-inline: 16px; }
.card-title { font-size: 12px; color: var(--text-strong); }
.tile { padding: 12px 14px; box-shadow: var(--shadow); background: var(--surface); border-color: var(--border); }
.tile-label { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); }
.tile-value { font-size: var(--metric); font-weight: 600; margin-top: 4px; }
.tile-value-small { font-size: 14px; }
.tile .small { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.table th { background: var(--bg); font-size: 11px; color: var(--text-muted); }
.table td { font-size: 13px; vertical-align: middle; }
.step-pill { font-size: 13px; }

.shell.solo .page { max-width: none; margin: 0; }
.option-card[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.card:not(:has(.card-head)) { padding-top: var(--gap); }
@media (max-width: 600px) { .hero-text { font-size: 16px; } .page { padding: 16px; } .topbar { padding: 10px 16px; } }

/* ---------- client polish ---------- */
.option-card[aria-pressed="true"] { border-top-color: var(--accent); background: var(--accent-soft); }
.option-card .option-number { letter-spacing: -0.02em; }
.shell.solo .page { gap: 0; padding: 0; }  /* the step sidebar runs edge to edge; the content column pads itself */
.shell.solo .card { border-radius: var(--radius-large); }
.shell.solo .card-title { font-size: 11px; letter-spacing: 0.08em; }
.shell.solo .legend { font-size: 11px; }
.dot-cell { width: 10px; height: 10px; }
.dots { grid-template-columns: repeat(auto-fill, 14px); gap: 4px; }
.meter { width: 100%; max-width: 560px; height: auto; display: block; }
.meter .track { fill: var(--border); }
.meter .fill.ok { fill: var(--ok); }
.meter .fill.warn { fill: var(--dir-down); }
.meter .fill.bad { fill: var(--bad); }
.meter .target { stroke: var(--text); stroke-width: 0.6; }
.meter .cap { fill: var(--text-muted); font-size: 2.1px; font-family: var(--font-body); }
.trust-line { display: flex; flex-direction: column; gap: 6px; }

/* ---------- scatter (forecast against what happened) ---------- */
.scatter-wrap { max-width: 480px; display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-large); background: var(--surface); }
.chart.scatter .tick { font-size: 10px; font-family: var(--font-mono); }
.chart.scatter .axis-title { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.chart.scatter .grid { stroke-dasharray: 2 3; }
.chart.scatter .axis { stroke: var(--border-strong); stroke-width: 1; }
.chart.scatter .diagonal { stroke-width: 1.2; }
.chart.scatter .diag-label { fill: var(--text-muted); font-size: 9.5px; font-style: italic; }
.chart.scatter .pt { opacity: 0.7; stroke: var(--surface); stroke-width: 0.8; }
.chart.scatter .pt.outside { opacity: 0.95; }

.shell.frame { min-height: 0; }
.shell.frame .page { max-width: none; padding: 0; gap: 0; }
.viewer-frame { display: block; width: 100%; height: calc(100vh - 56px); border: 0; background: var(--surface); }

/* ---------- held-out chart (client view) ---------- */
.held-title { font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-strong); }
.held-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }  /* as many charts per row as fit */
.held-panel { max-width: 440px; margin: 0;  /* a chart never grows past 440px, even when it is the only one */ padding: 10px 10px 4px; border: 1px solid var(--border); border-radius: var(--radius-large); background: var(--surface); }
.held-panel figcaption { font-size: 12px; color: var(--text-muted); padding: 0 2px 4px; }
.held-panel figcaption strong { color: var(--text); font-weight: 600; }
.chart.held .tick { font-size: 9px; font-family: var(--font-mono); }
.chart.held .axis-title { font-size: 9px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.chart.held .grid { stroke-dasharray: 2 3; }
.chart.held .diagonal { stroke-width: 1; }
.chart.held .range { stroke-width: 2.2; stroke-linecap: round; opacity: 0.28; }
.chart.held .range.inside { stroke: var(--point-inside); }
.chart.held .range.outside { stroke: var(--point-outside); opacity: 0.6; }
.chart.held .pt { stroke: var(--surface); stroke-width: 0.7; }
.chart.held .pt.inside { fill: var(--point-inside); }
.chart.held .pt.outside { fill: var(--point-outside); }


.seed-box { width: 220px; max-width: 100%; box-sizing: border-box; min-height: 40px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-small); background: var(--surface); color: var(--text); font: inherit; font-family: var(--font-mono); }
.seed-box:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.table-wrap { overflow-x: auto; }

.timer-line .mono { color: var(--text-strong); font-weight: 600; }

/* ---------- setup flow (workflow steps 01 to 04) ---------- */
.setup { display: flex; flex-direction: column; gap: var(--gap); }
.kicker { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--teal-strong); }
.big-question { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; max-width: 60ch; }
.helptext { color: var(--text-muted); max-width: 64ch; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.choice:hover { border-color: var(--teal); }
.choice[aria-pressed="true"] { border-color: var(--teal); box-shadow: inset 2px 0 0 var(--teal); background: var(--teal-soft); }
.choice .label { font-weight: 600; }
.choice .help { font-size: 12px; color: var(--text-muted); }
.input { width: 100%; max-width: 560px; min-height: 36px; padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--text); font: inherit; }
.input:focus { outline: none; border-color: var(--teal); }
textarea.input { min-height: 120px; resize: vertical; max-width: 720px; padding: 12px 14px; font-size: 15px; line-height: 1.55; }
.input.num { font-family: var(--font-mono); max-width: 200px; }
.btn.govern { background: var(--teal); border: 1px solid var(--teal-strong); color: var(--accent-contrast); }  /* COMPASS governed action: approvals and verifications only */
.btn.govern:hover:not(:disabled) { background: var(--teal-strong); }
.btn.primary:active:not(:disabled) { background: var(--accent-active); }
.btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.small { min-height: 30px; padding: 0 10px; font-size: 12px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.two { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); gap: var(--gap); align-items: start; }
@media (max-width: 900px) { .two { grid-template-columns: minmax(0, 1fr); } }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.facts li { display: flex; flex-direction: column; gap: 1px; padding-left: 10px; border-left: 2px solid var(--teal-border); }
.facts .t { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); }
.path-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.path-row:last-child { border-bottom: 0; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.tag-observed { color: var(--tag-observed); background: var(--tag-observed-bg); border-color: var(--tag-observed-border); }
.tag-published { color: var(--tag-published); background: var(--tag-published-bg); border-color: var(--tag-published-border); }
.tag-assumption { color: var(--tag-assumption); background: var(--tag-assumption-bg); border-color: var(--tag-assumption-border); }
.tag-llm_proposed { color: var(--tag-llm_proposed); background: var(--tag-llm_proposed-bg); border-color: var(--tag-llm_proposed-border); }
.suggest { border-left: 3px solid var(--tag-assumption-border); background: var(--tag-assumption-bg); padding: 14px 16px; border-radius: var(--radius); display: flex; flex-direction: column; gap: 10px; }
.drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 16px; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: var(--bg); color: var(--text-muted); cursor: pointer; text-align: center; }
.drop:hover, .drop.over { border-color: var(--teal); background: var(--teal-soft); }
.drop input { display: none; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; }
.check .mark { width: 16px; height: 16px; border-radius: 999px; border: 1px solid var(--border-strong); display: inline-flex; align-items: center; justify-content: center; font-size: 10px; }
.check.ok .mark { background: var(--teal); border-color: var(--teal); color: var(--accent-contrast); }
.issue { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.issue:last-child { border-bottom: 0; }
.issue .msg { flex: 1 1 auto; }
select.input { max-width: 260px; }
.diagram { max-width: 100%; min-width: 520px; height: auto; display: block; }  /* its width is set on the element: the drawing's own size, never stretched to fill the card */
.diagram .node rect { fill: var(--node-fill); stroke: var(--node-stroke); stroke-width: 1.5; }
.diagram .node.lit rect { fill: var(--node-lit); stroke: var(--node-lit-stroke); stroke-width: 2; }
.diagram .node.terminal rect { stroke-dasharray: 0; rx: 18; }
.diagram .node text { fill: var(--text); font-size: 13px; font-weight: 600; text-anchor: middle; }
.diagram .node .src { fill: var(--teal-strong); font-size: 10px; font-weight: 500; }
.diagram .edge { fill: none; stroke: var(--edge); stroke-width: 1.6; }
.diagram marker path { fill: var(--edge); }
.diagram .edge-label { fill: var(--text-muted); font-size: 10.5px; text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.diagram .edge-value { fill: var(--text); font-family: var(--font-mono); font-size: 11px; font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.diagram .edge-tag { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; text-anchor: middle; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.diagram .edge-tag.tag-observed { fill: var(--tag-observed); }
.diagram .edge-tag.tag-published { fill: var(--tag-published); }
.diagram .edge-tag.tag-assumption { fill: var(--tag-assumption); }
.diagram .edge-tag.tag-llm_proposed { fill: var(--tag-llm_proposed); }
.trust { width: 100%; height: 14px; display: block; }
.trust .seg.observed { fill: var(--tag-observed); }
.trust .seg.published { fill: var(--tag-published); }
.trust .seg.assumption { fill: var(--tag-assumption); }
.trust .seg.llm_proposed { fill: var(--tag-llm_proposed); }
.chapter { display: flex; flex-direction: column; gap: 12px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--teal); border-radius: var(--radius-large); }
.chapter.in_progress { border-top-color: var(--border-strong); color: var(--text-muted); }
.chapter .headline-big { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.35; max-width: 56ch; }
.chapter ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; max-width: 70ch; }
.empty { padding: 28px; text-align: center; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); }
.edit-cell { display: inline-flex; gap: 6px; align-items: center; }
.edit-cell .input { min-height: 28px; max-width: 110px; padding: 2px 6px; }
.link-btn { padding: 0; border: 0; background: none; font: inherit; font-size: 12px; color: var(--teal-strong); cursor: pointer; text-decoration: underline; }
.error-banner { padding: 10px 14px; border-radius: var(--radius); background: var(--bad-soft); border: 1px solid var(--bad-border); color: var(--bad); font-size: 13px; }
.chapter.compact { padding: 14px 18px; gap: 6px; }
.chapter.compact .headline-big { font-size: 16px; }
.card > .input { width: auto; }

/* ---------- workflow step bar: two groups, equal boxes, clear done / current / locked states ---------- */
.with-steps { display: grid; grid-template-columns: 272px minmax(0, 1fr); align-items: stretch; min-height: calc(100vh - var(--topbar-h)); }
.with-steps > .stack { width: 100%; max-width: var(--page-wide); padding: 24px 28px 40px; }
.setup-steps { background: var(--surface); border-right: 2px solid var(--border-strong); }
.steps-inner { position: sticky; top: var(--topbar-h); max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 18px 12px 24px; }
.step-group { display: flex; flex-direction: column; }
.step-group-label { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); padding: 0 8px 8px; border-bottom: 1px solid var(--border-strong); }
.step-col { display: flex; flex-direction: column; }
.setup-step { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; column-gap: 10px; min-height: 58px; padding: 10px 8px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; align-content: center; transition: background 0.15s ease; }
.setup-step:last-child { border-bottom: 0; }
.setup-step:hover:not([disabled]) { background: var(--chip-bg); }
.setup-step .badge { grid-row: 1 / span 2; display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 22px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--bg); color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; font-weight: 600; }
.setup-step .name { grid-column: 2; font-size: 13.5px; font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.setup-step .owner { grid-column: 2; font-size: 11.5px; line-height: 1.2; color: var(--text-faint); }
.setup-step.done .badge { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-strong); }
.setup-step[aria-current="step"] { background: var(--teal-soft); box-shadow: inset 2px 0 0 var(--teal); }  /* COMPASS selected row: teal tint and teal left marker */
.setup-step[aria-current="step"] .badge { background: var(--teal); border-color: var(--teal); color: var(--accent-contrast); }
.setup-step:has(.hint):not([aria-current="step"]):not(.done) .name { font-weight: 500; }  /* client view: steps not reached yet are regular weight */
.setup-step[disabled] { color: var(--text-faint); cursor: not-allowed; }
.setup-step[disabled] .name { font-weight: 500; color: var(--text-faint); }
@media (max-width: 900px) { .with-steps { grid-template-columns: minmax(0, 1fr); min-height: 0; } .setup-steps { border-right: 0; border-bottom: 1px solid var(--border-strong); } .steps-inner { position: static; max-height: none; } .topbar { position: static; } }

/* ---------- calibration and backtest (step 06): the analyst's page and the client's story ---------- */
.verdict { display: flex; flex-direction: column; gap: 10px; padding: 22px 26px; border-radius: var(--radius-large); background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-top: 2px solid var(--teal); }
.verdict-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.verdict-figs { display: none; }
.verdict-top { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.verdict-kicker { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.verdict-pill { display: inline-flex; align-items: center; height: 24px; padding: 0 12px; border-radius: 999px; background: var(--surface); color: var(--text); font-family: var(--font-body); font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; }
.verdict-pill.ok { background: var(--ok-soft); color: var(--ok); }
.verdict-pill.warn { background: var(--warn-soft); color: var(--warn); }
.verdict-pill.bad { background: var(--bad-soft); color: var(--bad); }
.verdict-headline { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.25; }
.verdict-sub { max-width: 80ch; color: var(--text-muted); }
.verdict-fails { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.muted-light { opacity: 0.65; font-size: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.kpi { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--border-strong); border-radius: var(--radius); }
.kpi.ok { border-top-color: var(--teal); }
.kpi.warn { border-top-color: var(--warn); }
.kpi.bad { border-top-color: var(--bad); }
.kpi .label { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.kpi .value { font-family: var(--font-mono); font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.kpi.ok .value { color: var(--teal-strong); }
.kpi.bad .value { color: var(--bad); }
.kpi .sub { font-size: 13px; color: var(--text-strong); }
.kpi .note { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: var(--text-faint); }
.hbar { width: 100%; height: 10px; display: block; }
.hbar .track { fill: var(--border); }
.hbar .fill { fill: var(--teal); }
.hbar.guess .fill { fill: var(--series-baseline); }
.meter-wide { width: 100%; height: 28px; display: block; }
.meter-wide .track { fill: var(--border); }
.meter-wide .band { fill: var(--teal-soft); stroke: var(--teal-border); stroke-width: 0.3; }
.meter-wide .fill.ok { fill: var(--teal); }
.meter-wide .fill.warn { fill: var(--warn); }
.meter-wide .fill.bad { fill: var(--bad); }
.meter-wide .aim { stroke: var(--text); stroke-width: 0.5; }
.rangebar { width: 100%; max-width: 260px; height: 24px; display: block; }
.rangebar .full { fill: var(--border); }
.rangebar .kept { fill: var(--teal-border); stroke: var(--teal); stroke-width: 1; }
.rangebar .best { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.sens-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.sens-block { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sens-row { display: grid; grid-template-columns: minmax(110px, 180px) 1fr 64px; gap: 10px; align-items: center; font-size: 13px; }
.sens-val { text-align: right; font-size: 12px; color: var(--text-strong); }
.table-wrap.tall { max-height: 420px; overflow-y: auto; }
.strong { font-weight: 600; }
.story { display: flex; flex-direction: column; }
.story-chapter { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 20px; padding: 30px 0; border-top: 1px solid var(--border-strong); }
.story-chapter:first-child { border-top: 0; padding-top: 8px; }
.story-num.done { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 2px var(--teal); transition: background .5s ease, color .5s ease; }
.story-num.ticking { animation: tick-pop .7s ease-out; }
@keyframes tick-pop { 0% { background: var(--teal); color: var(--accent-contrast); transform: scale(1); } 40% { transform: scale(1.18); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .story-num.ticking { animation: none; } }
.story-num { width: 40px; height: 40px; border-radius: 999px; background: var(--teal); color: var(--accent-contrast); font-family: var(--font-mono); font-size: 16px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.story-body { display: flex; flex-direction: column; gap: 14px; max-width: 1040px; min-width: 0; }
.story-headline { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.4; max-width: 62ch; }
.story-visual { padding: 18px 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-large); }
.story-means { padding-left: 14px; border-left: 3px solid var(--teal-border); color: var(--text-strong); max-width: 72ch; }
.compare { display: flex; flex-direction: column; gap: 12px; }
.compare-row { display: grid; grid-template-columns: minmax(130px, 200px) 1fr 60px; gap: 12px; align-items: center; }
.compare-label { font-size: 13px; font-weight: 600; }
.driver { font-size: 16px; max-width: 72ch; }
.driver em { font-style: normal; font-weight: 600; color: var(--teal-strong); }
.assumptions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.assumptions li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.story-verdict { display: flex; flex-direction: column; gap: 14px; padding: 24px 26px; background: var(--surface); border: 1px solid var(--border-strong); border-top: 4px solid var(--teal); border-radius: var(--radius-large); }
.story-verdict.warn { border-top-color: var(--warn); }
.story-verdict.bad { border-top-color: var(--bad); }
.say-do { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.say, .dont { padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); }
.say { background: var(--teal-soft); border-color: var(--teal-border); }
.dont { background: var(--bad-soft); border-color: var(--bad-border); }
.say .label, .dont .label { margin-bottom: 6px; font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.say .label { color: var(--teal-strong); }
.dont .label { color: var(--bad); }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(440px, 1fr)); gap: var(--gap); align-items: start; }
.timeline-wrap { padding-top: 2px; }
.tl { display: flex; flex-direction: column; gap: 8px; max-width: 720px; }
.tl-labels, .tl-dates { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.tl-labels { font-family: var(--font-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-strong); }
.tl-labels .tl-held { color: var(--teal-strong); }
.tl-dates { font-family: var(--font-mono); font-size: 13px; color: var(--text-muted); }
.tl-track { height: 12px; border-radius: var(--radius); overflow: hidden; }
.tl-bar { width: 100%; height: 100%; display: block; }
.tl-bar .seg.fit { fill: var(--teal); }
.tl-bar .seg.held { fill: var(--teal-soft); stroke: var(--teal); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.tl-bar .split-line { stroke: var(--surface); stroke-width: 3px; vector-effect: non-scaling-stroke; }
.held-panel.flat { display: flex; flex-direction: column; }
.flat-body { display: flex; flex-direction: column; gap: 8px; padding: 12px 4px 16px; }
.flat-num { font-family: var(--font-mono); font-size: 44px; font-weight: 600; line-height: 1; color: var(--teal-strong); }
.chart.held .mark { cursor: pointer; }
.chart.held .mark:hover .pt, .chart.held .mark.sel .pt { stroke: var(--text); stroke-width: 1.6; opacity: 1; }
.chart.held .mark.sel .range { opacity: 0.9; }
.chart.held .mark:focus-visible { outline: 2px solid var(--teal); }
.readout { max-width: 84ch; padding: 12px 16px; border: 1px solid var(--teal-border); border-left: 4px solid var(--teal); border-radius: var(--radius); background: var(--teal-soft); font-size: 14px; }
.readout.out { border-color: var(--bad-border); border-left-color: var(--bad); background: var(--bad-soft); }
.readout.hint { border-color: var(--border); border-left-color: var(--border-strong); background: var(--bg); color: var(--text-muted); }
.rv { display: flex; flex-direction: column; gap: 14px; }
.rv-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.rv-group { display: flex; flex-direction: column; gap: 6px; }
.rv-title { font-size: 13px; font-weight: 600; }
.rv-row { display: grid; grid-template-columns: minmax(70px, 120px) 1fr minmax(170px, 260px); gap: 12px; align-items: center; font-size: 13px; }
.rv-strip { width: 100%; height: 18px; display: block; }
.rv-strip .track { fill: var(--border); }
.rv-strip .rng { fill: var(--teal-border); }
.rv-strip .med { stroke: var(--text); stroke-width: 1.5px; stroke-dasharray: 2 2; vector-effect: non-scaling-stroke; }
.rv-strip .act { stroke-width: 4px; vector-effect: non-scaling-stroke; }
.rv-strip .act.inside { stroke: var(--point-inside); }
.rv-strip .act.outside { stroke: var(--point-outside); }
.ask { display: flex; flex-direction: column; gap: 12px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-large); }
.ask-q { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-q button { min-height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: 13px; cursor: pointer; }
.ask-q button:hover { border-color: var(--teal); }
.ask-q button[aria-pressed="true"] { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-strong); font-weight: 600; }
.ask-a { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-left: 4px solid var(--teal); background: var(--bg); border-radius: var(--radius); max-width: 84ch; }
.verdict.warn { border-top-color: var(--warn); }
.verdict.bad { border-top-color: var(--bad); }


/* ---------- scenario comparison (step 08): the analyst's page and the client's story ---------- */
.notice.info { background: var(--info-soft); color: var(--info); border: 1px solid var(--info-border); }
.table td.num, .table th.num { text-align: right; }
.table td { height: 40px; }
.table tbody tr:hover { background: var(--bg); }
.mono.big { font-size: 15px; font-weight: 600; }
.mono.faint { font-size: 11px; color: var(--text-faint); }
.mono.diff { font-size: 12px; color: var(--info); }
.mono.diff.unclear { color: var(--warn); }
.mono.diff.none { color: var(--text-faint); }
.cap { font-family: var(--font-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-faint); }
.tcell { display: flex; flex-direction: column; gap: 2px; }
.warn-text { color: var(--warn); }
.check-row { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); }
.cmp-banner { display: flex; flex-direction: column; gap: 10px; padding: 22px 26px; background: var(--surface); border: 1px solid var(--border-strong); border-top: 2px solid var(--teal); border-radius: var(--radius-large); }
.cmp-filters { position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-bar); }
.cmp-filters .segmented button { min-height: 36px; }
.cmp-filters select { min-height: 36px; }
.cmp-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); gap: var(--gap); align-items: start; }
@media (max-width: 1000px) { .cmp-cols { grid-template-columns: minmax(0, 1fr); } }
.stages { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stage { position: relative; flex: 1 1 200px; display: flex; flex-direction: column; gap: 4px; padding: 14px 18px; border-top: 2px solid var(--border); border-right: 1px solid var(--border); background: var(--surface); }
.stage:last-child { border-right: 0; }
.stage.clear { border-top-color: var(--teal); }
.stage.unclear { border-top-color: var(--warn); }
.stage:not(:last-child)::after { content: "›"; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); width: 12px; text-align: center; background: var(--surface); color: var(--text-faint); font-size: 18px; line-height: 1; z-index: 1; }
.metric { font-family: var(--font-mono); font-size: 24px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.metric.big { font-size: 40px; }
.metric.flat { color: var(--text-muted); }
.stage .sub, .ab .sub { font-size: 12px; color: var(--text-muted); }
.ab-row { display: flex; flex-wrap: wrap; gap: 12px; }
.ab { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.ab-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.rng-bar { width: 100%; height: 18px; display: block; margin-top: 4px; }
.rng-bar .track { fill: var(--border); }
.rng-bar .r90 { fill: var(--teal-border); }
.rng-bar .r50 { fill: var(--teal-border); }
.rng-bar .med { stroke: var(--accent); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.paired { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.paired .lines { line-height: 1.8; color: var(--text-strong); }
.chart.line-chart { max-width: 760px; }
.line-chart .ln { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.line-chart .ln.s0, .swatch.ln.s0 { stroke: var(--series-s0); background: var(--series-s0); stroke-dasharray: 5 4; }
.line-chart .ln.s1, .swatch.ln.s1 { stroke: var(--series-s1); background: var(--series-s1); }
.line-chart .ln.s2, .swatch.ln.s2 { stroke: var(--series-s2); background: var(--series-s2); }
.line-chart .ln.s3, .swatch.ln.s3 { stroke: var(--series-s3); background: var(--series-s3); }
.line-chart .band { stroke: none; opacity: 0.14; }
.line-chart .band.s0 { fill: var(--series-s0); } .line-chart .band.s1 { fill: var(--series-s1); } .line-chart .band.s2 { fill: var(--series-s2); } .line-chart .band.s3 { fill: var(--series-s3); }
.swatch.ln { height: 3px; width: 14px; border-radius: 0; }
.tell { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.tell:last-of-type { border-bottom: 0; }
.tell-all { font-size: 14px; line-height: 1.45; }
.tell-line { display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.tell-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.opt { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border: 1px solid var(--border); border-top: 2px solid var(--teal); border-radius: var(--radius); background: var(--surface); }
.opt.today { border-top-color: var(--border-strong); background: var(--bg); }
.opt-name { font-size: 16px; font-weight: 600; }
.chg-list { display: flex; flex-direction: column; }
.chg-row { display: grid; grid-template-columns: minmax(150px, 220px) minmax(180px, 1fr) minmax(110px, 160px); gap: 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--border); }
.chg-row:last-child { border-bottom: 0; }
@media (max-width: 700px) { .chg-row { grid-template-columns: minmax(0, 1fr); gap: 6px; } }
.diff-bar { width: 100%; height: 24px; display: block; }
.diff-bar .zero { stroke: var(--text); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.diff-bar .range { stroke: var(--text-faint); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.diff-bar .fill.up { fill: var(--dir-up); }
.diff-bar .fill.down { fill: var(--dir-down); }
.diff-bar.unclear .fill, .diff-bar.none .fill { opacity: 0.35; }
.swatch.more { background: var(--dir-up); }
.swatch.fewer { background: var(--dir-down); }
.assumptions.plain { list-style: disc; padding-left: 18px; display: block; }
.assumptions.plain li { display: list-item; margin-bottom: 6px; }

/* ---------- the client's story opens one chapter at a time ---------- */
.story-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; font-size: 13px; position: sticky; top: var(--topbar-h); z-index: 10; margin: 0 -28px; padding: 8px 28px; background: var(--bg); border-bottom: 1px solid var(--border); }  /* stays in view while the chapters scroll */
.story-progress .link-btn { margin-left: auto; font-size: 13px; }
.steps-dots { display: flex; gap: 5px; }
.steps-dots .dot { width: 26px; height: 20px; padding: 0; border: 0; background: transparent; position: relative; cursor: default; }
.steps-dots .dot::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 4px; border-radius: 2px; background: var(--border-strong); transition: background .3s ease; }
.steps-dots .dot.on::before { background: var(--teal); }
.steps-dots .dot.on:not([disabled]) { cursor: pointer; }
.steps-dots .dot.on:not([disabled]):hover::before { background: var(--teal-strong); }
.steps-dots .dot:focus-visible { outline: 2px solid var(--teal); outline-offset: 1px; border-radius: 2px; }
.story-next { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 4px 0 8px 72px; }
.story-chapter.read { opacity: .62; transition: opacity .4s ease; }  /* chapters already read recede, so the one being read stands out */
.story-chapter.read:hover, .story-chapter.read:focus-within { opacity: 1; }
.story-chapter.read .story-headline { font-size: 16px; transition: font-size .3s ease; }
.story-chapter.reveal { animation: rise 0.45s ease-out both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) { .story-next { padding-left: 0; } }

/* ---------- deleting a setup ---------- */
.btn.danger { background: var(--bad); border-color: var(--bad); color: var(--accent-contrast); }
.btn.danger:hover:not(:disabled) { background: var(--bad); filter: brightness(0.92); }
.btn.danger-outline { border-color: var(--bad-border); color: var(--bad); }
.btn.danger-outline:hover:not(:disabled) { border-color: var(--bad); background: var(--bad-soft); }

/* ---------- the pathway builder (step 02) ---------- */
.pw-list { display: flex; flex-direction: column; }
.pw-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 220px) minmax(0, 1fr) auto; gap: 10px 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.pw-row.add { border-bottom: 0; padding-top: 14px; }
.pw-move .pw-row { grid-template-columns: minmax(0, 1fr) auto; }
.pw-move { border-bottom: 1px solid var(--border); }
.pw-move .pw-row { border-bottom: 0; }
.pw-add { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; padding-top: 12px; }
.pw-add .input, .pw-row .input { max-width: none; }
.pw-row > * { min-width: 0; }
.staged-work .pw-row:has(> :nth-child(4)) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }  /* beside the picture there is room for two fields a row */
.staged-work .pw-row:has(> :nth-child(4)) > :nth-child(4) { justify-self: end; }  /* a long label wraps instead of pushing the button out of its card */
.staged { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.staged-work { min-width: 0; }
.staged-picture { position: sticky; top: 12px; min-width: 0; }
@media (max-width: 1100px) { .staged { grid-template-columns: minmax(0, 1fr); } .staged-picture { position: static; order: -1; } }
.stage-progress { display: flex; flex-direction: column; gap: 8px; }
.stage-rail { display: flex; gap: 6px; }
.stage-pill { position: relative; flex: 1 1 0; height: 8px; padding: 0; border: 0; border-radius: 999px; background: var(--border); cursor: pointer; }
.stage-pill::before { content: ""; position: absolute; inset: -8px 0; }  /* a taller click area than the thin bar */
.stage-pill.done { background: var(--teal); }  /* COMPASS stage progression: active and completed stages in governed teal, pending in the hairline grey */
.stage-pill.on { background: var(--teal); }
.stage-pill:hover:not(.on):not(.done) { background: var(--border-strong); }
.stage-caption { font-size: var(--text-small); color: var(--text-muted); }
.stage-caption strong { color: var(--text); font-weight: 600; }
.pw-add .input.num, .pw-row .input.num { max-width: 140px; }
@media (max-width: 800px) { .pw-row { grid-template-columns: minmax(0, 1fr); } }
.pw-fit { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pw-fit:last-child { border-bottom: 0; }
.pw-range { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; padding-left: 24px; }

/* ---------- sign-in page ---------- */
.login { display: flex; justify-content: center; padding: 56px 16px; }
.login-card { width: min(400px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 24px; border: 1px solid var(--border-strong); border-radius: var(--radius-large); background: var(--surface); }
.login-title { font-size: 20px; font-weight: 600; letter-spacing: -0.015em; }
.login-card .input { max-width: none; }
.login-card .btn { align-self: flex-start; }

/* The chapter bars: each opened chapter fills teal, the one you are on grows in thicker, and a name appears under a bar you point at */
.steps-dots .dot::before { transition: background .4s ease, transform .2s ease; }
.steps-dots .dot.on:not([disabled]):hover::before { transform: scaleY(1.6); }
.steps-dots .dot.cur::before { top: 7px; height: 6px; background: var(--teal-strong); transform-origin: left; animation: bar-fill .6s ease-out; }  /* the chapter you are on: thicker and a deeper teal */
.steps-dots .dot[data-tip]:not([disabled]):hover::after, .steps-dots .dot[data-tip]:focus-visible::after { content: attr(data-tip); position: absolute; left: 0; top: 24px; white-space: nowrap; padding: 4px 10px; border-radius: var(--radius-small); background: var(--text); color: var(--bg); font-size: 12px; z-index: 30; pointer-events: none; }
@keyframes bar-fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .steps-dots .dot.cur::before { animation: none; } }
