:root {
  --paper: #f4f1e8;
  --ink: #161713;
  --muted: #66675e;
  --line: #c8c5bb;
  --white: #fffdf8;
  --blue: #2159f5;
  --green: #45df83;
  --coral: #f06c58;
  --yellow: #f2ce54;
  --radius: 6px;
  font-family: Geist, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; background: var(--paper); }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.skip { position: fixed; top: -100px; left: 16px; z-index: 20; background: var(--ink); color: white; padding: 12px; }
.skip:focus { top: 16px; }
main { width: 100%; max-width: 100%; overflow-x: hidden; }
.topbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 4vw; border-bottom: 1px solid var(--line); background: rgba(244,241,232,.95); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 750; text-decoration: none; }
.brand-mark { width: 18px; height: 18px; border: 5px solid var(--blue); border-top-color: var(--green); border-radius: 50%; }
.nav-actions, .command-row { display: flex; align-items: center; gap: 10px; }
.local-note { color: var(--muted); font-size: .82rem; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--ink); background: transparent; font-size: 1.4rem; }
.hero { display: grid; grid-template-columns: minmax(0, 7fr) minmax(350px, 5fr); gap: 5vw; padding: 72px 4vw 48px; border-bottom: 1px solid var(--line); }
.hero-copy { align-self: center; }
.eyebrow { margin: 0 0 10px; color: var(--blue); font-size: .72rem; text-transform: uppercase; font-weight: 800; letter-spacing: .08em; }
h1 { max-width: 72rem; margin: 0; font-size: clamp(2.5rem, 5vw, 4.75rem); line-height: .98; letter-spacing: 0; }
.lede { max-width: 42rem; font-size: clamp(1rem, 1.6vw, 1.3rem); line-height: 1.5; color: var(--muted); }
.field { display: grid; gap: 7px; min-width: 0; }
.field > span { font-size: .78rem; font-weight: 750; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); color: var(--ink); }
.field textarea { resize: vertical; }
.field-wide { max-width: 44rem; margin-top: 28px; }
.compass { min-height: 480px; padding: 26px; background: var(--ink); color: var(--white); border-radius: var(--radius); display: flex; flex-direction: column; }
.compass-topline { display: flex; justify-content: space-between; color: #c9c9c2; font-size: .78rem; }
.confidence { color: var(--green); }
.compass-orbit { position: relative; width: min(270px, 70vw); aspect-ratio: 1; margin: 22px auto 18px; }
.orbit-ring { position: absolute; inset: 0; border-radius: 50%; border: 18px solid #30312d; border-top-color: var(--green); border-right-color: var(--blue); transform: rotate(22deg); }
.needle { position: absolute; width: 44%; height: 3px; background: var(--coral); left: 50%; top: 50%; transform-origin: left center; transform: rotate(-26deg); transition: transform .45s ease; }
.needle::after { content: ""; position: absolute; right: -7px; top: -6px; border: 7px solid transparent; border-left-color: var(--coral); }
.orbit-center { position: absolute; inset: 27%; background: var(--ink); border-radius: 50%; display: grid; place-content: center; text-align: center; }
.orbit-center span { font-size: 3rem; font-weight: 850; }
.orbit-center small { color: #aaa; }
.compass h2 { margin: 0 0 8px; font-size: 2rem; }
.compass p { margin: 0; color: #c9c9c2; line-height: 1.45; }
.next-action { margin-top: auto; padding-top: 18px; border-top: 1px solid #3e3f3a; display: grid; gap: 5px; }
.next-action span { color: #979890; font-size: .72rem; text-transform: uppercase; }
.next-action strong { line-height: 1.35; }
.decision-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(310px, 4fr); grid-auto-flow: dense; border-bottom: 1px solid var(--line); }
.panel { padding: 48px 4vw; }
.controls-panel { border-right: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-heading h2, .comparison-intro h2, .brief-section h2, .scenario-bar h2 { margin: 0; font-size: clamp(1.45rem, 2.4vw, 2.2rem); }
.section-heading output, .section-heading > span { color: var(--muted); font-size: .8rem; text-align: right; }
.slider-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 28px; }
.slider-field { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.slider-field label { font-weight: 700; font-size: .86rem; }
.slider-field output { font-variant-numeric: tabular-nums; color: var(--blue); font-weight: 800; }
.slider-field input { grid-column: 1 / -1; width: 100%; accent-color: var(--blue); }
.constraint-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--line); }
.evidence-list { display: grid; gap: 8px; }
.evidence-row { display: grid; grid-template-columns: 1fr 105px; gap: 12px; align-items: center; min-height: 48px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.evidence-row label { font-size: .88rem; font-weight: 650; }
.evidence-row select { min-height: 36px; border: 1px solid var(--line); background: var(--white); }
.comparison-section { display: grid; grid-template-columns: minmax(280px, 4fr) minmax(0, 8fr); gap: 4vw; padding: 96px 4vw; background: var(--white); }
.comparison-intro { align-self: start; position: sticky; top: 96px; }
.comparison-intro p:last-child { max-width: 28rem; color: var(--muted); line-height: 1.55; }
.mode-list { display: grid; gap: 10px; }
.mode-row { min-height: 150px; display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 18px; padding: 22px; background: var(--paper); border: 1px solid var(--line); transition: transform .35s ease, background .35s ease; }
.mode-row:hover { transform: translateX(-6px); }
.mode-row.selected { background: var(--ink); color: white; }
.mode-row h3 { margin: 0 0 8px; font-size: 1.35rem; }
.mode-row p { margin: 0; color: var(--muted); line-height: 1.45; }
.mode-row.selected p { color: #bdbeb7; }
.mode-stat { display: grid; align-content: space-between; border-left: 1px solid var(--line); padding-left: 16px; }
.mode-stat span { color: var(--muted); font-size: .72rem; text-transform: uppercase; }
.mode-row.selected .mode-stat span { color: #9ea099; }
.mode-stat strong { font-size: 1.4rem; }
.brief-section { display: grid; grid-template-columns: minmax(280px, 5fr) minmax(0, 7fr); gap: 5vw; padding: 84px 4vw; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.brief-copy > p:not(.eyebrow) { color: var(--muted); line-height: 1.5; }
.brief-copy .field { margin-top: 18px; }
.validation { min-height: 20px; margin: 5px 0; color: #a1281e; font-size: .82rem; }
.brief-output { min-width: 0; }
.brief-output pre { min-height: 390px; max-height: 500px; overflow: auto; white-space: pre-wrap; margin: 0 0 14px; padding: 24px; background: var(--ink); color: #e7e7de; border-radius: var(--radius); line-height: 1.5; font: .82rem/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
.button { min-height: 42px; padding: 0 17px; border: 1px solid var(--ink); border-radius: 3px; font-weight: 800; }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.button.secondary { background: transparent; color: var(--ink); }
.scenario-bar { display: grid; grid-template-columns: 1.2fr 1.4fr auto; gap: 20px; align-items: end; padding: 44px 4vw; }
.saved-list { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.saved-chip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); background: var(--white); }
.saved-chip button { border: 0; background: transparent; color: #a1281e; }
footer { min-height: 110px; padding: 30px 4vw; display: flex; justify-content: space-between; align-items: center; background: var(--ink); color: #bdbeb7; }
.text-button { border: 0; background: transparent; color: white; text-decoration: underline; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 20; max-width: 340px; padding: 14px 18px; background: var(--ink); color: white; border-left: 5px solid var(--green); transform: translateY(150%); transition: transform .25s ease; }
.toast.show { transform: translateY(0); }

body.preview-mode .topbar, body.preview-mode footer, body.preview-mode .scenario-bar { display: none; }
body.preview-mode .hero { min-height: 630px; height: 630px; padding-top: 42px; padding-bottom: 42px; overflow: hidden; }
body.preview-mode .hero-copy::before { content: attr(data-promise); display: inline-block; margin-bottom: 16px; padding: 8px 11px; background: var(--blue); color: white; font-size: 1rem; font-weight: 850; }
body.preview-mode .field-wide { display: none; }
body.preview-mode .decision-grid, body.preview-mode .comparison-section, body.preview-mode .brief-section { display: none; }
body.preview-brief .hero { display: none; }
body.preview-brief .brief-section { display: grid; height: 630px; min-height: 630px; padding-top: 48px; padding-bottom: 48px; background: var(--paper); overflow: hidden; }

@media (max-width: 850px) {
  .hero, .decision-grid, .comparison-section, .brief-section { grid-template-columns: 1fr; }
  .hero { padding-top: 48px; }
  .compass { min-height: 430px; }
  .controls-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .comparison-intro { position: static; }
  .constraint-grid { grid-template-columns: 1fr; }
  .scenario-bar { grid-template-columns: 1fr; align-items: stretch; }
  .saved-list { grid-column: auto; }
  body.preview-mode .hero { grid-template-columns: 1.05fr .95fr; }
}
@media (max-width: 850px) {
  body.preview-mode .hero { height: 315px; min-height: 315px; gap: 18px; padding: 24px; }
  body.preview-mode h1 { font-size: clamp(1.35rem, 5vw, 3.2rem); }
  body.preview-mode .hero-copy::before { margin-bottom: 8px; padding: 5px 7px; font-size: .72rem; }
  body.preview-mode .eyebrow { margin-bottom: 6px; font-size: .55rem; }
  body.preview-mode .lede { margin: 10px 0 0; font-size: .72rem; line-height: 1.25; }
  body.preview-mode .compass { height: 267px; min-height: 0; padding: 14px; overflow: hidden; }
  body.preview-mode .compass-orbit { width: min(150px, 26vw); margin: 10px auto 8px; }
  body.preview-mode .orbit-ring { border-width: 10px; }
  body.preview-mode .orbit-center span { font-size: 1.5rem; }
  body.preview-mode .compass h2 { margin-bottom: 4px; font-size: 1.1rem; }
  body.preview-mode .compass p { max-height: 2.6em; overflow: hidden; font-size: .65rem; }
  body.preview-mode .next-action { margin-top: 8px; padding-top: 8px; }
  body.preview-mode .next-action strong { max-height: 2.6em; overflow: hidden; font-size: .62rem; }
  body.preview-mode .next-action span { font-size: .55rem; }
  body.preview-brief .brief-section { grid-template-columns: 1fr 1.15fr; gap: 18px; padding: 24px; }
  body.preview-brief .brief-section h2 { font-size: 1.25rem; }
  body.preview-brief .brief-copy > p:not(.eyebrow) { margin: 8px 0; font-size: .72rem; }
  body.preview-brief .brief-copy .field { margin-top: 10px; }
  body.preview-brief .field > span { font-size: .6rem; }
  body.preview-brief .field input, body.preview-brief .field textarea { min-height: 30px; padding: 6px 8px; font-size: .65rem; }
  body.preview-brief .brief-output pre { min-height: 240px; max-height: 240px; padding: 12px; font-size: .55rem; line-height: 1.3; }
  body.preview-brief .button { min-height: 30px; padding: 0 8px; font-size: .62rem; }
}
@media (max-width: 560px) {
  .local-note { display: none; }
  .topbar { padding-left: 18px; padding-right: 18px; }
  .hero, .panel, .comparison-section, .brief-section, .scenario-bar { padding-left: 18px; padding-right: 18px; }
  h1 { font-size: 2.6rem; }
  .slider-grid, .mode-row { grid-template-columns: 1fr; }
  .mode-stat { border-left: 0; border-top: 1px solid var(--line); padding: 12px 0 0; gap: 5px; }
  .brief-output pre { min-height: 320px; }
  footer { align-items: flex-start; gap: 20px; flex-direction: column; }
  .command-row { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; }
}
