/* ══ Kora Utware — ikizamini cya provisoire ═══════════════════════════
   Colour carries meaning, not decoration: green = go / pass,
   amber = caution / flagged, red = stop / wrong — the same language the
   road code uses. Warm paper ground, ink chrome, hairline borders.
   ════════════════════════════════════════════════════════════════════ */

:root {
  /* traffic-signal semantics */
  --go:          #0B7A4B;
  --go-soft:     #E9F4EE;
  --go-tint:     #E4F1EA;
  --go-bright:   #2FBF7E;
  --caution:     #B57314;
  --caution-soft:#FBF0DC;
  --caution-line:#E7C88A;
  --caution-ink: #8A5A0F;
  --stop:        #B8302B;
  --stop-soft:   #FAEAE8;
  --stop-line:   #F0CFCC;
  --stop-ink:    #8E241F;

  /* ground and ink */
  --paper:       #F6F4EF;
  --surface:     #FFFFFF;
  --surface-2:   #EDEAE2;
  --surface-3:   #F2F0EA;
  --line:        #E3DFD6;
  --line-strong: #D8D3C8;
  --ink:         #10161A;
  --ink-2:       #5C6A72;
  --ink-3:       #8D9AA2;
  --ink-4:       #A8B2B8;

  /* Chrome surfaces (exam bar, paywall hero, upsell, toast). These stay
     dark in BOTH themes — unlike --ink, which is a text colour and
     flips. Never use --ink as a background. */
  --chrome:      #10161A;
  --on-chrome:   #F6F4EF;

  --r-lg: 18px;
  --r-md: 14px;
  --r-sm: 12px;
  --r-xs: 11px;

  --wrap:   620px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --display: ui-rounded, "SF Pro Display", "Segoe UI Variable Display",
             system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body:    system-ui, -apple-system, "Segoe UI", Roboto,
             "Helvetica Neue", Arial, sans-serif;
}

/* The dark palette is declared twice on purpose — once for "follow the
   phone", once for an explicit choice in settings. CSS has no way to
   share a block between a media query and an attribute selector, so if
   you edit one, edit the other. Three states:
     no data-theme    -> follow the phone
     data-theme=light -> stay light even if the phone is dark
     data-theme=dark  -> stay dark even if the phone is light          */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:       #0D1113;
    --surface:     #161C1F;
    --surface-2:   #202829;
    --surface-3:   #1C2326;
    --line:        #2A3336;
    --line-strong: #3A4548;
    --ink:         #E8EBE9;
    --ink-2:       #9AA7AB;
    --ink-3:       #7A868A;
    --ink-4:       #616C70;
    --chrome:      #070B0D;
    --on-chrome:   #E8EBE9;

    --go:          #35B57C;
    --go-soft:     #12301F;
    --go-tint:     #12301F;
    --caution:     #D9A24E;
    --caution-soft:#332612;
    --caution-line:#5A431B;
    --caution-ink: #E8C079;
    --stop:        #E8695F;
    --stop-soft:   #341A19;
    --stop-line:   #5A2A27;
    --stop-ink:    #F0A29A;
  }
}

:root[data-theme="dark"] {
  --paper:       #0D1113;
  --surface:     #161C1F;
  --surface-2:   #202829;
  --surface-3:   #1C2326;
  --line:        #2A3336;
  --line-strong: #3A4548;
  --ink:         #E8EBE9;
  --ink-2:       #9AA7AB;
  --ink-3:       #7A868A;
  --ink-4:       #616C70;
  --chrome:      #070B0D;
  --on-chrome:   #E8EBE9;

  --go:          #35B57C;
  --go-soft:     #12301F;
  --go-tint:     #12301F;
  --caution:     #D9A24E;
  --caution-soft:#332612;
  --caution-line:#5A431B;
  --caution-ink: #E8C079;
  --stop:        #E8695F;
  --stop-soft:   #341A19;
  --stop-line:   #5A2A27;
  --stop-ink:    #F0A29A;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  overscroll-behavior-y: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body { min-height: 100vh; min-height: 100dvh; }
h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.015em; }

button {
  font: inherit; color: inherit; cursor: pointer;
  touch-action: manipulation;
}

.num {
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.015em;
}

.muted { color: var(--ink-2); }
.hidden { display: none !important; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px 20px;
}

.eyebrow {
  font-size: 11.5px; font-weight: 650; letter-spacing: 0.09em;
  text-transform: uppercase; color: var(--ink-3);
}

/* ── boot ──────────────────────────────────────────────────────────── */
.boot {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 16px;
  background: var(--chrome); color: var(--on-chrome);
}
.boot p { margin: 0; opacity: .55; font-size: 13.5px; }
.boot-mark {
  width: 56px; height: 56px; border-radius: 17px;
  display: grid; place-content: center;
  background: rgba(47,191,126,.16); color: var(--go-bright);
  animation: breathe 1.6s ease-in-out infinite;
}
.boot-fail {
  display: flex; flex-direction: column; align-items: stretch; gap: 12px;
  max-width: 330px; padding: 24px; text-align: center;
}
.boot-fail strong { font-size: 19px; font-family: var(--display); }
.boot-fail p { margin: 0 0 6px; opacity: .72; font-size: 14px; line-height: 1.5; }
.boot-fail .btn { color: var(--ink); }
.boot-fail .btn-bright { color: #062A1B; }

@keyframes breathe { 0%,100% { transform: scale(1); opacity: 1 } 50% { transform: scale(.92); opacity: .6 } }

/* ── screens ───────────────────────────────────────────────────────── */
.screen { display: none; min-height: 100vh; min-height: 100dvh; flex-direction: column; }
.screen.active { display: flex; }

/* ── buttons ───────────────────────────────────────────────────────── */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 12px 18px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); color: var(--ink);
  font-size: 14.5px; font-weight: 600;
  transition: transform .12s, filter .15s, background .15s;
}
.btn:active { transform: scale(.985); }
.btn[disabled] { opacity: .42; pointer-events: none; }

.btn-go     { background: var(--go); border-color: var(--go); color: #fff; font-weight: 700; }
.btn-ink    { background: var(--chrome); border-color: var(--chrome); color: var(--on-chrome); font-weight: 700; }
.btn-bright { background: var(--go-bright); border-color: var(--go-bright); color: #062A1B; font-weight: 700; }
.btn-quiet  { background: transparent; border-color: transparent; color: var(--ink-3); }
.btn-go:active, .btn-ink:active, .btn-bright:active { filter: brightness(.94); }
.btn-lg     { min-height: 52px; font-size: 15.5px; }
.btn-block  { width: 100%; }

.icon-btn {
  display: grid; place-content: center;
  width: 40px; height: 40px; flex: none;
  border: 0; border-radius: var(--r-xs); background: transparent; color: inherit;
}
.icon-btn:active { background: rgba(128,128,128,.14); }

.link-btn {
  border: 0; background: none; color: var(--go);
  padding: 6px 0; font-weight: 650; font-size: 13px;
}

.stack { display: flex; flex-direction: column; gap: 9px; }

/* ── cards ─────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 18px;
}
.card + .card { margin-top: 12px; }

/* ── home ──────────────────────────────────────────────────────────── */
.home-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(20px + var(--safe-t)) 20px 0;
  max-width: var(--wrap); margin: 0 auto; width: 100%;
}
/* The brand gives way before the page ever scrolls sideways. */
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.head-end { display: flex; align-items: center; gap: 6px; flex: none; }
.brand-mark {
  display: grid; place-content: center;
  width: 30px; height: 30px; flex: none;
  border-radius: 9px; background: var(--chrome); color: var(--on-chrome);
}
.brand-name {
  font-size: 17px; font-weight: 700; letter-spacing: -0.02em;
  font-family: var(--display);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; border-radius: 999px;
  font-size: 12px; font-weight: 650; white-space: nowrap;
  border: 0;
}
.pill-trial { background: var(--caution-soft); color: var(--caution-ink); }
.pill-paid  { background: var(--go-tint); color: var(--go); font-weight: 700; }
.pill-ghost { background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); }

/* readiness */
.ready-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.ready-score {
  font-size: 46px; font-weight: 700; line-height: 1.02;
  letter-spacing: -0.035em; color: var(--go);
}
.ready-score small { font-size: 24px; color: var(--ink-3); font-weight: 700; }
.ready-label { font-size: 14px; font-weight: 650; }
.ready-sub { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; margin-top: 2px; }

.spark { display: flex; align-items: flex-end; gap: 5px; height: 66px; padding-top: 14px; flex: none; }
.spark i { display: block; width: 13px; border-radius: 3px 3px 0 0; background: var(--line); min-height: 5px; }
.spark i.pass { background: var(--go); }
.spark i.fail { background: var(--stop); }

.rule { height: 1px; background: var(--line); margin: 17px 0 14px; }

.mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini b { display: block; font-size: 19px; font-weight: 700; font-family: var(--display); font-variant-numeric: tabular-nums; }
.mini b small { font-size: 14px; color: var(--ink-3); }
.mini span { font-size: 11.5px; color: var(--ink-2); }

/* primary CTA */
.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; min-height: 62px; padding: 16px 20px;
  border: 0; border-radius: 16px; background: var(--go); color: #fff;
  text-align: left; transition: transform .12s, filter .15s;
}
.cta:active { transform: scale(.99); filter: brightness(.95); }
.cta-title { font-size: 18.5px; font-weight: 700; font-family: var(--display); letter-spacing: -0.015em; }
.cta-sub { font-size: 12.5px; color: rgba(255,255,255,.78); }
.cta-arrow {
  display: grid; place-content: center;
  width: 38px; height: 38px; flex: none;
  border-radius: 50%; background: rgba(255,255,255,.16);
}
.cta.locked { background: var(--chrome); }

/* resume */
.resume {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  border-left: 3px solid var(--caution);
}
.resume-actions { display: flex; gap: 8px; }

/* section head */
.sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 24px 0 11px;
}
.sec-title { font-size: 14.5px; font-weight: 700; font-family: var(--display); letter-spacing: -0.01em; }
.sec-meta { font-size: 12.5px; color: var(--ink-3); }

/* tiles */
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.tile {
  display: flex; flex-direction: column; gap: 7px; align-items: flex-start;
  min-height: 44px; padding: 13px 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: transform .12s;
}
.tile:active { transform: scale(.98); }
.tile strong { font-size: 13.5px; font-weight: 650; }
.tile span { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* history rows */
.hist-list { display: flex; flex-direction: column; gap: 8px; }
.hist {
  display: flex; align-items: center; gap: 13px; width: 100%;
  padding: 12px 14px; text-align: left;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.hist-score {
  display: grid; place-content: center;
  width: 42px; height: 42px; flex: none; border-radius: var(--r-sm);
  font-size: 17px; font-weight: 700; font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
.hist-score.pass { background: var(--go-tint); color: var(--go); }
.hist-score.fail { background: var(--stop-soft); color: var(--stop); }
.hist-meta { display: flex; flex-direction: column; gap: 1px; flex-grow: 1; min-width: 0; }
.hist-meta strong { font-size: 14px; font-weight: 650; }
.hist-meta span { font-size: 12px; color: var(--ink-3); }

.empty { text-align: center; color: var(--ink-2); padding: 44px 20px; font-size: 14px; line-height: 1.6; }

/* settings */
.row-set {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 0; font-size: 15px;
}
.row-set + .row-set { border-top: 1px solid var(--line); }
.row-set select {
  font: inherit; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
}
.row-set input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--go); }
.fineprint { font-size: 11.5px; color: var(--ink-4); margin: 12px 0 0; line-height: 1.55; }

/* ── settings ──────────────────────────────────────────────────────── */
.seg {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px; margin-top: 11px; padding: 4px;
  background: var(--surface-2); border-radius: var(--r-sm);
}
.seg-btn {
  min-height: 42px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2);
  font-size: 13.5px; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: background .15s, color .15s;
}
.seg-btn.on {
  background: var(--surface); color: var(--ink); font-weight: 700;
  box-shadow: 0 1px 3px rgba(16,22,26,.12);
}

.row-btn {
  display: flex; align-items: center; gap: 11px;
  width: 100%; min-height: 50px; padding: 13px 0;
  border: 0; background: none; text-align: left;
  font-size: 15px; font-weight: 500; color: var(--ink);
}
.row-btn + .row-btn { border-top: 1px solid var(--line); }
.row-btn svg:first-child { flex: none; color: var(--ink-3); }
.row-btn .row-end { margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--ink-3); font-size: 13px; }
.row-btn.danger { color: var(--stop); font-weight: 600; }
.row-btn.danger svg:first-child { color: var(--stop); }
.row-btn[disabled] { opacity: .45; pointer-events: none; }

.licence-card {
  display: flex; align-items: center; gap: 13px;
  margin-top: 11px; padding: 14px;
  background: var(--go-tint); border-radius: var(--r-md);
}
.licence-card .lc-mark {
  display: grid; place-content: center; flex: none;
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--go); color: #fff;
}
.licence-card .lc-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.licence-card .lc-body strong {
  font-size: 16px; font-family: var(--display);
  font-variant-numeric: tabular-nums; letter-spacing: .02em;
}
.licence-card .lc-body span { font-size: 12px; color: var(--ink-2); }

/* ── exam command bar ──────────────────────────────────────────────── */
.exam-bar {
  position: sticky; top: 0; z-index: 20;
  background: var(--chrome); color: var(--on-chrome);
  padding: calc(14px + var(--safe-t)) 16px 14px;
}
.exam-bar-inner {
  display: flex; align-items: center; gap: 14px;
  max-width: var(--wrap); margin: 0 auto;
}
.exam-bar .icon-btn { background: rgba(255,255,255,.10); border-radius: 10px; width: 34px; height: 34px; }
.exam-bar .icon-btn:active { background: rgba(255,255,255,.2); }
.exam-progress { display: flex; flex-direction: column; gap: 6px; flex-grow: 1; min-width: 0; }
.exam-count {
  display: flex; align-items: baseline; justify-content: space-between;
  font-size: 12.5px; color: rgba(246,244,239,.62); font-variant-numeric: tabular-nums;
}
.exam-count b { color: var(--on-chrome); font-weight: 700; }
.exam-count em { font-style: normal; font-size: 11.5px; color: rgba(246,244,239,.45); }
.pbar { height: 4px; border-radius: 3px; background: rgba(255,255,255,.16); overflow: hidden; }
.pbar-fill { display: block; height: 100%; width: 5%; border-radius: 3px; background: var(--go-bright); transition: width .3s; }

.timer {
  font-family: var(--display); font-variant-numeric: tabular-nums;
  font-size: 19px; font-weight: 700; letter-spacing: -0.01em;
  padding: 6px 11px; border-radius: 10px;
  background: rgba(255,255,255,.10); min-width: 78px; text-align: center;
}
.timer.warn   { background: rgba(217,162,78,.22); color: #F0C987; }
.timer.danger { background: rgba(232,105,95,.22); color: #F7AEA7; animation: blink 1s step-start infinite; }
@keyframes blink { 50% { opacity: .5 } }

.exam-body, .practice-body { flex-grow: 1; padding-bottom: 104px; }

/* ── question ──────────────────────────────────────────────────────── */
.q-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-tag {
  display: inline-flex; padding: 5px 10px; border-radius: 7px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 11px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase;
}
.q-flag { color: var(--caution); font-size: 12.5px; font-weight: 650; }
.q-text {
  font-size: 17.5px; font-weight: 650; line-height: 1.42;
  letter-spacing: -0.008em; margin: 12px 0 0; text-wrap: pretty;
}
.q-imgs { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0 2px; }
.q-img {
  display: block; max-width: 100%; max-height: 190px;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 9px;
}

.img-missing {
  display: block; padding: 14px 16px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  color: var(--ink-2); font-size: 13px; line-height: 1.45; text-align: center;
}

.opts { display: flex; flex-direction: column; gap: 9px; margin-top: 14px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 46px; padding: 13px 14px; text-align: left;
  background: var(--surface); border: 1.5px solid var(--line);
  border-radius: var(--r-md); font-size: 15px; line-height: 1.35;
  transition: border-color .15s, background .15s, transform .1s;
}
.opt:active { transform: scale(.99); }
.opt-letter {
  display: grid; place-content: center;
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  background: var(--surface-3); border: 1.5px solid var(--line);
  color: var(--ink-2); font-size: 13.5px; font-weight: 700;
  font-family: var(--display);
  transition: all .15s;
}
.opt-body { flex: 1; min-width: 0; }
.opt-body img { display: block; max-width: 100%; max-height: 128px; border-radius: 9px; background: #fff; }
.opt-mark { flex: none; display: grid; place-content: center; }

.opt.chosen { background: var(--go-soft); border-color: var(--go); }
.opt.chosen .opt-letter { background: var(--go); border-color: var(--go); color: #fff; }
.opt.chosen .opt-body { font-weight: 600; }
.opt.right { background: var(--go-soft); border-color: var(--go); }
.opt.right .opt-letter { background: var(--go); border-color: var(--go); color: #fff; }
.opt.right .opt-body { font-weight: 600; }
.opt.wrong { background: var(--stop-soft); border-color: var(--stop); }
.opt.wrong .opt-letter { background: var(--stop); border-color: var(--stop); color: #fff; }
.opt.locked { pointer-events: none; }

.q-source { margin-top: 14px; font-size: 11.5px; color: var(--ink-4); }

.feedback {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 14px; padding: 13px 14px; border-radius: 13px;
  font-size: 13.5px; line-height: 1.48;
}
.feedback svg { flex: none; margin-top: 1px; }
.feedback.ok  { background: var(--go-tint); border: 1px solid var(--go); color: var(--go); }
.feedback.bad { background: var(--stop-soft); border: 1px solid var(--stop-line); color: var(--stop-ink); }
.feedback.wait { background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2); }

/* ── fixed footers ─────────────────────────────────────────────────── */
.foot {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: flex; gap: 8px;
  padding: 10px 14px calc(10px + var(--safe-b));
  background: var(--surface); border-top: 1px solid var(--line);
}
.foot-inner { display: flex; gap: 8px; width: 100%; max-width: var(--wrap); margin: 0 auto; }
.foot-inner > .btn { flex: 1; min-height: 46px; padding: 12px 6px; font-size: 13.5px; white-space: nowrap; }
.foot-inner > .btn-go { flex: 1.5; }
.foot-inner > .btn.flagged { background: var(--caution-soft); border-color: var(--caution-line); color: var(--caution-ink); }
@media (max-width: 359px) { .foot-inner > .btn { font-size: 12.5px; padding: 12px 3px; } }

/* ── sub bar ───────────────────────────────────────────────────────── */
.sub-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px;
  padding: calc(12px + var(--safe-t)) 14px 12px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.sub-bar h1 {
  flex: 1; text-align: center; font-size: 15.5px;
  font-family: var(--display); letter-spacing: -0.01em;
}
.sub-bar > .icon-btn { margin: -8px 0; }
.sub-end { min-width: 40px; text-align: right; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tally { display: flex; align-items: center; gap: 7px; justify-content: flex-end; min-width: 40px; }
.tally b { font-size: 14.5px; font-weight: 700; font-family: var(--display); }
.tally .ok { color: var(--go); }
.tally .bad { color: var(--stop); }
.tally i { display: block; width: 1px; height: 13px; background: var(--line); }
.pr-sub { display: flex; flex-direction: column; align-items: center; gap: 1px; flex: 1; }
.pr-sub span { font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ── result ────────────────────────────────────────────────────────── */
.verdict {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: calc(40px + var(--safe-t)) 24px 30px; color: #fff;
  border-radius: 0 0 26px 26px; text-align: center;
}
.verdict.pass { background: var(--go); }
.verdict.fail { background: var(--stop); }
.verdict-mark {
  display: grid; place-content: center;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,.18); margin-bottom: 5px;
}
.verdict-score {
  font-size: 60px; font-weight: 700; line-height: 1;
  letter-spacing: -0.04em; font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
.verdict-score small { font-size: 25px; opacity: .7; }
.verdict strong { font-size: 21px; font-family: var(--display); letter-spacing: -0.015em; }
.verdict p { margin: 0; font-size: 13.5px; line-height: 1.45; color: rgba(255,255,255,.82); max-width: 32ch; }

.quad { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.quad div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.quad b { font-size: 21px; font-weight: 700; font-family: var(--display); font-variant-numeric: tabular-nums; }
.quad span { font-size: 11px; color: var(--ink-3); }

.bars { display: flex; flex-direction: column; gap: 13px; margin-top: 14px; }
.bar-row { display: flex; align-items: center; gap: 11px; font-size: 13.5px; }
.bar-label { width: 78px; flex: none; color: var(--ink-2); }
.bar-track { flex-grow: 1; height: 8px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 5px; background: var(--go); transition: width .5s; }
.bar-fill.mid { background: var(--caution); }
.bar-fill.low { background: var(--stop); }
.bar-val { width: 42px; flex: none; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── review ────────────────────────────────────────────────────────── */
.rv { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 15px 16px; }
.rv + .rv { margin-top: 12px; }
.rv-head { display: flex; align-items: center; gap: 8px; }
.badge {
  font-size: 10.5px; font-weight: 700; padding: 4px 8px; border-radius: 6px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.badge.ok    { background: var(--go-tint); color: var(--go); }
.badge.bad   { background: var(--stop-soft); color: var(--stop); }
.badge.blank { background: var(--surface-2); color: var(--ink-3); }
.badge.plain { background: var(--surface-2); color: var(--ink-2); }
.rv-page { margin-left: auto; font-size: 11px; color: var(--ink-4); }
.rv .q-text { font-size: 15px; margin: 11px 0 0; }
.rv .opts { margin-top: 12px; gap: 7px; }
.rv .opt { font-size: 14px; padding: 11px 13px; min-height: 42px; }
.rv .opt-letter { width: 27px; height: 27px; font-size: 12.5px; }

/* ── paywall ───────────────────────────────────────────────────────── */
.pay-hero {
  background: var(--chrome); color: var(--on-chrome);
  padding: calc(32px + var(--safe-t)) 24px 30px;
}
.pay-hero-inner { max-width: var(--wrap); margin: 0 auto; display: flex; flex-direction: column; gap: 13px; }
.pay-lock {
  display: grid; place-content: center;
  width: 44px; height: 44px; border-radius: 13px;
  background: rgba(47,191,126,.16); color: var(--go-bright);
}
.pay-hero h1 { font-size: 27px; line-height: 1.18; letter-spacing: -0.028em; font-family: var(--display); text-wrap: pretty; }
.pay-hero p { margin: 0; font-size: 14.5px; line-height: 1.5; color: rgba(246,244,239,.68); text-wrap: pretty; }

.price-card { margin-top: -16px; }
.price-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.price {
  font-size: 34px; font-weight: 700; letter-spacing: -0.03em;
  font-family: var(--display); font-variant-numeric: tabular-nums;
}
.price small { font-size: 17px; color: var(--ink-2); font-weight: 700; }

.perks { display: flex; flex-direction: column; gap: 10px; }
.perk { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.perk svg { flex: none; color: var(--go); }

.steps { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.step { display: flex; align-items: flex-start; gap: 11px; font-size: 13.5px; line-height: 1.42; }
.step i {
  display: grid; place-content: center; font-style: normal;
  width: 23px; height: 23px; flex: none; border-radius: 50%;
  background: var(--chrome); color: var(--on-chrome);
  font-size: 12px; font-weight: 700; font-family: var(--display);
}
.momo-num {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--display); font-variant-numeric: tabular-nums;
  font-weight: 700;
}

.upsell {
  background: var(--chrome); color: var(--on-chrome);
  border-radius: var(--r-lg); padding: 17px 18px; margin-top: 14px;
}
.upsell-head { display: flex; align-items: center; gap: 10px; }
.upsell-head svg { flex: none; color: var(--go-bright); }
.upsell-head strong { font-size: 15px; font-family: var(--display); letter-spacing: -0.01em; }
.upsell p { margin: 9px 0 13px; font-size: 13px; line-height: 1.5; color: rgba(246,244,239,.7); text-wrap: pretty; }
.upsell b { color: var(--on-chrome); font-family: var(--display); font-variant-numeric: tabular-nums; }

/* ── unlock ────────────────────────────────────────────────────────── */
.code-wrap { position: relative; margin-top: 26px; }
.code-boxes {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  pointer-events: none;
}
.code-box {
  display: grid; place-content: center;
  width: 36px; height: 50px; border-radius: var(--r-xs);
  background: var(--surface); border: 1.5px solid var(--line);
  font-size: 21px; font-weight: 700; font-family: var(--display);
  color: var(--ink);
}
.code-box.filled { border-color: var(--ink); }
.code-box.here { border-color: var(--go); box-shadow: 0 0 0 3px rgba(11,122,75,.14); }
.code-dash { display: block; width: 11px; height: 1.5px; background: var(--line-strong); border-radius: 2px; }
#code-input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; background: transparent;
  font-size: 16px; letter-spacing: 1em;
}
.code-bad .code-box { border-color: var(--stop); }

/* ── partner driving school ────────────────────────────────────────── */
a.btn, a.row-btn { text-decoration: none; color: inherit; }
a.btn-wa, .btn-wa { background: #1FA855; border-color: #1FA855; color: #fff; font-weight: 700; }
.btn-wa:active { filter: brightness(.94); }

.pill-partner { background: var(--go-tint); color: var(--go); font-weight: 700; }

.partner-card {
  display: flex; align-items: center; gap: 13px; width: 100%;
  margin-top: 12px; padding: 14px 14px 14px 12px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  transition: transform .12s;
}
.partner-card:active { transform: scale(.99); }
.partner-card img {
  width: 58px; height: 58px; flex: none; border-radius: 50%;
  object-fit: cover; background: var(--surface-2);
  box-shadow: 0 0 0 3px var(--go-tint);
}
.partner-card .pc-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.partner-card .pc-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--go);
}
.partner-card strong { font-size: 15.5px; font-family: var(--display); letter-spacing: -0.01em; line-height: 1.25; }
.partner-card .pc-sub { font-size: 12.5px; color: var(--ink-2); }
.partner-card .row-end { color: var(--ink-3); flex: none; }

.partner-poster {
  display: block; width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface-2);
}
.partner-dot { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }

.result-partner { margin-top: 14px; overflow: hidden; padding: 0; }
.result-partner .rp-text { padding: 16px 18px 4px; }
.result-partner .rp-text strong { display: block; font-size: 16px; font-family: var(--display); letter-spacing: -0.01em; }
.result-partner .rp-text p { margin: 4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.result-partner .partner-poster { border: 0; border-radius: 0; margin-top: 12px; }
.result-partner .rp-actions { display: flex; gap: 9px; padding: 14px 18px 18px; }
.result-partner .rp-actions > * { flex: 1; }

.partner-page .partner-id { margin: 18px 0 4px; }
.partner-page .partner-id h2 { margin: 10px 0 2px; font-size: 24px; letter-spacing: -0.025em; }
.partner-page .partner-id p { margin: 0; font-size: 14px; }

.partner-quote {
  margin: 16px 0 0; padding: 16px 18px; border-radius: var(--r-lg);
  background: var(--go-tint); color: var(--ink);
}
.partner-quote svg { color: var(--go); }
.partner-quote blockquote { margin: 6px 0 8px; font-size: 15.5px; line-height: 1.5; font-weight: 550; }
.partner-quote figcaption { font-size: 12.5px; color: var(--ink-2); }
.partner-quote figcaption::before { content: '— '; }

.partner-page .card { margin-top: 12px; }

.partner-services { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.partner-services li { display: flex; align-items: center; gap: 10px; font-size: 14.5px; }
.partner-services li svg { flex: none; color: var(--go); }

.spotlight-panel { max-width: 460px; }
.spotlight-panel .partner-poster { max-width: 420px; margin: 0 auto; }
.spot-line { margin: 14px 2px 14px; font-size: 14.5px; line-height: 1.5; text-align: center; }

.banner-note {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 0 0 18px; padding: 12px 14px; border-radius: 13px;
  background: var(--caution-soft); border: 1px solid var(--caution-line);
  color: var(--caution-ink); font-size: 13.5px; line-height: 1.5;
}
.banner-note svg { flex: none; margin-top: 1px; }

/* free tier: the review shows which answers were wrong, not what was right */
.review-lock { margin-bottom: 14px; }

.help-row { display: flex; align-items: flex-start; gap: 11px; font-size: 13px; line-height: 1.5; color: var(--ink-2); }
.help-row svg { flex: none; margin-top: 1px; color: var(--ink-3); }

/* ── sheets / modals ───────────────────────────────────────────────── */
.sheet {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(9,14,16,.55);
  display: flex; align-items: flex-end; justify-content: center;
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.sheet.sheet-center { align-items: center; }
.sheet-panel {
  width: 100%; max-width: var(--wrap);
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 18px 18px calc(18px + var(--safe-b));
  max-height: 86vh; max-height: 86dvh;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  animation: rise .22s cubic-bezier(.2,.8,.3,1);
}
@keyframes rise { from { transform: translateY(16px); opacity: .6 } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-head strong { font-size: 15.5px; font-family: var(--display); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); margin-bottom: 14px; flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.dot.done { background: var(--go); }
.dot.flag { background: var(--caution); }
.dot.todo { background: var(--surface-2); border: 1px solid var(--line-strong); }

.grid-nums { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.gn {
  min-height: 46px; aspect-ratio: 1;
  display: grid; place-content: center; position: relative;
  border: 1.5px solid var(--line); border-radius: var(--r-xs);
  background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 700; font-family: var(--display);
  font-variant-numeric: tabular-nums;
}
.gn.done { background: var(--go); border-color: var(--go); color: #fff; }
.gn.flag { background: var(--caution-soft); border-color: var(--caution-line); color: var(--caution-ink); }
.gn.here { border-color: var(--ink); border-width: 2px; }
.gn.flag.done { background: var(--go); color: #fff; }
.gn.flag.done::after, .gn.flag::after {
  content: ''; position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px; border-radius: 50%; background: var(--caution);
}

/* ── first launch: the language page ─────────────────────────────────
   Its own colours in both themes: the brand green from the pass/go
   palette, the dark chrome tile from the start-up screen.            */
.lang-splash {
  position: fixed; inset: 0; z-index: 80;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(24px + var(--safe-t)) 20px calc(22px + var(--safe-b));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(120% 60% at 50% 18%, rgba(47,191,126,.22), transparent 70%),
    linear-gradient(180deg, #0B7A4B 0%, #075C38 55%, #05432A 100%);
  color: #fff; text-align: center;
  animation: ls-in .28s ease-out;
}
.lang-splash.hidden { display: none; }
@keyframes ls-in { from { opacity: 0 } }

.ls-top {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; max-width: 420px; padding: 12px 0 26px;
}
.ls-mark {
  display: grid; place-content: center;
  width: 112px; height: 112px; border-radius: 32px;
  background: #10161A; color: #2FBF7E;
  box-shadow: 0 0 0 8px rgba(255,255,255,.07), 0 18px 40px rgba(0,0,0,.28);
  animation: ls-pop .5s cubic-bezier(.2,.9,.3,1.25) both;
}
@keyframes ls-pop { from { transform: scale(.7); opacity: 0 } }
.ls-name {
  margin-top: 26px;
  font-family: var(--display); font-size: 40px; font-weight: 800; line-height: 1.05;
  letter-spacing: -0.03em;
}
.ls-tag {
  margin-top: 8px; font-size: 12px; font-weight: 650; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.62);
}
.ls-title { margin: 30px 0 0; font-size: 21px; font-family: var(--display); font-weight: 700; letter-spacing: -0.01em; }
.ls-sub { margin: 6px 0 0; font-size: 14.5px; color: rgba(255,255,255,.78); }

.ls-actions { display: flex; flex-direction: column; gap: 14px; width: 100%; max-width: 420px; }
.ls-btn {
  width: 100%; min-height: 62px; padding: 14px 20px;
  border: 0; border-radius: 22px;
  background: #FFFFFF; color: #0B5A39;
  font-family: var(--display); font-size: 21px; font-weight: 800; letter-spacing: -0.01em;
  box-shadow: 0 6px 0 #04331F;                    /* the raised edge */
  transition: transform .08s, box-shadow .08s, filter .15s;
}
.ls-btn.suggested { background: #2FBF7E; color: #062A1B; box-shadow: 0 6px 0 #1A7F51; }
.ls-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 #04331F; }
.ls-btn.suggested:active { box-shadow: 0 2px 0 #1A7F51; }
.ls-btn[disabled] { opacity: .7; }
.ls-btn:focus-visible { outline: 3px solid #FFFFFF; outline-offset: 3px; }
.ls-note { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: rgba(255,255,255,.55); }

@media (hover: hover) and (pointer: fine) {
  .ls-btn { cursor: pointer; }
  .ls-btn:hover { filter: brightness(1.05); }
}
/* short screens (phones sideways): smaller mark, less air */
@media (max-height: 620px) {
  .ls-mark { width: 76px; height: 76px; border-radius: 22px; }
  .ls-mark svg { width: 40px; height: 40px; }
  .ls-name { margin-top: 14px; font-size: 30px; }
  .ls-title { margin-top: 14px; }
  .ls-top { padding-bottom: 16px; }
  .ls-btn { min-height: 52px; font-size: 18px; }
  .ls-actions { gap: 11px; }
}
@media (max-width: 359px) { .ls-name { font-size: 34px; } }
/* phones held sideways: name on the left, the three choices on the right */
@media (orientation: landscape) and (max-height: 500px) {
  .lang-splash { flex-direction: row; justify-content: center; align-items: center; gap: 36px; }
  .ls-top { flex: 0 1 340px; padding: 0; }
  .ls-actions { flex: 0 1 360px; }
  .ls-mark { width: 64px; height: 64px; border-radius: 18px; }
  .ls-mark svg { width: 34px; height: 34px; }
  .ls-name { margin-top: 10px; font-size: 28px; }
  .ls-title { margin-top: 12px; font-size: 18px; }
  .ls-btn { min-height: 50px; font-size: 18px; }
  .ls-actions { gap: 10px; }
}
/* ── Kwiga: learn before any test ────────────────────────────────── */
.sec-start { color: var(--go); font-weight: 700; }
.tiles-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.study-tile { min-height: 104px; gap: 6px; padding: 14px; }
.study-tile strong { font-size: 15.5px; }
.study-count { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.study-bar {
  display: block; width: 100%; height: 6px; margin-top: auto;
  border-radius: 4px; background: var(--surface-2); overflow: hidden;
}
.study-bar b { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--go); transition: width .4s; }

.study-progress { height: 4px; background: var(--surface-2); }
.study-progress span { display: block; height: 100%; width: 0; background: var(--go); transition: width .3s; }

/* the right answer is the only thing that stands out */
.study-body .opt:not(.right) { opacity: .5; }
.study-body .opt.right { box-shadow: 0 0 0 3px var(--go-tint); }
.study-tip { margin: 16px 6px 0; text-align: center; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }

.study-done {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 8px 24px; text-align: center;
}
.study-done-mark {
  display: grid; place-content: center; width: 76px; height: 76px; border-radius: 50%;
  background: var(--go-tint); color: var(--go);
}
.study-done strong { font-size: 22px; font-family: var(--display); letter-spacing: -0.015em; }
.study-done p { margin: 0 0 10px; font-size: 15px; line-height: 1.5; color: var(--ink-2); }
.study-done .btn { width: 100%; max-width: 360px; }

/* a worked explanation under a revealed answer */
.q-explain {
  margin: 12px 0 0; padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--surface-2); border-left: 3px solid var(--go);
  font-size: 13.5px; line-height: 1.5; color: var(--ink-2); text-wrap: pretty;
}

.confirm-panel {
  border-radius: 20px; max-width: 380px; margin: auto;
  text-align: center; padding: 24px 22px;
}
.confirm-panel strong { display: block; font-size: 17.5px; margin-bottom: 6px; font-family: var(--display); }
.confirm-panel p { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions > * { flex: 1; }

/* ── toast ─────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: calc(86px + var(--safe-b)); z-index: 90;
  transform: translateX(-50%);
  background: var(--chrome); color: var(--on-chrome);
  padding: 12px 18px; border-radius: 30px;
  font-size: 13.5px; font-weight: 600; text-align: center;
  max-width: calc(100% - 32px);
  box-shadow: 0 10px 40px rgba(0,0,0,.24);
  animation: rise .2s;
}

@media (min-width: 620px) {
  .grid-nums { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}

/* ── partner location + desktop-only pieces ────────────────────────── */
.partner-where {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.partner-where svg { flex: none; color: var(--go); }
a.partner-where { color: var(--go); text-decoration: none; }

.aside-partner { display: flex; flex-direction: column; gap: 11px; }
.aside-partner .pill { align-self: flex-start; }
.aside-partner .partner-poster { cursor: pointer; }
.aside-partner strong { font-size: 17px; font-family: var(--display); letter-spacing: -0.015em; line-height: 1.25; }
.aside-partner p { margin: -4px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.aside-partner .partner-where { margin: -2px 0 2px; }

/* These only exist on bigger screens; phones get the compact versions. */
.home-aside, .exam-side, .pp-wa-inline { display: none; }
.cta-wrap { margin-top: 14px; }

/* the exam fills the screen so its footer can sit at the bottom */
.exam-layout, .exam-main { display: flex; flex-direction: column; flex-grow: 1; min-width: 0; }

/* Long words and addresses wrap instead of pushing the page sideways. */
img { max-width: 100%; }
.row-btn > span:not(.row-end), .q-text, .opt-body, .tile strong { overflow-wrap: anywhere; }

/* ══ Three layouts, not one stretched ══════════════════════════════════
     phone    < 720px    one column, fixed thumb-reach footers (above)
     tablet   720–1099   wider column, side-by-side cards, centred sheets
     computer ≥ 1100     two-pane: work on the left, context on the right,
                         keyboard and mouse first
   Each screen picks its own width, so reading lines stay comfortable.  */

/* ── small phones (iPhone SE 1st gen, cheap Androids at 320px) ─────── */
@media (max-width: 359px) {
  .wrap { padding-left: 14px; padding-right: 14px; }
  .home-head { padding-left: 14px; padding-right: 14px; }
  .tiles { gap: 7px; }
  .tile { padding: 12px 9px; }
  .tile strong { font-size: 12.5px; }
  .ready-score { font-size: 40px; }
  .spark i { width: 10px; }
  .quad b { font-size: 18px; }
  .price { font-size: 30px; }
  .result-partner .rp-actions { flex-direction: column; }
}

/* Eight code boxes plus a dash must fit a 320px screen. */
.code-boxes { gap: clamp(4px, 1.6vw, 8px); }
.code-box { width: min(36px, calc((100vw - 100px) / 8)); }

/* ── phones held sideways ──────────────────────────────────────────── */
@media (orientation: landscape) and (max-height: 500px) {
  .exam-bar { padding-top: calc(8px + var(--safe-t)); padding-bottom: 8px; }
  .verdict { padding-top: calc(18px + var(--safe-t)); padding-bottom: 18px; }
  .verdict-score { font-size: 46px; }
  .pay-hero { padding-top: calc(18px + var(--safe-t)); padding-bottom: 26px; }
  .q-img { max-height: 140px; }
  .foot { padding-top: 7px; padding-bottom: calc(7px + var(--safe-b)); }
  .foot-inner > .btn { min-height: 42px; }
  .exam-body, .practice-body { padding-bottom: 86px; }
  .sheet-panel { max-height: 94vh; max-height: 94dvh; }
  .boot-fail { max-width: 460px; }
}

/* ── tablet and up ─────────────────────────────────────────────────── */
@media (min-width: 720px) {
  .screen { --wrap: 760px; }
  #screen-unlock { --wrap: 520px; }
  .wrap { padding-left: 24px; padding-right: 24px; }
  .home-head { padding-left: 24px; padding-right: 24px; }

  /* readiness and the big start button side by side */
  .home-top {
    display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 14px; align-items: stretch;
  }
  .cta-wrap { margin-top: 0; display: flex; }
  .cta {
    flex-direction: column; align-items: flex-start; justify-content: space-between;
    padding: 22px; border-radius: var(--r-lg);
  }
  .cta-title { font-size: 22px; }
  .cta-sub { font-size: 13.5px; }
  .cta-arrow { align-self: flex-end; width: 46px; height: 46px; }
  .hist-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hist-list > :not(.hist) { grid-column: 1 / -1; }

  .q-text { font-size: 19px; }
  .opt { font-size: 15.5px; }
  .q-img { max-height: 230px; }

  /* results: score and breakdown left, what to do next right */
  .result-grid {
    display: grid; gap: 14px; align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "quad side" "bars side" "acts side";
    grid-template-rows: auto auto 1fr;
    padding-top: 22px;
  }
  .result-grid > * { margin-top: 0 !important; }
  .rs-quad { grid-area: quad; }
  .rs-bars-card { grid-area: bars; }
  .result-side { grid-area: side; }
  .rs-actions { grid-area: acts; }
  .result-side { display: flex; flex-direction: column; gap: 14px; }
  .result-side > :empty { display: none; }
  .result-side .upsell, .result-side .result-partner { margin-top: 0; }
  .verdict { border-radius: 0 0 32px 32px; }

  /* settings as two columns of cards */
  .settings-grid { columns: 2; column-gap: 16px; padding-top: 22px; }
  .settings-grid > .card {
    display: inline-block; width: 100%; margin: 0 0 16px;
    break-inside: avoid; -webkit-column-break-inside: avoid;
  }
  .settings-grid > .fineprint { column-span: all; }

  /* paywall: what you get beside how to pay */
  .pay-grid {
    display: grid; gap: 16px; align-items: start;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pay-grid > .card { margin-top: -16px; }
  .pay-actions { grid-column: 1 / -1; width: 100%; max-width: 460px; justify-self: center; }
  .pay-hero-inner { max-width: calc(var(--wrap) - 48px); }
  .pay-hero h1 { font-size: 31px; max-width: 24ch; }
  .pay-hero p { max-width: 56ch; }

  /* partner page: poster stays in view, details scroll beside it */
  .partner-page {
    display: grid; column-gap: 26px; align-items: start;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    padding-top: 22px; padding-bottom: 40px !important;
  }
  .partner-page > .partner-poster {
    grid-column: 1; grid-row: 1 / span 4;
    position: sticky; top: calc(84px + var(--safe-t));
  }
  .partner-page > :not(.partner-poster) { grid-column: 2; }
  .partner-page .partner-id { margin-top: 0; }
  .pp-wa-inline { display: flex; margin-top: 14px; }
  #screen-partner > .foot { display: none; }

  /* sheets become centred dialogs instead of bottom drawers */
  .sheet { align-items: center; padding: 24px; }
  .sheet-panel {
    border-radius: 22px; padding-bottom: 18px;
    max-height: 88vh; max-height: 88dvh;
    box-shadow: 0 24px 80px rgba(0,0,0,.28);
  }
  .toast { bottom: calc(96px + var(--safe-b)); }
}

/* ── computer ──────────────────────────────────────────────────────── */
@media (min-width: 1100px) {
  #screen-home     { --wrap: 1160px; }
  #screen-exam     { --wrap: 1180px; }
  #screen-result   { --wrap: 1080px; }
  #screen-review   { --wrap: 1180px; }
  #screen-settings { --wrap: 960px; }
  #screen-paywall  { --wrap: 960px; }
  #screen-partner  { --wrap: 1080px; }
  #screen-practice { --wrap: 820px; }
  #screen-history  { --wrap: 900px; }
  .wrap, .home-head { padding-left: 32px; padding-right: 32px; }
  .pay-hero-inner { max-width: calc(var(--wrap) - 64px); }

  /* home: the work on the left, the driving school poster always in view */
  .home-grid {
    display: grid; gap: 30px; align-items: start;
    grid-template-columns: minmax(0, 1fr) 340px;
    padding-top: 22px;
  }
  .home-aside { display: block; position: sticky; top: 22px; }
  #home-partner { display: none; }
  .ready-score { font-size: 54px; }

  /* exam: question left, every question number right */
  .exam-layout {
    display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px;
    align-items: start; flex-grow: 1;
    width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 32px;
  }
  .exam-main { min-height: calc(100vh - 64px - var(--safe-t)); min-height: calc(100dvh - 64px - var(--safe-t)); }
  .exam-main > .wrap { max-width: none; padding: 30px 0 24px; }
  .exam-foot {
    position: sticky; bottom: 0; left: auto; right: auto;
    padding: 18px 0 calc(22px + var(--safe-b));
    background: linear-gradient(to bottom, transparent, var(--paper) 22px);
    border-top: 0;
  }
  .exam-foot .foot-inner { max-width: none; }
  .exam-foot .foot-inner > .btn { flex: none; min-width: 120px; padding: 12px 22px; font-size: 14.5px; }
  .exam-foot .foot-inner > .btn-go { margin-left: auto; min-width: 180px; }
  #btn-grid { display: none; }
  .exam-side { display: block; position: sticky; top: calc(86px + var(--safe-t)); padding-top: 30px; }
  .side-card { padding: 18px; }
  .side-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; margin-bottom: 16px; }
  .side-grid .gn { min-height: 0; font-size: 14.5px; }
  .kbd-hint b { color: var(--ink-2); font-weight: 650; }

  .exam-body .q-text, .practice-body .q-text { font-size: 21px; line-height: 1.4; }
  .exam-body .opt, .practice-body .opt { font-size: 16px; min-height: 54px; padding: 14px 16px; }
  .q-img { max-height: 270px; }

  /* results */
  .result-grid { grid-template-columns: minmax(0, 1fr) 380px; column-gap: 22px; }

  /* review: two answers per row instead of one long scroll */
  #review-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
  #review-body > .rv { margin-top: 0; }
  #review-body > :not(.rv) { grid-column: 1 / -1; }

  .partner-page { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 34px; }
}

/* very wide monitors: keep the poster column proportionate */
@media (min-width: 1500px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) 380px; }
}

/* ── mouse and keyboard ────────────────────────────────────────────── */
@media (hover: hover) and (pointer: fine) {
  .btn:hover { filter: brightness(.97); }
  .btn:not(.btn-go):not(.btn-ink):not(.btn-bright):not(.btn-wa):not(.btn-quiet):hover { background: var(--surface-3); border-color: var(--line-strong); }
  .btn-go:hover, .btn-ink:hover, .btn-bright:hover, .btn-wa:hover, .cta:hover { filter: brightness(1.08); }
  .btn-quiet:hover { color: var(--ink); }
  .opt:not(.locked):hover { border-color: var(--line-strong); background: var(--surface-3); }
  .opt.chosen:hover { background: var(--go-soft); border-color: var(--go); }
  .tile:hover, .hist:hover, .partner-card:hover { border-color: var(--line-strong); background: var(--surface-3); }
  .gn:not(.done):not(.flag):hover { border-color: var(--line-strong); background: var(--surface-3); }
  .row-btn:hover { color: var(--go); }
  .row-btn.danger:hover { color: var(--stop); filter: brightness(.9); }
  .icon-btn:hover { background: rgba(128,128,128,.12); }
  .exam-bar .icon-btn:hover { background: rgba(255,255,255,.18); }
  .link-btn:hover, a.partner-where:hover { text-decoration: underline; }
  .seg-btn:not(.on):hover { color: var(--ink); }
  .opt, .tile, .hist, .gn, .row-btn, .partner-card { cursor: pointer; }
  .opt.locked { cursor: default; }
}
@media (hover: none) {
  .kbd-hint { display: none; }
}

:focus-visible { outline: 2.5px solid var(--go); outline-offset: 2px; }
.exam-bar :focus-visible, .pay-hero :focus-visible { outline-color: var(--go-bright); }
:focus:not(:focus-visible) { outline: none; }
#code-input:focus-visible { outline: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
