:root {
  --brand: #005e36; --red: #c42a26; --ink: #14181f; --muted: #5b6478; --line: #dfe3ec;
  --soft: #f3f5f9; --green: #0a7a45; --amber: #9a5b00; --amber-bg: #fff4e0; --red-bg: #fdecea;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #fff; color: var(--ink); font: 17px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
.app { max-width: 620px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom, 0px)); }
.wide { max-width: 1040px; }
h1, h2, h3, p { margin: 0; }
input, textarea, select { font: inherit; font-size: 16px; color: inherit; }
button, a, label.tap { touch-action: manipulation; }
button, label.tap { user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

.top { background: #fff; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; border-bottom: 1px solid var(--line); }
.top img { height: 84px; width: auto; display: block; }
.langs { display: flex; gap: 4px; }
.langs button { min-width: 44px; height: 40px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 14px; font-weight: 700; color: var(--brand); }
.langs button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.status { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0 0; font-size: 14px; color: var(--muted); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-weight: 600; font-size: 13px; background: var(--soft); color: var(--muted); }
.pill.ok { background: #e6f5ec; color: var(--green); }
.pill.wait { background: var(--amber-bg); color: var(--amber); }
.pill.bad { background: var(--red-bg); color: #b3261e; }
.link { background: none; border: 0; padding: 6px 0; color: var(--brand); text-decoration: underline; font-size: 14px; min-height: 36px; }

.progress { margin: 14px 0 12px; }
.progress b { color: var(--brand); font-size: 22px; }
.bar { height: 8px; border-radius: 4px; background: var(--soft); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--red); }

.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.input, textarea { width: 100%; padding: 12px; border: 1px solid #b8bfcd; border-radius: 10px; background: #fff; }
textarea { min-height: 96px; resize: vertical; }

.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 10px 0; }
.chips button { min-height: 44px; min-width: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; background: #fff; font-size: 15px; font-weight: 600; color: var(--brand); }
.chips button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 10px 2px; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; }
.row:active { background: var(--soft); }
.stand { flex: none; width: 74px; font-weight: 800; font-size: 15px; color: var(--brand); }
.row .who { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.row .who small { display: block; color: var(--muted); font-size: 13px; }
.row.done .who strong { font-weight: 500; }
.tick { flex: none; color: var(--green); font-weight: 800; }
.tick.wait { color: var(--amber); }
.empty { padding: 24px 0; color: var(--muted); text-align: center; }

.notice { margin: 12px 0; padding: 12px; border-radius: 10px; background: var(--amber-bg); color: #5f3a00; font-size: 15px; }
.notice.bad { background: var(--red-bg); color: #8c1d18; }
.notice .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.btn { display: block; width: 100%; min-height: 54px; padding: 12px 16px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font-weight: 700; font-size: 17px; transition: transform 100ms ease-out; }
.btn:active { transform: scale(.98); }
.btn.alt { background: #fff; color: var(--brand); border: 2px solid var(--brand); }
.btn.small { width: auto; min-height: 44px; padding: 8px 14px; font-size: 15px; }
.stack { display: grid; gap: 10px; margin-top: 18px; }

.head { padding: 14px 0 4px; }
.head h1 { color: var(--brand); font-size: 22px; line-height: 1.2; overflow-wrap: anywhere; }
.head p { color: var(--red); font-weight: 700; margin-top: 2px; }
.eyebrow { color: var(--muted); font-size: 14px; font-weight: 600; }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
section.sec { margin-top: 26px; }
section.sec > h2 { font-size: 13px; letter-spacing: .05em; text-transform: uppercase; color: #fff; background: var(--brand); padding: 8px 12px; border-radius: 8px; }
.subhead { margin-top: 20px; font-weight: 700; color: var(--brand); }
.q { margin-top: 18px; padding: 2px 0; border-radius: 10px; scroll-margin-top: 16px; }
.q legend, .q .qtext { display: block; padding: 0; font-weight: 600; margin-bottom: 8px; }
.q.missing { outline: 2px solid var(--red); outline-offset: 6px; }

.scale { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.tap { position: relative; display: block; cursor: pointer; }
.tap input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.tap span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 10px; border: 1.5px solid #b8bfcd; border-radius: 10px; background: #fff; text-align: center; transition: background 100ms ease-out; }
.tap input:active + span { background: var(--soft); }
.tap input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.tap input:focus-visible + span { outline: 3px solid var(--red); outline-offset: 2px; }
.ends { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.opts { display: grid; gap: 6px; }
.opts .tap span { justify-content: flex-start; text-align: left; }
.opts.inline { grid-auto-flow: column; grid-auto-columns: 1fr; }
.opts.inline .tap span { justify-content: center; text-align: center; }

.thanks { text-align: center; padding: 48px 0 12px; }
.thanks .mark { font-size: 44px; color: var(--green); line-height: 1; }
.thanks h1 { color: var(--brand); font-size: 24px; margin-top: 12px; }
.thanks p { margin-top: 10px; color: var(--muted); }

/* results page */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
.tile { padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.tile b { display: block; font-size: 28px; color: var(--brand); }
.tile span { font-size: 14px; color: var(--muted); }
.block { margin-top: 28px; }
.block > h2 { font-size: 18px; color: var(--brand); margin-bottom: 8px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { padding: 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { font-size: 13px; color: var(--muted); white-space: nowrap; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
.comment { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.comment small { display: block; color: var(--muted); font-size: 13px; }
.danger { background: none; border: 0; color: #b3261e; text-decoration: underline; min-height: 36px; font-size: 14px; }

@media (hover: hover) and (pointer: fine) {
  .row:hover { background: var(--soft); }
  .tap:hover span { border-color: var(--brand); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
