:root {
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem; --space-5: 1.25rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem; --space-16: 4rem;

  --paper: #f5f2ea;
  --surface: #fffdf8;
  --surface-2: #efebe1;
  --ink: #1b1d1a;
  --ink-2: #4a4d47;
  --ink-3: #6f716a;
  --line: #ddd8cb;
  --accent: #1f5c47;
  --accent-ink: #ffffff;
  --accent-soft: #dfeae3;
  --go: #1f7a4d; --go-soft: #dcefe3;
  --refine: #9a6200; --refine-soft: #f6ead2;
  --avoid: #a63a2b; --avoid-soft: #f6dfda;

  --font-display: 'Cabinet Grotesk', 'Satoshi', system-ui, sans-serif;
  --font-body: 'Satoshi', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 10px;
  --shadow: 0 1px 0 rgba(27,29,26,.04), 0 6px 24px -12px rgba(27,29,26,.18);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-body); font-size: var(--text-base); line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.wrap { width: min(1240px, 100% - 2 * var(--space-6)); margin-inline: auto; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.tiny { font-size: var(--text-xs); }
.eyebrow { margin: 0 0 var(--space-1); font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 700; }
.h-lg { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.1; margin: var(--space-6) 0 var(--space-3); letter-spacing: -.01em; }
.h-md { font-family: var(--font-body); font-weight: 700; font-size: var(--text-lg); line-height: 1.25; margin: 0; }
.h-sm { font-weight: 700; font-size: var(--text-base); margin: 0 0 var(--space-3); }
.lead { color: var(--ink-2); max-width: 60ch; margin: 0; }

/* top bar */
.topbar { border-bottom: 1px solid var(--line); background: color-mix(in oklab, var(--paper) 88%, white); position: sticky; top: 0; z-index: 20; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; padding-block: var(--space-3); gap: var(--space-4); }
.brand { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand span { color: var(--accent); }
.top-actions { display: flex; align-items: center; gap: var(--space-3); }

/* layout */
.layout { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: var(--space-8); padding-block: var(--space-8) var(--space-16); align-items: start; }
.panel { display: grid; gap: var(--space-4); }
.stage { min-width: 0; }
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: var(--space-6); padding-top: var(--space-6); }
  .panel { position: static; }
}

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); box-shadow: var(--shadow); }
.connect { border-color: color-mix(in oklab, var(--accent) 35%, var(--line)); }
.row { display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
@media (max-width: 420px) { .grid-2 { grid-template-columns: 1fr; } }

.field { display: grid; gap: var(--space-1); margin: 0 0 var(--space-4); border: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-size: var(--text-sm); font-weight: 500; color: var(--ink-2); }
input[type=text], input[type=password], select, textarea {
  width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: var(--space-2) var(--space-3); font-size: var(--text-sm); min-height: 42px;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.check { display: flex; gap: var(--space-2); align-items: flex-start; font-size: var(--text-sm); margin-bottom: var(--space-4); }
.check input { margin-top: 4px; accent-color: var(--accent); }

.btn { border: 1px solid transparent; border-radius: 8px; padding: var(--space-2) var(--space-4); min-height: 42px; font-size: var(--text-sm); font-weight: 700; cursor: pointer; transition: background .15s, border-color .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in oklab, var(--accent) 86%, black); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-block + .btn-block, .form-msg + .btn-block { margin-top: var(--space-2); }
.link { font-size: var(--text-sm); font-weight: 500; }
.form-msg { min-height: 1.2em; margin: var(--space-2) 0 0; color: var(--avoid); }

.pill { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); font-weight: 700; padding: 2px var(--space-2); border-radius: 999px; white-space: nowrap; }
.pill-muted { background: var(--surface-2); color: var(--ink-2); }
.pill-ok { background: var(--go-soft); color: var(--go); }
.pill-warn { background: var(--refine-soft); color: var(--refine); }
.pill-bad { background: var(--avoid-soft); color: var(--avoid); }

/* empty state */
.empty { padding: var(--space-8) 0; max-width: 720px; }
.empty-diagram { position: relative; width: min(340px, 100%); aspect-ratio: 300 / 170; }
.wires { position: absolute; inset: 0; width: 100%; height: 100%; }
.wires path { fill: none; stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 4 5; animation: flow 1.6s linear infinite; opacity: .7; }
@keyframes flow { to { stroke-dashoffset: -18; } }
.node { position: absolute; font-size: var(--text-xs); font-weight: 700; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; transform: translate(-50%, -50%); box-shadow: var(--shadow); }
.n1 { left: 13%; top: 16%; } .n2 { left: 37%; top: 16%; } .n3 { left: 63%; top: 16%; } .n4 { left: 87%; top: 16%; }
.judge { left: 50%; top: 82%; background: var(--accent); color: #fff; border-color: var(--accent); }
.steps { list-style: none; padding: 0; margin: var(--space-6) 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-3); counter-reset: s; }
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); font-size: var(--text-sm); color: var(--ink-2); }
.steps li::before { content: counter(s, decimal-leading-zero); display: block; font-family: var(--font-mono); color: var(--accent); font-weight: 700; margin-bottom: var(--space-1); }
.steps b { color: var(--ink); }
@media (max-width: 600px) { .steps { grid-template-columns: 1fr; } }

/* run view */
.run-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-4); margin-bottom: var(--space-4); }
.lanes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 640px) { .lanes { grid-template-columns: 1fr; } }
.lane { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); display: grid; gap: var(--space-2); min-height: 120px; }
.lane-head { display: flex; justify-content: space-between; gap: var(--space-2); align-items: center; }
.lane-name { font-weight: 700; font-size: var(--text-sm); }
.lane-model { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); word-break: break-all; }
.lane-body { font-size: var(--text-sm); color: var(--ink-2); }
.lane-meta { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--ink-3); }
.judge-lane { margin-top: var(--space-3); }
.judge-lane .lane { border-color: color-mix(in oklab, var(--accent) 40%, var(--line)); background: color-mix(in oklab, var(--accent-soft) 45%, var(--surface)); }
.bar { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 40%; background: var(--accent); border-radius: 99px; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.skel { height: 10px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, #f7f4ec 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* report */
.banner { border-radius: var(--radius); padding: var(--space-3) var(--space-4); font-size: var(--text-sm); margin-bottom: var(--space-4); background: var(--refine-soft); color: #5d3c00; border: 1px solid color-mix(in oklab, var(--refine) 30%, transparent); }
.report-head { display: grid; grid-template-columns: auto 1fr; gap: var(--space-6); align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-6); box-shadow: var(--shadow); }
@media (max-width: 640px) { .report-head { grid-template-columns: 1fr; } }
.gauge { width: 132px; height: 132px; position: relative; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge circle { fill: none; stroke-width: 10; }
.gauge .track { stroke: var(--surface-2); }
.gauge .val { stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.gauge-num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge-num b { font-family: var(--font-mono); font-size: var(--text-xl); line-height: 1; }
.gauge-num small { font-size: var(--text-xs); color: var(--ink-3); }
.verdict-tag { display: inline-block; font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); letter-spacing: .02em; padding: 2px var(--space-3); border-radius: 6px; }
.v-GO { background: var(--go-soft); color: var(--go); }
.v-REFINE { background: var(--refine-soft); color: var(--refine); }
.v-AVOID { background: var(--avoid-soft); color: var(--avoid); }
.report-title { margin: var(--space-2) 0 var(--space-2); font-weight: 700; font-size: var(--text-lg); line-height: 1.3; }
.subscores { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
@media (max-width: 640px) { .subscores { grid-template-columns: repeat(2, 1fr); } }
.sub label { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--ink-2); margin-bottom: 4px; gap: var(--space-2); }
.sub .meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.sub .meter i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

.toolbar { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-4) 0; }
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; margin-bottom: var(--space-4); }
.tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: var(--space-3) var(--space-3); font-size: var(--text-sm); font-weight: 700; color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.tab[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.tabpanel { display: grid; gap: var(--space-4); }
.sec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-5); }
.sec h3 { margin: 0 0 var(--space-3); font-size: var(--text-base); font-weight: 700; display: flex; justify-content: space-between; gap: var(--space-2); align-items: center; }
.sec p { margin: 0 0 var(--space-2); }
.sec ul, .sec ol { margin: 0; padding-left: 1.2em; display: grid; gap: var(--space-2); }
.sec li { font-size: var(--text-sm); }
.ev { display: block; color: var(--ink-3); font-size: var(--text-xs); margin-top: 2px; }
.tbl-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
th, td { text-align: left; vertical-align: top; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--line); }
th { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
td.num { font-family: var(--font-mono); white-space: nowrap; }
.dis { border-left: 3px solid var(--refine); padding-left: var(--space-3); display: grid; gap: var(--space-2); }
.dis + .dis { margin-top: var(--space-4); }
.pos { display: grid; grid-template-columns: 110px 1fr; gap: var(--space-2); font-size: var(--text-sm); }
.pos b { font-size: var(--text-xs); color: var(--ink-2); padding-top: 2px; }
@media (max-width: 480px) { .pos { grid-template-columns: 1fr; gap: 0; } }
.res { font-size: var(--text-sm); background: var(--accent-soft); border-radius: 6px; padding: var(--space-2) var(--space-3); }
.copyblock { background: #fff; border: 1px dashed var(--line); border-radius: 8px; padding: var(--space-4); font-size: var(--text-sm); white-space: pre-wrap; word-break: break-word; }
.headline { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); line-height: 1.2; margin-bottom: var(--space-2); }
.modules { counter-reset: m; list-style: none; padding: 0 !important; }
.modules li { counter-increment: m; display: grid; grid-template-columns: 34px 1fr; gap: var(--space-2); }
.modules li::before { content: counter(m, decimal-leading-zero); font-family: var(--font-mono); color: var(--accent); font-weight: 700; }
.timeline { list-style: none; padding: 0 !important; }
.timeline li { display: grid; grid-template-columns: 90px 1fr; gap: var(--space-3); border-bottom: 1px solid var(--line); padding-bottom: var(--space-2); }
.timeline b { font-family: var(--font-mono); font-size: var(--text-xs); color: var(--accent); padding-top: 3px; }
.price-big { font-family: var(--font-mono); font-size: var(--text-xl); font-weight: 700; }
.unv { font-size: var(--text-xs); color: var(--refine); font-weight: 700; }
details.raw { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
details.raw summary { cursor: pointer; font-weight: 700; font-size: var(--text-sm); }
details.raw pre { white-space: pre-wrap; word-break: break-word; font-family: var(--font-mono); font-size: var(--text-xs); max-height: 420px; overflow: auto; }
.src { font-size: var(--text-sm); word-break: break-word; }

.history { list-style: none; margin: 0 0 var(--space-2); padding: 0; display: grid; gap: var(--space-2); }
.history button { width: 100%; text-align: left; background: var(--surface-2); border: 0; border-radius: 8px; padding: var(--space-2) var(--space-3); cursor: pointer; font-size: var(--text-sm); display: flex; justify-content: space-between; gap: var(--space-2); }
.history button:hover { background: var(--accent-soft); }

/* drawer */
.drawer { position: fixed; inset: 0; z-index: 50; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(27,29,26,.35); animation: fade .2s; }
.drawer-body { position: absolute; right: 0; top: 0; bottom: 0; width: min(480px, 100%); background: var(--surface); padding: var(--space-6); overflow-y: auto; animation: slidein .25s cubic-bezier(.2,.8,.2,1); box-shadow: -12px 0 40px -20px rgba(0,0,0,.4); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-6); }
.drawer hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-6) 0; }
@keyframes fade { from { opacity: 0; } }
@keyframes slidein { from { transform: translateX(30px); opacity: .4; } }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border-radius: 8px; padding: 3px; gap: 3px; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: var(--space-2); border-radius: 6px; font-size: var(--text-sm); font-weight: 700; cursor: pointer; color: var(--ink-2); }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.pickers { display: grid; gap: 0; }
.pickers select:disabled { background: var(--surface-2); color: var(--ink-2); }

.toast { position: fixed; bottom: var(--space-6); left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: var(--space-2) var(--space-4); border-radius: 8px; font-size: var(--text-sm); z-index: 60; box-shadow: var(--shadow); max-width: calc(100% - 2rem); }

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

/* v1.1 additions */
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.banner-ok { background: var(--accent-soft); color: var(--ink); border-color: color-mix(in oklab, var(--accent) 30%, transparent); }
table.cmp td { vertical-align: middle; }
table.cmp td:first-child { min-width: 200px; }
.sort { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink-2); cursor: pointer; }
.sort.on { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.sort:focus-visible, .linkbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.linkbtn:hover { color: var(--accent); text-decoration: underline; }
#printView { display: none; }

@media print {
  @page { size: A4; margin: 16mm 14mm; }
  body { background: #fff !important; }
  body > *:not(#printView) { display: none !important; }
  #printView { display: block !important; color: #111; font-size: 10.5pt; }
  #printView h1 { font-family: var(--font-display); font-size: 20pt; margin: 4px 0 6px; }
  #printView h2 { font-family: var(--font-display); font-size: 14pt; margin: 0 0 8px; padding-top: 6px; border-top: 2px solid #111; }
  #printView .pv-brand { font-family: var(--font-display); font-weight: 800; font-size: 11pt; }
  #printView .pv-brand span { color: var(--accent); }
  #printView .pv-meta { color: #555; font-size: 9pt; }
  #printView .pv-verdict { font-size: 10.5pt; }
  #printView .pv-part { margin-top: 14px; }
  #printView .pv-part + .pv-part { break-before: page; }
  #printView .sec { break-inside: avoid; margin-bottom: 10px; border: 0; padding: 0; box-shadow: none; background: none; }
  #printView .sec h3 { font-size: 11pt; margin: 8px 0 4px; }
  #printView .copyblock { white-space: pre-wrap; border: 1px solid #ccc; padding: 8px; border-radius: 4px; background: #fafafa; }
  #printView table { width: 100%; border-collapse: collapse; font-size: 9pt; }
  #printView th, #printView td { border-bottom: 1px solid #ddd; padding: 4px; text-align: left; }
  #printView a { color: #111; text-decoration: underline; }
  #printView .verdict-tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #printView .tbl-wrap { overflow: visible; }
}
.history .verdict-tag { align-self: flex-start; flex: none; }

/* v1.2: easier onboarding and per-AI view */
.btn-big { min-height: 52px; font-size: var(--text-base); }
.connect .eyebrow, #ideaForm .eyebrow { margin: 0 0 var(--space-1); }
.codebox { display: grid; gap: var(--space-2); margin-top: var(--space-2); padding-top: var(--space-3); border-top: 1px dashed var(--line); }
details.alt, details.more { margin-top: var(--space-3); }
details.alt summary, details.more summary { cursor: pointer; font-size: var(--text-sm); font-weight: 700; color: var(--ink-2); padding: var(--space-2) 0; }
details.alt summary:hover, details.more summary:hover { color: var(--accent); }
details.alt[open] summary, details.more[open] summary { margin-bottom: var(--space-2); }
#ideaForm .field > .h-sm { display: block; margin-bottom: var(--space-2); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: calc(-1 * var(--space-1)) 0 var(--space-2); }
.chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: var(--text-xs); font-weight: 700; cursor: pointer; }
.chip:hover { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in oklab, var(--accent) 30%, var(--line)); }
.chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tier { padding: var(--space-4); display: grid; gap: var(--space-1); }
.tier p { margin: 0; }
.tier-title { font-size: var(--text-sm); font-weight: 700; display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.linkbtn.tiny { font-size: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.seg { grid-template-columns: repeat(4, 1fr); }
.step-label { font-size: var(--text-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); margin: var(--space-4) 0 var(--space-2); }
.step-intro { margin: 0 0 var(--space-3); font-size: var(--text-sm); }
.sstrip { display: grid; gap: var(--space-2); }
.srow { display: grid; grid-template-columns: minmax(80px, 140px) 1fr 36px 72px; gap: var(--space-3); align-items: center; font-size: var(--text-sm); }
.srow .slabel { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srow .verdict-tag { font-size: var(--text-xs); justify-self: start; }
.sbar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.sbar i { display: block; height: 100%; background: var(--ink-3); border-radius: inherit; }
.srow.comb { border-top: 1px solid var(--line); padding-top: var(--space-2); }
.srow.comb .sbar i { background: var(--accent); }
.ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
@media (max-width: 760px) { .ai-grid { grid-template-columns: 1fr; } .srow { grid-template-columns: 90px 1fr 30px 64px; gap: var(--space-2); } }
.ai-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); display: grid; gap: var(--space-2); align-content: start; }
.ai-card header { display: flex; align-items: center; gap: var(--space-2); }
.ai-card header .verdict-tag { font-size: var(--text-xs); }
.ai-card .ai-score { margin-left: auto; font-size: var(--text-lg); }
.ai-card p { margin: 0; font-size: var(--text-sm); }
.kp { margin: var(--space-1) 0 0; padding-left: 1.1em; font-size: var(--text-sm); display: grid; gap: 4px; }
.ai-card details.raw { padding: var(--space-2) var(--space-3); }
.ai-card details.raw ul { padding-left: 1.1em; margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.next-row { display: flex; justify-content: flex-end; margin-top: var(--space-4); }
.cb { min-height: 100vh; display: grid; place-items: center; padding: var(--space-6); }
.cb .card { max-width: 420px; display: grid; gap: var(--space-3); }
.cb .brand { font-family: var(--font-display); font-weight: 800; margin: 0; }
.cb .brand span { color: var(--accent); }
[hidden] { display: none !important; }
.means { font-size: var(--text-sm); margin: 0 var(--space-2); }
.sub-help { display: block; font-size: 11px; color: var(--ink-3, var(--ink-2)); margin-top: 4px; line-height: 1.3; }
.next-btn { margin-top: var(--space-4); }
.run-hint { text-align: center; margin: var(--space-2) 0 0; }
#sampleBtn2 { margin-top: var(--space-6); }
.price-big small { font-size: var(--text-sm); font-weight: 500; }
.side-extra { display: grid; gap: var(--space-2); padding: var(--space-4); }
.center { text-align: center; }
#keyLinkRow { margin: var(--space-2) 0 0; }

/* discovery */
.seg.seg-2 { grid-template-columns: 1fr 1fr; margin-bottom: var(--space-3); }
.disc-head { margin-bottom: var(--space-4); }
.disc-head h2 { margin: var(--space-1) 0 var(--space-2); }
.rec { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; justify-content: space-between; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-3) var(--space-4); margin-top: var(--space-3); }
.rec > div { flex: 1 1 260px; min-width: 0; }
.rec p { margin: var(--space-1) 0 0; }
.opp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-4); margin-bottom: var(--space-4); display: grid; gap: var(--space-2); }
.opp-rec { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.opp p { margin: 0; }
.opp-head { display: grid; grid-template-columns: auto 1fr auto; gap: var(--space-3); align-items: start; }
.opp-rank { font-size: var(--text-lg, 1.25rem); font-weight: 700; color: var(--accent); }
.opp-title h3 { margin: 0; font-size: var(--text-base, 1rem); line-height: 1.3; }
.opp-score { text-align: right; white-space: nowrap; }
.opp-score b { font-size: 1.5rem; }
.opp-score small { color: var(--ink-3); }
.opp-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.opp-subs { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); }
.opp-subs .sub label { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--ink-2); gap: 4px; }
.opp-subs .meter { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.opp-subs .meter i { display: block; height: 100%; background: var(--accent); }
.opp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.opp-grid ul, .opp ul { margin: 0; padding-left: 1.1em; font-size: var(--text-sm); }
.opp-lbl { font-size: var(--text-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: var(--space-2) 0 var(--space-1) !important; }
.opp-product { background: var(--surface-2); border-radius: 8px; padding: var(--space-3); }
.opp > .btn { justify-self: start; }
.ai-opps { margin: 0; padding-left: 1.2em; font-size: var(--text-sm); display: grid; gap: var(--space-2); }
@media (max-width: 640px) {
  .opp-subs { grid-template-columns: 1fr 1fr; }
  .opp-grid { grid-template-columns: 1fr; }
  .opp > .btn, .rec .btn { justify-self: stretch; width: 100%; }
}
@media print { .opp { break-inside: avoid; } }
.opp, .opp > *, .opp-title { min-width: 0; }
.opp-tags .pill { white-space: normal; }
.opp a { overflow-wrap: anywhere; }

/* members */
.member-pill { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#memberCard { display: grid; gap: var(--space-3); }
#memberCard .eyebrow, #memberCard h2, #memberCard p { margin: 0; }
a.btn { text-decoration: none; text-align: center; }
@media (max-width: 520px) {
  .top-actions { gap: var(--space-2); }
  #creditPill { font-size: var(--text-xs); }
}
