:root {
    color-scheme: light;
    font-family: system-ui, sans-serif;
    color: #172640;
    background: #f3f6fb;
    --text: #172640;
    --muted: #51637f;
    --accent: #214ec3;
    --line: #d4dfef;
    --surface: #fff;
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
[hidden] { display: none !important; }
header { background: var(--surface); border-bottom: 1px solid var(--line); }
.bar, main, footer { width: min(71rem, calc(100% - 2rem)); margin-inline: auto; }
.bar { display: flex; align-items: center; gap: 1rem; min-height: 4.2rem; flex-wrap: wrap; padding-block: .65rem; }
.bar nav { display: flex; gap: .5rem 1.15rem; flex-wrap: wrap; margin-left: auto; }
.bar form { margin-left: auto; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 800; text-decoration: none; }
.brand span { display: grid; place-items: center; background: var(--accent); color: white; width: 2rem; height: 2rem; border-radius: .55rem; }
.brand small { padding-left: .35rem; border-left: 1px solid var(--line); }
a { color: var(--accent); text-underline-offset: .15em; }
a:hover { text-decoration-thickness: .12em; }
:focus-visible { outline: 3px solid #925810; outline-offset: 3px; }
.skip { position: absolute; inset: 0 auto auto .5rem; padding: .7rem; transform: translateY(-120%); background: white; z-index: 1; }
.skip:focus { transform: none; }
main { padding-block: clamp(1.25rem, 4vw, 3rem); min-height: 70vh; }
footer { color: var(--muted); padding-block: 1.25rem; border-top: 1px solid var(--line); }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { margin: 0 0 1.2rem; font-size: clamp(1.8rem, 5vw, 2.55rem); letter-spacing: -.035em; }
h2 { font-size: 1.25rem; margin: .25rem 0; }
h3 { font-size: 1rem; }
p { margin: .55rem 0; overflow-wrap: anywhere; }
.lead, small { color: var(--muted); }
.login-grid, .cards, .fields { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
.cards, .section { margin-top: 1.2rem; }
.card { border: 1px solid var(--line); border-radius: .9rem; background: var(--surface); padding: clamp(1rem, 3vw, 1.5rem); min-width: 0; }
.card p { margin-bottom: .9rem; }
.stack { display: grid; gap: 1rem; }
.stack > h2, .stack > p { margin: 0; }
.narrow { max-width: 37rem; }
label { display: grid; gap: .35rem; font-weight: 650; min-width: 0; }
input, select, textarea, button { font: inherit; }
input:not([type="radio"], [type="checkbox"], [type="hidden"]), select, textarea {
    display: block; width: 100%; min-height: 2.65rem; padding: .5rem .65rem;
    border: 1px solid #8197b7; border-radius: .45rem; color: var(--text); background: #fff;
}
textarea { resize: vertical; }
button, .button {
    display: inline-flex; align-items: center; justify-content: center; gap: .3rem; min-height: 2.65rem;
    border: 1px solid var(--accent); padding: .58rem .95rem; border-radius: .5rem;
    background: var(--accent); color: white; text-decoration: none; cursor: pointer; font-weight: 700;
}
button:hover, .button:hover { filter: brightness(.9); }
.quiet { background: white; color: var(--accent); border-color: #9cb1d8; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .85rem; }
.tag { display: inline-block; background: #e8efff; color: #234894; font-size: .82rem; font-weight: 700; border-radius: 5rem; padding: .18rem .65rem; margin-bottom: .4rem; }
.notice, .error { padding: .75rem 1rem; border: 1px solid #a8c3f5; border-left-width: .25rem; border-radius: .5rem; background: #edf3ff; }
.error { color: #861e1e; border-color: #bd5656; background: #fff0f0; }
fieldset { margin: 0; min-inline-size: 0; }
fieldset legend { padding-inline: .4rem; overflow-wrap: anywhere; max-width: 100%; font-weight: 700; }
.question { display: grid; gap: .85rem; }
.required { color: var(--muted); font-size: .85rem; font-weight: 500; }
.choices { display: flex; gap: .5rem; flex-wrap: wrap; }
.choice, .check { display: flex; align-items: center; gap: .45rem; }
.choice { border: 1px solid var(--line); border-radius: .5rem; padding: .45rem .65rem; min-height: 2.65rem; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); background: #e8efff; }
input[type="radio"], input[type="checkbox"] { width: 1.1rem; height: 1.1rem; accent-color: var(--accent); }
.scale-ends { display: flex; justify-content: space-between; gap: .6rem; color: var(--muted); font-size: .86rem; }
.scale-ends span:last-child { text-align: right; }
.scale .choice { flex: 1 0 auto; justify-content: center; }
.list { list-style: none; padding-block: .45rem; }
.list li { display: flex; justify-content: space-between; gap: .8rem; padding-block: .8rem; }
.list li + li { border-top: 1px solid var(--line); }
.list small { display: block; }
.submission dt { font-weight: 700; }
.submission dd { margin: .3rem 0 1rem; overflow-wrap: anywhere; white-space: pre-wrap; }
.submission dd:last-child { margin-bottom: 0; }
details > summary { cursor: pointer; font-weight: 700; padding-block: .5rem; }
details form { padding-top: .75rem; }
.filter { display: flex; align-items: end; flex-wrap: wrap; gap: .75rem; }
.filter label { flex: 1 0 min(100%, 12rem); }
.filter a { align-self: center; }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { border-bottom: 1px solid var(--line); padding: .5rem .65rem; }
th:first-child { min-width: 9rem; }
thead th { white-space: nowrap; }
.distribution { border-top: 1px solid var(--line); padding-block: .45rem; }
.frequency { display: grid; grid-template-columns: minmax(4rem,1fr) minmax(3rem,1fr) auto; align-items: center; gap: .5rem; font-size: .9rem; }
meter { width: 100%; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 37rem) {
    .bar nav { width: 100%; order: 3; margin: 0; }
    .frequency { grid-template-columns: minmax(4rem,1.3fr) minmax(3rem,1fr) auto; }
    th, td { padding-inline: .45rem; }
}
