:root {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172b33;
  background: #f5f7f5;
  line-height: 1.55;
}

* { box-sizing: border-box; }

body { margin: 0; }

button, input { font: inherit; }

button { cursor: pointer; }

button:disabled { cursor: not-allowed; opacity: .45; }

button:focus-visible, input:focus-visible + span {
  outline: 3px solid #b36e19;
  outline-offset: 3px;
}

.page { max-width: 960px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }

.site-header, .section-heading, .progress-row, .navigation, .utility-row, footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.site-header { align-items: flex-start; margin-bottom: 1.7rem; }

.eyebrow { margin: 0 0 .25rem; color: #527070; font-size: .78rem; font-weight: 750; letter-spacing: .11em; text-transform: uppercase; }

h1, h2, p { margin-top: 0; }

h1 { margin-bottom: .35rem; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; letter-spacing: -.035em; }

h2 { margin-bottom: .5rem; font-size: 1.45rem; }

.subtitle, .quiet, .progress-copy { color: #52666b; }

.subtitle { margin-bottom: 0; }

.local-badge { flex: none; margin-top: .3rem; padding: .35rem .7rem; border-radius: 999px; background: #e4f0e9; color: #225942; font-size: .82rem; font-weight: 650; }

.instructions, .question-card, #review-view, #results-view {
  background: #fff;
  border: 1px solid #dce5e1;
  border-radius: 18px;
  box-shadow: 0 6px 24px rgb(22 56 50 / 5%);
}

.instructions { padding: 1.3rem 1.5rem; margin-bottom: 2rem; }
.instructions p { margin-bottom: .65rem; }
.instructions p:last-child { margin-bottom: 0; }

.message { border-radius: 10px; padding: .85rem 1rem; margin-bottom: 1rem; }
.error { background: #f9e6e3; color: #8b2e24; }
.warning { background: #fff2d9; color: #765016; }

.progress-row { margin-bottom: .45rem; }
.progress-copy { margin-bottom: 0; font-size: .92rem; }
progress { display: block; width: 100%; height: .7rem; margin-bottom: 1.4rem; accent-color: #2a7662; }

.question-card { padding: clamp(1.25rem, 4vw, 2.5rem); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { display: block; width: 100%; margin-bottom: 2rem; padding: 0; font-size: clamp(1.3rem, 3vw, 1.8rem); font-weight: 650; line-height: 1.35; }
.scale-ends { display: flex; justify-content: space-between; color: #52666b; font-size: .87rem; font-weight: 650; margin-bottom: .5rem; }
.choices { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: .45rem; }
.choice { position: relative; }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; margin: 0; }
.choice span { display: grid; place-items: center; min-height: 3.25rem; border: 1px solid #b8c9c6; border-radius: 10px; background: #fff; color: #174b48; font-weight: 700; transition: background .12s, border-color .12s; }
.choice:hover span { background: #e8f2ef; }
.choice input:checked + span { background: #236c5b; border-color: #236c5b; color: #fff; }

.navigation { margin-top: 1.35rem; }
.utility-row { margin-top: .6rem; }
.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; min-height: 2.65rem; padding: .55rem 1rem; border-radius: 9px; font-weight: 650; text-decoration: none; }
.primary-button { border: 1px solid #236c5b; background: #236c5b; color: #fff; }
.primary-button:not(:disabled):hover { background: #195343; }
.secondary-button { border: 1px solid #9eb8b2; background: #fff; color: #1d574b; }
.secondary-button:not(:disabled):hover { background: #ebf4f1; }
.text-button { border: 0; background: transparent; color: #1d6253; padding: .45rem .15rem; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.text-button:not(:disabled):hover { color: #104a3c; }

#review-view, #results-view { padding: clamp(1.25rem, 4vw, 2rem); }
.section-heading { align-items: flex-start; margin-bottom: 1.5rem; }
.section-heading .quiet { margin-bottom: 0; }
.review-list { display: grid; gap: .4rem; max-height: 65vh; overflow: auto; padding-right: .3rem; }
.review-item { width: 100%; display: grid; grid-template-columns: 2.4rem 1fr auto; gap: .7rem; align-items: start; text-align: left; border: 1px solid #dae4df; border-radius: 9px; background: #fff; padding: .7rem; color: inherit; }
.review-item:hover { background: #f2f8f5; border-color: #7ea99a; }
.review-number { font-weight: 750; color: #1c6252; }
.review-answer { white-space: nowrap; font-weight: 700; color: #1d6253; }
.review-answer.unanswered { color: #9b592b; }
.result-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.result-text { white-space: pre-wrap; overflow-wrap: anywhere; max-height: 60vh; overflow: auto; padding: 1rem; border: 1px solid #dce5e1; border-radius: 10px; background: #f7f9f7; font: .9rem/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; }

footer { margin-top: 2.3rem; padding-top: 1rem; border-top: 1px solid #d5e0dc; color: #52666b; font-size: .9rem; }
.danger { color: #a33d32; }
.danger:hover { color: #7c2b23; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 650px) {
  .page { padding: 1.2rem .9rem 2rem; }
  .site-header, .section-heading, footer { flex-direction: column; align-items: flex-start; }
  .local-badge { margin-top: 0; }
  .choices { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .utility-row { flex-wrap: wrap; }
  .review-item { grid-template-columns: 2rem 1fr; }
  .review-answer { grid-column: 2; }
}
