:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --text: #1d2228;
  --muted: #5d6670;
  --line: #d9dde2;
  --accent: #23508a;
  --accent-ink: #ffffff;
  --soft: #eef2f7;
  --warn-bg: #fbecec;
  --warn-ink: #8a1c1c;
  --chip-on: #e3ebf6;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --surface: #1e2227;
    --text: #e8eaed;
    --muted: #a3acb6;
    --line: #353b43;
    --accent: #7fa8e0;
    --accent-ink: #0f1620;
    --soft: #262c33;
    --warn-bg: #3a1f22;
    --warn-ink: #f2b8b8;
    --chip-on: #2b3a50;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; gap: 10px; align-items: baseline; padding-top: 12px; padding-bottom: 12px; }
.brand { font-weight: 700; color: var(--accent); }
.sub { color: var(--muted); font-size: 14px; }
main { padding-top: 20px; padding-bottom: 60px; }
h1 { font-size: 1.4rem; margin: 0 0 12px; }
.muted { color: var(--muted); }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.intro ul { padding-left: 20px; margin: 8px 0 0; }
.intro li { margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: 15px; }
.grid2 { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .grid2 { grid-template-columns: 1fr 1fr; } }
input, select {
  width: 100%;
  font: inherit;
  font-size: 16px; /* prevents iOS zoom */
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
}
input:focus, select:focus, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 1px; }
input:disabled { background: var(--soft); color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.err { color: var(--warn-ink); font-size: 14px; margin: 4px 0 0; min-height: 0; }
.err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.btn {
  font: inherit;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 10px 16px;
  cursor: pointer;
  min-height: 44px;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; width: 100%; }
.btn:disabled { opacity: .6; cursor: progress; }
.banner { background: var(--warn-bg); color: var(--warn-ink); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px; }

.q .qnum { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.q .prompt { margin: 6px 0 12px; font-size: 17px; }
.q .prompt sup { font-size: .75em; }
.answers { display: flex; flex-wrap: wrap; gap: 10px; }
.ans { display: flex; align-items: center; gap: 6px; flex: 1 1 200px; max-width: 320px; }
.ans .lbl { font-weight: 600; white-space: nowrap; }
.ans .unit { color: var(--muted); white-space: nowrap; }
.chips { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.chip { font-size: 14px; padding: 6px 12px; min-height: 36px; border-radius: 999px; }
.chip[aria-pressed="true"] { background: var(--chip-on); border-color: var(--accent); font-weight: 600; }
.q.flagged { border-color: var(--accent); }
.submit-row p { margin: 0 0 10px; }
.done p { font-size: 18px; margin: 0; }
