/* ============================================================
   WBSL II Exam Prep - Premium UI System
   Visual redesign only. All class/ID hooks preserved for JS.
   ============================================================ */

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

/* Metric-matched fallback for Plus Jakarta Sans. Until the web font loads,
   text renders in Arial RE-SCALED to Jakarta's exact line metrics, so when
   Jakarta swaps in the layout does not move. This kills the ~0.99 CLS that
   the font swap was causing on <body>. Overrides computed for Plus Jakarta
   Sans over Arial (capsize/Fontaine values). */
/* Self-hosted Plus Jakarta Sans (variable, weights 200-800, latin subset).
   Same-origin and preloaded in the page <head>, so it is available at first
   paint; font-display:optional means it is never swapped in AFTER paint - the
   web font can no longer reflow the layout, which was the CLS cause. No
   third-party request (the old Google Fonts <link> is gone). */
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-weight: 200 800;
    font-display: optional;
    src: url('/fonts/plus-jakarta-sans-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Metric-matched fallback shown before the web font is ready. Overrides were
   computed against Arial, so the src lists Arial first, then Arial-metric
   clones that exist where Arial does NOT: Liberation Sans (Linux / the
   PageSpeed runner) and Helvetica Neue (older Mac). With only local('Arial')
   the face is inert on Linux (no Arial) and pre-font text falls to an
   unmatched system sans. Roboto is intentionally excluded (different metrics
   -> the overrides would mis-size it). */
@font-face {
    font-family: 'Jakarta Fallback';
    src: local('Arial'), local('Liberation Sans'), local('Helvetica Neue');
    ascent-override: 91.51%;
    descent-override: 24.11%;
    line-gap-override: 0%;
    size-adjust: 105.34%;
}

/* ---------- Design tokens ---------- */
:root {
    /* Brand */
    --primary: #2f54c4;
    --primary-dark: #213d96;
    --primary-light: #4f7cf5;
    --accent: #c2922f;
    --accent-dark: #9a6e12;
    --accent-light: #e6b450;

    --success: #0f766e;
    --danger: #dc2626;
    --warning: #b45309;
    --info: #2563eb;

    /* Surfaces (light) */
    --bg-primary: #f6f8fc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eaeff7;
    --surface-strong: #0e1526;
    --surface-glass: rgba(255, 255, 255, 0.82);

    --text-primary: #0f1729;
    --text-secondary: #3c4658;
    --text-tertiary: #677387;
    --border: #dde4ef;
    --border-strong: #c5d0e1;

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #4f7cf5 0%, #2f54c4 58%, #213d96 100%);
    --grad-gold: linear-gradient(135deg, #f6cd6a 0%, #e6b450 44%, #c2922f 100%);
    --grad-surface: linear-gradient(165deg, #ffffff 0%, #f6f9fd 100%);
    --grad-text: linear-gradient(120deg, #2f54c4, #9a6e12);
    --grad-ink: linear-gradient(150deg, #2a4fb0 0%, #2f54c4 52%, #213d96 100%);

    /* Radii */
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;
    --radius-pill: 999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgb(28 19 56 / 0.06);
    --shadow: 0 6px 16px -8px rgb(28 19 56 / 0.18);
    --shadow-lg: 0 22px 44px -24px rgb(28 19 56 / 0.32);
    --shadow-xl: 0 40px 80px -36px rgb(28 19 56 / 0.42);
    --glow: 0 0 0 1px rgb(60 96 219 / 0.10);

    --ring: 0 0 0 4px rgb(60 96 219 / 0.16);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);

    --header-h: 78px;
    --sidebar-w: 288px;

    --font-sans: 'Plus Jakarta Sans', 'Jakarta Fallback', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

[data-theme="dark"] {
    --primary: #6f9bff;
    --primary-dark: #4f7cf5;
    --primary-light: #9dbcff;
    --accent: #e6b450;
    --accent-dark: #c2922f;
    --accent-light: #f6cd6a;

    --success: #2dd4bf;
    --danger: #f87171;
    --warning: #fbbf24;
    --info: #60a5fa;

    --bg-primary: #0e1526;
    --bg-secondary: #16203a;
    --bg-tertiary: #1f2b48;
    --surface-strong: #1b2742;
    --surface-glass: rgba(22, 32, 58, 0.76);

    --text-primary: #f3f6fc;
    --text-secondary: #cbd6ea;
    --text-tertiary: #93a1bd;
    --border: #29354f;
    --border-strong: #3b4a6b;

    --grad-primary: linear-gradient(135deg, #7ea7ff 0%, #5183f7 52%, #3360db 100%);
    --grad-gold: linear-gradient(135deg, #f6cd6a 0%, #e6b450 50%, #c2922f 100%);
    --grad-surface: linear-gradient(165deg, #18223c 0%, #111a30 100%);
    --grad-text: linear-gradient(120deg, #f6cd6a, #d9a43f);
    --grad-ink: linear-gradient(150deg, #3258c4 0%, #2747a0 52%, #1b2f66 100%);

    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow: 0 8px 20px -10px rgb(0 0 0 / 0.6);
    --shadow-lg: 0 24px 48px -22px rgb(0 0 0 / 0.7), 0 0 40px rgb(60 96 219 / 0.08);
    --shadow-xl: 0 44px 90px -40px rgb(0 0 0 / 0.85), 0 0 60px rgb(60 96 219 / 0.14);
    --glow: 0 0 0 1px rgb(125 162 255 / 0.18);
    --ring: 0 0 0 4px rgb(125 162 255 / 0.22);
}

/* ---------- Base ---------- */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background:
        linear-gradient(180deg, var(--bg-primary) 0%, color-mix(in srgb, var(--bg-primary) 88%, #1d4ed8 12%) 100%);
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: 0;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

body::before { content: none; }

h1, h2, h3, h4 {
    letter-spacing: 0;
}

::selection {
    background: color-mix(in srgb, var(--primary) 30%, transparent);
}

a { color: var(--primary); }

/* Custom scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: var(--radius-pill);
    border: 2px solid transparent;
    background-clip: padding-box;
}

/* ---------- Premium user welcome / progress ring ---------- */
.premium-welcome {
    text-align: center;
    margin-bottom: 2.5rem;
}
.welcome-text {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.4rem;
    letter-spacing: 0;
}
.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}
.progress-circle-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 2.5rem 0;
}
.progress-ring {
    position: relative;
    width: 200px;
    height: 200px;
    filter: drop-shadow(0 12px 28px rgb(60 96 219 / 0.28));
}
/* viewBox-scaled: geometry (cx/cy/r, dash math) stays correct at every size */
.progress-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-ring-circle {
    fill: none;
    stroke: var(--border);
    stroke-width: 12;
}
.progress-ring-progress {
    fill: none;
    stroke: url(#gradient);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.2s var(--ease);
}
.progress-ring-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}
.progress-percentage {
    font-size: 2.6rem;
    font-weight: 800;
    background: var(--grad-text);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.progress-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-weight: 600;
}
.progress-stats {
    display: flex;
    gap: 2.5rem;
    justify-content: center;
    margin-top: 1.75rem;
}
.progress-stat { text-align: center; }
.progress-stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}
.progress-stat-label {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

/* Starter-tier upsell (shown in place of the progress dashboard) */
.starter-upsell {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1.25rem;
    margin: 1.5rem 0 0.5rem;
    padding: 1.7rem 2.25rem;
    border-radius: var(--radius-lg);
    /* Gold-tinted buying prompt (gold = the buying color); the radial accent
       keeps the signed-in home from reading as a wall of same-blue boxes. */
    background:
        radial-gradient(circle at 88% 16%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 30%),
        linear-gradient(135deg, color-mix(in srgb, var(--accent) 12%, var(--bg-secondary)), var(--bg-secondary) 72%);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}
.starter-upsell .su-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    margin-bottom: 0.9rem;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--accent) 20%, var(--bg-secondary));
    color: var(--accent-dark);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}
[data-theme="dark"] .starter-upsell .su-pill { color: var(--accent-light); }
.starter-upsell .su-pill svg { width: 14px; height: 14px; flex: 0 0 auto; }
.starter-upsell strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.starter-upsell .su-lead {
    display: block;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 0.5rem;
    max-width: 640px;
}
.starter-upsell .su-benefits {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem 0.9rem;
    margin-top: 0.85rem;
}
.starter-upsell .su-benefit {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-weight: 700;
    white-space: nowrap;
}
.starter-upsell .su-benefit .tick { color: var(--accent); font-weight: 900; }
.starter-upsell .su-actions {
    display: grid;
    gap: 0.6rem;
    width: 160px;
}
.starter-upsell .su-actions .btn { width: 100%; }
@media (max-width: 760px) {
    .starter-upsell { grid-template-columns: 1fr; gap: 1.25rem; padding: 1.4rem 1.25rem; }
    .starter-upsell .su-actions { width: 100%; }
    .starter-upsell .su-benefits { flex-wrap: wrap; }
}

/* Days-remaining chip on the signed-in welcome - quiet normally, warm and
   urgent on short windows (the 48h tier especially). */
.access-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--success);
    background: color-mix(in srgb, var(--success) 12%, transparent);
}
.access-chip.access-chip-urgent {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.starter-upsell .btn { flex: 0 0 auto; }

/* Daily practice streak (sidebar) */
.streak-card {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 14%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
}
.streak-flame { font-size: 1.35rem; line-height: 1; }
.streak-count { font-weight: 800; font-size: 0.92rem; color: var(--text-primary); }
.streak-best { font-size: 0.68rem; color: var(--text-tertiary); font-weight: 600; margin-top: 0.1rem; }

/* ---------- Header ---------- */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: color-mix(in srgb, var(--bg-primary) 82%, transparent);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
}
.brand-lockup {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    cursor: pointer;
    min-width: 0;
    transition: transform 0.25s var(--ease);
}
.brand-lockup:hover { transform: translateY(-1px); }
.brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--grad-primary);
    box-shadow: 0 8px 20px -8px rgb(60 96 219 / 0.6), inset 0 1px 0 rgb(255 255 255 / 0.25);
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.logo {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    letter-spacing: 0;
}
.brand-subtitle {
    color: var(--text-tertiary);
    font-size: 0.74rem;
    line-height: 1.2;
    font-weight: 500;
}
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}
/* Header controls read as flat text, not boxed buttons - the heavy
   border+fill chips felt out of place. min-width stays so the label can
   toggle Dark<->Light without shifting the row. */
.theme-toggle {
    min-width: 56px;
    height: 42px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.theme-toggle:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
/* Soft "vague button": a faint fill + thin border gives the email + Sign Out
   a bit of contrast/affordance, without the heavy bordered+shadowed chip the
   header had before. FAQ + theme toggle stay flat text. */
.user-badge {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.35rem 0.45rem 0.35rem 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    max-width: 280px;
    box-shadow: none;
}
#userEmail {
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}
.premium-badge {
    background: var(--grad-gold);
    color: #2a1d05;
    padding: 0.22rem 0.55rem;
    border-radius: var(--radius-sm);
    font-weight: 800;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 10px -4px rgb(224 168 46 / 0.6);
}

/* ---------- Layout ---------- */
.main-container {
    margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
    padding-left: var(--sidebar-w);
    width: 100%;
    min-width: 0;
}
.sidebar {
    width: var(--sidebar-w);
    background: color-mix(in srgb, var(--bg-secondary) 70%, var(--bg-primary));
    border-right: 1px solid var(--border);
    padding: 1.75rem 1.1rem;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: var(--header-h);
    bottom: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}
.sidebar-section { margin-bottom: 1.75rem; }
.sidebar-title {
    font-size: 0.66rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    color: var(--text-tertiary);
    margin-bottom: 0.85rem;
    padding-left: 0.35rem;
}
a.nav-item { text-decoration: none; color: inherit; }
.nav-item {
    padding: 0.72rem 0.8rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.3rem;
    cursor: pointer;
    transition: all 0.22s var(--ease);
    display: flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.94rem;
    position: relative;
}
.nav-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    transform: translateX(2px);
}
.nav-item.active {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 12px 24px -14px rgb(60 96 219 / 0.8);
}
.nav-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    flex: 0 0 auto;
    transition: all 0.2s var(--ease);
}
.nav-item:hover .nav-icon { color: var(--primary); }
.nav-item.active .nav-icon {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.content {
    max-width: 1280px;
    margin: 0 auto;
    min-width: 0;
    padding: 2.25rem 2rem 1rem;
}

/* ---------- Hero ---------- */
.hero {
    padding: 0;
    margin: 0 auto;
    transition: all 0.3s var(--ease);
}
.hero-shell {
    display: block;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2.75rem 0 2rem;
    position: relative;
}
.hero-shell::before { content: none; }
.hero-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: left;
    padding: 0.5rem 0;
    max-width: 820px;
    position: relative;
    z-index: 1;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    margin-bottom: 1.1rem;
}
.eyebrow::before {
    content: '';
    width: 22px;
    height: 2px;
    border-radius: 2px;
    background: var(--accent);
}
[data-theme="dark"] .eyebrow { color: #d8ccff; }
.hero h1 {
    font-size: 3.75rem;
    font-weight: 800;
    margin-bottom: 1.1rem;
    color: var(--text-primary);
    line-height: 1.04;
    letter-spacing: 0;
}
.hero h1 .accent-word {
    color: var(--primary);
    -webkit-text-fill-color: var(--primary);
}
.hero-subtitle {
    font-size: 1.16rem;
    color: var(--text-secondary);
    margin-bottom: 1.6rem;
    line-height: 1.6;
    max-width: 560px;
}
.hero-reassurance {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    padding: 0.6rem 0.85rem;
    margin-bottom: 1.4rem;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--accent) 18%, var(--bg-primary));
    color: var(--text-primary);
    border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
    font-size: 0.9rem;
    font-weight: 700;
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: center;
    margin-bottom: 1.5rem;
}

/* Hero rating / social proof */
.hero-rating {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}
.stars {
    display: inline-flex;
    gap: 2px;
    color: var(--accent);
    font-size: 1.05rem;
    letter-spacing: 1px;
}
.rating-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}
.rating-text strong { color: var(--text-primary); font-weight: 800; }
.avatar-stack {
    display: inline-flex;
}
.avatar-stack span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    margin-left: -10px;
    background: var(--grad-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    color: #fff;
}
.avatar-stack span:first-child { margin-left: 0; }
.avatar-stack span:nth-child(2) { background: linear-gradient(135deg, #f4c95d, #c98a17); color: #2a1d05; }
.avatar-stack span:nth-child(3) { background: linear-gradient(135deg, #34d399, #059669); }
.avatar-stack span:nth-child(4) { background: linear-gradient(135deg, #60a5fa, #2563eb); }

.hero-proof {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
    max-width: 600px;
    margin-top: 1.75rem;
}
.proof-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.8rem 0.9rem;
    background: color-mix(in srgb, var(--bg-secondary) 84%, transparent);
    box-shadow: var(--shadow-sm);
}
.proof-icon {
    width: 38px; height: 38px; flex: 0 0 auto;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
}
.proof-icon svg { width: 20px; height: 20px; }
.proof-blue { background: color-mix(in srgb, #2f54c4 16%, transparent); color: #2f54c4; }
.proof-green { background: color-mix(in srgb, #059669 16%, transparent); color: #059669; }
.proof-gold { background: color-mix(in srgb, #e6b450 24%, transparent); color: #b07d12; }
[data-theme="dark"] .proof-blue { background: color-mix(in srgb, #6f9bff 20%, transparent); color: #9dbcff; }
[data-theme="dark"] .proof-green { color: #34d399; }
[data-theme="dark"] .proof-gold { color: #e6b450; }
.proof-text strong { display: block; font-size: 1.4rem; line-height: 1.05; font-weight: 800; letter-spacing: 0; }
.proof-text span { display: block; color: var(--text-secondary); font-size: 0.8rem; margin-top: 0.15rem; font-weight: 650; }

/* Hero blueprint panel */
.hero-panel {
    background: var(--grad-ink);
    color: #f8fafc;
    padding: 2.1rem;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    border: 1px solid color-mix(in srgb, var(--border-strong) 75%, transparent);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    z-index: 1;
}
.hero-panel::before { content: none; }
.panel-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
    position: relative;
}
.blueprint-header {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 0 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.22);
    margin-bottom: 1.1rem;
    position: relative;
}
.blueprint-header span {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
}
.blueprint-header strong {
    color: var(--accent);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 800;
}
.domain-bars {
    display: grid;
    gap: 0.7rem;
    position: relative;
}
.domain-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem 1rem;
    align-items: center;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.09);
    transition: all 0.25s var(--ease);
}
.domain-row:hover {
    background: rgba(255, 255, 255, 0.14);
    transform: translateX(3px);
}
.domain-row.emphasized {
    border-color: rgba(246, 200, 95, 0.55);
    background: rgba(246, 200, 95, 0.1);
}
.domain-row strong,
.domain-row span,
.domain-row em { display: block; }
.domain-row strong { font-size: 0.95rem; font-weight: 700; }
.domain-row span {
    color: rgba(255, 255, 255, 0.66);
    font-size: 0.78rem;
    line-height: 1.35;
    margin-top: 0.15rem;
}
.domain-row em {
    color: var(--accent);
    font-style: normal;
    font-size: 1.05rem;
    font-weight: 800;
}
.domain-meter {
    grid-column: 1 / -1;
    height: 7px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-pill);
    overflow: hidden;
}
.domain-meter span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--primary-light));
    border-radius: inherit;
}
.panel-note {
    margin-top: 1.1rem;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.92rem;
    position: relative;
}
.product-preview {
    gap: 0;
    padding: 0;
    background: #f8fafc;
    color: #111827;
    border: 1px solid rgba(255, 255, 255, 0.78);
    box-shadow: 0 28px 70px -36px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(148, 163, 184, 0.18);
}
.preview-topline,
.preview-meter > div:first-child {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    position: relative;
}
.preview-topline {
    padding: 1rem 1.25rem;
    background: #111827;
    border-bottom: 1px solid #1f2937;
}
.preview-topline span,
.preview-meter span {
    color: #cbd5e1;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.preview-topline strong {
    color: #251a03;
    background: #fbbf24;
    border-radius: var(--radius-pill);
    padding: 0.32rem 0.62rem;
    font-size: 0.82rem;
}
.preview-question {
    position: relative;
    padding: 1.3rem 1.25rem 1rem;
    background: #ffffff;
    color: #111827;
    font-size: 1.12rem;
    font-weight: 800;
    line-height: 1.42;
    letter-spacing: 0;
}
.preview-options {
    display: grid;
    gap: 0.7rem;
    position: relative;
    padding: 0 1.25rem 1.2rem;
    background: #ffffff;
}
.preview-options div {
    padding: 0.85rem 0.95rem;
    border-radius: 12px;
    border: 1px solid #dce3ee;
    background: #f8fafc;
    color: #334155;
    font-size: 0.92rem;
    font-weight: 650;
    transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.preview-options div:hover {
    transform: translateX(3px);
    border-color: #aebbd0;
}
.preview-options .selected {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #111827;
    box-shadow: inset 4px 0 0 #f59e0b, 0 10px 24px -18px rgba(245, 158, 11, 0.9);
}
.preview-explanation {
    position: relative;
    margin: 0 1.25rem 1.15rem;
    padding: 1rem;
    border-radius: 14px;
    background: #ecfdf5;
    border: 1px solid #99f6e4;
}
.preview-explanation strong {
    display: block;
    margin-bottom: 0.28rem;
    color: #0f766e;
    font-size: 0.85rem;
}
.preview-explanation p {
    color: #115e59;
    font-size: 0.88rem;
    line-height: 1.5;
}
.preview-meter {
    position: relative;
    display: grid;
    gap: 0.55rem;
    padding: 1rem 1.25rem 1.2rem;
    background: #eef2f7;
    border-top: 1px solid #dde5ef;
}
.preview-meter strong {
    color: #0f766e;
    font-size: 1.15rem;
}
.product-preview .domain-meter {
    background: #d7dfec;
}
.product-preview .domain-meter span {
    background: linear-gradient(90deg, #14b8a6, #f59e0b);
}

/* ---------- Feature grid ---------- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.1rem;
    margin: 2.25rem auto;
    max-width: 1200px;
}
.compact-feature-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.75rem;
    margin-bottom: 0;
}
.feature-card {
    background: color-mix(in srgb, var(--bg-secondary) 60%, transparent);
    padding: 1.5rem;
    border: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
    border-radius: var(--radius);
    text-align: left;
    transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
    position: relative;
}
.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
    border-color: var(--border-strong);
}
.feature-card:hover .feature-title { color: var(--primary); }

/* Grounding line between the hero and the first content row. */
#homeScreen > .feature-grid {
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    padding-top: 2.5rem;
    max-width: 1200px;
}
/* Logged-out marketing features: an OPEN band with hairline dividers, not boxes.
   (Flex so it works for 3 or 4 cards. The logged-in dashboard keeps boxed,
   clickable tiles — this only applies when JS adds .feature-band.) */
#homeScreen > .feature-grid.feature-band {
    display: flex;
    gap: 0;
}
#homeScreen > .feature-grid.feature-band .feature-card {
    flex: 1 1 0;
    background: none;
    border: none;
    border-left: 1px solid var(--border);
    border-radius: 0;
    padding: 0.25rem 1.85rem;
}
#homeScreen > .feature-grid.feature-band .feature-card:first-child {
    border-left: none;
    padding-left: 0;
}
#homeScreen > .feature-grid.feature-band .feature-card:hover {
    transform: none;
    box-shadow: none;
}
/* Heading above the marketing band. It takes over the band's top divider so
   heading + cards read as one section; hidden (.hidden) for premium users,
   whose grid becomes the quick-action dashboard and keeps its own divider. */
#homeScreen > .feature-band-heading {
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    padding-top: 2.5rem;
    max-width: 1200px;
    text-align: left;
}
#homeScreen > .feature-band-heading h2 {
    font-size: 1.6rem;
    margin-bottom: 0.5rem;
}
#homeScreen > .feature-band-heading p {
    color: var(--text-secondary);
    max-width: 620px;
    margin: 0;
    font-size: 0.95rem;
}
#homeScreen > .feature-band-heading:not(.hidden) + .feature-grid {
    border-top: none;
    margin-top: 1.9rem;
    padding-top: 0;
}
@media (max-width: 860px) {
    #homeScreen > .feature-grid.feature-band { flex-direction: column; }
    #homeScreen > .feature-grid.feature-band .feature-card {
        border-left: none;
        border-top: 1px solid var(--border);
        padding: 1.5rem 0 0;
    }
    #homeScreen > .feature-grid.feature-band .feature-card:first-child {
        border-top: none;
        padding-top: 0;
    }
}
.feature-icon { margin-bottom: 0.9rem; }
.text-icon {
    width: 46px;
    height: 46px;
    border-radius: 13px;
    background: color-mix(in srgb, var(--primary) 14%, transparent);
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 800;
}
[data-theme="dark"] .text-icon { color: var(--primary-light); }
.feature-title {
    font-weight: 700;
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
    letter-spacing: 0;
}
.feature-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.55;
}

/* ---------- Exam band ---------- */
.exam-band {
    max-width: 1200px;
    margin: 3.5rem auto 0;
    padding: 2.75rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}
.exam-band .eyebrow { margin-bottom: 0.6rem; }
.exam-band h2 {
    font-size: 1.85rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
}
.exam-band p {
    color: var(--text-secondary);
    max-width: 720px;
}

/* ---------- Generic home sections (steps, testimonials, faq) ---------- */
.home-section {
    max-width: 1200px;
    margin: 4rem auto 0;
}
.section-head {
    text-align: left;
    max-width: 720px;
    margin: 0 0 2.25rem;
}
.section-head .eyebrow {
    justify-content: flex-start;
}
.section-head h2 {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: 0;
    margin-bottom: 0.6rem;
}
.section-head p {
    color: var(--text-secondary);
    font-size: 1.05rem;
}

/* ---------- Progress dashboard ---------- */
.dashboard { position: relative; }
.dashboard .dash-body { transition: filter 0.3s var(--ease); }
.dash-card {
    background: var(--grad-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.85rem;
    box-shadow: var(--shadow-sm);
}
.dash-card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.4rem; }
.dash-card-head h3 { font-size: 1.15rem; font-weight: 800; letter-spacing: 0; }
.dash-subhead { font-weight: 800; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-tertiary); margin-bottom: 0.9rem; }
.dash-subhead-spaced { margin-top: 1.5rem; }
.dash-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; margin-top: 1.25rem; }

/* Readiness ring */
.readiness-grid { display: grid; grid-template-columns: 240px 1fr; gap: 2rem; align-items: center; }
.readiness-ring-col { text-align: center; padding-right: 2rem; border-right: 1px solid var(--border); }
.readiness-ring { position: relative; width: 168px; height: 168px; margin: 0 auto; }
.ring-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: color-mix(in srgb, var(--primary) 12%, transparent); stroke-width: 10; }
.ring-fg { fill: none; stroke: var(--primary); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 0.7s var(--ease); }
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center span { font-size: 2.5rem; font-weight: 800; line-height: 1; }
.ring-center small { color: var(--text-tertiary); font-weight: 600; }
.readiness-status { font-weight: 800; color: var(--success); margin-top: 1rem; font-size: 1.05rem; }
.readiness-status.status-good { color: var(--success); }
.readiness-status.status-mid { color: #b06a10; }
.readiness-status.status-low { color: #b93838; }
.readiness-substatus { color: var(--text-tertiary); font-size: 0.85rem; margin-top: 0.3rem; line-height: 1.45; }

/* Domain bars */
.domain-bars { display: grid; gap: 0.85rem; }
.domain-bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 0.35rem; font-size: 0.92rem; }
.domain-bar-head span { color: var(--text-secondary); font-weight: 600; }
.domain-bar-head strong { color: var(--text-primary); font-weight: 800; }
.domain-bar-track { height: 8px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--primary) 12%, transparent); overflow: hidden; }
.domain-bar-fill { height: 100%; border-radius: var(--radius-pill); background: var(--grad-primary); transition: width 0.6s var(--ease); }

/* Recent quizzes */
.recent-quizzes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.recent-quiz { display: flex; align-items: center; gap: 0.6rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 0.85rem; }
.recent-quiz .rq-dot { width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto; border: 2px solid var(--success); }
.recent-quiz.rq-mid .rq-dot { border-color: var(--primary); }
.recent-quiz.rq-low .rq-dot { border-color: var(--accent); }
.recent-quiz .rq-name { font-weight: 700; font-size: 0.9rem; }
.recent-quiz .rq-when { color: var(--text-tertiary); font-size: 0.75rem; }
.recent-quiz .rq-score { margin-left: auto; text-align: right; }
.recent-quiz .rq-score strong { font-weight: 800; font-size: 0.95rem; }
.recent-quiz .rq-score span { display: block; color: var(--text-tertiary); font-size: 0.7rem; }
.recent-empty { color: var(--text-tertiary); font-size: 0.9rem; grid-column: 1/-1; }

/* Study plan */
.studyplan-top { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.studyplan-label { color: var(--text-tertiary); font-size: 0.8rem; font-weight: 600; }
.studyplan-goal, .studyplan-streak { font-size: 1.05rem; margin-top: 0.2rem; }
.studyplan-goal strong, .studyplan-streak strong { font-size: 1.5rem; font-weight: 800; }
.studyplan-track { height: 8px; border-radius: var(--radius-pill); background: color-mix(in srgb, var(--primary) 12%, transparent); overflow: hidden; }
.studyplan-fill { height: 100%; border-radius: var(--radius-pill); background: var(--grad-primary); transition: width 0.6s var(--ease); }
.studyplan-progress { color: var(--text-tertiary); font-size: 0.82rem; margin-top: 0.5rem; }
.studyplan-note { margin-top: 1rem; padding: 0.7rem 0.85rem; border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 7%, transparent); color: var(--text-secondary); font-size: 0.85rem; }

/* Progress at a glance */
.glance-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.1rem; }
.glance-stat strong { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1; }
.glance-stat span { color: var(--text-tertiary); font-size: 0.8rem; }
.glance-delta { display: inline-block; margin-top: 0.25rem; font-size: 0.78rem; font-weight: 800; }
.glance-delta.up { color: var(--success); }
.glance-delta.down { color: #b93838; }
.glance-trend { width: 100%; height: 70px; display: block; }
.glance-trend .trend-area { fill: color-mix(in srgb, var(--primary) 13%, transparent); }
.glance-trend .trend-line { fill: none; stroke: var(--primary); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }

/* Locked / blurred dashboard (entry tier / free / logged-out) */
.dashboard-lock { display: none; }
/* Light blur: the teaser should be tantalizingly readable-ish (it's sample
   data showcasing what buyers get), with the lock + copy doing the gating. */
.dashboard.is-locked .dash-body { filter: blur(3px); pointer-events: none; user-select: none; }
.dashboard.is-locked .dashboard-lock {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    text-align: center; gap: 0.55rem; position: absolute; inset: 0; padding: 1.5rem;
    background: color-mix(in srgb, var(--bg-secondary) 50%, transparent);
}
.dashboard-lock .lock-badge {
    font-size: 1.5rem; width: 54px; height: 54px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%; background: color-mix(in srgb, var(--accent) 22%, transparent);
}
.dashboard-lock strong { font-size: 1.2rem; }
.dashboard-lock span { color: var(--text-secondary); max-width: 460px; font-size: 0.95rem; }
.dashboard-lock .btn { margin-top: 0.6rem; }

@media (max-width: 820px) {
    .readiness-grid { grid-template-columns: 1fr; gap: 1.4rem; }
    .readiness-ring-col { border-right: none; border-bottom: 1px solid var(--border); padding-right: 0; padding-bottom: 1.4rem; }
    .dash-row { grid-template-columns: 1fr; }
    .recent-quizzes { grid-template-columns: 1fr; }
}

/* Steps */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}
.step-card {
    background: var(--grad-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    position: relative;
    transition: all 0.28s var(--ease);
}
.step-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}
.step-num {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--grad-primary);
    color: #fff;
    font-weight: 800;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    box-shadow: 0 10px 22px -10px rgb(60 96 219 / 0.7);
}
.step-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
}
.step-card p {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.55;
}

/* ============================================
   TESTIMONIALS SLIDER
   ============================================ */
.testimonials-section {
    position: relative;
    width: 100%;
    max-width: 1300px;
    margin: 0 auto 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow: hidden;
    box-sizing: border-box;
}

.testimonials-viewport {
    overflow: hidden;
    flex: 1;
    min-width: 0;
    width: 100%;
    max-width: 100%;
}

.testimonials-track {
    display: flex;
    gap: 1.25rem;
    transition: transform 0.4s ease;
}

.testimonial-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: left;
    flex: 0 0 calc(33.333% - 0.834rem);
    min-width: 0;
    box-sizing: border-box;
}

.testimonial-arrow {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1rem;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
    z-index: 2;
}

.testimonial-arrow:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
}

.testimonial-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    position: absolute;
    bottom: -1.5rem;
    left: 0;
    right: 0;
}

.testimonial-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
}

.testimonial-dot.active {
    background: var(--primary);
}

.testimonial-stars {
    color: #fbbf24;
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    letter-spacing: 0.1em;
}

.testimonial-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.testimonial-author strong {
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.testimonial-author span {
    color: var(--text-tertiary);
    font-size: 0.8125rem;
}

@media (max-width: 768px) {
    .testimonial-card {
        flex: 0 0 0;
    }

    .testimonial-arrow {
        display: none;
    }

    .testimonials-section {
        flex-direction: column;
    }

    .testimonials-viewport {
        position: relative;
        width: 100%;
    }

    .testimonials-track {
        gap: 0;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
    }
}

/* Trust badges row */
.trust-strip {
    max-width: 1200px;
    margin: 2.25rem auto 0;
    padding: 1.4rem 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.25rem 2.75rem;
}
.trust-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
}
.trust-item .ti-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--success) 16%, transparent);
    color: var(--success);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
}

/* FAQ */
.faq-list {
    max-width: 820px;
    margin: 0 auto;
    display: grid;
    gap: 0.85rem;
}
.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s var(--ease);
}
.faq-item[open] { border-color: var(--border-strong); box-shadow: var(--shadow); }
.faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 1.2rem 1.4rem;
    font-weight: 700;
    font-size: 1.02rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
/* (the +/- open indicator lives with the redesigned FAQ block further down;
   the old rotate(45deg) here fought it and produced a tilted minus glyph) */
.faq-item p {
    padding: 0 1.4rem 1.3rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Final CTA band */
.cta-band {
    max-width: 1200px;
    margin: 4rem auto 0;
    padding: 3rem;
    border-radius: var(--radius-xl);
    background: var(--grad-ink);
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
}
.cta-band::before { content: none; }
.cta-band > * { position: relative; }
.cta-band h2 {
    font-size: 2.3rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    letter-spacing: 0;
}
.cta-band p {
    color: rgba(255, 255, 255, 0.8);
    max-width: 560px;
    margin: 0 auto 1.75rem;
    font-size: 1.05rem;
}

/* ---------- Screen heading ---------- */
.screen-heading { margin-bottom: 2rem; }
.screen-heading h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 800;
    letter-spacing: 0;
}
.screen-heading p {
    color: var(--text-secondary);
    max-width: 780px;
}

/* ---------- Buttons ---------- */
.btn {
    padding: 0.8rem 1.6rem;
    border-radius: var(--radius-sm);
    border: none;
    font-family: inherit;
    font-weight: 700;
    font-size: 0.94rem;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.22s var(--ease);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
    letter-spacing: 0;
    position: relative;
    overflow: hidden;
}
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.6s var(--ease);
}
.btn:hover::before { transform: translateX(120%); }
.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 12px 26px -12px rgb(60 96 219 / 0.7);
}
.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -14px rgb(60 96 219 / 0.85);
}
.btn-gold {
    background: linear-gradient(135deg, #f4c95d, #d9a128);
    color: #2a1d05;
    box-shadow: 0 12px 26px -12px rgb(201 138 23 / 0.75);
}
.btn-gold:hover:not(:disabled) {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #f6d175, #c98a17);
    box-shadow: 0 18px 34px -14px rgb(201 138 23 / 0.9);
}
.btn-secondary {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}
.btn-secondary:hover:not(:disabled) {
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}
/* Header Sign In/Out: a light ghost, not a filled box, to match the
   de-boxed theme toggle + user email next to it. Scoped to the header
   button by id so every other .btn-secondary keeps its normal look. */
#authBtn {
    background: var(--bg-secondary);
    border-color: var(--border);
    color: var(--text-secondary);
    box-shadow: none;
}
#authBtn:hover:not(:disabled) {
    background: var(--bg-tertiary);
    border-color: var(--border-strong);
    color: var(--text-primary);
}
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
/* Dark theme uses brighter status colors - white text on them fails
   contrast badly (Skip / End Quiz were ~1.7:1); use dark ink instead */
[data-theme="dark"] .btn-success,
[data-theme="dark"] .btn-danger,
[data-theme="dark"] .btn-warning { color: #11182b; }
/* Google sign-in: neutral surface per Google branding guidelines */
.btn-google {
    background: #ffffff;
    color: #3c4043;
    border: 1px solid #dadce0;
    font-weight: 500;
    font-size: 0.9375rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}
.btn-google:hover:not(:disabled) {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
}
[data-theme="dark"] .btn-google {
    background: #131314;
    color: #e3e3e3;
    border-color: #5f6368;
}
[data-theme="dark"] .btn-google:hover:not(:disabled) {
    background: #222428;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.btn-gold {
    background: var(--grad-gold);
    color: #2a1d05;
    font-weight: 800;
    box-shadow: 0 12px 26px -12px rgb(224 168 46 / 0.7);
}
.btn-gold:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -14px rgb(224 168 46 / 0.85);
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:disabled::before { display: none; }
.btn-large {
    padding: 1.05rem 2.1rem;
    font-size: 1.05rem;
    border-radius: var(--radius);
}

/* ---------- Quiz ---------- */
.quiz-layout {
    display: grid;
    grid-template-columns: 1fr 290px;
    gap: 1.25rem;
    height: calc(100vh - 150px);
}
.quiz-main {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    position: relative;
    box-shadow: var(--shadow);
}
.quiz-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.progress-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.progress-header {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    margin-bottom: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.progress-bar-container {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-pill);
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.progress-bar-fill {
    height: 100%;
    background: var(--grad-primary);
    transition: width 0.4s var(--ease);
    border-radius: var(--radius-pill);
}
.progress-text {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    font-weight: 600;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
}
.stats-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.stat-box {
    text-align: center;
    padding: 0.85rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    transition: transform 0.2s var(--ease);
}
.stat-box:hover { transform: translateY(-2px); }
.stat-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    transition: color 0.3s ease;
}
.stat-label {
    font-size: 0.64rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 0.35rem;
    font-weight: 600;
}
.question-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
}
.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1.1rem;
    /* Land below the fixed header when scrolled to between questions */
    scroll-margin-top: calc(var(--header-h) + 12px);
    border-bottom: 2px solid var(--border);
}
.question-number {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary);
}
.question-meta {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.report-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--ease);
    box-shadow: var(--shadow);
}
.report-btn:hover { transform: scale(1.1); }
.report-btn:active { transform: scale(0.95); }
.question-text {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.75rem;
    line-height: 1.5;
    letter-spacing: 0;
}
.options-container {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
    padding-right: 80px;
}
.option {
    padding: 1.15rem 1.4rem;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s var(--ease);
    font-size: 1.05rem;
    position: relative;
    line-height: 1.5;
    font-weight: 600;
    /* Touch feel: no text-selection on tap, no double-tap zoom delay,
       no gray iOS tap flash - the :active state below is the feedback */
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.option:hover:not(.locked) {
    border-color: var(--primary);
    transform: translateX(5px);
    box-shadow: var(--shadow);
}
/* Instant press feedback - :hover never fires on touch screens */
.option:active:not(.locked) {
    border-color: var(--primary);
    transform: scale(0.985);
}
/* Verdict micro-animations, only on the render right after answering
   (.just-answered is set for one render pass, so revisiting an answered
   question via Previous does not replay them) */
@keyframes option-pop {
    0% { transform: scale(1); }
    35% { transform: scale(1.025); }
    100% { transform: scale(1); }
}
@keyframes option-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    55% { transform: translateX(5px); }
    80% { transform: translateX(-3px); }
}
.options-container.just-answered .option.correct { animation: option-pop 0.3s var(--ease); }
.options-container.just-answered .option.incorrect { animation: option-shake 0.35s var(--ease); }
.option.selected {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
}
.option.correct {
    border-color: var(--success);
    background: color-mix(in srgb, var(--success) 14%, transparent);
}
.option.incorrect {
    border-color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, transparent);
}
.option.locked { cursor: not-allowed; }
/* Non-color verdict signal (color-blind users, screenshots, print) */
.option.correct::after { content: " \2713"; font-weight: 800; }
.option.incorrect::after { content: " \2717"; font-weight: 800; }
.feedback-box {
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius);
    margin-top: 1.1rem;
    font-weight: 600;
    display: none;
    font-size: 0.95rem;
    line-height: 1.5;
    /* Keep clear of the sticky mobile action bar when scrolled into view */
    scroll-margin-bottom: 6rem;
}
.feedback-box.correct {
    background: color-mix(in srgb, var(--success) 12%, transparent);
    border: 2px solid var(--success);
    color: var(--success);
}
.feedback-box.incorrect {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    border: 2px solid var(--danger);
    color: var(--danger);
}
.quiz-controls {
    display: flex;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 1.25rem;
}
.floating-next {
    position: absolute;
    right: -70px;
    top: 50%;
    transform: translateY(-50%);
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 16px 30px -12px rgb(60 96 219 / 0.8);
    transition: all 0.3s var(--ease);
    z-index: 10;
}
.floating-next:hover:not(:disabled) {
    transform: translateY(-50%) scale(1.1);
}
.floating-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: var(--text-tertiary);
    box-shadow: none;
}
.floating-next.answered { animation: pulse 0.5s var(--ease); }
@keyframes pulse {
    0%, 100% { transform: translateY(-50%) scale(1); }
    50% { transform: translateY(-50%) scale(1.15); }
}

/* ---------- Results ---------- */
.results-container { max-width: 1200px; margin: 0 auto; }
.results-header { text-align: center; margin-bottom: 1.75rem; }
.results-header h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 0.5rem; }
.score-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}
.score-card {
    background: var(--grad-surface);
    padding: 1.4rem;
    border-radius: var(--radius);
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease);
}
.score-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.score-card-value { font-size: 2.4rem; font-weight: 800; margin-bottom: 0.35rem; letter-spacing: 0; }
.score-card-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}
.chart-card {
    background: var(--bg-secondary);
    padding: 1.4rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    min-height: 260px;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}
.chart-title { font-size: 1.02rem; font-weight: 700; margin-bottom: 1rem; }
.chart-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-style: italic;
    font-size: 0.9rem;
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}
.review-section {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.5rem;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.review-item {
    padding: 1.1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--danger);
}
.review-question { font-weight: 700; margin-bottom: 0.7rem; font-size: 1rem; }
.review-answers { display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.85rem; }
.review-correct { color: var(--success); font-weight: 600; }
.review-incorrect { color: var(--danger); font-weight: 600; }

/* ---------- Pricing ---------- */
.pricing-screen { max-width: 1200px; margin: 0 auto; }
.pricing-hero {
    padding: 1rem 0 1.75rem;
    margin-bottom: 1.5rem;
    max-width: 820px;
}
.pricing-hero .eyebrow { margin-bottom: 0.9rem; }
.pricing-hero h2 {
    font-size: 2.9rem;
    line-height: 1.05;
    margin-bottom: 0.85rem;
    max-width: 720px;
    font-weight: 800;
    letter-spacing: 0;
}
.pricing-hero p { color: var(--text-secondary); max-width: 720px; font-size: 1.05rem; }
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
    margin: 1.75rem auto;
    align-items: stretch;
}
.pricing-card {
    background: var(--grad-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.85rem 1.65rem;
    text-align: left;
    transition: all 0.3s var(--ease);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 540px;
    overflow: hidden;
}
.pricing-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--grad-primary);
    opacity: 0.35;
}
.pricing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
    border-color: var(--border-strong);
}
.pricing-card.featured {
    border: 1.5px solid transparent;
    background:
        linear-gradient(var(--bg-secondary), var(--bg-secondary)) padding-box,
        var(--grad-primary) border-box;
}
.pricing-card.featured::before { opacity: 1; height: 5px; }
.pricing-card.featured:hover { transform: translateY(-6px); box-shadow: var(--shadow-xl); }
@keyframes featuredGlow {
    0%, 100% { box-shadow: var(--shadow-xl); }
    50% { box-shadow: var(--shadow-xl), 0 0 32px -2px color-mix(in srgb, var(--primary) 42%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
    .pricing-card.featured { animation: none; }
}
.best-value {
    position: static;
    align-self: flex-start;
    background: var(--grad-primary);
    color: #fff;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-pill);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.9rem;
    box-shadow: 0 8px 18px -8px rgb(60 96 219 / 0.7);
}
.pricing-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 0.4rem;
    letter-spacing: 0;
}
.pricing-price {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    margin: 0.4rem 0 0.2rem;
    letter-spacing: 0;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.pricing-price small {
    font-size: 0.85rem;
    color: var(--text-tertiary);
    font-weight: 600;
}
.price-period {
    font-size: 0.95rem;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 0.4rem;
}
.price-value {
    font-size: 0.82rem;
    color: var(--text-tertiary);
    font-weight: 600;
    margin-bottom: 0.85rem;
}
.price-value.highlight {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    gap: 0.4rem;
    color: var(--success);
    font-weight: 800;
    padding: 0.28rem 0.7rem;
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--success) 14%, transparent);
}
.price-value.highlight::before {
    content: '';
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / contain no-repeat;
}
.pricing-total {
    color: var(--primary-dark);
    font-size: 0.82rem;
    margin-bottom: 0.9rem;
    font-weight: 800;
    padding: 0.32rem 0.7rem;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    border-radius: var(--radius-pill);
    display: inline-block;
    align-self: flex-start;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
[data-theme="dark"] .pricing-total { color: var(--primary-light); }
.plan-fit {
    color: var(--text-secondary);
    font-size: 0.92rem;
    min-height: 66px;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}
.pricing-features {
    list-style: none;
    margin: 0.5rem 0 1.5rem;
    text-align: left;
    width: 100%;
}
.pricing-features li {
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.92rem;
    display: flex;
    gap: 0.65rem;
    align-items: flex-start;
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-features li::before {
    content: '';
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    margin-top: 0.12rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--success) 18%, transparent)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23059669' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}
[data-theme="dark"] .pricing-features li::before {
    background: color-mix(in srgb, var(--success) 22%, transparent)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%2334d399' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}
.pricing-card .btn { margin-top: auto; }
/* Inconspicuous per-card VAT primer: small + muted, sits directly under the buy
   button. Subtly signals "a little is added on top" so the VAT line on the
   Polar checkout page reads as expected rather than a surprise that loses the sale. */
.vat-note {
    margin-top: 0.5rem;
    font-size: 0.72rem;
    line-height: 1.3;
    color: var(--text-tertiary);
    text-align: center;
    opacity: 0.85;
}

/* --- Analytics upsell modal (design v2) -----------------------------------
   Scoped to #analyticsUpsellModal so it restyles ONLY this modal, inherits the
   theme tokens (works light + dark) and the self-hosted body font (no Inter).
   The primary CTA reuses .btn-gold; its label is set by JS from
   ANALYTICS_UNLOCK_PLAN.ctaLabel so the displayed price always matches the charge. */
#analyticsUpsellModal .modal { max-width: 524px; }
#analyticsUpsellModal h2 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.55rem, 4.5vw, 2.05rem);
    line-height: 1.22;
    letter-spacing: -0.03em;
}
#analyticsUpsellModal .upsell-intro {
    margin: 0 0 1.5rem;
    color: var(--text-secondary);
    font-size: 1.05rem;
    line-height: 1.55;
}
#analyticsUpsellModal .ace {
    position: relative;
    font-weight: 900;
}
#analyticsUpsellModal .ace::after {
    content: "";
    position: absolute;
    left: 1px; right: 1px; bottom: -2px;
    height: 2px;
    border-radius: var(--radius-pill);
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
    opacity: 0.85;
}
#analyticsUpsellModal .benefits {
    display: grid;
    gap: 0.85rem;
    margin: 0 0 1.5rem;
    padding: 0;
    list-style: none;
}
#analyticsUpsellModal .benefits li {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 0.8rem;
    align-items: start;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.4;
}
#analyticsUpsellModal .benefits .tick {
    color: var(--accent);
    font-weight: 900;
    line-height: 1.3;
}
#analyticsUpsellModal .proof-box {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 0.85rem;
    align-items: center;
    margin: 0 0 1.5rem;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 12%, var(--bg-secondary));
    border: 1px solid color-mix(in srgb, var(--accent) 38%, transparent);
}
#analyticsUpsellModal .brain-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--accent-dark);
}
[data-theme="dark"] #analyticsUpsellModal .brain-icon { color: var(--accent-light); }
#analyticsUpsellModal .proof-box p {
    margin: 0;
    color: var(--text-primary);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.4;
}
#analyticsUpsellModal .button-stack {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.25rem;
}
#analyticsUpsellModal .purchase-footer {
    margin-top: 1.1rem;
    text-align: center;
    color: var(--text-tertiary);
}
#analyticsUpsellModal .purchase-note {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    font-size: 0.85rem;
    font-weight: 600;
}
#analyticsUpsellModal .purchase-note svg { width: 14px; height: 14px; }

/* --- Confidence ladder (above the pricing cards) ---------------------------
   3-icon "how each plan builds readiness" bar. Static and fully visible
   (no-JS safe). Mapped to theme tokens (works light + dark). */
.confidence-ladder {
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 0 auto 1.75rem;
    padding: 1.5rem 1.75rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}
.confidence-ladder .ladder-track {
    position: absolute;
    left: 14%; right: 14%; top: 3.25rem;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--bg-tertiary);
    overflow: hidden;
}
.confidence-ladder .ladder-fill {
    display: block; width: 100%; height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #8794a9, var(--primary), var(--accent));
    transform-origin: left center;
    transform: scaleX(1);
}
.confidence-ladder .ladder-step {
    position: relative; z-index: 1;
    display: grid; align-content: start; justify-items: center;
    text-align: center; padding: 0 0.5rem;
}
.confidence-ladder .ladder-marker {
    width: 56px; height: 56px;
    display: grid; place-items: center;
    margin-bottom: 0.7rem;
    border-radius: 50%;
    color: #fff;
    background: linear-gradient(135deg, #8794a9, #667286);
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12);
}
.confidence-ladder .ladder-step.focus .ladder-marker {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
}
.confidence-ladder .ladder-step.confidence .ladder-marker {
    color: #211604;
    background: var(--grad-gold);
}
.confidence-ladder .ladder-marker svg { width: 26px; height: 26px; }
.confidence-ladder .ladder-kicker {
    color: var(--text-tertiary);
    font-size: 0.68rem; font-weight: 800;
    letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 0.35rem;
}
.confidence-ladder .ladder-step strong {
    display: block; color: var(--text-primary);
    font-size: 1.05rem; line-height: 1.15; letter-spacing: -0.02em;
    font-weight: 800; margin-bottom: 0.3rem;
}
.confidence-ladder .ladder-step p {
    max-width: 230px; margin: 0;
    color: var(--text-secondary); font-size: 0.82rem; line-height: 1.35;
}
@media (max-width: 700px) {
    .confidence-ladder { grid-template-columns: 1fr; gap: 0.85rem; padding: 1.25rem; }
    .confidence-ladder .ladder-track { display: none; }
    .confidence-ladder .ladder-step p { max-width: none; }
}

/* Gold premium card (Pass Confidence) — the front/hero card */
.pricing-card.premium {
    border: 1.5px solid transparent;
    background:
        linear-gradient(var(--bg-secondary), var(--bg-secondary)) padding-box,
        linear-gradient(150deg, #f4c95d, #e6b450 52%, #c98a17) border-box;
    box-shadow: var(--shadow-xl);
    transform: scale(1.06);
    z-index: 3;
    animation: premiumGlow 3.6s ease-in-out infinite;
}
.pricing-card.premium::before {
    opacity: 1;
    height: 5px;
    background: linear-gradient(90deg, #f4c95d, #e6b450, #c98a17);
}
.pricing-card.premium:hover { transform: scale(1.06) translateY(-4px); }
@keyframes premiumGlow {
    0%, 100% { box-shadow: var(--shadow-xl); }
    50% { box-shadow: var(--shadow-xl), 0 0 36px -2px rgb(230 180 80 / 0.55); }
}
@media (prefers-reduced-motion: reduce) {
    .pricing-card.premium { animation: none; }
}

/* Gold "Best value" badge */
.best-value.gold {
    background: linear-gradient(135deg, #f4c95d, #c98a17);
    color: #2a1d05;
    box-shadow: 0 8px 18px -8px rgb(201 138 23 / 0.65);
}

/* Muted category badge — for the entry tier (no buy-me weight) */
.best-value.muted {
    background: color-mix(in srgb, var(--text-tertiary) 14%, transparent);
    color: var(--text-tertiary);
    box-shadow: none;
}

/* Pass-rate proof badge (gold) */
.pass-proof {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.2;
    color: #8a5a08;
    background: color-mix(in srgb, #e6b450 18%, transparent);
    border: 1px solid color-mix(in srgb, #e6b450 48%, transparent);
    padding: 0.34rem 0.72rem;
    border-radius: var(--radius-pill);
    margin-bottom: 0.9rem;
}
[data-theme="dark"] .pass-proof {
    color: #f4c95d;
    background: color-mix(in srgb, #e6b450 16%, transparent);
}

/* Highlighted perk row — the thing they upgrade for */
.pricing-features li.perk {
    font-weight: 800;
    color: var(--text-primary);
}
.pricing-features li.perk::before {
    background: color-mix(in srgb, var(--accent) 26%, transparent)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23c98a17' stroke='%23c98a17' stroke-width='1' stroke-linejoin='round'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26'/%3E%3C/svg%3E") center / 12px no-repeat;
}
[data-theme="dark"] .pricing-features li.perk::before {
    background: color-mix(in srgb, var(--accent) 28%, transparent)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23e6b450' stroke='%23e6b450' stroke-width='1' stroke-linejoin='round'%3E%3Cpolygon points='12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26'/%3E%3C/svg%3E") center / 12px no-repeat;
}

/* Excluded row — red minus, clearly "not in this plan" */
.pricing-features li.excluded {
    /* A tad stronger than tertiary - "you don't get this" must register
       without shouting. */
    color: var(--text-secondary);
}
.pricing-features li.excluded::before {
    background: color-mix(in srgb, #ef4444 24%, transparent)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='11' viewBox='0 0 24 24' fill='none' stroke='%23dc2626' stroke-width='4' stroke-linecap='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* Pricing trust row */
.pricing-trust {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1rem 2rem;
    margin: 0.5rem auto 2rem;
    padding: 1.25rem;
    border-radius: var(--radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border);
}
.pricing-trust .trust-item { font-size: 0.88rem; }

.pricing-footer-note {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: var(--radius-lg);
    background: var(--grad-surface);
    border: 1px solid var(--border);
    text-align: center;
}
.pricing-footer-note h3 { margin-bottom: 0.5rem; font-size: 1.3rem; font-weight: 800; }
.pricing-footer-note p { color: var(--text-secondary); max-width: 720px; margin: 0 auto; }

/* ---------- Profile ---------- */
.profile-screen { max-width: 1180px; margin: 0 auto; }
.profile-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--border);
}
.profile-header .eyebrow { margin-bottom: 0.8rem; }
.profile-header h2 { font-size: 2.5rem; line-height: 1.08; margin-bottom: 0.5rem; font-weight: 800; letter-spacing: 0; }
.profile-header p { color: var(--text-secondary); max-width: 720px; }
.profile-status-card {
    background: var(--grad-ink);
    color: #fff;
    border-radius: var(--radius);
    padding: 1.4rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.profile-status-card::before { content: none; }
.profile-status-card span,
.profile-status-card strong,
.profile-status-card small { display: block; position: relative; }
.profile-status-card span {
    color: rgba(255,255,255,0.65);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.profile-status-card strong { font-size: 1.4rem; margin: 0.35rem 0; font-weight: 800; }
.profile-status-card small { color: rgba(255,255,255,0.72); }
.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 370px;
    gap: 1.25rem;
    align-items: start;
}
.profile-form,
.profile-panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-sm);
}
.section-title {
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 1.1rem;
}
.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
.form-row.compact { align-items: end; }
.profile-actions-group { display: flex; align-items: end; }
.profile-actions-group .btn { width: 100%; min-height: 56px; }
.subscription-summary { display: grid; gap: 0.7rem; }
.subscription-summary div {
    padding: 0.9rem 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}
.subscription-summary span,
.subscription-summary strong { display: block; }
.subscription-summary span {
    color: var(--text-tertiary);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    margin-bottom: 0.25rem;
}
.subscription-summary strong { color: var(--text-primary); overflow-wrap: anywhere; font-weight: 700; }
.profile-action-stack { display: grid; gap: 0.75rem; margin-top: 1.1rem; }
.profile-note { color: var(--text-secondary); font-size: 0.875rem; margin-top: 1rem; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 6, 23, 0.72);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
    padding: 1rem;
}
.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.75rem;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-xl);
    position: relative;
    animation: modalIn 0.32s var(--ease);
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
.auth-loading-overlay {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, var(--bg-secondary) 92%, transparent);
    backdrop-filter: blur(12px);
    border-radius: var(--radius-lg);
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: fadeIn 0.3s ease;
}
.auth-loading-overlay.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.auth-spinner {
    position: relative;
    width: 60px;
    height: 60px;
    margin-bottom: 1.75rem;
}
.auth-spinner::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--primary) 18%, transparent);
    border-top-color: var(--primary);
    animation: cleanSpin 1s linear infinite;
}
.auth-loading-text { color: var(--text-secondary); font-weight: 600; }
@keyframes cleanSpin { to { transform: rotate(360deg); } }
.modal h2 { margin-bottom: 0.5rem; font-size: 1.7rem; font-weight: 800; letter-spacing: 0; }
.form-group { margin-bottom: 1.35rem; }
.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.92rem;
}
.form-input {
    width: 100%;
    padding: 0.95rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.form-input::placeholder { color: var(--text-tertiary); }
.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: var(--ring);
}
/* Custom select arrow — avoids the native-control flicker/repaint on click */
select.form-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
    padding-right: 2.75rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23677387' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 14px;
}
[data-theme="dark"] select.form-input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2393a1bd' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
}
select.form-input::-ms-expand { display: none; }
.error-message {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    color: var(--danger);
    padding: 0.9rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    display: none;
}

/* ---------- Notification ---------- */
.notification {
    position: fixed;
    top: calc(var(--header-h) + 14px);
    right: 2rem;
    padding: 1rem 1.4rem;
    border-radius: var(--radius);
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    box-shadow: var(--shadow-xl);
    z-index: 3000;
    animation: slideIn 0.35s var(--ease);
    max-width: 360px;
}
@keyframes slideIn {
    from { transform: translateX(420px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
.loading-spinner {
    border: 3px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Mistakes ---------- */
.mistakes-dashboard { margin: 1rem 0; }
.mistakes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}
.mistakes-header h2 { font-size: 2.1rem; font-weight: 800; letter-spacing: 0; }
.chapter-weakness-chart {
    background: var(--bg-secondary);
    padding: 1.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}
.mistakes-list {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 1.25rem;
    border: 1px solid var(--border);
    max-height: 440px;
    overflow-y: auto;
    box-shadow: var(--shadow-sm);
}
.mistake-item {
    padding: 1.1rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--danger);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.mistake-item:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.mistake-question { font-weight: 700; margin-bottom: 0.5rem; color: var(--text-primary); }
.mistake-details { font-size: 0.875rem; color: var(--text-secondary); }
.mistake-chapter {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    font-size: 0.72rem;
    margin-top: 0.5rem;
    font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    /* Belt-and-braces: no stray element may hand the page a horizontal
       scrollbar (clip, unlike hidden, creates no new scroll container) */
    body { overflow-x: clip; }
    .sidebar {
        transform: translateX(-100%);
        /* visibility removes the closed sidebar from the tab order and the
           accessibility tree (a transform alone does not) */
        visibility: hidden;
        transition: transform 0.3s var(--ease), visibility 0.3s;
        z-index: 999;
        box-shadow: var(--shadow-xl);
    }
    .sidebar.mobile-open { transform: translateX(0); visibility: visible; }
    /* The menu FAB overlaps the sticky quiz controls' Next button - hide it
       during a quiz (End Quiz lives in the stat strip) */
    body.quiz-active .mobile-menu-toggle { display: none; }
    .main-container { padding-left: 0; }
    .content { padding: 1.25rem; min-width: 0; width: 100%; }
    .quiz-layout { grid-template-columns: 1fr; height: auto; }
    .quiz-sidebar {
        order: -1;
        flex-direction: row;
        gap: 0.75rem;
        overflow-x: auto;
        margin-bottom: 1rem;
    }
    .quiz-sidebar > * { flex: 0 0 auto; }
    /* End Quiz fits inside the horizontal strip instead of forcing a
       full-width row the user has to scroll sideways to discover */
    .quiz-sidebar > .btn-danger { width: auto !important; margin-top: 0 !important; }
    .floating-next { display: none; }
    .options-container { padding-right: 0; }
    /* Prev/Skip/Next ride above the thumb instead of below the feedback
       box - answering cadence no longer requires scrolling every question */
    .quiz-controls {
        position: sticky;
        bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
        z-index: 5;
        background: color-mix(in srgb, var(--bg-secondary) 92%, transparent);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 0.6rem;
        margin-top: 1.25rem;
        box-shadow: var(--shadow-xl);
    }
    .stats-overview-grid { grid-template-columns: repeat(2, 1fr); }
    .hero-shell { grid-template-columns: minmax(0, 1fr); min-height: auto; width: 100%; max-width: 100%; }
    .hero-panel { min-height: 360px; }
    .pricing-hero,
    .profile-header,
    .profile-grid { grid-template-columns: 1fr; }
    .pricing-grid { grid-template-columns: 1fr; }
    .pricing-card { min-height: auto; }
    .pricing-card.featured { transform: none; }
    .pricing-card.featured:hover { transform: translateY(-6px); }
    .pricing-card.premium { transform: none; }
    .pricing-card.premium:hover { transform: translateY(-6px); }
    /* Mobile order: expensive -> middle -> cheapest (Pass Confidence, Fast Track, Final Review) */
    .pricing-card:nth-child(1) { order: 3; }
    .pricing-card:nth-child(2) { order: 2; }
    .pricing-card:nth-child(3) { order: 1; }
}

@media (max-width: 768px) {
    .header { padding: 0 1rem; }
    .header-actions { gap: 0.5rem; }
    .theme-toggle { min-width: 56px; padding: 0 0.5rem; }
    #userEmail { max-width: 92px; }
    .header-actions .btn { padding: 0.7rem 0.85rem; }
    .logo { font-size: 1.2rem; }
    .brand-subtitle { display: none; }
    .brand-mark { width: 40px; height: 40px; }
    .hero h1 { font-size: 2.4rem; max-width: 100%; overflow-wrap: normal; }
    .hero-copy { padding: 2rem 0; min-width: 0; width: 100%; }
    .hero-reassurance {
        width: 100%;
        max-width: 100%;
        border-radius: var(--radius);
        line-height: 1.45;
        white-space: normal;
    }
    /* Keep the three proof stats side by side on phones: compact column
       cards (icon above text) instead of a stacked list. */
    .hero-proof { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
    .proof-item {
        flex-direction: column;
        text-align: center;
        gap: 0.4rem;
        padding: 0.65rem 0.4rem;
    }
    .proof-icon { width: 30px; height: 30px; border-radius: 9px; }
    .proof-icon svg { width: 16px; height: 16px; }
    .proof-text strong { font-size: 1.1rem; }
    .proof-text span { font-size: 0.7rem; }
    .hero-panel { padding: 1.75rem; width: 100%; max-width: 100%; }
    .product-preview { padding: 0; }
    .preview-topline { flex-wrap: wrap; }
    .exam-band { flex-direction: column; align-items: stretch; padding: 1.75rem; }
    .section-head h2 { font-size: 1.7rem; }
    .cta-band { padding: 2rem 1.5rem; }
    .cta-band h2 { font-size: 1.7rem; }
    .pricing-hero h2,
    .profile-header h2 { font-size: 2rem; }
    .pricing-assurance,
    .profile-status-card { width: 100%; }
    .form-row { grid-template-columns: 1fr; gap: 0; }
    .welcome-text { font-size: 1.5rem; }
    .progress-ring { width: 160px; height: 160px; }
    .progress-percentage { font-size: 2rem; }
    .progress-stats { flex-direction: column; gap: 1rem; }
    .charts-grid { grid-template-columns: 1fr; }
    .quiz-main { padding: 1.5rem; }
    .question-text { font-size: 1.2rem; margin-bottom: 1.5rem; }
    .option { font-size: 0.95rem; padding: 1rem 1.25rem; }
    .quiz-controls { flex-wrap: wrap; }
    .quiz-controls .btn { flex: 1; min-width: 100px; }
    /* Slimmer stat strip so the question starts higher on small phones */
    .quiz-sidebar .progress-card { padding: 0.8rem 1rem; }
    .quiz-sidebar .stats-grid { gap: 0.5rem; }
    .quiz-sidebar .stat-box { padding: 0.5rem 0.65rem; }
    .stats-overview-grid { grid-template-columns: 1fr; gap: 0.75rem; }
    .score-card { padding: 1.1rem; }
    .score-card-value { font-size: 2rem; }
    .form-input { font-size: 1rem; padding: 0.875rem; }
    .feature-grid { grid-template-columns: 1fr; }
    .mistakes-header { flex-direction: column; align-items: stretch; }
    .mistakes-header > div { flex-direction: column; width: 100%; display: flex; gap: 0.75rem; }
    .mistakes-header .btn { width: 100%; }
    .modal { padding: 2rem; }
}

@media (max-width: 480px) {
    .header { padding: 0 0.75rem; }
    .brand-lockup { gap: 0.55rem; flex-shrink: 1; min-width: 0; }
    .brand-mark { width: 38px; height: 38px; border-radius: 11px; }
    .logo { display: none; }
    /* Everything stays in the header's flex flow. The old absolute
       left: min(...) hacks pushed Sign In past the right edge on narrow
       phones, giving the whole page a horizontal-overflow shift. */
    .header-actions { gap: 0.4rem; flex-shrink: 0; }
    .theme-toggle {
        min-width: 44px;
        width: 44px;
        height: 40px;
        font-size: 0.78rem;
        padding: 0;
    }
    .header-actions .btn {
        display: inline-flex;
        width: auto;
        padding: 0.68rem 0.72rem;
        font-size: 0.84rem;
        white-space: nowrap;
    }
    #userEmail { display: none; }
    .user-badge { padding: 0.4rem 0.5rem; gap: 0; max-width: none; }
    .content {
        padding: 1rem;
        max-width: 100vw;
        /* clip, not hidden: hidden makes .content a scroll container and
           kills position:sticky for the quiz controls */
        overflow-x: clip;
    }
    .hero-copy,
    .hero h1,
    .hero-subtitle,
    .hero-reassurance,
    .hero-actions,
    .hero-proof,
    .product-preview,
    .compact-feature-grid {
        max-width: min(100%, 358px);
        /* centered: without auto margins the capped column hugs the left
           edge on 390-480px screens (ring, stats, CTAs all leaned left) */
        margin-left: auto;
        margin-right: auto;
    }
    .hero h1 { font-size: 2rem; }
    .hero-actions .btn { width: 100%; }
    .preview-question { font-size: 1rem; }
    .preview-options div { font-size: 0.88rem; }
    .pricing-hero h2,
    .profile-header h2 { font-size: 1.75rem; }
    .welcome-text { font-size: 1.25rem; }
    .progress-ring { width: 140px; height: 140px; }
    .progress-percentage { font-size: 1.75rem; }
    .question-text { font-size: 1.05rem; }
    .option { font-size: 0.9rem; padding: 0.9rem 1rem; }
    .quiz-controls { gap: 0.5rem; }
    .quiz-controls .btn { font-size: 0.875rem; padding: 0.65rem 1rem; }
    .chart-card { min-height: 220px; }
    .notification { right: 1rem; left: 1rem; max-width: none; }
    .pricing-price { font-size: 2.5rem; }
}

/* ---------- Mobile menu toggle ---------- */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    bottom: 22px;
    right: 22px;
    width: 50px;
    height: 50px;
    padding: 0;
    /* Drag-to-reposition: pointermove must win over page scrolling */
    touch-action: none;
    border-radius: var(--radius-pill);
    background: var(--grad-primary);
    color: #fff;
    border: none;
    box-shadow: var(--shadow-xl);
    z-index: 1001;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    cursor: pointer;
}
.mobile-menu-toggle .menu-bar {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
/* bars sit 7px apart center-to-center (2px bar + 5px gap) — the outer two
   travel exactly that far to cross into an X when the sidebar is open */
.mobile-menu-toggle.is-open .menu-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-toggle.is-open .menu-bar:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.is-open .menu-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 1024px) {
    .mobile-menu-toggle { display: flex; }
}

.hidden { display: none !important; }

/* ---------- Footer ---------- */
.footer {
    padding-left: var(--sidebar-w);
    margin-top: 5rem;
}
.footer-divider {
    height: 1px;
    max-width: 1280px;
    margin: 0 auto 2rem;
    /* border-strong, not border: the faded gradient was nearly invisible,
       especially on mobile. */
    background: linear-gradient(to right, transparent, var(--border-strong) 12%, var(--border-strong) 88%, transparent);
}
.footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}
.footer-links {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}
.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s ease;
}
.footer-link:hover { color: var(--primary); }
.footer-separator { color: var(--text-tertiary); font-size: 0.75rem; }
.footer-copyright { color: var(--text-tertiary); font-size: 0.8125rem; text-align: center; }

@media (max-width: 1024px) {
    .footer { padding-left: 0; }
}
@media (max-width: 768px) {
    .footer { margin-top: 4rem; }
    .footer-content { padding: 0 1rem 1.5rem; }
    .footer-links { flex-direction: column; gap: 0.5rem; }
    .footer-separator { display: none; }
}

/* ============================================================
   10/10 UPGRADE — FAQ, exam timer, trial upsell, footer columns,
   accessibility, and link-based nav items
   ============================================================ */

/* Skip link (visible only when focused) */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 2000;
    padding: 0.7rem 1.1rem;
    background: var(--primary);
    color: #fff;
    border-radius: 0 0 var(--radius-sm) 0;
    font-weight: 700;
    text-decoration: none;
}
.skip-link:focus {
    left: 0;
}

/* Anchor-based nav items render identically to the div ones */
a.nav-item {
    color: inherit;
    text-decoration: none;
}

/* Keyboard focus affordances */
.nav-item:focus-visible,
.option:focus-visible,
.feature-card[role="button"]:focus-visible,
.brand-lockup:focus-visible {
    outline: none;
    box-shadow: var(--ring);
}

/* ---------- FAQ ---------- */
.faq-list {
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.faq-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.faq-item[open] {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
}
.faq-item summary {
    cursor: pointer;
    list-style: none;
    padding: 1.05rem 3rem 1.05rem 1.3rem;
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    position: relative;
    user-select: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    transition: transform 0.2s var(--ease);
}
.faq-item[open] summary::after {
    content: '\2212';
}
.faq-item summary:focus-visible {
    outline: none;
    box-shadow: inset var(--ring);
    border-radius: var(--radius);
}
.faq-item p {
    padding: 0 1.3rem 1.2rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

/* ---------- Exam simulation ---------- */
.feature-card-exam {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    background:
        linear-gradient(165deg, color-mix(in srgb, var(--accent) 7%, var(--bg-secondary)) 0%, var(--bg-secondary) 60%);
}
.feature-card-exam .feature-icon {
    background: var(--grad-gold);
    color: #2a1d05;
}
.exam-timer-card {
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
}
.exam-timer {
    font-size: 1.9rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    text-align: center;
    padding: 0.4rem 0 0.2rem;
}
.exam-timer-card.timer-warning {
    border-color: var(--danger);
    animation: timerPulse 1.6s ease-in-out infinite;
}
.exam-timer-card.timer-warning .exam-timer { color: var(--danger); }
@keyframes timerPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgb(220 38 38 / 0); }
    50% { box-shadow: 0 0 0 5px rgb(220 38 38 / 0.14); }
}
@media (prefers-reduced-motion: reduce) {
    .exam-timer-card.timer-warning { animation: none; }
}

/* ---------- Free-trial results upsell ---------- */
.results-upsell {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin: 0 0 1.75rem;
    padding: 1.4rem 1.6rem;
    border-radius: var(--radius-lg);
    background: var(--grad-ink);
    color: #f3f6fc;
    box-shadow: var(--shadow-lg);
}
.results-upsell strong {
    display: block;
    font-size: 1.12rem;
    font-weight: 800;
}
.results-upsell span {
    display: block;
    margin-top: 0.3rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
    max-width: 520px;
}
.results-upsell .btn { flex: 0 0 auto; }
.results-upsell.hidden { display: none; }

/* ---------- Feedback explanations ---------- */
.feedback-explanation {
    display: block;
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    font-weight: 500;
    font-size: 0.92rem;
}

/* ---------- Footer columns ---------- */
.footer-columns {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 880px;
    margin-bottom: 1.5rem;
}
.footer-col {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    align-items: flex-start;
}
.footer-col-title {
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    /* Slight blue so the column headlines read distinctly from the links. */
    color: color-mix(in srgb, var(--primary) 60%, var(--text-tertiary));
    margin-bottom: 0.2rem;
}
.footer-disclaimer {
    color: var(--text-tertiary);
    font-size: 0.78rem;
    text-align: center;
    max-width: 720px;
    line-height: 1.6;
    margin-bottom: 0.25rem;
}
@media (max-width: 640px) {
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* ---------- Cookie consent banner ---------- */
.cookie-banner {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 1500;
    max-width: 400px;
    padding: 1.15rem 1.3rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}
.cookie-banner p {
    margin: 0 0 0.9rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.55;
}
.cookie-banner a { color: var(--primary); }
.cookie-actions {
    display: flex;
    gap: 0.6rem;
}
.cookie-actions .btn { flex: 1; }
@media (max-width: 640px) {
    .cookie-banner {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 4.4rem; /* clears the mobile Menu button */
        max-width: none;
    }
}

/* Feedback popup star rating */
.feedback-stars {
    text-align: center;
    margin-bottom: 1rem;
    user-select: none;
}
.feedback-stars span {
    cursor: pointer;
    font-size: 2.25rem;
    line-height: 1;
    padding: 0 0.2rem;
    color: var(--text-secondary, #64748b);
    opacity: 0.45;
    transition: color 0.15s ease, opacity 0.15s ease, transform 0.15s ease;
}
.feedback-stars span:hover {
    transform: scale(1.15);
}
.feedback-stars span.active {
    color: #fbbf24;
    opacity: 1;
}
/* Gold on white fails contrast - darker amber in light theme */
[data-theme="light"] .feedback-stars span.active { color: #b45309; }

/* Trial results / conversion modal */
.trial-score-circle {
    width: 96px;
    height: 96px;
    margin: 0 auto 1rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 800;
    color: #fbbf24;
    border: 4px solid #fbbf24;
    background: rgba(251, 191, 36, 0.08);
}
[data-theme="light"] .trial-score-circle {
    color: #92600a;
    border-color: #d99e0b;
    background: rgba(217, 158, 11, 0.10);
}


/* ---------- 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; }
}


/* ---------- Practice subnav (sidebar quick-starts) ---------- */
.nav-subitems {
    margin: 0.15rem 0 0.5rem 1.45rem;
    padding-left: 0.85rem;
    border-left: 2px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}
.nav-subitem {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s var(--ease);
}
.nav-subitem:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.flash-focus { outline: 3px solid var(--primary); outline-offset: 3px; }

/* ---------- Settings gear in the user badge ---------- */
.badge-gear {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    padding: 0;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    line-height: 1;
}
/* Explicit SVG size: the icon stays 18px on every device while the 44px
   button keeps the accessible touch target. */
.badge-gear svg { width: 18px; height: 18px; display: block; }
.badge-gear:hover { color: var(--text-primary); background: var(--bg-tertiary); }

/* ---------- Preferences (Profile) ---------- */
.preferences-card { margin-top: 1.5rem; }
.pref-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}
.pref-row:last-child { border-bottom: none; padding-bottom: 0; }
.pref-text { display: flex; flex-direction: column; gap: 0.2rem; }
.pref-text strong { font-size: 0.95rem; }
.pref-text span { color: var(--text-secondary); font-size: 0.82rem; max-width: 420px; }
.segmented {
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    padding: 3px;
    background: var(--bg-primary);
    flex-shrink: 0;
}
.segmented button {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.4rem 0.85rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
}
.segmented button.active { background: var(--grad-primary); color: #fff; }
.switch { position: relative; display: inline-flex; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.switch-track {
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    transition: background 0.2s var(--ease);
    position: relative;
    pointer-events: none;
}
.switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s var(--ease);
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track::after { transform: translateX(20px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 2px; }
@media (max-width: 768px) {
    .pref-row { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
}

/* ---------- Exam date nudge card (home) + profile exam details ---------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.exam-nudge {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.25rem 0;
    padding: 1rem 2.5rem 1rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.exam-nudge-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 220px;
    flex: 1;
}

.exam-nudge-body strong { color: var(--text-primary); font-size: 1.05rem; }
.exam-nudge-body span { color: var(--text-secondary); font-size: 0.9rem; }

.exam-nudge-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.exam-nudge-input { max-width: 180px; }

.exam-nudge-close {
    position: absolute;
    top: 0.5rem;
    right: 0.6rem;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 1.3rem;
    line-height: 1;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.exam-nudge-close:hover,
.exam-nudge-close:focus-visible {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    outline: none;
}

[data-theme="dark"] .exam-nudge { border-left-color: var(--primary-light); }

.exam-details-card { margin-top: 1.5rem; }

@media (max-width: 768px) {
    .exam-nudge { padding-right: 1.25rem; }
    .exam-nudge-actions { width: 100%; }
    .exam-nudge-input { flex: 1; max-width: none; }
}

/* ===================================
   CRO BATCH (2026-06-13): verified-review badge, pricing tax note,
   final-CTA action row
   =================================== */
/* "Verified review" pill with a check seal in the site's PRIMARY blue
   (not the gold accent). Absolutely positioned top-right of each card so
   all three card builders (template, testimonial_gen.py deploys,
   site_generator seeds) can emit it as a simple sibling of the stars. */
.testimonial-card { position: relative; }
.verified-badge {
    position: absolute;
    top: 1.4rem;
    right: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.32rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    border-radius: 999px;
    padding: 0.28rem 0.6rem;
    white-space: nowrap;
}
.verified-badge svg { flex: 0 0 auto; color: var(--primary); }

/* Pricing screen: taxes-included reassurance under the plans intro. */
.pricing-tax-note {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.85rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.pricing-tax-note .ti-icon { color: var(--success); }

/* Final CTA band: free-practice + view-plans pair, stacking on phones. */
.cta-band-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ===================================
   CRO BATCH 2 (2026-06-13): 13"-laptop pricing fit, quiz chrome polish,
   footer hidden during quizzes
   =================================== */
/* Short-viewport laptops (13" MacBook ≈ 700-790px usable height): compact
   the pricing screen so all three cards and their buy buttons fit the first
   screenful instead of towering past the fold. */
@media (min-width: 1025px) and (max-height: 920px) {
    .pricing-hero { margin-bottom: 0.5rem; }
    .pricing-hero h2 { font-size: 1.5rem; }
    .pricing-card { min-height: 0; padding: 1.3rem 1.35rem; }
    .pricing-price { font-size: 2.25rem; }
    .plan-fit { min-height: 0; font-size: 0.88rem; margin-bottom: 0.5rem; }
    .pricing-features { margin: 0.35rem 0 1rem; }
    .pricing-features li { padding: 0.42rem 0; font-size: 0.88rem; }
    .pricing-card.premium { transform: scale(1.03); }
    .pricing-card.premium:hover { transform: scale(1.03) translateY(-3px); }
}

/* The quiz is a focused workspace: the marketing footer underneath only
   collides with the sticky controls / End Quiz (it was painting THROUGH
   the quiz card). quiz-active is set in initQuiz and cleared by
   hideAllScreens on every navigation. */
body.quiz-active .footer { display: none; }

/* Quiz chrome polish: calmer, more academic session UI. The green/red
   answer feedback itself is deliberately untouched. */
.stat-box { border: 1px solid var(--border); }
.stat-box:hover { transform: none; }
.stats-grid .stat-value { font-size: 1.35rem; font-weight: 700; }
.stat-value.stat-correct { color: color-mix(in srgb, var(--success) 72%, var(--text-primary)); }
.stat-value.stat-wrong { color: color-mix(in srgb, var(--danger) 72%, var(--text-primary)); }
.stat-value.stat-skipped { color: color-mix(in srgb, var(--warning) 72%, var(--text-primary)); }
/* Skip: a low-emphasis action should not shout louder than Next. */
.quiz-controls .btn-warning {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}
.quiz-controls .btn-warning:hover {
    background: color-mix(in srgb, var(--warning) 12%, transparent);
    color: var(--text-primary);
    border-color: var(--warning);
}
/* End Quiz: quiet-danger outline; fills red only on hover. */
.quiz-sidebar .btn-danger {
    background: transparent;
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 45%, transparent);
}
.quiz-sidebar .btn-danger:hover { background: var(--danger); color: #fff; }
[data-theme="dark"] .quiz-sidebar .btn-danger:hover { color: #11182b; }

/* Sidebar + in-quiz upgrade CTAs (non-buyers only; gold = the buying color) */
.sidebar-analytics-cta {
    width: 100%;
    margin-top: 0.75rem;
    padding: 0.55rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.sidebar-analytics-cta:hover {
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    border-color: var(--accent);
}
.quiz-upgrade-cta {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
    text-align: left;
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.9rem;
    background: color-mix(in srgb, var(--accent) 9%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.quiz-upgrade-cta:hover {
    background: color-mix(in srgb, var(--accent) 16%, transparent);
    border-color: var(--accent);
}
.quiz-upgrade-cta .quiz-upgrade-title {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-primary);
}
.quiz-upgrade-cta .quiz-upgrade-sub {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent);
}
.quiz-upgrade-cta.hidden, .sidebar-analytics-cta.hidden { display: none; }

/* Analytics tab bar: one logical page (Progress | Review Mistakes) -
   tabs navigate between the two existing screens. */
.analytics-tabs {
    display: inline-flex;
    gap: 0.25rem;
    padding: 0.25rem;
    margin-bottom: 1.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
}
.analytics-tab {
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.875rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all 0.2s var(--ease);
}
.analytics-tab:hover { color: var(--text-primary); }
.analytics-tab.active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    cursor: default;
}

/* Post-trial diagnostic capsule (pricingScoreStrip contents) */
.capsule-row1 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.capsule-score {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
}
.capsule-headline { font-size: 0.95rem; }
.capsule-dots { display: inline-flex; gap: 0.2rem; }
.capsule-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 0.62rem;
    font-weight: 800;
}
.capsule-dot.dot-correct { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.capsule-dot.dot-wrong { background: color-mix(in srgb, var(--danger) 16%, transparent); color: var(--danger); }
.capsule-dot.dot-skipped { background: var(--bg-tertiary); color: var(--text-tertiary); }
.capsule-count { font-size: 0.82rem; color: var(--text-secondary); font-weight: 600; }
.capsule-row2 {
    margin-top: 0.45rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}
.capsule-weak { font-weight: 700; color: var(--text-primary); }
.capsule-review { white-space: nowrap; margin-left: 0.4rem; }
@media (max-width: 480px) {
    /* The first pricing card's top edge must stay visible on phones. */
    .capsule-dots { display: none; }
    .capsule-score { font-size: 1.2rem; }
}

/* Sticky return-to-plans bar on the trial review screen */
.trial-review-return {
    position: sticky;
    bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
    padding: 0.85rem 1.25rem;
    background: var(--bg-secondary);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    z-index: 5;
}
.trial-review-return.hidden { display: none; }
.trial-review-return span { font-weight: 600; color: var(--text-secondary); }

/* Recent Quiz History: clickable entries + answer-review modal */
.history-item-clickable { cursor: pointer; }
.history-item-clickable:hover { border-left-color: var(--accent) !important; }
.history-view-hint {
    margin-top: 0.4rem;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--primary);
}
.quiz-history-modal { max-width: 640px; width: min(92vw, 640px); }
.quiz-history-detail {
    max-height: min(58vh, 520px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.75rem;
}
.hist-q {
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--border);
    border-left-width: 3px;
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
}
.hist-q.hist-correct { border-left-color: var(--success); }
.hist-q.hist-wrong { border-left-color: var(--danger); }
.hist-q.hist-skipped { border-left-color: var(--warning); }
.hist-status {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-tertiary);
}
.hist-q.hist-correct .hist-status { color: var(--success); }
.hist-q.hist-wrong .hist-status { color: var(--danger); }
.hist-q-text { font-size: 0.9rem; margin: 0.3rem 0 0.4rem; }
.hist-answer { font-size: 0.82rem; color: var(--text-secondary); }
.hist-answer.hist-answer-correct { color: var(--success); font-weight: 600; }

/* ===================================
   MOBILE BATCH (2026-06-13): left-aligned trust rows, compact locked dash,
   tighter final CTA, header menu button (FAB retired), boxless gear,
   compact mobile pricing
   =================================== */
/* Buying color discipline: white button for free actions on dark bands -
   gold stays reserved for buy/upgrade. */
.btn-light {
    background: #ffffff;
    color: #0f1729;
    border: 1px solid rgba(15, 23, 41, 0.08);
}
.btn-light:hover { background: #f1f4fa; color: #0f1729; }

/* Header menu button: replaces the floating bubble; sits left of the theme
   toggle and only exists on sidebar-collapsed widths. */
.header-menu-btn {
    display: none;
    border: 1px solid var(--border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    min-width: 44px;
    min-height: 40px;
    padding: 0 0.8rem;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    align-items: center;
    gap: 0.45rem;
}
.header-menu-btn .menu-glyph {
    display: inline-flex;
    flex-direction: column;
    gap: 3px;
}
.header-menu-btn .menu-glyph span {
    width: 14px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.header-menu-btn.is-open .menu-glyph span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.header-menu-btn.is-open .menu-glyph span:nth-child(2) { opacity: 0; }
.header-menu-btn.is-open .menu-glyph span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
@media (max-width: 1024px) {
    .header-menu-btn { display: inline-flex; }
    /* The draggable bubble is retired in favor of the header button. */
    .mobile-menu-toggle { display: none !important; }
}

@media (max-width: 768px) {
    /* Trust rows read as a checklist: left-aligned, not centered. */
    .trust-strip { justify-content: flex-start; }
    .pricing-trust { justify-content: flex-start; }

    /* Locked analytics teaser: cap the scroll - the lock + copy gate, the
       blurred sample only needs to be a glimpse, not a full page. */
    .dashboard.is-locked .dash-body { max-height: 380px; overflow: hidden; }

    /* Final CTA: the gap from the section above was a screenful of nothing. */
    .cta-band { margin-top: 2rem; padding: 2rem 1.25rem; }

    /* Pricing cards: compact on phones too (mirrors the 13"-laptop fix). */
    .pricing-card { min-height: 0; padding: 1.3rem 1.25rem; }
    .pricing-price { font-size: 2.25rem; }
    .plan-fit { min-height: 0; }
    .pricing-features li { padding: 0.45rem 0; }
}

@media (max-width: 480px) {
    /* When only the gear is visible in the user badge, the pill border reads
       as a pointless box around it - let the gear stand alone. */
    .user-badge { background: transparent; border: none; padding: 0; box-shadow: none; }
}

/* Collapsible per-domain mistake groups (All Mistakes) */
.mistake-domain-group {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    background: var(--bg-secondary);
    overflow: hidden;
}
.mistake-domain-group > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    cursor: pointer;
    list-style: none;
    font-weight: 700;
}
.mistake-domain-group > summary::-webkit-details-marker { display: none; }
.mistake-domain-group > summary::after {
    content: '\25BE';
    color: var(--text-tertiary);
    transition: transform 0.2s var(--ease);
}
.mistake-domain-group[open] > summary::after { transform: rotate(180deg); }
.mistake-domain-group .mdg-count {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--danger);
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    border-radius: 999px;
    padding: 0.2rem 0.6rem;
    white-space: nowrap;
    margin-left: auto;
    margin-right: 0.5rem;
}
.mistake-domain-group .mistake-item { margin: 0 0.75rem 0.75rem; }

/* Quiet header text link (FAQ): clean text, no button chrome. */
.header-text-link {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.4rem 0.5rem;
}
.header-text-link:hover { color: var(--primary); }

/* Header guide nav: fills the empty header centre with static links to the
   top guide in each category (SEO). Takes the middle via flex:1 + centred. */
.header-guides {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.header-guide { position: relative; }
.header-guide-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.4rem 0.7rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
/* Caret hints the link opens a menu; flips when the guide is open. */
.header-guide-link::after {
    content: "";
    width: 0.38rem;
    height: 0.38rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg) translate(-1px, -2px);
    opacity: 0.55;
    transition: transform 0.15s var(--ease), opacity 0.15s var(--ease);
}
.header-guide:hover .header-guide-link,
.header-guide:focus-within .header-guide-link { color: var(--primary); background: var(--bg-secondary); }
.header-guide:hover .header-guide-link::after,
.header-guide:focus-within .header-guide-link::after { transform: rotate(225deg) translate(-1px, -1px); opacity: 1; }

/* Dropdown panel - hidden until the guide is hovered/focused. Filled at
   generation with up to _HEADER_GUIDE_MAX_ITEMS real article links plus a
   "Browse all" link, so the count stays tidy at any catalogue size. The
   panel is flush under the trigger (top:100%) so the hover area stays
   continuous (no dead gap that dismisses the menu). Desktop only - the
   whole guide-nav hides <=1024px, where the sidebar carries navigation. */
.header-guide-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 250px;
    max-width: 340px;
    margin-top: 0.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s var(--ease), visibility 0.15s;
    z-index: 1001;
}
/* Invisible bridge across the margin-top gap so the cursor can travel from
   the trigger to the panel without the menu closing mid-move. */
.header-guide-menu::before {
    content: "";
    position: absolute;
    top: -0.4rem;
    left: 0;
    right: 0;
    height: 0.4rem;
}
.header-guide:hover .header-guide-menu,
.header-guide:focus-within .header-guide-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.header-guide-item {
    display: block;
    padding: 0.5rem 0.7rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.35;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}
.header-guide-item:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.header-guide-all {
    color: var(--primary);
    font-weight: 700;
    border-top: 1px solid var(--border);
    margin-top: 0.2rem;
    padding-top: 0.6rem;
}
.header-guide-all:hover { color: var(--primary); background: var(--bg-tertiary); }
/* Hidden once the sidebar collapses - the sidebar then carries navigation. */
@media (max-width: 1024px) { .header-guides { display: none; } }
@media (max-width: 480px) {
    /* Phones: the header is tight - FAQ stays reachable in the footer. */
    .header-text-link { display: none; }
}

/* ===================================
   CRO BATCH 3 (2026-06-13): expandable Study Resources dropdown
   =================================== */
.nav-expandable { justify-content: flex-start; }
.nav-caret {
    margin-left: auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 0.6;
    transition: transform 0.2s var(--ease);
}
.nav-expandable.is-open .nav-caret { transform: rotate(180deg); }

/* Buy-now promo sticker on the pricing screen: a gold pill (sticker, not a
   full-width bar) with a dark "Buy now" tag + the tax-covered benefit.
   Urgency via the offer framing - no gimmicky countdown. */

/* Analytics upsell popup perk list (checkmark bullets, no default markers) */
.upsell-perks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.upsell-perks li {
    position: relative;
    padding-left: 1.6rem;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.45;
}
.upsell-perks li::before {
    content: '\2713';
    position: absolute;
    left: 0;
    top: 0;
    font-weight: 800;
    color: var(--accent);
}
