/* ============================================================
   TOEFL Simulator — Redesign (mobile-first, dark-first)
   Tokens: navy / amber, Inter + Sora, one-question-per-screen,
   canvas audio player, sticky test chrome, reduced-motion safe.
   ============================================================ */

:root {
  --bg: #081226;
  --bg-2: #0b1b3a;
  --surface: #0f2247;
  --surface-2: #132a56;
  --surface-3: #1a356b;
  --border: #26427d;
  --border-soft: rgba(255, 255, 255, 0.08);

  --text: #eaf0ff;
  --text-dim: #9fb0dd;
  --text-faint: #6c80b4;

  --primary: #4f8cff;
  --primary-hover: #6ba2ff;
  --primary-soft: rgba(79, 140, 255, 0.16);

  --accent: #f6b93b;
  --accent-strong: #ffce4f;
  --accent-ink: #2a1a00;

  --ok: #3ddc97;
  --ok-soft: rgba(61, 220, 151, 0.14);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, 0.14);
  --warn: #ffb020;
  --warn-soft: rgba(255, 176, 32, 0.16);

  --teal: #2dd4bf;
  --violet: #a78bfa;

  --radius-s: 10px;
  --radius: 14px;
  --radius-l: 20px;

  --shadow-soft: 0 6px 24px rgba(2, 8, 24, 0.45);
  --shadow-pop: 0 14px 44px rgba(2, 8, 24, 0.55);
  --ring: 0 0 0 3px rgba(79, 140, 255, 0.45);

  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "Sora", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

::selection { background: rgba(246, 185, 59, 0.35); }

img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--border); }

/* ═══════════════ BACKGROUND FX ═══════════════ */
.bg-fx {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(79, 140, 255, 0.14), transparent 60%),
    radial-gradient(700px 500px at 10% 20%, rgba(246, 185, 59, 0.08), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(45, 212, 191, 0.08), transparent 60%),
    var(--bg);
}
.bg-fx::after {
  content: ""; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 75%);
}

/* ═══════════════ LAYOUT ═══════════════ */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { width: 100%; max-width: 1320px; margin: 0 auto; padding: 0 20px; }

/* ═══════════════ HEADER / NAV ═══════════════ */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: rgba(8, 18, 38, 0.78);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent) 0%, #ff8a3d 100%);
  color: var(--accent-ink);
  font-family: var(--font-display); font-weight: 800; font-size: 19px;
  display: grid; place-items: center;
  box-shadow: 0 4px 16px rgba(246, 185, 59, 0.35);
}
.brand-text b { font-family: var(--font-display); font-size: 16px; letter-spacing: 0.2px; display: block; line-height: 1.15; }
.brand-text span { font-size: 11.5px; color: var(--text-faint); letter-spacing: 1.4px; text-transform: uppercase; }
.topnav-links { display: flex; gap: 6px; align-items: center; }
.nav-link {
  padding: 8px 14px; border-radius: 10px;
  color: var(--text-dim); text-decoration: none; font-size: 14px; font-weight: 600;
  transition: color 0.2s, background 0.2s;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }

/* Theme toggle */
.theme-toggle-btn {
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--border-soft); background: var(--surface);
  display: grid; place-items: center; cursor: pointer;
  color: var(--text-dim);
  transition: all 0.25s var(--ease-out);
}
.theme-toggle-btn:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }

/* ═══════════════ HERO ═══════════════ */
.hero { padding: 64px 0 40px; position: relative; }
.hero-inner { display: grid; gap: 36px; align-items: center; grid-template-columns: 1.05fr 0.95fr; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 999px;
  background: var(--primary-soft); border: 1px solid rgba(79, 140, 255, 0.35);
  font-size: 12.5px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--primary-hover);
  margin-bottom: 20px;
}
.hero-eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(61, 220, 151, 0.5); } 50% { box-shadow: 0 0 0 6px rgba(61, 220, 151, 0); } }

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4.6vw, 52px);
  font-weight: 800; line-height: 1.08; letter-spacing: -1.2px;
  margin-bottom: 18px;
}
.hero h1 .grad {
  background: linear-gradient(100deg, #ffd76a 10%, #ff9d4d 55%, #ff6b6b 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lead { font-size: clamp(15px, 1.6vw, 17.5px); color: var(--text-dim); max-width: 520px; margin-bottom: 30px; line-height: 1.65; }
.hero-cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* hero score preview card (right column) */
.hero-card {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border-soft); border-radius: var(--radius-l);
  padding: 26px; box-shadow: var(--shadow-pop);
  position: relative; overflow: hidden;
}
.hero-card::before {
  content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%;
  top: -120px; right: -90px; background: rgba(246, 185, 59, 0.1); filter: blur(10px);
}
.hero-card .hc-badge { font-size: 11px; letter-spacing: 1.6px; text-transform: uppercase; color: var(--accent); font-weight: 800; margin-bottom: 14px; }
.hc-score { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.hc-ring { position: relative; width: 118px; height: 118px; flex-shrink: 0; }
.hc-ring svg { transform: rotate(-90deg); }
.hc-ring .track { stroke: var(--surface-3); }
.hc-ring .fill { stroke: url(#hcGrad); stroke-linecap: round; transition: stroke-dashoffset 1.6s var(--ease-out); }
.hc-ring .num {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  font-family: var(--font-display);
}
.hc-ring .num b { font-size: 26px; font-weight: 800; }
.hc-ring .num span { font-size: 10.5px; color: var(--text-faint); letter-spacing: 1px; text-transform: uppercase; }
.hc-meta { font-size: 13px; color: var(--text-dim); }
.hc-meta b { color: var(--text); display: block; font-size: 15px; margin-bottom: 4px; }
.hc-rows { display: grid; gap: 12px; margin-top: 16px; }
.hc-row { display: grid; grid-template-columns: 92px 1fr 44px; gap: 12px; align-items: center; font-size: 12.5px; color: var(--text-dim); }
.hc-bar { height: 7px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.hc-bar i { display: block; height: 100%; border-radius: 999px; background: var(--primary); width: 0; transition: width 1.1s var(--ease-out); }
.hc-row.l .hc-bar i { background: var(--teal); }
.hc-row.s .hc-bar i { background: var(--violet); }
.hc-row.r .hc-bar i { background: var(--accent); }

/* ═══════════════ BUTTONS ═══════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  padding: 13px 24px; border-radius: 13px;
  font-weight: 700; font-size: 15px; font-family: var(--font-body);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: transform 0.2s var(--ease-out), box-shadow 0.25s, background 0.2s, border-color 0.2s, color 0.2s;
  will-change: transform;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  min-height: 48px;
}
.btn:active { transform: scale(0.975); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent) 0%, #ff9d3d 100%);
  color: var(--accent-ink);
  box-shadow: 0 8px 26px rgba(246, 185, 59, 0.32);
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(246, 185, 59, 0.42); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 8px 22px rgba(79, 140, 255, 0.3); }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 12px 30px rgba(79, 140, 255, 0.42); }

.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--primary); transform: translateY(-1px); }

.btn-soft { background: var(--surface-2); color: var(--text); border-color: var(--border-soft); }
.btn-soft:hover { background: var(--surface-3); transform: translateY(-1px); }

.btn-danger { background: var(--bad-soft); color: var(--bad); border-color: rgba(255, 107, 107, 0.35); }
.btn-danger:hover { background: rgba(255, 107, 107, 0.22); transform: translateY(-1px); }

.btn-lg { padding: 16px 30px; font-size: 16px; border-radius: 15px; }
.btn-sm { padding: 8px 15px; font-size: 13px; min-height: 38px; border-radius: 10px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none; }

.btn .arrow { transition: transform 0.25s var(--ease-spring); }
.btn:hover .arrow { transform: translateX(4px); }

/* ═══════════════ SECTIONS ═══════════════ */
.section { padding: 54px 0; }
.section-head { margin-bottom: 30px; }
.section-eyebrow { font-size: 12px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.section-title { font-family: var(--font-display); font-size: clamp(24px, 3vw, 34px); font-weight: 800; letter-spacing: -0.6px; margin-bottom: 10px; }
.section-desc { color: var(--text-dim); max-width: 560px; font-size: 15px; }

/* ═══════════════ STAT STRIP ═══════════════ */
.stat-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 20px 22px;
}
.stat-num { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-num .unit { font-size: 15px; color: var(--text-dim); font-weight: 600; }
.stat-label { font-size: 12.5px; color: var(--text-dim); margin-top: 8px; }

/* ═══════════════ MODE CARDS ═══════════════ */
.mode-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.mode-card {
  position: relative;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-l);
  padding: 26px; cursor: pointer;
  transition: transform 0.3s var(--ease-out), border-color 0.25s, box-shadow 0.3s;
  overflow: hidden;
}
.mode-card::after {
  content: ""; position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(420px 200px at 85% -20%, var(--mc-tint, rgba(79, 140, 255, 0.16)), transparent 70%);
  transition: opacity 0.35s;
}
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-4px); border-color: var(--mc-color, var(--primary)); box-shadow: var(--shadow-pop); outline: none; }
.mode-card:hover::after, .mode-card:focus-visible::after { opacity: 1; }
.mode-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.mode-icon {
  width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center;
  background: var(--mc-soft, var(--primary-soft)); color: var(--mc-color, var(--primary));
}
.mode-time {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-dim);
  padding: 5px 12px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-soft);
}
.mode-card h3 { font-family: var(--font-display); font-size: 20px; font-weight: 800; margin-bottom: 8px; }
.mode-card p { color: var(--text-dim); font-size: 14px; margin-bottom: 18px; min-height: 42px; }
.mode-go { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; color: var(--mc-color, var(--primary)); }
.mode-go .arrow { transition: transform 0.25s var(--ease-spring); }
.mode-card:hover .mode-go .arrow { transform: translateX(5px); }
.mode-card.full {
  grid-column: 1 / -1;
  --mc-color: var(--accent); --mc-soft: rgba(246, 185, 59, 0.14); --mc-tint: rgba(246, 185, 59, 0.12);
  display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
}
.mode-card.full .mode-full-left { flex: 1; min-width: 240px; }
.mode-card.full p { min-height: 0; }
.mode-full-right { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.mode-flow { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); font-weight: 600; flex-wrap: wrap; }
.mode-flow .chip { padding: 6px 13px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-soft); }
.mode-flow .sep { color: var(--accent); }

/* section colors */
.mode-card.listening { --mc-color: var(--teal); --mc-soft: rgba(45, 212, 191, 0.13); --mc-tint: rgba(45, 212, 191, 0.13); }
.mode-card.structure { --mc-color: var(--violet); --mc-soft: rgba(167, 139, 250, 0.14); --mc-tint: rgba(167, 139, 250, 0.13); }
.mode-card.reading { --mc-color: var(--primary); --mc-soft: var(--primary-soft); --mc-tint: rgba(79, 140, 255, 0.14); }

/* ═══════════════ SETS GRID ═══════════════ */
.sets-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.set-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-l);
  padding: 22px; position: relative; overflow: hidden;
  transition: transform 0.28s var(--ease-out), border-color 0.25s, box-shadow 0.3s;
}
.set-card:hover { transform: translateY(-3px); border-color: var(--border); box-shadow: var(--shadow-soft); }
.set-card .set-no {
  position: absolute; top: 12px; right: 16px;
  font-family: var(--font-display); font-size: 44px; font-weight: 800;
  color: var(--surface-3); line-height: 1; user-select: none;
  transition: color 0.3s;
}
.set-card:hover .set-no { color: rgba(246, 185, 59, 0.3); }
.set-card h4 { font-family: var(--font-display); font-size: 17px; font-weight: 700; margin-bottom: 6px; position: relative; }
.set-card > p { font-size: 13px; color: var(--text-dim); margin-bottom: 14px; min-height: 38px; position: relative; }
.set-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; position: relative; }
.set-pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-dim); }
.set-actions { display: flex; flex-wrap: wrap; gap: 8px; position: relative; }
.set-actions .btn { flex: 1 1 calc(50% - 4px); }

/* ═══════════════ FEATURES ═══════════════ */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-l);
  padding: 24px;
  transition: transform 0.28s var(--ease-out), border-color 0.25s;
}
.feature-card:hover { transform: translateY(-3px); border-color: var(--border); }
.feature-icon {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--fi, var(--primary-soft)); color: var(--fc, var(--primary)); margin-bottom: 16px;
}
.feature-card h4 { font-family: var(--font-display); font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-card p { font-size: 13.5px; color: var(--text-dim); line-height: 1.6; }

/* ═══════════════ HOW IT WORKS ═══════════════ */
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; counter-reset: step; }
.step-card {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-l);
  padding: 24px; position: relative;
}
.step-num {
  font-family: var(--font-display); font-weight: 800; font-size: 15px;
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary); margin-bottom: 14px;
}
.step-card h4 { font-family: var(--font-display); font-size: 15.5px; margin-bottom: 7px; }
.step-card p { font-size: 13px; color: var(--text-dim); line-height: 1.55; }

/* ═══════════════ HISTORY ═══════════════ */
.history-wrap { display: none; }
.history-wrap.has-data { display: block; }
.history-list { display: grid; gap: 10px; }
.history-item {
  display: grid; grid-template-columns: auto 1fr auto; gap: 16px; align-items: center;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 16px 20px;
  animation: fadeUp 0.5s var(--ease-out) both;
}
.history-score-big { font-family: var(--font-display); font-size: 22px; font-weight: 800; min-width: 74px; text-align: center; color: var(--accent); }
.history-info b { font-size: 14px; display: block; }
.history-info span { font-size: 12.5px; color: var(--text-faint); }
.history-delta-tag { font-size: 12px; font-weight: 800; padding: 4px 12px; border-radius: 999px; }
.history-delta-tag.up { background: var(--ok-soft); color: var(--ok); }
.history-delta-tag.down { background: var(--bad-soft); color: var(--bad); }
.history-delta-tag.same { background: var(--surface-2); color: var(--text-dim); }
.history-clear { margin-top: 14px; }

/* ═══════════════ FOOTER ═══════════════ */
.site-footer {
  border-top: 1px solid var(--border-soft); margin-top: 40px;
  padding: 36px 0 44px;
}
.site-footer .foot-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.site-footer p { font-size: 13px; color: var(--text-faint); line-height: 1.7; max-width: 460px; }
.foot-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

/* ═══════════════ KEY ANIMS ═══════════════ */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInR { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInL { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: translateX(0); } }
@keyframes shakeX { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }

.reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-d1 { transition-delay: 0.08s; } .reveal-d2 { transition-delay: 0.16s; } .reveal-d3 { transition-delay: 0.24s; }

/* ═══════════════ TEST SHELL ═══════════════ */
.test-shell { display: none; min-height: 100vh; flex-direction: column; }
body.in-test .topnav, body.in-test .landing-root, body.in-test .site-footer { display: none; }
body.in-test .test-shell { display: flex; }

.test-topbar {
  position: sticky; top: 0; z-index: 60;
  background: rgba(8, 18, 38, 0.9); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-soft);
  padding: 12px 18px;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.tb-crumb { font-size: 12.5px; color: var(--text-faint); font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; white-space: nowrap; }
.tb-crumb b { color: var(--text); display: block; font-size: 14px; letter-spacing: 0; text-transform: none; }
.tb-progress { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 5px; }
.tb-progress .lbl { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--text-dim); font-weight: 600; }
.tb-progress .track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border-soft); }
.tb-progress .fill { height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--teal)); transition: width 0.4s var(--ease-out); }
.tb-timer {
  display: flex; align-items: center; gap: 9px; padding: 8px 16px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  font-family: var(--font-mono); font-weight: 700; font-size: 17px;
}
.tb-timer .t-ic { color: var(--primary); }
.tb-timer.warn { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); animation: timerPulse 2s infinite; }
.tb-timer.danger { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

.test-body { flex: 1; display: grid; grid-template-columns: 1fr 296px; gap: 22px; width: 100%; max-width: 1280px; margin: 0 auto; padding: 22px 20px 30px; align-items: start; }

/* ── Question stage ── */
.test-stage { min-width: 0; }
.stage-meta {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-faint); font-weight: 600;
}
.stage-meta .qnum-chip {
  font-family: var(--font-display); font-weight: 800; font-size: 13.5px;
  background: var(--primary-soft); color: var(--primary-hover);
  padding: 5px 14px; border-radius: 999px;
}
.stage-meta .part-chip { padding: 5px 14px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-dim); font-size: 12.5px; }

.qstage {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-l);
  padding: clamp(20px, 3vw, 32px);
  box-shadow: var(--shadow-soft);
}

.qcard { animation: slideInR 0.32s var(--ease-out) both; }
.qcard.back { animation-name: slideInL; }
.qcard.shake { animation: shakeX 0.45s ease; }

.q-text { font-size: clamp(17px, 2vw, 20px); font-weight: 700; line-height: 1.5; margin-bottom: 20px; font-family: var(--font-display); letter-spacing: -0.2px; }

.choices { display: grid; gap: 10px; }
.choice {
  position: relative; display: flex; align-items: center; gap: 14px;
  padding: 15px 16px; border-radius: var(--radius);
  background: var(--surface-2); border: 1.5px solid var(--border-soft);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.15s var(--ease-out), box-shadow 0.2s;
  min-height: 54px;
}
.choice:hover { border-color: var(--primary); background: var(--surface-3); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .key {
  flex-shrink: 0; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--surface-3); border: 1px solid var(--border-soft);
  font-weight: 800; font-size: 13.5px; color: var(--text-dim);
  transition: all 0.2s;
}
.choice-body { font-size: 15px; line-height: 1.45; }
.choice .check {
  margin-left: auto; flex-shrink: 0; opacity: 0; transform: scale(0.5);
  transition: all 0.22s var(--ease-spring); color: var(--primary);
}
.choice.selected {
  border-color: var(--primary); background: var(--primary-soft);
  box-shadow: 0 0 0 1px var(--primary) inset;
}
.choice.selected .key { background: var(--primary); color: #fff; border-color: var(--primary); }
.choice.selected .check { opacity: 1; transform: scale(1); }

/* result states */
.choice.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.choice.is-correct .key { background: var(--ok); color: #062015; border-color: var(--ok); }
.choice.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice.is-wrong .key { background: var(--bad); color: #fff; border-color: var(--bad); }
.choice.locked { cursor: default; pointer-events: none; }
.choice.dim { opacity: 0.55; }

/* explanation box */
.explain {
  margin-top: 16px; border-radius: var(--radius);
  border: 1px solid var(--border-soft); border-left: 4px solid var(--primary);
  background: var(--surface-2);
  padding: 16px 18px;
  animation: fadeUp 0.35s var(--ease-out) both;
  font-size: 14px; line-height: 1.6;
  display: none;
}
.explain.show { display: block; }
.explain .ex-verdict { font-weight: 800; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.explain.good { border-left-color: var(--ok); }
.explain.good .ex-verdict { color: var(--ok); }
.explain.bad { border-left-color: var(--bad); }
.explain.bad .ex-verdict { color: var(--bad); }
.explain .ex-answer { margin: 4px 0 8px; }
.explain .ex-answer b { color: var(--accent); }

/* ── Audio player (TTS) ── */
.audio-player {
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-l);
  padding: 18px; margin-bottom: 18px;
}
.audio-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.audio-title { font-weight: 800; font-size: 15px; display: flex; gap: 10px; align-items: center; }
.audio-title .a-ic { color: var(--teal); }
.audio-type { font-size: 11.5px; letter-spacing: 1.2px; text-transform: uppercase; font-weight: 800; padding: 4px 12px; border-radius: 999px; background: rgba(45, 212, 191, 0.13); color: var(--teal); }
.audio-canvas-wrap {
  height: 62px; border-radius: 12px; overflow: hidden; position: relative;
  background: var(--bg-2); border: 1px solid var(--border-soft); margin-bottom: 14px;
}
.audio-canvas-wrap canvas { width: 100%; height: 100%; }
.audio-progress-line { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(79, 140, 255, 0.13); border-right: 2px solid var(--primary); width: 0%; transition: width 0.25s linear; }
.audio-controls-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.audio-play-btn {
  width: 52px; height: 52px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), #25b0e0); color: #04241e;
  border: none; cursor: pointer; display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(45, 212, 191, 0.35);
  transition: transform 0.2s var(--ease-spring), box-shadow 0.25s;
}
.audio-play-btn:hover { transform: scale(1.07); box-shadow: 0 10px 26px rgba(45, 212, 191, 0.45); }
.audio-play-btn:active { transform: scale(0.95); }
.audio-mini-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 15px; border-radius: 11px; border: 1px solid var(--border-soft);
  background: var(--surface); color: var(--text); font-size: 13px; font-weight: 700; cursor: pointer;
  transition: all 0.2s;
}
.audio-mini-btn:hover:not(:disabled) { background: var(--surface-3); transform: translateY(-1px); }
.audio-mini-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.audio-status { margin-left: auto; font-size: 12px; color: var(--text-faint); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.audio-status .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--bad); display: none; }
.audio-status.playing .live-dot { display: block; animation: pulse 1.4s infinite; }
.audio-status.playing { color: var(--teal); }

/* ── Passage ── */
.passage-box {
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius-l);
  padding: 22px; margin-bottom: 18px; max-height: 46vh; overflow-y: auto;
}
.passage-box h4 { font-family: var(--font-display); font-size: 16px; margin-bottom: 12px; color: var(--accent); }
.passage-box .ptext { font-size: 15px; line-height: 1.85; color: var(--text); white-space: pre-line; user-select: text; }

/* ── Stage controls ── */
.stage-controls {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 20px; flex-wrap: wrap;
}
.stage-controls .sc-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.btn-flag-toggle.on { color: var(--warn) !important; border-color: var(--warn) !important; background: var(--warn-soft) !important; }

/* ── Palette (sidebar) ── */
.test-palette {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-l);
  padding: 18px; position: sticky; top: 86px;
}
.palette-title { font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-faint); font-weight: 800; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; max-height: 46vh; overflow-y: auto; padding: 2px; }
.pal-btn {
  aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--border-soft);
  background: var(--surface-2); color: var(--text-dim);
  font-size: 13px; font-weight: 800; cursor: pointer;
  display: grid; place-items: center; position: relative;
  transition: all 0.18s var(--ease-out);
  min-width: 38px; min-height: 38px;
}
.pal-btn:hover { border-color: var(--primary); color: var(--text); transform: translateY(-2px); }
.pal-btn.current { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--primary); color: var(--text); }
.pal-btn.answered { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.pal-btn.flagged { border-color: var(--warn); color: var(--warn); }
.pal-btn.flagged::after {
  content: ""; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%;
  background: var(--warn);
}
.palette-legend { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--text-faint); }
.palette-legend .lgd { display: inline-flex; align-items: center; gap: 6px; }
.palette-legend .sw { width: 12px; height: 12px; border-radius: 4px; }
.palette-legend .sw-answered { background: var(--ok); }
.palette-legend .sw-flag { background: var(--warn); }
.palette-legend .sw-todo { background: var(--surface-3); border: 1px solid var(--border-soft); }
.palette-submit { margin-top: 16px; width: 100%; }

/* mobile palette (bottom sheet) */
.palette-fab {
  display: none;
  position: fixed; bottom: 20px; right: 18px; z-index: 65;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
  box-shadow: var(--shadow-pop); cursor: pointer;
  align-items: center; justify-content: center;
}
.palette-sheet-overlay { position: fixed; inset: 0; background: rgba(3, 8, 20, 0.6); z-index: 70; opacity: 0; pointer-events: none; transition: opacity 0.25s; }
.palette-sheet-overlay.open { opacity: 1; pointer-events: auto; }
@media (max-width: 980px) {
  .test-body { grid-template-columns: 1fr; }
  .test-palette {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 75;
    border-radius: 20px 20px 0 0; padding: 20px 20px 34px;
    transform: translateY(106%); transition: transform 0.32s var(--ease-out);
    max-height: 62vh; overflow-y: auto;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.55);
  }
  .test-palette.open { transform: translateY(0); }
  .palette-fab { display: flex; }
  .palette-grid { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
}

/* ═══════════════ MODAL ═══════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(3, 8, 20, 0.72); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  opacity: 0; pointer-events: none; transition: opacity 0.22s;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-l);
  padding: 28px; width: 100%; max-width: 480px;
  box-shadow: var(--shadow-pop);
  transform: translateY(14px) scale(0.97); transition: transform 0.28s var(--ease-spring);
}
.modal-overlay.open .modal { transform: translateY(0) scale(1); }
.modal h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 12px; }
.modal p { font-size: 14.5px; color: var(--text-dim); margin-bottom: 8px; }
.modal .warn-p { color: var(--warn); }
.modal .ok-p { color: var(--ok); }
.modal .bad-p { color: var(--bad); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ═══════════════ REVIEW (post-submit) ═══════════════ */
.review-head { margin-bottom: 18px; }
.review-head h3 { font-family: var(--font-display); font-size: 20px; margin-bottom: 6px; }
.review-score-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.review-stat { flex: 1 1 120px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius); padding: 14px 16px; }
.review-stat b { font-family: var(--font-display); font-size: 22px; display: block; }
.review-stat span { font-size: 12px; color: var(--text-faint); }
.review-filter { display: flex; gap: 8px; margin: 14px 0 20px; flex-wrap: wrap; }
.review-filter .btn-sm.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.review-item { animation: fadeUp 0.4s var(--ease-out) both; }
.review-item .q-text { font-size: 16.5px; }

/* ═══════════════ TOAST ═══════════════ */
.toefl-toasts {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toefl-toast {
  background: var(--surface-3); color: var(--text);
  border: 1px solid var(--border);
  padding: 11px 22px; border-radius: 13px; font-size: 14px; font-weight: 700;
  box-shadow: var(--shadow-pop);
  opacity: 0; transform: translateY(12px); transition: opacity 0.3s, transform 0.3s;
  max-width: min(92vw, 480px); text-align: center;
}
.toefl-toast.show { opacity: 1; transform: translateY(0); }
.toefl-toast-warn { border-color: var(--warn); color: var(--warn); }
.toefl-toast-danger { border-color: var(--bad); color: var(--bad); }

/* ═══════════════ MISC ═══════════════ */
.kbd-hint { font-size: 12px; color: var(--text-faint); text-align: center; margin-top: 14px; display: none; }
@media (min-width: 980px) { .kbd-hint { display: block; } }
kbd {
  font-family: var(--font-mono); font-size: 11px; padding: 2px 7px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border-soft); color: var(--text-dim);
}

/* Skeleton loading */
.skel {
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
  min-height: 120px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* ═══════════════ LIGHT THEME ═══════════════ */
[data-theme="light"] {
  --bg: #f4f6fc;
  --bg-2: #eaeefb;
  --surface: #ffffff;
  --surface-2: #eef2fc;
  --surface-3: #dfe6f8;
  --border: #c9d5f0;
  --border-soft: rgba(11, 31, 75, 0.1);
  --text: #0c1a3d;
  --text-dim: #4a5b85;
  --text-faint: #7d8db5;
  --primary-soft: rgba(79, 140, 255, 0.12);
  --shadow-soft: 0 6px 24px rgba(11, 31, 75, 0.1);
  --shadow-pop: 0 14px 44px rgba(11, 31, 75, 0.16);
}
[data-theme="light"] .bg-fx {
  background:
    radial-gradient(900px 500px at 80% -10%, rgba(79, 140, 255, 0.12), transparent 60%),
    radial-gradient(700px 500px at 10% 20%, rgba(246, 185, 59, 0.1), transparent 60%),
    radial-gradient(800px 600px at 50% 110%, rgba(45, 212, 191, 0.08), transparent 60%),
    var(--bg);
}
[data-theme="light"] .topnav { background: rgba(255, 255, 255, 0.82); }
[data-theme="light"] .test-topbar { background: rgba(244, 246, 252, 0.9); }

/* ═══════════════ RESPONSIVE ═══════════════ */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .sets-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-strip { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .hero { padding: 38px 0 26px; }
  .section { padding: 38px 0; }
  .mode-grid { grid-template-columns: 1fr; }
  .sets-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .topnav { padding: 12px 16px; }
  .brand-text span { display: none; }
  .test-body { padding: 14px 12px 24px; }
  .test-topbar { padding: 10px 14px; gap: 10px; }
  .tb-progress { order: 3; flex-basis: 100%; }
  .qstage { padding: 18px 16px; }
  .stage-controls { flex-direction: column; align-items: stretch; }
  .stage-controls .sc-group { width: 100%; justify-content: space-between; }
  .stage-controls .sc-group .btn { flex: 1; }
  .hero-cta-row .btn { flex: 1; }
  .set-actions .btn { flex: 1 1 100%; }
}

/* ═══════════════ REDUCED MOTION ═══════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ═══════════════ USER CHIP (Google sign-in) ═══════════════ */
.user-chip-wrap { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px 5px 5px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  cursor: pointer; color: var(--text); transition: all 0.22s;
  min-height: 38px;
}
.user-chip:hover { border-color: var(--primary); background: var(--surface-3); }
.user-chip img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.user-chip-initial {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #ff8a3d); color: var(--accent-ink);
  font-weight: 800; font-size: 13px; display: grid; place-items: center;
}
.user-chip-name { font-weight: 700; font-size: 13.5px; max-width: 110px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  min-width: 180px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 14px; padding: 6px; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
  animation: fadeUp 0.2s var(--ease-out) both;
}
.user-menu a, .user-menu button {
  display: block; text-align: left; padding: 10px 14px; border-radius: 10px;
  color: var(--text); background: transparent; border: none; font-size: 13.5px; font-weight: 600;
  cursor: pointer; text-decoration: none;
}
.user-menu a:hover, .user-menu button:hover { background: var(--surface-2); }
.user-menu #menu-logout { color: var(--bad); }

/* ═══════════════ BOTTOM NAV (mobile) ═══════════════ */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  display: none;
  background: rgba(13, 27, 51, 0.92);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--border-soft);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}
html[data-theme="light"] .bottom-nav { background: rgba(255, 255, 255, 0.94); }
.bn-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 4px 6px; border-radius: 14px; text-decoration: none;
  color: var(--text-faint); font-size: 11px; font-weight: 600;
  min-height: 48px; justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.bn-item.active { color: var(--accent); }
.bn-item.active svg { stroke: var(--accent); }
.bn-item svg { stroke: currentColor; }
.bn-item:active { background: var(--surface-2); }

@media (max-width: 900px) {
  .bottom-nav { display: flex; }
  /* ruang bawah konten supaya tidak ketutup nav */
  body { padding-bottom: 72px; }
  /* Sembunyikan topbar nav links di mobile, user chip tetap */
  .topbar .nav-links { display: none; }
}

/* ═══════════════ PWA install banner ═══════════════ */
#pwa-install-banner {
  position: fixed; left: 14px; right: 14px; bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 95; animation: fadeUp 0.35s var(--ease-out) both;
}
@media (min-width: 901px) {
  #pwa-install-banner { left: auto; right: 24px; bottom: 24px; max-width: 400px; }
}
.pwa-banner {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 18px; padding: 14px; box-shadow: var(--shadow-pop);
}
.pwa-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), #ff8a3d);
  color: var(--accent-ink); font-weight: 800; font-size: 20px;
  display: grid; place-items: center;
}
.pwa-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pwa-text strong { font-size: 14px; }
.pwa-text span { font-size: 12px; color: var(--text-dim); }
.pwa-close {
  background: none; border: none; color: var(--text-faint); font-size: 22px;
  cursor: pointer; padding: 4px 8px; line-height: 1;
}

/* ═══════════════ MOBILE POLISH: test shell ═══════════════ */
@media (max-width: 640px) {
  /* pertanyaan tidak boleh mepet tepi */
  #qstage .q-card { border-radius: 18px; padding: 20px 16px; }
  #qstage .q-text { font-size: 16.5px; line-height: 1.65; }
  .choice-btn { padding: 15px 14px; font-size: 15px; min-height: 52px; border-radius: 14px; gap: 12px; }
  .choice-btn .choice-key { width: 32px; height: 32px; font-size: 14px; }
  /* tombol next/prev besar */
  .q-nav-row .btn { min-height: 52px; font-size: 15px; border-radius: 14px; }
  /* timer bar compact */
  .test-timer { font-size: 15px; }
  /* passage reading scroll nyaman */
  .passage-box { max-height: 42vh; overflow-y: auto; -webkit-overflow-scrolling: touch; border-radius: 14px; padding: 16px; font-size: 14.5px; line-height: 1.75; }
  /* palette grid HP: 5 kolom besar */
  #palette-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
  #palette-grid .pal-btn { min-height: 46px; font-size: 14px; border-radius: 12px; }
}

/* ═══════════════ HAMBURGER + MOBILE MENU SHEET ═══════════════ */
.hamburger-btn {
  display: none;
  width: 42px; height: 42px; border-radius: 12px;
  border: 1px solid var(--border-soft); background: var(--surface);
  color: var(--text-dim); cursor: pointer;
  place-items: center; transition: all 0.22s;
  -webkit-tap-highlight-color: transparent;
}
.hamburger-btn:hover { color: var(--text); border-color: var(--primary); }
.mm-sheet-overlay {
  position: fixed; inset: 0; z-index: 85;
  background: rgba(3, 8, 20, 0.55);
  opacity: 0; transition: opacity 0.22s;
}
.mm-sheet-overlay.open { opacity: 1; }
.mm-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 86;
  width: min(320px, 84vw);
  background: var(--surface); border-left: 1px solid var(--border-soft);
  box-shadow: -12px 0 40px rgba(2, 8, 24, 0.5);
  transform: translateX(100%); transition: transform 0.3s var(--ease-out);
  display: flex; flex-direction: column;
  padding-top: max(14px, env(safe-area-inset-top));
}
.mm-sheet.open { transform: translateX(0); }
.mm-head {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 20px 12px; border-bottom: 1px solid var(--border-soft);
  font-family: var(--font-display); font-size: 16px;
}
.mm-close-btn {
  margin-left: auto; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid var(--border-soft); background: var(--surface-2);
  color: var(--text-dim); cursor: pointer; display: grid; place-items: center;
}
.mm-close-btn:hover { color: var(--text); border-color: var(--primary); }
.mm-links { display: flex; flex-direction: column; padding: 14px 14px; gap: 4px; }
.mm-link {
  display: flex; align-items: center; padding: 14px 16px; border-radius: 13px;
  color: var(--text); text-decoration: none; font-size: 15.5px; font-weight: 600;
  min-height: 50px; transition: background 0.18s;
  -webkit-tap-highlight-color: transparent;
}
.mm-link:active { background: var(--surface-2); }
.mm-link:hover { background: var(--surface-2); }

@media (max-width: 900px) {
  .hamburger-btn { display: grid; }
  /* fix selector lama yang typo (class asli .topnav-links) */
  .topnav .topnav-links .nav-link { display: none; }
  .topnav .topnav-links a.nav-link { display: none; }
}

/* FIX: atribut [hidden] kalah dari display:flex — dropdown user sempat selalu muncul */
.user-menu[hidden] { display: none; }

/* ═══════════════ MODE PICK (Mock vs Latihan) ═══════════════ */
.mode-pick { display: flex; gap: 10px; margin: 16px 0 8px; flex-wrap: wrap; }
.mode-pick-card { flex: 1; min-width: 150px; cursor: pointer; position: relative; }
.mode-pick-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-pick-card .mpc-body {
  display: flex; flex-direction: column; gap: 5px;
  padding: 14px 16px; border-radius: 13px;
  background: var(--surface-2); border: 1.5px solid var(--border-soft);
  transition: border-color 0.2s, background 0.2s, transform 0.15s;
}
.mode-pick-card .mpc-body b { font-family: var(--font-display); font-size: 14.5px; }
.mode-pick-card .mpc-body span { font-size: 12px; color: var(--text-dim); line-height: 1.45; }
.mode-pick-card:hover .mpc-body { border-color: var(--primary); transform: translateY(-1px); }
.mode-pick-card.on .mpc-body {
  background: var(--primary-soft); border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.15);
}
.mode-pick-card.on .mpc-body b { color: var(--primary-hover); }
.mode-pick-card.on .mpc-body::after {
  content: "✓ Dipilih"; position: absolute; top: -8px; right: 8px;
  background: var(--primary); color: #fff; font-size: 10.5px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px;
}
