:root {
  color-scheme: light;
  --ink: #18231d;
  --muted: #65716a;
  --line: #d9e0db;
  --paper: #ffffff;
  --wash: #f3f6f2;
  --accent: #245a43;
  --accent-dark: #184832;
  --accent-soft: #e4f0e8;
  --gold: #f4c46b;
  --option-a: #eef4ff;
  --option-a-strong: #315d9a;
  --option-b: #fff3e7;
  --option-b-strong: #9a5d25;
  --danger: #9a352f;
  --shadow: 0 16px 50px rgb(27 52 36 / .07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--wash); color: var(--ink); font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input, select, textarea { font: inherit; }
button, label, select { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
a { color: var(--accent); }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(1.8rem, 4vw, 2.75rem); line-height: 1.08; letter-spacing: -.035em; }
h2 { font-size: 1.18rem; line-height: 1.25; }

.site-header { min-height: 76px; display: flex; justify-content: space-between; align-items: center; gap: 2rem; padding: .85rem max(1rem, calc((100vw - 1120px) / 2)); background: rgb(255 255 255 / .94); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; backdrop-filter: blur(14px); }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--ink); text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: var(--accent); color: white; font-weight: 850; letter-spacing: -.04em; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .74rem; }
.progress-wrap { width: min(280px, 38vw); display: grid; gap: .3rem; color: var(--muted); font-size: .8rem; text-align: right; }
progress { width: 100%; height: 8px; accent-color: var(--accent); }

main { width: min(1120px, calc(100% - 2rem)); margin: clamp(1.2rem, 3vw, 2.4rem) auto 5rem; }
.narrow { width: min(720px, 100%); margin-inline: auto; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: clamp(1.2rem, 3vw, 2.2rem); box-shadow: var(--shadow); }
.centered { text-align: center; margin-top: 12vh; }
.spinner { width: 38px; height: 38px; margin: 0 auto 1.2rem; border: 4px solid var(--accent-soft); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.eyebrow { margin-bottom: .35rem; color: var(--accent); font-size: .76rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.eyebrow.danger { color: var(--danger); }
.lede { color: var(--muted); font-size: 1.12rem; }
.status { min-height: 1.4em; margin: .8rem 0; color: var(--muted); }

.consent-layout { display: grid; grid-template-columns: minmax(240px, .72fr) minmax(0, 1.55fr); gap: 1.1rem; align-items: start; }
.consent-hero { position: sticky; top: 104px; padding: 1.2rem .6rem; }
.study-facts { margin: 2rem 0 0; display: grid; gap: .8rem; }
.study-facts div { padding-top: .75rem; border-top: 1px solid var(--line); }
.study-facts dt { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.study-facts dd { margin: .15rem 0 0; font-weight: 700; }
.consent-copy h2 { margin: 1.7rem 0 .45rem; color: var(--accent); }
.consent-copy h2:first-child { margin-top: 0; }
.decision-panel { grid-column: 2; border-top: 5px solid var(--accent); }
.check-row { display: grid; grid-template-columns: 24px 1fr; gap: .8rem; align-items: start; margin: 1rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; }
.check-row:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check-row input { width: 20px; height: 20px; margin-top: .15rem; accent-color: var(--accent); }
.no-ai-row { border-color: #d9b566; background: #fffaf0; }

.button-row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.button-row.end { justify-content: flex-end; }
.button-row.split { justify-content: space-between; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: .72rem 1.05rem; border: 1px solid transparent; border-radius: 10px; font-weight: 760; text-decoration: none; cursor: pointer; }
.button.primary { color: white; background: var(--accent); }
.button.primary:hover { background: var(--accent-dark); }
.button.quiet { color: var(--ink); background: white; border-color: var(--line); }
.button.compact { min-height: 38px; padding: .5rem .75rem; }
.button:disabled { opacity: .55; cursor: wait; }
.large-button { width: 100%; min-height: 52px; font-size: 1.06rem; }

.step-heading { margin: 1rem 0 1.2rem; }
.form-stack { display: grid; gap: 1.25rem; }
.form-stack > label { display: grid; gap: .45rem; font-weight: 700; }
.profile-section { margin-top: .5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.profile-section > p { color: var(--muted); }
.profile-section .question-card:last-child { border-bottom: 0; }
select, textarea { width: 100%; padding: .75rem .8rem; border: 1px solid #aeb9b1; border-radius: 9px; color: var(--ink); background: white; }
textarea { resize: vertical; }
select:focus, textarea:focus { outline: 3px solid #a9cab7; outline-offset: 2px; border-color: var(--accent); }

.scenario-nav { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin-bottom: .85rem; color: var(--muted); font-size: .9rem; }
.scenario-nav .button { justify-self: start; }
.nav-spacer { min-width: 90px; justify-self: end; }
.scenario-card { margin-bottom: 1rem; }
.scenario-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.domain-pill { flex: 0 0 auto; display: inline-flex; padding: .38rem .7rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .78rem; font-weight: 750; }
.setup { max-width: 900px; font-size: 1.07rem; }
.comparison { display: grid; grid-template-columns: minmax(0, 1fr) 145px minmax(0, 1fr); margin-top: 1.5rem; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.comparison > div { padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.comparison > div:nth-last-child(-n + 3) { border-bottom: 0; }
.comparison .header { font-weight: 830; }
.comparison .option-a { background: var(--option-a); }
.comparison .option-b { background: var(--option-b); }
.comparison .dimension { display: grid; place-items: center; text-align: center; color: var(--muted); font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; border-inline: 1px solid var(--line); }

.response-panel { display: grid; gap: 1rem; }
.question-card { border: 0; margin: 0; padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.question-card legend, .text-question { font-weight: 750; }
.text-question { display: grid; gap: .55rem; }
.text-question > span, .text-question small { color: var(--muted); font-weight: 450; }
.text-question small { text-align: right; }
.large-choices { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.large-choices label, .small-choices label { position: relative; cursor: pointer; }
.large-choices input, .small-choices input, .scale input { position: absolute; opacity: 0; pointer-events: none; }
.large-choices label span, .small-choices label span, .scale label { display: grid; place-items: center; min-height: 48px; padding: .65rem; border: 1px solid #abb6ae; border-radius: 9px; background: white; text-align: center; }
.large-choices label:first-child span { border-color: #a9bfdf; background: var(--option-a); }
.large-choices label:nth-child(2) span { border-color: #dfbf9d; background: var(--option-b); }
.large-choices input:checked + span, .small-choices input:checked + span, .scale input:checked + label { color: white; background: var(--accent); border-color: var(--accent); }
.large-choices input:focus-visible + span, .small-choices input:focus-visible + span, .scale input:focus-visible + label { outline: 3px solid #8fb6a0; outline-offset: 2px; }
.small-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: .55rem; margin-top: .7rem; }
.scale label { font-weight: 800; }
.scale-labels { display: flex; justify-content: space-between; gap: 1rem; margin-top: .35rem; color: var(--muted); font-size: .76rem; }
.scale-field { border: 0; padding: 0; margin: 0; }
.scale-field legend { font-weight: 700; }
.gaais-item { width: 100%; }
#attentionCheck p { margin-bottom: .8rem; color: var(--muted); }
.compact-choices { grid-template-columns: 1fr 1fr; }

.completion { margin-top: 8vh; text-align: center; }
.success-mark { width: 64px; height: 64px; display: grid; place-items: center; margin: 0 auto 1.2rem; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 2rem; font-weight: 900; }
.completion-code { padding: .8rem; border-radius: 9px; background: var(--wash); font-family: ui-monospace, monospace; }
.fine-print { margin: 1rem 0 0; color: var(--muted); font-size: .8rem; }
.toast { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 30; max-width: min(560px, calc(100% - 2rem)); padding: .8rem 1rem; border-radius: 10px; color: white; background: #2d3931; box-shadow: var(--shadow); pointer-events: none; }
.toast.success { background: var(--accent); font-weight: 650; }

@keyframes scenario-enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.scenario-animate { animation: scenario-enter .42s cubic-bezier(.22,.61,.36,1); }

@keyframes progress-pop { 0% { transform: none; } 40% { transform: scale(1.14); } 100% { transform: none; } }
.progress-wrap.pulse #progressBar { animation: progress-pop .5s ease; transform-origin: left center; }

@media (max-width: 760px) {
  .site-header { position: static; }
  .brand small { display: none; }
  .consent-layout { grid-template-columns: 1fr; }
  .consent-hero { position: static; padding: .4rem; }
  .decision-panel { grid-column: 1; }
  .comparison { grid-template-columns: 1fr; }
  .comparison .dimension { border: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); min-height: 40px; }
  .comparison > div { border: 0; }
  .comparison .header { display: none; }
  .comparison .option-a::before, .comparison .option-b::before { display: block; margin-bottom: .25rem; font-size: .72rem; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
  .comparison .option-a::before { content: "Version A"; color: var(--option-a-strong); }
  .comparison .option-b::before { content: "Version B"; color: var(--option-b-strong); }
  .scenario-heading { display: block; }
  .domain-pill { margin-bottom: .8rem; }
  .small-choices { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 500px) {
  main { width: min(100% - 1rem, 1120px); }
  .panel { border-radius: 13px; }
  .site-header { gap: .6rem; }
  .progress-wrap { width: 42vw; }
  .large-choices { grid-template-columns: 1fr; }
  .button-row.split { align-items: stretch; flex-direction: column-reverse; }
  .button-row.split .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation: none; }
  .scenario-animate, .progress-wrap.pulse #progressBar { animation: none; }
}
