:root {
  --blue: #F2563B; --blue-dark: #D9442B; --ink: #14181F; --mut: #5A6472;
  --bg: #FFFFFF; --card: #ffffff; --line: #DDE6F1;
  --good: #059669; --grow: #d97706;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink); }
.screen { display: none; min-height: 100vh; padding: 16px; position: relative; }
.screen.active { display: block; }

/* ---------- landing ---------- */
.landing { padding: 0 0 40px; }
.hero { background: linear-gradient(135deg, #D9442B 0%, #F2563B 45%, #E8960F 100%);
  color: #fff; text-align: center; padding: 52px 20px 86px; }
.brand.light { color: #bfdbfe; letter-spacing: 2px; font-size: .8rem; }
.hero-h1 { font-size: clamp(1.8rem, 6vw, 2.8rem); margin: 10px 0 12px; }
.hero-sub { color: #dbeafe; max-width: 560px; margin: 0 auto 20px; line-height: 1.5; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35);
  border-radius: 999px; padding: 7px 14px; font-size: .85rem; font-weight: 600; }
.landing .card { margin: 24px auto; max-width: 640px; }
.card.overlap { margin-top: -48px; box-shadow: 0 12px 32px rgba(17,24,39,.14); }
.price-row { display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 8px; border-bottom: 1px dashed var(--line); padding-bottom: 14px; }
.price { font-size: 1.7rem; font-weight: 800; }
.price-note { color: var(--mut); font-size: .82rem; display: block; }
.free-badge { background: #dcfce7; color: #166534; font-weight: 700; font-size: .85rem;
  border-radius: 999px; padding: 8px 14px; }
.big-cta { font-size: 1.15rem; padding: 16px; }
.opt-tag { color: var(--mut); font-weight: 400; font-size: .82rem; }
.landing-h2 { font-size: 1.15rem; margin-bottom: 14px; }
.get-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.get { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.get span { font-size: 1.5rem; }
.get b { display: block; margin: 6px 0 4px; }
.get p { color: var(--mut); font-size: .85rem; line-height: 1.45; }
.cert-teaser { text-align: center; margin-top: 18px; }
.mini-cert { display: inline-block; background: #fffdf7; border: 2px solid #c9a227;
  border-radius: 6px; padding: 16px 26px; box-shadow: 0 6px 18px rgba(0,0,0,.12);
  transform: rotate(-1.5deg); font-family: Georgia, serif; }
.mc-brand { font-family: Helvetica, sans-serif; font-size: .55rem; letter-spacing: 1px;
  color: var(--blue); font-weight: 700; }
.mc-title { font-variant: small-caps; font-size: .8rem; margin-top: 2px; }
.mc-name { font-weight: 700; font-size: 1.05rem; border-bottom: 1px solid #c9a227;
  margin: 6px 0; padding-bottom: 3px; }
.mc-score { font-size: 1.6rem; font-weight: 800; color: var(--blue); }
.mc-score span { color: var(--blue); }
.mc-serial { font-family: Helvetica, sans-serif; font-size: .58rem; color: var(--mut); margin-top: 4px; }
.cert-caption { color: var(--mut); font-size: .85rem; margin-top: 10px; }
.sample-row { display: flex; gap: 10px; margin-top: 16px; }
.sample-row button { flex: 1; }
.klass-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.klass { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.klass-emoji { font-size: 1.6rem; }
.klass b { display: block; margin: 6px 0 2px; }
.klass-num { color: var(--blue); font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.klass p { color: var(--mut); font-size: .84rem; line-height: 1.45; }
.klass p.klass-num { color: var(--blue); }
.klass-common { margin-top: 14px; font-size: .92rem; }
.klass-common ul { margin: 8px 0 0 2px; list-style: none; }
.klass-common li { margin: 7px 0; line-height: 1.45; }
@media (max-width: 640px) { .klass-grid { grid-template-columns: 1fr; } .sample-row { flex-direction: column; } }
@media (max-width: 560px) { .get-grid { grid-template-columns: 1fr; } }
.card { max-width: 760px; margin: 24px auto; background: var(--card);
  border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.card.center { text-align: center; }
.brand { color: var(--blue); font-weight: 700; letter-spacing: .4px; margin-bottom: 6px; }
h1 { font-size: 1.5rem; margin-bottom: 8px; }
.sub { color: var(--mut); margin-bottom: 20px; }
label { display: block; margin: 14px 0 4px; font-weight: 600; font-size: .95rem; }
input, select { width: 100%; padding: 12px; margin-top: 6px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 1rem; background: #fff; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: 13px 22px;
  font-size: 1rem; font-weight: 600; }
button:disabled { opacity: .4; cursor: default; }
button.primary { background: var(--blue); color: #fff; width: 100%; margin-top: 20px; }
button.primary:active { background: var(--blue-dark); }
button.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.fine { color: var(--mut); font-size: .8rem; margin-top: 16px; line-height: 1.4; }
.hidden { display: none; }
.big { font-size: 2.2rem; font-weight: 700; margin: 14px 0; }

#hud { max-width: 760px; margin: 0 auto; display: flex; justify-content: space-between;
  padding: 10px 4px; font-weight: 600; color: var(--mut); font-size: .9rem; }
#hud-timer.low { color: #dc2626; }
#q-prompt { font-weight: 800; font-size: 1.2rem; line-height: 1.4; margin-bottom: 14px; }
#q-stem svg { width: 100%; height: auto; max-height: 46vh; }
#q-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px; margin-top: 14px; }
.opt { border: 2px solid var(--line); border-radius: 10px; background: #fff;
  padding: 6px; position: relative; }
.opt svg { width: 100%; height: auto; }
.opt .tag { position: absolute; top: 4px; left: 8px; font-weight: 700; color: var(--mut); }
.opt.sel { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.opt { cursor: pointer; transition: transform .08s, border-color .12s; }
.opt:active { transform: scale(.96); }
.opt-check { position: absolute; top: 4px; right: 8px; color: var(--blue);
  font-weight: 800; opacity: 0; transition: opacity .12s; }
.opt.sel .opt-check { opacity: 1; }

/* zone intro */
#zone-intro { position: absolute; inset: 0; display: none; z-index: 20;
  background: linear-gradient(135deg, #D9442B, #F2563B 45%, #E8960F);
  color: #fff; align-items: center; justify-content: center; text-align: center; }
#zone-intro.show { display: flex; animation: zi-in .3s ease-out; }
@keyframes zi-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.zi-inner { padding: 24px; }
.zi-name { font-size: 2rem; font-weight: 800; margin-bottom: 10px; }
.zi-tag { font-size: 1.1rem; color: #dbeafe; margin-bottom: 26px; }
#zone-intro .zi-go { background: #fff; color: var(--blue); max-width: 240px; margin: 0 auto; }

/* numerical: type your answer */
/* W1-06 layout budget: pad + confirm tick must fit above the fold at 360x740 */
.num-entry { text-align: center; padding: 4px 0 2px; }
.num-disp { font-size: 2rem; font-weight: 800; min-height: 44px; letter-spacing: 3px;
  border-bottom: 2px solid var(--line); max-width: 260px; margin: 0 auto 10px; }
.num-pad { display: grid; grid-template-columns: repeat(3, 68px); gap: 8px; justify-content: center; }
.num-key { font-size: 1.3rem; padding: 10px 0; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; font-weight: 700; cursor: pointer; }
.num-key:active { background: #eef2ff; }
.num-ok { background: var(--blue); color: #fff; border: 0; }
.num-ok:disabled { opacity: .35; }
#q-nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 18px; }
#q-nav .primary { width: auto; margin-top: 0; }

/* ---------- working memory mini-games ---------- */
.wm-intro { text-align: center; padding: 16px 0; }
.wm-emoji { font-size: 3rem; }
.wm-len { font-weight: 700; margin: 10px 0 18px; }
.wm-done-note { color: var(--good); font-weight: 600; margin-bottom: 10px; }
.wm-intro .primary { max-width: 320px; margin: 0 auto; }
.wm-stage { text-align: center; padding: 24px 0; }
.wm-flash { font-size: 5rem; font-weight: 800; height: 110px; line-height: 110px; }
.wm-flash.pop { animation: wmpop .25s ease-out; }
@keyframes wmpop { from { transform: scale(.4); opacity: .2; } to { transform: scale(1); opacity: 1; } }
.wm-hint { color: var(--mut); margin-top: 8px; }
.wm-answer { text-align: center; padding: 6px 0; }
.wm-answer > p { font-weight: 700; margin-bottom: 8px; }
.wm-entry { font-size: 1.6rem; font-weight: 700; letter-spacing: 6px; min-height: 40px;
  border-bottom: 2px solid var(--line); max-width: 320px; margin: 0 auto 10px; }
.wm-pad { display: grid; grid-template-columns: repeat(3, 68px); gap: 8px; justify-content: center; }
.wm-key { font-size: 1.3rem; padding: 10px 0; border: 1px solid var(--line); border-radius: 12px;
  background: #fff; font-weight: 700; cursor: pointer; }
.wm-key:active { background: #eef2ff; }
.wm-ok { background: var(--blue); color: #fff; border: 0; }
.wm-ok:disabled { opacity: .35; }
.wm-grid { display: grid; grid-template-columns: repeat(3, 76px); grid-template-rows: repeat(3, 76px);
  gap: 9px; justify-content: center; margin: 0 auto; }
.wm-cell { background: #e8edf7; border-radius: 12px; position: relative; }
.wm-cell.tap { cursor: pointer; }
.wm-cell.lit { background: var(--blue); box-shadow: 0 0 18px rgba(37,99,235,.55); }
/* class-wise Memory Master skins: same cells, same scoring — only the faces
   change with age. 3-5 parade · 6-8 picture cards · 9-10 gallery · 11-12 cards */
.wm-grid.parade .wm-cell, .wm-grid.pictures .wm-cell, .wm-grid.gallery .wm-cell,
.wm-grid.cards .wm-cell { display: flex; align-items: center; justify-content: center;
  transition: transform .15s; }
.wm-grid.parade .wm-cell { background: #FFF8E6; font-size: 38px; }
.wm-grid.parade .wm-cell.lit { background: #FFF3C4; transform: scale(1.14);
  box-shadow: 0 0 0 4px #F2563B; }
.wm-grid.pictures .wm-cell { background: #fff; border: 2px solid #C2571A;
  border-radius: 10px; font-size: 32px; }
.wm-grid.pictures .wm-cell.lit { background: #FFF3C4; transform: scale(1.1);
  box-shadow: 0 0 0 3px #C2571A; }
.wm-grid.gallery .wm-cell { background: #fff; border: 3px double #14181F;
  border-radius: 4px; font-size: 30px; }
.wm-grid.gallery .wm-cell.lit { background: #FFF8E6; transform: scale(1.08);
  box-shadow: 0 0 0 3px #E8A100; }
.wm-grid.cards .wm-cell { background: #fff; border: 2px solid #14181F;
  border-radius: 8px; font-size: 19px; font-weight: 800; color: #14181F; }
.wm-grid.cards .wm-cell.lit { background: #FFF3C4; transform: scale(1.08);
  box-shadow: 0 0 0 3px #14181F; }
/* flip & match (#69) */
.pairs-grid { display: grid; gap: 10px; max-width: 480px; margin: 10px auto; }
.pcard { aspect-ratio: 1; cursor: pointer; perspective: 500px; }
.pcard-in { position: relative; width: 100%; height: 100%; transition: transform .35s;
  transform-style: preserve-3d; }
.pcard.up .pcard-in, .pcard.won .pcard-in { transform: rotateY(180deg); }
.pcard-back, .pcard-face { position: absolute; inset: 0; backface-visibility: hidden;
  border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.pcard-back { background: #F2563B; color: #FFF3C4; font-size: 1.6rem; font-weight: 800; }
.pcard-face { background: #fff; border: 2px solid #E5D9C3; transform: rotateY(180deg); padding: 8px; }
.pcard-face svg { width: 100%; height: 100%; }
.pcard.won .pcard-face { border-color: #1E8E3E; box-shadow: 0 0 0 3px rgba(30,142,62,.35); }
.pairs-meter { text-align: center; font-weight: 700; color: #6b6257; margin-top: 8px; }
.wm-trial-tag { font-weight: 800; color: #1E8E3E; letter-spacing: .5px; margin: 4px 0; }
.wm-intro.trial { border: 2px dashed #1E8E3E; border-radius: 14px; padding: 14px; }
.wm-say { margin: 0 8px 8px 0; }
.wm-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.4rem; color: var(--blue); }
.wm-grid-nav { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }

.confetti { text-align: center; font-size: 1.6rem; margin-bottom: 6px; }
.center-text { text-align: center; }
.mut { color: var(--mut); }
.iq-ring { width: 170px; height: 170px; margin: 18px auto 8px; border-radius: 50%;
  border: 8px solid var(--blue); display: flex; flex-direction: column;
  align-items: center; justify-content: center; box-shadow: 0 0 0 8px rgba(37,99,235,.12); }
.iq-num { font-size: 3.4rem; font-weight: 800; line-height: 1; }
.iq-cap { font-size: .75rem; color: var(--mut); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.beat { font-weight: 700; font-size: 1.05rem; margin: 12px 0 18px; }
.share-row { display: flex; gap: 10px; margin-top: 10px; }
.share-row button { flex: 1; }
.wa { border-color: #25d366; color: #128c7e; font-weight: 700; }
/* CareerGuide account box (result screen) */
.acct { border: 1px dashed var(--blue); border-radius: 12px; padding: 16px;
  margin-top: 14px; background: #f6f9ff; }
.acct h3 { font-size: 1rem; margin-bottom: 6px; }
.acct input { width: 100%; padding: 11px; margin-top: 8px; border: 1px solid var(--line);
  border-radius: 10px; font-size: .95rem; background: #fff; }
.acct .primary { margin-top: 12px; }
.acct-row { display: flex; gap: 10px; margin-top: 12px; }
.acct-row button { flex: 1; margin: 0; }
.acct-note { color: var(--mut); font-size: .88rem; line-height: 1.45; }
.acct-note.ok { color: var(--good); font-weight: 600; }
.acct-note.err { color: #dc2626; font-weight: 600; }
.acct-small { padding: 8px 14px; font-size: .85rem; margin-top: 8px; }

.retake-cta { border: 2px dashed var(--blue); border-radius: 14px; background: #FFF6F1;
  padding: 16px 18px; text-align: center; margin-top: 14px; line-height: 1.5; }

.explain { margin-top: 26px; }
.explain h2 { font-size: 1.05rem; margin-bottom: 10px; }
.explain details { border: 1px solid var(--line); border-radius: 10px;
  margin: 8px 0; background: #fafbfe; }
.explain summary { cursor: pointer; padding: 13px 14px; font-weight: 700;
  list-style: none; }
.explain summary::-webkit-details-marker { display: none; }
.explain summary::after { content: "＋"; float: right; color: var(--blue); }
.explain details[open] summary::after { content: "－"; }
.explain p { padding: 0 14px 14px; line-height: 1.55; font-size: .95rem; }
.dimrow { margin: 12px 0; }
.dimrow .name { display: flex; justify-content: space-between; font-size: .92rem;
  font-weight: 600; margin-bottom: 4px; }
.bar { height: 10px; background: var(--line); border-radius: 6px; overflow: hidden; }
.bar > div { height: 100%; background: var(--blue); border-radius: 6px; }
.callouts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.callout { border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.callout h3 { font-size: .85rem; text-transform: uppercase; letter-spacing: .4px; margin-bottom: 6px; }
.callout.good h3 { color: var(--good); }
.callout.grow h3 { color: var(--grow); }
@media (max-width: 560px) { .callouts { grid-template-columns: 1fr; } .card { padding: 18px; } }


/* W1-01: idle "are you still there?" pause overlay */
#idle-overlay { position: absolute; inset: 0; display: none; z-index: 40; cursor: pointer;
  background: rgba(17,24,39,.88); color: #fff;
  align-items: center; justify-content: center; text-align: center; }
#idle-overlay.show { display: flex; animation: zi-in .3s ease-out; }
.idle-inner { padding: 24px; }
.idle-emoji { font-size: 3rem; }
.idle-title { font-size: 1.6rem; font-weight: 800; margin-top: 10px; }
.idle-sub { color: #d1d5db; margin-top: 10px; font-size: 1rem; }

/* W1-11: Skip must not look like Next */
#btn-skip { border: 1px dashed var(--grow); color: var(--grow); background: #fffbeb; }

/* one-time hint toast */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(16px);
  background: #111827; color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: .9rem; font-weight: 600; max-width: 90vw; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 60; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* keypad input-mode announcement (W1-07) */
.pad-hint { color: var(--mut); font-size: .82rem; margin-bottom: 8px; }

/* frozen timer on the break screen (W1-04) */
.break-frozen { color: var(--mut); margin-top: 10px; }
.break-frozen b { color: var(--ink); }

/* W1-06: short phones (360x740 class) — everything answerable above the fold */
@media (max-height: 760px) {
  #q-stem svg { max-height: 32vh; }
  .card { padding: 16px; }
  #q-prompt { margin-bottom: 8px; }
  #q-options { margin-top: 10px; }
  #q-nav { margin-top: 12px; }
  .wm-stage { padding: 12px 0; }
  .wm-grid { grid-template-columns: repeat(3, 68px); grid-template-rows: repeat(3, 68px); }
}

/* mid-test paywall
   14 Oct 2026 (audit of 13 Oct, item 13 — layout only, no word changed). The card opened with no heading, only
   the pay button, for two reasons: (1) it was centred with align-items:center, so a card taller than its layer
   spilled ABOVE the layer's top, where no scroll reaches (65 px at 1280x650); (2) the layer began at the top of
   the PAGE, so a child who had scrolled down to tap Next opened it with the heading 280-350 px above the window
   on a phone. Now the layer is the window itself (fixed), the card is centred by auto margins, which fall back to
   0 when the card is taller than the window (it then starts at the top and the layer scrolls to its last line),
   and the page behind stays still while the card is open. Where the card fits, it sits exactly where it sat. */
#paywall { position: fixed; inset: 0; display: none; z-index: 30; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(135deg, #D9442B, #F2563B 45%, #E8960F); color: #fff; }
#paywall.show { display: flex; animation: zi-in .3s ease-out; }
.pw-inner { max-width: 420px; padding: 28px 20px; text-align: center; margin: auto; }
html:has(#paywall.show) { overflow: hidden; }
.pw-title { font-size: 1.7rem; font-weight: 800; }
.pw-sub { color: #dbeafe; margin: 10px 0 16px; line-height: 1.5; }
.pw-preview { position: relative; background: #fff; border-radius: 14px; padding: 18px; }
.pw-blur { filter: blur(5px); }
.pw-ring { width: 90px; height: 90px; border-radius: 50%; border: 6px solid #F2563B;
  margin: 0 auto 12px; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 800; color: #111827; }
.pw-bars div { height: 9px; background: #e5e7eb; border-radius: 6px; margin: 7px 0; }
.pw-bars i { display: block; height: 100%; background: #F2563B; border-radius: 6px; }
.pw-cert { color: #92400e; background: #fef3c7; border-radius: 8px; padding: 8px;
  font-weight: 700; font-size: .85rem; margin-top: 10px; }
.pw-lock { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 3.4rem; }
.pw-what { color: #dbeafe; font-size: .85rem; margin: 14px 0 4px; line-height: 1.5; }
#paywall .pw-pay { background: #fff; color: #D9442B; font-size: 1.1rem; }
.pw-note { color: #bfdbfe; font-size: .78rem; margin-top: 10px; }

/* parent-consent gate (DPDP) */
.acct-check { display: flex; gap: 8px; align-items: flex-start; font-size: .84rem;
  color: #475569; margin: 8px 0 10px; line-height: 1.45; }
.acct-check input { margin-top: 3px; flex: 0 0 auto; }

/* G6 (shared QA standard): reserve the scrollbar gutter so the card never
   shifts left/right between screens. G3/G4/G5 already satisfied here —
   .opt-check is pre-rendered and revealed by opacity, and .opt:active uses
   transform, so selection never changes layout. */
html { scrollbar-gutter: stable; }

/* zone intro: what's coming (W1-05) */
.zi-step { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: #93c5fd; font-weight: 700; margin-bottom: 4px; }
.zi-meta { font-weight: 700; margin-top: 10px; color: #fff; }
.zi-how { font-size: .88rem; color: #dbeafe; margin-top: 6px; line-height: 1.5; max-width: 30ch; }

/* R2: inline validation on the start card — no browser alert() boxes */
.field-bad { border-color: #dc2626 !important; box-shadow: 0 0 0 3px rgba(220,38,38,.12); }
.field-msg { color: #b91c1c; font-size: .85rem; margin: 5px 0 0; }
/* R2: reviewer saw clipped text on narrow phones */
.hero-h1, .hero-sub, .chip, .big-cta { overflow-wrap: anywhere; }
.big-cta { white-space: normal; line-height: 1.3; height: auto; padding: 15px 18px; }
.chips { flex-wrap: wrap; }
/* R2: option letter badges (A-E) so a student can call out an answer */
.opt-letter { display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px; border-radius:6px; background:#eef2ff; color:#3730a3;
  font-weight:700; font-size:.78rem; margin-right:8px; flex:0 0 auto; }
.opt.selected .opt-letter { background:#F2563B; color:#fff; }
/* R2: student identity visible during the test */
.who { font-size:.8rem; color:#64748b; }

/* ---------- R2-11/12: question palette + mark-for-review ----------
   A 91-question paper had no way to see what was missed or jump back.
   Students in Classes 10-12 sit board and entrance mocks; they expect this. */
.hud-btn { background: none; border: 1px solid var(--line); border-radius: 8px;
  padding: 2px 8px; font-size: .95rem; cursor: pointer; color: var(--ink); line-height: 1.6; }
.hud-btn:active { background: #f1f5f9; }

#palette { position: absolute; inset: 0; z-index: 30; display: flex;
  align-items: center; justify-content: center; background: rgba(15,23,42,.55); padding: 16px; }
#palette.hidden { display: none; }
.pal-card { background: #fff; border-radius: 16px; padding: 16px; width: 100%;
  max-width: 420px; max-height: 84vh; display: flex; flex-direction: column; }
.pal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.pal-x { background: none; border: 0; font-size: 1.1rem; cursor: pointer; color: #64748b; }
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 7px; overflow-y: auto; padding: 2px; }
.pal-q { aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--line);
  background: #fff; font-weight: 700; font-size: .82rem; cursor: pointer; color: var(--ink); }
.pal-q.done { background: #dcfce7; border-color: #16a34a; color: #14532d; }
.pal-q.flag { background: #fef3c7; border-color: #d97706; color: #78350f; }
.pal-q.flag.done { background: #fef3c7; border-color: #16a34a; }
.pal-q.lock { background: #f1f5f9; color: #94a3b8; cursor: not-allowed; border-style: dashed; }
.pal-q.here { box-shadow: 0 0 0 3px rgba(37,99,235,.45); border-color: var(--blue); }
.pal-key { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: .74rem; color: #64748b; }
.pal-key .k { display: inline-block; width: 11px; height: 11px; border-radius: 3px;
  border: 1.5px solid var(--line); vertical-align: -1px; margin-right: 4px; }
.k-done { background: #dcfce7; border-color: #16a34a; }
.k-todo { background: #fff; }
.k-flag { background: #fef3c7; border-color: #d97706; }
.k-lock { background: #f1f5f9; border-style: dashed; }
.pal-sum { font-size: .8rem; color: #475569; margin: 10px 0 0; text-align: center; }

#btn-flag.on { background: #fef3c7; border-color: #d97706; color: #78350f; }
@media (max-width: 380px) { #q-nav { flex-wrap: wrap; } #q-nav button { flex: 1 1 auto; } }

/* ── cheers & milestones (gamification standard) ── */
#cheer{position:fixed;top:74px;left:50%;transform:translateX(-50%) translateY(-12px);background:#14181F;color:#fff;font-weight:800;font-size:15px;padding:10px 22px;border-radius:999px;box-shadow:0 12px 30px -10px rgba(0,0,0,.4);opacity:0;pointer-events:none;transition:all .25s cubic-bezier(.2,0,0,1);z-index:9998}
#cheer.on{opacity:1;transform:translateX(-50%) translateY(0)}
#cheer.milestone{background:#F2563B;font-size:16.5px;box-shadow:0 0 0 3px #FFD93B,0 14px 34px -10px rgba(242,86,59,.55)}

.brand-by { display: block; font-size: .62em; font-weight: 600; letter-spacing: .04em; opacity: .85; text-transform: none; }
/* #59 checkout coupon box */
.pw-coupon-toggle { margin: 8px 0 0; font-size: .85rem; }
.pw-coupon-toggle a { color: #C2571A; font-weight: 700; }
.pw-coupon { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.pw-coupon input { padding: 10px 12px; border: 2px solid #E5D9C3; border-radius: 10px;
  font-size: 1rem; text-transform: uppercase; width: 170px; }
.pw-coupon-msg { width: 100%; font-size: .85rem; font-weight: 700; margin: 4px 0 0; }
.pw-coupon-msg.ok { color: #1E8E3E; }
.pw-coupon-msg.bad { color: #D9442B; }
.pw-offer { margin: 10px 0 0; }
.pw-offer-chip { background: #FFF3C4; border: 1.5px dashed #C2571A; color: #8A3D10;
  border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: .88rem; }

/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════
   G82 — THE QUESTION CARD (11 Oct 2026, her rulings). ONE block, appended; no rule above this line is edited.
   The base look (house border, the two cards behind, the fly, the refusal) comes from qcard.css, the shared
   file for every live assessment. This block only fits that card to the IQ question screen:
     · the deck takes the old card's place on the page (same width, same outer margin);
     · the card's soft fill follows the zone (set in app.js: qcDress). The picture / memory stage and every
       answer tile stay WHITE — no picture ever sits on a colour (her 19 Sep ruling: colour never carries
       information);
     · the chosen answer is a solid fill in the zone's dark shade, never colour alone: with it come a round
       tick badge and the yellow offset edge. On a picture tile the picture keeps its white panel inside the
       fill; a saved typed number is filled whole, white digits, with a tick. None of it changes the size of
       anything (rule G3–G5: selecting never moves the layout);
     · Next is grey until there is an answer (look only — the button is never disabled);
     · Memory Master keeps the browser's own touch handling (no drag there).
   ══════════════════════════════════════════════════════════════════════════════════════════════════════════ */
#screen-test { overflow-x: clip; }                /* a card dragged sideways is cut at the screen edge and never widens the page */
/* The flying copy of the old card is pinned to the screen by app.js (qcMove: position fixed), so it adds nothing
   to the page's length or width while it flies — the new question is in its resting place from the first frame
   (12 Oct 2026 repair). */
#screen-test .qc-deck { max-width: 760px; margin: 24px auto; }
/* the house border is 2.5px where the old line was 1px: the padding gives the 1.5px back, so the picture, the
   tiles and every button keep exactly the size they had (same three steps as the .card rules above) */
#screen-test .qc-deck > .card { max-width: none; margin: 0; padding: 26.5px; }
@media (max-width: 560px) { #screen-test .qc-deck > .card { padding: 16.5px; } }
@media (max-height: 760px) { #screen-test .qc-deck > .card { padding: 14.5px; } }
/* Pinch-zoom stays with the child, as before G82: the card keeps only its sideways drag for itself. While the page
   is zoomed in (app.js sets html.iq-zoomed) every finger move belongs to the browser, so the zoomed page can be
   moved about in any direction (12 Oct 2026 repair). Memory Master: the browser's own handling, as before. */
#screen-test .qc-card { touch-action: pan-y pinch-zoom; }
html.iq-zoomed #screen-test .qc-card,
#screen-test .qc-card.qc-still { touch-action: auto; }

/* white panels on the tint. The panel's padding is taken back by an equal negative margin, so it adds NO height
   and no width: the picture, the tiles, the tick and Next all stay exactly where they were (W1-06 budget kept) */
#screen-test .qc-card .qq-stem { background: #fff; border-radius: 16px; padding: 7px 8px; margin: -7px -8px;
  box-shadow: inset 0 0 0 1.5px rgba(20,24,31,.10); }
@media (max-height: 760px) { #screen-test .qc-card .qq-stem { padding: 4px 8px; margin: -4px -8px; } }
/* a question with no picture above its answers (Eagle Eye "find the different one") shows no empty white strip —
   and takes no room: with its padding left on, the empty box kept the gap above it and the gap below it from
   folding into one, and the answers, Skip and Next sat 14 px lower than on the old page (8 px on a short phone).
   No padding, no margin: the empty box is the plain empty box it always was (12 Oct 2026, final repair) */
#screen-test .qc-card .qq-stem:empty { background: none; box-shadow: none; padding: 0; margin: 0; }
#screen-test .qc-card .num-disp { background: #fff; border-radius: 12px 12px 0 0; }

/* the chosen picture tile (G82.9: "selected answer - fill colour with contrast").
   12 Oct 2026 (repair): a SOLID fill in the zone's dark shade — the whole tile: its frame and the strip that carries
   the letter and the tick — with the dark ring and the yellow offset edge. Only the picture itself keeps a white
   panel: a fill over the picture would hide it, and no picture ever sits on a colour. The letter and the tick turn
   into white badges on the fill. Colours only — nothing changes size (G3–G5). (Before the repair the tile stayed
   white with a thick border: "border only", which the rule rules out.) */
#screen-test .qc-card .opt.sel { background: var(--qc-deep, #14181F); border-color: var(--qc-deep, #14181F);
  box-shadow: 0 0 0 2px var(--qc-deep, #14181F), 6px 6px 0 2px #FFD93B; }
#screen-test .qc-card .opt.sel svg { background: #fff; border-radius: 6px; }
#screen-test .qc-card .opt .opt-check { top: 5px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; background: #fff;
  color: var(--qc-deep, #14181F); font-size: .9rem; line-height: 1; }
#screen-test .qc-card .opt.selected .opt-letter { background: #fff; color: var(--qc-deep, #14181F); }
/* the saved typed number (.qc-sel from qcard.css gives the solid dark fill, white text and yellow edge) */
#screen-test .qc-card .num-disp.qc-sel { border-radius: 12px; }
#screen-test .qc-card .num-disp.qc-sel::after { content: "✓"; display: inline-block; width: 24px; height: 24px;
  margin-left: 10px; border-radius: 50%; background: #fff; color: var(--qc-deep, #14181F);
  font-size: 1rem; line-height: 24px; letter-spacing: 0; vertical-align: middle; text-align: center; }

/* Next: grey until there is an answer (same box, only the colours change) */
#screen-test .qc-card .primary.qc-wait { background: #D9DEE6; color: #4A5362; box-shadow: inset 0 0 0 1.5px #9AA4B2; }

/* The flying copy of the card carries no ids (qcard.js strips them), so the id rules above (#q-prompt, #q-stem,
   #q-options, #q-nav, #btn-skip, #btn-flag) are repeated here by class for that half second only.
   Keep the two in step: tools/iq_e2e/rules.mjs measures the copy against the card. */
.qc-ghost .qq-prompt { font-weight: 800; font-size: 1.2rem; line-height: 1.4; margin-bottom: 14px; }
.qc-ghost .qq-stem svg { width: 100%; height: auto; max-height: 46vh; }
.qc-ghost .qq-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 14px; }
.qc-ghost .qq-nav { display: flex; gap: 10px; justify-content: space-between; margin-top: 18px; }
.qc-ghost .qq-nav .primary { width: auto; margin-top: 0; }
.qc-ghost .qq-nav .skip { border: 1px dashed var(--grow); color: var(--grow); background: #fffbeb; }
.qc-ghost .qq-nav .flag.on { background: #fef3c7; border-color: #d97706; color: #78350f; }
@media (max-width: 380px) { .qc-ghost .qq-nav { flex-wrap: wrap; } .qc-ghost .qq-nav button { flex: 1 1 auto; } }
@media (max-height: 760px) {
  .qc-ghost .qq-stem svg { max-height: 32vh; }
  .qc-ghost .qq-prompt { margin-bottom: 8px; }
  .qc-ghost .qq-options { margin-top: 10px; }
  .qc-ghost .qq-nav { margin-top: 12px; }
}
/* ═══════════════════════════════════════ end of G82 block ═══════════════════════════════════════════════ */

/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════
   7 Nov 2026 — tester Satyam's question-screen bugs (doc "IQ Test", 7 Nov). One block, appended. Each rule names
   its item; the words and the flow are in app.js (fitStem, nextRefused, confirmSubmit, armBackGuard, answerGrid).
   ══════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* 8 + the phone header: the clock has a face; nothing in the strip breaks across two lines any more */
#hud { flex-wrap: wrap; align-items: center; gap: 4px 12px; }
#hud-progress, #hud-timer, #hud-dim { white-space: nowrap; }
#hud-timer { font-variant-numeric: tabular-nums; }
/* 3: the grey Next now also refuses the tap (app.js); the cursor says so on a laptop */
#screen-test .qc-card .primary.qc-wait { cursor: not-allowed; }
/* 6 + 10: a tapped memory square is unmistakable — ink ring, yellow edge, its order number in a corner badge.
   The face stays on its own light panel (no picture on a colour). A refused tap shakes the square. */
.wm-cell.picked { box-shadow: 0 0 0 3px #14181F, 5px 5px 0 3px #FFD93B; z-index: 1; }
.wm-grid.parade .wm-cell.picked, .wm-grid.pictures .wm-cell.picked, .wm-grid.gallery .wm-cell.picked,
.wm-grid.cards .wm-cell.picked { box-shadow: 0 0 0 3px #14181F, 5px 5px 0 3px #FFD93B; transform: none; }
.wm-badge { inset: auto; top: -9px; right: -9px; width: 26px; height: 26px; border-radius: 50%; background: #14181F;
  color: #fff; font-size: .8rem; font-weight: 800; line-height: 1; border: 2px solid #fff; padding: 0 2px;
  min-width: 26px; width: auto; }
.wm-cell.wm-no { animation: wm-no .32s; }
@keyframes wm-no { 25% { transform: translateX(-6px); } 60% { transform: translateX(5px); } }
/* 11: the zone intro and the idle question cover the WINDOW, not the page, so no page scrollbar shows behind them */
#zone-intro, #idle-overlay { position: fixed; }
html:has(#zone-intro.show), html:has(#idle-overlay.show) { overflow: hidden; scrollbar-gutter: auto; }
/* 7: the review screen — the question list's chips, grouped */
.rv-group { text-align: left; margin: 16px 0 0; }
.rv-title { font-weight: 800; font-size: .92rem; margin-bottom: 8px; }
.rv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 7px; }
.rv-grid .pal-q { min-height: 44px; }
#screen-submit .ghost { width: 100%; margin-top: 18px; }
#screen-submit .primary { margin-top: 10px; }
/* 4: "Leave the test?" — the box the Back button opens */
#leave-box { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center;
  background: rgba(15,23,42,.6); padding: 16px; }
#leave-box.show { display: flex; animation: zi-in .2s ease-out; }
.leave-card { background: #fff; border: 2.5px solid #14181F; border-radius: 20px; box-shadow: 6px 6px 0 #FFD93B;
  padding: 22px 20px; width: 100%; max-width: 380px; text-align: center; }
.leave-emoji { font-size: 2.2rem; }
.leave-card h2 { font-size: 1.3rem; margin: 6px 0 6px; }
.leave-sub { color: var(--mut); line-height: 1.5; font-size: .95rem; }
.leave-card .primary { margin-top: 16px; }
.leave-card .ghost { width: 100%; margin-top: 10px; }
/* 5: the consent line, marked as a whole when it is missed */
label.field-bad { border-radius: 10px; box-shadow: 0 0 0 3px rgba(220,38,38,.35); }
/* 4: the resume / finished offers sit at the top of the start card, as a soft blue note (not hidden under the optional fields) */
#resume-box, #done-box { background: #E6F0FA; border: 1.5px solid #2B6CB8; border-radius: 12px; padding: 12px 14px; margin: 14px 0 4px; }
#resume-box p, #done-box p { font-weight: 600; margin-bottom: 8px; line-height: 1.45; }
#resume-box .ghost, #done-box .ghost { width: 100%; border-color: #2B6CB8; color: #2B6CB8; font-weight: 800; }

/* ══════════════════════════════════════════════════════════════════════════════════════════════════════════
   B60 (14 Nov 2026) — the Ideal Career Test's test-taking changes (B57, 12–13 Nov), given to IQ on her
   "yes to all :)" (14 Nov). One block, appended; the words and the flow are in app.js (paintTop, showZoneIntro,
   takeBreak). Her words: "Instruction screen as popup better" · "Logins on popup and phases can be on popup instead
   of a complete page" · "Dont write on top section name as it gives away algorithm" · "more celebration milestones
   with confetti" · "a bar and % not sectional but overall test".
   ══════════════════════════════════════════════════════════════════════════════════════════════════════════ */
/* the top while answering: "Part n of N" and "23%" (never a zone's name, never "Q n / total"), and one bar for the
   whole test. The bar's 10 px come out of the gap above the card, so the card sits where it sat. */
#hud-dim { color: var(--ink); font-weight: 800; }
#hud-progress { color: #C2381F; font-weight: 800; font-variant-numeric: tabular-nums; }
.hud-bar { max-width: 752px; height: 8px; margin: 2px auto 0; background: #EEF2F7; border-radius: 999px;
  overflow: hidden; box-shadow: inset 0 0 0 1px #DDE6F1; }
.hud-bar > i { display: block; height: 100%; width: 1%; border-radius: inherit;
  background: linear-gradient(90deg, #F2563B, #FFB547); transition: width .45s ease; }
#screen-test .qc-deck { margin-top: 14px; }

/* the Ready card (before question 1) and the card that opens every part: a card over the dimmed screen, not a page.
   Under it the last question stays in view, dimmed and out of reach (app.js underInert). */
#zone-intro { background: rgba(20,24,31,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  color: var(--ink); flex-direction: column; justify-content: flex-start; padding: 20px 16px; overflow-y: auto; }
#zone-intro.show { animation: b60-fade .2s ease-out; }
#zone-intro .zi-inner { margin: auto 0; width: 100%; max-width: 420px; background: #fff; border: 2px solid #14181F;
  border-radius: 24px; box-shadow: 8px 8px 0 #FFD93B; padding: 24px 22px 22px; animation: zi-in .3s ease-out; }
#zone-intro .zi-inner.zi-ready { max-width: 460px; }
@keyframes b60-fade { from { opacity: 0; } to { opacity: 1; } }
#zone-intro .zi-emoji { font-size: 2.4rem; line-height: 1.1; }
.zi-done { color: #047857; font-weight: 800; font-size: 1.02rem; letter-spacing: .02em; margin-bottom: 2px; }
#zone-intro .zi-cheer { color: var(--mut); font-weight: 700; font-size: .95rem; margin-bottom: 10px; }
#zone-intro .zi-name { font-family: 'Bricolage Grotesque', 'Segoe UI', sans-serif; letter-spacing: -.02em;
  font-size: 1.75rem; line-height: 1.15; color: var(--ink); margin: 4px 0 8px; }
#zone-intro .zi-how { color: var(--mut); font-size: 1rem; line-height: 1.5; max-width: 34ch; margin: 0 auto; }
#zone-intro .zi-go { display: block; width: 100%; max-width: 300px; margin: 20px auto 0; background: #D13F26; color: #fff;
  font-weight: 800; font-size: 1.05rem; border-radius: 999px; padding: 14px 22px; box-shadow: 0 12px 26px -10px rgba(209,63,38,.55); }
#zone-intro .zi-go:active { background: #B9351D; }
#zone-intro .zi-go:focus-visible, #btn-break-continue:focus-visible { outline: 3px solid #2B6CB8; outline-offset: 3px; }
/* the Ready card: the lockup, the test it is, how it works, Part 1's line */
.zi-brand { font-family: 'Bricolage Grotesque', 'Segoe UI', sans-serif; font-weight: 800; font-size: 16px; color: #14181F; line-height: 1.1; }
.zi-brand i { font-style: normal; color: #F2563B; }
.zi-brand span { display: block; font: 600 9.5px Inter, 'Segoe UI', sans-serif; color: #5A6472; margin-top: 2px; }
#zone-intro .zi-ready .zi-name { margin: 14px 0 2px; }
.zi-test { color: #C2381F; font-weight: 800; font-size: .95rem; }
.zi-box { text-align: left; background: #F7FAFD; border: 1.5px solid #DDE6F1; border-radius: 16px; padding: 12px 16px; margin: 14px 0 0; }
.zi-box-h { font: 800 11px Inter, 'Segoe UI', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #C2381F; margin-bottom: 6px; }
.zi-box ul { list-style: none; padding: 0; margin: 0; }
.zi-box li { font-weight: 600; font-size: .9rem; line-height: 1.5; color: #3F4855; margin: 4px 0; }
#zone-intro .zi-first { color: var(--ink); font-size: .95rem; line-height: 1.5; margin-top: 12px; }
#screen-test.b60-first #q-deck { visibility: hidden; }

/* the brain break: the same card over the question just answered (its own screen, shown with the test under it) */
#screen-test.under { display: block; }
#screen-break.active { position: fixed; inset: 0; z-index: 25; min-height: 0; display: flex; flex-direction: column;
  align-items: center; padding: 20px 16px; background: rgba(20,24,31,.55); -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px); overflow-y: auto; animation: b60-fade .2s ease-out; }
#screen-break.active > .card { margin: auto 0 0; width: 100%; max-width: 420px; border: 2px solid #14181F; border-radius: 24px;
  box-shadow: 8px 8px 0 #FFD93B; padding: 24px 22px 22px; animation: zi-in .3s ease-out; }
#screen-break.active > .card h2 { font-size: 1.6rem; margin: 2px 0 8px; }
#screen-break.active > .card p { line-height: 1.5; }
#screen-break.active > .card .big { margin: 10px 0 4px; }
#screen-break.active #btn-break-continue { border-radius: 999px; background: #D13F26; font-weight: 800; }
#screen-break.active > .rp-line { margin: 8px 0 auto; }
#screen-break.active > .rp-line a { color: #fff; }
html:has(#screen-break.active) { overflow: hidden; scrollbar-gutter: auto; }

@media (prefers-reduced-motion: reduce) {
  #zone-intro.show, #zone-intro .zi-inner, #screen-break.active, #screen-break.active > .card { animation: none; }
  .hud-bar > i { transition: none; }
}
/* ═══════════════════════════════════════ end of B60 block ═══════════════════════════════════════════════ */
