:root {
  color-scheme: light dark;
  --page: #ffffff;
  --ink: #16181d;
  --dim: #5b6270;
  --line: #d9dde4;      /* hairlines and rules; decorative */
  --field: #7f8794;     /* form control edges; must clear 3:1 on --page */
  --accent: #123a6b;    /* links and the primary button */
  --accent-ink: #ffffff;
  --caution: #8a3324;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #101216;
    --ink: #e8eaee;
    --dim: #9aa3b2;
    --line: #2b303a;
    --field: #616875;
    --accent: #7fb2f0;
    --accent-ink: #0b1220;
    --caution: #f0a882;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink); background: var(--page); }
header, footer, main { max-width: 44rem; margin: 0 auto; padding: 1.25rem; }
header { border-bottom: 1px solid var(--line); }
footer { border-top: 1px solid var(--line); display: flex; gap: 1.25rem; font-size: .9rem; }
.wordmark { font-weight: 650; letter-spacing: .02em; text-decoration: none; color: var(--ink); }
a { color: var(--accent); }
h1 { font-size: 1.6rem; margin: 1rem 0 .5rem; }
h2 { font-size: 1.05rem; margin: 1.75rem 0 .5rem; }
.lede { color: var(--dim); }
label { display: block; font-weight: 600; margin-top: 1.25rem; }
.optional { font-weight: 400; color: var(--dim); }
input, textarea { width: 100%; padding: .55rem .65rem; font: inherit; color: inherit;
  background: transparent; border: 1px solid var(--field); border-radius: 6px; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
.hint { color: var(--dim); font-size: .875rem; margin: .35rem 0 0; }
button { margin-top: 1.5rem; padding: .6rem 1.1rem; font: inherit; font-weight: 600;
  color: var(--accent-ink); background: var(--accent); border: 0; border-radius: 6px;
  cursor: pointer; }
.disclosure { border: 1px solid var(--line); border-radius: 8px; padding: .25rem 1rem 1rem; margin: 1.5rem 0; }
.disclosure ul { padding-left: 1.1rem; }
.disclosure li { margin: .5rem 0; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; }
.details dt { color: var(--dim); }
.details dd { margin: 0; overflow-wrap: anywhere; }
.events { color: var(--dim); font-size: .9rem; }
.problems { color: var(--caution); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em; }

fieldset { margin: 1.25rem 0 0; padding: .75rem 1rem 1rem; border: 1px solid var(--line);
  border-radius: 6px; }
legend { font-weight: 600; padding: 0 .35rem; }
.choice { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400;
  margin-top: .5rem; }
.choice input { width: auto; margin-top: .3rem; }
.hint.warning { color: var(--caution); }
.decision { display: flex; flex-wrap: wrap; gap: .75rem; }
button.secondary { color: inherit; background: transparent; border: 1px solid var(--line); }
button[disabled] { opacity: .5; cursor: default; }
#review-body h3 { font-size: 1rem; margin: 1.25rem 0 .25rem; }
#review-body ul { padding-left: 1.1rem; }
#review-body li { margin: .4rem 0; }

/* A field that only applies to one answer is disabled until that answer is
   given, rather than hidden: a control that appears from nowhere is worse for
   a screen reader than one that was always there and became available. */
.dependent[aria-disabled="true"] { opacity: .55; }
.dependent[aria-disabled="true"] textarea { cursor: not-allowed; }

/* Live checks on what the submitter typed. Never the only signal: the text
   beside the field says the same thing. */
.field-status { display: inline-block; width: 1.2em; text-align: center; }
.field-status[data-state="checking"]::before { content: "\2026"; color: var(--dim); }
.field-status[data-state="found"]::before { content: "\2713"; color: var(--accent); }
.field-status[data-state="missing"]::before { content: "\2717"; color: var(--caution); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; }

button[data-busy="true"] { opacity: .8; cursor: progress; }
button[data-busy="true"]::after {
  content: ""; display: inline-block; width: .8em; height: .8em; margin-left: .55rem;
  vertical-align: -.05em; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  button[data-busy="true"]::after { animation: none; border-right-color: currentColor; opacity: .4; }
}
.problems-block { border-color: var(--caution); }
.problems { padding-left: 1.1rem; color: var(--caution); }
