/* Layout: one narrow left-aligned column, one question per screen, like filling in a deposit slip.
   The one decorative moment is a guilloche band (the wavy security pattern on checks) on the welcome and thank-you screens. */
:root {
  --paper: #F4F6F2;
  --card: #FBFCFA;
  --ink: #1C2621;
  --muted: #56655D;
  --rule: #CFD8D1;
  --accent: #2C6B4F;
  --accent-ink: #F4F6F2;
  --accent-soft: #E1ECE5;
  --error: #A3362B;
  --error-soft: #F6E3E0;
  --font: "Public Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: 1.5rem;
  --step-3: clamp(1.75rem, 1.2rem + 2.4vw, 2.5rem);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121915;
    --card: #17201B;
    --ink: #E5ECE7;
    --muted: #9AABA1;
    --rule: #2E3B34;
    --accent: #7FC4A0;
    --accent-ink: #0F1612;
    --accent-soft: #1E2C25;
    --error: #F0948A;
    --error-soft: #3A1F1C;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-1);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.shell {
  max-width: 40rem;
  margin: 0 auto;
  padding-block: 2rem 3rem;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Guilloche band */
.guilloche {
  display: block;
  width: 100%;
  height: 120px;
  margin-bottom: 1.75rem;
  color: var(--accent);
}

h1, h2 {
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: var(--step-3); line-height: 1.12; }
h1:focus, h2:focus { outline: none; }
h2 { font-size: var(--step-2); line-height: 1.25; }
p { margin: 0; max-width: 34rem; }

.intro { display: grid; gap: 1.25rem; }
.intro .lede { color: var(--ink); }
.facts {
  list-style: none;
  margin: 0.25rem 0 0;
  padding: 1rem 0 0;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0.6rem;
  color: var(--muted);
  font-size: var(--step-0);
}
.facts li { display: grid; grid-template-columns: 1.25rem 1fr; gap: 0.6rem; align-items: start; }
.facts svg { margin-top: 0.3rem; color: var(--accent); }
.contact { color: var(--muted); font-size: 0.9375rem; }
.contact span { user-select: all; color: var(--ink); }

/* Progress */
.progress { margin-bottom: 2rem; }
.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.9375rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
  font-variant-numeric: tabular-nums;
}
.progress-track { height: 4px; background: var(--rule); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 240ms ease; }

/* Question */
.question { display: grid; gap: 1.5rem; min-width: 0; }
.prompt { display: grid; gap: 0.5rem; }
.quote { color: var(--ink); font-size: var(--step-1); border-left: 3px solid var(--accent); padding-left: 0.875rem; }
.help { color: var(--muted); font-size: var(--step-0); }

.options { display: grid; gap: 0.625rem; }
.option {
  position: relative;
  display: grid;
  grid-template-columns: 1.375rem 1fr;
  gap: 0.875rem;
  align-items: center;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
  transition: border-color 120ms ease, background-color 120ms ease;
  line-height: 1.35;
}
.option:hover { border-color: var(--accent); }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.mark {
  width: 1.375rem; height: 1.375rem;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--card);
}
.option[data-kind="multi"] .mark { border-radius: 5px; }
.mark svg { opacity: 0; color: var(--accent-ink); }
.option.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.option.is-selected .mark { background: var(--accent); border-color: var(--accent); }
.option.is-selected .mark svg { opacity: 1; }
.option.is-disabled { opacity: 0.45; cursor: not-allowed; }
.option.is-disabled:hover { border-color: var(--rule); }
.option:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Segmented buttons (used by the scales) */
.seg {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.6rem 0.4rem;
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  background: var(--card);
  font-size: 0.9375rem;
  line-height: 1.25;
  cursor: pointer;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg:hover { border-color: var(--accent); }
.seg.is-selected { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Scale */
.scale { display: grid; gap: 0.5rem; }
.scale-buttons { display: grid; gap: 0.375rem; }
.scale-buttons[data-count="5"] { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.scale-buttons[data-count="11"] { grid-template-columns: repeat(11, minmax(0, 1fr)); }
.scale-buttons .seg { padding: 0.75rem 0; font-variant-numeric: tabular-nums; font-size: var(--step-0); }
.scale-ends { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: 0.875rem; }
@media (max-width: 480px) {
  .scale-buttons[data-count="11"] { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

textarea {
  width: 100%;
  min-height: 9rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: var(--step-0);
  resize: vertical;
}
textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }

.limit-note { font-size: 0.9375rem; color: var(--muted); }
.limit-note.is-full { color: var(--accent); font-weight: 600; }

/* Actions */
.actions {
  margin-top: auto;
  padding-top: 2rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.btn {
  font: inherit;
  font-size: var(--step-0);
  font-weight: 600;
  border-radius: 8px;
  padding: 0.85rem 1.4rem;
  cursor: pointer;
  border: 1.5px solid transparent;
  min-height: 3rem;
}
.btn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.btn-quiet:hover { border-color: var(--muted); }
@media (min-width: 720px) {
  .shell { padding-block: 3.5rem 4rem; }
  .actions { margin-top: 0; padding-top: 2.5rem; }
}
.actions .btn-primary { margin-left: auto; }
.actions .btn-primary:only-child { margin-left: 0; }
.hint { font-size: 0.875rem; color: var(--muted); }

.redirect {
  margin-top: 1.5rem;
  padding: 0.875rem 1rem;
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  background: var(--accent-soft);
  font-size: var(--step-0);
}

.notice {
  padding: 0.875rem 1rem;
  border-radius: 8px;
  background: var(--error-soft);
  color: var(--error);
  font-size: var(--step-0);
}

.thanks { display: grid; gap: 1.25rem; }
.copy-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.copy-row code {
  font-family: inherit;
  font-size: 0.9375rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--card);
  overflow-wrap: anywhere;
  user-select: all;
}

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.noscript { padding: 2rem 0; }

.screen { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.screen.enter { animation: enter 220ms ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .screen.enter { animation: none; }
  .progress-fill, .option { transition: none; }
}
