/* Phone only. Single column, 16px gutters, 44px+ tap targets, no hover. */
:root {
  --ink: #14212b; --muted: #5b6b77; --line: #d9e1e6; --bg: #f6f8f9; --card: #fff;
  --brand: #0f5c5d; --brand-ink: #fff; --good: #1b7f3b; --mid: #a86400; --bad: #b3261e;
  --sel: #e3f1f1; --gutter: 16px; --tap: 48px; --radius: 12px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden; overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
.app { max-width: 480px; margin: 0 auto; min-height: 100dvh; }
.screen { padding: 12px var(--gutter) calc(32px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; }

h1, h2, p { margin: 0; }
.brand { font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: var(--brand); }
.title { font-size: 26px; font-weight: 800; line-height: 1.2; }
.section { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 12px; }
.lede { color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.error { color: var(--bad); font-weight: 600; }
.loading { padding: 24px var(--gutter); color: var(--muted); }

.topbar { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); }

/* buttons */
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%;
  min-height: var(--tap); padding: 12px 16px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: var(--card); color: var(--ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  touch-action: manipulation; user-select: none;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn-quiet {
  min-height: 44px; min-width: 44px; padding: 0 8px; margin: 0 -8px;
  display: inline-flex; align-items: center; background: none; border: 0;
  color: var(--brand); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
:focus-visible { outline: 3px solid #5aa9a9; outline-offset: 2px; }

/* forms */
.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.field input {
  min-height: var(--tap); padding: 10px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius); background: var(--card); color: var(--ink);
  font: inherit; font-size: 18px; /* ≥16px stops iOS zoom-on-focus */ width: 100%;
}

/* cards */
.card {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  min-height: 64px; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: var(--radius); background: var(--card); color: var(--ink);
  font: inherit; text-decoration: none; cursor: pointer;
}
.card:active { background: var(--sel); }
.card-resume { border-color: var(--brand); background: var(--sel); }
.card-kicker { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--brand); }
.card-title { font-size: 18px; font-weight: 700; }
.card-meta { font-size: 14px; color: var(--muted); }
.card-body { font-size: 15px; color: var(--muted); margin-top: 4px; }

.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }

/* run */
.run { min-height: 100dvh; display: flex; flex-direction: column; }
.runbar {
  position: sticky; top: 0; z-index: 2; background: var(--bg);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  min-height: 52px; padding: 0 var(--gutter);
}
.runbar-count { font-weight: 700; }
.runbar-clock { justify-self: end; font-variant-numeric: tabular-nums; font-weight: 700; }
.runbar-clock.is-low { color: var(--bad); }
.progress { height: 4px; background: var(--line); margin: 0 var(--gutter); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--brand); transition: width .2s; }
.qwrap { flex: 1; padding: 20px var(--gutter); display: flex; flex-direction: column; gap: 16px; outline: none; }
.runfoot {
  position: sticky; bottom: 0; background: var(--bg);
  padding: 12px var(--gutter) calc(12px + var(--safe-b)); border-top: 1px solid var(--line);
}

.stimulus { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.prompt { font-size: 19px; font-weight: 700; line-height: 1.35; }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 56px; padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: var(--radius); background: var(--card); color: var(--ink);
  font: inherit; cursor: pointer; touch-action: manipulation;
}
.choice-key {
  flex: none; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; border: 1.5px solid var(--line); font-weight: 700; font-size: 15px;
}
.choice[aria-checked="true"] { border-color: var(--brand); background: var(--sel); }
.choice[aria-checked="true"] .choice-key { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

/* results */
.score { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.score-pct { font-size: 56px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.band { font-weight: 800; font-size: 18px; padding: 4px 10px; border-radius: 999px; }
.band-good { background: #e3f4e8; color: var(--good); }
.band-mid { background: #fdf0dc; color: var(--mid); }
.band-low { background: #fbe4e2; color: var(--bad); }
.sync { font-size: 14px; padding: 10px 12px; border-radius: var(--radius); }
.sync-ok { background: #e3f4e8; color: var(--good); }
.sync-wait { background: #fdf0dc; color: var(--mid); }
.sync-bad { background: #fbe4e2; color: var(--bad); }
.review { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.review-item { background: var(--card); border: 1px solid var(--line); border-left-width: 4px; border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.review-item.is-ok { border-left-color: var(--good); }
.review-item.is-wrong { border-left-color: var(--bad); }
.review-q { font-weight: 600; }
.review-mark { font-weight: 800; }
.is-ok .review-mark { color: var(--good); }
.is-wrong .review-mark { color: var(--bad); }
.review-a { font-size: 15px; }
.review-x { font-size: 15px; color: var(--muted); }

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