:root {
  color-scheme: light;
  --page: #F3F4F6;
  --card: #FFFFFF;
  --ink: #111827;
  --muted: #6B7280;
  --border: #D1D5DB;
  --brand: #0F766E;
  --selected: #E6F4F2;
  --clash: #FF5A1F;
  --error: #B91C1C;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--page);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { min-height: 44px; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

.shell {
  max-width: 520px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
}

.header { padding-top: 22px; }
.wordmark { display: inline-block; font-weight: 800; letter-spacing: -.035em; }

.stages {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, .63fr) minmax(0, 1.03fr) minmax(0, 1.04fr) minmax(0, 1.36fr) minmax(0, .94fr);
  gap: 5px;
}

.stage { min-width: 0; color: var(--muted); }
.stage[aria-current="step"] { color: var(--brand); font-weight: 700; }
.stage-track {
  display: block;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}
.stage-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--brand);
  transition: width 180ms ease;
}
.stage-label {
  display: block;
  margin-top: 6px;
  font-size: .9375rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.main, #check-form { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.question { padding: 20px 0 16px; }
.back {
  display: grid;
  place-items: center;
  width: 44px;
  margin: -6px 0 3px -8px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 1.5rem;
}
.back:hover { background: var(--card); }

h1, .suggestion h2 {
  font-family: ui-serif, Georgia, serif;
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -.035em;
}
h1 { margin: 0; font-size: clamp(2rem, 7vw, 2.875rem); }
h1:focus { outline: none; }
.intro { margin: 10px 0 18px; color: var(--muted); }

.options { display: grid; gap: 6px; }
.choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 6px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  text-align: left;
  font-weight: 550;
  line-height: 1.25;
}
.choice[aria-pressed="true"] { background: var(--selected); }
.choice-tick {
  flex: 0 0 20px;
  width: 20px;
  color: var(--brand);
  text-align: center;
  visibility: hidden;
}
.choice[aria-pressed="true"] .choice-tick { visibility: visible; }

.chip-group {
  min-width: 0;
  margin: 0 0 16px;
  padding: 0;
  border: 0;
}
.chip-group legend { margin-bottom: 8px; padding: 0; font-weight: 650; }
.chip-group .options { display: flex; flex-wrap: wrap; }
.chip-group .choice { width: auto; min-width: 44px; }

.field { margin: 0 0 12px; }
.options + .field, .choice + .field { margin-top: 12px; }
.field label { display: block; margin-bottom: 4px; font-weight: 650; }
.field input, .field textarea {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--muted);
  border-radius: 12px;
  background: var(--card);
}
.field textarea { min-height: 84px; resize: vertical; }
.field [aria-invalid="true"] { border-color: var(--error); }
.optional { color: var(--muted); font-weight: 400; }
.error { margin: 6px 0 0; color: var(--error); }
.shake { animation: shake 230ms ease-out; }

@keyframes shake {
  25%, 75% { transform: translateX(4px); }
  50% { transform: translateX(-4px); }
}

.actions {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin-top: auto;
  padding: 10px 0 max(12px, env(safe-area-inset-bottom));
  background: var(--page);
}
.actions .error { margin: 0 0 8px; }
.privacy { margin: 0 0 10px; color: var(--muted); }
.primary, .add-upload {
  width: 100%;
  min-height: 48px;
  padding: 9px 14px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  font-weight: 700;
}
.primary { color: var(--card); background: var(--brand); }
/* WCAG contrast for #111827 text on #FF5A1F is 5.69:1. */
.primary.send { color: var(--ink); background: var(--clash); border-color: var(--ink); }
.primary:disabled { color: var(--muted); background: var(--border); border-color: transparent; }
.text-button {
  display: block;
  min-width: 44px;
  margin: 1px auto -6px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--brand);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.add-upload { border-color: var(--ink); background: var(--card); }
.add-upload:disabled { color: var(--muted); border-color: var(--border); }
.uploads { display: grid; gap: 8px; margin-top: 12px; }
.upload {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 44px;
  min-height: 68px;
  align-items: center;
  gap: 10px;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
}
.upload-preview {
  display: grid;
  place-items: center;
  width: 64px;
  height: 54px;
  border-radius: 8px;
  background: var(--selected);
  overflow: hidden;
}
.upload-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-name { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.upload-status { margin: 0; color: var(--brand); }
.upload-status.error { color: var(--error); }
.remove-upload {
  width: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
}
.remove-upload:hover { background: var(--page); }
.honeypot { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }

.done { padding: 28px 0 16px; }
.suggestion {
  margin-top: 18px;
  padding: 18px;
  border: 1.5px solid var(--brand);
  border-radius: 14px;
  background: var(--selected);
}
.suggestion h2 { margin: 0; font-size: 1.625rem; }
.suggestion p { margin: 8px 0 0; }
.summary { margin: 16px 0 0; }
.summary div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr);
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.summary dt { color: var(--muted); }
.summary dd { margin: 0; overflow-wrap: anywhere; }
.done h1, .done p { overflow-wrap: anywhere; }

.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  column-gap: 12px;
  padding: 0 0 env(safe-area-inset-bottom);
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .9375rem;
}
.footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: inherit;
  text-underline-offset: 3px;
}
.footer a:hover { color: var(--brand); }

@media (min-width: 600px) {
  .shell { padding-inline: 24px; }
  .header { padding-top: 32px; }
  .question { padding-top: 27px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
