/* Growth Experiment Studio · product UI. Coral = loss/harm, emerald = gain, cobalt = action/selection. All data simulated. */
:root {
  --canvas: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --line: #e4e8f0;
  --line-2: #d3d9e5;
  --ink: #0f172a;
  --ink-2: #39425a;
  --muted: #5f6982;

  --navy: #0c1430;
  --navy-2: #16204a;
  --navy-line: #222c55;
  --navy-text: #c4cbe3;
  --navy-muted: #8790b2;

  --cobalt: #2f52f0;
  --cobalt-600: #2342d4;
  --cobalt-700: #1c36b3;
  --cobalt-50: #eef2ff;
  --cobalt-100: #dce4ff;
  --cobalt-300: #7b93ff;

  --loss: #e5533d;
  --loss-ink: #b93a26;
  --loss-50: #fdf1ee;
  --loss-100: #f9d6cd;
  --gain: #0e9f6e;
  --gain-ink: #0a7a54;
  --gain-50: #e8f7f0;
  --gain-100: #c3ead8;
  --amber-ink: #a04c08;
  --amber-50: #fdf3e6;
  --amber-100: #f4d6b0;
  --neutral-50: #eff2f7;

  --seg-all: #2f52f0;
  --seg-small: #0e9fb3;
  --seg-larger: #8357f0;

  --r-xs: 6px;
  --r-sm: 9px;
  --r: 12px;
  --r-lg: 16px;
  --sh-xs: 0 1px 2px rgba(15, 23, 42, .06);
  --sh-sm: 0 1px 2px rgba(15, 23, 42, .05), 0 2px 6px -2px rgba(15, 23, 42, .08);
  --sh-md: 0 2px 4px rgba(15, 23, 42, .04), 0 10px 24px -8px rgba(15, 23, 42, .14);
  --ring: 0 0 0 3px rgba(47, 82, 240, .28);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-2xs: .75rem;   /* 12 */
  --t-xs: .8125rem;  /* 13 */
  --t-sm: .875rem;   /* 14 */
  --t-base: .9375rem;/* 15 */
  --t-md: 1rem;      /* 16 */
  --t-lg: 1.1875rem; /* 19 */
  --t-xl: 1.5rem;    /* 24 */
  --t-kpi: 1.75rem;  /* 28 */

  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  accent-color: var(--cobalt);
  scrollbar-color: #c4cbd8 transparent;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); font-size: var(--t-base); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p, dl, dd, figure, blockquote { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
::selection { background: var(--cobalt-100); color: var(--ink); }
:focus { outline: none; }
:focus-visible { outline: none; box-shadow: var(--ring); }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: var(--neutral-50); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; color: var(--ink-2); }
.num, table, .vals, .lift, .kpi-val { font-variant-numeric: tabular-nums; }
.ico { flex: none; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--surface); padding: 8px 12px; border-radius: var(--r-sm); z-index: 50; }
.skip:focus { left: 8px; }

/* ================= Shell ================= */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--navy); color: var(--navy-text); padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 2px 6px; }
.mark { display: grid; }
.sb-name { color: #fff; font-weight: 650; font-size: var(--t-sm); line-height: 1.25; letter-spacing: -.005em; }
.sb-workspace { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--navy-line); border-radius: var(--r); background: rgba(255,255,255,.03); }
.ws-avatar { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #c8462f, #a5321d); color: #fff; font-weight: 700; font-size: var(--t-sm); flex: none; }
.ws-text { display: grid; line-height: 1.3; }
.ws-text b { color: #fff; font-size: var(--t-sm); font-weight: 600; }
.ws-text span { font-size: var(--t-2xs); color: var(--navy-muted); }

/* Nav tabs */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.step { width: 100%; display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; text-align: left; padding: 8px 10px 8px 8px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--navy-text); transition: background .15s var(--ease), color .15s var(--ease); }
.step:hover:not(:disabled) { background: rgba(255,255,255,.06); color: #fff; }
.step:active:not(:disabled) { background: rgba(255,255,255,.09); }
.step:disabled { cursor: not-allowed; opacity: .55; }
.step-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.05); color: var(--navy-muted); transition: background .15s var(--ease), color .15s var(--ease); }
.step-text { display: grid; line-height: 1.25; min-width: 0; }
.step .t { font-weight: 600; font-size: var(--t-sm); }
.step .s { font-size: var(--t-2xs); color: var(--navy-muted); }
.step-state { color: #4fd1a5; display: grid; }
.lock { font-size: 11px; font-weight: 600; color: var(--navy-muted); border: 1px solid var(--navy-line); border-radius: 999px; padding: 0 6px; }
.step.current { background: var(--navy-2); color: #fff; box-shadow: inset 0 0 0 1px var(--navy-line); }
.step.current .step-ico { background: var(--cobalt); color: #fff; box-shadow: 0 4px 12px -4px rgba(47,82,240,.8); }
.step.current .s { color: var(--navy-text); }
.step.done .step-ico { color: #4fd1a5; background: rgba(79,209,165,.10); }
.step:focus-visible { box-shadow: 0 0 0 2px var(--cobalt-300); }

.sb-question { margin-top: 4px; padding: 14px 12px; border-radius: var(--r); background: rgba(255,255,255,.035); border: 1px solid var(--navy-line); }
.sb-question dt { font-size: var(--t-2xs); font-weight: 600; color: var(--cobalt-300); margin-bottom: 6px; }
.sb-question dd { font-size: var(--t-xs); color: var(--navy-text); line-height: 1.5; }
.sb-foot { margin-top: auto; font-size: var(--t-2xs); color: var(--navy-muted); padding: 0 6px; line-height: 1.45; }

.app { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: var(--t-sm); color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs .sep { color: var(--line-2); }
.crumbs b { color: var(--ink); font-weight: 600; }
.sim-badge { display: inline-flex; align-items: center; gap: 6px; background: var(--amber-50); color: var(--amber-ink); border: 1px solid var(--amber-100); font-size: var(--t-xs); font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 999px; white-space: nowrap; }
main { padding: 24px 32px 8px; outline: none; width: 100%; max-width: 1400px; }
.foot { color: var(--muted); font-size: var(--t-xs); padding: 16px 32px 32px; max-width: 1400px; }

/* ================= Page head ================= */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 18px; }
.page-title { max-width: 820px; }
h1 { font-size: var(--t-xl); line-height: 1.2; letter-spacing: -.022em; font-weight: 650; text-wrap: balance; }
.lede { color: var(--muted); font-size: var(--t-base); margin-top: 6px; max-width: 78ch; text-wrap: pretty; }
.page-aside { flex: none; }
.meta-list { display: flex; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); box-shadow: var(--sh-xs); }
.meta-list > div { padding: 7px 14px; border-left: 1px solid var(--line); }
.meta-list > div:first-child { border-left: 0; }
.meta-list dt { font-size: var(--t-2xs); color: var(--muted); }
.meta-list dd { font-size: var(--t-sm); font-weight: 600; white-space: nowrap; }

/* ================= Panels ================= */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-xs); }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px 24px; padding: 16px 20px 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: var(--t-md); font-weight: 600; letter-spacing: -.012em; line-height: 1.3; }
.sub { color: var(--muted); font-size: var(--t-xs); margin-top: 2px; max-width: 80ch; }
.section-gap { margin-top: 16px; }
.count-pill { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 500; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.legend { display: flex; gap: 14px; align-items: center; font-size: var(--t-xs); color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot-all { background: var(--seg-all); }
.dot-small { background: var(--seg-small); }
.dot-larger { background: var(--seg-larger); }
.lg-leak { width: 12px; height: 10px; border-radius: 2px; display: inline-block; background: rgba(229,83,61,.22); box-shadow: inset 0 2px 0 var(--loss); }
.lg-diamond { width: 8px; height: 8px; background: var(--ink-2); transform: rotate(45deg); display: inline-block; }
.lg-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-2); display: inline-block; }
.lg-band { width: 14px; height: 10px; background: rgba(14,159,110,.16); border-radius: 2px; display: inline-block; }

/* ================= Control system ================= */
/* Buttons: one family, three weights (primary / secondary / ghost) */
.btn { --h: 36px; height: var(--h); display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 550; font-size: var(--t-sm); letter-spacing: -.005em; white-space: nowrap; box-shadow: var(--sh-xs); transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease), color .15s var(--ease); }
.btn .ico { color: var(--muted); transition: transform .15s var(--ease), color .15s var(--ease); }
.btn:hover { background: var(--surface-2); border-color: #bfc7d6; box-shadow: var(--sh-sm); }
.btn:hover .ico { color: var(--ink-2); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 1px 2px rgba(15,23,42,.10); background: var(--neutral-50); }
.btn.primary { color: #fff; border-color: var(--cobalt-600); background: linear-gradient(180deg, #3a5cf7, var(--cobalt-600)); box-shadow: 0 1px 2px rgba(28,54,179,.35), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.primary .ico { color: rgba(255,255,255,.85); }
.btn.primary:hover { background: linear-gradient(180deg, #3051ee, var(--cobalt-700)); box-shadow: 0 4px 12px -4px rgba(47,82,240,.6), inset 0 1px 0 rgba(255,255,255,.18); }
.btn.primary:hover .ico { color: #fff; transform: translateX(2px); }
.btn.primary:active { background: var(--cobalt-700); box-shadow: inset 0 2px 3px rgba(0,0,0,.18); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--neutral-50); }
.btn.lg { --h: 42px; padding: 0 18px; font-size: var(--t-base); }
.btn.ok { border-color: var(--gain-100); color: var(--gain-ink); background: var(--gain-50); }
.btn.ok .ico { color: var(--gain-ink); }
.btn:disabled, .btn:disabled:hover, .btn:disabled:active { opacity: .42; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary:disabled { background: var(--cobalt); }
.actions { display: flex; gap: 10px; align-items: center; margin-top: 20px; flex-wrap: wrap; }
.actions .hint { color: var(--muted); font-size: var(--t-xs); max-width: 70ch; margin-left: 6px; }

/* Segmented control: track + white thumb, cobalt label when active */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: #e9edf5; box-shadow: inset 0 1px 2px rgba(15,23,42,.06); }
.seg button { height: 30px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; font-size: var(--t-sm); font-weight: 550; color: var(--muted); white-space: nowrap; transition: background .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink); background: rgba(255,255,255,.55); }
.seg button:active:not([aria-pressed="true"]) { background: rgba(255,255,255,.8); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--cobalt-600); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.12), 0 0 0 1px rgba(15,23,42,.05); }

/* Chips + radio (shared selection indicator) */
.chip { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-2xs); font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid transparent; line-height: 1.7; white-space: nowrap; }
.chip.good { background: var(--gain-50); color: var(--gain-ink); border-color: var(--gain-100); }
.chip.warn { background: var(--amber-50); color: var(--amber-ink); border-color: var(--amber-100); }
.chip.bad { background: var(--loss-50); color: var(--loss-ink); border-color: var(--loss-100); }
.chip.neutral { background: var(--neutral-50); color: var(--ink-2); border-color: var(--line); }
.radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; color: transparent; background: var(--surface); transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease); flex: none; }
[aria-pressed="true"] .radio { background: var(--cobalt); border-color: var(--cobalt); color: #fff; box-shadow: 0 0 0 3px var(--cobalt-50); }

/* Selectable surfaces share one language: hairline → hover lift → cobalt ring + tint */
.choice, .dec, .res { transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease), transform .15s var(--ease); }
.choice:hover:not([aria-pressed="true"]), .dec:hover:not([aria-pressed="true"]) { border-color: var(--line-2); box-shadow: var(--sh-md); transform: translateY(-1px); }
.choice:active, .dec:active { transform: translateY(0); }
.choice[aria-pressed="true"], .dec[aria-pressed="true"] { border-color: var(--cobalt); background: linear-gradient(180deg, var(--cobalt-50), var(--surface) 70%); box-shadow: 0 0 0 1px var(--cobalt), var(--sh-sm); }

/* ================= Diagnose ================= */
.kpis { overflow: hidden; }
.kpi-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.kpis.two .kpi-row { grid-template-columns: 170px repeat(5, minmax(0, 1fr)); }
.kpis.two .kpi-row + .kpi-row { border-top: 1px solid var(--line); }
.kpi-seg { display: flex; align-items: center; gap: 8px; padding: 14px 18px; flex-wrap: wrap; border-right: 1px solid var(--line); background: var(--surface-2); }
.kpi-seg b { font-size: var(--t-sm); font-weight: 600; }
.kpi-seg span { font-size: var(--t-2xs); color: var(--muted); flex-basis: 100%; padding-left: 16px; }
.kpi { padding: 14px 18px 16px; display: grid; gap: 2px; border-left: 1px solid var(--line); align-content: start; }
.kpi:first-child, .kpi-seg + .kpi { border-left: 0; }
.kpi-label { font-size: var(--t-xs); color: var(--muted); font-weight: 500; }
.kpi-val { font-size: var(--t-kpi); font-weight: 650; letter-spacing: -.03em; line-height: 1.15; }
.kpis.two .kpi-val { font-size: 1.375rem; }
.kpi-sub { font-size: var(--t-2xs); color: var(--muted); line-height: 1.4; }
.kpi.loss .kpi-val { color: var(--loss-ink); }
.kpi.gain .kpi-val { color: var(--gain-ink); }
.kpi.loss { background: linear-gradient(180deg, rgba(229,83,61,.05), transparent 80%); }
.kpi.gain { background: linear-gradient(180deg, rgba(14,159,110,.06), transparent 80%); }
.kpi-note { display: flex; align-items: center; gap: 10px; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: var(--t-xs); color: var(--ink-2); flex-wrap: wrap; }
.kpi-note .ico { color: var(--loss); }
.kpi-note b { color: var(--loss-ink); font-weight: 650; }
.kpi-note-aside { margin-left: auto; color: var(--muted); font-size: var(--t-2xs); }

.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: stretch; margin-top: 16px; }
.funnel-panel { align-self: start; }
.rail { height: 0; min-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.rail .quotes { flex: 1; overflow-y: auto; overscroll-behavior: contain; }

.funnel { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 8px; padding: 6px 20px 0 12px; --plot: 200px; }
.fn-axis { height: var(--plot); display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.fn-axis span { line-height: 0; }
.fn-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fn-col { display: grid; grid-template-rows: var(--plot) auto; min-width: 0; }
.fn-col + .fn-col .fn-plot { box-shadow: inset 1px 0 0 var(--line); }
.fn-col + .fn-col .fn-meta { border-left: 1px solid var(--line); }
.fn-plot { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 8px; padding: 0 14%;
  background:
    linear-gradient(var(--line-2), var(--line-2)) 0 100% / 100% 1px no-repeat,
    linear-gradient(#edf0f6, #edf0f6) 0 75% / 100% 1px no-repeat,
    linear-gradient(#edf0f6, #edf0f6) 0 50% / 100% 1px no-repeat,
    linear-gradient(#edf0f6, #edf0f6) 0 25% / 100% 1px no-repeat,
    linear-gradient(#edf0f6, #edf0f6) 0 0 / 100% 1px no-repeat; }
.fn-bar-wrap { position: relative; height: 100%; flex: 1; max-width: 76px; }
.compare .fn-bar-wrap { max-width: 46px; }
.f-bar { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 6px 6px 2px 2px; transition: height .5s var(--ease); }
.f-bar.all { background: linear-gradient(180deg, #4a6bff, var(--seg-all)); }
.f-bar.small { background: linear-gradient(180deg, #23b6c9, var(--seg-small)); }
.f-bar.larger { background: linear-gradient(180deg, #9a76f7, var(--seg-larger)); }
.fn-ghost { position: absolute; left: 0; right: 0; border-radius: 6px 6px 0 0; background: rgba(229,83,61,.11); box-shadow: inset 0 2px 0 rgba(229,83,61,.55), inset 0 0 0 1px rgba(229,83,61,.18); transition: bottom .5s var(--ease), height .5s var(--ease); }
.fn-ghost.big { background: rgba(229,83,61,.24); box-shadow: inset 0 2px 0 var(--loss), inset 0 0 0 1px rgba(229,83,61,.4); }
.fn-val { position: absolute; left: 0; right: 0; text-align: center; transform: translateY(100%); padding-top: 4px; font-size: var(--t-2xs); font-weight: 650; color: #fff; transition: bottom .5s var(--ease); }
.fn-meta { display: grid; gap: 2px; align-content: start; padding: 12px 12px 16px; }
.fn-step { font-size: var(--t-sm); font-weight: 600; }
.fn-hint { font-size: var(--t-2xs); color: var(--muted); line-height: 1.35; min-height: 2.7em; }
.fn-counts { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--t-md); font-weight: 650; letter-spacing: -.01em; margin-top: 6px; }
.fn-counts span { display: inline-flex; align-items: center; gap: 6px; }
.fn-drops { display: grid; gap: 5px; justify-items: start; margin-top: 8px; }
.fn-start { font-size: var(--t-2xs); color: var(--muted); padding: 3px 0; }
.drop { display: inline-flex; align-items: center; gap: 5px; font-size: var(--t-2xs); color: var(--ink-2); padding: 2px 7px; border-radius: var(--r-xs); background: var(--neutral-50); border: 1px solid var(--line); line-height: 1.55; white-space: nowrap; }
.drop .ico { color: var(--muted); }
.drop b { font-weight: 700; font-variant-numeric: tabular-nums; }
.drop-n { color: var(--muted); }
.drop.big { background: var(--loss-50); border-color: var(--loss-100); color: var(--loss-ink); }
.drop.big .ico, .drop.big .drop-n { color: var(--loss-ink); }
.fn-ghost .leak-tag { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--loss-ink); color: #fff; font-size: 11.5px; font-weight: 650; padding: 2px 7px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px -2px rgba(185,58,38,.6); }
.drop.big b { color: var(--loss-ink); }
.notes { margin-top: 4px; padding: 12px 20px 14px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); display: grid; gap: 4px; }
.note { font-size: var(--t-xs); color: var(--muted); max-width: 110ch; }
.note b { color: var(--ink-2); font-weight: 600; }

.rail .quotes { border-top: 1px solid var(--line); }
.quote { padding: 14px 20px; display: grid; gap: 6px; border-bottom: 1px solid var(--line); }
.quote:last-child { border-bottom: 0; }
.quote-meta { display: flex; align-items: center; gap: 7px; font-size: var(--t-2xs); font-weight: 600; color: var(--ink-2); }
.quote-meta .theme { margin-left: auto; font-weight: 500; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); padding: 0 7px; border-radius: 999px; }
.quote blockquote { font-size: var(--t-sm); line-height: 1.5; color: var(--ink); text-wrap: pretty; }
.quote blockquote::before { content: "“"; }
.quote blockquote::after { content: "”"; }
.quote-who { font-size: var(--t-2xs); color: var(--muted); }
.quote-who b { color: var(--ink-2); font-weight: 600; }

/* ================= Test ================= */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.choice { position: relative; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: var(--sh-xs); display: flex; flex-direction: column; gap: 8px; }
.choice-top { display: flex; justify-content: space-between; align-items: center; }
.choice-tag { font-size: var(--t-2xs); font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 8px; border-radius: 999px; }
.choice[aria-pressed="true"] .choice-tag { background: var(--surface); border-color: var(--cobalt-100); color: var(--cobalt-600); }
.choice-title { font-size: var(--t-lg); font-weight: 600; letter-spacing: -.016em; line-height: 1.3; }
.hyp { color: var(--ink-2); font-size: var(--t-sm); line-height: 1.55; }
.linked { display: flex; align-items: center; gap: 8px; font-size: var(--t-2xs); color: var(--muted); padding-top: 10px; margin-top: 2px; border-top: 1px solid var(--line); }
.choice-cta { font-size: var(--t-xs); font-weight: 600; color: var(--cobalt-600); }
.choice[aria-pressed="true"] .choice-cta { color: var(--ink-2); }

.design { margin-top: 16px; }
.spec { border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; }
.spec-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 13px 20px; border-bottom: 1px solid var(--line); }
/* DOM order: audience, arms, primary metric, success, guardrail, also watched → arms leads full width, also-watched closes full width */
.spec-row:nth-child(1), .spec-row:nth-child(4) { border-right: 1px solid var(--line); }
.spec-row:nth-child(2), .spec-row:last-child { grid-column: span 2; }
.spec-row:nth-child(2) { order: -1; }
.spec-row:last-child { border-bottom: 0; }
.spec dt { display: flex; align-items: center; gap: 8px; font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); align-self: start; padding-top: 1px; }
.spec dt .ico { color: var(--muted); }
.spec dd { color: var(--ink-2); font-size: var(--t-sm); }
.spec dd b { color: var(--ink); font-weight: 600; }
.spec ul { margin: 0; padding-left: 16px; display: grid; gap: 3px; }
.arms { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.arm { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; background: var(--surface-2); }
.arm h4 { font-size: var(--t-2xs); font-weight: 650; color: var(--muted); margin-bottom: 2px; }
.arm.variant { background: var(--cobalt-50); border-color: var(--cobalt-100); }
.arm.variant h4 { color: var(--cobalt-600); }
.empty { border: 1px dashed var(--line-2); border-radius: var(--r-lg); padding: 28px; text-align: center; color: var(--muted); margin-top: 16px; display: grid; justify-items: center; gap: 8px; background: var(--surface-2); font-size: var(--t-sm); }

/* ================= Decide ================= */
.sealed-body { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; padding: 22px; align-items: center; }
.sealed-copy h2 { font-size: var(--t-lg); font-weight: 600; letter-spacing: -.015em; }
.sealed-copy > p { color: var(--ink-2); margin: 4px 0 14px; max-width: 72ch; font-size: var(--t-sm); }
.kv { display: grid; border-top: 1px solid var(--line); }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: var(--t-sm); }
.kv dt { color: var(--muted); }
.kv dd { font-weight: 600; text-align: right; }
.kv.compact { max-width: 560px; }
.sealed-cta { display: grid; gap: 6px; justify-items: stretch; }

.scorecard { overflow: hidden; }
.guard { display: grid; border-top: 1px solid var(--line); }
.guard.three { grid-template-columns: 1.15fr 1fr 1fr; }
.g-cell { padding: 14px 20px 16px; border-left: 1px solid var(--line); display: grid; align-content: start; gap: 3px; }
.g-cell:first-child { border-left: 0; }
.g-cell h4 { font-size: var(--t-sm); font-weight: 600; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; line-height: 1.35; }
.g-cell h4 .chip { margin-left: auto; }
.g-role { flex-basis: 100%; font-size: var(--t-2xs); color: var(--muted); font-weight: 500; }
.g-cell .vals { font-size: var(--t-kpi); font-weight: 650; letter-spacing: -.03em; margin: 6px 0 2px; line-height: 1.1; }
.g-line { font-size: var(--t-2xs); color: var(--muted); line-height: 1.5; }
.lift-tile { background: linear-gradient(180deg, var(--cobalt-50), transparent 75%); }
.vals.tone-pos { color: var(--gain-ink); }
.vals.tone-neg { color: var(--loss-ink); }
.vals.tone-neu { color: var(--ink); }
.g-bad .vals { color: var(--loss-ink); }
.g-bad { background: linear-gradient(180deg, rgba(229,83,61,.05), transparent 75%); }
.g-warn .vals { color: var(--amber-ink); }

.rtable { border-top: 1px solid var(--line); --rcols: minmax(170px, 1.25fr) 104px 104px minmax(150px, 1fr) minmax(220px, 1.7fr) minmax(150px, 1fr); }
.rhead, .res { display: grid; grid-template-columns: var(--rcols); gap: 14px; align-items: center; padding: 0 20px; }
.rhead { height: 40px; font-size: var(--t-2xs); font-weight: 600; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line); }
.rh-axis { align-self: end; padding-bottom: 2px; }
.iv-axis { display: block; overflow: visible; }
.iv-axis text { font-size: 10.5px; fill: var(--muted); font-variant-numeric: tabular-nums; font-family: inherit; }
.iv-axis text.z { fill: var(--ink); font-weight: 700; }
.iv-axis text.band-l { fill: var(--gain-ink); font-weight: 600; font-size: 10px; }
.res { width: 100%; min-height: 66px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); padding-top: 10px; padding-bottom: 10px; position: relative; }
#res-cards .res:last-child { border-bottom: 0; }
.res:hover:not([aria-pressed="true"]) { background: var(--surface-2); }
.res[aria-pressed="true"] { background: var(--cobalt-50); box-shadow: inset 0 0 0 1px var(--cobalt-100); }
.res:focus-visible { box-shadow: inset 0 0 0 2px var(--cobalt); }
.rc { display: grid; gap: 1px; min-width: 0; }
.rc b { font-size: var(--t-md); font-weight: 650; letter-spacing: -.01em; }
.rc small { font-size: var(--t-2xs); color: var(--muted); }
.rc-seg { display: flex; align-items: center; gap: 12px; }
.res-name { display: flex; align-items: center; gap: 8px; }
.res-name > span { display: grid; line-height: 1.3; }
.res-name b { font-size: var(--t-sm); font-weight: 600; }
.res-name small { font-size: var(--t-2xs); color: var(--muted); }
.lift { font-size: 1.375rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.lift.pos { color: var(--gain-ink); }
.lift.neg { color: var(--loss-ink); }
.lift.neu { color: var(--ink); }
.rc-verdict { display: flex; flex-wrap: wrap; gap: 5px; }
.iv { display: block; }
.iv-band { fill: rgba(14,159,110,.10); }
.iv-zero { stroke: var(--ink); stroke-width: 1.25; }
.iv-ci { stroke-width: 3; stroke-linecap: round; }
.iv-cap { stroke-width: 1.75; }
.iv-pt { stroke: #fff; stroke-width: 2; }
.iv-good .iv-ci, .iv-good .iv-cap { stroke: var(--gain); } .iv-good .iv-pt { fill: var(--gain); }
.iv-neutral .iv-ci, .iv-neutral .iv-cap { stroke: #7a8398; } .iv-neutral .iv-pt { fill: #7a8398; }
.iv-bad .iv-ci, .iv-bad .iv-cap { stroke: var(--loss); } .iv-bad .iv-pt { fill: var(--loss); }
.res[aria-pressed="true"] .iv-pt { stroke: var(--cobalt-50); }
.hint-line { color: var(--muted); font-size: var(--t-2xs); padding: 10px 20px 12px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }
/* one authored motion moment: intervals draw out from their estimate on reveal */
.results.animate .iv-row { transform-box: fill-box; transform-origin: center; animation: iv-grow .7s var(--ease) both; }
.results.animate .res:nth-child(2) .iv-row { animation-delay: .07s; }
.results.animate .res:nth-child(3) .iv-row { animation-delay: .14s; }
@keyframes iv-grow { from { transform: scaleX(.04); opacity: 0; } to { transform: none; opacity: 1; } }

.limits { display: flex; gap: 12px; background: var(--amber-50); border: 1px solid var(--amber-100); border-radius: var(--r-lg); padding: 12px 18px; font-size: var(--t-xs); color: var(--ink-2); }
.limits > .ico { color: var(--amber-ink); margin-top: 1px; }
.limits b { color: var(--amber-ink); font-weight: 650; }
.limits ul { margin: 4px 0 0; padding-left: 16px; display: grid; gap: 2px; }
.limits li b { color: var(--ink); }

details.stats { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin-top: 16px; box-shadow: var(--sh-xs); }
details.stats summary { cursor: pointer; padding: 12px 20px; list-style: none; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; border-radius: var(--r-lg); transition: background .15s var(--ease); }
details.stats summary:hover { background: var(--surface-2); }
details.stats summary::-webkit-details-marker { display: none; }
.sum-title { font-weight: 600; font-size: var(--t-sm); }
.sum-sub { color: var(--muted); font-size: var(--t-xs); }
.sum-ico { color: var(--muted); width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--surface); transition: transform .2s var(--ease); }
details.stats[open] .sum-ico { transform: rotate(180deg); }
details.stats[open] summary { border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; }
.stats-body { padding: 2px 20px 18px; }
h4.sub { font-size: var(--t-xs); font-weight: 600; margin: 18px 0 6px; color: var(--ink); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: var(--t-xs); }
th, td { padding: 8px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--surface-2); }
th:first-child, td:first-child { text-align: left; }
th { font-size: var(--t-2xs); color: var(--muted); font-weight: 600; background: var(--surface-2); }
td:first-child { font-weight: 600; }
.method { margin: 14px 0 0; padding-left: 16px; font-size: var(--t-xs); color: var(--ink-2); display: grid; gap: 4px; max-width: 120ch; }

.decide-panel .panel-head { padding-bottom: 12px; }
.decisions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 20px 20px; }
.dec { position: relative; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: start; box-shadow: var(--sh-xs); }
.dec-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--neutral-50); border: 1px solid var(--line); color: var(--ink-2); transition: all .15s var(--ease); }
.dec[aria-pressed="true"] .dec-ico { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
.dec-text { display: grid; gap: 1px; }
.dec-title { font-size: var(--t-md); font-weight: 600; letter-spacing: -.01em; }
.dec-desc { color: var(--muted); font-size: var(--t-xs); line-height: 1.45; }

.brief { overflow: hidden; }
.brief-band { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 11px 20px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.brief-kind { font-size: var(--t-xs); font-weight: 650; color: var(--ink); }
.brief-meta { display: flex; gap: 18px; }
.brief-meta > div { display: flex; gap: 5px; font-size: var(--t-xs); }
.brief-meta dt { color: var(--muted); }
.brief-meta dd { font-weight: 600; }
.brief-band .chip { margin-left: auto; }
.fit-well .brief-band { background: var(--gain-50); border-bottom-color: var(--gain-100); }
.fit-partly .brief-band { background: var(--amber-50); border-bottom-color: var(--amber-100); }
.fit-weak .brief-band { background: var(--loss-50); border-bottom-color: var(--loss-100); }
.brief-body { padding: 20px; }
.brief h2 { font-size: var(--t-xl); font-weight: 650; letter-spacing: -.022em; line-height: 1.2; text-wrap: balance; max-width: 34ch; }
.brief .lead { font-size: var(--t-base); color: var(--ink-2); margin: 6px 0 18px; max-width: 80ch; }
.brief-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.brief-cols > div { padding: 14px 18px 0; border-left: 1px solid var(--line); }
.brief-cols > div:first-child { border-left: 0; padding-left: 0; }
.brief-cols > div:last-child { padding-right: 0; }
.brief-cols h4 { font-size: var(--t-xs); font-weight: 650; color: var(--ink); margin-bottom: 8px; }
.brief-cols ul { margin: 0; padding-left: 16px; display: grid; gap: 8px; }
.brief-cols li { font-size: var(--t-sm); line-height: 1.55; color: var(--ink-2); }
.brief-cols li::marker { color: var(--line-2); }
.brief-actions { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ================= Responsive ================= */
@media (max-width: 1280px) {
  .grid-main { grid-template-columns: 1fr; }
  .rail { height: auto; min-height: 0; }
  .rtable { --rcols: minmax(160px, 1.2fr) 92px 92px minmax(130px, 1fr) minmax(190px, 1.5fr) 140px; }
}
@media (max-width: 1100px) {
  .kpi-row, .kpis.two .kpi-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi-seg { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line); }
  .kpi { border-top: 1px solid var(--line); }
  .kpi-row > .kpi:nth-child(-n+3), .kpi-seg ~ .kpi:nth-child(-n+4) { border-top: 0; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .spec { grid-template-columns: 1fr; }
  .spec-row:nth-child(1), .spec-row:nth-child(4) { border-right: 0; }
  .spec-row:nth-child(2), .spec-row:last-child { grid-column: auto; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px 16px; gap: 12px; }
  .sb-workspace, .sb-question, .sb-foot { display: none; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step { grid-template-columns: auto 1fr; padding: 6px; }
  .step .s, .step-state { display: none; }
  .topbar { padding: 0 16px; }
  main { padding: 18px 16px 8px; }
  .foot { padding: 16px; }
  .kpi-row, .kpis.two .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { border-top: 1px solid var(--line) !important; }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi-seg ~ .kpi { border-left: 1px solid var(--line); }
  .kpi-seg ~ .kpi:nth-child(even) { border-left: 0; }
  .choices, .guard.three, .decisions, .brief-cols, .arms, .sealed-body { grid-template-columns: 1fr; }
  .g-cell { border-left: 0; border-top: 1px solid var(--line); }
  .g-cell:first-child { border-top: 0; }
  .brief-cols > div { border-left: 0; padding: 14px 0 0; }
  .spec-row { grid-template-columns: 1fr; gap: 6px; }
  .seg { flex-wrap: wrap; }
  .funnel { --plot: 160px; padding: 6px 12px 0 4px; }
  .fn-plot { padding: 0 8%; gap: 4px; }
  .fn-meta { padding: 10px 6px 14px; }
  .fn-hint { display: none; }
  .drop .drop-n, .drop .big-tag { display: none; }
  .rhead { display: none; }
  .res { grid-template-columns: 1fr 1fr; row-gap: 8px; padding: 14px 16px; }
  .rc-seg, .rc-iv, .rc-verdict { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
