/**
 * E3 Learning Quiz System V3 - Comprehensive Styles
 * Inspired by Pocket Prep's clean, professional design
 * 
 * Color scheme adapts V2 dark theme with warm accents
 */

:root {
    /* Base colors - dark theme */
    --quiz-bg-primary: #0f172a;
    --quiz-bg-secondary: #1e293b;
    --quiz-bg-elevated: #283548;
    --quiz-bg-card: #1e293b;
    
    /* Accent colors - warm palette like Pocket Prep */
    --quiz-accent-gold: #f59e0b;
    --quiz-accent-orange: #fb923c;
    --quiz-accent-teal: #14b8a6;
    --quiz-accent-blue: #3b82f6;
    --quiz-accent-purple: #8b5cf6;
    --quiz-accent-green: #10b981;
    --quiz-accent-red: #ef4444;
    --quiz-accent-cyan: #06b6d4;
    
    /* Text colors */
    --quiz-text-primary: #f1f5f9;
    --quiz-text-secondary: #e2e8f0;
    --quiz-text-muted: #94a3b8;
    --quiz-text-dim: #64748b;
    
    /* Border colors */
    --quiz-border: #334155;
    --quiz-border-subtle: rgba(255, 255, 255, 0.1);
    
    /* Premium badge */
    --quiz-premium-bg: #fef3c7;
    --quiz-premium-text: #92400e;
    
    /* Status colors */
    --quiz-correct: #10b981;
    --quiz-incorrect: #ef4444;
    --quiz-flagged: #f59e0b;
    --quiz-unanswered: #94a3b8;
}

/* ============================================================================
   LAYOUT & STRUCTURE
   ============================================================================ */

/* Base reset & body styling for quiz-only pages (no education-v2.css) */
body.quiz-page {
    margin: 0;
    padding: 0;
    background: var(--quiz-bg-primary);
    color: var(--quiz-text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

body.quiz-page *,
body.quiz-page *::before,
body.quiz-page *::after {
    box-sizing: border-box;
}

/* Hide scrollbar for immersive quiz sessions */
body.quiz-page.quiz-session-page {
    scrollbar-width: none; /* Firefox */
}
body.quiz-page.quiz-session-page::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.quiz-app {
    min-height: 100vh;
    background: var(--quiz-bg-primary);
    color: var(--quiz-text-secondary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

.quiz-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.quiz-container--narrow {
    max-width: 900px;
}

/* ============================================================================
   TOP NAVIGATION BAR
   ============================================================================ */

.quiz-topnav {
    background: var(--quiz-bg-secondary);
    border-bottom: 1px solid var(--quiz-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.quiz-topnav__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.quiz-topnav__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--quiz-text-primary);
}

.quiz-topnav__logo {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--quiz-accent-gold), var(--quiz-accent-orange));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-topnav__logo svg {
    width: 22px;
    height: 22px;
    color: white;
}

.quiz-topnav__title {
    font-weight: 700;
    font-size: 1rem;
}

.quiz-topnav__subtitle {
    font-size: 0.75rem;
    color: var(--quiz-text-muted);
}

/* Main navigation tabs */
.quiz-topnav__tabs {
    display: flex;
    gap: 0.5rem;
}

.quiz-topnav__tab {
    padding: 0.75rem 1.25rem;
    color: var(--quiz-text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    border-radius: 8px;
    transition: all 0.2s;
    position: relative;
}

.quiz-topnav__tab:hover {
    color: var(--quiz-text-primary);
    background: var(--quiz-bg-elevated);
}

.quiz-topnav__tab--active {
    color: var(--quiz-text-primary);
}

.quiz-topnav__tab--active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: var(--quiz-accent-gold);
    border-radius: 3px 3px 0 0;
}

/* Right side actions */
.quiz-topnav__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.quiz-topnav__upgrade {
    background: var(--quiz-accent-teal);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
}

.quiz-topnav__upgrade:hover {
    background: #0d9488;
    transform: translateY(-1px);
}

.quiz-topnav__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--quiz-text-primary);
    font-weight: 500;
    cursor: pointer;
    position: relative;
}

.quiz-topnav__avatar {
    width: 36px;
    height: 36px;
    background: var(--quiz-accent-gold);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    font-size: 0.875rem;
}

/* User Dropdown Menu */
.quiz-topnav__dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--quiz-bg-secondary, #1e293b);
    border: 1px solid var(--quiz-border, rgba(255,255,255,0.1));
    border-radius: 12px;
    min-width: 220px;
    padding: 0.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    z-index: 100;
}

.quiz-topnav__dropdown--open {
    display: block;
    animation: quizDropdownIn 0.15s ease;
}

@keyframes quizDropdownIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.quiz-topnav__dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    color: var(--quiz-text-secondary, #cbd5e1);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.15s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.quiz-topnav__dropdown-item i,
.quiz-topnav__dropdown-item svg {
    width: 18px;
    height: 18px;
    opacity: 0.7;
}

.quiz-topnav__dropdown-item:hover {
    background: rgba(255,255,255,0.06);
    color: var(--quiz-text-primary, #f1f5f9);
}

.quiz-topnav__dropdown-divider {
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
    margin: 0.35rem 0;
}

.quiz-topnav__dropdown-item--danger {
    color: #f87171;
}
.quiz-topnav__dropdown-item--danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.quiz-topnav__dropdown-item--back {
    color: var(--quiz-text-muted, #94a3b8);
}
.quiz-topnav__dropdown-item--back:hover {
    color: var(--quiz-text-primary, #f1f5f9);
}

/* Responsive topnav - hide tabs on mobile (use bottom nav instead) */
@media (max-width: 900px) {
    .quiz-topnav__tabs {
        display: none;
    }
    
    .quiz-topnav__upgrade {
        display: none;
    }
    
    .quiz-topnav__user span,
    .quiz-topnav__user svg {
        display: none;
    }
}

/* Bottom mobile navigation (shared across quiz pages) */
.quiz-mobile-nav {
    display: none;
}

@media (max-width: 900px) {
    .quiz-mobile-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        height: calc(56px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        background: linear-gradient(180deg, #131b2e 0%, #0f172a 100%);
        border-top: 1px solid rgba(59, 130, 246, 0.2);
        padding: 4px 4px;
        padding-bottom: max(4px, env(safe-area-inset-bottom));
        z-index: 10000;
        align-items: stretch;
        gap: 0;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
    }

    .quiz-mobile-nav__item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        padding: 6px 4px 4px;
        color: rgba(148, 163, 184, 0.8);
        text-decoration: none;
        font-size: 0.625rem;
        font-weight: 500;
        letter-spacing: 0.02em;
        border-radius: 8px;
        transition: color 0.2s ease, background 0.2s ease;
        -webkit-tap-highlight-color: transparent;
        position: relative;
    }

    .quiz-mobile-nav__item svg,
    .quiz-mobile-nav__item i {
        width: 22px;
        height: 22px;
        flex-shrink: 0;
        stroke-width: 1.75;
    }

    .quiz-mobile-nav__item:active {
        background: rgba(59, 130, 246, 0.1);
    }

    .quiz-mobile-nav__item--active {
        color: #60a5fa;
    }

    .quiz-mobile-nav__item--active::after {
        content: '';
        position: absolute;
        top: 0;
        left: 25%;
        right: 25%;
        height: 2px;
        background: #3b82f6;
        border-radius: 1px;
    }

    /* Body padding for quiz pages so content isn't hidden behind fixed mobile nav */
    body.quiz-page {
        padding-bottom: 70px;
    }
}

/* ============================================================================
   STUDY PAGE - HERO/GREETING
   ============================================================================ */

.study-hero {
    background: var(--quiz-bg-secondary);
    border-bottom: 1px solid var(--quiz-border);
    padding: 1.5rem 0;
    position: relative;
}

.study-hero__content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: grid;
    grid-template-columns: minmax(200px, 280px) minmax(280px, 1fr) minmax(280px, 380px);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1100px) {
    .study-hero__content {
        grid-template-columns: 1fr 1fr;
    }
    
    .study-hero__main {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .study-hero__content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.study-hero__greeting h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--quiz-text-primary);
    margin-bottom: 0.25rem;
}

.study-hero__greeting p {
    color: var(--quiz-text-muted);
    font-size: 0.9rem;
}

/* ============================================================================
   CALENDAR WIDGET
   ============================================================================ */

.study-calendar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.study-calendar__streak strong {
    color: var(--quiz-text-primary);
}

.study-calendar__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
}

.study-calendar__day-label {
    font-size: 0.75rem;
    color: var(--quiz-text-dim);
    text-align: center;
    padding: 0.5rem;
    font-weight: 500;
}

.study-calendar__day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    color: var(--quiz-text-muted);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.study-calendar__day:hover {
    background: var(--quiz-bg-elevated);
}

.study-calendar__day--today {
    text-decoration: underline;
    font-weight: 600;
    color: var(--quiz-text-primary);
}

.study-calendar__day--studied {
    background: var(--quiz-accent-teal);
    color: white;
    font-weight: 600;
}

.study-calendar__day--studied:hover {
    background: #0d9488;
}

.study-calendar__legend {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--quiz-border-subtle);
}

.study-calendar__legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: var(--quiz-text-muted);
}

.study-calendar__legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--quiz-accent-teal);
}

/* ============================================================================
   QUESTION OF THE DAY WIDGET
   ============================================================================ */

.qotd-widget {
    background: var(--quiz-bg-card);
    border: 1px solid var(--quiz-border);
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
}

.qotd-widget__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    color: var(--quiz-text-muted);
    font-size: 0.875rem;
}

.qotd-widget__header svg {
    width: 20px;
    height: 20px;
}

.qotd-widget__question {
    font-size: 1rem;
    color: var(--quiz-text-primary);
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.qotd-widget__options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.qotd-widget__option {
    padding: 0.875rem 1rem;
    background: var(--quiz-bg-elevated);
    border: 1px solid var(--quiz-border);
    border-radius: 10px;
    color: var(--quiz-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9375rem;
}

.qotd-widget__option:hover {
    border-color: var(--quiz-accent-gold);
    background: rgba(245, 158, 11, 0.1);
}

.qotd-widget__option--selected {
    border-color: var(--quiz-accent-gold);
    background: rgba(245, 158, 11, 0.15);
}

.qotd-widget__option--correct {
    border-color: var(--quiz-correct);
    background: rgba(16, 185, 129, 0.15);
}

.qotd-widget__option--incorrect {
    border-color: var(--quiz-incorrect);
    background: rgba(239, 68, 68, 0.15);
}

.qotd-widget__submit {
    margin-top: 1rem;
    width: 100%;
    padding: 0.875rem;
    background: var(--quiz-accent-orange);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.qotd-widget__submit:hover {
    background: #ea580c;
}

.qotd-widget__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qotd-widget__footer {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--quiz-border-subtle);
}

.qotd-widget__action {
    background: none;
    border: none;
    color: var(--quiz-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.qotd-widget__action:hover {
    background: var(--quiz-bg-elevated);
    color: var(--quiz-text-primary);
}

.qotd-widget__action svg {
    width: 22px;
    height: 22px;
}

/* ============================================================================
   IN-PROGRESS QUIZZES SECTION
   ============================================================================ */

.in-progress-section {
    padding: 1.5rem 0 0;
}

.in-progress-section__header {
    margin-bottom: 1rem;
}

.in-progress-section__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--quiz-text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.in-progress-section__title svg {
    width: 20px;
    height: 20px;
    color: var(--quiz-accent-purple);
}

.in-progress-section__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.in-progress-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: var(--quiz-bg-secondary);
    border: 1px solid var(--quiz-accent-purple);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
}

.in-progress-card:hover {
    background: var(--quiz-bg-elevated);
    transform: translateY(-1px);
}

.in-progress-card__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--quiz-accent-purple);
}

.in-progress-card__icon svg {
    width: 20px;
    height: 20px;
}

.in-progress-card__info {
    flex: 1;
    min-width: 0;
}

.in-progress-card__title {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--quiz-text-primary);
    margin-bottom: 0.25rem;
}

.in-progress-card__meta {
    font-size: 0.8125rem;
    color: var(--quiz-text-muted);
}

.in-progress-card__action {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--quiz-accent-purple);
    white-space: nowrap;
}

/* ============================================================================
   QUIZ MODES SECTION
   ============================================================================ */

.quiz-modes {
    padding: 2rem 0 3rem;
}

.quiz-modes__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.quiz-modes__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--quiz-text-primary);
}

.quiz-modes__settings {
    color: var(--quiz-accent-blue);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.quiz-modes__settings:hover {
    text-decoration: underline;
}

.quiz-modes__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

/* Quiz Mode Card */
.quiz-mode-card {
    background: var(--quiz-bg-card);
    border: 1px solid var(--quiz-border);
    border-radius: 14px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    text-decoration: none;
    display: block;
}

.quiz-mode-card:hover {
    border-color: var(--quiz-accent-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.quiz-mode-card--premium {
    opacity: 0.85;
}

.quiz-mode-card__badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: var(--quiz-premium-bg);
    color: var(--quiz-premium-text);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.quiz-mode-card__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    background: var(--quiz-bg-elevated);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-mode-card__icon svg {
    width: 28px;
    height: 28px;
}

.quiz-mode-card__icon--blue svg { color: var(--quiz-accent-blue); }
.quiz-mode-card__icon--gold svg { color: var(--quiz-accent-gold); }
.quiz-mode-card__icon--teal svg { color: var(--quiz-accent-teal); }
.quiz-mode-card__icon--purple svg { color: var(--quiz-accent-purple); }
.quiz-mode-card__icon--red svg { color: var(--quiz-accent-red); }
.quiz-mode-card__icon--green svg { color: var(--quiz-accent-green); }
.quiz-mode-card__icon--orange svg { color: var(--quiz-accent-orange); }

.quiz-mode-card__title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--quiz-text-primary);
}

/* ============================================================================
   STATS PAGE
   ============================================================================ */

.stats-hero {
    background: linear-gradient(180deg, var(--quiz-bg-secondary) 0%, var(--quiz-bg-primary) 100%);
    padding: 3rem 0;
    text-align: center;
    position: relative;
}

.stats-hero::before {
    content: '';
    position: absolute;
    top: -50px;
    right: 0;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

/* Score Ring */
.score-ring {
    width: 180px;
    height: 180px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.score-ring__svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.score-ring__bg {
    fill: none;
    stroke: var(--quiz-bg-elevated);
    stroke-width: 14;
}

.score-ring__fill {
    fill: none;
    stroke: var(--quiz-accent-gold);
    stroke-width: 14;
    stroke-linecap: round;
    stroke-dasharray: 502.65;
    stroke-dashoffset: 502.65;
    transition: stroke-dashoffset 1.5s ease-out;
}

.score-ring__value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-ring__percent {
    font-size: 3rem;
    font-weight: 800;
    color: var(--quiz-text-primary);
    line-height: 1;
}

.score-ring__label {
    font-size: 0.75rem;
    color: var(--quiz-text-muted);
    margin-top: 0.25rem;
}

/* Stats Row */
.stats-row {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stats-row__item {
    text-align: center;
}

.stats-row__value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--quiz-text-primary);
}

.stats-row__label {
    font-size: 0.75rem;
    color: var(--quiz-text-muted);
    margin-top: 0.25rem;
}

/* Subject Insights */
.subject-insights {
    background: var(--quiz-bg-card);
    border: 1px solid var(--quiz-border);
    border-radius: 16px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.subject-insights__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.subject-insights__title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--quiz-text-primary);
}

.subject-insights__title svg {
    width: 20px;
    height: 20px;
    color: var(--quiz-accent-blue);
}

.subject-insights__sort {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--quiz-text-muted);
    font-size: 0.8125rem;
    background: none;
    border: none;
    cursor: pointer;
}

.subject-insights__sort svg {
    width: 14px;
    height: 14px;
}

.subject-insights__list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.subject-item {
    display: grid;
    grid-template-columns: 1fr auto auto 120px;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--quiz-border-subtle);
}

.subject-item:last-child {
    border-bottom: none;
}

.subject-item__name {
    font-size: 0.9375rem;
    color: var(--quiz-text-primary);
}

.subject-item__ratio {
    font-size: 0.8125rem;
    color: var(--quiz-text-muted);
}

.subject-item__percent {
    font-size: 1rem;
    font-weight: 700;
    color: var(--quiz-text-primary);
    min-width: 3rem;
    text-align: right;
}

.subject-item__bar {
    height: 10px;
    background: var(--quiz-bg-elevated);
    border-radius: 5px;
    overflow: hidden;
}

.subject-item__bar-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease-out;
}

.subject-item__bar-fill--low { background: var(--quiz-incorrect); }
.subject-item__bar-fill--medium { background: var(--quiz-accent-gold); }
.subject-item__bar-fill--high { background: var(--quiz-correct); }

.subject-insights__more {
    margin-top: 1rem;
    color: var(--quiz-accent-blue);
    font-size: 0.875rem;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.subject-insights__more:hover {
    text-decoration: underline;
}

/* Quiz Scores & Activity Grid */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

.stats-card {
    background: var(--quiz-bg-card);
    border: 1px solid var(--quiz-border);
    border-radius: 16px;
    padding: 1.5rem;
}

.stats-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.stats-card__title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--quiz-text-primary);
}

.stats-card__title svg {
    width: 18px;
    height: 18px;
    color: var(--quiz-accent-purple);
}

.stats-card__filter {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--quiz-accent-blue);
    font-size: 0.8125rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* Quiz activity list */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.activity-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background: var(--quiz-bg-elevated);
    border-radius: 10px;
}

.activity-item__info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.activity-item__icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.activity-item__icon--quiz {
    background: rgba(59, 130, 246, 0.2);
    color: var(--quiz-accent-blue);
}

.activity-item__icon--missed {
    background: rgba(239, 68, 68, 0.2);
    color: var(--quiz-incorrect);
}

.activity-item__name {
    font-size: 0.875rem;
    color: var(--quiz-text-primary);
}

.activity-item__date {
    font-size: 0.75rem;
    color: var(--quiz-text-muted);
}

.activity-item__score {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--quiz-text-primary);
}

/* ============================================================================
   REVIEW PAGE
   ============================================================================ */

.review-page {
    padding: 2rem 0;
}

.review-header {
    margin-bottom: 2rem;
}

.review-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--quiz-text-primary);
    margin-bottom: 1.5rem;
}

/* Filter Tabs */
.review-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--quiz-border);
}

.review-tab {
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--quiz-text-muted);
    font-size: 0.9375rem;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.review-tab:hover {
    color: var(--quiz-text-primary);
}

.review-tab--active {
    color: var(--quiz-text-primary);
    font-weight: 600;
}

.review-tab--active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--quiz-accent-blue);
}

.review-tab__count {
    font-weight: 700;
    color: var(--quiz-text-primary);
    margin-left: 0.25rem;
}

/* Search & Filter Bar */
.review-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.review-search {
    flex: 1;
    position: relative;
}

.review-search__input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    background: var(--quiz-bg-card);
    border: 1px solid var(--quiz-border);
    border-radius: 10px;
    color: var(--quiz-text-primary);
    font-size: 0.9375rem;
}

.review-search__input::placeholder {
    color: var(--quiz-text-muted);
}

.review-search__input:focus {
    outline: none;
    border-color: var(--quiz-accent-blue);
}

.review-search__icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--quiz-text-muted);
}

.review-filter-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--quiz-bg-card);
    border: 1px solid var(--quiz-border);
    border-radius: 10px;
    color: var(--quiz-accent-blue);
    font-size: 0.875rem;
    cursor: pointer;
}

.review-filter-btn:hover {
    border-color: var(--quiz-accent-blue);
}

.review-filter-btn svg {
    width: 16px;
    height: 16px;
}

/* Question List */
.question-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.question-item {
    background: var(--quiz-bg-card);
    border: 1px solid var(--quiz-border);
    border-radius: 12px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.2s;
}

.question-item:hover {
    border-color: var(--quiz-accent-blue);
}

.question-item__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.question-item__category {
    font-size: 0.75rem;
    color: var(--quiz-accent-purple);
    font-weight: 500;
}

.question-item__status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.question-item__status svg {
    width: 18px;
    height: 18px;
}

.question-item__status--correct svg {
    color: var(--quiz-correct);
}

.question-item__status--incorrect svg {
    color: var(--quiz-incorrect);
}

.question-item__status--flagged svg {
    color: var(--quiz-flagged);
}

.question-item__lock {
    color: var(--quiz-text-dim);
}

.question-item__lock svg {
    width: 14px;
    height: 14px;
}

.question-item__text {
    font-size: 0.9375rem;
    color: var(--quiz-text-primary);
    line-height: 1.5;
}

/* ============================================================================
   EXAM SESSION INTERFACE
   ============================================================================ */

.exam-header {
    background: var(--quiz-bg-secondary);
    border-bottom: 1px solid var(--quiz-border);
    padding: 0.75rem 1.5rem;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}

.exam-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.exam-header__brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.exam-header__logo {
    width: 32px;
    height: 32px;
    background: var(--quiz-accent-gold);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.exam-header__logo svg {
    width: 18px;
    height: 18px;
    color: white;
}

.exam-header__title {
    font-weight: 600;
    color: var(--quiz-text-primary);
    font-size: 0.9375rem;
}

.exam-header__subtitle {
    font-size: 0.75rem;
    color: var(--quiz-text-muted);
}

/* Progress Bar */
.exam-progress {
    flex: 1;
    max-width: 600px;
    height: 6px;
    background: var(--quiz-bg-elevated);
    border-radius: 3px;
    margin: 0 2rem;
    position: relative;
    overflow: hidden;
}

.exam-progress__fill {
    height: 100%;
    background: var(--quiz-accent-gold);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.exam-progress__marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--quiz-accent-gold);
    border: 2px solid var(--quiz-bg-secondary);
    border-radius: 50%;
}

/* Timer */
.exam-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--quiz-text-muted);
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.9375rem;
}

.exam-timer svg {
    width: 18px;
    height: 18px;
}

.exam-timer--warning {
    color: var(--quiz-accent-red);
}

.exam-exit {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--quiz-border);
    border-radius: 8px;
    color: var(--quiz-text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.exam-exit:hover {
    border-color: var(--quiz-accent-red);
    color: var(--quiz-accent-red);
}

/* Question Content */
.exam-content {
    max-width: 700px;
    margin: 100px auto 100px;
    padding: 1.5rem 1.25rem;
}

.exam-question-number {
    text-align: center;
    color: var(--quiz-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.exam-question-number svg {
    width: 20px;
    height: 20px;
    margin-bottom: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.exam-question-text {
    font-size: 1.125rem;
    color: var(--quiz-text-primary);
    line-height: 1.65;
    text-align: center;
    margin-bottom: 1.75rem;
}

/* Answer Options */
.exam-options {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    max-width: 500px;
    margin: 0 auto;
}

.exam-option {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1.125rem 1.25rem;
    background: var(--quiz-bg-card);
    border: 1px solid var(--quiz-border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 60px;
}

.exam-option:hover {
    border-color: var(--quiz-accent-gold);
}

.exam-option--selected {
    border-color: var(--quiz-accent-gold);
    background: rgba(245, 158, 11, 0.1);
}

.exam-option__letter {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--quiz-bg-elevated);
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--quiz-text-muted);
    flex-shrink: 0;
}

.exam-option--selected .exam-option__letter {
    background: var(--quiz-accent-gold);
    color: white;
}

.exam-option__text {
    font-size: 0.9375rem;
    color: var(--quiz-text-secondary);
    line-height: 1.65;
    padding-top: 0.125rem;
}

/* Next Button */
.exam-submit {
    text-align: center;
    margin-top: 2rem;
}

.exam-submit__btn {
    padding: 0.875rem 2rem;
    background: var(--quiz-accent-blue);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.exam-submit__btn:hover {
    background: #2563eb;
}

.exam-submit__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Bottom Toolbar */
.exam-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--quiz-bg-secondary);
    border-top: 1px solid var(--quiz-border);
    padding: 0.75rem 1.5rem;
}

.exam-toolbar__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.exam-toolbar__left,
.exam-toolbar__center,
.exam-toolbar__right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.exam-toolbar__btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--quiz-text-muted);
    font-size: 0.875rem;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.exam-toolbar__btn:hover {
    background: var(--quiz-bg-elevated);
    color: var(--quiz-text-primary);
}

.exam-toolbar__btn svg {
    width: 18px;
    height: 18px;
}

.exam-toolbar__nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.exam-toolbar__nav-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--quiz-bg-elevated);
    border: none;
    border-radius: 8px;
    color: var(--quiz-text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.exam-toolbar__nav-btn:hover {
    color: var(--quiz-text-primary);
}

.exam-toolbar__nav-btn svg {
    width: 20px;
    height: 20px;
}

.exam-toolbar__flag {
    color: var(--quiz-text-muted);
}

.exam-toolbar__flag--active {
    color: var(--quiz-flagged);
}

/* ============================================================================
   MODALS
   ============================================================================ */

.quiz-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.quiz-modal-overlay--visible {
    opacity: 1;
    visibility: visible;
}

.quiz-modal {
    background: var(--quiz-bg-card);
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

.quiz-modal__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--quiz-text-muted);
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}

.quiz-modal__close:hover {
    background: var(--quiz-bg-elevated);
    color: var(--quiz-text-primary);
}

.quiz-modal__close svg {
    width: 20px;
    height: 20px;
}

.quiz-modal__header {
    padding: 2rem 2rem 1rem;
    text-align: center;
}

.quiz-modal__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: var(--quiz-bg-elevated);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quiz-modal__icon svg {
    width: 24px;
    height: 24px;
    color: var(--quiz-accent-blue);
}

.quiz-modal__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--quiz-text-primary);
    margin-bottom: 0.25rem;
}

.quiz-modal__subtitle {
    font-size: 0.875rem;
    color: var(--quiz-text-muted);
}

.quiz-modal__content {
    padding: 0 2rem 2rem;
}

.quiz-modal__info {
    background: var(--quiz-bg-elevated);
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.quiz-modal__info-item {
    padding: 0.5rem 0;
    color: var(--quiz-text-secondary);
    font-size: 0.9375rem;
}

.quiz-modal__info-item:not(:last-child) {
    border-bottom: 1px solid var(--quiz-border-subtle);
}

.quiz-modal__info-item strong {
    color: var(--quiz-text-primary);
}

/* Level indicator in modal */
.quiz-modal__level-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.quiz-modal__level-label {
    color: var(--quiz-text-muted);
    font-size: 0.875rem;
}

.quiz-modal__level-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: #a78bfa;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
}

.quiz-modal__level-badge svg,
.quiz-modal__level-badge i {
    width: 14px;
    height: 14px;
}

.quiz-modal__level-badge.level-emtb {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.quiz-modal__level-badge.level-paramedic {
    background: rgba(59, 130, 246, 0.15);
    border-color: rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.quiz-modal__level-badge.level-rn {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.3);
    color: #c084fc;
}

.quiz-modal__level-badge.level-fpc-cfrn {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.quiz-modal__description {
    color: var(--quiz-text-muted);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.quiz-modal__warning {
    color: var(--quiz-accent-orange);
    font-size: 0.8125rem;
    margin-top: 1rem;
}

.quiz-modal__footer {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 1rem 2rem 2rem;
}

.quiz-modal__btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quiz-modal__btn--secondary {
    background: transparent;
    border: none;
    color: var(--quiz-accent-blue);
}

.quiz-modal__btn--secondary:hover {
    text-decoration: underline;
}

.quiz-modal__btn--primary {
    background: var(--quiz-accent-blue);
    border: none;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-modal__btn--primary:hover {
    background: #2563eb;
}

.quiz-modal__btn--primary svg {
    width: 16px;
    height: 16px;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 900px) {
    .study-hero__content {
        grid-template-columns: 1fr;
    }
    
    .qotd-widget {
        order: -1;
    }
    
    .quiz-topnav__tabs {
        display: none;
    }

    /* Ensure content isn't hidden behind fixed mobile bottom nav */
    .quiz-app {
        padding-bottom: 70px;
    }
}

@media (max-width: 768px) {
    .quiz-topnav__upgrade {
        display: none;
    }
    
    .quiz-topnav__user span {
        display: none;
    }
    
    .stats-row {
        gap: 1.5rem;
    }
    
    .subject-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .subject-item__bar {
        width: 100%;
    }

    /* Exam session mobile — header */
    .exam-header {
        padding: 0.5rem 1rem;
    }

    .exam-header__inner {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .exam-header__brand {
        gap: 0.5rem;
    }

    .exam-header__logo {
        width: 28px;
        height: 28px;
    }

    .exam-header__title {
        font-size: 0.8125rem;
    }

    .exam-header__subtitle {
        display: none;
    }

    .exam-progress {
        margin: 0 0.75rem;
        max-width: none;
        flex: 1;
        order: 3;
        width: 100%;
    }

    .exam-timer {
        font-size: 0.8125rem;
    }

    .exam-exit {
        padding: 0.375rem 0.75rem;
        font-size: 0.8125rem;
    }

    /* Exam session mobile — content */
    .exam-content {
        margin: 80px auto 80px;
        padding: 1.25rem 1rem;
    }

    .exam-question-text {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }

    .exam-option {
        padding: 1rem 1rem;
        gap: 0.75rem;
        min-height: 56px;
    }

    .exam-option__text {
        font-size: 0.875rem;
        line-height: 1.6;
    }

    /* Exam session mobile — toolbar */
    .exam-toolbar {
        padding: 0.5rem 0.75rem;
    }

    .exam-toolbar__inner {
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: center;
    }

    .exam-toolbar__left,
    .exam-toolbar__center,
    .exam-toolbar__right {
        gap: 0.5rem;
    }

    .exam-toolbar__btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.8125rem;
    }

    .exam-toolbar__btn span {
        display: none;
    }

    .exam-toolbar__nav-btn {
        width: 36px;
        height: 36px;
    }

    /* Quiz container tighter on mobile */
    .quiz-container {
        padding: 1.25rem 1rem;
    }

    /* Question list items */
    .question-item {
        padding: 1rem;
    }

    .question-item__text {
        font-size: 0.875rem;
    }

    /* Review search */
    .review-search__input {
        font-size: 1rem; /* Prevent iOS zoom */
    }

    /* Modal refinements */
    .quiz-modal {
        width: 95%;
        border-radius: 16px;
    }
}

@media (max-width: 480px) {
    .quiz-modes__grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .review-filters {
        flex-direction: column;
    }

    /* Exam session — very small screens */
    .exam-content {
        margin: 70px auto 70px;
        padding: 1rem 0.875rem;
    }

    .exam-question-text {
        font-size: 0.9375rem;
        margin-bottom: 1.25rem;
    }

    .exam-options {
        max-width: 100%;
        gap: 0.75rem;
    }

    .exam-submit__btn {
        width: 100%;
        padding: 0.75rem 1.5rem;
    }

    /* Quiz header tighter */
    .quiz-topnav__inner {
        padding: 0 1rem;
        height: 56px;
    }

    .quiz-topnav__brand {
        gap: 0.5rem;
    }

    .quiz-topnav__logo {
        width: 32px;
        height: 32px;
    }

    .quiz-topnav__name {
        font-size: 0.875rem;
    }

    /* Stats card compact */
    .stats-card {
        padding: 1.25rem;
    }
}

/* ============================================================================
   STANDARDIZED LOADING / ERROR / EMPTY STATES
   ============================================================================ */

.quiz-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
    border-radius: 14px;
    gap: 0.75rem;
}

/* Loading variant */
.quiz-state--loading {
    background: var(--quiz-bg-secondary);
    border: 1px solid var(--quiz-border);
    color: var(--quiz-text-muted);
}

.quiz-state__spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--quiz-bg-elevated);
    border-top-color: var(--quiz-accent-teal);
    border-radius: 50%;
    animation: quizSpin 0.8s linear infinite;
}

@keyframes quizSpin {
    to { transform: rotate(360deg); }
}

.quiz-state__text {
    color: var(--quiz-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
    max-width: 320px;
}

/* Error variant */
.quiz-state--error {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.quiz-state--error .quiz-state__icon {
    color: var(--quiz-incorrect);
}

.quiz-state--error .quiz-state__text {
    color: var(--quiz-text-secondary);
}

/* Empty variant */
.quiz-state--empty {
    background: var(--quiz-bg-secondary);
    border: 1px solid var(--quiz-border);
}

.quiz-state--empty .quiz-state__icon {
    color: var(--quiz-text-muted);
    opacity: 0.5;
}

.quiz-state__icon svg {
    width: 40px;
    height: 40px;
}

.quiz-state__heading {
    color: var(--quiz-text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.quiz-state__action {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.25rem;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    border: none;
}

.quiz-state--error .quiz-state__action {
    background: var(--quiz-bg-elevated);
    color: var(--quiz-text-secondary);
    border: 1px solid var(--quiz-border);
}

.quiz-state--error .quiz-state__action:hover {
    background: var(--quiz-bg-card);
    border-color: var(--quiz-accent-teal);
    color: var(--quiz-text-primary);
}

.quiz-state--empty .quiz-state__action {
    background: var(--quiz-accent-teal);
    color: white;
}

.quiz-state--empty .quiz-state__action:hover {
    background: #0d9488;
}

/* grid-spanning helper (full row in grid layouts) */
.quiz-state--grid {
    grid-column: 1 / -1;
}

/* ============================================================================
   CONFIRM MODAL (replaces browser confirm/alert)
   ============================================================================ */

.quiz-modal--confirm {
    max-width: 420px;
}

.quiz-modal--confirm .quiz-modal__content {
    padding: 0 2rem 1rem;
}

.quiz-modal--confirm .quiz-modal__content p {
    color: var(--quiz-text-secondary);
    line-height: 1.6;
    font-size: 0.925rem;
}

.quiz-modal__btn--danger {
    background: var(--quiz-incorrect);
    border: none;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.quiz-modal__btn--danger:hover {
    background: #dc2626;
}

.quiz-modal__btn--danger svg,
.quiz-modal__btn--danger i {
    width: 16px;
    height: 16px;
}

.quiz-modal__btn--cancel {
    background: var(--quiz-bg-elevated);
    border: 1px solid var(--quiz-border);
    color: var(--quiz-text-secondary);
}

.quiz-modal__btn--cancel:hover {
    background: var(--quiz-bg-secondary);
    color: var(--quiz-text-primary);
}

/* ============================================================================
   TOAST NOTIFICATIONS (replaces browser alert)
   ============================================================================ */

.quiz-toast-container {
    position: fixed;
    top: 80px;
    right: 1rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
}

.quiz-toast {
    background: var(--quiz-bg-secondary);
    border: 1px solid var(--quiz-border);
    border-radius: 12px;
    padding: 0.85rem 1.15rem;
    color: var(--quiz-text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    pointer-events: auto;
    animation: quizToastIn 0.25s ease;
    max-width: 380px;
}

.quiz-toast--success {
    border-color: rgba(16, 185, 129, 0.4);
}

.quiz-toast--success .quiz-toast__icon {
    color: var(--quiz-correct);
}

.quiz-toast--error {
    border-color: rgba(239, 68, 68, 0.4);
}

.quiz-toast--error .quiz-toast__icon {
    color: var(--quiz-incorrect);
}

.quiz-toast--warning {
    border-color: rgba(245, 158, 11, 0.4);
}

.quiz-toast--warning .quiz-toast__icon {
    color: var(--quiz-accent-gold);
}

.quiz-toast--info {
    border-color: rgba(59, 130, 246, 0.4);
}

.quiz-toast--info .quiz-toast__icon {
    color: var(--quiz-accent-blue);
}

.quiz-toast__icon svg {
    width: 20px;
    height: 20px;
}

.quiz-toast__text {
    flex: 1;
}

.quiz-toast--exiting {
    animation: quizToastOut 0.2s ease forwards;
}

@keyframes quizToastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes quizToastOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(40px); }
}

@media (max-width: 480px) {
    .quiz-toast-container {
        left: 1rem;
        right: 1rem;
    }
    .quiz-toast {
        max-width: 100%;
    }
}

/* ============================================================================
   GLOBAL MOBILE SAFETY
   ============================================================================ */

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* Exam detail page mobile refinements */
@media (max-width: 768px) {
    .exam-detail-page {
        padding: 1.5rem 1rem 3rem;
    }

    .exam-detail-card {
        padding: 1rem;
    }

    .exam-metrics {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .exam-cta-row {
        flex-direction: column;
        gap: 0.75rem;
    }

    .exam-cta-row .action-btn {
        width: 100%;
        justify-content: center;
    }

    .attempt-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .exam-metrics {
        grid-template-columns: 1fr;
    }

    .exam-center-page {
        padding: 1.5rem 0.75rem 5rem;
    }

    .exam-hero {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .exam-hero h1 {
        font-size: 1.25rem;
    }

    .exam-grid {
        grid-template-columns: 1fr;
    }
}

/* Quiz subnav mobile fix — account for varying V2 header height */
@media (max-width: 900px) {
    .quiz-subnav {
        display: none;
    }
}

/* ============================================================================
   UPGRADE MODAL (premium upsell)
   ============================================================================ */

.upgrade-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: upgradeOverlayIn 0.25s ease;
}

@keyframes upgradeOverlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes upgradeModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.upgrade-modal {
    background: var(--quiz-bg-card, #1e293b);
    border: 1px solid var(--quiz-border, #334155);
    border-radius: 20px;
    max-width: 420px;
    width: 90%;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    animation: upgradeModalIn 0.3s ease;
}

.upgrade-modal__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.25rem;
    background: linear-gradient(135deg, var(--quiz-accent-gold, #f59e0b), var(--quiz-accent-orange, #fb923c));
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.upgrade-modal__icon i,
.upgrade-modal__icon svg {
    width: 28px;
    height: 28px;
    color: white;
}

.upgrade-modal__title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--quiz-text-primary, #f1f5f9);
    margin: 0 0 0.75rem;
}

.upgrade-modal__desc {
    font-size: 0.9375rem;
    line-height: 1.65;
    color: var(--quiz-text-muted, #94a3b8);
    margin: 0 0 1.75rem;
}

.upgrade-modal__actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upgrade-modal__btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, var(--quiz-accent-gold, #f59e0b), var(--quiz-accent-orange, #fb923c));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.upgrade-modal__btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.upgrade-modal__btn-dismiss {
    background: none;
    border: none;
    color: var(--quiz-text-muted, #94a3b8);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s;
}

.upgrade-modal__btn-dismiss:hover {
    color: var(--quiz-text-primary, #f1f5f9);
}


/* ############################################################################
   PAGE-SPECIFIC STYLES
   Extracted from inline <style> blocks — February 2026
   ############################################################################ */

/* ============================================================================
   PAGE-SPECIFIC: HUB
   ============================================================================ */
/* ============================================
           QUIZ SUB-NAVIGATION
           ============================================ */
        .quiz-subnav {
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(51, 65, 85, 0.5);
            position: sticky;
            top: 88px;
            z-index: 90;
        }

        .quiz-subnav__inner {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 1.5rem;
            display: flex;
            gap: 0.25rem;
            overflow-x: auto;
            scrollbar-width: none;
        }

        .quiz-subnav__inner::-webkit-scrollbar { display: none; }

        .quiz-subnav__link {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.875rem 1.25rem;
            color: rgba(255, 255, 255, 0.55);
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 500;
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
            white-space: nowrap;
        }

        .quiz-subnav__link i,
        .quiz-subnav__link svg { width: 16px; height: 16px; }

        .quiz-subnav__link:hover {
            color: rgba(255, 255, 255, 0.85);
            background: rgba(255, 255, 255, 0.04);
        }

        .quiz-subnav__link--active {
            color: #fff;
            border-bottom-color: #3b82f6;
        }

        /* Hide subnav on mobile (bottom nav handles it) */
        .quiz-subnav { display: none; }
        @media (min-width: 901px) {
            .quiz-subnav { display: block; }
        }

        /* ============================================
           QUIZ HERO
           ============================================ */
        .quiz-hero {
            position: relative;
            overflow: hidden;
            padding: 1rem 0;
            border-bottom: 1px solid rgba(139, 92, 246, 0.1);
        }

        .quiz-hero__bg {
            position: absolute;
            inset: 0;
            background: linear-gradient(135deg, 
                rgba(59, 130, 246, 0.08) 0%, 
                rgba(139, 92, 246, 0.08) 50%, 
                rgba(6, 182, 212, 0.05) 100%);
            background-size: 200% 200%;
            animation: v2-gradientShift 12s ease infinite;
        }

        .quiz-hero__orb {
            position: absolute;
            border-radius: 50%;
            pointer-events: none;
        }

        .quiz-hero__orb--1 {
            width: 300px;
            height: 300px;
            background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
            top: -100px;
            right: 10%;
            animation: v2-float 8s ease-in-out infinite;
        }

        .quiz-hero__orb--2 {
            width: 200px;
            height: 200px;
            background: radial-gradient(circle, rgba(139, 92, 246, 0.1) 0%, transparent 70%);
            bottom: -50px;
            left: 5%;
            animation: v2-float 10s ease-in-out infinite reverse;
        }

        .quiz-hero__content {
            position: relative;
            z-index: 1;
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 1rem;
            display: grid;
            grid-template-columns: 1fr auto;
            gap: 1rem;
            align-items: center;
        }

        .quiz-hero__greeting {
            display: flex;
            flex-direction: column;
            gap: 0.125rem;
        }

        .quiz-hero__title {
            font-size: 1.125rem;
            font-weight: 800;
            color: #f1f5f9;
            background: linear-gradient(135deg, #fff 0%, #93c5fd 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            line-height: 1.2;
        }

        .quiz-hero__subtitle {
            color: #94a3b8;
            font-size: 0.8125rem;
        }

        .quiz-hero__greeting-text {
            font-size: 0.9375rem;
            font-weight: 600;
            color: #cbd5e1;
        }

        .quiz-hero__streak {
            display: inline-flex;
            align-items: center;
            gap: 0.375rem;
            color: #94a3b8;
            font-size: 0.75rem;
            margin-top: 0.375rem;
            background: rgba(245, 158, 11, 0.1);
            border: 1px solid rgba(245, 158, 11, 0.2);
            padding: 0.3rem 0.625rem;
            border-radius: 8px;
            width: fit-content;
        }

        .quiz-hero__streak svg,
        .quiz-hero__streak i {
            width: 14px;
            height: 14px;
            color: #f59e0b;
        }

        .quiz-hero__streak strong {
            color: #f1f5f9;
        }

        @media (min-width: 769px) {
            .quiz-hero__content {
                padding: 0 1.5rem;
                gap: 1.5rem;
            }
            .quiz-hero__title { font-size: 1.5rem; }
            .quiz-hero { padding: 0.75rem 0; }
            .quiz-hero__greeting { gap: 0.25rem; }
            .quiz-hero__subtitle { font-size: 0.875rem; }
            .quiz-hero__greeting-text { font-size: 1rem; }
            .quiz-hero__streak { font-size: 0.8125rem; padding: 0.375rem 0.75rem; }
            .quiz-hero__streak i, .quiz-hero__streak svg { width: 16px; height: 16px; }
        }

        /* ============================================
           STUDY CALENDAR — Compact Mini
           ============================================ */
        .study-calendar {
            background: rgba(15, 23, 42, 0.5);
            border: 1px solid rgba(51, 65, 85, 0.4);
            border-radius: 12px;
            padding: 0.5rem;
            width: 185px;
            flex-shrink: 0;
        }

        .study-calendar__header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.25rem;
        }

        .study-calendar__nav {
            background: none;
            border: none;
            color: #64748b;
            cursor: pointer;
            padding: 0.125rem;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .study-calendar__nav:hover {
            color: #f1f5f9;
            background: rgba(59, 130, 246, 0.15);
        }

        .study-calendar__nav svg,
        .study-calendar__nav i { width: 12px; height: 12px; }

        .study-calendar__title {
            font-size: 0.625rem;
            font-weight: 600;
            color: #94a3b8;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .study-calendar__grid {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 1px;
        }

        .study-calendar__day-label {
            font-size: 0.5rem;
            padding: 0.125rem 0;
            text-align: center;
            color: #475569;
            font-weight: 600;
            text-transform: uppercase;
        }

        .study-calendar__day {
            aspect-ratio: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.5625rem;
            color: #64748b;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.15s;
        }

        .study-calendar__day:not(.study-calendar__day--empty):hover {
            background: rgba(59, 130, 246, 0.12);
        }

        .study-calendar__day--empty { cursor: default; }

        .study-calendar__day--today {
            background: linear-gradient(135deg, #3b82f6, #6366f1);
            color: white;
            font-weight: 700;
            box-shadow: 0 1px 4px rgba(59, 130, 246, 0.3);
        }

        .study-calendar__day--future { opacity: 0.25; }

        .study-calendar__day--studied {
            background: linear-gradient(135deg, #10b981, #14b8a6);
            color: white;
            font-weight: 700;
        }

        @media (min-width: 769px) {
            .study-calendar {
                width: 210px;
                padding: 0.625rem;
            }
            .study-calendar__title { font-size: 0.6875rem; }
            .study-calendar__day { font-size: 0.625rem; }
            .study-calendar__day-label { font-size: 0.5625rem; }
            .study-calendar__nav i, .study-calendar__nav svg { width: 14px; height: 14px; }
        }

        /* ============================================
           QUIZ SECTIONS
           ============================================ */
        .quiz-section {
            padding: 2.5rem 0 0;
        }

        .quiz-section--last {
            padding-bottom: 3rem;
        }

        .quiz-container {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 1.5rem;
        }

        .quiz-section__header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.5rem;
        }

        .quiz-section__title {
            font-size: 1.375rem;
            font-weight: 700;
            color: #f1f5f9;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .quiz-section__title i,
        .quiz-section__title svg {
            width: 24px;
            height: 24px;
            color: #8b5cf6;
        }

        .quiz-section__link {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: #94a3b8;
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 500;
            padding: 0.5rem 0.875rem;
            border-radius: 8px;
            transition: all 0.2s;
        }

        .quiz-section__link i,
        .quiz-section__link svg { width: 16px; height: 16px; }

        .quiz-section__link:hover {
            color: #3b82f6;
            background: rgba(59, 130, 246, 0.1);
        }

        /* ============================================
           CUSTOM QUIZ BUILDER CARD
           ============================================ */
        .custom-quiz-builder {
            background: linear-gradient(145deg, #1e293b, #162032);
            border: 1px solid rgba(51, 65, 85, 0.5);
            border-radius: var(--v2-radius-lg);
            margin-bottom: 1rem;
            overflow: hidden;
        }
        .custom-quiz-builder[open] { border-color: rgba(59, 130, 246, 0.3); }
        .custom-quiz-builder__header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.75rem 1.25rem;
            cursor: pointer;
            list-style: none;
            user-select: none;
        }
        .custom-quiz-builder__header::-webkit-details-marker { display: none; }
        .custom-quiz-builder__header::marker { display: none; content: ''; }
        .custom-quiz-builder__title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: 0.9rem;
            color: var(--v2-text-primary);
        }
        .custom-quiz-builder__title i,
        .custom-quiz-builder__title svg { width: 18px; height: 18px; color: #60a5fa; }
        .custom-quiz-builder__chevron {
            transition: transform 0.25s ease;
            color: var(--v2-text-muted);
        }
        .custom-quiz-builder__chevron i,
        .custom-quiz-builder__chevron svg { width: 16px; height: 16px; }
        .custom-quiz-builder[open] .custom-quiz-builder__chevron { transform: rotate(180deg); }
        .custom-quiz-builder__body {
            padding: 0 1.25rem 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }
        .custom-quiz-builder__row {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            flex-wrap: wrap;
        }
        .custom-quiz-builder__label {
            font-size: 0.8rem;
            font-weight: 600;
            color: var(--v2-text-muted);
            min-width: 70px;
            flex-shrink: 0;
        }
        .custom-quiz-builder__chips {
            display: flex;
            flex-wrap: wrap;
            gap: 0.375rem;
        }
        .cq-chip {
            padding: 0.3rem 0.65rem;
            font-size: 0.75rem;
            font-weight: 500;
            border-radius: 8px;
            border: 1px solid rgba(51, 65, 85, 0.5);
            background: rgba(30, 41, 59, 0.6);
            color: #94a3b8;
            cursor: pointer;
            transition: all 0.15s;
        }
        .cq-chip:hover { border-color: rgba(59, 130, 246, 0.4); color: #cbd5e1; }
        .cq-chip--active {
            background: rgba(59, 130, 246, 0.2);
            border-color: #3b82f6;
            color: #60a5fa;
        }
        .custom-quiz-builder__start {
            margin-top: 0.25rem;
            padding: 0.6rem 1.25rem;
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
            color: white;
            border: none;
            border-radius: 10px;
            font-weight: 600;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
        }
        .custom-quiz-builder__start i,
        .custom-quiz-builder__start svg { width: 16px; height: 16px; }
        .custom-quiz-builder__start:hover {
            box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
            transform: translateY(-1px);
        }
        @media (max-width: 600px) {
            .custom-quiz-builder__row { gap: 0.5rem; }
            .custom-quiz-builder__label { min-width: 100%; }
        }

        /* ============================================
           SCOPE BAR (always visible)
           ============================================ */
        .quiz-scope-bar {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 0.75rem;
            background: rgba(30, 41, 59, 0.6);
            border: 1px solid rgba(51, 65, 85, 0.5);
            border-radius: 12px;
            margin-bottom: 1rem;
            overflow-x: auto;
            scrollbar-width: none;
            -webkit-overflow-scrolling: touch;
        }
        .quiz-scope-bar::-webkit-scrollbar { display: none; }
        .quiz-scope-bar__label {
            display: flex;
            align-items: center;
            gap: 0.375rem;
            color: #94a3b8;
            font-size: 0.8125rem;
            font-weight: 600;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .quiz-scope-bar__label i,
        .quiz-scope-bar__label svg { width: 14px; height: 14px; }
        .quiz-scope-bar__chips {
            display: flex;
            gap: 0.375rem;
            flex-shrink: 0;
        }
        .scope-chip {
            padding: 0.3rem 0.625rem;
            border-radius: 20px;
            border: 1px solid rgba(51, 65, 85, 0.6);
            background: transparent;
            color: #94a3b8;
            font-size: 0.75rem;
            font-weight: 500;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
        }
        .scope-chip:hover {
            border-color: #3b82f6;
            color: #e2e8f0;
            background: rgba(59, 130, 246, 0.1);
        }
        .scope-chip--on {
            background: linear-gradient(135deg, rgba(59, 130, 246, 0.25), rgba(139, 92, 246, 0.2));
            border-color: #3b82f6;
            color: #f1f5f9;
            font-weight: 600;
            box-shadow: 0 0 8px rgba(59, 130, 246, 0.15);
        }
        @media (min-width: 601px) {
            .quiz-scope-bar { padding: 0.625rem 1rem; gap: 0.75rem; }
            .scope-chip { padding: 0.375rem 0.875rem; font-size: 0.8125rem; }
        }

        /* ============================================
           QUIZ MODE CARDS (V2 Style)
           ============================================ */
        .quiz-modes__grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 1rem;
            padding: 0;
        }

        .quiz-mode-card {
            position: relative;
            background: linear-gradient(145deg, #1e293b, #162032);
            border: 1px solid rgba(51, 65, 85, 0.5);
            border-radius: 16px;
            padding: 1.75rem 1.25rem 1.5rem;
            text-align: center;
            text-decoration: none;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.625rem;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
            cursor: pointer;
        }

        /* Accent top bar */
        .quiz-mode-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--card-accent, #3b82f6), var(--card-accent-end, #8b5cf6));
            opacity: 0;
            transition: opacity 0.3s;
        }

        .quiz-mode-card:hover {
            transform: translateY(-4px);
            border-color: rgba(139, 92, 246, 0.3);
            box-shadow: 
                0 8px 30px var(--card-glow, rgba(59, 130, 246, 0.12)),
                0 0 20px var(--card-glow, rgba(59, 130, 246, 0.06));
        }

        .quiz-mode-card:hover::before { opacity: 1; }

        /* Mode-specific accent colors */
        .quiz-mode-card[data-mode="quick10"]    { --card-accent: #3b82f6; --card-accent-end: #60a5fa; --card-glow: rgba(59, 130, 246, 0.15); }
        .quiz-mode-card[data-mode="timed"]      { --card-accent: #f59e0b; --card-accent-end: #fbbf24; --card-glow: rgba(245, 158, 11, 0.15); }
        .quiz-mode-card[data-mode="levelup"]    { --card-accent: #f97316; --card-accent-end: #fb923c; --card-glow: rgba(249, 115, 22, 0.15); }
        .quiz-mode-card[data-mode="weakest"]    { --card-accent: #ef4444; --card-accent-end: #f87171; --card-glow: rgba(239, 68, 68, 0.15); }
        .quiz-mode-card[data-mode="missed"]     { --card-accent: #ef4444; --card-accent-end: #f87171; --card-glow: rgba(239, 68, 68, 0.12); }
        .quiz-mode-card[data-mode="custom"]     { --card-accent: #8b5cf6; --card-accent-end: #a78bfa; --card-glow: rgba(139, 92, 246, 0.15); }
        .quiz-mode-card[data-mode="mock"]       { --card-accent: #14b8a6; --card-accent-end: #2dd4bf; --card-glow: rgba(20, 184, 166, 0.15); }
        .quiz-mode-card[data-mode="spaced"]     { --card-accent: #10b981; --card-accent-end: #34d399; --card-glow: rgba(16, 185, 129, 0.15); }
        .quiz-mode-card[data-mode="examcenter"] { --card-accent: #3b82f6; --card-accent-end: #60a5fa; --card-glow: rgba(59, 130, 246, 0.15); }

        .quiz-mode-card__icon {
            width: 56px;
            height: 56px;
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.3s;
        }

        .quiz-mode-card:hover .quiz-mode-card__icon {
            transform: scale(1.08) rotate(3deg);
        }

        .quiz-mode-card__icon i,
        .quiz-mode-card__icon svg { width: 28px; height: 28px; }

        /* Icon color variants */
        .quiz-mode-card__icon--blue   { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
        .quiz-mode-card__icon--gold   { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
        .quiz-mode-card__icon--orange { background: rgba(249, 115, 22, 0.15); color: #fb923c; }
        .quiz-mode-card__icon--red    { background: rgba(239, 68, 68, 0.15); color: #f87171; }
        .quiz-mode-card__icon--purple { background: rgba(139, 92, 246, 0.15); color: #a78bfa; }
        .quiz-mode-card__icon--teal   { background: rgba(20, 184, 166, 0.15); color: #2dd4bf; }
        .quiz-mode-card__icon--green  { background: rgba(16, 185, 129, 0.15); color: #34d399; }

        .quiz-mode-card__title {
            font-size: 0.9375rem;
            font-weight: 600;
            color: #f1f5f9;
        }

        .quiz-mode-card__desc {
            font-size: 0.8125rem;
            color: #64748b;
            line-height: 1.4;
        }

        .quiz-mode-card__badge {
            position: absolute;
            top: 12px;
            right: 12px;
            background: linear-gradient(135deg, #8b5cf6, #6d28d9);
            color: white;
            font-size: 0.625rem;
            font-weight: 700;
            padding: 0.2rem 0.5rem;
            border-radius: 20px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            z-index: 1;
        }

        .quiz-modal__interactive {
            margin-top: 1rem;
            padding: 0.9rem;
            border: 1px solid rgba(148, 163, 184, 0.22);
            border-radius: 12px;
            background: rgba(15, 23, 42, 0.35);
            display: grid;
            gap: 0.75rem;
        }

        .quiz-interactive__title {
            font-size: 0.82rem;
            font-weight: 700;
            color: #e2e8f0;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .quiz-interactive__row {
            display: grid;
            gap: 0.45rem;
        }

        .quiz-interactive__label {
            font-size: 0.78rem;
            color: #94a3b8;
            font-weight: 600;
        }

        .quiz-interactive__select {
            width: 100%;
            border: 1px solid rgba(148, 163, 184, 0.3);
            background: rgba(15, 23, 42, 0.7);
            color: #e2e8f0;
            border-radius: 10px;
            padding: 0.55rem 0.65rem;
            font-size: 0.85rem;
        }

        .quiz-interactive__meta {
            font-size: 0.78rem;
            color: #94a3b8;
            line-height: 1.45;
        }

        .quiz-interactive__chips {
            display: flex;
            flex-wrap: wrap;
            gap: 0.45rem;
        }

        .quiz-interactive__chip {
            border: 1px solid rgba(148, 163, 184, 0.28);
            background: rgba(30, 41, 59, 0.65);
            color: #cbd5e1;
            padding: 0.38rem 0.62rem;
            border-radius: 999px;
            font-size: 0.76rem;
            font-weight: 600;
            cursor: pointer;
        }

        .quiz-interactive__chip--active {
            border-color: rgba(139, 92, 246, 0.7);
            background: rgba(139, 92, 246, 0.2);
            color: #f1f5f9;
        }

        /* ============================================
           PERFORMANCE SNAPSHOT
           ============================================ */
        .perf-summary {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }

        .perf-stat {
            background: linear-gradient(145deg, #1e293b, #162032);
            border: 1px solid rgba(51, 65, 85, 0.5);
            border-radius: 12px;
            padding: 1rem 1.25rem;
            text-align: center;
        }

        .perf-stat__value {
            font-size: 1.5rem;
            font-weight: 800;
            background: linear-gradient(135deg, #60a5fa, #a78bfa);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .perf-stat__label {
            font-size: 0.75rem;
            color: #64748b;
            margin-top: 0.25rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .perf-categories {
            display: flex;
            flex-direction: column;
            gap: 0.625rem;
        }

        .perf-cat {
            display: grid;
            grid-template-columns: 110px 1fr 42px;
            align-items: center;
            gap: 0.5rem;
            padding: 0.625rem 0;
        }

        .perf-cat__name {
            font-size: 0.8125rem;
            font-weight: 500;
            color: #e2e8f0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .perf-cat__bar-wrapper {
            height: 8px;
            background: rgba(51, 65, 85, 0.5);
            border-radius: 4px;
            overflow: hidden;
            position: relative;
        }

        .perf-cat__bar {
            height: 100%;
            border-radius: 4px;
            transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
            min-width: 2px;
        }

        .perf-cat__pct {
            font-size: 0.8125rem;
            font-weight: 600;
            color: #94a3b8;
            text-align: right;
        }

        .perf-cat--weak .perf-cat__name {
            color: #fbbf24;
        }

        .perf-cat--weak .perf-cat__pct {
            color: #fbbf24;
        }

        @media (min-width: 641px) {
            .perf-cat {
                grid-template-columns: 140px 1fr 50px;
                gap: 0.75rem;
            }
            .perf-cat__name { font-size: 0.875rem; }
        }

        /* ============================================
           RECOMMENDATION CARDS
           ============================================ */
        .rec-card {
            position: relative;
            background: linear-gradient(145deg, #1e293b, #162032);
            border: 1px solid rgba(51, 65, 85, 0.5);
            border-radius: 16px;
            padding: 1.5rem 1.25rem;
            text-decoration: none;
            display: flex;
            flex-direction: column;
            align-items: center;
            text-align: center;
            gap: 0.625rem;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            overflow: hidden;
        }

        .rec-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, var(--rec-color, #3b82f6), var(--rec-color-end, #8b5cf6));
            opacity: 0;
            transition: opacity 0.3s;
        }

        .rec-card:hover {
            transform: translateY(-4px);
            border-color: rgba(139, 92, 246, 0.3);
            box-shadow: 0 8px 30px rgba(59, 130, 246, 0.12);
        }

        .rec-card:hover::before { opacity: 1; }

        .rec-card__icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(59, 130, 246, 0.12);
            color: var(--rec-color, #60a5fa);
            transition: transform 0.3s;
        }

        .rec-card:hover .rec-card__icon {
            transform: scale(1.08) rotate(3deg);
        }

        .rec-card__icon i,
        .rec-card__icon svg { width: 24px; height: 24px; }

        .rec-card__title {
            font-size: 0.9375rem;
            font-weight: 600;
            color: #f1f5f9;
        }

        .rec-card__desc {
            font-size: 0.8125rem;
            color: #64748b;
            line-height: 1.4;
        }

        .rec-card__badge {
            font-size: 0.6875rem;
            font-weight: 600;
            padding: 0.2rem 0.625rem;
            border-radius: 20px;
            background: rgba(59, 130, 246, 0.15);
            color: #60a5fa;
        }

        /* ============================================
           IN-PROGRESS WRAPPER — Collapsible
           ============================================ */
        .in-progress-wrapper {
            background: linear-gradient(145deg, #1e293b, #162032);
            border: 1px solid rgba(51, 65, 85, 0.5);
            border-radius: 14px;
            overflow: hidden;
        }
        .in-progress-wrapper[open] {
            border-color: rgba(59, 130, 246, 0.25);
        }
        .in-progress-wrapper__header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.875rem 1.25rem;
            cursor: pointer;
            list-style: none;
            user-select: none;
        }
        .in-progress-wrapper__header::-webkit-details-marker { display: none; }
        .in-progress-wrapper__header::marker { display: none; content: ''; }
        .in-progress-wrapper__title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 700;
            font-size: 1rem;
            color: #f1f5f9;
        }
        .in-progress-wrapper__title i,
        .in-progress-wrapper__title svg { width: 20px; height: 20px; color: #8b5cf6; }
        .in-progress-wrapper__count {
            font-size: 0.7rem;
            font-weight: 700;
            background: rgba(59, 130, 246, 0.2);
            color: #60a5fa;
            padding: 0.1rem 0.5rem;
            border-radius: 999px;
            min-width: 20px;
            text-align: center;
        }
        .in-progress-wrapper__chevron {
            transition: transform 0.25s ease;
            color: var(--v2-text-muted, #94a3b8);
        }
        .in-progress-wrapper__chevron i,
        .in-progress-wrapper__chevron svg { width: 18px; height: 18px; }
        .in-progress-wrapper[open] .in-progress-wrapper__chevron { transform: rotate(180deg); }
        .in-progress-wrapper__body {
            padding: 0 1.25rem 1rem;
        }
        .in-progress-wrapper:not([open]) .in-progress-wrapper__body { display: none; }

        /* ============================================
           IN-PROGRESS CARDS
           ============================================ */
        .in-progress-section__grid {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }

        .in-progress-card {
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 0.5rem;
            background: rgba(30, 41, 59, 0.5);
            border: 1px solid rgba(51, 65, 85, 0.4);
            border-radius: 10px;
            padding: 0.75rem 1rem;
            text-decoration: none;
            transition: all 0.2s;
            position: relative;
        }

        .in-progress-card:hover {
            border-color: rgba(59, 130, 246, 0.3);
            background: rgba(30, 41, 59, 0.7);
        }

        .in-progress-card__info { flex: 1; min-width: 0; }

        .in-progress-card__title {
            font-weight: 600;
            color: #f1f5f9;
            font-size: 0.9375rem;
            margin-bottom: 0.25rem;
        }

        .in-progress-card__meta {
            color: #64748b;
            font-size: 0.8125rem;
        }

        .in-progress-card__progress {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            min-width: 120px;
            width: 100%;
            order: 3;
        }

        .in-progress-card__bar {
            flex: 1;
            height: 6px;
            background: rgba(51, 65, 85, 0.5);
            border-radius: 3px;
            overflow: hidden;
        }

        .in-progress-card__bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #3b82f6, #8b5cf6);
            border-radius: 3px;
            transition: width 0.3s;
        }

        .in-progress-card__pct {
            font-size: 0.8125rem;
            font-weight: 600;
            color: #94a3b8;
            min-width: 35px;
            text-align: right;
        }

        .in-progress-card__action {
            display: flex;
            align-items: center;
            gap: 0.375rem;
            color: #3b82f6;
            font-weight: 600;
            font-size: 0.75rem;
            white-space: nowrap;
        }

        .in-progress-card__action i,
        .in-progress-card__action svg { width: 16px; height: 16px; }

        .in-progress-card__delete {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 26px;
            height: 26px;
            border-radius: 8px;
            background: none;
            border: 1px solid transparent;
            color: #64748b;
            cursor: pointer;
            transition: all 0.2s;
            flex-shrink: 0;
            padding: 0;
        }
        .in-progress-card__delete:hover {
            color: #ef4444;
            background: rgba(239, 68, 68, 0.1);
            border-color: rgba(239, 68, 68, 0.3);
        }
        .in-progress-card__delete i,
        .in-progress-card__delete svg { width: 14px; height: 14px; }

        @media (min-width: 641px) {
            .in-progress-card { flex-wrap: nowrap; gap: 1rem; }
            .in-progress-card__progress { width: auto; order: 0; }
            .in-progress-card__action { font-size: 0.8125rem; }
            .in-progress-card__delete { width: 30px; height: 30px; }
        }

        /* ============================================
           SETTINGS MODAL REFINEMENTS
           ============================================ */
        .quiz-settings__group {
            margin-bottom: 1.5rem;
        }

        .quiz-settings__label {
            display: block;
            color: #f1f5f9;
            font-weight: 600;
            margin-bottom: 0.75rem;
            font-size: 0.9375rem;
        }

        .quiz-settings__hint {
            color: #64748b;
            font-size: 0.8125rem;
            margin: -0.25rem 0 0.75rem;
            line-height: 1.4;
        }

        .quiz-settings__options {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .settings-option {
            padding: 0.5rem 1rem;
            background: rgba(30, 41, 59, 0.8);
            border: 1px solid rgba(51, 65, 85, 0.5);
            border-radius: 10px;
            color: #94a3b8;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .settings-option:hover {
            border-color: rgba(59, 130, 246, 0.4);
            color: #f1f5f9;
        }

        .settings-option--active {
            background: linear-gradient(135deg, #3b82f6, #6366f1);
            border-color: transparent;
            color: white;
            font-weight: 600;
        }

        .quiz-settings__checkbox {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            color: #94a3b8;
            cursor: pointer;
            font-size: 0.9375rem;
        }

        .quiz-settings__checkbox input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: #3b82f6;
        }

        /* ============================================
           MOBILE ADJUSTMENTS
           ============================================ */

        @media (min-width: 901px) {

            .quiz-modes__grid {
                grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            }
        }

        /* Modal start button gradient override */
        .quiz-modal__btn--primary {
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
        }

        .quiz-modal__btn--primary:hover {
            box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
        }

        /* ============================================
           QOTD Collapsible Card
           ============================================ */
        .qotd-card {
            background: linear-gradient(145deg, #1e293b, #162032);
            border: 1px solid rgba(51, 65, 85, 0.5);
            border-radius: var(--v2-radius-lg);
            margin-bottom: 1.5rem;
            overflow: hidden;
            max-width: 900px;
            margin-left: auto;
            margin-right: auto;
        }
        @media (max-width: 768px) {
            .qotd-card { margin-bottom: 0.75rem; }
        }
        .qotd-card:not([open]) .qotd-card__body { display: none; }
        .qotd-card[open] { border-color: rgba(59, 130, 246, 0.3); }
        .qotd-card__header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 1.25rem;
            cursor: pointer;
            list-style: none;
            user-select: none;
        }
        .qotd-card__header::-webkit-details-marker { display: none; }
        .qotd-card__header::marker { display: none; content: ''; }
        .qotd-card__title {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--v2-text-primary);
        }
        .qotd-card__title i,
        .qotd-card__title svg { width: 20px; height: 20px; color: #f59e0b; }
        .qotd-card__chevron {
            transition: transform 0.25s ease;
            color: var(--v2-text-muted);
        }
        .qotd-card__chevron i,
        .qotd-card__chevron svg { width: 18px; height: 18px; }
        .qotd-card[open] .qotd-card__chevron { transform: rotate(180deg); }
        .qotd-new-badge {
            font-size: 0.6rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            padding: 0.15rem 0.45rem;
            border-radius: 6px;
            background: linear-gradient(135deg, #f59e0b, #d97706);
            color: #fff;
            line-height: 1;
            animation: qotd-pulse 2s ease-in-out infinite;
        }
        @keyframes qotd-pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.6; }
        }
        .qotd-card__body { padding: 0 1.25rem 1.25rem; }
        .qotd-card__question {
            font-size: 0.9375rem;
            color: #e2e8f0;
            line-height: 1.6;
            margin-bottom: 1rem;
        }
        .qotd-card__options {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .qotd-card__option {
            padding: 0.75rem 1rem;
            background: rgba(30, 41, 59, 0.8);
            border: 1px solid rgba(51, 65, 85, 0.5);
            border-radius: 10px;
            color: #cbd5e1;
            cursor: pointer;
            transition: all 0.2s;
            font-size: 0.875rem;
        }
        .qotd-card__option:hover { border-color: rgba(59, 130, 246, 0.4); background: rgba(59, 130, 246, 0.08); }
        .qotd-card__option--selected { border-color: #3b82f6; background: rgba(59, 130, 246, 0.15); }
        .qotd-card__option--correct { border-color: #10b981; background: rgba(16, 185, 129, 0.15); color: #34d399; cursor: default; }
        .qotd-card__option--incorrect { border-color: #ef4444; background: rgba(239, 68, 68, 0.15); color: #f87171; cursor: default; }
        .qotd-card__submit {
            margin-top: 1rem;
            width: 100%;
            padding: 0.75rem;
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
            color: white;
            border: none;
            border-radius: 10px;
            font-weight: 600;
            font-size: 0.9375rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .qotd-card__submit:hover:not(:disabled) { box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3); transform: translateY(-1px); }
        .qotd-card__submit:disabled { opacity: 0.5; cursor: not-allowed; }
        .qotd-card__explanation {
            margin-top: 0.75rem;
            padding: 0.75rem;
            background: rgba(59, 130, 246, 0.08);
            border: 1px solid rgba(59, 130, 246, 0.2);
            border-radius: 10px;
            font-size: 0.8125rem;
            color: #94a3b8;
            line-height: 1.5;
        }


/* ============================================================================
   PAGE-SPECIFIC: QUESTION ADMIN
   ============================================================================ */
:root {
            --admin-sidebar: 280px;
            --v2-bg-primary: #0f172a;
            --v2-bg-secondary: #1e293b;
            --v2-bg-tertiary: #334155;
            --v2-text-primary: #f1f5f9;
            --v2-text-secondary: #e2e8f0;
            --v2-text-muted: #94a3b8;
            --v2-accent-purple: #8b5cf6;
            --v2-accent-blue: #3b82f6;
            --v2-accent-green: #10b981;
            --v2-accent-red: #ef4444;
            --v2-accent-cyan: #06b6d4;
            --v2-accent-yellow: #f59e0b;
        }
        
        body.question-admin-page {
            background: var(--v2-bg-primary);
            color: var(--v2-text-secondary);
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            min-height: 100vh;
            display: flex;
        }

        /* Sidebar */
        .sidebar {
            width: var(--admin-sidebar);
            background: var(--v2-bg-secondary);
            border-right: 1px solid var(--v2-bg-tertiary);
            height: 100vh;
            position: fixed;
            left: 0;
            top: 0;
            overflow-y: auto;
            z-index: 100;
        }

        .sidebar-header {
            padding: 1.5rem;
            border-bottom: 1px solid var(--v2-bg-tertiary);
        }

        .sidebar-logo {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            text-decoration: none;
            color: var(--v2-text-primary);
            font-weight: 700;
            font-size: 1.125rem;
        }

        .sidebar-logo svg {
            width: 32px;
            height: 32px;
            color: var(--v2-accent-purple);
        }

        .sidebar-nav {
            padding: 1rem 0;
        }

        .nav-section {
            margin-bottom: 1.5rem;
        }

        .nav-section-title {
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--v2-text-muted);
            padding: 0 1.5rem;
            margin-bottom: 0.5rem;
        }

        .nav-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1.5rem;
            color: var(--v2-text-secondary);
            text-decoration: none;
            cursor: pointer;
            transition: all 0.2s;
        }

        .nav-item:hover {
            background: var(--v2-bg-tertiary);
        }

        .nav-item.active {
            background: rgba(139, 92, 246, 0.1);
            color: var(--v2-accent-purple);
            border-right: 3px solid var(--v2-accent-purple);
        }

        .nav-item svg {
            width: 20px;
            height: 20px;
        }

        .nav-item .badge {
            margin-left: auto;
            background: var(--v2-accent-purple);
            color: white;
            font-size: 0.75rem;
            padding: 0.125rem 0.5rem;
            border-radius: 10px;
        }

        /* Main Content */
        .main-content {
            flex: 1;
            margin-left: var(--admin-sidebar);
            min-height: 100vh;
        }

        /* Top Bar */
        .top-bar {
            background: var(--v2-bg-secondary);
            border-bottom: 1px solid var(--v2-bg-tertiary);
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: sticky;
            top: 0;
            z-index: 50;
        }

        /* Level Selector Pill Bar */
        .level-selector {
            background: var(--v2-bg-primary);
            border-bottom: 1px solid var(--v2-bg-tertiary);
            padding: 0.75rem 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .level-selector-label {
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--v2-text-muted);
            white-space: nowrap;
        }

        .level-pills {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .level-pill {
            padding: 0.4rem 1rem;
            border-radius: 20px;
            font-weight: 600;
            font-size: 0.8125rem;
            cursor: pointer;
            border: 1px solid var(--v2-bg-tertiary);
            background: transparent;
            color: var(--v2-text-muted);
            transition: all 0.2s;
        }

        .level-pill:hover {
            background: var(--v2-bg-tertiary);
            color: var(--v2-text-primary);
        }

        .level-pill.active {
            background: linear-gradient(135deg, var(--v2-accent-purple), var(--v2-accent-blue));
            color: white;
            border-color: transparent;
        }

        .page-title {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--v2-text-primary);
        }

        .top-bar-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        /* Buttons */
        .btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.625rem 1.25rem;
            border-radius: 8px;
            font-weight: 600;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s;
            text-decoration: none;
            border: none;
        }

        .btn svg {
            width: 18px;
            height: 18px;
        }

        .btn-primary {
            background: linear-gradient(135deg, var(--v2-accent-purple), var(--v2-accent-blue));
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
        }

        .btn-secondary {
            background: var(--v2-bg-tertiary);
            color: var(--v2-text-secondary);
        }

        .btn-secondary:hover {
            background: #475569;
        }

        .btn-danger {
            background: var(--v2-accent-red);
            color: white;
        }

        .btn-success {
            background: var(--v2-accent-green);
            color: white;
        }

        .btn-ghost {
            background: transparent;
            color: var(--v2-text-muted);
        }

        .btn-ghost:hover {
            background: var(--v2-bg-tertiary);
            color: var(--v2-text-primary);
        }

        /* Content Area */
        .content-area {
            padding: 1.5rem;
        }

        /* Table */
        .data-table-container {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            overflow: hidden;
        }

        .table-toolbar {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 1rem;
            border-bottom: 1px solid var(--v2-bg-tertiary);
            flex-wrap: wrap;
        }

        .search-input {
            flex: 1;
            min-width: 200px;
            padding: 0.625rem 1rem 0.625rem 2.5rem;
            background: var(--v2-bg-primary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 8px;
            color: var(--v2-text-primary);
            font-size: 0.875rem;
        }

        .search-input:focus {
            outline: none;
            border-color: var(--v2-accent-purple);
        }

        .search-wrapper {
            position: relative;
            flex: 1;
            min-width: 200px;
        }

        .search-wrapper svg {
            position: absolute;
            left: 0.75rem;
            top: 50%;
            transform: translateY(-50%);
            width: 18px;
            height: 18px;
            color: var(--v2-text-muted);
        }

        .filter-select {
            padding: 0.625rem 1rem;
            background: var(--v2-bg-primary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 8px;
            color: var(--v2-text-secondary);
            font-size: 0.875rem;
            min-width: 150px;
        }

        .filter-select:focus {
            outline: none;
            border-color: var(--v2-accent-purple);
        }

        .data-table {
            width: 100%;
            border-collapse: collapse;
        }

        .data-table th {
            text-align: left;
            padding: 0.875rem 1rem;
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: var(--v2-text-muted);
            background: var(--v2-bg-primary);
            border-bottom: 1px solid var(--v2-bg-tertiary);
        }

        .data-table td {
            padding: 1rem;
            border-bottom: 1px solid var(--v2-bg-tertiary);
            vertical-align: middle;
        }

        .data-table tr:hover td {
            background: rgba(139, 92, 246, 0.05);
        }

        .data-table tr:last-child td {
            border-bottom: none;
        }

        .question-preview {
            max-width: 400px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* Badges */
        .badge {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            padding: 0.25rem 0.625rem;
            border-radius: 6px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .badge-type {
            background: rgba(139, 92, 246, 0.2);
            color: var(--v2-accent-purple);
        }

        .badge-difficulty-1, .badge-difficulty-2 {
            background: rgba(16, 185, 129, 0.2);
            color: var(--v2-accent-green);
        }

        .badge-difficulty-3 {
            background: rgba(245, 158, 11, 0.2);
            color: var(--v2-accent-yellow);
        }

        .badge-difficulty-4 {
            background: rgba(249, 115, 22, 0.2);
            color: #f97316;
        }

        .badge-difficulty-5 {
            background: rgba(239, 68, 68, 0.2);
            color: var(--v2-accent-red);
        }

        .badge-premium {
            background: rgba(6, 182, 212, 0.2);
            color: var(--v2-accent-cyan);
        }

        .badge-active {
            background: rgba(16, 185, 129, 0.2);
            color: var(--v2-accent-green);
        }

        .badge-inactive {
            background: rgba(239, 68, 68, 0.2);
            color: var(--v2-accent-red);
        }

        /* Actions */
        .row-actions {
            display: flex;
            gap: 0.5rem;
        }

        .row-action {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            background: transparent;
            border: 1px solid var(--v2-bg-tertiary);
            color: var(--v2-text-muted);
            cursor: pointer;
            transition: all 0.2s;
        }

        .row-action:hover {
            background: var(--v2-bg-tertiary);
            color: var(--v2-text-primary);
        }

        .row-action.delete:hover {
            background: rgba(239, 68, 68, 0.2);
            border-color: var(--v2-accent-red);
            color: var(--v2-accent-red);
        }

        .row-action svg {
            width: 16px;
            height: 16px;
        }

        /* Bulk select checkbox */
        .bulk-checkbox {
            width: 16px;
            height: 16px;
            accent-color: var(--v2-accent-blue);
            cursor: pointer;
        }

        /* Bulk action bar */
        .bulk-action-bar {
            display: none;
            align-items: center;
            gap: 1rem;
            padding: 0.75rem 1rem;
            background: var(--v2-bg-primary);
            border: 1px solid var(--v2-accent-blue);
            border-radius: 8px;
            margin-bottom: 1rem;
            animation: slideIn 0.2s ease;
        }
        .bulk-action-bar.visible { display: flex; }
        .bulk-action-bar .bulk-count {
            font-weight: 600;
            color: var(--v2-accent-blue);
            white-space: nowrap;
        }
        .bulk-action-bar .bulk-actions {
            display: flex;
            gap: 0.5rem;
            margin-left: auto;
        }
        .bulk-action-bar .btn-sm {
            padding: 0.35rem 0.75rem;
            font-size: 0.8rem;
            border-radius: 6px;
        }
        @keyframes slideIn {
            from { opacity: 0; transform: translateY(-6px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Pagination */
        .table-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem;
            border-top: 1px solid var(--v2-bg-tertiary);
        }

        .table-info {
            font-size: 0.875rem;
            color: var(--v2-text-muted);
        }

        .pagination {
            display: flex;
            gap: 0.25rem;
        }

        .page-btn {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            background: var(--v2-bg-primary);
            border: 1px solid var(--v2-bg-tertiary);
            color: var(--v2-text-secondary);
            cursor: pointer;
            transition: all 0.2s;
        }

        .page-btn:hover:not(:disabled) {
            background: var(--v2-bg-tertiary);
        }

        .page-btn.active {
            background: var(--v2-accent-purple);
            border-color: var(--v2-accent-purple);
            color: white;
        }

        .page-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Modal */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            backdrop-filter: blur(4px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .modal-overlay.active {
            display: flex;
        }

        .modal {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 16px;
            width: 100%;
            max-width: 700px;
            max-height: 90vh;
            overflow: hidden;
            animation: modalSlideIn 0.2s ease;
        }

        @keyframes modalSlideIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }

        .modal-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1.25rem 1.5rem;
            border-bottom: 1px solid var(--v2-bg-tertiary);
        }

        .modal-title {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--v2-text-primary);
        }

        .modal-close {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 8px;
            background: transparent;
            border: none;
            color: var(--v2-text-muted);
            cursor: pointer;
        }

        .modal-close:hover {
            background: var(--v2-bg-tertiary);
        }

        .modal-close svg {
            width: 20px;
            height: 20px;
        }

        .modal-body {
            padding: 1.5rem;
            overflow-y: auto;
            max-height: calc(90vh - 140px);
        }

        .modal-footer {
            display: flex;
            justify-content: flex-end;
            gap: 0.75rem;
            padding: 1.25rem 1.5rem;
            border-top: 1px solid var(--v2-bg-tertiary);
            background: var(--v2-bg-primary);
        }

        /* Form */
        .form-group {
            margin-bottom: 1.25rem;
        }

        .form-label {
            display: block;
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--v2-text-primary);
            margin-bottom: 0.5rem;
        }

        .form-label span {
            font-weight: 400;
            color: var(--v2-text-muted);
        }

        .form-input,
        .form-textarea,
        .form-select {
            width: 100%;
            padding: 0.75rem 1rem;
            background: var(--v2-bg-primary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 8px;
            color: var(--v2-text-primary);
            font-size: 0.875rem;
            font-family: inherit;
        }

        .form-input:focus,
        .form-textarea:focus,
        .form-select:focus {
            outline: none;
            border-color: var(--v2-accent-purple);
        }

        .form-textarea {
            min-height: 120px;
            resize: vertical;
        }

        .form-row {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        .form-help {
            font-size: 0.75rem;
            color: var(--v2-text-muted);
            margin-top: 0.375rem;
        }

        /* Options Builder */
        .options-builder {
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 8px;
            overflow: hidden;
        }

        .option-item {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            border-bottom: 1px solid var(--v2-bg-tertiary);
        }

        .option-item:last-child {
            border-bottom: none;
        }

        .option-letter {
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            background: var(--v2-bg-tertiary);
            font-size: 0.75rem;
            font-weight: 700;
            color: var(--v2-text-muted);
        }

        .option-letter.correct {
            background: var(--v2-accent-green);
            color: white;
        }

        .option-input {
            flex: 1;
            padding: 0.5rem 0.75rem;
            background: var(--v2-bg-primary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 6px;
            color: var(--v2-text-primary);
            font-size: 0.875rem;
        }

        .option-actions {
            display: flex;
            gap: 0.25rem;
        }

        .option-action {
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            background: transparent;
            border: 1px solid var(--v2-bg-tertiary);
            color: var(--v2-text-muted);
            cursor: pointer;
        }

        .option-action:hover {
            background: var(--v2-bg-tertiary);
        }

        .option-action.correct-btn:hover,
        .option-action.correct-btn.active {
            background: rgba(16, 185, 129, 0.2);
            border-color: var(--v2-accent-green);
            color: var(--v2-accent-green);
        }

        .option-action.delete-btn:hover {
            background: rgba(239, 68, 68, 0.2);
            border-color: var(--v2-accent-red);
            color: var(--v2-accent-red);
        }

        .option-action svg {
            width: 14px;
            height: 14px;
        }

        .add-option-btn {
            width: 100%;
            padding: 0.75rem;
            background: var(--v2-bg-primary);
            border: 1px dashed var(--v2-bg-tertiary);
            border-radius: 0 0 8px 8px;
            color: var(--v2-text-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s;
        }

        .add-option-btn:hover {
            border-color: var(--v2-accent-purple);
            color: var(--v2-accent-purple);
        }

        .add-option-btn svg {
            width: 16px;
            height: 16px;
        }

        /* Import Panel */
        .import-panel {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .import-dropzone {
            border: 2px dashed var(--v2-bg-tertiary);
            border-radius: 8px;
            padding: 3rem 2rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
        }

        .import-dropzone:hover,
        .import-dropzone.dragover {
            border-color: var(--v2-accent-purple);
            background: rgba(139, 92, 246, 0.05);
        }

        .import-dropzone svg {
            width: 48px;
            height: 48px;
            color: var(--v2-text-muted);
            margin-bottom: 1rem;
        }

        .import-dropzone h3 {
            color: var(--v2-text-primary);
            margin-bottom: 0.5rem;
        }

        .import-dropzone p {
            color: var(--v2-text-muted);
            font-size: 0.875rem;
        }

        .import-results {
            margin-top: 1.5rem;
            padding: 1rem;
            border-radius: 8px;
            background: var(--v2-bg-primary);
        }

        .import-stat {
            display: flex;
            justify-content: space-between;
            padding: 0.5rem 0;
            border-bottom: 1px solid var(--v2-bg-tertiary);
        }

        .import-stat:last-child {
            border-bottom: none;
        }

        /* Stats Cards */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .stat-card {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            padding: 1.25rem;
        }

        .stat-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.75rem;
        }

        .stat-icon {
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 10px;
            background: rgba(139, 92, 246, 0.2);
        }

        .stat-icon svg {
            width: 20px;
            height: 20px;
            color: var(--v2-accent-purple);
        }

        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            color: var(--v2-text-primary);
        }

        .stat-label {
            font-size: 0.875rem;
            color: var(--v2-text-muted);
        }

        /* Analytics */
        .analytics-toolbar {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .analytics-toolbar select {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            color: var(--v2-text-primary);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-size: 0.875rem;
            min-width: 250px;
        }

        .analytics-charts {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .analytics-charts.full-width {
            grid-template-columns: 1fr;
        }

        .chart-card {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            padding: 1.25rem;
        }

        .chart-card h3 {
            font-size: 0.875rem;
            font-weight: 600;
            color: var(--v2-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin: 0 0 1rem 0;
        }

        .chart-card canvas {
            width: 100% !important;
            max-height: 280px;
        }

        .funnel-row {
            display: flex;
            height: 32px;
            border-radius: 6px;
            overflow: hidden;
            margin-bottom: 0.75rem;
        }

        .funnel-segment {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 600;
            color: #fff;
            min-width: 2px;
            transition: flex 0.3s;
        }

        .funnel-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 1rem;
            font-size: 0.8rem;
            color: var(--v2-text-muted);
        }

        .funnel-legend span::before {
            content: '';
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 3px;
            margin-right: 6px;
            vertical-align: middle;
        }

        .funnel-legend .leg-completed::before { background: #10b981; }
        .funnel-legend .leg-abandoned::before { background: #f59e0b; }
        .funnel-legend .leg-timed-out::before { background: #ef4444; }
        .funnel-legend .leg-in-progress::before { background: #3b82f6; }

        .user-row { cursor: pointer; }
        .user-row:hover td { background: rgba(139, 92, 246, 0.1) !important; }

        .drilldown-header {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .drilldown-header .btn-back {
            background: var(--v2-bg-tertiary);
            border: none;
            color: var(--v2-text-primary);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
        }

        .drilldown-header .btn-back:hover {
            background: rgba(139, 92, 246, 0.3);
        }

        .drilldown-header h2 {
            margin: 0;
            font-size: 1.25rem;
        }

        .pass-badge {
            display: inline-block;
            padding: 2px 8px;
            border-radius: 4px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .pass-badge.passed { background: rgba(16, 185, 129, 0.2); color: #10b981; }
        .pass-badge.failed { background: rgba(239, 68, 68, 0.2); color: #ef4444; }

        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            border: 0;
        }

        .analytics-empty {
            text-align: center;
            padding: 3rem 1rem;
            color: var(--v2-text-muted);
        }

        .analytics-empty i, .analytics-empty svg {
            width: 48px;
            height: 48px;
            margin-bottom: 1rem;
            opacity: 0.5;
        }

        /* Loading */
        .loading-overlay {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(15, 23, 42, 0.8);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10;
        }

        .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid var(--v2-bg-tertiary);
            border-top-color: var(--v2-accent-purple);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Toast notifications */
        .toast-container {
            position: fixed;
            bottom: 1.5rem;
            right: 1.5rem;
            z-index: 2000;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .toast {
            padding: 1rem 1.5rem;
            border-radius: 8px;
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            color: var(--v2-text-primary);
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
            display: flex;
            align-items: center;
            gap: 0.75rem;
            animation: slideIn 0.2s ease;
        }

        .toast.success {
            border-left: 4px solid var(--v2-accent-green);
        }

        .toast.error {
            border-left: 4px solid var(--v2-accent-red);
        }

        .toast svg {
            width: 20px;
            height: 20px;
        }

        .toast.success svg {
            color: var(--v2-accent-green);
        }

        .toast.error svg {
            color: var(--v2-accent-red);
        }

        @keyframes slideIn {
            from { opacity: 0; transform: translateX(100%); }
            to { opacity: 1; transform: translateX(0); }
        }

        /* Exams and reports */
        .admin-split {
            display: grid;
            grid-template-columns: minmax(280px, 420px) 1fr;
            gap: 1rem;
            align-items: start;
        }

        .admin-panel {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            padding: 1rem;
        }

        .admin-panel h3 {
            color: var(--v2-text-primary);
            margin: 0 0 0.75rem;
            font-size: 1rem;
        }

        .chip-row {
            display: flex;
            flex-wrap: wrap;
            gap: 0.45rem;
        }

        .chip {
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 999px;
            padding: 0.2rem 0.6rem;
            font-size: 0.75rem;
            color: var(--v2-text-muted);
        }

        .exam-results-summary {
            display: grid;
            grid-template-columns: repeat(4, minmax(110px, 1fr));
            gap: 0.6rem;
            margin-bottom: 0.85rem;
        }

        .exam-results-summary .import-stat {
            padding: 0.65rem;
            border-radius: 8px;
            border: 1px solid var(--v2-bg-tertiary);
            background: var(--v2-bg-primary);
            color: var(--v2-text-muted);
            font-size: 0.8rem;
            display: flex;
            flex-direction: column;
            gap: 0.25rem;
        }

        .exam-results-summary strong {
            color: var(--v2-text-primary);
            font-size: 1rem;
        }

        @media (max-width: 1200px) {
            .admin-split {
                grid-template-columns: 1fr;
            }
        }

        /* Responsive */
        @media (max-width: 1024px) {
            .sidebar {
                transform: translateX(-100%);
                transition: transform 0.3s;
            }

            .sidebar.open {
                transform: translateX(0);
            }

            .main-content {
                margin-left: 0;
            }

            .form-row {
                grid-template-columns: 1fr;
            }

            .analytics-charts {
                grid-template-columns: 1fr;
            }

            .analytics-toolbar select {
                min-width: 100%;
            }

            .drilldown-header h2 {
                font-size: 1rem;
                word-break: break-word;
            }
        }

        /* Hide sections by default */
        .view-section {
            display: none;
        }

        .view-section.active {
            display: block;
        }


/* ============================================================================
   PAGE-SPECIFIC: SESSION
   ============================================================================ */
/* Use quiz-v3.css variables, fallback to these */
        :root {
            --v2-bg-primary: var(--quiz-bg-primary, #0f172a);
            --v2-bg-secondary: var(--quiz-bg-secondary, #1e293b);
            --v2-bg-tertiary: var(--quiz-bg-elevated, #334155);
            --v2-text-primary: var(--quiz-text-primary, #f1f5f9);
            --v2-text-secondary: var(--quiz-text-secondary, #e2e8f0);
            --v2-text-muted: var(--quiz-text-muted, #94a3b8);
            --v2-accent-purple: var(--quiz-accent-purple, #8b5cf6);
            --v2-accent-blue: var(--quiz-accent-blue, #3b82f6);
            --v2-accent-green: var(--quiz-correct, #10b981);
            --v2-accent-red: var(--quiz-incorrect, #ef4444);
            --v2-accent-cyan: var(--quiz-accent-teal, #06b6d4);
        }
        
        /* Prevent text selection on header/nav only (NOT answer options) */
        .quiz-header, .quiz-navigation, .nav-btn, .submit-answer-btn {
            -webkit-user-select: none;
            user-select: none;
        }

        /* Skeleton loading styles */
        .skeleton-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.75rem 1rem;
            background: var(--v2-bg-secondary);
            border-radius: 10px;
            margin-bottom: 0.75rem;
        }
        .skeleton-bar {
            height: 6px;
            background: var(--v2-bg-tertiary);
            border-radius: 3px;
            margin-bottom: 1rem;
            overflow: hidden;
        }
        .skeleton-bar::after {
            content: '';
            display: block;
            height: 100%;
            width: 30%;
            background: linear-gradient(90deg, var(--v2-accent-purple), var(--v2-accent-blue));
            border-radius: 3px;
            animation: skeletonPulse 1.5s ease-in-out infinite;
        }
        .skeleton-card {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 16px;
            padding: 1.25rem;
        }
        .skeleton-line {
            background: var(--v2-bg-tertiary);
            border-radius: 6px;
            margin-bottom: 0.5rem;
            animation: skeletonPulse 1.5s ease-in-out infinite;
        }
        .skeleton-option {
            height: 52px;
            background: var(--v2-bg-primary);
            border: 2px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            margin-bottom: 0.5rem;
            animation: skeletonPulse 1.5s ease-in-out infinite;
        }
        .skeleton-option:nth-child(2) { animation-delay: 0.1s; }
        .skeleton-option:nth-child(3) { animation-delay: 0.2s; }
        .skeleton-option:nth-child(4) { animation-delay: 0.3s; }
        @keyframes skeletonPulse {
            0%, 100% { opacity: 0.5; }
            50% { opacity: 1; }
        }

        /* Header */
        .quiz-header {
            background: var(--v2-bg-secondary);
            border-bottom: 1px solid var(--v2-bg-tertiary);
            padding: 1rem 1.5rem;
            position: sticky;
            top: 0;
            z-index: 100;
            flex-shrink: 0;
        }

        @media (max-width: 768px) {
            .quiz-header {
                padding: 0.5rem 0.75rem;
            }
            /* Hide badges row on mobile — saves ~40px */
            .quiz-progress-info {
                display: none !important;
            }
            .quiz-topic {
                font-size: 0.875rem;
            }
            .quiz-topic svg {
                width: 16px;
                height: 16px;
            }
            .exit-btn span {
                display: none;
            }
            .exit-btn {
                padding: 0.375rem;
                min-width: 32px;
                justify-content: center;
                border: none;
            }
            .exit-btn svg {
                width: 16px;
                height: 16px;
            }
        }

        .quiz-header-inner {
            max-width: 900px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
        }

        .quiz-info {
            display: flex;
            align-items: center;
            gap: 1.5rem;
        }

        .quiz-topic {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            color: var(--v2-text-primary);
        }

        .quiz-topic svg {
            width: 20px;
            height: 20px;
            color: var(--v2-accent-purple);
        }

        .quiz-progress-info {
            display: flex;
            align-items: center;
            gap: 1rem;
            font-size: 0.875rem;
            color: var(--v2-text-muted);
        }

        .quiz-progress-info svg {
            width: 16px;
            height: 16px;
        }

        .progress-badge {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: var(--v2-bg-tertiary);
            padding: 0.375rem 0.75rem;
            border-radius: 6px;
        }

        /* Timer */
        .quiz-timer {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: var(--v2-bg-tertiary);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-weight: 600;
            font-family: 'SF Mono', Consolas, monospace;
        }

        .quiz-timer svg {
            width: 18px;
            height: 18px;
            color: var(--v2-accent-cyan);
        }

        .quiz-timer.warning {
            background: rgba(239, 68, 68, 0.2);
            color: var(--v2-accent-red);
        }

        .quiz-timer.warning svg {
            color: var(--v2-accent-red);
            animation: pulse 1s infinite;
        }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.5; }
        }

        /* Level Indicator Badge */
        .level-badge {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: var(--v2-bg-tertiary);
            padding: 0.375rem 0.75rem;
            border-radius: 6px;
            font-size: 0.875rem;
            font-weight: 600;
            border: 1px solid transparent;
        }

        .level-badge svg {
            width: 16px;
            height: 16px;
        }

        .level-badge.level-all {
            background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(59, 130, 246, 0.15));
            border-color: rgba(139, 92, 246, 0.3);
            color: #a78bfa;
        }

        .level-badge.level-emtb {
            background: rgba(16, 185, 129, 0.15);
            border-color: rgba(16, 185, 129, 0.3);
            color: #34d399;
        }

        .level-badge.level-paramedic {
            background: rgba(59, 130, 246, 0.15);
            border-color: rgba(59, 130, 246, 0.3);
            color: #60a5fa;
        }

        .level-badge.level-rn {
            background: rgba(168, 85, 247, 0.15);
            border-color: rgba(168, 85, 247, 0.3);
            color: #c084fc;
        }

        .level-badge.level-fpc-cfrn {
            background: rgba(239, 68, 68, 0.15);
            border-color: rgba(239, 68, 68, 0.3);
            color: #f87171;
        }

        .exit-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: transparent;
            border: 1px solid var(--v2-bg-tertiary);
            color: var(--v2-text-muted);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .exit-btn:hover {
            background: var(--v2-bg-tertiary);
            color: var(--v2-text-primary);
        }

        .exit-btn svg {
            width: 18px;
            height: 18px;
        }

        /* Main Quiz Area */
        .quiz-container {
            max-width: 900px;
            margin: 0 auto;
            padding: 1.5rem 1.25rem;
        }

        @media (max-width: 768px) {
            .quiz-container {
                padding: 0.5rem 0.75rem;
                /* space for fixed nav + safe area */
                padding-bottom: calc(70px + env(safe-area-inset-bottom));
            }
        }

        /* Progress Bar */
        .progress-bar-container {
            margin-bottom: 1.5rem;
        }

        .progress-bar {
            background: var(--v2-bg-tertiary);
            height: 8px;
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 0.75rem;
        }

        .progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--v2-accent-purple), var(--v2-accent-blue));
            border-radius: 4px;
            transition: width 0.3s ease;
        }

        .progress-indicators {
            display: flex;
            gap: 0.375rem;
            flex-wrap: wrap;
        }

        .progress-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            background: var(--v2-bg-tertiary);
            border: 2px solid var(--v2-bg-tertiary);
            transition: all 0.2s;
            cursor: pointer;
        }

        .progress-dot.current {
            background: var(--v2-accent-purple);
            border-color: var(--v2-accent-purple);
            transform: scale(1.2);
        }

        .progress-dot.answered {
            background: var(--v2-accent-green);
            border-color: var(--v2-accent-green);
        }

        .progress-dot.incorrect {
            background: var(--v2-accent-red);
            border-color: var(--v2-accent-red);
        }

        .progress-dot.flagged {
            border-color: var(--v2-accent-cyan);
        }

        .progress-dot.answered-neutral {
            background: var(--v2-accent-cyan);
            border-color: var(--v2-accent-cyan);
        }

        /* Question Card */
        .question-card {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 16px;
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }

        .question-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            margin-bottom: 1.25rem;
        }

        .question-number {
            font-size: 0.875rem;
            color: var(--v2-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .question-meta {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .question-difficulty {
            display: flex;
            align-items: center;
            gap: 0.375rem;
        }

        .difficulty-dots {
            display: flex;
            gap: 0.25rem;
        }

        .difficulty-dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            background: var(--v2-bg-tertiary);
            transition: background 0.2s;
        }

        .difficulty-dot.filled { background: var(--v2-accent-green); }
        .difficulty--3 .difficulty-dot.filled { background: var(--v2-accent-yellow, #f59e0b); }
        .difficulty--4 .difficulty-dot.filled { background: var(--v2-accent-orange, #f97316); }
        .difficulty--5 .difficulty-dot.filled { background: var(--v2-accent-red, #ef4444); }

        .difficulty-label {
            font-size: 0.6875rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            color: var(--v2-text-muted);
        }

        .difficulty--1 .difficulty-label { color: var(--v2-accent-green); }
        .difficulty--2 .difficulty-label { color: var(--v2-accent-green); }
        .difficulty--3 .difficulty-label { color: var(--v2-accent-yellow, #f59e0b); }
        .difficulty--4 .difficulty-label { color: var(--v2-accent-orange, #f97316); }
        .difficulty--5 .difficulty-label { color: var(--v2-accent-red, #ef4444); }

        .flag-btn {
            background: transparent;
            border: none;
            color: var(--v2-text-muted);
            cursor: pointer;
            padding: 0.25rem;
            transition: color 0.2s;
        }

        .flag-btn:hover, .flag-btn.active {
            color: var(--v2-accent-cyan);
        }

        .flag-btn svg {
            width: 20px;
            height: 20px;
        }

        .question-text {
            font-size: 1.125rem;
            line-height: 1.65;
            color: var(--v2-text-primary);
            margin-bottom: 1.5rem;
        }

        .question-image {
            max-width: 100%;
            border-radius: 12px;
            margin-bottom: 2rem;
        }

        /* Answer Options */
        .answer-options {
            display: flex;
            flex-direction: column;
            gap: 0.875rem;
        }

        .answer-option {
            background: var(--v2-bg-primary);
            border: 2px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            padding: 1.125rem 1.25rem;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            flex-wrap: wrap;
            align-items: flex-start;
            gap: 0.5rem 1rem;
            min-height: 60px;
        }

        .answer-option:hover:not(.disabled) {
            border-color: var(--v2-accent-purple);
            background: rgba(139, 92, 246, 0.1);
        }

        /* App-like: tap/press feedback */
        @media (hover: hover) {
            .answer-option:active:not(.disabled) {
                opacity: 0.7;
            }
            .nav-btn:active:not(:disabled) {
                opacity: 0.7;
            }
        }

        .answer-option.selected {
            border-color: var(--v2-accent-purple);
            background: rgba(139, 92, 246, 0.1);
        }

        /* Multi-select checkbox */
        .ms-checkbox {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 18px;
            height: 18px;
            border: 2px solid var(--quiz-text-muted, #64748b);
            border-radius: 4px;
            margin-right: 4px;
            flex-shrink: 0;
            transition: all 0.15s;
        }
        .ms-checkbox i, .ms-checkbox svg {
            width: 12px;
            height: 12px;
            color: white;
        }
        .answer-option.selected .ms-checkbox {
            background: var(--v2-accent-purple, #8b5cf6);
            border-color: var(--v2-accent-purple, #8b5cf6);
        }
        .answer-option.correct .ms-checkbox {
            background: var(--v2-accent-green, #10b981);
            border-color: var(--v2-accent-green, #10b981);
        }
        .answer-option.incorrect .ms-checkbox {
            background: var(--v2-accent-red, #ef4444);
            border-color: var(--v2-accent-red, #ef4444);
        }

        .answer-option.correct {
            border-color: var(--v2-accent-green);
            background: rgba(16, 185, 129, 0.1);
        }

        .answer-option.incorrect {
            border-color: var(--v2-accent-red);
            background: rgba(239, 68, 68, 0.1);
        }

        .answer-option.disabled {
            cursor: default;
            opacity: 0.8;
        }

        .answer-option.crossed-off {
            opacity: 0.35;
            text-decoration: line-through;
            border-color: var(--v2-bg-tertiary);
            background: transparent;
            position: relative;
        }

        .answer-option.crossed-off .option-indicator {
            text-decoration: line-through;
            opacity: 0.5;
        }

        .answer-option.crossed-off:hover:not(.disabled) {
            border-color: var(--v2-bg-tertiary);
            background: transparent;
            opacity: 0.5;
        }

        .cross-off-btn {
            background: none;
            border: none;
            color: var(--v2-text-muted);
            cursor: pointer;
            padding: 4px;
            border-radius: 6px;
            opacity: 0;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            margin-left: auto;
        }

        .cross-off-btn svg, .cross-off-btn i {
            width: 16px;
            height: 16px;
        }

        .answer-option:hover .cross-off-btn {
            opacity: 0.6;
        }

        .cross-off-btn:hover {
            opacity: 1 !important;
            color: var(--v2-accent-red);
            background: rgba(239, 68, 68, 0.1);
        }

        .answer-option.crossed-off .cross-off-btn {
            opacity: 0.6;
            color: var(--v2-accent-green);
        }

        .answer-option.crossed-off .cross-off-btn:hover {
            color: var(--v2-accent-green);
            background: rgba(16, 185, 129, 0.1);
        }

        .submit-answer-area {
            margin-top: 1rem;
            display: flex;
            justify-content: center;
        }

        .submit-answer-btn {
            background: linear-gradient(135deg, var(--v2-accent-purple), var(--v2-accent-blue));
            color: white;
            border: none;
            padding: 0.85rem 2.5rem;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            opacity: 0;
            transform: translateY(8px);
            pointer-events: none;
        }

        .submit-answer-btn.visible {
            opacity: 1;
            transform: translateY(0);
            pointer-events: auto;
        }

        .submit-answer-btn:hover {
            filter: brightness(1.15);
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
        }

        .submit-answer-btn i, .submit-answer-btn svg {
            width: 18px;
            height: 18px;
        }

        .option-indicator {
            width: 32px;
            height: 32px;
            min-width: 32px;
            border-radius: 8px;
            background: var(--v2-bg-tertiary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.875rem;
            color: var(--v2-text-muted);
            transition: all 0.2s;
        }

        .answer-option.selected .option-indicator {
            background: var(--v2-accent-purple);
            color: white;
        }

        .answer-option.correct .option-indicator {
            background: var(--v2-accent-green);
            color: white;
        }

        .answer-option.incorrect .option-indicator {
            background: var(--v2-accent-red);
            color: white;
        }

        .option-text {
            flex: 1;
            line-height: 1.7;
            padding-top: 0.3rem;
            font-size: 0.9375rem;
        }

        /* Inline Rationale */
        .option-rationale {
            display: none;
            flex-basis: 100%;
            padding: 0.6rem 0.75rem 0.25rem;
            padding-left: calc(32px + 1rem + 0.75rem); /* indicator width + gap + padding */
            font-size: 0.82rem;
            line-height: 1.5;
            color: var(--v2-text-muted);
            border-top: 1px solid rgba(255,255,255,0.06);
        }

        .answer-option.disabled .option-rationale {
            display: block;
            animation: fadeIn 0.3s ease;
        }

        .answer-option.correct .option-rationale {
            color: rgba(16, 185, 129, 0.85);
        }

        .answer-option.incorrect .option-rationale {
            color: rgba(239, 68, 68, 0.7);
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        /* Source reference at bottom */
        .explanation-source {
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid rgba(255,255,255,0.06);
            font-size: 0.8rem;
            color: var(--v2-text-muted);
            font-style: italic;
        }

        /* Citation reference */
        .explanation-citation {
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid rgba(255,255,255,0.06);
            font-size: 0.8rem;
            color: var(--v2-text-muted);
            font-style: italic;
        }
        .explanation-citation:empty { display: none; }

        /* Rationale Box (brief, shown first) */
        .rationale-box {
            background: var(--v2-bg-primary);
            border: 1px solid var(--v2-bg-tertiary);
            border-left: 4px solid var(--v2-accent-blue);
            border-radius: 8px;
            padding: 1rem 1.25rem;
            margin-top: 1.25rem;
            display: none;
        }
        .rationale-box.visible {
            display: block;
            animation: slideIn 0.3s ease;
        }
        .rationale-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            color: var(--v2-accent-blue);
            margin-bottom: 0.5rem;
        }
        .rationale-header svg, .rationale-header i {
            width: 16px;
            height: 16px;
        }
        .rationale-text {
            color: var(--v2-text-secondary);
            line-height: 1.6;
            font-size: 0.95rem;
        }

        /* Explanation Box */
        .explanation-box {
            background: var(--v2-bg-primary);
            border: 1px solid var(--v2-bg-tertiary);
            border-left: 4px solid var(--v2-accent-green);
            border-radius: 8px;
            padding: 1.25rem;
            margin-top: 1.5rem;
            display: none;
        }

        .explanation-box.visible {
            display: block;
            animation: slideIn 0.3s ease;
        }

        @keyframes slideIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .explanation-header {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            color: var(--v2-accent-green);
            margin-bottom: 0.75rem;
        }

        .explanation-header svg {
            width: 18px;
            height: 18px;
        }

        .explanation-text {
            color: var(--v2-text-secondary);
            line-height: 1.7;
        }

        /* Navigation */
        .quiz-navigation {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            padding: 1rem 1.5rem;
        }

        @media (max-width: 768px) {
            .quiz-navigation {
                position: fixed;
                bottom: 0;
                left: 0;
                right: 0;
                z-index: 99;
                background: var(--v2-bg-secondary);
                border-top: 1px solid var(--v2-bg-tertiary);
                padding: 0.625rem 1rem;
                /* Safe area for modern iPhones with home indicator */
                padding-bottom: calc(0.625rem + env(safe-area-inset-bottom));
            }
        }

        .nav-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.875rem 1.5rem;
            border-radius: 10px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }

        .nav-btn svg {
            width: 20px;
            height: 20px;
        }

        .nav-btn-prev {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            color: var(--v2-text-secondary);
        }

        .nav-btn-prev:hover:not(:disabled) {
            background: var(--v2-bg-tertiary);
        }

        .nav-btn-next {
            background: linear-gradient(135deg, var(--v2-accent-purple), var(--v2-accent-blue));
            border: none;
            color: white;
        }

        .nav-btn-next:hover:not(:disabled) {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
        }

        .nav-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .nav-btn-submit {
            background: linear-gradient(135deg, var(--v2-accent-green), #059669);
        }

        /* Loading & Error states use shared .quiz-state classes from quiz-v3.css */

        /* True/False Buttons */
        .tf-options {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
        }

        .tf-option {
            padding: 1.5rem;
            text-align: center;
            font-size: 1.125rem;
            font-weight: 600;
        }

        /* Fill-in-blank Input */
        .fib-input {
            width: 100%;
            padding: 1rem 1.25rem;
            background: var(--v2-bg-primary);
            border: 2px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            color: var(--v2-text-primary);
            font-size: 1.125rem;
            transition: border-color 0.2s;
        }

        .fib-input:focus {
            outline: none;
            border-color: var(--v2-accent-purple);
        }

        /* Q&A Self Assessment */
        .qa-options {
            display: flex;
            gap: 1rem;
            justify-content: center;
        }

        .qa-option {
            flex: 1;
            max-width: 200px;
            padding: 1.5rem;
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.75rem;
        }

        .qa-option svg {
            width: 32px;
            height: 32px;
        }

        .qa-knew-it {
            border-color: var(--v2-accent-green);
        }

        .qa-knew-it:hover {
            background: rgba(16, 185, 129, 0.1);
        }

        .qa-didnt-know {
            border-color: var(--v2-accent-red);
        }

        .qa-didnt-know:hover {
            background: rgba(239, 68, 68, 0.1);
        }

        .scenario-block {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .scenario-block__heading {
            background: rgba(59, 130, 246, 0.12);
            border: 1px solid rgba(59, 130, 246, 0.3);
            border-radius: 10px;
            color: var(--v2-text-primary);
            line-height: 1.6;
            padding: 0.9rem 1rem;
        }

        .scenario-part {
            background: var(--v2-bg-primary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            padding: 1rem;
        }

        .scenario-part__header {
            align-items: center;
            display: flex;
            gap: 0.5rem;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }

        .scenario-part__number {
            color: var(--v2-text-muted);
            font-size: 0.75rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .scenario-part__type {
            background: rgba(139, 92, 246, 0.2);
            border-radius: 999px;
            color: var(--v2-accent-purple);
            font-size: 0.7rem;
            font-weight: 700;
            letter-spacing: 0.04em;
            padding: 0.2rem 0.55rem;
            text-transform: uppercase;
        }

        .scenario-part__text {
            color: var(--v2-text-primary);
            line-height: 1.6;
            margin-bottom: 0.9rem;
        }

        .scenario-part__image {
            border-radius: 10px;
            margin-bottom: 0.9rem;
            max-width: 100%;
        }

        .scenario-part__answers {
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
        }

        .scenario-part__option {
            margin: 0;
        }

        .scenario-part__explanation {
            border-top: 1px solid rgba(255, 255, 255, 0.07);
            color: var(--v2-text-muted);
            font-size: 0.9rem;
            line-height: 1.5;
            margin-top: 0.9rem;
            padding-top: 0.75rem;
        }

        /* Responsive */
        @media (max-width: 640px) {
            .nav-btn {
                padding: 0.625rem 1rem;
                font-size: 0.875rem;
            }

            .tf-options {
                grid-template-columns: 1fr;
            }

            .qa-options {
                flex-direction: column;
            }

            .qa-option {
                max-width: 100%;
            }

        }

        @media (max-width: 480px) {
            .quiz-navigation {
                padding: 0.5rem 0.75rem;
            }

            .nav-btn {
                padding: 0.5rem 0.75rem;
                font-size: 0.8125rem;
            }

            .scenario-part {
                padding: 0.75rem;
            }

            .scenario-part__text {
                font-size: 0.9rem;
            }

            .quiz-timer {
                font-size: 0.8125rem;
            }
        }

        /* ===== Mobile quiz sizing (≤768px) ===== */
        @media (max-width: 768px) {
            .question-card {
                padding: 1rem;
                border-radius: 10px;
                margin-bottom: 0;
            }

            .answer-options {
                gap: 0.5rem;
            }

            .answer-option {
                padding: 0.625rem 0.75rem;
                border-radius: 10px;
                gap: 0.5rem;
                min-height: 44px;
                border-width: 1.5px;
            }

            .option-indicator {
                width: 26px;
                height: 26px;
                min-width: 26px;
                border-radius: 6px;
                font-size: 0.8125rem;
            }

            .option-text {
                font-size: 0.875rem;
                line-height: 1.45;
                padding-top: 0.1rem;
            }

            .progress-bar-container {
                margin-bottom: 0.375rem;
            }

            .progress-bar {
                height: 4px;
                margin-bottom: 0;
                border-radius: 2px;
            }

            .progress-indicators {
                display: none;
            }

            .question-header {
                margin-bottom: 0.5rem;
            }

            .question-number {
                font-size: 0.75rem;
            }

            .question-text {
                font-size: 0.9375rem;
                line-height: 1.5;
                margin-bottom: 0.75rem;
            }

            .difficulty-dot {
                width: 6px;
                height: 6px;
            }

            .difficulty-label {
                font-size: 0.625rem;
            }

            .flag-btn svg {
                width: 16px;
                height: 16px;
            }

            .submit-answer-area {
                margin-top: 0.5rem;
            }

            .submit-answer-btn {
                padding: 0.625rem 1.5rem;
                font-size: 0.875rem;
                border-radius: 10px;
            }
        }


/* ============================================================================
   PAGE-SPECIFIC: STATS
   ============================================================================ */
/* ============================================
           QUIZ SUB-NAVIGATION
           ============================================ */
        .quiz-subnav {
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(51, 65, 85, 0.5);
            position: sticky;
            top: 88px;
            z-index: 90;
        }
        .quiz-subnav__inner {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 1.5rem;
            display: flex;
            gap: 0.25rem;
            overflow-x: auto;
            scrollbar-width: none;
        }
        .quiz-subnav__inner::-webkit-scrollbar { display: none; }
        .quiz-subnav__link {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.875rem 1.25rem;
            color: rgba(255, 255, 255, 0.55);
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 500;
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .quiz-subnav__link i,
        .quiz-subnav__link svg { width: 16px; height: 16px; }
        .quiz-subnav__link:hover {
            color: rgba(255, 255, 255, 0.85);
            background: rgba(255, 255, 255, 0.04);
        }
        .quiz-subnav__link--active {
            color: #fff;
            border-bottom-color: #3b82f6;
        }
        /* Hide subnav on mobile (bottom nav handles it) */
        .quiz-subnav { display: none; }
        @media (min-width: 901px) {
            .quiz-subnav { display: block; }
        }

        /* ============================================
           TRAINER STATS — POKÉMON-STYLE CARD
           ============================================ */

        .stats-page-container {
            max-width: 1000px;
            margin: 0 auto;
            padding: 0.75rem 1rem 1rem;
        }
        @media (max-width: 768px) {
            .stats-page-container {
                padding-top: 0.5rem;
            }
        }

        .stats-page-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            flex-wrap: wrap;
            gap: 0.75rem;
            margin-bottom: 1.25rem;
        }
        .stats-page-header h1 {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--v2-text-primary);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .stats-page-header h1 span {
            font-size: 0.8rem;
            color: var(--v2-text-muted);
            font-weight: 400;
        }

        /* ── Loading ── */
        .stats-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 400px;
            gap: 1rem;
        }
        .stats-loading .pokeball-spin {
            width: 48px;
            height: 48px;
            border: 4px solid rgba(239, 68, 68, 0.3);
            border-top-color: #ef4444;
            border-radius: 50%;
            animation: pokespin 0.8s linear infinite;
        }
        @keyframes pokespin {
            to { transform: rotate(360deg); }
        }

        /* ── Trainer Card (Top Section) ── */
        .trainer-card {
            background: linear-gradient(145deg, #1a2744, #0f1d36);
            border: 2px solid rgba(59, 130, 246, 0.3);
            border-radius: var(--v2-radius-xl);
            overflow: hidden;
            margin-bottom: 1.5rem;
            position: relative;
        }
        .trainer-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, #3b82f6, #8b5cf6, #ef4444, #f59e0b, #10b981);
        }

        .trainer-card-inner {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0;
            min-height: 340px;
        }

        /* Left panel — info */
        .trainer-info {
            padding: 2rem;
            display: flex;
            flex-direction: column;
            gap: 0;
        }

        .trainer-info-row {
            display: grid;
            grid-template-columns: 130px 1fr;
            padding: 0.55rem 0;
            border-bottom: 1px solid rgba(148, 163, 184, 0.1);
            align-items: center;
        }
        .trainer-info-row:last-child {
            border-bottom: none;
        }
        .trainer-info-label {
            color: var(--v2-text-muted);
            font-size: 0.85rem;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .trainer-info-value {
            color: var(--v2-text-primary);
            font-weight: 600;
            font-size: 1rem;
        }

        .trainer-name {
            font-size: 1.4rem !important;
            background: linear-gradient(135deg, #f1f5f9, #94a3b8);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .trainer-type-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.2rem 0.75rem;
            border-radius: 999px;
            font-size: 0.8rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: white;
            width: fit-content;
        }

        /* Type colors based on credential */
        .type-emt { background: linear-gradient(135deg, #16a34a, #15803d); }
        .type-aemt { background: linear-gradient(135deg, #2563eb, #1d4ed8); }
        .type-paramedic { background: linear-gradient(135deg, #dc2626, #b91c1c); }
        .type-ccp { background: linear-gradient(135deg, #7c3aed, #6d28d9); }
        .type-rn { background: linear-gradient(135deg, #0891b2, #0e7490); }
        .type-nurse { background: linear-gradient(135deg, #0891b2, #0e7490); }
        .type-md { background: linear-gradient(135deg, #ca8a04, #a16207); }
        .type-do { background: linear-gradient(135deg, #ca8a04, #a16207); }
        .type-default { background: linear-gradient(135deg, #64748b, #475569); }

        /* XP Bar */
        .xp-section {
            margin-top: auto;
            padding-top: 0.75rem;
        }
        .xp-header {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            margin-bottom: 0.35rem;
        }
        .xp-label {
            color: var(--v2-text-muted);
            font-size: 0.8rem;
            font-weight: 600;
            text-transform: uppercase;
        }
        .xp-value {
            color: #f59e0b;
            font-size: 1.1rem;
            font-weight: 700;
        }
        .xp-sublabel {
            color: var(--v2-text-muted);
            font-size: 0.75rem;
            margin-top: 0.25rem;
        }
        .xp-bar {
            height: 10px;
            background: rgba(148, 163, 184, 0.15);
            border-radius: 5px;
            overflow: hidden;
        }
        .xp-bar-fill {
            height: 100%;
            border-radius: 5px;
            background: linear-gradient(90deg, #f59e0b, #ef4444);
            transition: width 1.5s ease-out;
            width: 0%;
        }

        .level-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            background: linear-gradient(135deg, #f59e0b, #ef4444);
            color: white;
            font-weight: 800;
            font-size: 1.3rem;
            padding: 0.2rem 0.8rem;
            border-radius: var(--v2-radius-md);
            width: fit-content;
        }
        .level-badge-label {
            font-size: 0.7rem;
            font-weight: 600;
            text-transform: uppercase;
            opacity: 0.9;
        }

        /* ── Right panel — Radar Chart ── */
        .radar-panel {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.5rem;
            position: relative;
            background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.05) 0%, transparent 70%);
        }
        .radar-container {
            width: 100%;
            max-width: 320px;
            aspect-ratio: 1;
            position: relative;
        }
        .radar-svg {
            width: 100%;
            height: 100%;
        }
        .radar-axis-line {
            stroke: rgba(148, 163, 184, 0.2);
            stroke-width: 1;
        }
        .radar-ring {
            fill: none;
            stroke: rgba(148, 163, 184, 0.12);
            stroke-width: 1;
        }
        .radar-shape {
            fill: rgba(59, 130, 246, 0.15);
            stroke: #3b82f6;
            stroke-width: 2.5;
            transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .radar-shape.animated {
            fill: rgba(6, 182, 212, 0.2);
            stroke: #06b6d4;
        }
        .radar-dot {
            fill: #06b6d4;
            stroke: white;
            stroke-width: 2;
            r: 4;
            transition: all 1.2s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .radar-label {
            fill: var(--v2-text-muted);
            font-size: 11px;
            font-weight: 600;
            text-anchor: middle;
            dominant-baseline: middle;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .radar-label-value {
            fill: var(--v2-text-primary);
            font-size: 13px;
            font-weight: 700;
        }

        /* ── Stat Bars Section ── */
        .stat-bars-section {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .stat-bar-card {
            background: var(--v2-bg-secondary);
            border: 1px solid rgba(148, 163, 184, 0.1);
            border-radius: var(--v2-radius-lg);
            padding: 1.25rem;
        }
        .stat-bar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.75rem;
        }
        .stat-bar-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            font-size: 0.95rem;
            color: var(--v2-text-primary);
        }
        .stat-bar-title i,
        .stat-bar-title svg {
            width: 18px;
            height: 18px;
        }
        .stat-bar-number {
            font-size: 1.4rem;
            font-weight: 800;
            color: var(--v2-text-primary);
        }

        .stat-bar-track {
            height: 8px;
            background: rgba(148, 163, 184, 0.1);
            border-radius: 4px;
            overflow: hidden;
            margin-bottom: 0.35rem;
        }
        .stat-bar-fill {
            height: 100%;
            border-radius: 4px;
            transition: width 1.2s ease-out;
            width: 0%;
        }
        .stat-bar-meta {
            font-size: 0.75rem;
            color: var(--v2-text-muted);
        }

        /* Color variants */
        .stat-color-blue .stat-bar-fill { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
        .stat-color-green .stat-bar-fill { background: linear-gradient(90deg, #10b981, #34d399); }
        .stat-color-purple .stat-bar-fill { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
        .stat-color-orange .stat-bar-fill { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
        .stat-color-red .stat-bar-fill { background: linear-gradient(90deg, #ef4444, #f87171); }
        .stat-color-cyan .stat-bar-fill { background: linear-gradient(90deg, #06b6d4, #22d3ee); }

        .stat-color-blue .stat-bar-number { color: #60a5fa; }
        .stat-color-green .stat-bar-number { color: #34d399; }
        .stat-color-purple .stat-bar-number { color: #a78bfa; }
        .stat-color-orange .stat-bar-number { color: #fbbf24; }
        .stat-color-red .stat-bar-number { color: #f87171; }
        .stat-color-cyan .stat-bar-number { color: #22d3ee; }

        .stat-color-blue .stat-bar-title i,
        .stat-color-blue .stat-bar-title svg { color: #60a5fa; }
        .stat-color-green .stat-bar-title i,
        .stat-color-green .stat-bar-title svg { color: #34d399; }
        .stat-color-purple .stat-bar-title i,
        .stat-color-purple .stat-bar-title svg { color: #a78bfa; }
        .stat-color-orange .stat-bar-title i,
        .stat-color-orange .stat-bar-title svg { color: #fbbf24; }
        .stat-color-red .stat-bar-title i,
        .stat-color-red .stat-bar-title svg { color: #f87171; }
        .stat-color-cyan .stat-bar-title i,
        .stat-color-cyan .stat-bar-title svg { color: #22d3ee; }

        /* ── Category Breakdown (TYPE MATCHUP STYLE) ── */
        .category-section-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--v2-text-primary);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .category-section-title i,
        .category-section-title svg {
            width: 20px;
            height: 20px;
            color: #f59e0b;
        }

        .category-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .category-card {
            background: var(--v2-bg-secondary);
            border: 1px solid rgba(148, 163, 184, 0.1);
            border-radius: var(--v2-radius-lg);
            padding: 1rem 1.25rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            transition: border-color 0.2s, transform 0.2s;
        }
        .category-card:hover {
            border-color: rgba(59, 130, 246, 0.3);
            transform: translateY(-1px);
        }
        .category-icon {
            width: 44px;
            height: 44px;
            border-radius: var(--v2-radius-md);
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 1.3rem;
        }
        .category-details {
            flex: 1;
            min-width: 0;
        }
        .category-name {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--v2-text-primary);
            margin-bottom: 0.25rem;
        }
        .category-accuracy-row {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            margin-bottom: 0.35rem;
        }
        .category-accuracy-bar {
            flex: 1;
            height: 6px;
            background: rgba(148, 163, 184, 0.1);
            border-radius: 3px;
            overflow: hidden;
        }
        .category-accuracy-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 1s ease-out;
        }
        .category-accuracy-pct {
            font-size: 0.85rem;
            font-weight: 700;
            min-width: 38px;
            text-align: right;
        }
        .category-meta {
            font-size: 0.72rem;
            color: var(--v2-text-muted);
        }

        /* ── Strengths & Weaknesses ── */
        .strengths-weaknesses {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .sw-panel {
            background: var(--v2-bg-secondary);
            border: 1px solid rgba(148, 163, 184, 0.1);
            border-radius: var(--v2-radius-lg);
            padding: 1.25rem;
        }
        .sw-panel-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 700;
            font-size: 0.95rem;
            margin-bottom: 1rem;
        }
        .sw-panel-title i,
        .sw-panel-title svg { width: 18px; height: 18px; }
        .sw-strength .sw-panel-title { color: #10b981; }
        .sw-strength .sw-panel-title i,
        .sw-strength .sw-panel-title svg { color: #10b981; }
        .sw-weakness .sw-panel-title { color: #ef4444; }
        .sw-weakness .sw-panel-title i,
        .sw-weakness .sw-panel-title svg { color: #ef4444; }

        .sw-topic {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0.5rem 0;
            border-bottom: 1px solid rgba(148, 163, 184, 0.06);
        }
        .sw-topic:last-child { border-bottom: none; }
        .sw-topic-name {
            font-size: 0.85rem;
            color: var(--v2-text-secondary);
        }
        .sw-topic-pct {
            font-size: 0.85rem;
            font-weight: 700;
        }
        .sw-strength .sw-topic-pct { color: #10b981; }
        .sw-weakness .sw-topic-pct { color: #ef4444; }
        .sw-empty {
            color: var(--v2-text-muted);
            font-size: 0.85rem;
            font-style: italic;
            padding: 0.5rem 0;
        }

        /* ── Weekly Activity (Mini chart) ── */
        .activity-section {
            background: var(--v2-bg-secondary);
            border: 1px solid rgba(148, 163, 184, 0.1);
            border-radius: var(--v2-radius-lg);
            padding: 1.25rem;
            margin-bottom: 1.5rem;
        }
        .activity-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 700;
            font-size: 0.95rem;
            color: var(--v2-text-primary);
            margin-bottom: 1rem;
        }
        .activity-title i,
        .activity-title svg { width: 18px; height: 18px; color: #8b5cf6; }
        .activity-bars {
            display: flex;
            align-items: flex-end;
            gap: 0.5rem;
            height: 100px;
        }
        .activity-day {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.3rem;
        }
        .activity-bar-wrap {
            width: 100%;
            height: 80px;
            display: flex;
            align-items: flex-end;
            justify-content: center;
        }
        .activity-bar {
            width: 70%;
            max-width: 32px;
            border-radius: 4px 4px 0 0;
            background: linear-gradient(to top, #3b82f6, #8b5cf6);
            transition: height 1s ease-out;
            min-height: 2px;
        }
        .activity-day-label {
            font-size: 0.7rem;
            color: var(--v2-text-muted);
            font-weight: 600;
        }
        .activity-day-count {
            font-size: 0.7rem;
            color: var(--v2-text-secondary);
            font-weight: 600;
        }

        /* ── Community Compare ── */
        .community-card {
            background: var(--v2-bg-secondary);
            border: 1px solid rgba(148, 163, 184, 0.1);
            border-radius: var(--v2-radius-lg);
            padding: 1.25rem;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 1.5rem;
            flex-wrap: wrap;
        }
        .community-vs {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex: 1;
        }
        .community-stat {
            text-align: center;
        }
        .community-stat-label {
            font-size: 0.75rem;
            color: var(--v2-text-muted);
            text-transform: uppercase;
            font-weight: 600;
            letter-spacing: 0.03em;
            margin-bottom: 0.25rem;
        }
        .community-stat-value {
            font-size: 2rem;
            font-weight: 800;
        }
        .community-divider {
            font-size: 1.5rem;
            color: var(--v2-text-muted);
            font-weight: 300;
        }
        .community-verdict {
            font-size: 0.9rem;
            font-weight: 600;
            padding: 0.4rem 1rem;
            border-radius: 999px;
        }
        .verdict-above { background: rgba(16, 185, 129, 0.15); color: #10b981; }
        .verdict-below { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
        .verdict-even { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

        /* ── CTA ── */
        .stats-cta {
            text-align: center;
            padding: 2rem 1rem;
            margin-bottom: 2rem;
        }
        .stats-cta-text {
            color: var(--v2-text-muted);
            font-size: 0.9rem;
            margin-bottom: 1rem;
        }
        .stats-cta-buttons {
            display: flex;
            justify-content: center;
            gap: 1rem;
            flex-wrap: wrap;
        }
        .stats-cta-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.6rem 1.4rem;
            border-radius: var(--v2-radius-md);
            font-weight: 600;
            font-size: 0.9rem;
            text-decoration: none;
            transition: transform 0.15s, box-shadow 0.15s;
        }
        .stats-cta-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.3);
        }
        .stats-cta-btn i,
        .stats-cta-btn svg { width: 18px; height: 18px; }
        .stats-cta-primary {
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
            color: white;
        }
        .stats-cta-secondary {
            background: var(--v2-bg-secondary);
            border: 1px solid rgba(148, 163, 184, 0.2);
            color: var(--v2-text-primary);
        }

        /* ── No Data State ── */
        .no-data-state {
            text-align: center;
            padding: 3rem 1rem;
        }
        .no-data-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
        }
        .no-data-state h2 {
            font-size: 1.3rem;
            color: var(--v2-text-primary);
            margin-bottom: 0.5rem;
        }
        .no-data-state p {
            color: var(--v2-text-muted);
            max-width: 400px;
            margin: 0 auto 1.5rem;
        }

        /* ── Share Card ── */
        .share-btn {
            position: absolute;
            top: 16px;
            right: 16px;
            background: rgba(148, 163, 184, 0.15);
            border: 1px solid rgba(148, 163, 184, 0.2);
            color: var(--v2-text-muted);
            border-radius: var(--v2-radius-md);
            padding: 0.4rem 0.7rem;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.35rem;
            transition: all 0.2s;
            z-index: 2;
        }
        .share-btn:hover {
            background: rgba(59, 130, 246, 0.15);
            border-color: rgba(59, 130, 246, 0.3);
            color: #60a5fa;
        }
        .share-btn i,
        .share-btn svg { width: 14px; height: 14px; }

        /* ── Mobile Responsive ── */
        @media (max-width: 768px) {
            .stats-page-header {
                flex-direction: column;
                align-items: flex-start;
            }
            .trainer-card-inner {
                grid-template-columns: 1fr;
            }
            .radar-panel {
                padding: 1rem;
            }
            .radar-container {
                max-width: 260px;
            }
            .stat-bars-section {
                grid-template-columns: 1fr;
            }
            .strengths-weaknesses {
                grid-template-columns: 1fr;
            }
            .community-card {
                flex-direction: column;
                text-align: center;
            }
            .category-grid {
                grid-template-columns: 1fr;
            }
            .trainer-info-row {
                grid-template-columns: 100px 1fr;
            }
        }

        @media (max-width: 480px) {
            .stats-page-title h1 {
                font-size: 1.4rem;
            }
            .trainer-info {
                padding: 1.25rem;
            }
            .level-badge {
                font-size: 1.1rem;
            }
        }

        /* ── Stat Tooltips ── */
        [data-tip] {
            cursor: help;
        }
        .stat-tooltip {
            position: fixed;
            max-width: 280px;
            min-width: 160px;
            background: #0f172a;
            border: 1px solid rgba(59, 130, 246, 0.35);
            border-radius: 10px;
            padding: 0.6rem 0.85rem;
            color: #e2e8f0;
            font-size: 0.8rem;
            line-height: 1.45;
            font-weight: 400;
            text-align: center;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s ease;
            z-index: 9999;
            box-shadow: 0 8px 24px rgba(0,0,0,0.5);
        }
        .stat-tooltip.visible {
            opacity: 1;
        }
        .stat-tooltip::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border: 6px solid transparent;
            border-top-color: rgba(59, 130, 246, 0.35);
        }
        .stat-tooltip.below::after {
            top: auto;
            bottom: 100%;
            border-top-color: transparent;
            border-bottom-color: rgba(59, 130, 246, 0.35);
        }

        /* Level title display */
        .level-title {
            font-size: 0.75rem;
            color: #f59e0b;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            margin-left: 0.5rem;
            opacity: 0.85;
        }

        /* Practice link in weaknesses */
        .sw-practice {
            font-size: 0.72rem;
            color: #3b82f6;
            text-decoration: none;
            font-weight: 600;
            margin-left: 0.5rem;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .sw-topic:hover .sw-practice {
            opacity: 1;
        }
        .sw-practice:hover {
            text-decoration: underline;
        }

        /* Clickable category cards */
        a.category-card {
            text-decoration: none;
            color: inherit;
        }

        /* ── Licensure Level Breakdown ── */
        .licensure-section {
            margin-bottom: 1.5rem;
        }
        .licensure-section-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--v2-text-primary);
            margin-bottom: 1rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .licensure-section-title i,
        .licensure-section-title svg {
            width: 20px;
            height: 20px;
            color: #f59e0b;
        }
        .licensure-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 1rem;
        }
        .licensure-card {
            background: var(--v2-bg-secondary);
            border: 1px solid rgba(148, 163, 184, 0.1);
            border-radius: var(--v2-radius-lg);
            padding: 1.25rem;
            position: relative;
            overflow: hidden;
            transition: border-color 0.2s, transform 0.2s;
        }
        .licensure-card:hover {
            border-color: rgba(59, 130, 246, 0.3);
            transform: translateY(-1px);
        }
        .licensure-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
        }
        .licensure-card.lic-emtb::before { background: linear-gradient(90deg, #16a34a, #4ade80); }
        .licensure-card.lic-paramedic::before { background: linear-gradient(90deg, #dc2626, #f87171); }
        .licensure-card.lic-rn::before { background: linear-gradient(90deg, #0891b2, #22d3ee); }
        .licensure-card.lic-fpc-cfrn::before { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
        .licensure-card-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 0.75rem;
        }
        .licensure-card-name {
            font-size: 1rem;
            font-weight: 700;
            color: var(--v2-text-primary);
        }
        .licensure-card.lic-emtb .licensure-card-name { color: #4ade80; }
        .licensure-card.lic-paramedic .licensure-card-name { color: #f87171; }
        .licensure-card.lic-rn .licensure-card-name { color: #22d3ee; }
        .licensure-card.lic-fpc-cfrn .licensure-card-name { color: #a78bfa; }
        .licensure-card-pct {
            font-size: 1.4rem;
            font-weight: 800;
        }
        .licensure-card-bar {
            height: 6px;
            background: rgba(148, 163, 184, 0.1);
            border-radius: 3px;
            overflow: hidden;
            margin-bottom: 0.4rem;
        }
        .licensure-card-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 1.2s ease-out;
            width: 0%;
        }
        .licensure-card.lic-emtb .licensure-card-fill { background: linear-gradient(90deg, #16a34a, #4ade80); }
        .licensure-card.lic-paramedic .licensure-card-fill { background: linear-gradient(90deg, #dc2626, #f87171); }
        .licensure-card.lic-rn .licensure-card-fill { background: linear-gradient(90deg, #0891b2, #22d3ee); }
        .licensure-card.lic-fpc-cfrn .licensure-card-fill { background: linear-gradient(90deg, #7c3aed, #a78bfa); }
        .licensure-card-meta {
            font-size: 0.75rem;
            color: var(--v2-text-muted);
        }
        .licensure-empty {
            color: var(--v2-text-muted);
            font-size: 0.9rem;
            font-style: italic;
            padding: 1rem;
            background: var(--v2-bg-secondary);
            border-radius: var(--v2-radius-lg);
            text-align: center;
        }

        /* ── Level Filter Chips ── */
        .level-filter {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 0;
            flex-wrap: wrap;
            align-items: center;
        }
        .level-chip {
            padding: 0.5rem 1rem;
            border-radius: 999px;
            font-size: 0.75rem;
            font-weight: 600;
            border: none;
            outline: 1.5px solid rgba(148, 163, 184, 0.2);
            outline-offset: -1.5px;
            background: transparent;
            color: var(--v2-text-muted);
            cursor: pointer;
            transition: all 0.2s;
            text-transform: uppercase;
            letter-spacing: 0.03em;
            line-height: 1;
        }
        .level-chip:hover {
            outline-color: rgba(148, 163, 184, 0.4);
            color: var(--v2-text-secondary);
        }
        .level-chip.active {
            color: white;
            outline: none;
        }
        .level-chip[data-level="all"].active {
            background: linear-gradient(135deg, #3b82f6, #8b5cf6);
        }
        .level-chip[data-level="emtb"].active {
            background: linear-gradient(135deg, #16a34a, #4ade80);
        }
        .level-chip[data-level="paramedic"].active {
            background: linear-gradient(135deg, #dc2626, #f87171);
        }
        .level-chip[data-level="rn"].active {
            background: linear-gradient(135deg, #0891b2, #22d3ee);
        }
        .level-chip[data-level="fpc-cfrn"].active {
            background: linear-gradient(135deg, #7c3aed, #a78bfa);
        }
        .level-filter-label {
            display: flex;
            align-items: center;
            gap: 0.35rem;
            color: var(--v2-text-muted);
            font-size: 0.75rem;
            font-weight: 600;
            text-transform: uppercase;
            margin-right: 0.25rem;
        }
        .level-filter-label i,
        .level-filter-label svg {
            width: 14px;
            height: 14px;
        }


/* ============================================================================
   PAGE-SPECIFIC: RESULTS
   ============================================================================ */
/* Use quiz-v3.css variables, fallback to these */
        :root {
            --v2-bg-primary: var(--quiz-bg-primary, #0f172a);
            --v2-bg-secondary: var(--quiz-bg-secondary, #1e293b);
            --v2-bg-tertiary: var(--quiz-bg-elevated, #334155);
            --v2-text-primary: var(--quiz-text-primary, #f1f5f9);
            --v2-text-secondary: var(--quiz-text-secondary, #e2e8f0);
            --v2-text-muted: var(--quiz-text-muted, #94a3b8);
            --v2-accent-purple: var(--quiz-accent-purple, #8b5cf6);
            --v2-accent-blue: var(--quiz-accent-blue, #3b82f6);
            --v2-accent-green: var(--quiz-correct, #10b981);
            --v2-accent-red: var(--quiz-incorrect, #ef4444);
            --v2-accent-cyan: var(--quiz-accent-teal, #06b6d4);
            --v2-accent-yellow: var(--quiz-accent-gold, #f59e0b);
        }
        
        /* Results Hero */
        .results-hero {
            background: linear-gradient(180deg, var(--v2-bg-secondary) 0%, var(--v2-bg-primary) 100%);
            padding: 4rem 1.5rem;
            text-align: center;
            position: relative;
            overflow: hidden;
        }

        .results-hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 200%;
            height: 100%;
            background: radial-gradient(ellipse at center top, rgba(139, 92, 246, 0.15) 0%, transparent 70%);
            pointer-events: none;
        }

        .results-hero-content {
            position: relative;
            z-index: 1;
            max-width: 600px;
            margin: 0 auto;
        }

        /* Score Circle */
        .score-circle {
            width: 200px;
            height: 200px;
            margin: 0 auto 2rem;
            position: relative;
        }

        .score-circle svg {
            width: 100%;
            height: 100%;
            transform: rotate(-90deg);
        }

        .score-bg {
            fill: none;
            stroke: var(--v2-bg-tertiary);
            stroke-width: 12;
        }

        .score-fill {
            fill: none;
            stroke: var(--v2-accent-green);
            stroke-width: 12;
            stroke-linecap: round;
            stroke-dasharray: 565.48;
            stroke-dashoffset: 565.48;
            transition: stroke-dashoffset 1s ease-out;
        }

        .score-fill.failing {
            stroke: var(--v2-accent-red);
        }

        .score-fill.warning {
            stroke: var(--v2-accent-yellow);
        }

        .score-value {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }

        .score-percent {
            font-size: 3.5rem;
            font-weight: 800;
            color: var(--v2-text-primary);
            line-height: 1;
        }

        .score-label {
            font-size: 0.875rem;
            color: var(--v2-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.1em;
        }

        /* Result Status */
        .result-status {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.75rem 1.5rem;
            border-radius: 50px;
            font-weight: 600;
            margin-bottom: 1rem;
        }

        .result-status.passed {
            background: rgba(16, 185, 129, 0.2);
            color: var(--v2-accent-green);
            border: 1px solid rgba(16, 185, 129, 0.3);
        }

        .result-status.failed {
            background: rgba(239, 68, 68, 0.2);
            color: var(--v2-accent-red);
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .result-status svg {
            width: 20px;
            height: 20px;
        }

        .results-hero h1 {
            font-size: 1.5rem;
            color: var(--v2-text-primary);
            margin-bottom: 0.5rem;
        }

        .results-hero p {
            color: var(--v2-text-muted);
        }

        /* Exam context badges */
        .exam-context {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.6rem;
            flex-wrap: wrap;
            margin-bottom: 0.75rem;
        }

        .exam-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            padding: 0.35rem 0.75rem;
            border-radius: 8px;
            font-size: 0.8rem;
            font-weight: 600;
            background: rgba(139, 92, 246, 0.15);
            color: var(--v2-accent-purple);
            border: 1px solid rgba(139, 92, 246, 0.25);
        }

        .exam-badge svg {
            width: 14px;
            height: 14px;
        }

        .exam-badge--threshold {
            background: rgba(6, 182, 212, 0.15);
            color: var(--v2-accent-cyan);
            border-color: rgba(6, 182, 212, 0.25);
        }

        /* Topic Breakdown */
        .topic-breakdown {
            margin-bottom: 2rem;
        }

        .topic-breakdown-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 1.125rem;
            font-weight: 700;
            color: var(--v2-text-primary);
            margin-bottom: 1rem;
        }

        .topic-breakdown-title svg {
            width: 20px;
            height: 20px;
            color: var(--v2-accent-purple);
        }

        .topic-row {
            display: flex;
            align-items: center;
            gap: 1rem;
            padding: 0.75rem 0;
            border-bottom: 1px solid var(--v2-bg-tertiary);
        }

        .topic-row:last-child {
            border-bottom: none;
        }

        .topic-name {
            min-width: 140px;
            font-size: 0.875rem;
            color: var(--v2-text-secondary);
        }

        .topic-bar-wrap {
            flex: 1;
            height: 10px;
            background: var(--v2-bg-tertiary);
            border-radius: 5px;
            overflow: hidden;
        }

        .topic-bar-fill {
            height: 100%;
            border-radius: 5px;
            transition: width 0.6s ease;
        }

        .topic-bar-fill.good { background: var(--v2-accent-green); }
        .topic-bar-fill.ok { background: var(--v2-accent-yellow); }
        .topic-bar-fill.weak { background: var(--v2-accent-red); }

        .topic-score {
            min-width: 60px;
            text-align: right;
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--v2-text-muted);
        }

        /* Stats Grid */
        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 1rem;
            max-width: 800px;
            margin: 2rem auto 0;
        }

        .stat-card {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            padding: 1.25rem;
            text-align: center;
        }

        .stat-value {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--v2-text-primary);
            margin-bottom: 0.25rem;
        }

        .stat-value.correct {
            color: var(--v2-accent-green);
        }

        .stat-value.incorrect {
            color: var(--v2-accent-red);
        }

        .stat-label {
            font-size: 0.75rem;
            color: var(--v2-text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        /* Main Content */
        .results-main {
            max-width: 900px;
            margin: 0 auto;
            padding: 2rem 1.5rem;
        }

        /* Action Buttons */
        .action-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
            margin-bottom: 3rem;
        }

        .action-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.875rem 1.5rem;
            border-radius: 10px;
            font-weight: 600;
            text-decoration: none;
            transition: all 0.2s;
            cursor: pointer;
        }

        .action-btn svg {
            width: 20px;
            height: 20px;
        }

        .action-btn-primary {
            background: linear-gradient(135deg, var(--v2-accent-purple), var(--v2-accent-blue));
            color: white;
            border: none;
        }

        .action-btn-primary:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
        }

        .action-btn-secondary {
            background: var(--v2-bg-secondary);
            color: var(--v2-text-secondary);
            border: 1px solid var(--v2-bg-tertiary);
        }

        .action-btn-secondary:hover {
            background: var(--v2-bg-tertiary);
        }

        /* Review Section */
        .review-section {
            margin-bottom: 3rem;
        }

        .section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1.5rem;
        }

        .section-title {
            font-size: 1.25rem;
            color: var(--v2-text-primary);
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .section-title svg {
            width: 24px;
            height: 24px;
            color: var(--v2-accent-purple);
        }

        .filter-buttons {
            display: flex;
            gap: 0.5rem;
        }

        .filter-btn {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            color: var(--v2-text-muted);
            padding: 0.5rem 1rem;
            border-radius: 8px;
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s;
        }

        .filter-btn:hover, .filter-btn.active {
            background: var(--v2-accent-purple);
            border-color: var(--v2-accent-purple);
            color: white;
        }

        /* Question Review Cards */
        .review-list {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .review-card {
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
            border-radius: 12px;
            overflow: hidden;
            transition: all 0.2s;
        }

        .review-card.correct {
            border-left: 4px solid var(--v2-accent-green);
        }

        .review-card.incorrect {
            border-left: 4px solid var(--v2-accent-red);
        }

        .review-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 1.25rem;
            cursor: pointer;
            transition: background 0.2s;
        }

        .review-card-header:hover {
            background: var(--v2-bg-tertiary);
        }

        .review-card-left {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .review-status-icon {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .review-status-icon.correct {
            background: rgba(16, 185, 129, 0.2);
            color: var(--v2-accent-green);
        }

        .review-status-icon.incorrect {
            background: rgba(239, 68, 68, 0.2);
            color: var(--v2-accent-red);
        }

        .review-status-icon svg {
            width: 18px;
            height: 18px;
        }

        .review-question-preview {
            color: var(--v2-text-primary);
            font-weight: 500;
        }

        .review-question-preview .q-number {
            color: var(--v2-text-muted);
            font-weight: 400;
            margin-right: 0.5rem;
        }

        .review-card-right {
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .review-badge {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            background: var(--v2-bg-tertiary);
            color: var(--v2-text-muted);
        }

        .review-badge.flagged {
            background: rgba(6, 182, 212, 0.2);
            color: var(--v2-accent-cyan);
        }

        .review-badge.diff-1, .review-badge.diff-2 {
            background: rgba(16, 185, 129, 0.15);
            color: #10b981;
        }
        .review-badge.diff-3 {
            background: rgba(245, 158, 11, 0.15);
            color: #f59e0b;
        }
        .review-badge.diff-4 {
            background: rgba(249, 115, 22, 0.15);
            color: #f97316;
        }
        .review-badge.diff-5 {
            background: rgba(239, 68, 68, 0.15);
            color: #ef4444;
        }

        .expand-icon {
            color: var(--v2-text-muted);
            transition: transform 0.2s;
        }

        .expand-icon svg {
            width: 20px;
            height: 20px;
        }

        .review-card.expanded .expand-icon {
            transform: rotate(180deg);
        }

        /* Expanded Content */
        .review-card-body {
            display: none;
            padding: 1.25rem;
            border-top: 1px solid var(--v2-bg-tertiary);
            background: var(--v2-bg-primary);
        }

        .review-card.expanded .review-card-body {
            display: block;
        }

        .review-full-question {
            font-size: 1.125rem;
            line-height: 1.7;
            color: var(--v2-text-primary);
            margin-bottom: 1.5rem;
        }

        .review-answers {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }

        .review-answer {
            display: flex;
            align-items: flex-start;
            gap: 0.75rem;
            padding: 0.875rem 1rem;
            border-radius: 8px;
            background: var(--v2-bg-secondary);
            border: 1px solid var(--v2-bg-tertiary);
        }

        .review-answer.correct-answer {
            border-color: var(--v2-accent-green);
            background: rgba(16, 185, 129, 0.1);
        }

        .review-answer.user-incorrect {
            border-color: var(--v2-accent-red);
            background: rgba(239, 68, 68, 0.1);
        }

        .answer-indicator {
            width: 24px;
            height: 24px;
            min-width: 24px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            font-weight: 700;
            background: var(--v2-bg-tertiary);
            color: var(--v2-text-muted);
        }

        .review-answer.correct-answer .answer-indicator {
            background: var(--v2-accent-green);
            color: white;
        }

        .review-answer.user-incorrect .answer-indicator {
            background: var(--v2-accent-red);
            color: white;
        }

        .answer-label {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.75rem;
            color: var(--v2-text-muted);
            margin-left: auto;
        }

        .answer-label.correct {
            color: var(--v2-accent-green);
        }

        .answer-label.incorrect {
            color: var(--v2-accent-red);
        }

        /* Explanation */
        .review-explanation {
            background: var(--v2-bg-secondary);
            border-left: 4px solid var(--v2-accent-blue);
            padding: 1rem 1.25rem;
            border-radius: 0 8px 8px 0;
        }

        .review-explanation-title {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-weight: 600;
            color: var(--v2-accent-blue);
            margin-bottom: 0.5rem;
        }

        .review-explanation-title svg {
            width: 18px;
            height: 18px;
        }

        .review-explanation p {
            color: var(--v2-text-secondary);
            line-height: 1.7;
        }

        /* Loading */
        .loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            min-height: 60vh;
            gap: 1.5rem;
        }

        .loading-spinner {
            width: 60px;
            height: 60px;
            border: 4px solid var(--v2-bg-tertiary);
            border-top-color: var(--v2-accent-purple);
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        @keyframes spin {
            to { transform: rotate(360deg); }
        }

        /* Responsive */
        @media (max-width: 768px) {
            .results-hero {
                padding: 3rem 1rem;
            }

            .results-main {
                padding: 1.5rem 1rem;
            }

            .topic-row {
                flex-direction: column;
                gap: 0.5rem;
            }

            .topic-name {
                min-width: unset;
            }

            .section-header {
                flex-direction: column;
                gap: 0.75rem;
                align-items: flex-start;
            }

            /* Show filter as horizontal scroll on tablets */
            .filter-buttons {
                display: flex;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                gap: 0.5rem;
                padding-bottom: 0.25rem;
            }

            .filter-btn {
                white-space: nowrap;
                flex-shrink: 0;
            }
        }

        @media (max-width: 640px) {
            .score-circle {
                width: 160px;
                height: 160px;
            }

            .score-percent {
                font-size: 2.5rem;
            }

            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
            }

            .action-buttons {
                flex-direction: column;
            }

            .action-btn {
                justify-content: center;
            }

            .review-question-preview {
                font-size: 0.875rem;
            }

            .review-card {
                border-radius: 10px;
            }

            .review-card-body {
                padding: 1rem;
            }
        }

        @media (max-width: 480px) {

            .results-hero {
                padding: 2rem 0.75rem;
            }

            .score-circle {
                width: 140px;
                height: 140px;
                margin-bottom: 1.5rem;
            }

            .score-percent {
                font-size: 2rem;
            }

            .results-hero h1 {
                font-size: 1.25rem;
            }

            .results-main {
                padding: 1rem 0.75rem;
            }

            .stats-grid {
                gap: 0.5rem;
            }

            .stat-card {
                padding: 0.75rem;
            }

            .stat-value {
                font-size: 1.25rem;
            }

            .stat-label {
                font-size: 0.7rem;
            }

            .action-btn {
                padding: 0.75rem;
                font-size: 0.875rem;
            }

            .section-title {
                font-size: 1rem;
            }

            .review-card-header {
                padding: 0.75rem;
            }

            .review-card-body {
                padding: 0.75rem;
            }

            .review-answer {
                padding: 0.5rem;
                gap: 0.5rem;
                font-size: 0.8125rem;
            }

            .review-explanation {
                padding: 0.75rem 1rem;
            }

            .review-explanation p {
                font-size: 0.875rem;
            }

            .topic-score {
                font-size: 0.75rem;
            }

            /* Add padding for mobile bottom nav */
            .results-main {
                padding-bottom: 80px;
            }
        }


/* ============================================================================
   PAGE-SPECIFIC: REVIEW
   ============================================================================ */
/* Review Page Styles */
        .review-page {
            padding: 1.5rem 1rem;
            min-height: calc(100vh - 130px);
            max-width: 1200px;
            margin: 0 auto;
            box-sizing: border-box;
            overflow-x: hidden;
        }

        /* Quiz subnav */
        .quiz-subnav {
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(51, 65, 85, 0.5);
            position: sticky;
            top: 88px;
            z-index: 90;
        }
        .quiz-subnav__inner {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 1.5rem;
            display: flex;
            gap: 0.25rem;
            overflow-x: auto;
            scrollbar-width: none;
        }
        .quiz-subnav__inner::-webkit-scrollbar { display: none; }
        .quiz-subnav__link {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.875rem 1.25rem;
            color: rgba(255, 255, 255, 0.55);
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 500;
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .quiz-subnav__link i, .quiz-subnav__link svg { width: 16px; height: 16px; }
        .quiz-subnav__link:hover {
            color: rgba(255, 255, 255, 0.85);
            background: rgba(255, 255, 255, 0.04);
        }
        .quiz-subnav__link--active {
            color: #fff;
            border-bottom-color: #3b82f6;
        }
        @media (max-width: 900px) {
            .quiz-subnav { display: none; }
        }
        
        .review-header {
            margin-bottom: 2rem;
        }
        
        .review-header h1 {
            font-size: 1.75rem;
            color: var(--quiz-text-primary);
            margin-bottom: 0.5rem;
        }
        
        .review-header p {
            color: var(--quiz-text-muted);
        }
        
        /* Filter Tabs */
        .review-filters {
            display: block;
            background: var(--quiz-bg-secondary);
            border-radius: 16px;
            padding: 1rem;
            margin-bottom: 1.5rem;
        }
        
        .review-tabs {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 1rem;
            overflow-x: auto;
            scrollbar-width: none;
        }

        .review-tabs::-webkit-scrollbar {
            display: none;
        }
        
        .review-tab {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.625rem 1rem;
            background: var(--quiz-bg-elevated);
            border: 1px solid var(--quiz-border);
            border-radius: 8px;
            color: var(--quiz-text-muted);
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
        }
        
        .review-tab svg {
            width: 16px;
            height: 16px;
        }
        
        .review-tab:hover {
            border-color: var(--quiz-accent-teal);
            color: var(--quiz-text-secondary);
        }
        
        .review-tab--active {
            background: var(--quiz-accent-teal);
            border-color: var(--quiz-accent-teal);
            color: white;
        }
        
        .review-tab__count {
            font-size: 0.75rem;
            padding: 0.125rem 0.375rem;
            background: rgba(255,255,255,0.15);
            border-radius: 4px;
        }
        
        .review-tab--active .review-tab__count {
            background: rgba(255,255,255,0.25);
        }
        
        /* Search & Actions */
        .review-actions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.75rem;
            align-items: center;
        }
        
        .review-search {
            flex: 1 1 240px;
            min-width: 0;
            position: relative;
        }

        .review-select {
            flex: 0 1 160px;
            min-width: 120px;
        }
        
        .review-search svg {
            position: absolute;
            left: 0.875rem;
            top: 50%;
            transform: translateY(-50%);
            width: 18px;
            height: 18px;
            color: var(--quiz-text-muted);
        }
        
        .review-search input {
            width: 100%;
            padding: 0.625rem 0.875rem 0.625rem 2.5rem;
            background: var(--quiz-bg-elevated);
            border: 1px solid var(--quiz-border);
            border-radius: 8px;
            color: var(--quiz-text-primary);
            font-size: 0.875rem;
        }
        
        .review-search input::placeholder {
            color: var(--quiz-text-muted);
        }
        
        .review-search input:focus {
            outline: none;
            border-color: var(--quiz-accent-teal);
        }
        
        .review-select {
            padding: 0.625rem 0.875rem;
            background: var(--quiz-bg-elevated);
            border: 1px solid var(--quiz-border);
            border-radius: 8px;
            color: var(--quiz-text-secondary);
            font-size: 0.875rem;
        }
        
        /* Question List */
        .question-list {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
        }
        
        .question-list__loading {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            padding: 3rem;
            color: var(--quiz-text-muted);
        }
        
        .question-list__loading svg {
            width: 24px;
            height: 24px;
        }
        
        .question-list__empty {
            text-align: center;
            padding: 3rem;
            color: var(--quiz-text-muted);
        }
        
        .question-list__empty svg {
            width: 48px;
            height: 48px;
            margin-bottom: 1rem;
            opacity: 0.5;
        }
        
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }
        
        .spin {
            animation: spin 1s linear infinite;
        }
        
        /* Question Item */
        .question-item {
            background: var(--quiz-bg-secondary);
            border: 1px solid var(--quiz-border);
            border-radius: 12px;
            padding: 1.25rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .question-item:hover {
            border-color: var(--quiz-accent-teal);
            transform: translateY(-1px);
        }
        
        .question-item__header {
            display: flex;
            align-items: flex-start;
            gap: 1rem;
            margin-bottom: 0.75rem;
        }
        
        .question-item__status {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        
        .question-item__status svg {
            width: 18px;
            height: 18px;
        }
        
        .question-item__status--correct {
            background: rgba(16, 185, 129, 0.15);
            color: var(--quiz-correct);
        }
        
        .question-item__status--incorrect {
            background: rgba(239, 68, 68, 0.15);
            color: var(--quiz-incorrect);
        }
        
        .question-item__status--flagged {
            background: rgba(245, 158, 11, 0.15);
            color: var(--quiz-accent-gold);
        }
        
        .question-item__content {
            flex: 1;
        }
        
        .question-item__text {
            font-size: 0.9375rem;
            color: var(--quiz-text-primary);
            line-height: 1.5;
            margin-bottom: 0.75rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
            word-break: break-word;
            overflow-wrap: anywhere;
        }
        
        .question-item__meta {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
        }
        
        .question-item__tag {
            font-size: 0.75rem;
            padding: 0.25rem 0.5rem;
            background: var(--quiz-bg-elevated);
            border-radius: 4px;
            color: var(--quiz-text-muted);
        }
        
        .question-item__tag--subject {
            color: var(--quiz-accent-purple);
        }
        
        .question-item__date {
            font-size: 0.75rem;
            color: var(--quiz-text-muted);
        }
        
        .question-item__flag {
            margin-left: auto;
            opacity: 0;
            transition: opacity 0.2s;
        }
        
        .question-item:hover .question-item__flag {
            opacity: 1;
        }
        
        .question-item__flag svg {
            width: 18px;
            height: 18px;
            color: var(--quiz-text-muted);
        }
        
        .question-item__flag.flagged svg {
            color: var(--quiz-accent-gold);
            fill: var(--quiz-accent-gold);
        }
        
        /* Pagination */
        .review-pagination {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            margin-top: 2rem;
            padding-top: 1.5rem;
            border-top: 1px solid var(--quiz-border);
        }
        
        .pagination-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            background: var(--quiz-bg-secondary);
            border: 1px solid var(--quiz-border);
            border-radius: 8px;
            color: var(--quiz-text-secondary);
            font-size: 0.875rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .pagination-btn svg {
            width: 16px;
            height: 16px;
        }
        
        .pagination-btn:hover:not(:disabled) {
            border-color: var(--quiz-accent-teal);
            color: var(--quiz-accent-teal);
        }
        
        .pagination-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .pagination-info {
            font-size: 0.875rem;
            color: var(--quiz-text-muted);
        }
        
        /* Load More */
        .load-more-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5rem;
            margin-top: 1.5rem;
        }
        
        .load-more-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.625rem 1.5rem;
            background: var(--quiz-bg-secondary);
            border: 1px solid var(--quiz-border);
            border-radius: 8px;
            color: var(--quiz-accent-teal);
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .load-more-btn svg {
            width: 16px;
            height: 16px;
        }
        
        .load-more-btn:hover {
            background: rgba(20, 184, 166, 0.1);
            border-color: var(--quiz-accent-teal);
        }
        
        .load-more-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        
        .load-more-info {
            font-size: 0.8rem;
            color: var(--quiz-text-muted);
        }
        
        /* Mastery Indicator */
        .question-item__mastery {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 0.75rem;
            color: var(--quiz-text-muted);
        }
        
        .question-item__mastery-bar {
            width: 40px;
            height: 4px;
            background: rgba(255,255,255,0.1);
            border-radius: 2px;
            overflow: hidden;
        }
        
        .question-item__mastery-fill {
            height: 100%;
            border-radius: 2px;
            transition: width 0.3s;
        }
        
        .question-item__mastery-fill--low { background: #ef4444; }
        .question-item__mastery-fill--mid { background: #f59e0b; }
        .question-item__mastery-fill--high { background: #10b981; }
        
        /* Question Detail Modal */
        .quiz-modal--question {
            max-width: 700px;
            width: 95%;
            max-height: 85vh;
            overflow-y: auto;
        }
        
        .question-detail {
            padding: 1rem;
            word-break: break-word;
            overflow-wrap: anywhere;
        }
        
        .question-detail__header {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1.5rem;
            padding-bottom: 1rem;
            border-bottom: 1px solid var(--quiz-border);
        }
        
        .question-detail__status {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        .question-detail__status svg {
            width: 24px;
            height: 24px;
        }
        
        .question-detail__status--correct {
            background: rgba(16, 185, 129, 0.15);
            color: var(--quiz-correct);
        }
        
        .question-detail__status--incorrect {
            background: rgba(239, 68, 68, 0.15);
            color: var(--quiz-incorrect);
        }
        
        .question-detail__info h3 {
            color: var(--quiz-text-primary);
            font-size: 1rem;
            margin-bottom: 0.25rem;
        }
        
        .question-detail__info p {
            color: var(--quiz-text-muted);
            font-size: 0.8125rem;
        }
        
        .question-detail__question {
            font-size: 1.0625rem;
            color: var(--quiz-text-primary);
            line-height: 1.6;
            margin-bottom: 1.5rem;
            word-break: break-word;
            overflow-wrap: anywhere;
        }
        
        .question-detail__options {
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            margin-bottom: 1.5rem;
        }
        
        .question-detail__option {
            padding: 0.875rem;
            border-radius: 10px;
            background: var(--quiz-bg-elevated);
            border: 1px solid var(--quiz-border);
            color: var(--quiz-text-secondary);
            word-break: break-word;
            overflow-wrap: anywhere;
            font-size: 0.9rem;
            line-height: 1.5;
        }
        
        .question-detail__option--correct {
            background: rgba(16, 185, 129, 0.1);
            border-color: var(--quiz-correct);
            color: var(--quiz-correct);
        }
        
        .question-detail__option--selected-wrong {
            background: rgba(239, 68, 68, 0.1);
            border-color: var(--quiz-incorrect);
            color: var(--quiz-incorrect);
        }
        
        .question-detail__explanation {
            background: var(--quiz-bg-elevated);
            border-radius: 12px;
            padding: 1.25rem;
        }
        
        .question-detail__explanation h4 {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: var(--quiz-accent-teal);
            font-size: 0.9375rem;
            margin-bottom: 0.75rem;
        }
        
        .question-detail__explanation h4 svg {
            width: 18px;
            height: 18px;
        }
        
        .question-detail__explanation p {
            color: var(--quiz-text-secondary);
            font-size: 0.9375rem;
            line-height: 1.6;
        }
        
        .question-detail__actions {
            display: flex;
            gap: 0.75rem;
            margin-top: 1.5rem;
            padding-top: 1rem;
            border-top: 1px solid var(--quiz-border);
        }
        
        .question-detail__btn {
            flex: 1;
            padding: 0.75rem;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s;
        }
        
        .question-detail__btn svg {
            width: 18px;
            height: 18px;
        }
        
        .question-detail__btn--flag {
            background: var(--quiz-bg-elevated);
            border: 1px solid var(--quiz-border);
            color: var(--quiz-text-secondary);
        }
        
        .question-detail__btn--flag:hover {
            border-color: var(--quiz-accent-gold);
            color: var(--quiz-accent-gold);
        }
        
        .question-detail__btn--flag.flagged {
            background: rgba(245, 158, 11, 0.15);
            border-color: var(--quiz-accent-gold);
            color: var(--quiz-accent-gold);
        }
        
        .question-detail__btn--retry {
            background: var(--quiz-accent-teal);
            border: none;
            color: white;
        }
        
        .question-detail__btn--retry:hover {
            background: var(--quiz-accent-blue);
        }
        
        /* Mobile layout */
        @media (max-width: 900px) {
            .review-page {
                padding: 1rem 0.75rem 90px;
            }

            .review-header h1 {
                font-size: 1.35rem;
            }

            .review-filters {
                padding: 0.75rem;
            }

            .review-tabs {
                gap: 0.35rem;
            }

            .review-tab {
                padding: 0.5rem 0.75rem;
                font-size: 0.8rem;
            }

            .review-search {
                flex-basis: 100%;
            }

            .review-select {
                flex: 1 1 45%;
            }

            .question-item {
                padding: 0.875rem;
            }

            .question-item__header {
                gap: 0.65rem;
            }

            .question-item__status {
                width: 28px;
                height: 28px;
            }

            .question-item__status svg {
                width: 15px;
                height: 15px;
            }

            .question-item__text {
                font-size: 0.85rem;
            }

            .question-item__meta {
                gap: 0.5rem;
            }

            .quiz-modal--question {
                max-height: 90vh;
                border-radius: 16px 16px 0 0;
                max-width: none;
                width: 100%;
                margin-top: auto;
            }

            .question-detail {
                padding: 0.75rem;
            }

            .question-detail__header {
                gap: 0.65rem;
                margin-bottom: 1rem;
                padding-bottom: 0.75rem;
            }

            .question-detail__question {
                font-size: 0.95rem;
            }

            .question-detail__option {
                padding: 0.75rem;
                font-size: 0.85rem;
            }

            .question-detail__actions {
                flex-direction: column;
            }

            .question-detail__explanation {
                padding: 1rem;
            }

            .question-detail__explanation p {
                font-size: 0.875rem;
            }
        }


/* ============================================================================
   PAGE-SPECIFIC: QUIZ REVIEW
   ============================================================================ */

        /* Header */
        .header {
            background: linear-gradient(135deg, #1e293b, #0f172a);
            border-bottom: 1px solid #334155;
            padding: 1rem 2rem;
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-content {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .header h1 {
            font-size: 1.5rem;
            color: #f1f5f9;
            display: flex;
            align-items: center;
            gap: 0.75rem;
        }

        .header h1 span {
            background: linear-gradient(135deg, #8b5cf6, #6366f1);
            padding: 0.25rem 0.75rem;
            border-radius: 6px;
            font-size: 0.875rem;
        }

        .header-actions {
            display: flex;
            gap: 1rem;
        }

        .btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.625rem 1.25rem;
            border: none;
            border-radius: 8px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .btn-primary {
            background: linear-gradient(135deg, #10b981, #059669);
            color: white;
        }

        .btn-primary:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
        }

        .btn-secondary {
            background: #334155;
            color: #e2e8f0;
        }

        .btn-secondary:hover {
            background: #475569;
        }

        .btn-danger {
            background: linear-gradient(135deg, #ef4444, #dc2626);
            color: white;
        }

        /* Main Content */
        .main {
            max-width: 1400px;
            margin: 0 auto;
            padding: 2rem;
        }

        /* Stats Bar */
        .stats-bar {
            display: flex;
            gap: 1.5rem;
            margin-bottom: 2rem;
            flex-wrap: wrap;
        }

        .stat-card {
            background: linear-gradient(145deg, #1e293b, #1a2436);
            border: 1px solid #334155;
            border-radius: 12px;
            padding: 1.25rem 1.5rem;
            min-width: 150px;
        }

        .stat-value {
            font-size: 2rem;
            font-weight: 700;
            color: #f1f5f9;
        }

        .stat-label {
            font-size: 0.875rem;
            color: #94a3b8;
        }

        .stat-card.pending .stat-value { color: #fbbf24; }
        .stat-card.approved .stat-value { color: #10b981; }
        .stat-card.rejected .stat-value { color: #ef4444; }

        /* Topic Selector */
        .topic-selector {
            margin-bottom: 2rem;
        }

        .topic-selector label {
            display: block;
            margin-bottom: 0.5rem;
            color: #94a3b8;
            font-size: 0.875rem;
        }

        .topic-selector select {
            background: #1e293b;
            border: 1px solid #334155;
            border-radius: 8px;
            padding: 0.75rem 1rem;
            color: #f1f5f9;
            font-size: 1rem;
            min-width: 250px;
            cursor: pointer;
        }

        .topic-selector select:focus {
            outline: none;
            border-color: #8b5cf6;
        }

        /* Question Cards */
        .questions-grid {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
        }

        .question-card {
            background: linear-gradient(145deg, #1e293b, #1a2436);
            border: 1px solid #334155;
            border-radius: 16px;
            overflow: hidden;
            transition: all 0.2s;
        }

        .question-card:hover {
            border-color: #475569;
        }

        .question-card.approved {
            border-color: #10b981;
            background: linear-gradient(145deg, #1e293b, #0a2920);
        }

        .question-card.rejected {
            border-color: #ef4444;
            opacity: 0.6;
        }

        .question-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 1.5rem;
            border-bottom: 1px solid #334155;
            background: rgba(0, 0, 0, 0.2);
        }

        .question-meta {
            display: flex;
            align-items: center;
            gap: 1rem;
        }

        .question-id {
            font-family: monospace;
            font-size: 0.875rem;
            color: #64748b;
            background: #0f172a;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
        }

        .question-source {
            font-size: 0.75rem;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .question-source.template {
            background: rgba(59, 130, 246, 0.2);
            color: #60a5fa;
        }

        .question-source.ai-generated {
            background: rgba(139, 92, 246, 0.2);
            color: #a78bfa;
        }

        .question-source.manual {
            background: rgba(16, 185, 129, 0.2);
            color: #34d399;
        }

        .question-status {
            font-size: 0.75rem;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        .question-status.pending {
            background: rgba(251, 191, 36, 0.2);
            color: #fbbf24;
        }

        .question-status.approved {
            background: rgba(16, 185, 129, 0.2);
            color: #34d399;
        }

        .question-status.rejected {
            background: rgba(239, 68, 68, 0.2);
            color: #f87171;
        }

        .question-body {
            padding: 1.5rem;
        }

        .question-label {
            font-size: 0.75rem;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.5rem;
        }

        .question-text {
            font-size: 1.125rem;
            color: #f1f5f9;
            margin-bottom: 1.5rem;
            line-height: 1.6;
        }

        .answer-text {
            font-size: 1rem;
            color: #94a3b8;
            line-height: 1.6;
            background: rgba(0, 0, 0, 0.2);
            padding: 1rem;
            border-radius: 8px;
            border-left: 3px solid #10b981;
        }

        /* Edit Mode */
        .question-text.editing,
        .answer-text.editing {
            background: #0f172a;
            border: 1px solid #475569;
            border-radius: 8px;
            padding: 1rem;
            min-height: 100px;
            outline: none;
            color: #f1f5f9;
        }

        .question-text.editing:focus,
        .answer-text.editing:focus {
            border-color: #8b5cf6;
        }

        /* Action Buttons */
        .question-actions {
            display: flex;
            gap: 0.75rem;
            padding: 1rem 1.5rem;
            border-top: 1px solid #334155;
            background: rgba(0, 0, 0, 0.2);
        }

        .action-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.5rem 1rem;
            border: none;
            border-radius: 6px;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }

        .action-btn.approve {
            background: rgba(16, 185, 129, 0.2);
            color: #34d399;
        }

        .action-btn.approve:hover {
            background: #10b981;
            color: white;
        }

        .action-btn.reject {
            background: rgba(239, 68, 68, 0.2);
            color: #f87171;
        }

        .action-btn.reject:hover {
            background: #ef4444;
            color: white;
        }

        .action-btn.edit {
            background: rgba(59, 130, 246, 0.2);
            color: #60a5fa;
        }

        .action-btn.edit:hover {
            background: #3b82f6;
            color: white;
        }

        .action-btn.save {
            background: rgba(16, 185, 129, 0.2);
            color: #34d399;
        }

        .action-btn.cancel {
            background: rgba(100, 116, 139, 0.2);
            color: #94a3b8;
        }

        /* Empty State */
        .empty-state {
            text-align: center;
            padding: 4rem 2rem;
            color: #64748b;
        }

        .empty-state h3 {
            font-size: 1.25rem;
            color: #94a3b8;
            margin-bottom: 0.5rem;
        }

        /* Toast Notifications */
        .toast-container {
            position: fixed;
            bottom: 2rem;
            right: 2rem;
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .toast {
            background: #1e293b;
            border: 1px solid #334155;
            border-radius: 8px;
            padding: 1rem 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            animation: slideIn 0.3s ease-out;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        }

        .toast.success {
            border-color: #10b981;
        }

        .toast.error {
            border-color: #ef4444;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateX(100px);
            }
            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        /* Responsive */
        @media (max-width: 768px) {
            .header-content {
                flex-direction: column;
                gap: 1rem;
            }

            .stats-bar {
                flex-direction: column;
            }

            .stat-card {
                width: 100%;
            }

            .question-actions {
                flex-wrap: wrap;
            }
        }


/* ============================================================================
   PAGE-SPECIFIC: EXAMS
   ============================================================================ */
.exam-center-page {
            min-height: calc(100vh - 130px);
            padding: 2rem 1.25rem 5rem;
        }

        /* Quiz subnav (shared across quiz pages) */
        .quiz-subnav {
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(51, 65, 85, 0.5);
            position: sticky;
            top: 88px;
            z-index: 90;
        }
        .quiz-subnav__inner {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 1.5rem;
            display: flex;
            gap: 0.25rem;
            overflow-x: auto;
            scrollbar-width: none;
        }
        .quiz-subnav__inner::-webkit-scrollbar { display: none; }
        .quiz-subnav__link {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.875rem 1.25rem;
            color: rgba(255, 255, 255, 0.55);
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 500;
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .quiz-subnav__link i, .quiz-subnav__link svg { width: 16px; height: 16px; }
        .quiz-subnav__link:hover {
            color: rgba(255, 255, 255, 0.85);
            background: rgba(255, 255, 255, 0.04);
        }
        .quiz-subnav__link--active {
            color: #fff;
            border-bottom-color: #3b82f6;
        }
        @media (max-width: 900px) {
            .quiz-subnav { display: none; }
        }

        .exam-hero {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 1rem;
            margin-bottom: 1.25rem;
        }

        .exam-hero h1 {
            color: var(--quiz-text-primary);
            font-size: 1.85rem;
            margin-bottom: 0.35rem;
        }

        .exam-hero p {
            color: var(--quiz-text-muted);
        }

        .exam-refresh {
            border: 1px solid var(--quiz-border);
            background: var(--quiz-bg-secondary);
            color: var(--quiz-text-secondary);
            border-radius: 10px;
            padding: 0.6rem 0.85rem;
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            cursor: pointer;
        }

        .exam-refresh:hover {
            background: var(--quiz-bg-card);
            color: var(--quiz-text-primary);
        }

        .exam-refresh svg {
            width: 16px;
            height: 16px;
        }

        .exam-subscription {
            border: 1px solid var(--quiz-border);
            background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(34, 211, 238, 0.08));
            border-radius: 14px;
            padding: 0.95rem 1rem;
            margin-bottom: 1.25rem;
            color: var(--quiz-text-secondary);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        .exam-section {
            margin-bottom: 1.75rem;
        }

        .exam-section__header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.8rem;
        }

        .exam-section__header h2 {
            color: var(--quiz-text-primary);
            font-size: 1.1rem;
            margin: 0;
        }

        .exam-count {
            font-size: 0.78rem;
            font-weight: 700;
            color: var(--quiz-text-muted);
            border: 1px solid var(--quiz-border);
            border-radius: 999px;
            padding: 0.2rem 0.6rem;
            min-width: 36px;
            text-align: center;
        }

        .exam-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 0.9rem;
        }

        .exam-card {
            background: var(--quiz-bg-secondary);
            border: 1px solid var(--quiz-border);
            border-radius: 14px;
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.85rem;
        }

        .exam-card__head {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 0.75rem;
        }

        .exam-card__title {
            color: var(--quiz-text-primary);
            font-weight: 700;
            font-size: 1rem;
            margin: 0 0 0.3rem;
        }

        .exam-card__desc {
            color: var(--quiz-text-muted);
            font-size: 0.88rem;
            line-height: 1.45;
            margin: 0;
        }

        .exam-badges {
            display: flex;
            gap: 0.35rem;
            flex-wrap: wrap;
        }

        .exam-badge {
            font-size: 0.7rem;
            font-weight: 700;
            border-radius: 999px;
            padding: 0.14rem 0.5rem;
            border: 1px solid var(--quiz-border);
            color: var(--quiz-text-muted);
        }

        .exam-badge--assigned {
            color: #22d3ee;
            border-color: rgba(34, 211, 238, 0.45);
        }

        .exam-badge--public {
            color: #34d399;
            border-color: rgba(52, 211, 153, 0.45);
        }

        .exam-badge--paid {
            color: #fbbf24;
            border-color: rgba(251, 191, 36, 0.45);
        }

        .exam-meta {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.4rem;
            font-size: 0.8rem;
            color: var(--quiz-text-muted);
        }

        .exam-meta strong {
            color: var(--quiz-text-primary);
            margin-right: 0.2rem;
        }

        .exam-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.65rem;
        }

        .exam-price {
            color: var(--quiz-text-primary);
            font-weight: 700;
            font-size: 0.92rem;
        }

        .exam-card__btn {
            text-decoration: none;
            border: none;
            border-radius: 9px;
            padding: 0.55rem 0.9rem;
            font-size: 0.84rem;
            font-weight: 700;
            cursor: pointer;
            background: linear-gradient(135deg, var(--quiz-accent-purple), var(--quiz-accent-blue));
            color: #fff;
            white-space: nowrap;
        }

        .exam-card__btn--secondary {
            background: var(--quiz-bg-elevated);
            color: var(--quiz-text-secondary);
        }

        /* Loading/empty/error states use shared .quiz-state classes from quiz-v3.css */

        @media (max-width: 900px) {
            .exam-hero {
                flex-direction: column;
                align-items: stretch;
            }

            .exam-refresh {
                width: fit-content;
            }
        }


/* ============================================================================
   PAGE-SPECIFIC: EXAM
   ============================================================================ */
.exam-detail-page {
            min-height: calc(100vh - 130px);
            padding: 2rem 1.25rem 3rem;
        }

        /* Quiz subnav */
        .quiz-subnav {
            background: rgba(15, 23, 42, 0.95);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-bottom: 1px solid rgba(51, 65, 85, 0.5);
            position: sticky;
            top: 88px;
            z-index: 90;
        }
        .quiz-subnav__inner {
            max-width: 1280px;
            margin: 0 auto;
            padding: 0 1.5rem;
            display: flex;
            gap: 0.25rem;
            overflow-x: auto;
            scrollbar-width: none;
        }
        .quiz-subnav__inner::-webkit-scrollbar { display: none; }
        .quiz-subnav__link {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.875rem 1.25rem;
            color: rgba(255, 255, 255, 0.55);
            text-decoration: none;
            font-size: 0.875rem;
            font-weight: 500;
            border-bottom: 2px solid transparent;
            transition: all 0.2s;
            white-space: nowrap;
        }
        .quiz-subnav__link i, .quiz-subnav__link svg { width: 16px; height: 16px; }
        .quiz-subnav__link:hover {
            color: rgba(255, 255, 255, 0.85);
            background: rgba(255, 255, 255, 0.04);
        }
        .quiz-subnav__link--active {
            color: #fff;
            border-bottom-color: #3b82f6;
        }
        @media (max-width: 900px) {
            .quiz-subnav { display: none; }
        }

        .exam-back-link {
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
            color: var(--quiz-text-muted);
            text-decoration: none;
            margin-bottom: 1rem;
            font-size: 0.9rem;
        }

        .exam-back-link:hover {
            color: var(--quiz-text-primary);
        }

        .exam-back-link svg {
            width: 16px;
            height: 16px;
        }

        .exam-detail-card,
        .exam-history-card {
            background: var(--quiz-bg-secondary);
            border: 1px solid var(--quiz-border);
            border-radius: 16px;
            padding: 1.1rem;
            margin-bottom: 1rem;
        }

        .exam-detail-card h1 {
            color: var(--quiz-text-primary);
            font-size: 1.55rem;
            margin: 0 0 0.45rem;
        }

        .exam-description {
            color: var(--quiz-text-muted);
            line-height: 1.55;
            margin-bottom: 0.95rem;
        }

        .exam-flags {
            display: flex;
            gap: 0.45rem;
            flex-wrap: wrap;
            margin-bottom: 0.9rem;
        }

        .exam-flag {
            font-size: 0.72rem;
            font-weight: 700;
            border: 1px solid var(--quiz-border);
            color: var(--quiz-text-muted);
            border-radius: 999px;
            padding: 0.16rem 0.55rem;
        }

        .exam-flag--public {
            color: #34d399;
            border-color: rgba(52, 211, 153, 0.5);
        }

        .exam-flag--assigned {
            color: #22d3ee;
            border-color: rgba(34, 211, 238, 0.5);
        }

        .exam-flag--locked {
            color: #f87171;
            border-color: rgba(248, 113, 113, 0.5);
        }

        .exam-metrics {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
            gap: 0.65rem;
            margin-bottom: 1rem;
        }

        .exam-metric {
            border: 1px solid var(--quiz-border);
            border-radius: 12px;
            background: var(--quiz-bg-card);
            padding: 0.7rem;
        }

        .exam-metric__label {
            color: var(--quiz-text-muted);
            font-size: 0.76rem;
            margin-bottom: 0.25rem;
        }

        .exam-metric__value {
            color: var(--quiz-text-primary);
            font-weight: 700;
        }

        .exam-cta-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.9rem;
            flex-wrap: wrap;
            margin-top: 0.25rem;
        }

        .exam-cta-notes {
            color: var(--quiz-text-muted);
            font-size: 0.84rem;
        }

        .exam-btn {
            border: none;
            border-radius: 10px;
            padding: 0.66rem 1rem;
            cursor: pointer;
            color: #fff;
            font-weight: 700;
            background: linear-gradient(135deg, var(--quiz-accent-purple), var(--quiz-accent-blue));
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
        }

        .exam-btn--secondary {
            background: var(--quiz-bg-elevated);
            color: var(--quiz-text-secondary);
        }

        .exam-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }

        .exam-btn svg {
            width: 16px;
            height: 16px;
        }

        .exam-locked {
            border: 1px solid rgba(248, 113, 113, 0.35);
            background: rgba(127, 29, 29, 0.15);
            color: #fca5a5;
            border-radius: 12px;
            padding: 0.7rem 0.8rem;
            font-size: 0.85rem;
            margin-top: 0.8rem;
        }

        .exam-history-card h3 {
            color: var(--quiz-text-primary);
            margin: 0 0 0.75rem;
            font-size: 1.05rem;
        }

        .attempt-row {
            border: 1px solid var(--quiz-border);
            border-radius: 10px;
            padding: 0.65rem 0.75rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.65rem;
            margin-bottom: 0.55rem;
            background: var(--quiz-bg-card);
            font-size: 0.84rem;
        }

        .attempt-row:last-child {
            margin-bottom: 0;
        }

        .attempt-score {
            color: var(--quiz-text-primary);
            font-weight: 700;
        }

        .attempt-score--pass {
            color: #34d399;
        }

        .attempt-score--fail {
            color: #f87171;
        }

        /* Loading/error states use shared .quiz-state classes from quiz-v3.css */


/* ============================================================================
   PAGE-SPECIFIC: ANALYTICS
   ============================================================================ */
/* --- shared subnav --- */
        .quiz-subnav{background:rgba(15,23,42,.95);backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);border-bottom:1px solid rgba(51,65,85,.5);position:sticky;top:88px;z-index:90}
        .quiz-subnav__inner{max-width:1280px;margin:0 auto;padding:0 1.5rem;display:flex;gap:.25rem;overflow-x:auto;scrollbar-width:none}
        .quiz-subnav__inner::-webkit-scrollbar{display:none}
        .quiz-subnav__link{display:flex;align-items:center;gap:.5rem;padding:.875rem 1.25rem;color:rgba(255,255,255,.55);text-decoration:none;font-size:.875rem;font-weight:500;border-bottom:2px solid transparent;transition:all .2s;white-space:nowrap}
        .quiz-subnav__link i,.quiz-subnav__link svg{width:16px;height:16px}
        .quiz-subnav__link:hover{color:rgba(255,255,255,.85);background:rgba(255,255,255,.04)}
        .quiz-subnav__link--active{color:#fff;border-bottom-color:#3b82f6}
        @media(max-width:900px){.quiz-subnav{display:none}body{padding-bottom:70px}}

        /* --- layout --- */
        .an{min-height:calc(100vh - 130px)}
        .an-wrap{max-width:960px;margin:0 auto;padding:1.25rem 1rem 2rem;display:flex;flex-direction:column;gap:1rem}
        @media(max-width:900px){.an-wrap{padding-bottom:90px}}

        /* --- loading / empty --- */
        .an-state{text-align:center;display:flex;flex-direction:column;align-items:center;gap:.75rem}
        .an-state__icon i,.an-state__icon svg{width:40px;height:40px;color:#475569}
        .an-state__heading{color:#f1f5f9;font-size:1.125rem;margin:0}
        .an-state__text{color:#64748b;font-size:.8125rem;margin:0}
        .an-spinner{width:28px;height:28px;border:3px solid rgba(59,130,246,.2);border-top-color:#3b82f6;border-radius:50%;animation:sp .6s linear infinite}
        @keyframes sp{to{transform:rotate(360deg)}}
        .an-btn{display:inline-flex;padding:.5rem 1.25rem;border-radius:8px;font-size:.8125rem;font-weight:600;text-decoration:none;transition:all .2s}
        .an-btn--primary{background:#3b82f6;color:#fff}
        .an-btn--primary:hover{background:#2563eb}
        .an-empty{text-align:center;padding:2rem 1rem;color:#475569;font-size:.8125rem}

        /* --- hero summary --- */
        .an-hero{display:flex;align-items:center;gap:1.25rem;background:linear-gradient(145deg,#1e293b,#162032);border:1px solid rgba(51,65,85,.5);border-radius:14px;padding:1.25rem 1.5rem;flex-wrap:wrap}
        .an-hero__ring-wrap{width:86px;height:86px;position:relative;flex-shrink:0}
        .an-hero__ring{width:100%;height:100%}
        .an-hero__ring circle:nth-child(2){transition:stroke-dashoffset 1s ease-out,stroke .3s}
        .an-hero__ring-inner{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
        .an-hero__pct{font-size:1.5rem;font-weight:800;color:#f1f5f9;line-height:1}
        .an-hero__pct-label{font-size:.5rem;color:#64748b;text-transform:uppercase;letter-spacing:.5px;margin-top:1px}
        .an-hero__kpis{display:flex;flex-wrap:wrap;gap:.5rem;flex:1}
        .an-kpi{background:rgba(15,23,42,.55);border:1px solid rgba(51,65,85,.35);border-radius:8px;padding:.5rem .7rem;text-align:center;min-width:68px;flex:1}
        .an-kpi__val{display:block;font-size:1.125rem;font-weight:700;color:#f1f5f9;line-height:1}
        .an-kpi--g{color:#34d399!important}
        .an-kpi--r{color:#f87171!important}
        .an-kpi--a{color:#fbbf24!important}
        .an-kpi__lbl{font-size:.55rem;color:#64748b;text-transform:uppercase;letter-spacing:.4px;margin-top:2px;display:block}
        .an-hero__sub{width:100%;font-size:.75rem;color:#64748b;margin:0;text-align:center}
        @media(max-width:600px){
            .an-hero{flex-direction:column;text-align:center;padding:1rem}
            .an-hero__ring-wrap{width:72px;height:72px}
            .an-hero__pct{font-size:1.25rem}
            .an-kpi{min-width:60px;padding:.375rem .5rem}
            .an-kpi__val{font-size:.9375rem}
        }

        /* --- cards --- */
        .an-card{background:linear-gradient(145deg,#1e293b,#162032);border:1px solid rgba(51,65,85,.5);border-radius:14px;padding:1rem 1.25rem}
        .an-card--inner{background:rgba(15,23,42,.45);border-color:rgba(51,65,85,.3);padding:.875rem 1rem}
        .an-card__hd{font-size:.875rem;font-weight:600;color:#f1f5f9;display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem}
        .an-card__hd i,.an-card__hd svg{width:16px;height:16px;color:#8b5cf6}

        /* --- warn card --- */
        .an-card--warn{border-color:rgba(239,68,68,.3);background:linear-gradient(145deg,rgba(127,29,29,.08),#162032)}
        .an-card--warn .an-card__hd i,.an-card--warn .an-card__hd svg{color:#f87171}

        .an-weak{display:flex;flex-direction:column;gap:.375rem}
        .an-weak__row{display:flex;align-items:center;gap:.625rem;padding:.5rem .75rem;background:rgba(239,68,68,.04);border:1px solid rgba(239,68,68,.12);border-radius:8px}
        .an-weak__dot{width:7px;height:7px;border-radius:50%;flex-shrink:0}
        .an-weak__info{flex:1;min-width:0}
        .an-weak__name{font-size:.8125rem;font-weight:600;color:#f1f5f9;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
        .an-weak__meta{font-size:.625rem;color:#64748b}
        .an-weak__pct{font-size:.875rem;font-weight:700;color:#f87171}
        .an-weak__go{background:rgba(59,130,246,.12);border:1px solid rgba(59,130,246,.25);color:#60a5fa;padding:.25rem .625rem;border-radius:5px;font-size:.6875rem;font-weight:600;cursor:pointer;text-decoration:none;white-space:nowrap}
        .an-weak__go:hover{background:rgba(59,130,246,.22)}

        /* --- tabs --- */
        .an-tabs{display:flex;gap:.25rem;background:rgba(15,23,42,.6);border:1px solid rgba(51,65,85,.35);border-radius:10px;padding:4px;overflow-x:auto;scrollbar-width:none}
        .an-tabs::-webkit-scrollbar{display:none}
        .an-tab{flex:1;display:flex;align-items:center;justify-content:center;gap:.375rem;padding:.5rem .75rem;background:transparent;border:none;border-radius:7px;color:#64748b;font-size:.75rem;font-weight:600;cursor:pointer;transition:all .2s;white-space:nowrap}
        .an-tab i,.an-tab svg{width:14px;height:14px}
        .an-tab:hover{color:#94a3b8;background:rgba(255,255,255,.03)}
        .an-tab--on{background:rgba(59,130,246,.12);color:#60a5fa}

        /* --- panels --- */
        .an-panel--off{display:none}
        .an-panel__toolbar{display:flex;gap:.25rem;margin-bottom:.75rem;flex-wrap:wrap}
        .an-pill{background:rgba(15,23,42,.5);border:1px solid rgba(51,65,85,.35);color:#64748b;padding:.25rem .5rem;border-radius:5px;font-size:.625rem;font-weight:600;cursor:pointer;transition:all .15s}
        .an-pill:hover{color:#94a3b8}
        .an-pill--on{background:rgba(59,130,246,.1);border-color:rgba(59,130,246,.25);color:#60a5fa}
        .an-select{background:rgba(15,23,42,.6);border:1px solid rgba(51,65,85,.4);border-radius:6px;color:#94a3b8;padding:.3rem .5rem;font-size:.6875rem}

        /* --- category grid --- */
        .an-cats{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:.625rem}
        .an-cat{background:rgba(15,23,42,.45);border:1px solid rgba(51,65,85,.3);border-radius:10px;padding:.75rem 1rem;transition:border-color .2s}
        .an-cat:hover{border-color:rgba(139,92,246,.25)}
        .an-cat__top{display:flex;align-items:center;gap:.625rem;margin-bottom:.5rem}
        .an-cat__icon{width:30px;height:30px;border-radius:8px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
        .an-cat__icon svg,.an-cat__icon i{width:15px;height:15px;color:#fff}
        .an-cat__name{font-size:.8125rem;font-weight:600;color:#e2e8f0;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
        .an-cat__pct{font-size:1rem;font-weight:700}
        .an-cat__bar{height:4px;background:rgba(51,65,85,.4);border-radius:2px;overflow:hidden;margin-bottom:.375rem}
        .an-cat__fill{height:100%;border-radius:2px;transition:width .7s ease-out}
        .an-cat__row{display:flex;gap:.75rem;font-size:.6125rem;color:#64748b}
        .an-cat__row i,.an-cat__row svg{width:10px;height:10px}
        .an-cat__row span{display:flex;align-items:center;gap:3px}
        @media(max-width:480px){.an-cats{grid-template-columns:1fr}}

        /* --- mastery accordion --- */
        .an-mcat{border:1px solid rgba(51,65,85,.3);border-radius:10px;overflow:hidden;background:rgba(15,23,42,.35)}
        .an-mcat+.an-mcat{margin-top:.5rem}
        .an-mcat__hd{display:flex;align-items:center;gap:.5rem;padding:.625rem .875rem;cursor:pointer;user-select:none;transition:background .15s}
        .an-mcat__hd:hover{background:rgba(255,255,255,.02)}
        .an-mcat__dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}
        .an-mcat__name{flex:1;font-size:.8125rem;font-weight:600;color:#e2e8f0}
        .an-mcat__avg{font-size:.8125rem;font-weight:700}
        .an-mcat__chev{width:14px;height:14px;color:#475569;transition:transform .2s}
        .an-mcat--open .an-mcat__chev{transform:rotate(180deg)}
        .an-mcat__body{display:none;padding:0 .75rem .5rem}
        .an-mcat--open .an-mcat__body{display:block}

        .an-topic{display:grid;grid-template-columns:1fr 100px 40px;align-items:center;gap:.5rem;padding:.3rem .25rem;border-radius:4px}
        .an-topic:hover{background:rgba(255,255,255,.015)}
        .an-topic__name{font-size:.75rem;color:#94a3b8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
        .an-topic__name--dim{color:#475569;font-style:italic}
        .an-topic__bar{height:4px;background:rgba(51,65,85,.4);border-radius:2px;overflow:hidden}
        .an-topic__fill{height:100%;border-radius:2px;transition:width .5s ease-out}
        .an-topic__pct{font-size:.6875rem;font-weight:600;text-align:right}
        .an-topic__meta{font-size:.575rem;color:#475569}
        @media(max-width:480px){.an-topic{grid-template-columns:1fr 70px 32px}}

        /* --- split (diff + type side-by-side) --- */
        .an-split{display:grid;grid-template-columns:1fr 1fr;gap:.75rem}
        @media(max-width:700px){.an-split{grid-template-columns:1fr}}

        .an-diff{display:flex;flex-direction:column;gap:.375rem}
        .an-diff__row{display:flex;align-items:center;gap:.5rem;padding:.375rem 0}
        .an-diff__label{width:90px;font-size:.6875rem;font-weight:700;text-transform:uppercase;letter-spacing:.03em;flex-shrink:0}
        .an-diff__bar{flex:1;height:5px;background:rgba(51,65,85,.4);border-radius:3px;overflow:hidden}
        .an-diff__fill{height:100%;border-radius:3px;transition:width .6s ease-out}
        .an-diff__val{width:38px;text-align:right;font-size:.75rem;font-weight:700}
        .an-diff__ct{font-size:.575rem;color:#64748b;width:52px;text-align:right}

        .an-types{display:flex;flex-direction:column;gap:.375rem}
        .an-type{display:flex;align-items:center;gap:.5rem;padding:.5rem .625rem;background:rgba(15,23,42,.4);border:1px solid rgba(51,65,85,.25);border-radius:8px}
        .an-type__icon{width:28px;height:28px;border-radius:6px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
        .an-type__icon svg{width:14px;height:14px;color:#fff}
        .an-type__info{flex:1;min-width:0}
        .an-type__name{font-size:.75rem;font-weight:600;color:#f1f5f9}
        .an-type__meta{font-size:.575rem;color:#64748b;margin-top:1px}
        .an-type__pct{font-size:.9375rem;font-weight:700}

        /* --- sessions --- */
        .an-sess{display:flex;flex-direction:column;gap:.375rem}
        .an-sess__row{display:grid;grid-template-columns:42px 1fr auto;align-items:center;gap:.5rem;padding:.5rem .625rem;background:rgba(15,23,42,.35);border:1px solid rgba(51,65,85,.2);border-radius:8px}
        .an-sess__row:hover{border-color:rgba(51,65,85,.45)}
        .an-sess__badge{width:42px;height:42px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.75rem}
        .an-sess__badge--hi{background:rgba(16,185,129,.12);color:#34d399;border:2px solid rgba(16,185,129,.25)}
        .an-sess__badge--md{background:rgba(245,158,11,.12);color:#fbbf24;border:2px solid rgba(245,158,11,.25)}
        .an-sess__badge--lo{background:rgba(239,68,68,.12);color:#f87171;border:2px solid rgba(239,68,68,.25)}
        .an-sess__info{min-width:0}
        .an-sess__title{font-size:.75rem;font-weight:600;color:#e2e8f0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
        .an-sess__meta{font-size:.6125rem;color:#64748b;display:flex;gap:.5rem;flex-wrap:wrap;margin-top:2px}
        .an-sess__right{text-align:right}
        .an-sess__date{font-size:.6875rem;color:#64748b}
        .an-sess__link{font-size:.625rem;color:#60a5fa;text-decoration:none;font-weight:500}
        .an-sess__link:hover{text-decoration:underline}

        /* --- recommendations --- */
        .an-card--recs{border-color:rgba(59,130,246,.2);background:linear-gradient(145deg,rgba(30,58,138,.06),#162032)}
        .an-card--recs .an-card__hd i,.an-card--recs .an-card__hd svg{color:#60a5fa}
        .an-recs{display:flex;flex-direction:column;gap:.5rem}
        .an-rec{display:flex;gap:.625rem;padding:.625rem .75rem;background:rgba(59,130,246,.03);border:1px solid rgba(59,130,246,.1);border-radius:8px}
        .an-rec__icon{width:28px;height:28px;border-radius:7px;display:flex;align-items:center;justify-content:center;flex-shrink:0}
        .an-rec__icon svg{width:14px;height:14px}
        .an-rec__body{flex:1}
        .an-rec__title{font-size:.8125rem;font-weight:600;color:#f1f5f9}
        .an-rec__desc{font-size:.6875rem;color:#94a3b8;margin-top:2px;line-height:1.4}
        .an-rec__go{display:inline-flex;align-items:center;gap:3px;margin-top:.375rem;font-size:.6875rem;color:#60a5fa;text-decoration:none;font-weight:500}
        .an-rec__go:hover{text-decoration:underline}
        .an-rec__go svg{width:10px;height:10px}


/* ============================================================================
   PAGE-SPECIFIC: EXAM PURCHASED
   ============================================================================ */
.purchase-page {
            min-height: 100vh;
            display: grid;
            place-items: center;
            padding: 1.2rem;
            background: radial-gradient(circle at top, rgba(34, 211, 238, 0.08), transparent 45%), var(--quiz-bg-primary);
        }

        .purchase-card {
            width: min(560px, 100%);
            background: var(--quiz-bg-secondary);
            border: 1px solid var(--quiz-border);
            border-radius: 18px;
            padding: 1.4rem 1.2rem;
            text-align: center;
        }

        .purchase-icon {
            width: 58px;
            height: 58px;
            border-radius: 50%;
            margin: 0 auto 0.9rem;
            background: rgba(52, 211, 153, 0.15);
            display: grid;
            place-items: center;
        }

        .purchase-icon svg {
            width: 32px;
            height: 32px;
            color: #34d399;
        }

        .purchase-card h1 {
            margin: 0 0 0.45rem;
            color: var(--quiz-text-primary);
            font-size: 1.6rem;
        }

        .purchase-card p {
            margin: 0 0 0.85rem;
            color: var(--quiz-text-muted);
        }

        .purchase-loading {
            color: var(--quiz-text-muted);
            font-size: 0.9rem;
        }

        .purchase-actions {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.65rem;
            margin-top: 1rem;
            flex-wrap: wrap;
        }

        .purchase-btn {
            border: none;
            border-radius: 10px;
            padding: 0.68rem 0.95rem;
            font-weight: 700;
            cursor: pointer;
            text-decoration: none;
            display: inline-flex;
            align-items: center;
            gap: 0.45rem;
            background: linear-gradient(135deg, var(--quiz-accent-purple), var(--quiz-accent-blue));
            color: #fff;
        }

        .purchase-btn--secondary {
            background: var(--quiz-bg-elevated);
            color: var(--quiz-text-secondary);
        }

        .purchase-exam {
            margin-top: 1rem;
            text-align: left;
            border: 1px solid var(--quiz-border);
            border-radius: 12px;
            background: var(--quiz-bg-card);
            padding: 0.75rem;
        }

        .purchase-exam h3 {
            margin: 0 0 0.3rem;
            color: var(--quiz-text-primary);
            font-size: 1rem;
        }

        .purchase-exam p {
            margin: 0;
            font-size: 0.86rem;
            color: var(--quiz-text-muted);
        }
