:root {
    color-scheme: light;
    --ink: #142c2b;
    --muted: #526661;
    --paper: #fff;
    --wash: #f2f6f3;
    --line: #d6e2dc;
    --accent: #0c6355;
    --accent-dark: #084b41;
    --accent-wash: #e0f1e9;
    --warm: #f9f3e6;
    --warm-ink: #5e4419;
    font-family: Inter, "Segoe UI", system-ui, sans-serif;
    font-size: 16px;
    line-height: 1.58;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--wash); color: var(--ink); }
button, input, textarea { font: inherit; }
a { color: var(--accent-dark); text-underline-offset: .2em; }
a:hover { color: #073a32; }
:focus-visible { outline: 3px solid #166c99; outline-offset: 3px; }
[hidden] { display: none !important; }
p { margin: 0 0 .95rem; }
p:last-child { margin-bottom: 0; }

.site-header {
    border-bottom: 1px solid var(--line);
    background: #fcfefa;
}
.topbar {
    max-width: 76rem;
    min-height: 4.6rem;
    margin: auto;
    padding: .65rem clamp(1rem, 3vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
}
.wordmark {
    display: inline-flex;
    align-items: center;
    gap: .62rem;
    font-size: 1.16rem;
    font-weight: 720;
    letter-spacing: -.045em;
    color: var(--ink);
    text-decoration: none;
}
.brand-mark {
    display: inline-block;
    width: 1.64rem;
    height: 1.64rem;
    background: var(--accent);
    border-radius: .6rem .6rem .6rem .21rem;
    box-shadow: inset 0 0 0 .45rem var(--accent);
    border: .13rem solid var(--accent);
}
.brand-mark::after {
    content: "";
    display: block;
    width: .56rem;
    height: .56rem;
    margin: .41rem;
    border-radius: 50%;
    background: #d8f0e0;
}
.site-label, .muted, .draft-status, .eyebrow { color: var(--muted); }
.site-label { font-size: .9rem; text-align: right; }

.layout {
    max-width: 57rem;
    margin: 0 auto;
    padding: clamp(1.65rem, 4vw, 3.75rem) clamp(.9rem, 3vw, 2.5rem) 4rem;
}
.layout--steps {
    max-width: 76rem;
    display: grid;
    grid-template-columns: minmax(13rem, 15.5rem) minmax(0, 50rem);
    justify-content: center;
    align-items: start;
    gap: clamp(1.5rem, 4vw, 3.4rem);
}
.content { min-width: 0; }
.page-heading { margin-bottom: 1.55rem; }
h1, h2, h3 { margin: 0 0 .55rem; line-height: 1.23; }
h1 { max-width: 26ch; font-size: clamp(2.15rem, 7vw, 3.65rem); font-weight: 720; letter-spacing: -.052em; }
h2 { margin: 0 0 .7rem; font-size: clamp(1.2rem, 3vw, 1.48rem); letter-spacing: -.029em; }
h3 { font-size: 1rem; }
.eyebrow { font-size: .84rem; font-weight: 720; letter-spacing: .055em; margin-bottom: .65rem; }
.lead { max-width: 63ch; font-size: 1.12rem; color: var(--muted); }
.study-meta { font-size: .91rem; color: var(--accent-dark); font-weight: 650; }
.resume { margin-bottom: 1.15rem; }
.steps {
    position: sticky;
    top: 1.3rem;
    border: 1px solid var(--line);
    background: #fbfdfa;
    border-radius: 1.05rem;
    padding: 1.03rem;
}
.steps-caption { font-size: .85rem; font-weight: 700; padding: .1rem .25rem; margin: 0 0 .6rem; color: var(--muted); }
.steps ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.stage {
    border-radius: .55rem;
    padding: .42rem .48rem;
    display: flex;
    align-items: center;
    gap: .54rem;
    min-height: 2.55rem;
    font-weight: 550;
    font-size: .88rem;
    text-decoration: none;
}
.stage-number {
    display: grid;
    place-items: center;
    border-radius: 50%;
    width: 1.55rem;
    height: 1.55rem;
    flex: 0 0 1.55rem;
    font-size: .77rem;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--line);
}
.stage.current { background: var(--accent-wash); color: var(--accent-dark); font-weight: 750; }
.stage.current .stage-number { background: var(--accent); color: #fff; border-color: var(--accent); }
.stage.reached:hover { background: var(--accent-wash); }
.stage.pending { color: var(--muted); }

.card, .notice {
    padding: clamp(1rem, 3vw, 1.62rem);
    border: 1px solid var(--line);
    border-radius: 1.08rem;
    margin-bottom: 1rem;
}
.card { background: var(--paper); box-shadow: 0 4px 12px rgba(21, 58, 45, .035); }
.card :last-child { margin-bottom: 0; }
.notice { background: var(--warm); border-color: #e9d8b3; color: var(--warm-ink); }
.notice--error { color: #812b23; background: #fff1ed; border-color: #e9bdb1; }
.notice--success { color: var(--accent-dark); background: var(--accent-wash); border-color: #b3d5c8; }
.consent-copy h2:not(:first-child) { margin-top: 1.6rem; }
.answer-group { margin-top: .9rem; }
.response { padding: .95rem 1rem; margin: .75rem 0; border-radius: .55rem; background: var(--wash); }
.response p { white-space: pre-wrap; overflow-wrap: anywhere; }
.emotion-copy { line-height: 1.67; color: #304944; }
.emotion-copy ul { padding-left: 1.3rem; }
.captcha { padding-top: .5rem; }
.captcha input[type="text"], .text-control {
    display: block;
    width: min(100%, 36rem);
    padding: .65rem .82rem;
    border: 1px solid #9bb2a8;
    border-radius: .6rem;
    color: var(--ink);
    background: #fcfefa;
}
.captcha input[type="text"] { display: inline-block; margin: .4rem 0 .4rem .35rem; width: 4.2rem; }
.text-control--small { width: 9rem; }
textarea.text-control { width: 100%; min-height: 9.3rem; resize: vertical; }
.field-label { display: block; font-weight: 700; margin-bottom: .25rem; }
.counter { color: var(--muted); font-size: .84rem; text-align: right; margin: .3rem 0 0; }
.question { border: 0; padding: 0; margin: 1.25rem 0; min-inline-size: 0; }
.question:first-child { margin-top: 0; }
.question legend { padding: 0 0 .55rem; font-size: 1rem; font-weight: 700; line-height: 1.4; }
.options { display: flex; gap: .43rem; flex-wrap: wrap; }
.options--stacked { flex-direction: column; flex-wrap: nowrap; }
.frequency-question .options {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) repeat(3, minmax(0, 1fr)) minmax(0, 1.45fr);
    gap: clamp(.18rem, 1vw, .43rem);
}
.frequency-question .option {
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    padding: .45rem .25rem;
    text-align: center;
    font-size: clamp(.69rem, 2.55vw, .89rem);
    overflow-wrap: anywhere;
}
.option, .scale-option {
    display: flex;
    align-items: center;
    gap: .45rem;
    min-height: 2.63rem;
    padding: .48rem .63rem;
    border: 1px solid var(--line);
    border-radius: .5rem;
    background: #fbfdfa;
    font-size: .89rem;
    cursor: pointer;
}
.option input, .scale-option input { margin: 0; accent-color: var(--accent); }
.option:has(input:checked), .scale-option:has(input:checked) { border-color: var(--accent); background: var(--accent-wash); color: var(--accent-dark); }
.option:has(input:focus-visible), .scale-option:has(input:focus-visible) { outline: 3px solid #166c99; outline-offset: 2px; }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
.scale--nine { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.scale-option { position: relative; padding: 0; justify-content: center; font-size: .92rem; font-weight: 690; }
.scale-option input { position: absolute; opacity: 0; }
.scale-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; gap: .4rem; margin-bottom: .32rem; }
.scale-labels span:last-child { text-align: right; }
.statement-list .question { margin-bottom: 1rem; padding-bottom: 1.02rem; border-bottom: 1px solid var(--line); }
.statement-list .question:last-child { border-bottom: 0; padding-bottom: 0; }
.example { margin-top: 1rem; }
.example summary { cursor: pointer; font-weight: 650; color: var(--accent-dark); }
.example p { margin: .55rem 0 0; }
.completion { border-top: 3px solid var(--accent); }

.actions { margin-top: 1.25rem; display: flex; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.actions-row { display: flex; gap: .55rem; flex-wrap: wrap; justify-content: flex-end; }
.draft-status { margin: 0 auto 0 0; font-size: .82rem; }
.draft-status:empty { display: none; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: .62rem .92rem;
    min-height: 2.8rem;
    border-radius: .58rem;
    border: 1px solid transparent;
    font-weight: 690;
    font-size: .92rem;
    text-decoration: none;
    cursor: pointer;
}
.button--primary { background: var(--accent); color: #fff; }
.button--primary:hover { background: var(--accent-dark); color: #fff; }
.button--primary:disabled { opacity: .55; cursor: not-allowed; }
.button--secondary { background: #fff; color: var(--accent-dark); border-color: #9bb2a8; }
.button--secondary:hover, .button--muted:hover { background: var(--accent-wash); }
.button--muted { color: var(--accent-dark); }
.button--danger { background: #a53a31; color: #fff; }
.button--danger:hover { background: #812b23; color: #fff; }
.abandon-action { margin-top: 1.4rem; font-size: .9rem; }
.danger-link, .danger-link:hover { color: #812b23; }

.skip-link { position: fixed; top: .5rem; left: .8rem; z-index: 9; padding: .45rem .6rem; border-radius: .4rem; transform: translateY(-160%); background: white; }
.skip-link:focus { transform: translateY(0); }
@media (max-width: 850px) {
    .layout--steps { display: block; }
    .steps { position: static; margin-bottom: 1.35rem; padding: .65rem; }
    .steps ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .stage { padding: .3rem; gap: .26rem; }
    .stage-number { width: 1.2rem; height: 1.2rem; flex-basis: 1.2rem; }
}
@media (max-width: 480px) {
    .steps ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .step-caption { display: none; }
    .option { min-height: 2.75rem; }
    .scale--nine { gap: .18rem; }
    .scale-option { min-height: 2.55rem; font-size: .86rem; }
    .actions-row { width: 100%; justify-content: space-between; }
    .draft-status { flex-basis: 100%; }
}
