/* ================================================================
   styles.css — Shared styles for all pages
   EnglishJibi Classes Student Panel
   ================================================================ */

/* ── Reset & Base Guard ──────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

/* ── Local High-Performance Inter Variable Webfont ─────────── */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}


/* ── INLINED DESIGN TOKENS (Merged for Zero Mobile Render-Blocking) ── */
/**
 * ================================================================
 * EnglishJibi Design System — Design Tokens
 * Master visual design tokens for typography, color palette,
 * spacing, radii, shadows, motion, and layout hierarchy.
 * ================================================================
 */

:root {
    /* ── Surface & Neutral Colors ──────────────────────────────── */
    --ej-bg-base: #020617;
    /* Deepest canvas background (slate-950) */
    --ej-bg-surface: #0b1120;
    /* Secondary container / header bg */
    --ej-bg-card: #0f172a;
    /* Primary card surface (slate-900) */
    --ej-bg-card-elevated: #131c31;
    /* Elevated surface / dropdowns */
    --ej-bg-card-hover: #1e293b;
    /* Hover state surface (slate-800) */

    /* ── Border Colors ─────────────────────────────────────────── */
    --ej-border-subtle: rgba(51, 65, 85, 0.45);
    /* Standard card & divider border */
    --ej-border-medium: rgba(71, 85, 105, 0.5);
    /* Hover card & active element border */
    --ej-border-strong: rgba(100, 116, 139, 0.6);
    /* High-contrast borders */

    /* ── Text Colors ───────────────────────────────────────────── */
    --ej-text-primary: #f8fafc;
    /* Headings & key text (slate-50) */
    --ej-text-secondary: #cbd5e1;
    /* Supporting text & labels (slate-300) */
    --ej-text-muted: #a1b3c9;
    /* Meta notes & placeholders (enhanced slate-300/400 - WCAG 2.2 AA >= 5:1) */
    --ej-text-inverse: #020617;
    /* Text on light / accent surfaces */

    /* ── Theme 1: Gold / Amber (Platform Brand & Dashboard) ────── */
    --ej-gold-500: #eab308;
    --ej-gold-400: #facc15;
    --ej-gold-600: #ca8a04;
    --ej-gold-bg: rgba(66, 32, 6, 0.25);
    --ej-gold-border: rgba(234, 179, 8, 0.4);
    --ej-gold-glow: rgba(234, 179, 8, 0.2);

    /* ── Theme 2: Emerald / Mint (Grammar Hub) ─────────────────── */
    --ej-emerald-500: #10b981;
    --ej-emerald-400: #34d399;
    --ej-emerald-600: #059669;
    --ej-emerald-bg: rgba(2, 44, 34, 0.25);
    --ej-emerald-border: rgba(16, 185, 129, 0.4);
    --ej-emerald-glow: rgba(16, 185, 129, 0.2);

    /* ── Theme 3: Cyan / Sky (CBSE Special) ────────────────────── */
    --ej-cyan-500: #06b6d4;
    --ej-cyan-400: #22d3ee;
    --ej-cyan-600: #0891b2;
    --ej-cyan-bg: rgba(8, 51, 68, 0.25);
    --ej-cyan-border: rgba(6, 182, 212, 0.4);
    --ej-cyan-glow: rgba(6, 182, 212, 0.2);

    /* ── Theme 4: Violet / Indigo (Olympiad Hub) ───────────────── */
    --ej-violet-500: #8b5cf6;
    --ej-violet-400: #a78bfa;
    --ej-violet-600: #7c3aed;
    --ej-violet-bg: rgba(46, 16, 101, 0.25);
    --ej-violet-border: rgba(139, 92, 246, 0.4);
    --ej-violet-glow: rgba(139, 92, 246, 0.2);

    /* ── Theme 5: Rose / Crimson (Alerts, Errors & Incorrect Answers) ─ */
    --ej-rose-500: #f43f5e;
    --ej-rose-400: #fb7185;
    --ej-rose-600: #e11d48;
    --ej-rose-bg: rgba(76, 5, 25, 0.25);
    --ej-rose-border: rgba(244, 63, 94, 0.4);
    --ej-rose-glow: rgba(244, 63, 94, 0.2);

    /* ── Typography Scale ──────────────────────────────────────── */
    --ej-font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --ej-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

    --ej-text-2xs: 10px;
    --ej-text-xs: 11px;
    --ej-text-sm: 13px;
    --ej-text-base: 15px;
    --ej-text-lg: 18px;
    --ej-text-xl: 22px;
    --ej-text-2xl: 28px;
    --ej-text-3xl: 36px;
    --ej-text-4xl: 44px;

    --ej-weight-normal: 400;
    --ej-weight-medium: 500;
    --ej-weight-semibold: 600;
    --ej-weight-bold: 700;
    --ej-weight-extrabold: 800;
    --ej-weight-black: 900;

    /* ── Spacing Scale (4px base) ──────────────────────────────── */
    --ej-sp-0: 0;
    --ej-sp-1: 4px;
    --ej-sp-2: 8px;
    --ej-sp-3: 12px;
    --ej-sp-4: 16px;
    --ej-sp-5: 20px;
    --ej-sp-6: 24px;
    --ej-sp-8: 32px;
    --ej-sp-10: 40px;
    --ej-sp-12: 48px;
    --ej-sp-16: 64px;

    /* ── Border Radius Scale ───────────────────────────────────── */
    --ej-radius-xs: 4px;
    --ej-radius-sm: 8px;
    --ej-radius-md: 12px;
    --ej-radius-lg: 16px;
    --ej-radius-xl: 20px;
    --ej-radius-2xl: 24px;
    --ej-radius-full: 9999px;

    /* ── Shadow Hierarchy ──────────────────────────────────────── */
    --ej-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
    --ej-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --ej-shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
    --ej-shadow-lg: 0 12px 36px rgba(0, 0, 0, 0.4);
    --ej-shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.5);

    /* ── Transitions & Easings ─────────────────────────────────── */
    --ej-ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ej-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ej-dur-fast: 160ms;
    --ej-dur-normal: 260ms;
    --ej-dur-slow: 400ms;

    /* ── Focus Ring Token ──────────────────────────────────────── */
    --ej-focus-ring: 0 0 0 2px rgba(234, 179, 8, 0.6), 0 0 0 4px rgba(234, 179, 8, 0.2);

    /* ── Layering & Z-Index Scale ──────────────────────────────── */
    --ej-z-base: 1;
    --ej-z-dropdown: 20;
    --ej-z-sticky: 50;
    --ej-z-nav: 100;
    --ej-z-cloudee: 120;
    /* Cloudee floats above content, below dialogs */
    --ej-z-modal-backdrop: 200;
    /* Modals ALWAYS cover Cloudee & page controls */
    --ej-z-modal: 210;
    --ej-z-toast: 300;

    /* ── Unified Skeleton Loading Design Tokens ────────────────── */
    --ej-skeleton-base: rgba(30, 41, 59, 0.65);
    --ej-skeleton-shimmer: rgba(51, 65, 85, 0.45);
    --ej-skeleton-highlight: rgba(71, 85, 105, 0.35);
    --ej-skeleton-sweep-highlight: rgba(255, 255, 255, 0.06);
    --ej-skeleton-border: rgba(51, 65, 85, 0.6);
    --ej-skeleton-card-bg: #0f172a;
}


/* ── INLINED COMPONENTS (Merged for Zero Mobile Render-Blocking) ── */
/**
 * ================================================================
 * EnglishJibi Design System — Shared Components
 * Standardized reusable components for cards, buttons, badges,
 * modals, form fields, navigation, and Cloudee integration.
 * ================================================================
 */

/* ── 1. CARDS: Academic Hub & Subject Cards ─────────────────────── */
.type-card,
.subject-card,
.hub-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 160px;
    padding: 24px 20px;
    border-radius: var(--ej-radius-lg, 16px);
    border: 1px solid var(--ej-border-subtle, rgba(51, 65, 85, 0.5));
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
    text-decoration: none;
    color: var(--ej-text-primary, #f8fafc);
    cursor: pointer;
    box-shadow: var(--ej-shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.3));
    transition: transform var(--ej-dur-normal, 260ms) var(--ej-ease-out, cubic-bezier(0.16, 1, 0.3, 1)),
        border-color var(--ej-dur-normal, 260ms) ease,
        box-shadow var(--ej-dur-normal, 260ms) ease;
    -webkit-tap-highlight-color: transparent;
}

@media (min-width: 640px) {

    .type-card,
    .subject-card,
    .hub-card {
        padding: 24px;
    }
}

/* ── Profile Page: Subject Breakdown Stat Cards (Compact sizing) ── */
#subject-breakdown .subject-card,
#subject-breakdown .stat-card,
#subject-breakdown .cbse-class-card,
#subject-breakdown .olympiad-class-card {
    min-height: auto;
    padding: 14px 16px;
}

@media (min-width: 640px) {

    #subject-breakdown .subject-card,
    #subject-breakdown .stat-card,
    #subject-breakdown .cbse-class-card,
    #subject-breakdown .olympiad-class-card {
        padding: 14px 16px;
    }
}

.type-card:hover,
.subject-card:hover,
.hub-card:hover {
    transform: none;
    border-color: rgba(234, 179, 8, 0.55);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(234, 179, 8, 0.1);
}

.type-card:active,
.subject-card:active,
.hub-card:active {
    transform: translateY(-1px) scale(0.99);
}

/* Card Glow Effect */
.card-glow {
    position: absolute;
    top: -40%;
    right: -20%;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    filter: blur(50px);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ej-dur-normal, 260ms) ease;
}

.type-card:hover .card-glow,
.subject-card:hover .card-glow,
.hub-card:hover .card-glow {
    opacity: 0.25;
}

/* Card Theme Variants */
.card-theme-emerald:hover {
    border-color: rgba(16, 185, 129, 0.6) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(16, 185, 129, 0.12) !important;
}

.card-theme-cyan:hover {
    border-color: rgba(6, 182, 212, 0.6) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(6, 182, 212, 0.12) !important;
}

.card-theme-violet:hover {
    border-color: rgba(139, 92, 246, 0.6) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(139, 92, 246, 0.12) !important;
}

/* Locked & Coming Soon States */
.type-card.is-locked,
.subject-card.is-locked,
.hub-card.is-locked {
    opacity: 0.55;
    cursor: not-allowed;
    background: rgba(15, 23, 42, 0.6);
}

.type-card.is-locked:hover,
.subject-card.is-locked:hover,
.hub-card.is-locked:hover {
    transform: none !important;
    box-shadow: var(--ej-shadow-sm) !important;
    border-color: var(--ej-border-subtle) !important;
}

/* ── 2. BUTTONS ─────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 18px;
    border-radius: var(--ej-radius-md, 12px);
    font-family: var(--ej-font-sans, inherit);
    font-size: var(--ej-text-xs, 11px);
    font-weight: var(--ej-weight-extrabold, 800);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    line-height: 1;
    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    transition: all var(--ej-dur-fast, 160ms) ease;
    -webkit-tap-highlight-color: transparent;
}

.btn:active {
    transform: scale(0.98);
}

.btn:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--ej-focus-ring);
}

/* Button Variants */
.btn-gold {
    background-color: var(--ej-gold-500, #eab308);
    color: #000000;
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.25);
}

.btn-gold:hover {
    background-color: var(--ej-gold-400, #facc15);
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.35);
}

.btn-emerald {
    background-color: var(--ej-emerald-500, #10b981);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.btn-emerald:hover {
    background-color: var(--ej-emerald-400, #34d399);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.35);
}

.btn-cyan {
    background-color: var(--ej-cyan-500, #06b6d4);
    color: #000000;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
}

.btn-cyan:hover {
    background-color: var(--ej-cyan-400, #22d3ee);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

.btn-violet {
    background-color: var(--ej-violet-500, #8b5cf6);
    color: #ffffff;
    box-shadow: 0 4px 14px rgba(139, 92, 246, 0.25);
}

.btn-violet:hover {
    background-color: var(--ej-violet-400, #a78bfa);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.35);
}

.btn-secondary {
    background-color: var(--ej-bg-card-elevated, #131c31);
    border-color: var(--ej-border-subtle, rgba(51, 65, 85, 0.5));
    color: var(--ej-text-primary, #f8fafc);
}

.btn-secondary:hover {
    background-color: var(--ej-bg-card-hover, #1e293b);
    border-color: var(--ej-border-medium, rgba(71, 85, 105, 0.6));
    color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    border-color: rgba(234, 179, 8, 0.4);
    color: var(--ej-gold-400, #facc15);
}

.btn-outline:hover {
    background-color: rgba(234, 179, 8, 0.1);
    border-color: var(--ej-gold-500, #eab308);
}

.btn-ghost {
    background-color: transparent;
    color: var(--ej-text-secondary, #94a3b8);
}

.btn-ghost:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #ffffff;
}

/* ── 3. BADGES & STATUS PILLS ──────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border-radius: var(--ej-radius-sm, 6px);
    font-size: var(--ej-text-2xs, 10px);
    font-weight: var(--ej-weight-bold, 700);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    line-height: 1;
    white-space: nowrap;
    border: 1px solid transparent;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.badge-gold {
    background: var(--ej-gold-bg, rgba(66, 32, 6, 0.25));
    border-color: var(--ej-gold-border, rgba(234, 179, 8, 0.4));
    color: var(--ej-gold-400, #facc15);
}

.badge-gold .badge-dot {
    background: var(--ej-gold-500, #eab308);
    box-shadow: 0 0 6px var(--ej-gold-glow);
}

.badge-emerald {
    background: var(--ej-emerald-bg, rgba(2, 44, 34, 0.25));
    border-color: var(--ej-emerald-border, rgba(16, 185, 129, 0.4));
    color: var(--ej-emerald-400, #34d399);
}

.badge-emerald .badge-dot {
    background: var(--ej-emerald-500, #10b981);
    box-shadow: 0 0 6px var(--ej-emerald-glow);
}

.badge-cyan {
    background: var(--ej-cyan-bg, rgba(8, 51, 68, 0.25));
    border-color: var(--ej-cyan-border, rgba(6, 182, 212, 0.4));
    color: var(--ej-cyan-400, #22d3ee);
}

.badge-cyan .badge-dot {
    background: var(--ej-cyan-500, #06b6d4);
    box-shadow: 0 0 6px var(--ej-cyan-glow);
}

.badge-violet {
    background: var(--ej-violet-bg, rgba(46, 16, 101, 0.25));
    border-color: var(--ej-violet-border, rgba(139, 92, 246, 0.4));
    color: var(--ej-violet-400, #a78bfa);
}

.badge-violet .badge-dot {
    background: var(--ej-violet-500, #8b5cf6);
    box-shadow: 0 0 6px var(--ej-violet-glow);
}

.badge-neutral {
    background: rgba(30, 41, 59, 0.5);
    border-color: var(--ej-border-subtle, rgba(51, 65, 85, 0.45));
    color: var(--ej-text-secondary, #94a3b8);
}

/* ── 4. NAVIGATION PILLS & CONTROLS ────────────────────────────── */
.nav-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--ej-radius-md, 10px);
    border: 1px solid var(--ej-border-subtle, rgba(51, 65, 85, 0.5));
    background: var(--ej-bg-card, #0f172a);
    color: var(--ej-text-secondary, #94a3b8);
    font-size: var(--ej-text-2xs, 10px);
    font-weight: var(--ej-weight-black, 900);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-decoration: none;
    transition: all var(--ej-dur-fast, 160ms) ease;
}

.nav-pill:hover {
    border-color: rgba(234, 179, 8, 0.4);
    background: var(--ej-bg-card-hover, #1e293b);
    color: var(--ej-gold-400, #facc15);
}

/* Back Button */
.back-btn {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--ej-radius-md, 10px);
    border: 1px solid var(--ej-border-subtle, rgba(51, 65, 85, 0.5));
    background: var(--ej-bg-card, #0f172a);
    color: var(--ej-text-secondary, #94a3b8);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--ej-dur-fast, 160ms) ease;
    flex-shrink: 0;
}

.back-btn:hover {
    border-color: rgba(234, 179, 8, 0.4);
    background: var(--ej-bg-card-hover, #1e293b);
    color: var(--ej-gold-400, #facc15);
    transform: translateX(-1px);
}

/* Category Switcher (e.g. Leaderboard Grammar / CBSE / Olympiad) */
.category-switcher {
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid var(--ej-border-subtle, rgba(51, 65, 85, 0.5));
    border-radius: var(--ej-radius-md, 12px);
    padding: 3px;
    gap: 3px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-tab {
    padding: 6px 14px;
    border-radius: calc(var(--ej-radius-md, 12px) - 3px);
    font-size: var(--ej-text-xs, 11px);
    font-weight: var(--ej-weight-extrabold, 800);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ej-text-secondary, #94a3b8);
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all var(--ej-dur-fast, 160ms) ease;
    white-space: nowrap;
}

.category-tab:hover:not(.active) {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.category-tab.active {
    background: var(--ej-gold-500, #eab308);
    color: #000000;
    box-shadow: 0 2px 8px rgba(234, 179, 8, 0.3);
}

/* ── 5. FORM CONTROLS ───────────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-bottom: 16px;
}

.form-label {
    font-size: var(--ej-text-xs, 11px);
    font-weight: var(--ej-weight-bold, 700);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--ej-text-secondary, #94a3b8);
}

.form-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border-radius: var(--ej-radius-md, 10px);
    border: 1px solid var(--ej-border-subtle, rgba(51, 65, 85, 0.5));
    background-color: var(--ej-bg-base, #020617);
    color: var(--ej-text-primary, #f8fafc);
    font-family: var(--ej-font-sans, inherit);
    font-size: var(--ej-text-sm, 13px);
    font-weight: var(--ej-weight-medium, 500);
    transition: border-color var(--ej-dur-fast, 160ms) ease, box-shadow var(--ej-dur-fast, 160ms) ease;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--ej-gold-500, #eab308);
    box-shadow: var(--ej-focus-ring);
}

.form-input::placeholder {
    color: var(--ej-text-muted, #64748b);
}

/* ── 6. MODALS & POPUPS ─────────────────────────────────────────── */
.coming-soon-overlay,
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: var(--ej-z-modal-backdrop, 200) !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: modalFadeIn 0.25s var(--ej-ease-out) forwards;
}

.coming-soon-card,
.modal-card {
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 400px;
    border-radius: var(--ej-radius-xl, 20px);
    border: 1px solid var(--ej-border-medium, rgba(71, 85, 105, 0.5));
    background: linear-gradient(135deg, #0b1120 0%, #020617 100%);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--ej-shadow-xl, 0 20px 60px rgba(0, 0, 0, 0.5));
    animation: modalScaleUp 0.25s var(--ej-ease-out) forwards;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes modalScaleUp {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── 7. ANIMATIONS & SKELETONS ──────────────────────────────────── */
@keyframes cardCascade {
    0% {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.card-enter,
.subject-card-enter {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    will-change: auto !important;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-enter {
    animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.spin {
    animation: ejSpin 0.8s linear infinite;
}

@keyframes ejSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Skeleton Loading Shimmer */
.skeleton {
    background: linear-gradient(90deg,
            var(--ej-skeleton-base, rgba(30, 41, 59, 0.65)) 0%,
            var(--ej-skeleton-shimmer, rgba(51, 65, 85, 0.45)) 35%,
            var(--ej-skeleton-highlight, rgba(71, 85, 105, 0.35)) 50%,
            var(--ej-skeleton-shimmer, rgba(51, 65, 85, 0.45)) 65%,
            var(--ej-skeleton-base, rgba(30, 41, 59, 0.65)) 100%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    border-radius: var(--ej-radius-sm, 8px);
}

@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ── 8. REDUCED MOTION PREFERENCE ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .card-enter,
    .subject-card-enter,
    .hero-enter {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }

    .type-card:hover,
    .subject-card:hover,
    .hub-card:hover {
        transform: none !important;
    }
}

/* ── 8B. RESPONSIVE / MOBILE CARD INSTANT-RENDER GUARD ──────────── */
@media (max-width: 767px) {
    body[data-custom-reveal] {
        opacity: 1 !important;
        visibility: visible !important;
        transition: none !important;
    }

    .card-enter,
    .subject-card-enter {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        will-change: auto !important;
    }

    .subject-card.opacity-0 {
        opacity: 1 !important;
    }
}

/* ── 9. ACADEMIC PALETTE UTILITIES (Shared by all Hubs & Class Cards) ─ */
.border-indigo-500\/30 {
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.bg-indigo-950\/20 {
    background-color: rgba(30, 27, 75, 0.2) !important;
}

.text-indigo-400 {
    color: #818cf8 !important;
}

.border-amber-500\/30 {
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.bg-amber-950\/20 {
    background-color: rgba(69, 26, 3, 0.2) !important;
}

.text-amber-400 {
    color: #fbbf24 !important;
}

.border-emerald-500\/30 {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.bg-emerald-950\/20 {
    background-color: rgba(2, 44, 34, 0.2) !important;
}

.text-emerald-400 {
    color: #34d399 !important;
}

.border-teal-500\/30 {
    border-color: rgba(20, 184, 166, 0.3) !important;
}

.bg-teal-950\/20 {
    background-color: rgba(4, 47, 46, 0.2) !important;
}

.text-teal-400 {
    color: #2dd4bf !important;
}

.border-rose-500\/30 {
    border-color: rgba(244, 63, 94, 0.3) !important;
}

.bg-rose-950\/20 {
    background-color: rgba(76, 5, 25, 0.2) !important;
}

.text-rose-400 {
    color: #fb7185 !important;
}

.border-cyan-500\/30 {
    border-color: rgba(6, 182, 212, 0.3) !important;
}

.bg-cyan-950\/20 {
    background-color: rgba(8, 51, 68, 0.2) !important;
}

.text-cyan-400 {
    color: #22d3ee !important;
}

.border-violet-500\/30 {
    border-color: rgba(139, 92, 246, 0.3) !important;
}

.bg-violet-950\/20 {
    background-color: rgba(46, 16, 101, 0.2) !important;
}

.text-violet-400 {
    color: #a78bfa !important;
}

.border-yellow-500\/30 {
    border-color: rgba(234, 179, 8, 0.3) !important;
}

.bg-yellow-950\/20 {
    background-color: rgba(66, 32, 6, 0.2) !important;
}

.text-yellow-400 {
    color: #facc15 !important;
}

.border-pink-500\/30 {
    border-color: rgba(236, 72, 153, 0.3) !important;
}

.bg-pink-950\/20 {
    background-color: rgba(80, 7, 36, 0.2) !important;
}

.text-pink-400 {
    color: #f472b6 !important;
}


/* ── INLINED LAYOUT (Merged for Zero Mobile Render-Blocking) ── */
/**
 * ================================================================
 * EnglishJibi Design System — Layout & Responsive Utilities
 * Master layout rules for responsive containers, grids, headers,
 * branding bars, and responsive viewports (320px to 1440px+).
 * ================================================================
 */

/* ── 1. GLOBAL OVERFLOW GUARD ───────────────────────────────────── */
html,
body {
    overflow-x: clip;
    max-width: 100vw;
}

/* ── 2. FLUID SHELL (Consistent Content Width) ──────────────────── */
.fluid-shell {
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 430px) {
    .fluid-shell {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (min-width: 640px) {
    .fluid-shell {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (min-width: 1024px) {
    .fluid-shell {
        padding-left: 32px;
        padding-right: 32px;
    }
}

@media (min-width: 1440px) {
    .fluid-shell {
        padding-left: 40px;
        padding-right: 40px;
    }
}

/* ── 3. BRANDING BAR ────────────────────────────────────────────── */
.brand-bar {
    width: 100%;
    background: #020617;
    border-bottom: 1px solid rgba(51, 65, 85, 0.4);
}

.brand-bar-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
}

@media (min-width: 768px) {
    .brand-bar-mobile {
        display: flex !important;
    }
}

.brand-title {
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    user-select: none;
    line-height: 1;
}

.brand-white {
    color: #ffffff;
}

.brand-red {
    color: #cc2200;
}

/* ── 4. RESPONSIVE GRID LAYOUTS ─────────────────────────────────── */
.academic-grid-4 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .academic-grid-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .academic-grid-4 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1280px) {
    .academic-grid-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 24px;
    }
}

.academic-grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

@media (min-width: 640px) {
    .academic-grid-3 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .academic-grid-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px;
    }
}

/* ── 5. SITE FOOTER ─────────────────────────────────────────────── */
.site-footer {
    width: 100%;
    margin-top: auto;
    padding: 0;
    border-top: 1px solid rgba(51, 65, 85, 0.4);
    background: #020617;
}

@media (max-width: 1023px) {
    .site-footer {
        padding: 0;
    }
}

.footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    padding: 14px 16px;
}

@media (min-width: 768px) {
    .footer-inner {
        flex-direction: row;
        justify-content: space-between;
        gap: 16px;
        padding: 18px 24px;
    }
}

.footer-brand {
    font-size: 12px;
    font-weight: 700;
    color: var(--ej-text-secondary, #94a3b8);
    letter-spacing: 0.05em;
}

.footer-divider {
    display: none;
    width: 1px;
    height: 14px;
    background: rgba(51, 65, 85, 0.6);
}

@media (min-width: 768px) {
    .footer-divider {
        display: block;
    }
}

.footer-credit {
    font-size: 12px;
    font-weight: 500;
    color: var(--ej-text-muted, #64748b);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-credit-name {
    font-weight: 700;
    color: var(--ej-text-secondary, #94a3b8);
}

.footer-credit-role {
    font-size: 12px;
    color: var(--ej-text-muted, #64748b);
}

/* ── 6. VIEWPORT FIXES ACROSS BREAKPOINTS ───────────────────────── */
/* 320px - 375px (Small phones) */
@media (max-width: 375px) {
    .fluid-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 10px;
    }
}


/* ══════════════════════════════════════════════════════════════════
   DESIGN TOKENS — Central source of truth for visual system
   ══════════════════════════════════════════════════════════════════ */
:root {
    /* ── Spacing scale (4px base) — mapped to master design-tokens.css ── */
    --sp-0: var(--ej-sp-0, 0);
    --sp-1: var(--ej-sp-1, 4px);
    --sp-2: var(--ej-sp-2, 8px);
    --sp-3: var(--ej-sp-3, 12px);
    --sp-4: var(--ej-sp-4, 16px);
    --sp-5: var(--ej-sp-5, 20px);
    --sp-6: var(--ej-sp-6, 24px);
    --sp-8: var(--ej-sp-8, 32px);
    --sp-10: var(--ej-sp-10, 40px);
    --sp-12: var(--ej-sp-12, 48px);
    --sp-16: var(--ej-sp-16, 64px);

    /* ── Border radius — mapped to master design-tokens.css ──────────── */
    --radius-xs: var(--ej-radius-xs, 4px);
    --radius-sm: var(--ej-radius-sm, 8px);
    --radius-md: var(--ej-radius-md, 12px);
    --radius-lg: var(--ej-radius-lg, 16px);
    --radius-xl: var(--ej-radius-xl, 20px);
    --radius-2xl: var(--ej-radius-2xl, 24px);
    --radius-full: var(--ej-radius-full, 9999px);

    /* ── Shadow hierarchy — mapped to master design-tokens.css ────────── */
    --shadow-xs: var(--ej-shadow-xs, 0 1px 2px rgba(0, 0, 0, 0.25));
    --shadow-sm: var(--ej-shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.3));
    --shadow-md: var(--ej-shadow-md, 0 6px 20px rgba(0, 0, 0, 0.35));
    --shadow-lg: var(--ej-shadow-lg, 0 12px 36px rgba(0, 0, 0, 0.4));
    --shadow-xl: var(--ej-shadow-xl, 0 20px 60px rgba(0, 0, 0, 0.5));
    --shadow-glow-yellow: 0 0 20px var(--ej-gold-glow, rgba(234, 179, 8, 0.2));
    --shadow-glow-emerald: 0 0 20px var(--ej-emerald-glow, rgba(16, 185, 129, 0.2));
    --shadow-glow-cyan: 0 0 20px var(--ej-cyan-glow, rgba(6, 182, 212, 0.2));
    --shadow-glow-blue: 0 0 20px rgba(59, 130, 246, 0.2);

    /* ── Glassmorphism ────────────────────────────────────────── */
    --glass-bg: rgba(11, 17, 32, 0.85);
    --glass-bg-heavy: rgba(11, 17, 32, 0.92);
    --glass-border: rgba(148, 163, 184, 0.08);
    --glass-border-hover: rgba(148, 163, 184, 0.14);
    --glass-blur: 16px;

    /* ── Gradient tokens ──────────────────────────────────────── */
    --gradient-card: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.98));
    --gradient-card-hover: linear-gradient(135deg, rgba(15, 23, 42, 1), rgba(2, 6, 23, 1));
    --gradient-accent-yellow: linear-gradient(135deg, #eab308, #f59e0b);
    --gradient-accent-emerald: linear-gradient(135deg, #059669, #10b981);
    --gradient-accent-blue: linear-gradient(135deg, #2563eb, #3b82f6);
    --gradient-bar-yellow: linear-gradient(90deg, #ca8a04, #eab308);
    --gradient-bar-emerald: linear-gradient(90deg, #059669, #34d399);

    /* ── Color tokens — mapped to master design-tokens.css ────────────── */
    --surface-primary: var(--ej-bg-base, #020617);
    --surface-card: var(--ej-bg-card, #0f172a);
    --surface-card-elevated: var(--ej-bg-card-elevated, #131c31);
    --surface-hover: var(--ej-bg-card-hover, #1e293b);
    --border-subtle: var(--ej-border-subtle, rgba(51, 65, 85, 0.45));
    --border-medium: var(--ej-border-medium, rgba(71, 85, 105, 0.5));
    --border-accent: var(--ej-gold-border, rgba(234, 179, 8, 0.4));
    --text-primary: var(--ej-text-primary, #f8fafc);
    --text-secondary: var(--ej-text-secondary, #cbd5e1);
    --text-muted: var(--ej-text-muted, #a1b3c9);
    --text-accent: var(--ej-gold-500, #eab308);

    /* ── Transition tokens — mapped to master design-tokens.css ───────── */
    --ease-out-expo: var(--ej-ease-out, cubic-bezier(0.16, 1, 0.3, 1));
    --ease-spring: var(--ej-ease-spring, cubic-bezier(0.34, 1.56, 0.64, 1));
    --duration-fast: var(--ej-dur-fast, 160ms);
    --duration-normal: var(--ej-dur-normal, 260ms);
    --duration-slow: var(--ej-dur-slow, 400ms);

    /* ── Focus ring ───────────────────────────────────────────── */
    --focus-ring: var(--ej-focus-ring, 0 0 0 2px rgba(234, 179, 8, 0.6), 0 0 0 4px rgba(234, 179, 8, 0.2));

    /* ── Shared sticky offset for desktop split layouts ───────── */
    --sticky-top-offset: 88px;
    --sets-sticky-top: 148px;
}

/* ── Accessibility: Respect user's motion preferences ─────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ── Base ──────────────────────────────────────────────────────── */
html {
    overflow-x: clip;
}

body {
    background-color: var(--surface-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-synthesis: none;
    overflow-x: clip;
}

body[data-custom-reveal] {
    opacity: 0;
    transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

body[data-custom-reveal].page-ready {
    opacity: 1 !important;
    visibility: visible !important;
}

/* ── Shared fluid wrappers + split layouts ───────────────────── */
.fluid-shell {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

@media (min-width: 640px) {
    .fluid-shell {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (min-width: 1280px) {
    .fluid-shell {
        padding-left: 22px;
        padding-right: 22px;
    }
}

.split-1-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
}

@media (min-width: 1024px) {
    .split-1-2 {
        grid-template-columns: minmax(320px, 34%) minmax(0, 66%);
        gap: 18px;
    }
}

@media (min-width: 1536px) {
    .split-1-2 {
        gap: 20px;
    }
}

.sticky-desktop {
    position: static;
}

@media (min-width: 1024px) {
    .sticky-desktop {
        position: sticky;
        top: var(--sticky-top-offset);
        align-self: start;
    }

    /* Sticky Level Stats Sidebar on Sets Pages (Constant while scrolling) */
    #level-stats-sidebar,
    .level-stats-sidebar {
        position: -webkit-sticky !important;
        position: sticky !important;
        top: var(--sets-sticky-top, 148px) !important;
        align-self: start !important;
        z-index: 20 !important;
    }
}

/* ── Background variants ──────────────────────────────────────── */
body.bg-center-glow {
    background-color: var(--surface-primary, #020617);
    background-image:
        radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.2) 0%, transparent 60%),
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 100% 100%, 30px 30px, 30px 30px;
}

body.bg-dual-glow {
    background-color: var(--surface-primary, #020617);
    background-image:
        radial-gradient(circle at 20% 0%, rgba(59, 130, 246, 0.12) 0%, transparent 55%),
        radial-gradient(circle at 80% 0%, rgba(234, 179, 8, 0.06) 0%, transparent 45%),
        linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 32px 32px, 32px 32px;
}

/* ── Disable Criss-Cross Grid when toggled OFF via Admin Settings ─ */
body.no-crisscross.bg-center-glow,
html[data-crisscross="false"] body.bg-center-glow {
    background-image: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.2) 0%, var(--surface-primary, #020617) 65%);
    background-size: 100% 100%;
}

body.no-crisscross.bg-dual-glow,
html[data-crisscross="false"] body.bg-dual-glow {
    background-image:
        radial-gradient(circle at 20% 0%, rgba(59, 130, 246, 0.12) 0%, var(--surface-primary, #020617) 55%),
        radial-gradient(circle at 80% 0%, rgba(234, 179, 8, 0.06) 0%, var(--surface-primary, #020617) 45%);
    background-size: 100% 100%, 100% 100%;
}

/* ══════════════════════════════════════════════════════════════════
   KEYFRAMES
   ══════════════════════════════════════════════════════════════════ */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 8px rgba(234, 179, 8, 0.1);
    }

    50% {
        box-shadow: 0 0 20px rgba(234, 179, 8, 0.25);
    }
}

@keyframes progressShimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes subtleBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-2px);
    }
}

/* ══════════════════════════════════════════════════════════════════
   ANIMATION UTILITY CLASSES
   ══════════════════════════════════════════════════════════════════ */
.spin {
    animation: spin 1s linear infinite;
}

.enter {
    animation: slideUp var(--duration-slow) var(--ease-out-expo) forwards;
    opacity: 0;
}

.animate-enter {
    animation: slideUpFade 0.45s var(--ease-out-expo) forwards;
    opacity: 0;
}

.animate-shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.animate-scale-in {
    animation: scaleIn var(--duration-slow) var(--ease-out-expo) forwards;
    opacity: 0;
}

.animate-fade-in {
    animation: fadeIn var(--duration-normal) ease forwards;
    opacity: 0;
}

.animate-glow-pulse {
    animation: glowPulse 2.5s ease-in-out infinite;
}

.animate-bounce-subtle {
    animation: subtleBounce 2s ease-in-out infinite;
}

/* Tailwind CDN can miss line-clamp plugin utilities in some setups.
   Provide a local fallback so card descriptions don't overflow. */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ══════════════════════════════════════════════════════════════════
   REUSABLE COMPONENT CLASSES
   ══════════════════════════════════════════════════════════════════ */

/* ── Glass panel ──────────────────────────────────────────────── */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
}

.glass-panel-heavy {
    background: var(--glass-bg-heavy);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
}

/* ── Elevated card ────────────────────────────────────────────── */
.card-elevated {
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: transform var(--duration-normal) var(--ease-out-expo),
        box-shadow var(--duration-normal) ease,
        border-color var(--duration-fast) ease;
}

@media (hover: hover) {
    .card-elevated:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-lg);
        border-color: var(--glass-border-hover);
    }
}

/* ── Button hierarchy ─────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #000;
    background: var(--gradient-accent-yellow);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm), var(--shadow-glow-yellow);
    cursor: pointer;
    transition: transform var(--duration-fast) var(--ease-out-expo),
        box-shadow var(--duration-fast) ease,
        filter var(--duration-fast) ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), 0 0 30px rgba(234, 179, 8, 0.25);
    filter: brightness(1.05);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-xs);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: saturate(0.5);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease-out-expo);
}

.btn-secondary:hover {
    color: var(--text-primary);
    border-color: var(--border-medium);
    background: var(--surface-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--duration-fast) ease;
}

.btn-ghost:hover {
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--border-subtle);
}

/* ── Badge system ─────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    border-radius: var(--radius-sm);
    border: 1px solid;
    line-height: 1;
}

.badge-success {
    color: #34d399;
    background: rgba(5, 150, 105, 0.12);
    border-color: rgba(5, 150, 105, 0.25);
}

.badge-warning {
    color: #fbbf24;
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.25);
}

.badge-danger {
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.25);
}

.badge-info {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.25);
}

.badge-neutral {
    color: var(--text-muted);
    background: rgba(100, 116, 139, 0.1);
    border-color: rgba(100, 116, 139, 0.2);
}

/* ── Section heading ──────────────────────────────────────────── */
.section-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.section-heading .section-accent {
    width: 5px;
    height: 24px;
    border-radius: var(--radius-full);
    flex-shrink: 0;
}

.section-heading h2 {
    font-size: 18px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-primary);
    line-height: 1;
}

.section-heading .section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-subtle) 0%, transparent 100%);
    margin-left: 4px;
}

/* ══════════════════════════════════════════════════════════════════
   EXISTING COMPONENT ENHANCEMENTS
   ══════════════════════════════════════════════════════════════════ */

/* ── Scrollbar hide ───────────────────────────────────────────── */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ── Branding bar ─────────────────────────────────────────────── */
.brand-bar {
    background-color: #112240;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
    background-size: 28px 28px, 28px 28px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.75);
    position: relative;
}

.brand-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(234, 179, 8, 0.15), transparent);
}

/* Brand-bar is now visible on all screen sizes (mobile + desktop) */
.brand-bar,
.brand-bar-mobile {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
}

/* ── Video card ───────────────────────────────────────────────── */
.video-card {
    transition: transform var(--duration-normal) var(--ease-out-expo),
        box-shadow var(--duration-normal) ease;
}

.video-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

/* ── Progress bar ─────────────────────────────────────────────── */
.progress-bar {
    transition: width 0.9s var(--ease-out-expo);
    position: relative;
    overflow: hidden;
}

.progress-bar.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 100%);
    background-size: 200% 100%;
    animation: progressShimmer 2s linear infinite;
}

/* ── Set card ─────────────────────────────────────────────────── */
.set-card {
    transition: transform var(--duration-fast) var(--ease-out-expo),
        box-shadow var(--duration-fast) ease,
        border-color var(--duration-fast) ease;
}

.set-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.set-card.is-locked {
    opacity: 0.6;
    pointer-events: none;
}

.set-card.is-completed {
    border-color: rgba(16, 185, 129, 0.2) !important;
}

.set-card.is-completed:hover {
    border-color: rgba(16, 185, 129, 0.35) !important;
    box-shadow: var(--shadow-md), var(--shadow-glow-emerald);
}

/* ── Set card action buttons consistency (mobile & desktop) ───── */
.set-card button,
.set-card a,
.set-action-btn,
.set-pdf-btn,
.js-download-question-pdf,
.js-cbse-pdf,
.js-olympiad-pdf {
    min-height: 36px !important;
    max-height: 36px !important;
    height: 36px !important;
    min-width: unset !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

/* ── Fixed standardized dimensions for set action buttons ── */
.set-action-btn.set-pdf-btn,
.set-pdf-btn {
    width: 64px !important;
    min-width: 64px !important;
    max-width: 64px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.set-action-btn.set-yt-btn,
.set-yt-btn {
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}

.set-action-btn.set-start-btn,
.set-start-btn {
    width: 108px !important;
    min-width: 108px !important;
    max-width: 108px !important;
    height: 36px !important;
    min-height: 36px !important;
    max-height: 36px !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0 !important;
}


/* ── Stat card (profile page + reusable) ──────────────────────── */
.stat-card {
    transition: transform var(--duration-fast) var(--ease-out-expo),
        box-shadow var(--duration-fast) ease,
        border-color var(--duration-fast) ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent);
    opacity: 0;
    transition: opacity var(--duration-normal) ease;
}

/* Only apply hover transforms on devices with actual hover capability (desktop) */
@media (hover: hover) {
    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-md), var(--shadow-glow-yellow);
        border-color: var(--border-accent);
    }

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

/* ── Breadcrumb separator ─────────────────────────────────────── */
.bc-sep {
    opacity: 0.22;
}

/* ── Dashboard card border enhancement ───────────────────────── */
/* Lifts subject, stat, CBSE, and resume cards off the dark bg    */
/* with a brighter border + subtle top-edge glow + depth shadow   */

/* Subject cards (curriculum grid) */
.subject-card {
    background: #0f172a !important;
    /* slate-900 — same as Olympiad cards */
    border-color: rgba(71, 85, 105, 0.35) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
}

.subject-card.is-skeleton {
    pointer-events: none;
    cursor: default;
    user-select: none;
}

.subject-card.is-skeleton::after {
    display: none;
}

.subject-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(148, 163, 184, 0.1) 30%, rgba(148, 163, 184, 0.08) 70%, transparent 95%);
    pointer-events: none;
    z-index: 20;
}

@media (hover: hover) {
    .subject-card:hover {
        transform: none !important;
    }

    .subject-card-violet:hover {
        border-color: rgba(139, 92, 246, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(139, 92, 246, 0.12);
    }

    .subject-card-violet:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(139, 92, 246, 0.18) 30%, rgba(139, 92, 246, 0.14) 70%, transparent 95%);
    }

    .subject-card-yellow:hover {
        border-color: rgba(234, 179, 8, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(234, 179, 8, 0.12);
    }

    .subject-card-yellow:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(234, 179, 8, 0.18) 30%, rgba(234, 179, 8, 0.14) 70%, transparent 95%);
    }

    .subject-card-emerald:hover {
        border-color: rgba(16, 185, 129, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(16, 185, 129, 0.12);
    }

    .subject-card-emerald:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(16, 185, 129, 0.18) 30%, rgba(16, 185, 129, 0.14) 70%, transparent 95%);
    }

    .subject-card-cyan:hover {
        border-color: rgba(6, 182, 212, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(6, 182, 212, 0.12);
    }

    .subject-card-cyan:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(6, 182, 212, 0.18) 30%, rgba(6, 182, 212, 0.14) 70%, transparent 95%);
    }

    .subject-card-rose:hover {
        border-color: rgba(244, 63, 94, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(244, 63, 94, 0.12);
    }

    .subject-card-rose:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(244, 63, 94, 0.18) 30%, rgba(244, 63, 94, 0.14) 70%, transparent 95%);
    }

    .watermark-num {
        display: none !important;
    }
}

/* Staggered entrance animation for subject & hub cards */
@keyframes subjectCardCascade {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.subject-card-enter,
.card-enter {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
    will-change: auto !important;
}

@keyframes cardCascade {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce),
(max-width: 767px) {
    body[data-custom-reveal] {
        opacity: 1 !important;
        visibility: visible !important;
        transition: none !important;
    }

    .subject-card-enter,
    .card-enter {
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
        will-change: auto !important;
    }

    .subject-card.opacity-0 {
        opacity: 1 !important;
    }
}

/* Section title rows & grid containers — explicit guard against unwanted borders and shadows */
.curriculum-section-header,
.fluid-shell>.flex.items-center,
.fluid-shell>.grid {
    box-shadow: none !important;
}

/* Dashboard stat cards (top 4 metric tiles) */
[role="group"][aria-label="Performance statistics"]>div {
    border-color: rgba(71, 85, 105, 0.35) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.18);
    position: relative;
}

[role="group"][aria-label="Performance statistics"]>div::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.08), transparent);
    pointer-events: none;
    border-radius: inherit;
}

/* CBSE Special cards */
#cbse-card-10,
#cbse-card-9,
#adv-grammar-card {
    border-color: rgba(71, 85, 105, 0.35) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
}

#cbse-card-10::after,
#cbse-card-9::after,
#adv-grammar-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(148, 163, 184, 0.1) 30%, rgba(148, 163, 184, 0.08) 70%, transparent 95%);
    pointer-events: none;
    z-index: 20;
}

@media (hover: hover) {
    #cbse-card-10:hover {
        border-color: rgba(6, 182, 212, 0.45) !important;
        box-shadow:
            0 4px 14px rgba(0, 0, 0, 0.35),
            0 12px 32px rgba(0, 0, 0, 0.25),
            0 0 20px rgba(6, 182, 212, 0.12);
    }

    #cbse-card-10:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(6, 182, 212, 0.15) 30%, rgba(6, 182, 212, 0.12) 70%, transparent 95%);
    }

    #cbse-card-9:hover {
        border-color: rgba(139, 92, 246, 0.4) !important;
        box-shadow:
            0 4px 14px rgba(0, 0, 0, 0.35),
            0 12px 32px rgba(0, 0, 0, 0.25),
            0 0 20px rgba(139, 92, 246, 0.12);
    }

    #cbse-card-9:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(139, 92, 246, 0.15) 30%, rgba(139, 92, 246, 0.12) 70%, transparent 95%);
    }

    #adv-grammar-card:hover {
        border-color: rgba(234, 179, 8, 0.4) !important;
        box-shadow:
            0 4px 14px rgba(0, 0, 0, 0.35),
            0 12px 32px rgba(0, 0, 0, 0.25),
            0 0 20px rgba(234, 179, 8, 0.12);
    }

    #adv-grammar-card:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(234, 179, 8, 0.15) 30%, rgba(234, 179, 8, 0.12) 70%, transparent 95%);
    }
}

/* ── Olympiad Curriculum cards — Unified with CBSE Professional Architecture ── */
.olympiad-card {
    border-color: rgba(71, 85, 105, 0.35) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.2);
    position: relative;
}

.olympiad-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, rgba(148, 163, 184, 0.1) 30%, rgba(148, 163, 184, 0.08) 70%, transparent 95%);
    pointer-events: none;
    z-index: 20;
}

@media (hover: hover) {
    .olympiad-card:hover {
        transform: none !important;
    }

    .olympiad-card-cyan:hover {
        border-color: rgba(6, 182, 212, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(6, 182, 212, 0.12);
    }

    .olympiad-card-cyan:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(6, 182, 212, 0.18) 30%, rgba(6, 182, 212, 0.14) 70%, transparent 95%);
    }

    .olympiad-card-violet:hover {
        border-color: rgba(139, 92, 246, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(139, 92, 246, 0.12);
    }

    .olympiad-card-violet:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(139, 92, 246, 0.18) 30%, rgba(139, 92, 246, 0.14) 70%, transparent 95%);
    }

    .olympiad-card-yellow:hover {
        border-color: rgba(234, 179, 8, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(234, 179, 8, 0.12);
    }

    .olympiad-card-yellow:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(234, 179, 8, 0.18) 30%, rgba(234, 179, 8, 0.14) 70%, transparent 95%);
    }

    .olympiad-card-pink:hover {
        border-color: rgba(236, 72, 153, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(236, 72, 153, 0.12);
    }

    .olympiad-card-pink:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(236, 72, 153, 0.18) 30%, rgba(236, 72, 153, 0.14) 70%, transparent 95%);
    }

    .olympiad-card-indigo:hover {
        border-color: rgba(99, 102, 241, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(99, 102, 241, 0.12);
    }

    .olympiad-card-indigo:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(99, 102, 241, 0.18) 30%, rgba(99, 102, 241, 0.14) 70%, transparent 95%);
    }

    .olympiad-card-sky:hover {
        border-color: rgba(14, 165, 233, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(14, 165, 233, 0.12);
    }

    .olympiad-card-sky:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(14, 165, 233, 0.18) 30%, rgba(14, 165, 233, 0.14) 70%, transparent 95%);
    }

    .olympiad-card-amber:hover {
        border-color: rgba(245, 158, 11, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(245, 158, 11, 0.12);
    }

    .olympiad-card-amber:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(245, 158, 11, 0.18) 30%, rgba(245, 158, 11, 0.14) 70%, transparent 95%);
    }

    .olympiad-card-emerald:hover {
        border-color: rgba(16, 185, 129, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(16, 185, 129, 0.12);
    }

    .olympiad-card-emerald:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(16, 185, 129, 0.18) 30%, rgba(16, 185, 129, 0.14) 70%, transparent 95%);
    }

    .olympiad-card-teal:hover {
        border-color: rgba(20, 184, 166, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(20, 184, 166, 0.12);
    }

    .olympiad-card-teal:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(20, 184, 166, 0.18) 30%, rgba(20, 184, 166, 0.14) 70%, transparent 95%);
    }

    .olympiad-card-rose:hover {
        border-color: rgba(244, 63, 94, 0.5) !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 12px 32px rgba(0, 0, 0, 0.25), 0 0 20px rgba(244, 63, 94, 0.12);
    }

    .olympiad-card-rose:hover::after {
        background: linear-gradient(90deg, transparent 5%, rgba(244, 63, 94, 0.18) 30%, rgba(244, 63, 94, 0.14) 70%, transparent 95%);
    }

    .olympiad-card .watermark-num {
        transition: color 0.3s ease;
    }

    .olympiad-card-cyan:hover .watermark-num {
        color: rgba(6, 182, 212, 0.25) !important;
    }

    .olympiad-card-violet:hover .watermark-num {
        color: rgba(139, 92, 246, 0.25) !important;
    }

    .olympiad-card-yellow:hover .watermark-num {
        color: rgba(234, 179, 8, 0.25) !important;
    }

    .olympiad-card-pink:hover .watermark-num {
        color: rgba(236, 72, 153, 0.25) !important;
    }

    .olympiad-card-indigo:hover .watermark-num {
        color: rgba(99, 102, 241, 0.25) !important;
    }

    .olympiad-card-sky:hover .watermark-num {
        color: rgba(14, 165, 233, 0.25) !important;
    }

    .olympiad-card-amber:hover .watermark-num {
        color: rgba(245, 158, 11, 0.25) !important;
    }

    .olympiad-card-emerald:hover .watermark-num {
        color: rgba(16, 185, 129, 0.25) !important;
    }

    .olympiad-card-teal:hover .watermark-num {
        color: rgba(20, 184, 166, 0.25) !important;
    }

    .olympiad-card-rose:hover .watermark-num {
        color: rgba(244, 63, 94, 0.25) !important;
    }
}

/* Leaderboard Rank Card Banner */
#resume-wrap>div {
    border-color: rgba(71, 85, 105, 0.35) !important;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.4),
        0 4px 12px rgba(0, 0, 0, 0.18);
}

/* ── Practice page: compact header on scroll (mobile only) ────── */
@media (max-width: 1023px) {
    #sticky-header-wrap.compact .hdr-title-full {
        display: none;
    }

    #sticky-header-wrap.compact .hdr-title-compact {
        display: inline !important;
    }

    #sticky-header-wrap.compact .hdr-sub {
        display: none;
    }
}

/* ── Practice header responsive title short name on mobile ───── */
.hdr-title-short {
    display: inline;
}
.hdr-title-full-name {
    display: none;
}
@media (min-width: 768px) {
    .hdr-title-short {
        display: none !important;
    }
    .hdr-title-full-name {
        display: inline !important;
    }
}

/* ── Practice test pages: Direct icon & timer on phone screens (no outer div pill) ── */
@media (max-width: 767px) {
    .hdr-timer-pill {
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        gap: 6px !important;
    }
}

/* ══════════════════════════════════════════════════════════════════
   PROFESSIONAL FOOTER
   ══════════════════════════════════════════════════════════════════ */
.site-footer {
    border-top: 1px solid rgba(148, 163, 184, 0.08);
    background: linear-gradient(to top, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.6));
    width: 100%;
    padding: 0;
}

.site-footer .footer-inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 16px clamp(1rem, 3.5vw, 3.25rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.site-footer .footer-brand {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.7);
    margin: 0;
    white-space: nowrap;
}

.site-footer .footer-divider {
    display: none;
}

.site-footer .footer-credit {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: rgba(148, 163, 184, 0.65);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.site-footer .footer-credit-name {
    color: #EAB308;
    font-weight: 700;
}

.site-footer .footer-credit-role {
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.55);
    display: inline-flex;
    align-items: center;
}

.site-footer .footer-credit-role::before {
    content: '·';
    margin-right: 6px;
    color: rgba(148, 163, 184, 0.4);
    font-weight: 900;
}

/* ── Footer responsive — standard professional height & bottom-nav clearance only when needed ──── */
@media (max-width: 1023px) {
    .site-footer .footer-inner {
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding-top: 14px;
        padding-bottom: 14px;
        gap: 6px;
    }

    /* Only add clearance if mobile-nav is present on the page */
    body:has(.mobile-nav) .site-footer .footer-inner {
        padding-bottom: calc(64px + 14px + env(safe-area-inset-bottom, 0));
    }

    .site-footer .footer-brand {
        font-size: 0.72rem;
    }

    .site-footer .footer-credit {
        justify-content: center;
        text-align: center;
        font-size: 0.72rem;
    }

    /* Keep footer compact on tablets and mobile */
    .site-footer .footer-credit-role {
        display: none !important;
    }
}

@media (max-width: 640px) {
    .site-footer .footer-inner {
        padding-left: 1rem;
        padding-right: 1rem;
        padding-top: 12px;
        padding-bottom: 12px;
        gap: 5px;
    }

    body:has(.mobile-nav) .site-footer .footer-inner {
        padding-bottom: calc(64px + 12px + env(safe-area-inset-bottom, 0));
    }

    .site-footer .footer-brand {
        font-size: 0.7rem;
    }

    .site-footer .footer-credit {
        font-size: 0.7rem;
        flex-direction: row;
        justify-content: center;
        gap: 4px;
        flex-wrap: wrap;
    }
}

/* Fallback for browsers without :has support */
@supports not (selector(:has(*))) {
    @media (max-width: 1023px) {
        .site-footer .footer-inner {
            padding-bottom: calc(64px + 14px + env(safe-area-inset-bottom, 0));
        }
    }
}

/* ══════════════════════════════════════════════════════════════════
   ACCESSIBILITY
   ══════════════════════════════════════════════════════════════════ */

/* ── Focus ring for keyboard navigation ───────────────────────── */
*:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--focus-ring);
    border-radius: var(--radius-sm);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid transparent;
    box-shadow: var(--focus-ring);
}

/* ── Reduced motion ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .spin {
        animation: none;
    }
}

/* ── High contrast support ────────────────────────────────────── */
@media (prefers-contrast: high) {
    :root {
        --border-subtle: rgba(100, 116, 139, 0.8);
        --border-medium: rgba(148, 163, 184, 0.8);
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
    }
}

/* ══════════════════════════════════════════════════════════════════
   LOGIN PAGE SPECIFIC
   ══════════════════════════════════════════════════════════════════ */
.login-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-xl);
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-accent-yellow);
    opacity: 0.6;
}

.login-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-primary);
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: border-color var(--duration-fast) ease,
        box-shadow var(--duration-fast) ease;
}

.login-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.login-input:focus {
    outline: none;
    border-color: rgba(234, 179, 8, 0.5);
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.1);
}

.login-error {
    padding: 10px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-md);
}

/* ── Spinner utility ──────────────────────────────────────────── */
.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border: 2.5px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ══════════════════════════════════════════════════════════════════
   AUTH LAYOUT — Split-screen for login & register pages
   ══════════════════════════════════════════════════════════════════ */

.auth-layout {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ── Left: Branding Panel ─────────────────────────────────────── */
.auth-brand-panel {
    display: none;
    width: 50%;
    min-width: 420px;
    max-width: 600px;
    background: linear-gradient(135deg, #0c1929 0%, #0a1628 40%, #081020 100%);
    position: relative;
    overflow: hidden;
}

.auth-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    height: 100%;
    padding: 48px 56px;
}

.auth-brand-grid {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    top: -30%;
    left: -20%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -20%;
    right: -10%;
    width: 50%;
    height: 50%;
    background: radial-gradient(circle, rgba(234, 179, 8, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.auth-brand-content {
    position: relative;
    z-index: 2;
}

.auth-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: #60a5fa;
    margin-bottom: 28px;
}

.auth-brand-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #3b82f6;
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

.auth-brand-title {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    margin-bottom: 4px;
}

.auth-brand-subtitle {
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(148, 163, 184, 0.5);
    margin-bottom: 0;
}

.auth-brand-divider {
    width: 48px;
    height: 2px;
    background: linear-gradient(90deg, rgba(234, 179, 8, 0.6), rgba(234, 179, 8, 0.05));
    margin: 24px 0;
    border-radius: 2px;
}

.auth-brand-desc {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.7;
    color: rgba(148, 163, 184, 0.7);
    max-width: 380px;
    margin-bottom: 32px;
}

.auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(203, 213, 225, 0.75);
}

.auth-feature-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #3b82f6;
}

.auth-brand-footer {
    position: absolute;
    bottom: 32px;
    left: 56px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.4);
}

/* ── Right: Card Panel ────────────────────────────────────────── */
.auth-card-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
        #020617;
    overflow-y: auto;
}

.auth-card-inner {
    width: 100%;
    max-width: 420px;
}

/* ── Mobile Branding (visible < 1024px) ──────────────────────── */
.auth-mobile-brand {
    text-align: center;
    margin-bottom: 20px;
    display: block;
}

.auth-mobile-footer {
    text-align: center;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(100, 116, 139, 0.4);
    margin-top: 16px;
    display: block;
}

/* ── Success Panel ────────────────────────────────────────────── */
.auth-success-panel {
    text-align: center;
    padding: 28px 20px;
}

.auth-success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #10b981;
    margin-bottom: 16px;
}

/* ── Desktop breakpoint ──────────────────────────────────────── */
@media (min-width: 1024px) {
    .auth-brand-panel {
        display: block;
    }

    .auth-mobile-brand,
    .auth-mobile-footer {
        display: none;
    }

    .auth-card-panel {
        background:
            radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.05) 0%, transparent 50%),
            #020617;
    }
}

/* ── Right panel border on desktop ───────────────────────────── */
@media (min-width: 1024px) {
    .auth-card-panel {
        border-left: 1px solid rgba(148, 163, 184, 0.06);
    }
}

/* ── Mobile adjustments ──────────────────────────────────────── */
@media (max-width: 480px) {
    .auth-card-panel {
        padding: 16px;
    }

    .login-card {
        border-radius: var(--radius-xl) !important;
    }
}

@media (max-width: 768px) {

    .auth-card-panel button,
    .btn-primary,
    .btn-secondary,
    .btn-ghost,
    .auth-btn {
        min-height: 44px;
    }
}

/* ── Ensure no scroll on standard desktop ────────────────────── */
@media (min-height: 700px) and (min-width: 1024px) {
    .auth-card-panel {
        overflow: hidden;
    }
}

/* ══════════════════════════════════════════════════════════════════
   CUSTOM SCROLLBAR — Professional classic dark style
   ══════════════════════════════════════════════════════════════════ */
::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: rgba(2, 6, 23, 0.35);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(71, 85, 105, 0.65), rgba(51, 65, 85, 0.5));
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(100, 116, 139, 0.8), rgba(71, 85, 105, 0.7));
}

html {
    scrollbar-width: thin;
    scrollbar-color: rgba(71, 85, 105, 0.5) rgba(2, 6, 23, 0.3);
}

/* ── Profile card fade-in helper ──────────────────────────────── */
.profile-fade-in {
    opacity: 0;
    transition: opacity 0.35s ease;
}

.profile-fade-in.visible {
    opacity: 1;
}

/* ── Profile desktop shell: leaderboard-style structure ───────── */
@media (min-width: 1024px) {
    .profile-page #profile-main-shell {
        --profile-pane-height: auto;
        padding-top: 10px;
        padding-bottom: 14px;
    }

    .profile-page .profile-desktop-shell {
        height: var(--profile-pane-height);
        min-height: var(--profile-pane-height);
        align-items: stretch;
    }

    .profile-page .profile-desktop-card {
        height: 100%;
        min-height: 100%;
        padding: 2.2rem 2rem;
        border-radius: 1rem;
    }

    .profile-page #profile-photo-frame {
        width: 9rem;
        height: 9rem;
    }

    .profile-page #profile-photo-initial {
        font-size: 3.6rem;
    }

    .profile-page #profile-name {
        font-size: 1.9rem;
        line-height: 1.05;
    }

    .profile-page .profile-meta-label {
        font-size: 11.5px;
        letter-spacing: 0.14em;
    }

    .profile-page .profile-meta-value {
        font-size: 0.98rem;
        line-height: 1.36;
    }

    .profile-page .profile-meta-id {
        font-size: 0.88rem;
    }

    .profile-page .profile-right-shell {
        height: 100%;
        max-height: 100%;
        min-height: 0;
        min-width: 0;
        display: flex;
        flex-direction: column;
    }

    .profile-page .profile-scroll-pane {
        height: 100%;
        max-height: 100%;
        flex: 1 1 auto;
        min-height: 0;
        min-width: 0;
        overflow-y: auto;
        overflow-x: hidden;
        overscroll-behavior: contain;
        padding-right: 4px;
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .profile-page .profile-scroll-pane::-webkit-scrollbar {
        width: 0;
        height: 0;
    }

    .profile-page #profile-scroll-content {
        min-height: 0;
        padding-bottom: 8px;
    }
}

/* ══════════════════════════════════════════════════════════════════
   iOS INPUT ZOOM PREVENTION
   iOS Safari auto-zooms any input with font-size < 16px.
   ══════════════════════════════════════════════════════════════════ */
@supports (-webkit-touch-callout: none) {

    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="tel"],
    input[type="number"],
    input[type="search"],
    input[type="url"],
    input[type="date"],
    select,
    textarea {
        font-size: 16px !important;
    }
}

/* ══════════════════════════════════════════════════════════════════
   BACKDROP-FILTER FALLBACK
   Solid backgrounds for devices that don't support backdrop-filter.
   ══════════════════════════════════════════════════════════════════ */
@supports not (backdrop-filter: blur(1px)) {
    .brand-bar {
        background-color: #112240;
    }
}

/* ══════════════════════════════════════════════════════════════════
   ANIMATED ICON SYSTEM
   CSS-powered micro-animations for SVG icons — adds life to UI
   ══════════════════════════════════════════════════════════════════ */
@keyframes iconFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

@keyframes iconPulseRing {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(6, 182, 212, 0);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.15);
    }
}

@keyframes iconPulseRingGold {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(234, 179, 8, 0);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(234, 179, 8, 0.15);
    }
}

@keyframes iconPulseRingViolet {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(139, 92, 246, 0);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
    }
}

@keyframes iconBreathe {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.08);
        opacity: 0.85;
    }
}

@keyframes iconDrawIn {
    from {
        stroke-dashoffset: 60;
        opacity: 0;
    }

    to {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

/* Animated icon containers */
.anim-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-icon svg {
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.anim-icon-float {
    animation: iconFloat 3s ease-in-out infinite;
}

.anim-icon-breathe {
    animation: iconBreathe 2.5s ease-in-out infinite;
}

.anim-icon-pulse-cyan {
    animation: iconPulseRing 2s ease-out infinite;
}

.anim-icon-pulse-gold {
    animation: iconPulseRingGold 2.5s ease-out infinite;
}

.anim-icon-pulse-violet {
    animation: iconPulseRingViolet 2.5s ease-out infinite;
}

/* Draw-in effect for icons on page load */
.anim-icon-draw svg path {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: iconDrawIn 0.8s ease forwards;
}

/* Hover: scale up icon */
@media (hover: hover) {

    .group:hover .anim-icon svg,
    .anim-icon:hover svg {
        transform: scale(1.15) rotate(-3deg);
    }
}

/* ══════════════════════════════════════════════════════════════════
   COMING SOON POPUP
   ══════════════════════════════════════════════════════════════════ */
@keyframes comingSoonSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes comingSoonFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.coming-soon-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    animation: comingSoonFadeIn 0.25s ease forwards;
}

.coming-soon-card {
    position: relative;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 1));
    border: 1px solid rgba(51, 65, 85, 0.6);
    border-radius: 20px;
    padding: 32px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: comingSoonSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    overflow: hidden;
}

.coming-soon-card .cs-glow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 120px;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════════
   ANIMATED BOTTOM NAV — CSS-driven icon micro-animations
   ══════════════════════════════════════════════════════════════════ */

/* ── Shared mobile bottom nav (unified across all pages) ───────── */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    background: #0b1120;
    border-top: 1px solid rgba(51, 65, 85, 0.5);
    display: flex;
    align-items: stretch;
    justify-content: space-around;
    z-index: 100;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.22);
    visibility: visible !important;
    opacity: 1 !important;
}

@media (min-width: 1024px) {
    .mobile-nav {
        display: none;
    }
}

.mobile-nav a {
    flex: 1 1 0;
    min-width: 0;
    height: 60px;
    min-height: 60px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px 5px;
    text-decoration: none;
    color: #94a3b8;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.mobile-nav a>span:not(.nav-icon) {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    white-space: nowrap;
    transition: color 0.15s ease, transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Icon container & SVG (Standard 24x24 / 22x22 Tap Sizing) ──── */
.mobile-nav a .nav-icon {
    width: 24px;
    height: 24px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-nav a .nav-icon svg {
    width: 22px;
    height: 22px;
    max-width: 22px;
    max-height: 22px;
    stroke-width: 2;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
        filter 0.2s ease,
        stroke-width 0.15s ease;
    will-change: transform;
}

/* ── Active state ────────────────────────────────────────────────── */
.mobile-nav a.active {
    color: #eab308;
}


.mobile-nav a.active .nav-icon svg {
    /* animation: navIconBounce 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; */
    filter: drop-shadow(0 0 5px rgba(234, 179, 8, 0.4));
    stroke-width: 2.2;
}

.mobile-nav a.active>span:not(.nav-icon) {
    transform: scale(1.04);
    font-weight: 800;
    color: #facc15;
}

/* ── Tap / press feedback (Instant tactile touch area response) ──── */
.mobile-nav a:active {
    background-color: rgba(255, 255, 255, 0.04);
}

.mobile-nav a:active .nav-icon {
    transform: scale(0.88);
    transition-duration: 60ms;
}

.mobile-nav a:active>span:not(.nav-icon) {
    transform: scale(0.95);
    transition-duration: 60ms;
}

/* ── Hover (desktop / mouse preview) ─────────────────────────────── */
@media (hover: hover) {
    .mobile-nav a:hover:not(.active) {
        color: #f8fafc;
        background-color: rgba(255, 255, 255, 0.02);
    }

    .mobile-nav a:hover:not(.active) .nav-icon svg {
        transform: translateY(-1px);
    }
}

/* ── Nav icon bounce keyframe ────────────────────────────────────── */
@keyframes navIconBounce {
    0% {
        transform: scale(1);
    }

    35% {
        transform: scale(1.15) translateY(-1px);
    }

    65% {
        transform: scale(0.96);
    }

    100% {
        transform: scale(1);
    }
}

/* ══════════════════════════════════════════════════════════════════
   UI/UX POLISH — Production Hardening
   Issues: Glass contrast, empty states, skeleton loaders,
   offline banner, touch targets, admin table breathing room
   ══════════════════════════════════════════════════════════════════ */

/* ── Issue 3: Glass Contrast Enhancement ─────────────────────────
   Increase text readability on glass surfaces by boosting
   background opacity and text contrast. WCAG AA compliant. */
.glass-panel {
    background: rgba(11, 17, 32, 0.92);
}

.glass-panel-heavy {
    background: rgba(11, 17, 32, 0.96);
}

/* Cards get a subtle inner glow to lift text off the background */
.card-elevated,
.stat-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(2, 6, 23, 1));
}

/* Ensure muted text stays readable on dark glass surfaces */
.glass-panel .text-slate-400,
.glass-panel-heavy .text-slate-400,
.card-elevated .text-slate-400 {
    color: #94a3b8;
}

.glass-panel .text-slate-500,
.glass-panel-heavy .text-slate-500,
.card-elevated .text-slate-500 {
    color: #78869b;
}

/* ── Issue 4 + 18: Mobile Touch Targets ──────────────────────────
   Ensure 44×44px minimum for all interactive elements on mobile.
   Apple HIG and WCAG 2.5.5 require this for accessible tapping. */
@media (max-width: 768px) {

    button:not(.set-card button):not(.set-action-btn):not(.set-pdf-btn):not(.js-download-question-pdf):not(.js-cbse-pdf):not(.js-olympiad-pdf):not(#btn-settings):not(.curriculum-tab):not(.period-tab):not(.settings-dropdown button):not(.curriculum-dropdown-btn):not(#curriculum-dropdown-btn):not(#toggle-password):not(.fl-eye-btn),
    [role="button"]:not(.set-card):not(.set-card *):not(.curriculum-tabs *),
    .btn-primary,
    .btn-secondary,
    .btn-ghost,
    .auth-btn,
    select:not(.curriculum-filter):not(.period-filter),
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Icon-only buttons need explicit sizing */
    /* CB-01 FIX: Replaced :has() (unsupported Firefox ESR/older WebView)
       with a utility class. Add .icon-only to icon-only buttons in HTML. */
    button.icon-only,
    [role="button"].icon-only {
        min-width: 44px;
        min-height: 44px;
        padding: 10px;
    }

    /* Quiz option buttons need comfortable tapping */
    .quiz-option,
    [data-option] {
        min-height: 48px;
        padding: 12px 16px;
    }
}

/* ── Issue 2 + 17: Professional Empty States ─────────────────────
   Replaces plain "No data" text with icon + title + description
   + optional CTA button. Used across dashboard, leaderboard,
   admin panel, and profile sections. */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    min-height: 200px;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(51, 65, 85, 0.15);
    border: 1px solid rgba(71, 85, 105, 0.2);
    margin-bottom: 20px;
    animation: iconFloat 4s ease-in-out infinite;
}

.empty-state-icon svg {
    width: 28px;
    height: 28px;
    color: var(--text-muted);
    opacity: 0.7;
}

.empty-state-title {
    font-size: 14px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.3;
}

.empty-state-desc {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    max-width: 280px;
    line-height: 1.6;
    margin-bottom: 0;
}

.empty-state-cta {
    margin-top: 20px;
}

/* Compact variant for tables and inline sections */
.empty-state--compact {
    padding: 24px 16px;
    min-height: 120px;
}

.empty-state--compact .empty-state-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 14px;
}

.empty-state--compact .empty-state-icon svg {
    width: 22px;
    height: 22px;
}

.empty-state--compact .empty-state-title {
    font-size: 12px;
}

.empty-state--compact .empty-state-desc {
    font-size: 11px;
}

/* ── Issue 6: Skeleton Loaders ───────────────────────────────────
   Animated placeholder blocks shown while data loads.
   Replaces spinning loaders for a more polished feel. */
@keyframes skeletonShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton,
.skeleton-shimmer {
    background: linear-gradient(90deg,
            var(--ej-skeleton-base, rgba(30, 41, 59, 0.65)) 0%,
            var(--ej-skeleton-shimmer, rgba(51, 65, 85, 0.45)) 50%,
            var(--ej-skeleton-base, rgba(30, 41, 59, 0.65)) 100%);
    background-size: 200% 100%;
    animation: skeletonShimmer 1.8s ease-in-out infinite;
    border-radius: var(--radius-md);
}

.skeleton-text {
    height: 12px;
    border-radius: 4px;
    margin-bottom: 8px;
}

.skeleton-text--sm {
    height: 10px;
    width: 60%;
}

.skeleton-text--md {
    height: 14px;
    width: 80%;
}

.skeleton-text--lg {
    height: 18px;
    width: 50%;
}

.skeleton-circle {
    border-radius: 50%;
}

.skeleton-card {
    height: 100px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(51, 65, 85, 0.2);
}

.skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.skeleton-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
}

/* ── Issue 10: Offline Banner ────────────────────────────────────
   Persistent top-bar notification when the user loses internet.
   Auto-hides when connection is restored. CSS-only styling;
   JS toggle via adding/removing .offline-visible class. */
@keyframes offlineBannerSlide {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
    animation: offlineBannerSlide 0.3s var(--ease-out-expo) forwards;
}

.offline-banner.offline-visible {
    display: flex;
}

.offline-banner svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.offline-banner .offline-retry {
    margin-left: 8px;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: background 0.2s ease;
    min-height: 32px;
}

.offline-banner .offline-retry:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Online restored banner */
.online-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #059669, #047857);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: 0 4px 20px rgba(5, 150, 105, 0.3);
    animation: offlineBannerSlide 0.3s var(--ease-out-expo) forwards;
}

.online-banner.online-visible {
    display: flex;
}

/* ── Issue 8: Profile Edit Limit Badges ──────────────────────────
   Clear "X edits remaining" badges for profile fields. */
.edit-limit-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: var(--radius-full);
    line-height: 1;
}

.edit-limit-badge--available {
    color: #34d399;
    background: rgba(5, 150, 105, 0.1);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.edit-limit-badge--warning {
    color: #fbbf24;
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid rgba(234, 179, 8, 0.2);
}

.edit-limit-badge--exhausted {
    color: #f87171;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* ── Issue 1 + 16: Admin Table Breathing Room ────────────────────
   More padding, relaxed row heights, and subtle zebra striping
   for improved scannability in admin data tables. */
.admin-table th {
    padding: 12px 14px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    white-space: nowrap;
}

.admin-table td {
    padding: 14px 14px;
    font-size: 13px;
    vertical-align: middle;
}

.admin-table tbody tr {
    border-bottom: 1px solid rgba(51, 65, 85, 0.2);
    transition: background 0.15s ease;
}

.admin-table tbody tr:hover {
    background: rgba(30, 41, 59, 0.4);
}

/* Zebra striping for long tables */
.admin-table tbody tr:nth-child(even) {
    background: rgba(15, 23, 42, 0.3);
}

.admin-table tbody tr:nth-child(even):hover {
    background: rgba(30, 41, 59, 0.5);
}

/* ── Issue 7: Visual Hierarchy in Admin ──────────────────────────
   Stronger differentiation between headings, subheadings,
   and body content. Primary actions get more visual weight. */
.admin-page-title {
    font-size: 20px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    color: var(--text-primary);
    line-height: 1.1;
}

.admin-section-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.admin-stat-value {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1;
    color: var(--text-primary);
}

.admin-stat-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ── Reduced motion: disable skeletons and offline banner anim ── */
@media (prefers-reduced-motion: reduce) {

    .skeleton,
    .skeleton-shimmer {
        animation: none;
        background: rgba(30, 41, 59, 0.5);
    }

    .empty-state-icon {
        animation: none;
    }

    .offline-banner,
    .online-banner {
        animation: none;
    }
}

/* ══════════════════════════════════════════════════════════════════
   AUTH PAGES — Shared styles for login.html & register.html
   Extracted from inline <style> blocks to eliminate ~1100 lines of duplication.
   ══════════════════════════════════════════════════════════════════ */

/* ── Split Layout ─────────────────────────────────────── */
.auth-shell {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

@media (min-width: 1024px) {
    .auth-shell {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1280px) {
    .auth-shell {
        grid-template-columns: 1.15fr 0.85fr;
    }
}

/* ── Branding Panel (desktop only) ───────────────── */
.auth-shell .brand-panel {
    display: none;
    position: relative;
    background: linear-gradient(135deg, #020617 0%, #0f172a 40%, #1e293b 100%);
    overflow: hidden;
}

@media (min-width: 1024px) {
    .auth-shell .brand-panel {
        display: flex;
    }
}

.auth-shell .brand-panel::after {
    content: '';
    position: absolute;
    bottom: -40%;
    left: -20%;
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(234, 179, 8, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

/* Register page uses an emerald glow variant */
.auth-shell .brand-panel.brand-panel--register::after {
    background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
}

.auth-shell .brand-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(51, 65, 85, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(51, 65, 85, 0.06) 1px, transparent 1px);
    background-size: 48px 48px;
}

/* ── Auth Panel (form side) ───────────────────────── */
.auth-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    background: linear-gradient(180deg, #020617 0%, #0a0f1e 100%);
    position: relative;
}

@media (min-width: 640px) {
    .auth-panel {
        padding: 32px;
    }
}

@media (min-width: 1024px) {
    .auth-panel {
        background: linear-gradient(180deg, #0f172a 0%, #020617 100%);
        border-left: 1px solid rgba(51, 65, 85, 0.2);
    }
}

/* Register page needs scrolling for longer form */
.auth-panel--scrollable {
    overflow-y: auto;
}

/* ── Card ─────────────────────────────────────────── */
.auth-card {
    width: 100%;
    max-width: 400px;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(51, 65, 85, 0.25);
    border-radius: 16px;
    padding: 32px 28px;
    position: relative;
}

@media (min-width: 640px) {
    .auth-card {
        padding: 40px 36px;
        border-radius: 20px;
    }
}

/* Register card is slightly tighter */
.auth-card--compact {
    padding: 28px 24px;
}

@media (min-width: 640px) {
    .auth-card--compact {
        padding: 36px 32px;
    }
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(234, 179, 8, 0.25), transparent);
}

/* Register page uses emerald accent line */
.auth-card--register::before {
    background: linear-gradient(90deg, transparent, rgba(16, 185, 129, 0.25), transparent);
}

/* ── Inputs ───────────────────────────────────────── */
.auth-input {
    width: 100%;
    padding: 11px 14px;
    background: rgba(2, 6, 23, 0.55);
    border: 1px solid rgba(51, 65, 85, 0.35);
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-input:focus {
    border-color: rgba(234, 179, 8, 0.45);
    box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.06);
}

/* Register uses emerald focus */
.auth-input--emerald:focus {
    border-color: rgba(16, 185, 129, 0.45);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.06);
}

.auth-input::placeholder {
    color: #475569;
    font-weight: 400;
}

.auth-input.has-error {
    border-color: rgba(239, 68, 68, 0.4);
}

/* ── Button ───────────────────────────────────────── */
.auth-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #eab308, #ca8a04);
    color: #000;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.auth-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #facc15, #eab308);
    box-shadow: 0 2px 16px rgba(234, 179, 8, 0.2);
}

.auth-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.auth-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Register uses emerald button */
.auth-btn--emerald {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    padding: 11px;
}

.auth-btn--emerald:hover:not(:disabled) {
    background: linear-gradient(135deg, #34d399, #10b981);
    box-shadow: 0 2px 16px rgba(16, 185, 129, 0.2);
}

/* ── Loading spinner for auth-btn ─── */
.auth-btn.btn-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.auth-btn.btn-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    top: 50%;
    left: 50%;
    margin-top: -9px;
    margin-left: -9px;
    border: 2.5px solid rgba(0, 0, 0, 0.3);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.auth-btn--emerald.btn-loading::after {
    border-color: rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
}

/* ── Alert ────────────────────────────────────────── */
.auth-alert {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.auth-alert--error {
    background: rgba(239, 68, 68, 0.07);
    border: 1px solid rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.auth-alert--warn {
    background: rgba(249, 115, 22, 0.07);
    border: 1px solid rgba(249, 115, 22, 0.12);
    color: #fb923c;
}

.auth-alert--info {
    background: rgba(234, 179, 8, 0.07);
    border: 1px solid rgba(234, 179, 8, 0.12);
    color: #fbbf24;
}

/* ── Stat pill (branding panel) ───────────────────── */
.auth-stat-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(234, 179, 8, 0.06);
    border: 1px solid rgba(234, 179, 8, 0.1);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #fbbf24;
    letter-spacing: 0.04em;
}

.auth-stat-pill--emerald {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.1);
    color: #34d399;
}

/* ── Field error hint ─────────────────────────────── */
.field-hint {
    font-size: 11px;
    font-weight: 600;
    color: #f87171;
    margin-top: 4px;
    display: none;
}

.field-hint.show {
    display: block;
}

/* ── Password strength meter ──────────────────────── */
.pw-meter {
    height: 3px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.5);
    margin-top: 6px;
    overflow: hidden;
}

.pw-meter-fill {
    height: 100%;
    border-radius: 999px;
    width: 0%;
    transition: width 0.3s, background 0.3s;
}

/* ── Ghost Back button ────────────────────────────── */
.auth-btn-ghost {
    padding: 12px 16px;
    background: transparent;
    border: 1px solid rgba(51, 65, 85, 0.4);
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.auth-btn-ghost:hover {
    border-color: rgba(100, 116, 139, 0.6);
    color: #94a3b8;
}

/* ── Mobile entrance animation ────────────────────── */
@keyframes authMobileScaleIn {
    from {
        opacity: 0;
        transform: scale(0.97) translateY(8px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* ── Mobile Optimization (≤768px) ─────────────────── */
@media (max-width: 768px) {
    .auth-panel {
        padding: 24px 20px;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        min-height: 100dvh;
    }

    .auth-card {
        max-width: 100%;
        padding: 24px 20px;
        border-radius: 12px;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: rgba(15, 23, 42, 0.65);
        border-color: rgba(51, 65, 85, 0.2);
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    }

    .auth-card::before {
        display: none;
    }

    .auth-input {
        min-height: 48px;
        font-size: 16px;
        padding: 12px 14px;
        border-radius: 10px;
    }

    .auth-input:focus {
        box-shadow: 0 0 0 2px rgba(234, 179, 8, 0.08);
    }

    .auth-input--emerald:focus {
        box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.08);
    }

    .auth-btn {
        min-height: 48px;
        font-size: 13px;
        border-radius: 10px;
        box-shadow: none;
    }

    .auth-btn:hover:not(:disabled) {
        box-shadow: none;
    }
}

/* ══════════════════════════════════════════════════════════════════
   FLOATING LABEL SYSTEM — Used by register.html
   ══════════════════════════════════════════════════════════════════ */
.fl-group {
    position: relative;
    min-width: 0;
}

.fl-input {
    width: 100%;
    height: 48px;
    padding: 18px 14px 6px;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(51, 65, 85, 0.28);
    border-radius: 12px;
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 500;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
    display: block;
}

.fl-input::placeholder {
    color: transparent;
}

.fl-input:hover {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(71, 85, 105, 0.52);
}

.fl-input:focus {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.07);
    background: rgba(15, 23, 42, 0.82);
}

.fl-input.has-error {
    border-color: rgba(239, 68, 68, 0.45);
}

/* Floating label text (anchored to 48px input center at 24px, never shifts on error) */
.fl-label {
    position: absolute;
    left: 14px;
    top: 24px;
    transform: translateY(-50%);
    font-size: 14px;
    font-weight: 500;
    color: #475569;
    pointer-events: none;
    transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    line-height: 1;
    user-select: none;
}

/* Floated state — input/trigger hovered, focused/tapped, open, OR has value */
.fl-input:hover~.fl-label,
.fl-input:focus~.fl-label,
.fl-select-trigger.is-open~.fl-label,
.fl-select-trigger.has-value~.fl-label,
input.fl-input:not(:placeholder-shown)~.fl-label,
.fl-select.has-value~.fl-label {
    top: 9px;
    transform: none;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #34d399;
}

.fl-input.has-error:not(:hover):not(:focus)~.fl-label,
.fl-select.has-error:not(.has-value)~.fl-select-trigger:not(:hover):not(:focus):not(.is-open)~.fl-label {
    color: #f87171;
}

.fl-select.has-error~.fl-select-trigger {
    border-color: rgba(239, 68, 68, 0.45);
}

/* Custom Dropdown for Class & School */
.fl-group.dd-open {
    z-index: 60;
}

select.fl-select-native-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.fl-select-trigger {
    cursor: pointer;
    padding: 18px 34px 6px 14px;
    text-align: left;
    position: relative;
    display: flex;
    align-items: flex-start;
    user-select: none;
    line-height: normal;
}

.fl-select-trigger.is-open {
    border-color: rgba(16, 185, 129, 0.55);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08);
    background: rgba(15, 23, 42, 0.88);
}

.fl-select-val {
    display: block;
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 500;
    line-height: 21px;
    height: 21px;
    margin: 0;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.fl-select-trigger.has-value .fl-select-val {
    opacity: 1;
}

.fl-select-chevron {
    position: absolute;
    right: 12px;
    top: 24px;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: #64748b;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), color 0.2s ease;
}

.fl-select-trigger:hover .fl-select-chevron,
.fl-select-trigger.is-open .fl-select-chevron {
    color: #34d399;
}

.fl-select-trigger.is-open .fl-select-chevron {
    transform: translateY(-50%) rotate(180deg);
}

.fl-dd-menu {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    background: #0b1326;
    border: 1px solid rgba(52, 211, 153, 0.28);
    border-radius: 12px;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.72), 0 0 0 1px rgba(15, 23, 42, 0.9);
    max-height: 214px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 5px;
    z-index: 70;
    display: flex;
    flex-direction: column;
    gap: 2px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transform-origin: top center;
    transition: opacity 0.16s ease, transform 0.16s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.16s;
    scrollbar-width: thin;
    scrollbar-color: rgba(52, 211, 153, 0.22) transparent;
}

.fl-dd-menu::-webkit-scrollbar {
    width: 3.5px;
}

.fl-dd-menu::-webkit-scrollbar-track {
    background: transparent;
    margin: 4px 0;
}

.fl-dd-menu::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.22);
    border-radius: 999px;
    transition: background 0.2s ease;
}

.fl-dd-menu:hover::-webkit-scrollbar-thumb {
    background: rgba(52, 211, 153, 0.45);
}

.fl-dd-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.fl-dd-item {
    width: 100%;
    min-height: 34px !important;
    height: 34px;
    padding: 0 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: #cbd5e1;
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background 0.12s ease, color 0.12s ease;
    line-height: 1.2;
    flex-shrink: 0;
}

.fl-dd-item:hover {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
}

.fl-dd-item:focus-visible {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    outline: 2px solid rgba(16, 185, 129, 0.6);
    outline-offset: -2px;
}

.fl-dd-item.is-selected {
    background: rgba(16, 185, 129, 0.16);
    color: #34d399;
    font-weight: 700;
}

.fl-dd-item.is-other-opt {
    margin-top: 3px;
    padding-top: 9px;
    border-top: 1px solid rgba(51, 65, 85, 0.35);
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    color: #fbbf24;
    font-weight: 600;
}

.fl-dd-item.is-other-opt:hover {
    background: rgba(234, 179, 8, 0.12);
    color: #fde047;
}

.fl-dd-check {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    color: #34d399;
    opacity: 0;
    transition: opacity 0.12s ease;
}

.fl-dd-item.is-selected .fl-dd-check {
    opacity: 1;
}

.school-fl-group.show-other .fl-select-trigger,
.school-fl-group.show-other .fl-dd-menu {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Select */
select.fl-input {
    cursor: pointer;
    color: transparent;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 15px;
    padding-right: 36px;
}

select.fl-input.has-value {
    color: #f1f5f9;
}

select.fl-input option {
    background: #0f172a;
    color: #e2e8f0;
}

/* Eye-toggle inside fl-group and auth-input */
#toggle-password,
.fl-eye-btn {
    position: absolute !important;
    right: 10px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: transparent !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    z-index: 2 !important;
    line-height: 1 !important;
    -webkit-tap-highlight-color: transparent !important;
    box-sizing: border-box !important;
}

#toggle-password:hover,
.fl-eye-btn:hover {
    color: #e2e8f0 !important;
}

#toggle-password:active,
.fl-eye-btn:active {
    transform: translateY(-50%) scale(0.94) !important;
}

/* School "Other" overlay — zero layout shift */
.school-fl-group {
    position: relative;
}

.fl-school-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 48px;
    opacity: 0;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.18s;
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.45);
    padding: 18px 70px 6px 14px;
    border: 1px solid rgba(51, 65, 85, 0.28);
    color: #f1f5f9;
    font-size: 14px;
    font-weight: 500;
    outline: none;
}

.fl-school-overlay::placeholder {
    color: transparent;
}

.fl-school-overlay:focus {
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.07);
    background: rgba(15, 23, 42, 0.82);
}

.school-fl-group.show-other .fl-select {
    opacity: 0;
    pointer-events: none;
}

.school-fl-group.show-other .fl-school-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* When "Other" is active, always float the label in green */
.school-fl-group.show-other .fl-label {
    top: 9px !important;
    transform: none !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    color: #34d399 !important;
}

.school-change-btn {
    position: absolute;
    right: 12px;
    top: 24px;
    transform: translateY(-50%) !important;
    font-size: 10px;
    font-weight: 700;
    color: #94a3b8;
    cursor: pointer;
    background: rgba(30, 41, 59, 0.6);
    border: 1px solid rgba(71, 85, 105, 0.4);
    padding: 3px 7px;
    border-radius: 6px;
    transition: background 0.18s, border-color 0.18s, color 0.18s;
    z-index: 3;
    display: none;
    white-space: nowrap;
    align-items: center;
    gap: 2px;
    -webkit-tap-highlight-color: transparent;
}

.school-change-btn:active {
    transform: translateY(-50%) !important;
}

.school-fl-group.show-other .school-change-btn {
    display: inline-flex;
}

.school-change-btn:hover {
    color: #facc15;
    border-color: rgba(234, 179, 8, 0.5);
    background: rgba(30, 41, 59, 0.9);
}

.school-change-btn:focus-visible {
    color: #facc15;
    border-color: rgba(234, 179, 8, 0.7);
    background: rgba(30, 41, 59, 0.9);
    outline: 2px solid transparent;
    box-shadow: var(--focus-ring);
}

/* ── Pill Toggle Buttons ──────────────────────────── */
.pill-field-label {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    margin-bottom: 5px;
    display: block;
}

.pill-row {
    display: flex;
    gap: 7px;
}

.pill-btn {
    flex: 1;
    padding: 8px 6px;
    background: rgba(2, 6, 23, 0.45);
    border: 1px solid rgba(51, 65, 85, 0.28);
    border-radius: 10px;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.18s;
    text-align: center;
    line-height: 1;
}

.pill-btn:hover {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(71, 85, 105, 0.5);
    color: #94a3b8;
}

.pill-btn.active {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.45);
    color: #34d399;
}

.pill-btn.has-error {
    border-color: rgba(239, 68, 68, 0.4);
}

/* ══════════════════════════════════════════════════════════════════
   MULTI-STEP WIZARD — Used by register.html
   ══════════════════════════════════════════════════════════════════ */
.step-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
}

.step-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid rgba(51, 65, 85, 0.45);
    transition: all 0.25s ease;
    font-size: 11px;
    font-weight: 800;
    color: #475569;
}

.step-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    transition: color 0.25s;
}

.step-node.active .step-circle {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.5);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.14);
    color: #34d399;
}

.step-node.active .step-label {
    color: #34d399;
}

.step-node.done .step-circle {
    background-color: rgba(16, 185, 129, 0.12);
    border-color: rgba(16, 185, 129, 0.4);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2334d399'%3E%3Cpath d='M 19.980469 5.9902344 A 1.0001 1.0001 0 0 0 19.292969 6.2929688 L 9 16.585938 L 5.7070312 13.292969 A 1.0001 1.0001 0 1 0 4.2929688 14.707031 L 8.2929688 18.707031 A 1.0001 1.0001 0 0 0 9.7070312 18.707031 L 20.707031 7.7070312 A 1.0001 1.0001 0 0 0 19.980469 5.9902344 z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px 13px;
    color: transparent;
    font-size: 0;
}

.step-node.done .step-circle::after {
    content: '';
}

.step-node.done .step-label {
    color: #10b981;
}

.step-connector {
    flex: 1;
    height: 1px;
    background: rgba(51, 65, 85, 0.4);
    margin: 0 8px;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
}

.step-connector-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: rgba(16, 185, 129, 0.5);
    transition: width 0.35s ease;
}

/* Review summary card */
.review-card {
    background: rgba(2, 6, 23, 0.4);
    border: 1px solid rgba(51, 65, 85, 0.2);
    border-radius: 10px;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.review-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 12px;
}

.rv-label {
    flex-shrink: 0;
    width: 78px;
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #475569;
    padding-top: 1px;
}

.rv-val {
    font-weight: 600;
    color: #cbd5e1;
    word-break: break-word;
    font-size: 12.5px;
}

/* Step slide animations */
@keyframes stepSlideIn {
    from {
        opacity: 0;
        transform: translateX(18px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes stepSlideBack {
    from {
        opacity: 0;
        transform: translateX(-18px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.step-panel {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.step-panel.hidden {
    display: none !important;
}

.step-panel.slide-in {
    animation: stepSlideIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.step-panel.slide-in-back {
    animation: stepSlideBack 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Success state ────────────────────────────────── */
.success-panel {
    text-align: center;
    padding: 12px 6px;
    animation: scaleIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.success-ring,
.auth-success-ring {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.12);
    border: 2px solid rgba(16, 185, 129, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 24px rgba(16, 185, 129, 0.22);
    animation: scaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ── Autofill fix ─────────────────────────────────── */
.fl-input:-webkit-autofill,
.fl-input:-webkit-autofill:hover,
.fl-input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f1f5f9;
    -webkit-box-shadow: 0 0 0px 1000px rgba(10, 15, 30, 0.95) inset;
    transition: background-color 5000s ease-in-out 0s;
    caret-color: #f1f5f9;
}

.fl-input:-webkit-autofill~.fl-label,
.fl-input.has-value~.fl-label {
    top: 9px;
    transform: none;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #34d399;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVENESS AUDIT FIXES (2026-05-13)
   ══════════════════════════════════════════════════════════════════ */

/* R-04: Edit modal no max-height on short viewports */
#edit-modal>div,
#edit-modal .bg-slate-950 {
    max-height: 90vh;
    max-height: 90dvh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* R-03: Profile card narrow-screen layout — maintain single-line horizontal rows */
.profile-summary-card .flex.items-center.justify-between {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
}

.profile-summary-card [id$="-school"],
.profile-summary-card [id$="-id"],
.profile-summary-card [id$="-class"],
.profile-summary-card [id$="-type"],
.profile-summary-card [id$="-joined"] {
    text-align: right !important;
}

/* R-06: Subject analytics grid at 320px */
@media (max-width: 340px) {

    #stat-mastery,
    #stat-sets,
    #stat-avg {
        font-size: 1.1rem !important;
    }

    .subject-analytics-grid {
        gap: 6px;
    }

    .subject-analytics-grid>div {
        padding: 10px;
    }
}

/* R-01: Stat card text overflow on <= 360px */
@media (max-width: 360px) {

    #stat-score,
    #stat-sets,
    #stat-subjects,
    #stat-streak {
        font-size: 1.5rem !important;
    }

    #stat-best {
        font-size: 0.875rem !important;
    }
}

/* R-05: Multi-step form + safe-area clearance */
/* CB-02 FIX: Replaced env(keyboard-inset-height) — near-zero browser support.
   Was adding permanent 80px dead space on Safari/Firefox/Samsung Internet. */
.auth-panel {
    padding-bottom: env(safe-area-inset-bottom, 16px);
}



/* ── Noscript Fallback ───────────────────────────────────────── */
.noscript-fallback {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 32px;
    background: #020617;
    text-align: center;
}

.noscript-fallback h1 {
    font-size: 24px;
    font-weight: 900;
    color: #eab308;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    margin-bottom: 12px;
}

.noscript-fallback p {
    font-size: 14px;
    font-weight: 500;
    color: #94a3b8;
    max-width: 320px;
    line-height: 1.6;
}

/* ── Olympiad Theme Palette Utilities (Classes 01-10) ──── */
.border-indigo-500\/30 {
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.bg-indigo-950\/20 {
    background-color: rgba(30, 27, 75, 0.2) !important;
}

.text-indigo-400 {
    color: #818cf8 !important;
}

.border-amber-500\/30 {
    border-color: rgba(245, 158, 11, 0.3) !important;
}

.bg-amber-950\/20 {
    background-color: rgba(69, 26, 3, 0.2) !important;
}

.text-amber-400 {
    color: #fbbf24 !important;
}

.border-emerald-500\/30 {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

.bg-emerald-950\/20 {
    background-color: rgba(2, 44, 34, 0.2) !important;
}

.text-emerald-400 {
    color: #34d399 !important;
}

.border-teal-500\/30 {
    border-color: rgba(20, 184, 166, 0.3) !important;
}

.bg-teal-950\/20 {
    background-color: rgba(4, 47, 46, 0.2) !important;
}

.text-teal-400 {
    color: #2dd4bf !important;
}

.border-rose-500\/30 {
    border-color: rgba(244, 63, 94, 0.3) !important;
}

.bg-rose-950\/20 {
    background-color: rgba(76, 5, 25, 0.2) !important;
}

.text-rose-400 {
    color: #fb7185 !important;
}

.border-cyan-500\/30 {
    border-color: rgba(6, 182, 212, 0.3) !important;
}

.bg-cyan-950\/20 {
    background-color: rgba(8, 51, 68, 0.2) !important;
}

.text-cyan-400 {
    color: #22d3ee !important;
}

.border-violet-500\/30 {
    border-color: rgba(139, 92, 246, 0.3) !important;
}

.bg-violet-950\/20 {
    background-color: rgba(46, 16, 101, 0.2) !important;
}

.text-violet-400 {
    color: #a78bfa !important;
}

.border-yellow-500\/30 {
    border-color: rgba(234, 179, 8, 0.3) !important;
}

.bg-yellow-950\/20 {
    background-color: rgba(66, 32, 6, 0.2) !important;
}

.text-yellow-400 {
    color: #facc15 !important;
}

.border-pink-500\/30 {
    border-color: rgba(236, 72, 153, 0.3) !important;
}

.bg-pink-950\/20 {
    background-color: rgba(80, 7, 36, 0.2) !important;
}

.text-pink-400 {
    color: #f472b6 !important;
}

/* ── Theme Palette Utilities (/40 Border Variants) ─────── */
.border-indigo-500\/40 {
    border-color: rgba(99, 102, 241, 0.4) !important;
}

.border-amber-500\/40 {
    border-color: rgba(245, 158, 11, 0.4) !important;
}

.border-emerald-500\/40 {
    border-color: rgba(16, 185, 129, 0.4) !important;
}

.border-teal-500\/40 {
    border-color: rgba(20, 184, 166, 0.4) !important;
}

.border-rose-500\/40 {
    border-color: rgba(244, 63, 94, 0.4) !important;
}

.border-cyan-500\/40 {
    border-color: rgba(6, 182, 212, 0.4) !important;
}

.border-violet-500\/40 {
    border-color: rgba(139, 92, 246, 0.4) !important;
}

.border-yellow-500\/40 {
    border-color: rgba(234, 179, 8, 0.4) !important;
}

.border-pink-500\/40 {
    border-color: rgba(236, 72, 153, 0.4) !important;
}

/* ── Theme Palette Utilities (/50 Hover Border Variants) ── */
.hover\:border-cyan-500\/50:hover {
    border-color: rgba(6, 182, 212, 0.5) !important;
}

.hover\:border-violet-500\/50:hover {
    border-color: rgba(139, 92, 246, 0.5) !important;
}

.hover\:border-yellow-500\/50:hover {
    border-color: rgba(234, 179, 8, 0.5) !important;
}

.hover\:border-pink-500\/50:hover {
    border-color: rgba(236, 72, 153, 0.5) !important;
}

.hover\:border-emerald-500\/50:hover {
    border-color: rgba(16, 185, 129, 0.5) !important;
}

.hover\:border-rose-500\/50:hover {
    border-color: rgba(244, 63, 94, 0.5) !important;
}

.hover\:border-amber-500\/50:hover {
    border-color: rgba(245, 158, 11, 0.5) !important;
}

.hover\:border-indigo-500\/50:hover {
    border-color: rgba(99, 102, 241, 0.5) !important;
}

.hover\:border-teal-500\/50:hover {
    border-color: rgba(20, 184, 166, 0.5) !important;
}

/* ══════════════════════════════════════════════════════════════════
   GLOBAL DARK THEME BORDER PREFLIGHT FIX:
   Tailwind's preflight resets: *, ::before, ::after { border: 0 solid #e5e7eb; }.
   On dark themes, if an element uses .border without a precompiled
   border-color utility, it falls back to #e5e7eb (bright white),
   causing high-contrast white border glitches across cards, badges, and buttons.
   Setting the base border-color to a subtle dark slate ensures
   that uncolored/uncompiled borders blend gracefully into the dark UI.
   ══════════════════════════════════════════════════════════════════ */
*,
::before,
::after {
    border-color: rgba(51, 65, 85, 0.5);
    /* slate-700/50 fallback dark border */
}

/* ── Extended Theme Palette Utilities (Borders) ────────── */
.border-emerald-800\/60 {
    border-color: rgba(6, 95, 70, 0.6) !important;
}

.border-emerald-800\/70 {
    border-color: rgba(6, 95, 70, 0.7) !important;
}

.border-emerald-500\/60 {
    border-color: rgba(16, 185, 129, 0.6) !important;
}

.border-emerald-900\/60 {
    border-color: rgba(6, 78, 59, 0.6) !important;
}

.border-violet-900\/60 {
    border-color: rgba(76, 29, 149, 0.6) !important;
}

.border-violet-900\/40 {
    border-color: rgba(76, 29, 149, 0.4) !important;
}

.border-violet-800\/50 {
    border-color: rgba(91, 33, 182, 0.5) !important;
}

.border-violet-800\/60 {
    border-color: rgba(91, 33, 182, 0.6) !important;
}

.border-violet-800\/70 {
    border-color: rgba(91, 33, 182, 0.7) !important;
}

.border-violet-500\/60 {
    border-color: rgba(139, 92, 246, 0.6) !important;
}

.border-orange-800\/60 {
    border-color: rgba(154, 52, 18, 0.6) !important;
}

.border-orange-900\/60 {
    border-color: rgba(124, 45, 18, 0.6) !important;
}

.border-yellow-800\/50 {
    border-color: rgba(133, 77, 14, 0.5) !important;
}

.border-cyan-800\/70 {
    border-color: rgba(21, 94, 117, 0.7) !important;
}

.border-rose-800\/70 {
    border-color: rgba(159, 18, 57, 0.7) !important;
}

.border-amber-800\/70 {
    border-color: rgba(146, 64, 14, 0.7) !important;
}

.border-pink-800\/70 {
    border-color: rgba(157, 23, 77, 0.7) !important;
}

.border-teal-800\/70 {
    border-color: rgba(17, 94, 89, 0.7) !important;
}

/* ── Extended Theme Palette Utilities (Backgrounds) ────── */
.bg-emerald-950\/60 {
    background-color: rgba(2, 44, 34, 0.6) !important;
}

.bg-orange-950\/60 {
    background-color: rgba(67, 20, 7, 0.6) !important;
}

.bg-violet-900\/60 {
    background-color: rgba(76, 29, 149, 0.6) !important;
}

.bg-violet-950\/50 {
    background-color: rgba(46, 16, 101, 0.5) !important;
}

.bg-violet-950\/60 {
    background-color: rgba(46, 16, 101, 0.6) !important;
}

.bg-violet-950\/70 {
    background-color: rgba(46, 16, 101, 0.7) !important;
}

.bg-indigo-950\/60 {
    background-color: rgba(30, 27, 75, 0.6) !important;
}

.bg-cyan-950\/40 {
    background-color: rgba(8, 51, 68, 0.4) !important;
}

.bg-cyan-950\/70 {
    background-color: rgba(8, 51, 68, 0.7) !important;
}

.bg-amber-950\/40 {
    background-color: rgba(69, 26, 3, 0.4) !important;
}

.bg-amber-950\/70 {
    background-color: rgba(69, 26, 3, 0.7) !important;
}

.bg-pink-950\/70 {
    background-color: rgba(80, 7, 36, 0.7) !important;
}

.bg-rose-950\/70 {
    background-color: rgba(76, 5, 25, 0.7) !important;
}

.bg-teal-950\/70 {
    background-color: rgba(4, 47, 46, 0.7) !important;
}

/* ── Extended Theme Palette Utilities (Hover) ──────────── */
.hover\:bg-violet-900\/60:hover {
    background-color: rgba(76, 29, 149, 0.6) !important;
}

.hover\:bg-violet-900\/50:hover {
    background-color: rgba(76, 29, 149, 0.5) !important;
}

.hover\:border-violet-900\/60:hover {
    border-color: rgba(76, 29, 149, 0.6) !important;
}

.hover\:border-emerald-800\/60:hover {
    border-color: rgba(6, 95, 70, 0.6) !important;
}

.hover\:border-violet-500\/40:hover {
    border-color: rgba(139, 92, 246, 0.4) !important;
}

/* ── Extended Theme Palette Utilities (Text) ───────────── */
.text-amber-300 {
    color: #fcd34d !important;
}

.text-indigo-300 {
    color: #a5b4fc !important;
}

.text-violet-400\/80 {
    color: rgba(167, 139, 250, 0.8) !important;
}

/* ── Profile 3-Way Curriculum Switcher (matching Leaderboard UI/UX) ── */
.curriculum-tabs {
    display: none;
    align-items: center;
    gap: 3px;
    padding: 2px 3px;
    height: 32px;
    min-height: 32px;
    max-height: 32px;
    box-sizing: border-box;
    border-radius: 10px;
    border: 1px solid rgba(71, 85, 105, .55);
    background: linear-gradient(180deg, rgba(15, 23, 42, .92), rgba(2, 6, 23, .98));
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, .08), 0 8px 24px rgba(2, 6, 23, .34);
}

.curriculum-tab {
    border: 1px solid transparent;
    background: transparent;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    border-radius: 7px;
    height: 26px;
    min-height: 26px;
    max-height: 26px;
    line-height: 24px;
    padding: 0 11px;
    cursor: pointer;
    transition: all .2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    box-sizing: border-box;
}

.curriculum-tab:hover {
    color: #e2e8f0;
    background: rgba(148, 163, 184, .08);
    border-color: rgba(100, 116, 139, .42);
}

.curriculum-tab.active,
.curriculum-tab.active-grammar {
    color: #fef08a;
    border-color: rgba(234, 179, 8, .55);
    background: linear-gradient(180deg, rgba(120, 53, 15, .75), rgba(92, 37, 8, .7));
    box-shadow: 0 0 0 1px rgba(250, 204, 21, .18) inset, 0 6px 16px rgba(146, 64, 14, .3);
}

.curriculum-tab.active-cbse {
    color: #a5f3fc;
    border-color: rgba(6, 182, 212, .55);
    background: linear-gradient(180deg, rgba(14, 116, 144, .75), rgba(8, 79, 100, .7));
    box-shadow: 0 0 0 1px rgba(34, 211, 238, .18) inset, 0 6px 16px rgba(14, 116, 144, .3);
}

.curriculum-tab.active-olympiad {
    color: #e9d5ff;
    border-color: rgba(139, 92, 246, .55);
    background: linear-gradient(180deg, rgba(109, 40, 217, .75), rgba(76, 29, 149, .7));
    box-shadow: 0 0 0 1px rgba(168, 85, 247, .18) inset, 0 6px 16px rgba(109, 40, 217, .3);
}

.curriculum-tab:focus-visible {
    outline: 2px solid transparent;
    box-shadow: 0 0 0 2px rgba(250, 204, 21, .28);
}

/* ── Curriculum Division Switcher Dropdown (Matching Leaderboard UI/UX) ── */
.curriculum-filter-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    width: 116px !important;
    min-width: 116px !important;
    max-width: 116px !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    box-sizing: border-box !important;
}

.curriculum-dropdown-btn,
.curriculum-filter {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    height: 32px !important;
    min-height: 32px !important;
    max-height: 32px !important;
    line-height: 30px !important;
    box-sizing: border-box !important;
    border-radius: 10px;
    border: 1px solid rgba(71, 85, 105, .65);
    background: linear-gradient(180deg, rgba(13, 23, 42, .94), rgba(7, 14, 30, .98));
    color: #f8fafc;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .03em;
    padding: 0 10px 0 12px;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, .08);
    transition: border-color .2s ease, box-shadow .2s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.curriculum-dropdown-btn span {
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.curriculum-dropdown-btn:hover,
.curriculum-filter:hover {
    border-color: rgba(148, 163, 184, .85);
}

.curriculum-dropdown-btn:focus-visible,
.curriculum-dropdown-btn[aria-expanded="true"] {
    outline: 2px solid transparent;
    border-color: #eab308;
    box-shadow: 0 0 0 2px rgba(234, 179, 8, .25) !important;
}

/* Arrow inside dropdown button: always vertically centered, rotates in-place without jumping */
.curriculum-dropdown-arrow {
    width: 13px;
    height: 13px;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.2s ease;
    transform-origin: center;
    pointer-events: none;
}

.curriculum-dropdown-btn[aria-expanded="true"] .curriculum-dropdown-arrow {
    transform: rotate(180deg);
    color: #eab308;
}

/* ── Custom Curriculum Dropdown Menu (Settings-Dropdown UI/UX) ── */
#curriculum-dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 100%;
    min-width: 116px;
    max-width: calc(100vw - 24px);
    z-index: 100;
    transform-origin: top right;
}

#curriculum-dropdown-menu.open {
    display: block;
    animation: curriculumDropdownIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes curriculumDropdownIn {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(-4px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#curriculum-dropdown-menu button,
#curriculum-dropdown-menu a {
    text-decoration: none !important;
}

@media(min-width: 768px) {
    .curriculum-tabs {
        display: inline-flex;
    }

    .curriculum-filter-wrap {
        display: none;
    }
}

/* ── Profile Header Settings Button & Dropdown (Uniform Height with Tabs/Filter) ── */
#btn-settings {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    max-width: 32px !important;
    max-height: 32px !important;
    border-radius: 10px !important;
    padding: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}

.settings-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    width: 190px;
    min-width: 180px;
    max-width: calc(100vw - 24px);
    z-index: 100;
}

.settings-dropdown.open {
    display: block;
}

.settings-dropdown button,
.settings-dropdown a {
    min-height: auto !important;
    min-width: auto !important;
}


/* ── Olympiad / CBSE Class Quick Selector Chips ────────── */
.curriculum-quick-pill {
    transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1) !important;
    user-select: none;
    white-space: nowrap;
}

.curriculum-quick-pill:hover {
    transform: translateY(-1px);
}

/* ── Reduced Motion Accessibility (WCAG 2.3.3) ── */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ══════════════════════════════════════════════════════════════════
   PROFESSIONAL UI/UX ENHANCEMENTS — Mobile & Desktop Polish
   ══════════════════════════════════════════════════════════════════ */

/* ── 1. Card Top Hairline Highlight (Linear / Vercel style) ──────── */
.stat-card,
.profile-summary-card,
.subject-card,
.level-stats-sidebar,
.set-card {
    box-shadow: inset 0 1px 0 0 rgba(255, 255, 255, 0.05), var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.3));
}

/* ── 2. Mobile Touch Polish — Zero Delay & Instant Tactile Feedback ── */
button:not(.school-change-btn):not(.fl-eye-btn):not(#toggle-password),
[role="button"]:not(.school-change-btn):not(.fl-eye-btn):not(#toggle-password),
.set-card,
.curriculum-tab,
.mobile-nav a {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:active:not(:disabled):not(.school-change-btn):not(.fl-eye-btn):not(#toggle-password),
[role="button"]:active:not(.school-change-btn):not(.fl-eye-btn):not(#toggle-password),
.set-card:active {
    transform: scale(0.985);
    transition: transform 70ms ease;
}

/* ── 3. Tabular Numerals for Numerical Stability (Scores/Timers) ─── */
.tabular-nums,
[id^="perf-"],
[id^="stat-"],
.level-stat-num {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum', 'cv02', 'cv03', 'cv04', 'cv11';
}

/* ── 4. Desktop Sticky Sidebar Hardware Acceleration ─────────────── */
@media (min-width: 1024px) {

    #profile-card,
    .profile-summary-card,
    #level-stats-sidebar,
    .level-stats-sidebar {
        will-change: transform;
        transform: translateZ(0);
    }
}

/* ── 5. Mobile Stat Card Breathing Room (Small Phone Screens) ─────── */
@media (max-width: 639px) {
    .stat-card {
        padding: 14px 12px !important;
    }
}

/* ── Fading Dividers & Section Accent Bars (Anti-Grid Clash) ──── */
.divider-fade {
    height: 1px;
    width: 100%;
    background-color: rgba(51, 65, 85, 0.65);
}

.section-accent-bar {
    flex: 1 1 0%;
    height: 1px;
    background-color: rgba(51, 65, 85, 0.65);
}


/* ── Multi-track Leaderboard Standing Separators ───────────────── */
.standing-tracks-grid>*:not(:last-child) {
    border-bottom: 1px solid rgba(30, 41, 59, 0.6);
}

@media (min-width: 768px) {
    .standing-tracks-grid>*:not(:last-child) {
        border-bottom: none;
        border-right: none;
        position: relative;
    }

    .standing-tracks-grid>*:not(:last-child)::after {
        content: "";
        position: absolute;
        right: 0;
        top: 14px;
        bottom: 14px;
        width: 1px;
        background-color: rgba(51, 65, 85, 0.5);
        border-radius: 9999px;
        pointer-events: none;
    }
}


/* ── Indicator Dots & Utility Polyfills ────────────────────────── */
span.w-1\.5.h-1\.5,
span.w-2.h-2,
span.w-2\.5.h-2\.5,
span.w-3.h-3,
.w-1\.5.h-1\.5.rounded-full,
.w-2.h-2.rounded-full {
    display: inline-block;
    flex-shrink: 0;
}

/* Missing Tailwind Background Color Utilities */
.bg-emerald-400 {
    background-color: #34d399 !important;
}

.bg-emerald-400.animate-pulse {
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.75);
}

.bg-amber-500 {
    background-color: #f59e0b !important;
}

.bg-indigo-500 {
    background-color: #6366f1 !important;
}

.bg-sky-500 {
    background-color: #0ea5e9 !important;
}

.bg-sky-950 {
    background-color: #082f49 !important;
}

.bg-teal-500 {
    background-color: #14b8a6 !important;
}

.bg-rose-500 {
    background-color: #f43f5e !important;
}

.bg-gold-400 {
    background-color: #facc15 !important;
}

.bg-gold-950 {
    background-color: #1a1303 !important;
}

.bg-cyan-900 {
    background-color: #164e63 !important;
}

.bg-violet-400 {
    background-color: #a78bfa !important;
}


/* ================================================================
   PROFESSIONAL SKELETON LOADERS & ZERO-CLS HARDENING
   ================================================================ */
@keyframes smoothPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: smoothPulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
    will-change: opacity;
}

/* Base properties for skeleton card containers: 100% solid, fully opaque, non-transparent */
.set-card-skeleton,
.level-card-skeleton,
.resume-card-skeleton,
.quiz-skeleton-card,
.profile-skeleton-card,
.top5-card.is-skeleton,
.rank-row.is-skeleton,
.video-skeleton-box,
.skeleton-sweep-card {
    position: relative !important;
    overflow: hidden !important;
    pointer-events: none !important;
    user-select: none !important;
    cursor: default !important;
    background-color: #0f172a !important;
    /* Force solid, opaque slate-900 background */
    opacity: 1 !important;
    /* Ensure card container itself is NEVER transparent */
}

/* Prevent whole card containers from pulsating opacity (which makes them look transparent against dark page backgrounds) */
.set-card-skeleton.animate-pulse,
.level-card-skeleton.animate-pulse,
.resume-card-skeleton.animate-pulse,
.quiz-skeleton-card.animate-pulse,
.profile-skeleton-card.animate-pulse,
.video-skeleton-box.animate-pulse {
    animation: none !important;
    opacity: 1 !important;
}

/* Pulse the placeholder bars, pills, dots, and button blocks inside the cards instead */
.set-card-skeleton [class*="bg-slate-"],
.level-card-skeleton [class*="bg-slate-"],
.resume-card-skeleton [class*="bg-slate-"],
.quiz-skeleton-card [class*="bg-slate-"],
.profile-skeleton-card [class*="bg-slate-"],
.video-skeleton-box [class*="bg-slate-"] {
    animation: smoothPulse 1.8s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
    will-change: opacity;
}

@keyframes skeletonCardSweep {
    0% {
        transform: translateX(-100%);
    }

    60%,
    100% {
        transform: translateX(100%);
    }
}

.subject-card.is-skeleton::before,
.set-card-skeleton::before,
.level-card-skeleton::before,
.resume-card-skeleton::before,
.quiz-skeleton-card::before,
.profile-skeleton-card::before,
.top5-card.is-skeleton::before,
.rank-row.is-skeleton::before,
.video-skeleton-box::before,
.skeleton-sweep-card::before {
    content: '' !important;
    position: absolute !important;
    inset: 0 !important;
    transform: translateX(-100%) !important;
    background: linear-gradient(90deg,
            transparent 0%,
            rgba(148, 163, 184, 0.02) 20%,
            var(--ej-skeleton-sweep-highlight, rgba(255, 255, 255, 0.06)) 50%,
            rgba(148, 163, 184, 0.02) 80%,
            transparent 100%) !important;
    animation: skeletonCardSweep 2.2s cubic-bezier(0.4, 0, 0.2, 1) infinite !important;
    pointer-events: none !important;
    z-index: 25 !important;
}

@media (prefers-reduced-motion: reduce) {

    .animate-pulse,
    .skeleton,
    .skeleton-shimmer,
    .subject-card.is-skeleton::before,
    .set-card-skeleton::before,
    .level-card-skeleton::before,
    .resume-card-skeleton::before,
    .quiz-skeleton-card::before,
    .profile-skeleton-card::before,
    .top5-card.is-skeleton::before,
    .rank-row.is-skeleton::before,
    .video-skeleton-box::before,
    .skeleton-sweep-card::before {
        animation: none !important;
        transform: none !important;
        opacity: 0.75 !important;
    }
}

/* ================================================================
   SMOOTH, LIGHTWEIGHT, ZERO-BLUR TAB & PAGE NAVIGATION
   Native-app instant persistence for header and navigation bar.
   Eliminates all blurry bitmap cross-fades, GPU blur lag, and layout shifts.
   ================================================================ */
body>header,
.site-header,
#quiz-header,
#sticky-header-wrap>header {
    position: sticky !important;
    top: 0 !important;
    z-index: 50 !important;
    visibility: visible !important;
    opacity: 1 !important;
    background-color: #0b1120 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.brand-bar {
    visibility: visible !important;
    opacity: 1 !important;
}

.mobile-nav {
    visibility: visible !important;
    opacity: 1 !important;
    background-color: #0b1120 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Smooth, lightweight, non-blurry content arrival on page switch */
@keyframes contentFadeIn {
    from {
        opacity: 0.88;
    }

    to {
        opacity: 1;
    }
}

#main-content,
#cbse-main,
#olympiad-main,
.page-shell {
    animation: contentFadeIn 0.12s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Eliminate conflicting entrance animations when replacing skeleton loaders */
.hero-enter,
.topic-card.enter,
.class-card.enter,
.subject-card.enter,
.level-card.enter,
.set-card.animate-enter,
.set-card.opacity-0,
.set-card.set-enter {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
}

/* ================================================================
   RESPONSIVE HUB LEADERBOARD VISIBILITY & PROFESSIONAL SPACING
   Desktop: 100% original layout (Header leaderboard button + divider line)
   Mobile (<640px): Dedicated leaderboard card below hero with 16px/20px gap
   ================================================================ */
.hub-leaderboard-desktop {
    display: flex !important;
}

.hub-divider-desktop {
    display: block !important;
}

.hub-leaderboard-mobile {
    display: none !important;
}

@media (max-width: 639px) {
    .hub-leaderboard-desktop {
        display: none !important;
    }

    .hub-divider-desktop {
        display: none !important;
    }

    .hub-leaderboard-mobile {
        display: block !important;
    }

    /* Balanced professional gap hierarchy on phones */
    .hero-enter {
        margin-bottom: 16px !important;
    }

    .hub-leaderboard-mobile {
        margin-bottom: 20px !important;
    }

    #grammar-main,
    #cbse-main,
    #olympiad-main {
        padding-top: 0 !important;
    }
}

/* ================================================================
   PRACTICE SET CARDS RESPONSIVE SWITCH & UTILITY FALLBACKS
   - Desktop (>=640px): 100% original 1-row layout preserved
   - Mobile (<640px): Dedicated 2-row layout (Meta top, Actions bottom)
   - Ensures .sm:flex works even when omitted by Tailwind purge
   ================================================================ */
.set-card-desktop {
    display: flex !important;
}

.set-card-mobile {
    display: none !important;
}

@media (min-width: 640px) {
    .sm\:flex {
        display: flex !important;
    }

    .sm\:inline-flex {
        display: inline-flex !important;
    }

    .sm\:h-10 {
        height: 2.5rem;
    }

    .sm\:w-14 {
        width: 3.5rem;
    }

    .sm\:w-20 {
        width: 5rem;
    }

    .sm\:w-24 {
        width: 6rem;
    }

    .sm\:w-28 {
        width: 7rem;
    }

    .sm\:w-40 {
        width: 10rem;
    }

    .sm\:mb-2 {
        margin-bottom: 0.5rem;
    }

    .sm\:min-h-\[76px\] {
        min-height: 76px;
    }

    .sm\:min-h-\[82px\] {
        min-height: 82px;
    }

    .sm\:rounded-2xl {
        border-radius: 1rem;
    }
}

/* Skeleton utility width/height fallbacks not present in purged tailwind.min.css */
.h-2\.5 {
    height: 0.625rem;
}

.w-18 {
    width: 4.5rem;
}

.w-22 {
    width: 5.5rem;
}

.w-26 {
    width: 6.5rem;
}

.w-30 {
    width: 7.5rem;
}

.w-32 {
    width: 8rem;
}

.w-36 {
    width: 9rem;
}

.w-40 {
    width: 10rem;
}

.w-44 {
    width: 11rem;
}

.w-4\/5 {
    width: 80%;
}

.w-\[108px\] {
    width: 108px;
}

.min-h-\[68px\] {
    min-height: 68px;
}

.min-h-\[72px\] {
    min-height: 72px;
}

.min-h-\[76px\] {
    min-height: 76px;
}

.bg-slate-800\/50 {
    background-color: rgba(30, 41, 59, 0.5);
}

.bg-slate-800\/90 {
    background-color: rgba(30, 41, 59, 0.9);
}

@media (max-width: 639px) {
    .set-card-desktop {
        display: none !important;
    }

    .set-card-mobile {
        display: flex !important;
    }

    /* Profile Recent Activity card — refined phone-only UI/UX */
    .recent-activity-card {
        padding: 12px 14px !important;
        gap: 12px !important;
        border-radius: 14px !important;
        align-items: center !important;
    }

    .recent-activity-score {
        width: 42px !important;
        height: 42px !important;
        border-radius: 11px !important;
    }

    .recent-activity-score>span {
        font-size: 12.5px !important;
        line-height: 1 !important;
        letter-spacing: -0.02em !important;
    }

    .recent-activity-body {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 4px !important;
        min-width: 0 !important;
    }

    .recent-activity-title {
        font-size: 13.5px !important;
        font-weight: 800 !important;
        line-height: 1.2 !important;
        letter-spacing: -0.01em !important;
    }

    .recent-activity-meta {
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 6px !important;
        margin-top: 0 !important;
        font-size: 10px !important;
        line-height: 1.2 !important;
        letter-spacing: 0.05em !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    .recent-activity-subtext {
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
        flex-shrink: 1 !important;
        min-width: 0 !important;
    }

    .recent-activity-dot {
        flex-shrink: 0 !important;
        opacity: 0.45 !important;
    }

    .recent-activity-date {
        flex-shrink: 0 !important;
        color: #94a3b8 !important;
    }

    .recent-activity-badge {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: 24px !important;
        padding: 0 9px !important;
        border-radius: 7px !important;
        font-size: 9px !important;
        font-weight: 900 !important;
        line-height: 1 !important;
        letter-spacing: 0.08em !important;
        flex-shrink: 0 !important;
    }
}


/* ══════════════════════════════════════════════════════════════════
   ANSWER REVEAL — Solid Correct / Wrong option states (no inner badges)
   Used by js/engine.js + cbse-engine/js/*-engine.js after submit
   ══════════════════════════════════════════════════════════════════ */
.opt-rv-correct,
.opt-rv-wrong,
.opt-rv-dim {
    opacity: 1 !important;
    font-weight: 700 !important;
    transition: background-color .2s ease, border-color .2s ease;
}

.opt-rv-correct {
    background: #16a34a !important;
    border-color: #22c55e !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px -6px rgba(22, 163, 74, .55);
}

.opt-rv-wrong {
    background: #dc2626 !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 6px 18px -6px rgba(220, 38, 38, .55);
}

.opt-rv-dim {
    background: #1e293b !important;
    border-color: #475569 !important;
    color: #f1f5f9 !important;
}

.opt-rv-correct .letter-badge,
.opt-rv-wrong .letter-badge {
    background: transparent !important;
    border: 1.5px solid #ffffff !important;
    color: #ffffff !important;
}

.opt-rv-dim .letter-badge {
    background: #334155 !important;
    border-color: #475569 !important;
    color: #94a3b8 !important;
}

/* ══════════════════════════════════════════════════════════════════
   PRACTICE QUESTION CARDS — Responsive Mobile (<768px) + Desktop (>=768px)
   ══════════════════════════════════════════════════════════════════ */
#quiz-container {
    padding: 10px 10px 20px !important;
}

@media (min-width: 640px) {
    #quiz-container {
        padding: 14px 18px 24px !important;
    }
}

#quiz-container>.q-card {
    padding: 12px 12px !important;
    margin-bottom: 10px !important;
    border-radius: 8px !important;
}

@media (min-width: 640px) {
    #quiz-container>.q-card {
        padding: 14px 16px !important;
        margin-bottom: 12px !important;
        border-radius: 8px !important;
    }
}

#quiz-container>.q-card>.q-hdr {
    padding: 0;
    border-bottom: 0;
    display: block;
}

#quiz-container>.q-card .q-badge {
    display: none;
}

#quiz-container>.q-card .q-text {
    margin-bottom: 8px !important;
    line-height: 1.5 !important;
}

.q-opts {
    gap: 4px !important;
}

.q-opts .q-opt {
    padding: 6px 6px !important;
    border-radius: 6px !important;
    background: transparent;
    border: 1px solid transparent;
    cursor: pointer;
    gap: 10px !important;
}

.q-opts .q-opt:not(:disabled):hover {
    background: transparent;
}

.q-opts .q-opt .letter-badge {
    width: 18px;
    height: 18px;
    border-radius: 9999px;
    border: 2px solid #475569;
    background: transparent;
    flex-shrink: 0;
    transition: all 0.15s ease;
}

.q-opts .q-opt:not(:disabled):hover .letter-badge {
    border-color: #94a3b8;
}

.q-opts .q-opt.is-selected {
    background: transparent !important;
    border-color: transparent !important;
    color: #fef08a;
    font-weight: 600;
}

.q-opts .q-opt.is-selected .letter-badge {
    border-color: #facc15;
    background-color: #facc15;
    box-shadow: inset 0 0 0 3px #0f172a;
}

.q-opts .q-opt.opt-rv-correct .letter-badge {
    border: 2px solid #ffffff !important;
    background-color: #ffffff !important;
    box-shadow: inset 0 0 0 3px #16a34a !important;
}

.q-opts .q-opt.opt-rv-wrong .letter-badge {
    border: 2px solid #ffffff !important;
    background-color: #ffffff !important;
    box-shadow: inset 0 0 0 3px #dc2626 !important;
}

.q-opts .q-opt.opt-rv-dim {
    background: transparent !important;
    border-color: transparent !important;
    color: #64748b !important;
    font-weight: 400 !important;
    box-shadow: none !important;
}

.q-opts .q-opt.opt-rv-dim .letter-badge {
    border: 2px solid #334155 !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* ── Desktop Layout (>= 768px): Q01 Header + 2-Column Boxed Options ── */
@media (min-width: 768px) {
    #quiz-container {
        padding: 24px 32px !important;
    }

    #quiz-container>.q-card {
        padding: 0 !important;
        margin-bottom: 20px !important;
        border-radius: 12px !important;
        overflow: hidden;
    }

    #quiz-container>.q-card>.q-hdr {
        padding: 16px 20px !important;
        border-bottom: 1px solid #1e293b !important;
        display: flex !important;
        gap: 16px !important;
        align-items: flex-start !important;
    }

    #quiz-container>.q-card[data-type="passage"]>.q-hdr,
    #quiz-container>.q-card[data-type="paragraph"]>.q-hdr {
        margin-bottom: 16px !important;
    }

    #quiz-container>.q-card>.q-passage-rows {
        padding: 0 20px 16px 20px !important;
    }

    #quiz-container>.q-card .q-badge {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        color: #22d3ee;
        font-size: 12px;
        line-height: 16px;
        background-color: rgba(8, 51, 68, 0.5);
        border: 1px solid rgba(21, 94, 117, 0.5);
        padding: 4px 10px;
        border-radius: 4px;
        flex-shrink: 0;
        margin-top: 2px;
    }

    #quiz-container>.q-card .q-num {
        display: none !important;
    }

    #quiz-container>.q-card .q-text {
        margin-bottom: 0 !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        line-height: 1.625 !important;
    }

    .q-opts {
        padding: 20px !important;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .q-opts .q-opt {
        padding: 12px 16px !important;
        border-radius: 8px !important;
        border: 1px solid #1e293b !important;
        background-color: #020617 !important;
        color: #cbd5e1;
        font-size: 14px !important;
        font-weight: 500;
        gap: 12px !important;
        transition: all 0.2s ease;
    }

    .q-opts .q-opt:not(:disabled):hover {
        border-color: rgba(234, 179, 8, 0.5) !important;
        background-color: #0f172a !important;
    }

    .q-opts .q-opt .letter-badge {
        width: 28px !important;
        height: 28px !important;
        border-radius: 6px !important;
        border: 1px solid #334155 !important;
        background-color: #0f172a !important;
        color: #64748b !important;
        font-size: 12px !important;
        font-weight: 700 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: none !important;
    }

    .q-opts .q-opt .letter-badge::before {
        content: attr(data-letter);
    }

    .q-opts .q-opt .opt-prefix {
        display: none !important;
    }

    .q-opts .q-opt.is-selected {
        border-color: #eab308 !important;
        background-color: rgba(66, 32, 6, 0.3) !important;
        color: #facc15 !important;
        font-weight: 500 !important;
    }

    .q-opts .q-opt.is-selected .letter-badge {
        border-color: #eab308 !important;
        background-color: rgba(113, 63, 18, 0.2) !important;
        color: #eab308 !important;
        box-shadow: none !important;
    }

    .q-opts .q-opt.opt-rv-correct {
        background: #16a34a !important;
        border-color: #22c55e !important;
        color: #ffffff !important;
        font-weight: 700 !important;
    }

    .q-opts .q-opt.opt-rv-correct .letter-badge {
        background: transparent !important;
        border: 1.5px solid #ffffff !important;
        color: #ffffff !important;
        box-shadow: none !important;
    }

    .q-opts .q-opt.opt-rv-wrong {
        background: #dc2626 !important;
        border-color: #ef4444 !important;
        color: #ffffff !important;
        font-weight: 700 !important;
    }

    .q-opts .q-opt.opt-rv-wrong .letter-badge {
        background: transparent !important;
        border: 1.5px solid #ffffff !important;
        color: #ffffff !important;
        box-shadow: none !important;
    }

    .q-opts .q-opt.opt-rv-dim {
        background: #1e293b !important;
        border-color: #475569 !important;
        color: #f1f5f9 !important;
        font-weight: 700 !important;
    }

    .q-opts .q-opt.opt-rv-dim .letter-badge {
        background: #334155 !important;
        border: 1px solid #475569 !important;
        color: #94a3b8 !important;
        box-shadow: none !important;
    }
}

@media (min-width: 1280px) {
    #quiz-container {
        padding: 24px 64px !important;
    }
}