
        /* ==========================================================================
           COMPLETE SELF-CONTAINED CSS (ZERO EXTERNAL DEPENDENCIES)
           ========================================================================== */
        :root {
            --bg-main: #0f172a;
            --bg-card: #1e293b;
            --bg-card-dark: #0b1120;
            --bg-input: #0f172a;
            --border-color: #334155;
            --border-light: #475569;
            --text-main: #f8fafc;
            --text-muted: #94a3b8;
            --text-dim: #64748b;
            --emerald: #10b981;
            --emerald-dark: #059669;
            --emerald-bg: rgba(16, 185, 129, 0.12);
            --blue: #3b82f6;
            --blue-dark: #2563eb;
            --blue-bg: rgba(59, 130, 246, 0.12);
            --purple: #a855f7;
            --purple-dark: #9333ea;
            --purple-bg: rgba(168, 85, 247, 0.12);
            --amber: #f59e0b;
            --amber-dark: #d97706;
            --amber-bg: rgba(245, 158, 11, 0.12);
            --rose: #f43f5e;
            --rose-bg: rgba(244, 63, 94, 0.12);
        }

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

        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
            background-color: var(--bg-main);
            color: var(--text-main);
            line-height: 1.5;
            min-height: 100vh;
            display: flex;
            flex-direction: column;
        }

        .hidden {
            display: none !important;
        }

        /* StudyHub dashboard */
        .home-hero {
            display: grid;
            grid-template-columns: minmax(0, 1.5fr) minmax(230px, 0.8fr);
            gap: 1.5rem;
            align-items: center;
            padding: clamp(1.5rem, 4vw, 2.5rem);
            background: radial-gradient(circle at 90% 10%, rgba(16,185,129,.17), transparent 35%), linear-gradient(135deg, #1e293b, #111c30);
            border-color: rgba(16,185,129,.28);
        }
        .home-kicker { color: var(--emerald); font-size: .75rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
        .home-title { font-size: clamp(2rem, 5vw, 3.15rem); line-height: 1.08; margin: .55rem 0 .8rem; color: #fff; font-weight: 900; }
        .home-copy { max-width: 620px; color: #cbd5e1; font-size: 1rem; }
        .home-visual { min-height: 190px; display: grid; place-items: center; border: 1px solid rgba(16,185,129,.25); border-radius: 18px; background: rgba(15,23,42,.6); }
        .home-globe { font-size: 5.8rem; filter: drop-shadow(0 12px 22px rgba(16,185,129,.22)); }
        .home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin: 1.25rem 0 2rem; }
        .home-stat { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 15px; padding: 1rem 1.1rem; }
        .home-stat strong { display: block; color: #fff; font-size: 1.4rem; }
        .home-stat span { color: var(--text-muted); font-size: .8rem; }
        .subject-card { min-height: 235px; }
        .subject-icon { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--emerald-bg); font-size: 1.5rem; margin-bottom: 1rem; }
        .coming-soon { opacity: .72; border-style: dashed; }
        .home-section-title { margin: 0 0 .9rem; }
        .nav-tab-btn.subject-nav { display: none; }
        body.subject-open .nav-tab-btn.subject-nav { display: inline-flex; }
        .nav-tab-btn.math-nav { display: none; }
        body.math-open .nav-tab-btn.subject-nav { display: none; }
        body.math-open .nav-tab-btn.math-nav { display: inline-flex; }
        .subject-card-link { cursor: pointer; outline: none; }
        .subject-card-link:hover, .subject-card-link:focus-visible {
            border-color: var(--emerald);
            box-shadow: 0 0 0 3px rgba(16,185,129,.14), 0 14px 30px rgba(0,0,0,.22);
            transform: translateY(-3px);
        }
        .card-open-hint {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: .75rem;
            margin-top: 1.25rem;
            padding: .8rem 1rem;
            border-radius: 12px;
            color: #022c22;
            background: linear-gradient(90deg, #10b981, #14b8a6);
            font-size: .9rem;
            font-weight: 800;
        }
        .info-note { background: rgba(59,130,246,.08); border: 1px solid rgba(59,130,246,.25); border-radius: 12px; padding: .85rem 1rem; color: #cbd5e1; font-size: .84rem; margin-top: 1rem; }
        @media (max-width: 720px) {
            .home-hero { grid-template-columns: 1fr; }
            .home-visual { min-height: 130px; }
            .home-globe { font-size: 4rem; }
        }
        @media (max-width: 520px) { .home-stats { grid-template-columns: 1fr; } }

        /* Header & Navigation */
        header {
            background-color: rgba(30, 41, 59, 0.95);
            border-bottom: 1px solid var(--border-color);
            position: sticky;
            top: 0;
            z-index: 50;
            backdrop-filter: blur(8px);
        }

        .header-inner {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0.85rem 1.25rem;
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            cursor: pointer;
        }

        .brand-icon {
            width: 42px;
            height: 42px;
            border-radius: 12px;
            background: var(--emerald-bg);
            border: 1px solid rgba(16, 185, 129, 0.35);
            color: var(--emerald);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.35rem;
        }

        .brand-title {
            font-size: 1.2rem;
            font-weight: 800;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: #fff;
        }

        .study-pill {
            font-size: 0.65rem;
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            background: var(--emerald-bg);
            color: var(--emerald);
            border: 1px solid rgba(16, 185, 129, 0.35);
            padding: 0.15rem 0.5rem;
            border-radius: 999px;
        }

        .brand-sub {
            font-size: 0.78rem;
            color: var(--text-muted);
        }

        nav {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .nav-tab-btn {
            border: 1px solid var(--border-color);
            background-color: var(--bg-card);
            color: var(--text-muted);
            padding: 0.55rem 0.95rem;
            border-radius: 12px;
            font-size: 0.85rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
        }

        .nav-tab-btn:hover {
            color: #fff;
            border-color: var(--border-light);
            background-color: #293548;
        }

        .nav-tab-btn.active {
            background-color: var(--emerald-dark);
            color: #fff;
            border-color: var(--emerald);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
        }

        /* Main Container */
        main {
            max-width: 1200px;
            width: 100%;
            margin: 0 auto;
            padding: 1.5rem 1.25rem 3rem;
            flex-grow: 1;
        }

        /* Cards & Panels */
        .panel {
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 18px;
            padding: 1.5rem;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
            margin-bottom: 1.5rem;
        }

        .panel-header {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
        }

        h2 {
            font-size: 1.5rem;
            font-weight: 800;
            color: #fff;
        }

        h3 {
            font-size: 1.15rem;
            font-weight: 700;
            color: #fff;
        }

        .subtitle {
            color: var(--text-muted);
            font-size: 0.9rem;
            margin-top: 0.25rem;
        }

        /* Form Elements */
        select, input[type="text"], textarea {
            background-color: var(--bg-input);
            border: 1px solid var(--border-color);
            color: #fff;
            border-radius: 12px;
            padding: 0.65rem 0.9rem;
            font-size: 0.9rem;
            font-family: inherit;
            outline: none;
            transition: border-color 0.2s;
        }

        select:focus, input[type="text"]:focus, textarea:focus {
            border-color: var(--emerald);
        }

        textarea {
            width: 100%;
            resize: vertical;
            line-height: 1.5;
        }

        /* Grid Layouts */
        .grid-tests {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 1.25rem;
        }

        .grid-2 {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 1.25rem;
        }

        .grid-3 {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 1.25rem;
        }

        /* Test Card */
        .test-card {
            background-color: var(--bg-card);
            border: 1px solid var(--border-color);
            border-radius: 18px;
            padding: 1.5rem;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            position: relative;
            overflow: hidden;
            transition: transform 0.2s, border-color 0.2s;
        }

        .test-card:hover {
            transform: translateY(-3px);
            border-color: var(--emerald);
        }

        .test-card.featured {
            background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
            border: 2px solid rgba(16, 185, 129, 0.5);
        }

        .ribbon {
            position: absolute;
            top: 0;
            right: 0;
            background-color: var(--emerald);
            color: #022c22;
            font-size: 0.68rem;
            font-weight: 900;
            padding: 0.25rem 0.75rem;
            border-bottom-left-radius: 12px;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }

        .card-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.85rem;
            font-size: 0.78rem;
        }

        .tag {
            padding: 0.25rem 0.65rem;
            border-radius: 999px;
            font-weight: 700;
            font-size: 0.75rem;
        }

        .tag-emerald { background: var(--emerald-bg); color: var(--emerald); border: 1px solid rgba(16,185,129,0.3); }
        .tag-blue { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(59,130,246,0.3); }
        .tag-purple { background: var(--purple-bg); color: var(--purple); border: 1px solid rgba(168,85,247,0.3); }
        .tag-amber { background: var(--amber-bg); color: var(--amber); border: 1px solid rgba(245,158,11,0.3); }
        .tag-rose { background: var(--rose-bg); color: var(--rose); border: 1px solid rgba(244,63,94,0.3); }

        .card-desc {
            color: var(--text-muted);
            font-size: 0.85rem;
            margin-top: 0.6rem;
            line-height: 1.5;
        }

        /* Buttons */
        .btn {
            border: none;
            border-radius: 12px;
            padding: 0.75rem 1.2rem;
            font-size: 0.9rem;
            font-weight: 700;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.2s;
            font-family: inherit;
        }

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

        .btn-full { width: 100%; margin-top: 1.25rem; }
        .btn-emerald { background-color: var(--emerald-dark); color: #fff; }
        .btn-emerald:hover:not(:disabled) { background-color: var(--emerald); color: #022c22; }
        .btn-blue { background-color: var(--blue-dark); color: #fff; }
        .btn-blue:hover:not(:disabled) { background-color: var(--blue); }
        .btn-purple { background-color: var(--purple-dark); color: #fff; }
        .btn-purple:hover:not(:disabled) { background-color: var(--purple); }
        .btn-amber { background: linear-gradient(90deg, #f59e0b, #ea580c); color: #0f172a; font-weight: 800; }
        .btn-amber:hover:not(:disabled) { filter: brightness(1.1); }
        .btn-gradient { background: linear-gradient(90deg, #10b981, #14b8a6); color: #022c22; font-weight: 800; }
        .btn-gradient:hover:not(:disabled) { filter: brightness(1.1); }
        .btn-secondary { background-color: #334155; color: #f1f5f9; border: 1px solid var(--border-light); }
        .btn-secondary:hover:not(:disabled) { background-color: #475569; }

        /* Quiz Interface */
        .quiz-top-bar {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            gap: 1rem;
            margin-bottom: 1rem;
        }

        .timer-badge {
            background-color: var(--bg-main);
            border: 1px solid var(--amber);
            color: var(--amber);
            padding: 0.4rem 0.85rem;
            border-radius: 10px;
            font-weight: 800;
            font-variant-numeric: tabular-nums;
            font-size: 0.95rem;
        }

        .progress-track {
            width: 100%;
            height: 10px;
            background-color: var(--bg-main);
            border-radius: 999px;
            overflow: hidden;
            margin-bottom: 1rem;
        }

        .progress-fill {
            height: 100%;
            background: linear-gradient(90deg, var(--emerald), #2dd4bf);
            width: 0%;
            transition: width 0.3s ease;
        }

        /* Question Navigator Pills */
        .q-nav-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem;
            margin-bottom: 1.25rem;
        }

        .q-pill {
            width: 32px;
            height: 32px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
            background-color: var(--bg-main);
            color: var(--text-muted);
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .q-pill.answered {
            background-color: rgba(16, 185, 129, 0.18);
            border-color: var(--emerald);
            color: var(--emerald);
        }

        .q-pill.current {
            background-color: var(--emerald);
            color: #022c22;
            border-color: #fff;
            transform: scale(1.08);
        }

        .question-text {
            font-size: 1.15rem;
            font-weight: 700;
            color: #fff;
            margin: 1rem 0 1.25rem;
            line-height: 1.5;
        }

        .mc-option {
            width: 100%;
            text-align: left;
            padding: 0.9rem 1rem;
            margin-bottom: 0.65rem;
            border-radius: 12px;
            border: 1px solid var(--border-color);
            background-color: var(--bg-main);
            color: var(--text-main);
            font-size: 0.95rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            transition: all 0.15s;
        }

        .mc-option:hover {
            border-color: var(--border-light);
            background-color: #162033;
        }

        .mc-option.selected {
            border-color: var(--emerald);
            background-color: var(--emerald-bg);
            color: #6ee7b7;
        }

        .mc-letter {
            width: 28px;
            height: 28px;
            border-radius: 8px;
            background-color: var(--bg-card);
            color: var(--text-muted);
            font-weight: 800;
            font-size: 0.8rem;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            margin-right: 0.75rem;
            flex-shrink: 0;
        }

        .mc-option.selected .mc-letter {
            background-color: var(--emerald);
            color: #022c22;
        }

        .quiz-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 1.5rem;
            padding-top: 1.25rem;
            border-top: 1px solid var(--border-color);
            gap: 1rem;
        }

        /* Results & Grade Display */
        .grade-hero {
            text-align: center;
            padding: 2rem 1rem;
        }

        .grade-circle {
            width: 130px;
            height: 130px;
            border-radius: 50%;
            margin: 0 auto 1rem;
            background: var(--bg-main);
            border: 4px solid var(--emerald);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            box-shadow: 0 0 30px rgba(16, 185, 129, 0.25);
        }

        .grade-number {
            font-size: 2.75rem;
            font-weight: 900;
            line-height: 1;
            color: #fff;
        }

        .grade-label {
            font-size: 0.7rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: var(--text-muted);
            margin-top: 0.25rem;
        }

        .stats-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1rem;
            max-width: 600px;
            margin: 1.5rem auto;
        }

        .stat-box {
            background-color: var(--bg-main);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 0.85rem;
        }

        .stat-val {
            font-size: 1.2rem;
            font-weight: 800;
            color: #fff;
        }

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

        .review-card {
            border-radius: 14px;
            padding: 1.15rem;
            margin-bottom: 1rem;
            border: 1px solid var(--border-color);
            background-color: var(--bg-main);
        }

        .review-card.correct { border-color: rgba(16, 185, 129, 0.45); background: rgba(16, 185, 129, 0.05); }
        .review-card.partial { border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.05); }
        .review-card.wrong { border-color: rgba(244, 63, 94, 0.45); background: rgba(244, 63, 94, 0.05); }

        .user-answer-box {
            background-color: rgba(15, 23, 42, 0.85);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 0.7rem 0.9rem;
            margin: 0.65rem 0;
            font-size: 0.88rem;
            color: #cbd5e1;
        }

        .feedback-box {
            margin-top: 0.65rem;
            padding-top: 0.65rem;
            border-top: 1px solid rgba(71, 85, 105, 0.4);
            font-size: 0.85rem;
            color: var(--text-muted);
        }

        /* Flashcards (3D Flip) */
        .flashcard-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
            gap: 1.15rem;
        }

        .flashcard {
            height: 190px;
            perspective: 1000px;
            cursor: pointer;
        }

        .flashcard-inner {
            position: relative;
            width: 100%;
            height: 100%;
            transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
            transform-style: preserve-3d;
        }

        .flashcard.flipped .flashcard-inner {
            transform: rotateY(180deg);
        }

        .flashcard-front, .flashcard-back {
            position: absolute;
            width: 100%;
            height: 100%;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            border-radius: 16px;
            padding: 1.15rem;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            border: 1px solid var(--border-color);
        }

        .flashcard-front {
            background-color: var(--bg-card);
        }

        .flashcard:hover .flashcard-front {
            border-color: var(--emerald);
        }

        .flashcard-back {
            background-color: var(--bg-card-dark);
            border-color: var(--emerald);
            transform: rotateY(180deg);
        }

        .fc-term {
            font-size: 1.15rem;
            font-weight: 800;
            text-align: center;
            color: #fff;
            margin: auto 0;
        }

        .fc-def {
            font-size: 0.86rem;
            color: #e2e8f0;
            line-height: 1.45;
            overflow-y: auto;
            margin: auto 0;
        }

        /* Visual Diagrams & Summary Tables */
        .diagram-box {
            background-color: var(--bg-main);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            padding: 1rem;
            text-align: center;
        }

        .diagram-box svg {
            max-width: 100%;
            height: auto;
            border-radius: 10px;
        }

        table.geo-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 0.75rem;
            font-size: 0.86rem;
        }

        table.geo-table th, table.geo-table td {
            border: 1px solid var(--border-color);
            padding: 0.65rem 0.85rem;
            text-align: left;
        }

        table.geo-table th {
            background-color: var(--bg-main);
            color: var(--emerald);
            font-weight: 700;
        }

        /* Spinner & Toast */
        .spinner {
            width: 44px;
            height: 44px;
            border: 4px solid rgba(16, 185, 129, 0.2);
            border-top-color: var(--emerald);
            border-radius: 50%;
            animation: spin 0.9s linear infinite;
            margin: 0 auto 1rem;
        }

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

        .toast {
            position: fixed;
            bottom: 1.25rem;
            right: 1.25rem;
            z-index: 100;
            max-width: 360px;
            background-color: var(--bg-card);
            border: 1px solid var(--amber);
            color: #fff;
            padding: 0.85rem 1rem;
            border-radius: 14px;
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
            display: flex;
            align-items: flex-start;
            gap: 0.65rem;
            font-size: 0.84rem;
        }

        footer {
            text-align: center;
            padding: 1.25rem;
            color: var(--text-dim);
            font-size: 0.78rem;
            border-top: 1px solid var(--border-color);
            margin-top: auto;
        }

        @media (max-width: 640px) {
            .stats-row { grid-template-columns: 1fr; }
            .header-inner { flex-direction: column; align-items: flex-start; }
        }
    
        /* StudyHub refresh: clean, modern learning-platform styling */
        :root {
            --bg-main: #f4f7fc;
            --bg-card: #ffffff;
            --bg-card-dark: #f7f9fd;
            --bg-input: #ffffff;
            --border-color: #e5eaf3;
            --border-light: #cbd5e3;
            --text-main: #17243a;
            --text-muted: #64748b;
            --text-dim: #94a3b8;
            --emerald: #0f9f83;
            --emerald-dark: #087e6a;
            --emerald-bg: #e8f8f3;
            --blue: #4676ee;
            --blue-dark: #315fd4;
            --blue-bg: #edf3ff;
            --purple: #8663dc;
            --purple-dark: #704ac8;
            --purple-bg: #f2edff;
            --amber: #d99016;
            --amber-dark: #b9780e;
            --amber-bg: #fff6e4;
            --rose: #dc5570;
            --rose-bg: #fff0f3;
            --brand: #4169e1;
            --brand-dark: #2f51c7;
            --brand-soft: #edf2ff;
        }
        body { background: #f4f7fc; color: #17243a; }
        header { background: rgba(255,255,255,.94); border-bottom: 1px solid #e6ebf3; box-shadow: 0 3px 18px rgba(20,38,70,.04); }
        .header-inner { max-width: 1320px; padding-top: .8rem; padding-bottom: .8rem; }
        .brand-icon { color: #fff; background: linear-gradient(145deg,#547bf2,#3559cf); border: 0; box-shadow: 0 7px 16px rgba(65,105,225,.22); }
        .brand-title { color: #17243a; letter-spacing: -.025em; }
        .brand-sub { color: #718096; }
        .study-pill { color: #3559cf; background: #edf2ff; border: 1px solid #dbe5ff; }
        .nav-tab-btn { color: #53627a; background: #fff; border-color: #e4e9f2; border-radius: 10px; }
        .nav-tab-btn:hover { color: #2f51c7; border-color: #cbd8ff; background: #f6f8ff; }
        .nav-tab-btn.active { background: #4169e1; border-color: #4169e1; color: #fff; box-shadow: 0 5px 14px rgba(65,105,225,.2); }
        main { max-width: 1320px; padding-top: 1.8rem; }
        .panel, .test-card { background: #fff; border-color: #e6ebf3; box-shadow: 0 8px 26px rgba(24,43,77,.055); }
        .panel { border-radius: 18px; }
        .test-card { border-radius: 17px; }
        h2, h3, .panel h2, .panel h3, .test-card h3 { color: #17243a !important; }
        .subtitle, .card-desc { color: #66758b; }
        .home-hero { background: linear-gradient(110deg,#ffffff 0%,#f6f8ff 65%,#eef4ff 100%); border: 1px solid #e1e8fb; box-shadow: 0 12px 34px rgba(35,62,120,.07); }
        .home-title { color: #182a4a !important; letter-spacing: -.045em; }
        .home-title span { color: #4169e1; }
        .home-kicker { color: #4169e1; }
        .home-copy { color: #617089; }
        .home-visual { border-color: #dce5ff; background: radial-gradient(circle at 50% 50%,#e8efff,#f7f9ff 68%); overflow: hidden; position: relative; }
        .home-globe { filter: none; }
        .home-stats { margin-top: 1.1rem; }
        .home-stat { background: #fff; border-color: #e6ebf3; border-radius: 15px; box-shadow: 0 6px 18px rgba(24,43,77,.04); }
        .home-stat strong { color: #182a4a; }
        .home-stat span { color: #718096; }
        .subject-card { min-height: 245px; }
        .subject-card-link { color: inherit; text-decoration: none; border: 1px solid #e3e9f3; transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
        .subject-card-link:hover, .subject-card-link:focus-visible { border-color: #aebfff; box-shadow: 0 12px 28px rgba(42,74,150,.12); transform: translateY(-3px); outline: none; }
        .subject-card.featured { background: #fff; border: 1px solid #dce5ff; }
        .subject-icon { box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
        .geo-icon { background: linear-gradient(145deg,#e8f7f1,#dff4ee); }
        .math-icon { display: grid; place-items: center; color: #3559cf; font-size: 1.8rem; font-weight: 850; background: linear-gradient(145deg,#e9efff,#dce6ff); }
        .physics-icon { background: linear-gradient(145deg,#f0eaff,#e6ddff); }
        .subject-level { color: #8a96aa; font-size: .75rem; font-weight: 750; }
        .card-open-hint { color: white; background: linear-gradient(90deg,#4169e1,#6687ed); border-radius: 11px; }
        .math-open-hint { background: linear-gradient(90deg,#4769d5,#728cf0); }
        .coming-soon { background: #fbfcff; opacity: .88; border-style: solid; border-color: #e8ecf4; }
        .coming-soon-label { margin-top: 1.1rem; color: #8390a5; font-size: .82rem; font-weight: 700; padding: .65rem .8rem; border-radius: 10px; background: #f5f7fb; }
        .home-page .grid-tests { grid-template-columns: repeat(auto-fit,minmax(260px,1fr)); }
        .home-section-title { color: #17243a !important; }
        .btn-emerald, .btn-gradient { background: #4169e1; color: #fff; }
        .btn-emerald:hover:not(:disabled), .btn-gradient:hover:not(:disabled) { background: #3159d5; color: #fff; }
        .btn-blue { background: #3978de; }
        .btn-purple { background: #7857ce; }
        .btn-secondary { background: #fff; color: #52627a; border: 1px solid #dfe5ef; }
        .btn-secondary:hover:not(:disabled) { background: #f5f7fb; color: #283b5c; }
        select, input[type="text"], textarea { background: #fff; color: #17243a; border-color: #dfe5ef; }
        .question-text { color: #17243a; }
        .mc-option { background: #fff; color: #25344d; border-color: #e2e8f2; }
        .mc-option:hover { background: #f6f8ff; border-color: #b9c8fb; }
        .mc-option.selected { background: #edf3ff; color: #3159c9; border-color: #6f8bed; }
        .mc-letter { background: #f0f3f9; color: #66758b; }
        .mc-option.selected .mc-letter { background: #4169e1; color: #fff; }
        .q-pill { background: #fff; color: #718096; border-color: #e0e6ef; }
        .q-pill.answered { background: #e8f8f3; color: #087e6a; border-color: #8bd8c4; }
        .q-pill.current { background: #4169e1; color: #fff; border-color: #4169e1; }
        .progress-track { background: #edf1f7; }
        .progress-fill { background: linear-gradient(90deg,#4169e1,#7795f4); }
        .timer-badge { background: #fff8e9; color: #a86c0d; border-color: #f2d08c; }
        .grade-circle { background: #f5f8ff; box-shadow: 0 7px 20px rgba(65,105,225,.09); }
        .grade-number { color: #17243a; }
        .stat-box { background: #f8faff; border-color: #e5eaf3; }
        .stat-val { color: #17243a; }
        .stat-lbl { color: #718096; }
        .review-card, .user-answer-box { background: #fff; border-color: #e5eaf3; }
        .user-answer-box { color: #52627a; }
        .flashcard-front { background: #fff; border-color: #e2e8f2; }
        .flashcard-back { background: #f2f6ff; border-color: #aebfff; }
        .fc-term { color: #1d2d4a; }
        .fc-def { color: #3f506b; }
        .diagram-box { background: #f8faff; border-color: #e2e8f2; }
        table.geo-table th { background: #eff4ff; color: #3559cf; }
        table.geo-table td { color: #394861; }
        table.geo-table th, table.geo-table td { border-color: #e0e6ef; }
        footer { color: #91a0b4; border-top-color: #e6ebf3; }
        .toast { background: #fff; color: #25344d; border-color: #e7c46f; box-shadow: 0 12px 30px rgba(24,43,77,.14); }
        .home-section-heading { display:flex; justify-content:space-between; align-items:end; gap:1rem; margin: 1.9rem 0 .95rem; }
        .home-section-heading > p { color:#8a96aa; font-size:.84rem; margin-bottom:.2rem; }
        .section-eyebrow { color:#4169e1; font-size:.7rem; font-weight:850; letter-spacing:.13em; margin-bottom:.25rem; }
        .home-section-heading .home-section-title { margin:0; font-size:1.5rem; }
        .home-hero-meta { display:flex; gap:.55rem; flex-wrap:wrap; margin-top:1.2rem; }
        .home-hero-meta span { border:1px solid #e2e9fb; background:#fff; color:#5c6d89; border-radius:999px; padding:.4rem .7rem; font-size:.75rem; font-weight:700; }
        .kicker-dot { display:inline-block; width:7px; height:7px; border-radius:50%; background:#4169e1; margin-right:.35rem; vertical-align:middle; }
        .home-visual { min-height:210px; }
        .visual-center { z-index:2; width:105px; height:105px; border-radius:32px; display:grid; place-items:center; color:white; font-size:2rem; font-weight:900; letter-spacing:-.06em; background:linear-gradient(145deg,#6283f0,#3559cf); box-shadow:0 17px 38px rgba(65,105,225,.28); transform:rotate(-8deg); }
        .visual-orbit { position:absolute; border:1px solid #cddaff; border-radius:50%; transform:rotate(-22deg); }
        .orbit-one { width:235px; height:105px; }
        .orbit-two { width:190px; height:165px; transform:rotate(35deg); }
        .visual-float { position:absolute; z-index:3; width:42px; height:42px; display:grid; place-items:center; background:#fff; border:1px solid #e0e8fc; border-radius:14px; box-shadow:0 8px 18px rgba(40,62,120,.1); }
        .float-book { top:28px; left:23%; transform:rotate(-10deg); }
        .float-pencil { right:20%; bottom:25px; transform:rotate(12deg); }
        .float-star { top:28px; right:22%; color:#edae3d; font-size:1.6rem; }
        @media (max-width: 760px) { .home-section-heading { align-items:start; flex-direction:column; } .home-section-heading > p { margin:0; } .home-visual { min-height:160px; } }

/* Wiskunde-module: stijlen zijn bewust binnen .math-app afgeschermd. */
.math-app {--bg:#f4f7fc;--surface:#fff;--ink:#17243a;--muted:#687891;--line:#e4eaf3;--blue:#4169e1;--blue2:#3159cf;--blue-soft:#edf2ff;--green:#0f9f83;--green-soft:#e9f8f3;--red:#d9516d;--red-soft:#fff0f3;--shadow:0 10px 28px rgba(24,43,77,.055)}
.math-app * {box-sizing:border-box}
.math-app {margin:0;background:var(--bg);color:var(--ink);font:15px/1.55 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
.math-app button,.math-app a {font:inherit}
.math-app a {color:inherit;text-decoration:none}
.math-app .hidden {display:none!important}
.math-app .topbar {position:sticky;top:0;z-index:20;background:rgba(255,255,255,.94);backdrop-filter:blur(14px);border-bottom:1px solid var(--line)}
.math-app .topbar-inner {max-width:1180px;margin:auto;min-height:72px;padding:0 22px;display:flex;align-items:center;justify-content:space-between;gap:18px}
.math-app .brand {display:flex;align-items:center;gap:12px;font-weight:850;letter-spacing:-.03em}
.math-app .brand-mark {width:40px;height:40px;border-radius:13px;background:linear-gradient(145deg,#6687f4,#3559cf);color:#fff;display:grid;place-items:center;font-size:18px;font-weight:900;box-shadow:0 6px 15px #4169e133}
.math-app .brand-name {font-size:1.08rem}
.math-app .brand-sub {display:block;color:#8794a9;font-size:.7rem;font-weight:650;letter-spacing:.02em}
.math-app .top-actions {display:flex;align-items:center;gap:12px}
.math-app .grade-pill {background:#edf2ff;color:#3559cf;border:1px solid #dce5ff;padding:6px 11px;border-radius:99px;font-size:.72rem;font-weight:850;letter-spacing:.04em}
.math-app .back-link {color:#61718b;font-weight:700;font-size:.85rem;padding:9px 12px;border-radius:10px}
.math-app .back-link:hover {background:#f3f6fc;color:#3159cf}
.math-app {max-width:1180px;margin:auto;padding:30px 22px 70px}
.math-app .hero {padding:30px 34px;display:grid;grid-template-columns:1.4fr .6fr;gap:20px;align-items:center;background:linear-gradient(112deg,#fff 0%,#f4f7ff 65%,#eaf0ff 100%);border:1px solid #e0e8fc;border-radius:22px;box-shadow:var(--shadow)}
.math-app .eyebrow {color:var(--blue);font-size:.7rem;font-weight:900;letter-spacing:.14em}
.math-app .hero h1 {font-size:clamp(2rem,4vw,2.8rem);letter-spacing:-.055em;line-height:1.08;margin:9px 0 11px}
.math-app .hero h1 span {color:var(--blue)}
.math-app .hero p {color:var(--muted);max-width:650px;margin:0}
.math-app .hero-art {min-height:155px;display:grid;place-items:center;position:relative}
.math-app .math-symbol {width:112px;height:112px;border-radius:34px;transform:rotate(-8deg);display:grid;place-items:center;background:linear-gradient(145deg,#6d8bf4,#3559cf);color:#fff;font-size:3rem;font-weight:750;box-shadow:0 18px 36px #4169e140}
.math-app .hero-chip {position:absolute;background:#fff;border:1px solid #e2e9fb;border-radius:12px;padding:8px 11px;box-shadow:0 8px 17px #253c7117;color:#536785;font-size:.78rem;font-weight:800}
.math-app .chip-one {top:12px;left:10%}
.math-app .chip-two {right:8%;bottom:11px}
.math-app .stats {display:grid;grid-template-columns:repeat(3,1fr);gap:13px;margin:18px 0 32px}
.math-app .stat {background:#fff;border:1px solid var(--line);border-radius:15px;padding:14px 17px;display:flex;align-items:center;gap:12px;box-shadow:0 5px 17px #23395e08}
.math-app .stat-icon {width:38px;height:38px;display:grid;place-items:center;border-radius:12px;background:#f0f4ff;font-size:1.1rem}
.math-app .stat strong {display:block;font-size:1.1rem}
.math-app .stat span:last-child {color:#8794a9;font-size:.76rem}
.math-app .section-head {display:flex;align-items:end;justify-content:space-between;gap:15px;margin:29px 0 14px}
.math-app .section-head h2 {font-size:1.35rem;letter-spacing:-.035em;margin:0}
.math-app .section-head p {color:#8794a9;font-size:.82rem;margin:0}
.math-app .chapter-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.math-app .chapter-card {display:block;width:100%;text-align:left;color:var(--ink);text-decoration:none;background:var(--surface);border:1px solid var(--line);border-radius:17px;padding:20px;box-shadow:0 5px 18px #23395e08;transition:.18s ease;cursor:pointer}
.math-app .chapter-card:hover,.math-app .chapter-card:focus-visible {border-color:#b9c9ff;transform:translateY(-2px);box-shadow:0 12px 28px #294a9b13;outline:none}
.math-app .chapter-top {display:flex;align-items:start;justify-content:space-between;gap:12px}
.math-app .chapter-icon {width:47px;height:47px;border-radius:14px;background:#edf2ff;color:#4169e1;display:grid;place-items:center;font-size:1.4rem;font-weight:900}
.math-app .chapter-tag {color:#77869d;background:#f5f7fb;border:1px solid #e9edf4;border-radius:99px;padding:5px 9px;font-size:.68rem;font-weight:850}
.math-app .chapter-card h3 {font-size:1.08rem;margin:14px 0 4px;letter-spacing:-.02em}
.math-app .chapter-card p {margin:0;color:#74839a;font-size:.84rem;min-height:42px}
.math-app .chapter-footer {margin-top:18px;display:flex;align-items:center;justify-content:space-between;color:#4169e1;font-weight:800;font-size:.83rem}
.math-app .chapter-footer small {font-size:.72rem;color:#9aa5b6;font-weight:650}
.math-app .quick-panel {margin-top:18px;background:#fff;border:1px solid var(--line);border-radius:17px;padding:20px 22px;display:flex;align-items:center;justify-content:space-between;gap:18px;box-shadow:0 5px 18px #23395e08}
.math-app .quick-panel h3 {font-size:1rem;margin:0 0 3px}
.math-app .quick-panel p {margin:0;color:#74839a;font-size:.82rem}
.math-app .btn {border:0;cursor:pointer;border-radius:11px;padding:11px 16px;font-weight:800;font-size:.84rem;transition:.16s ease}
.math-app .btn-primary {background:var(--blue);color:#fff;box-shadow:0 6px 14px #4169e128}
.math-app .btn-primary:hover {background:var(--blue2);transform:translateY(-1px)}
.math-app .btn-light {background:#f1f4fa;color:#5c6d87;border:1px solid #e3e9f2}
.math-app .btn-light:hover {background:#e9eef7}
.math-app .view-head {display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:18px}
.math-app .view-head h2 {margin:4px 0 0;font-size:1.6rem;letter-spacing:-.04em}
.math-app .view-head p {margin:4px 0 0;color:var(--muted);font-size:.85rem}
.math-app .practice-wrap {max-width:820px;margin:8px auto}
.math-app .practice-card {background:#fff;border:1px solid var(--line);border-radius:20px;padding:24px;box-shadow:var(--shadow)}
.math-app .practice-meta {display:flex;align-items:center;justify-content:space-between;color:#8290a6;font-size:.78rem;font-weight:750}
.math-app .progress {height:8px;border-radius:99px;background:#edf1f7;overflow:hidden;margin:13px 0 22px}
.math-app .progress>span {height:100%;display:block;background:linear-gradient(90deg,#4169e1,#86a1f7);border-radius:99px;transition:width .25s}
.math-app .question {font-size:1.2rem;line-height:1.4;letter-spacing:-.02em;font-weight:800;margin:10px 0 19px}
.math-app .math-expression {display:inline-block;background:#f5f7fc;border:1px solid #e8edf5;padding:2px 8px;border-radius:7px;font-weight:800;color:#29416d}
.math-app .answers {display:grid;gap:10px}
.math-app .answer {width:100%;text-align:left;background:#fff;border:1px solid #e2e8f1;border-radius:12px;padding:13px 14px;color:#354761;cursor:pointer;display:flex;align-items:center;gap:12px;font-weight:650;transition:.15s}
.math-app .answer:hover:not(:disabled) {border-color:#aebfff;background:#f8faff}
.math-app .answer .letter {width:28px;height:28px;border-radius:9px;display:grid;place-items:center;background:#f0f3f9;color:#7b8aa2;font-size:.75rem;font-weight:900;flex:0 0 auto}
.math-app .answer.correct {border-color:#75cfb3;background:#effaf6;color:#087e6a}
.math-app .answer.correct .letter {background:#d5f3e8;color:#087e6a}
.math-app .answer.wrong {border-color:#f0a4b3;background:#fff5f6;color:#bd3c57}
.math-app .answer.wrong .letter {background:#ffe3e8;color:#bd3c57}
.math-app .feedback {margin-top:16px;border-radius:12px;padding:14px 16px;font-size:.84rem}
.math-app .feedback.good {background:#effaf6;border:1px solid #d0f1e5;color:#087e6a}
.math-app .feedback.bad {background:#fff7f7;border:1px solid #f8dce2;color:#a43b50}
.math-app .feedback strong {display:block;margin-bottom:4px}
.math-app .practice-actions {margin-top:20px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.math-app .result-box {text-align:center;padding:30px 15px}
.math-app .result-ring {width:130px;height:130px;border:7px solid #d9e4ff;border-radius:50%;margin:0 auto 15px;display:grid;place-items:center;color:#3159cf;font-size:2.25rem;font-weight:900;background:#f7f9ff}
.math-app .result-box h2 {margin:0;font-size:1.55rem}
.math-app .result-box p {color:var(--muted);margin:7px auto 20px;max-width:450px}
.math-app .content-grid {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.math-app .info-card {background:#fff;border:1px solid var(--line);border-radius:16px;padding:20px;box-shadow:0 4px 14px #23395e07}
.math-app .info-card h3 {margin:0 0 7px;font-size:1rem}
.math-app .info-card p,.math-app .info-card li {color:#667891;font-size:.85rem}
.math-app .formula {margin:11px 0;padding:13px 15px;border-radius:11px;background:#f2f5ff;color:#294fae;font-size:1.03rem;font-weight:850;letter-spacing:.01em}
.math-app .steps {padding-left:19px;margin:10px 0}
.math-app .video-list {display:grid;gap:10px}
.math-app .video-link {display:flex;align-items:center;justify-content:space-between;gap:14px;padding:14px 16px;background:#fff;border:1px solid var(--line);border-radius:12px;font-weight:750;font-size:.86rem}
.math-app .video-link:hover {border-color:#b9c9ff;color:#3159cf}
.math-app .video-link span {color:#8b98ab;font-size:.75rem;font-weight:650}
.math-app .site-footer {text-align:center;color:#9aa5b6;font-size:.75rem;border-top:1px solid var(--line);padding:21px}
.math-app .muted-note {color:#8a97aa;font-size:.77rem;margin-top:11px}
.math-app .toast {position:fixed;right:22px;bottom:20px;background:#1f2e49;color:#fff;border-radius:11px;padding:11px 15px;box-shadow:0 8px 22px #1b2f5730;font-size:.82rem;z-index:50}
@media (max-width:760px) {
.math-app .hero {grid-template-columns:1fr;padding:23px}
.math-app .hero-art {min-height:125px}
.math-app .stats {grid-template-columns:1fr}
.math-app .chapter-grid,.math-app .content-grid {grid-template-columns:1fr}
.math-app .section-head,.math-app .view-head {align-items:start;flex-direction:column}
.math-app .quick-panel {align-items:start;flex-direction:column}
.math-app .topbar-inner {padding:0 14px}
.math-app .grade-pill {display:none}
.math-app {padding:20px 14px 55px}
}

/* =====================================================================
   STUDYHUB DARK MODE — shared visual language for every subject
   ===================================================================== */
:root {
    color-scheme: dark;
    --bg-main: #0b1220;
    --bg-card: #151f32;
    --bg-card-dark: #0a1120;
    --bg-input: #0d1728;
    --border-color: #2b3950;
    --border-light: #40516b;
    --text-main: #f1f5f9;
    --text-muted: #a5b2c5;
    --text-dim: #718198;
    --emerald: #34d399;
    --emerald-dark: #059669;
    --emerald-bg: rgba(52, 211, 153, .12);
    --blue: #6d8cff;
    --blue-dark: #496df0;
    --blue-bg: rgba(109, 140, 255, .14);
    --purple: #b69aff;
    --purple-dark: #8b68e8;
    --purple-bg: rgba(182, 154, 255, .13);
    --amber: #fbbf24;
    --amber-dark: #d99113;
    --amber-bg: rgba(251, 191, 36, .13);
    --rose: #fb7185;
    --rose-bg: rgba(251, 113, 133, .13);
    --brand: #6d8cff;
    --brand-dark: #496df0;
    --brand-soft: rgba(109, 140, 255, .14);
}
html, body { background: var(--bg-main) !important; color: var(--text-main) !important; }
body { background-image: radial-gradient(ellipse at 12% 0%, rgba(65,105,225,.09), transparent 32%), radial-gradient(ellipse at 95% 18%, rgba(16,185,129,.045), transparent 28%); }
header { background: rgba(13, 22, 38, .94) !important; border-bottom: 1px solid var(--border-color) !important; box-shadow: 0 6px 26px rgba(0,0,0,.22) !important; }
.brand-title, .home-title, .home-section-title, .home-stat strong { color: #f8fafc !important; }
.brand-sub, .home-stat span, .home-section-heading > p { color: var(--text-muted) !important; }
.study-pill { background: rgba(109,140,255,.13) !important; border-color: rgba(109,140,255,.32) !important; color: #a9bbff !important; }
.nav-tab-btn { color: #b8c5d8 !important; background: #172338 !important; border-color: #2c3a51 !important; }
.nav-tab-btn:hover { color: #fff !important; background: #202f49 !important; border-color: #536b94 !important; }
.nav-tab-btn.active { color: #fff !important; background: linear-gradient(135deg,#496df0,#627df5) !important; border-color: #6d8cff !important; box-shadow: 0 5px 16px rgba(73,109,240,.24) !important; }
.panel, .test-card, .home-stat { background: #151f32 !important; border-color: var(--border-color) !important; color: var(--text-main); box-shadow: 0 10px 28px rgba(0,0,0,.18) !important; }
.panel h2, .panel h3, .test-card h3, h2, h3 { color: #f1f5f9 !important; }
.subtitle, .card-desc { color: #a5b2c5 !important; }
.home-hero { background: linear-gradient(115deg,#172338 0%,#121e32 64%,#18284a 100%) !important; border-color: #2b3c5b !important; box-shadow: 0 14px 36px rgba(0,0,0,.22) !important; }
.home-title span { color: #8da6ff !important; }
.home-kicker, .section-eyebrow { color: #8da6ff !important; }
.home-copy { color: #b6c3d6 !important; }
.home-visual { border-color: #30466e !important; background: radial-gradient(circle at 50% 50%,#223458,#111d31 70%) !important; }
.visual-orbit { border-color: rgba(141,166,255,.28) !important; }
.visual-float { background: #1c2b44 !important; border-color: #354967 !important; box-shadow: 0 8px 18px rgba(0,0,0,.26) !important; }
.home-hero-meta span { background: #1a2941 !important; border-color: #344766 !important; color: #c3cfe0 !important; }
.subject-card, .subject-card.featured { background: #151f32 !important; border-color: #2b3950 !important; }
.subject-card-link { color: var(--text-main) !important; }
.subject-card-link:hover, .subject-card-link:focus-visible { border-color: #6d8cff !important; box-shadow: 0 0 0 3px rgba(109,140,255,.12), 0 14px 30px rgba(0,0,0,.3) !important; }
.geo-icon { background: rgba(52,211,153,.14) !important; }
.math-icon { color: #a9bbff !important; background: rgba(109,140,255,.16) !important; }
.physics-icon { background: rgba(182,154,255,.14) !important; }
.subject-level { color: #91a0b8 !important; }
.card-open-hint { background: linear-gradient(90deg,#496df0,#6b86f4) !important; color: #fff !important; }
.math-open-hint { background: linear-gradient(90deg,#3f61d6,#687ff0) !important; }
.coming-soon { opacity: .72; background: #111b2d !important; border-color: #34425a !important; }
.coming-soon-label { color: #9aa9c0 !important; background: #1a2840 !important; }
.tag-emerald { color: #65e6bb !important; background: rgba(52,211,153,.12) !important; border-color: rgba(52,211,153,.27) !important; }
.tag-blue { color: #a9bbff !important; background: rgba(109,140,255,.13) !important; border-color: rgba(109,140,255,.3) !important; }
.tag-purple { color: #c7b3ff !important; background: rgba(182,154,255,.13) !important; border-color: rgba(182,154,255,.28) !important; }
.tag-amber { color: #fbd477 !important; background: rgba(251,191,36,.12) !important; border-color: rgba(251,191,36,.28) !important; }
.btn-secondary { color: #d5deeb !important; background: #202e45 !important; border-color: #3a4b65 !important; }
.btn-secondary:hover:not(:disabled) { background: #2a3b57 !important; color: #fff !important; }
.btn-emerald, .btn-gradient { background: linear-gradient(100deg,#496df0,#657ff3) !important; color: #fff !important; }
.btn-blue { background: #3978de !important; color: #fff !important; }
.btn-purple { background: #7958cf !important; color: #fff !important; }
select, input[type="text"], textarea { background: #0d1728 !important; color: #edf3fb !important; border-color: #35445e !important; }
select:focus, input[type="text"]:focus, textarea:focus { border-color: #7892ff !important; }
.question-text { color: #f1f5f9 !important; }
.mc-option { color: #dce5f2 !important; background: #101b2d !important; border-color: #34435b !important; }
.mc-option:hover { background: #1a2941 !important; border-color: #627dbf !important; }
.mc-option.selected { background: rgba(109,140,255,.15) !important; color: #c2d0ff !important; border-color: #7892ff !important; }
.mc-letter { background: #263650 !important; color: #bac8dc !important; }
.mc-option.selected .mc-letter { background: #5d7df0 !important; color: white !important; }
.q-pill { background: #101b2d !important; color: #9cacbf !important; border-color: #34435b !important; }
.q-pill.answered { background: rgba(52,211,153,.12) !important; color: #65e6bb !important; border-color: #279b7a !important; }
.q-pill.current { background: #5d7df0 !important; color: #fff !important; border-color: #8da6ff !important; }
.progress-track { background: #0b1526 !important; }
.progress-fill { background: linear-gradient(90deg,#5577f1,#8ca4ff) !important; }
.timer-badge { background: rgba(251,191,36,.12) !important; color: #fbd477 !important; border-color: #9b7629 !important; }
.grade-circle { background: #101b2d !important; border-color: #5577f1 !important; box-shadow: 0 0 28px rgba(86,119,241,.16) !important; }
.grade-number { color: #f8fafc !important; }
.stat-box { background: #101b2d !important; border-color: #34435b !important; }
.stat-val { color: #f1f5f9 !important; }
.stat-lbl { color: #9cacbf !important; }
.review-card, .user-answer-box { background: #101b2d !important; border-color: #34435b !important; }
.user-answer-box { color: #d0daea !important; }
.flashcard-front { background: #172338 !important; border-color: #34435b !important; }
.flashcard-back { background: #101b2d !important; border-color: #5577f1 !important; }
.fc-term, .fc-def { color: #eef3fb !important; }
.diagram-box { background: #101b2d !important; border-color: #34435b !important; }
table.geo-table th { background: #1b2b44 !important; color: #a9bbff !important; }
table.geo-table td { color: #d0daea !important; }
table.geo-table th, table.geo-table td { border-color: #34435b !important; }
.toast { background: #172338 !important; color: #f1f5f9 !important; border-color: #856b32 !important; }
footer { color: #8191a9 !important; border-top-color: #29384f !important; }

/* Math section follows the same dark card and button language as Geography. */
.math-app {
    --bg: #0b1220;
    --surface: #151f32;
    --ink: #f1f5f9;
    --muted: #a5b2c5;
    --line: #2b3950;
    --blue: #6d8cff;
    --blue2: #496df0;
    --blue-soft: rgba(109,140,255,.14);
    --green: #34d399;
    --green-soft: rgba(52,211,153,.12);
    --red: #fb7185;
    --red-soft: rgba(251,113,133,.12);
    --shadow: 0 10px 28px rgba(0,0,0,.2);
    max-width: 1200px;
    padding: 24px 0 56px;
    margin: 0 auto;
    background: transparent !important;
    color: var(--ink) !important;
}
.math-app .hero { background: linear-gradient(115deg,#172338 0%,#121e32 64%,#18284a 100%) !important; border-color: #2b3c5b !important; box-shadow: var(--shadow) !important; border-radius: 18px; }
.math-app .hero h1, .math-app .section-head h2, .math-app .view-head h2, .math-app .quick-panel h3, .math-app .info-card h3, .math-app .result-box h2 { color: #f1f5f9 !important; }
.math-app .hero h1 span { color: #8da6ff !important; }
.math-app .hero p, .math-app .section-head p, .math-app .view-head p, .math-app .quick-panel p, .math-app .info-card p, .math-app .info-card li { color: #a5b2c5 !important; }
.math-app .eyebrow { color: #8da6ff !important; }
.math-app .math-symbol { background: linear-gradient(145deg,#617ff0,#344fc1) !important; }
.math-app .hero-chip { background: #1d2b43 !important; border-color: #394b69 !important; color: #d6e0f0 !important; box-shadow: 0 8px 17px rgba(0,0,0,.24) !important; }
.math-app .stat, .math-app .chapter-card, .math-app .quick-panel, .math-app .practice-card, .math-app .info-card, .math-app .video-link { background: #151f32 !important; border-color: #2b3950 !important; color: #e7eef8 !important; box-shadow: 0 8px 24px rgba(0,0,0,.18) !important; }
.math-app .stat strong, .math-app .chapter-card h3 { color: #f1f5f9 !important; }
.math-app .stat span:last-child, .math-app .chapter-card p, .math-app .chapter-footer small, .math-app .muted-note { color: #9eacc1 !important; }
.math-app .stat-icon, .math-app .chapter-icon { background: rgba(109,140,255,.15) !important; color: #a9bbff !important; }
.math-app .chapter-tag { color: #aebbd0 !important; background: #202e45 !important; border-color: #3a4b65 !important; }
.math-app .chapter-footer { color: #9bb0ff !important; }
.math-app .chapter-grid { grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap: 18px; }
.math-app .chapter-card { min-height: 230px; display: flex; flex-direction: column; justify-content: space-between; border-radius: 18px; }
.math-app .chapter-card:hover, .math-app .chapter-card:focus-visible { border-color: #718cff !important; box-shadow: 0 0 0 3px rgba(109,140,255,.1), 0 14px 30px rgba(0,0,0,.26) !important; }
.math-app .quick-panel { border-radius: 18px; }
.math-app .btn-primary { background: linear-gradient(100deg,#496df0,#657ff3) !important; color: #fff !important; box-shadow: 0 6px 14px rgba(73,109,240,.25) !important; }
.math-app .btn-primary:hover { background: linear-gradient(100deg,#5a7bf5,#7790ff) !important; }
.math-app .btn-light { background: #202e45 !important; color: #d5deeb !important; border: 1px solid #3a4b65 !important; }
.math-app .btn-light:hover { background: #2a3b57 !important; color: #fff !important; }
.math-app .practice-meta { color: #a5b2c5 !important; }
.math-app .progress { background: #0b1526 !important; }
.math-app .progress > span { background: linear-gradient(90deg,#5577f1,#8ca4ff) !important; }
.math-app .question { color: #f1f5f9 !important; }
.math-app .answer { background: #101b2d !important; border-color: #34435b !important; color: #dce5f2 !important; }
.math-app .answer:hover:not(:disabled) { background: #1a2941 !important; border-color: #627dbf !important; }
.math-app .answer .letter { background: #263650 !important; color: #bac8dc !important; }
.math-app .answer.correct { border-color: #279b7a !important; background: rgba(52,211,153,.13) !important; color: #75e8c0 !important; }
.math-app .answer.correct .letter { background: #17654f !important; color: #fff !important; }
.math-app .answer.wrong { border-color: #a6465a !important; background: rgba(251,113,133,.12) !important; color: #ff9cad !important; }
.math-app .answer.wrong .letter { background: #633041 !important; color: #fff !important; }
.math-app .feedback.good { background: rgba(52,211,153,.1) !important; border-color: rgba(52,211,153,.35) !important; color: #9aefd2 !important; }
.math-app .feedback.bad { background: rgba(251,113,133,.1) !important; border-color: rgba(251,113,133,.32) !important; color: #ffb2bf !important; }
.math-app .result-ring { background: #101b2d !important; color: #a9bbff !important; border-color: #405baf !important; }
.math-app .formula { background: rgba(109,140,255,.13) !important; border: 1px solid rgba(109,140,255,.25) !important; color: #bdcaff !important; }
.math-app .video-link { color: #dce5f2 !important; }
.math-app .video-link:hover { border-color: #718cff !important; color: #a9bbff !important; }
.math-app .video-link span { color: #9eacc1 !important; }
.math-app .toast { background: #172338 !important; color: #f1f5f9 !important; border: 1px solid #3a4b65 !important; }
body.math-open .nav-tab-btn.math-nav { display: inline-flex; }
body.math-open .nav-tab-btn.subject-nav { display: none; }
body.subject-open:not(.math-open) .nav-tab-btn.subject-nav { display: inline-flex; }
body.subject-open:not(.math-open) .nav-tab-btn.math-nav { display: none; }
@media (max-width: 760px) {
    .math-app { padding: 18px 0 44px; }
    .math-app .chapter-grid { grid-template-columns: 1fr; }
    .header-inner { align-items: flex-start; }
    header nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 3px; }
    header nav .nav-tab-btn { white-space: nowrap; }
}

/* Wiskunde oefentoets-generator: dezelfde formulieropbouw als Aardrijkskunde. */
.math-app .math-generator-panel { background:#151f32 !important; border:1px solid #2b3950 !important; color:#e7eef8 !important; box-shadow:0 10px 28px rgba(0,0,0,.2) !important; }
.math-app .math-generator-panel .panel-header { margin-bottom:22px; }
.math-app .math-generator-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; margin:20px 0 16px; }
.math-app .math-generator-fields label { display:block; color:#dce5f2; font-size:.86rem; font-weight:750; margin-bottom:7px; }
.math-app .math-generator-fields select { width:100%; min-height:44px; background:#0f192b !important; color:#e7eef8 !important; border:1px solid #34435b !important; border-radius:11px; padding:10px 12px; font:inherit; }
.math-app .math-generator-fields select:focus { outline:2px solid rgba(109,140,255,.45); border-color:#718cff !important; }
.math-app .math-generator-note { margin:14px 0 18px; padding:13px 15px; background:rgba(109,140,255,.09); border:1px solid rgba(109,140,255,.24); border-radius:12px; color:#b7c5da; font-size:.82rem; line-height:1.55; }
.math-app .math-generator-note strong { display:block; color:#dce5f2; margin-bottom:3px; }
.math-app .math-generator-panel .btn-amber { background:linear-gradient(100deg,#d99a2b,#f0b44f) !important; color:#172033 !important; border:0 !important; font-weight:850; }
.math-app .math-generator-panel .btn-amber:hover:not(:disabled) { filter:brightness(1.08); }
.math-app .math-generator-panel .btn-amber:disabled { opacity:.6; cursor:wait; }
.math-app .math-generator-loading { text-align:center; padding:22px 0 8px; color:#edbd63; }
.math-app .math-generator-loading p { margin:5px 0 2px; font-size:.9rem; font-weight:800; }
.math-app .math-generator-loading span { color:#9eacc1; font-size:.78rem; }
.math-app .math-generator-loading .spinner { width:34px; height:34px; border:3px solid rgba(245,158,11,.18); border-top-color:#f0b44f; border-radius:50%; animation:spin .8s linear infinite; margin:0 auto; }
.math-app .math-generator-footnote { margin:13px 0 0; color:#9eacc1; font-size:.78rem; text-align:center; }
@media(max-width:640px){.math-app .math-generator-fields{grid-template-columns:1fr}.math-app .math-generator-panel{padding:20px 16px}}


/* StudyHub PWA install button */
.install-app-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    min-height: 38px; padding: .55rem .9rem; border-radius: 11px;
    border: 1px solid rgba(109,140,255,.5);
    background: linear-gradient(135deg,#496df0,#627df5); color: #fff;
    box-shadow: 0 5px 15px rgba(73,109,240,.2);
    font: inherit; font-size: .84rem; font-weight: 800; cursor: pointer;
    white-space: nowrap; transition: transform .18s ease, filter .18s ease;
}
.install-app-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.install-app-btn:focus-visible { outline: 3px solid rgba(109,140,255,.42); outline-offset: 2px; }
.install-app-btn:disabled { opacity: .75; cursor: default; transform: none; }
@media (max-width: 760px) {
    .install-app-btn { flex: 0 0 auto; }
}
.install-app-btn[hidden] { display: none !important; }


/* ================================================================
   STUDYHUB DARK MODE · unified dashboard, subjects and summaries
   ================================================================ */
:root {
  color-scheme: dark;
  --bg-main: #0b1220;
  --bg-card: #172338;
  --bg-card-dark: #0c1628;
  --bg-input: #101c30;
  --border-color: #2a3a52;
  --border-light: #425570;
  --text-main: #eef4ff;
  --text-muted: #a4b2c8;
  --text-dim: #71829d;
  --emerald: #34d6a0;
  --emerald-dark: #0d9f76;
  --emerald-bg: rgba(52,214,160,.12);
  --blue: #6f95ff;
  --blue-dark: #4169e1;
  --blue-bg: rgba(111,149,255,.14);
  --purple: #b18aff;
  --purple-dark: #8055d8;
  --purple-bg: rgba(177,138,255,.14);
  --amber: #f6bf5c;
  --amber-dark: #c88723;
  --amber-bg: rgba(246,191,92,.13);
  --rose: #ff7b96;
  --rose-bg: rgba(255,123,150,.13);
  --brand: #6f95ff;
  --brand-dark: #4169e1;
  --brand-soft: rgba(111,149,255,.14);
}
body { background: var(--bg-main) !important; color: var(--text-main) !important; }
header { background: rgba(12,22,40,.94) !important; border-bottom: 1px solid var(--border-color) !important; box-shadow: 0 5px 22px rgba(0,0,0,.24) !important; }
.brand-title { color: #f5f8ff !important; }
.brand-sub { color: var(--text-muted) !important; }
.study-pill { color: #a9c0ff !important; background: rgba(111,149,255,.12) !important; border-color: rgba(111,149,255,.3) !important; }
.nav-tab-btn { color: #b5c2d8 !important; background: #172338 !important; border-color: #30425d !important; }
.nav-tab-btn:hover { color: #fff !important; border-color: #6688db !important; background: #1b2b45 !important; }
.nav-tab-btn.active { background: #4169e1 !important; border-color: #6688f1 !important; color: #fff !important; box-shadow: 0 5px 18px rgba(65,105,225,.25) !important; }
main { color: var(--text-main) !important; }
.panel, .test-card, .home-stat, .stat-box, .review-card, .user-answer-box { background: var(--bg-card) !important; color: var(--text-main) !important; border-color: var(--border-color) !important; box-shadow: 0 10px 26px rgba(0,0,0,.22) !important; }
.panel h2, .panel h3, .test-card h3, h2, h3, .home-section-title { color: #f2f6ff !important; }
.subtitle, .card-desc, .home-copy, .home-section-heading > p { color: var(--text-muted) !important; }
.home-hero { background: radial-gradient(circle at 90% 12%, rgba(52,214,160,.14), transparent 34%), linear-gradient(120deg,#17263c 0%,#101c30 68%,#14233b 100%) !important; border-color: rgba(52,214,160,.24) !important; }
.home-title { color: #f3f7ff !important; }
.home-title span { color: #63dcb3 !important; }
.home-kicker, .section-eyebrow { color: #57d8ad !important; }
.home-copy { color: #c3cee0 !important; }
.home-visual { border-color: #2d4560 !important; background: radial-gradient(circle at 50% 50%,#1d3150,#101a2d 68%) !important; }
.home-stat strong { color: #fff !important; }
.home-stat span { color: var(--text-muted) !important; }
.home-hero-meta span { border-color: #30445f !important; background: #17263c !important; color: #b6c6dc !important; }
.visual-orbit { border-color: #405a80 !important; }
.visual-float { background: #1c2c44 !important; border-color: #39506f !important; }
.subject-card-link { border-color: #2b3e59 !important; background: #172338 !important; }
.subject-card-link:hover, .subject-card-link:focus-visible { border-color: #6688db !important; box-shadow: 0 12px 30px rgba(0,0,0,.28) !important; }
.subject-card.featured { background: #172338 !important; border-color: #38517b !important; }
.geo-icon { background: rgba(52,214,160,.14) !important; }
.math-icon { color: #b3c6ff !important; background: rgba(111,149,255,.16) !important; }
.physics-icon { background: rgba(177,138,255,.15) !important; }
.subject-level { color: #8495b1 !important; }
.card-open-hint { color: #061c18 !important; background: linear-gradient(90deg,#19ad84,#39d6a4) !important; }
.math-open-hint { color: #fff !important; background: linear-gradient(90deg,#4169e1,#6f95ff) !important; }
.coming-soon { background: #141f32 !important; border-color: #34455e !important; }
.coming-soon-label { color: #9aabc4 !important; background: #1b2940 !important; }
.btn-secondary { background: #24344c !important; color: #dbe6f7 !important; border: 1px solid #3b506e !important; }
.btn-secondary:hover:not(:disabled) { background: #2c405e !important; color: #fff !important; }
select, input[type="text"], textarea { background: #101c30 !important; color: #eef4ff !important; border-color: #3b506e !important; }
select:focus, input[type="text"]:focus, textarea:focus { border-color: #6f95ff !important; }
.question-text { color: #f5f8ff !important; }
.mc-option { background: #101c30 !important; color: #e9f0fc !important; border-color: #344861 !important; }
.mc-option:hover { background: #172944 !important; border-color: #6688db !important; }
.mc-option.selected { background: rgba(52,214,160,.13) !important; color: #83e9c6 !important; border-color: #34d6a0 !important; }
.mc-letter { background: #24344c !important; color: #b3c2d8 !important; }
.mc-option.selected .mc-letter { background: #34d6a0 !important; color: #09251c !important; }
.q-pill { background: #101c30 !important; color: #a4b2c8 !important; border-color: #344861 !important; }
.q-pill.answered { background: rgba(52,214,160,.14) !important; color: #60dfb5 !important; border-color: #34d6a0 !important; }
.q-pill.current { background: #4169e1 !important; color: #fff !important; }
.progress-track { background: #0b1628 !important; }
.progress-fill { background: linear-gradient(90deg,#4169e1,#34d6a0) !important; }
.timer-badge { background: rgba(246,191,92,.12) !important; color: #ffd27c !important; border-color: rgba(246,191,92,.45) !important; }
.grade-circle { background: #101c30 !important; }
.grade-number { color: #f4f7ff !important; }
.stat-box { background: #101c30 !important; }
.stat-val { color: #f4f7ff !important; }
.stat-lbl { color: var(--text-muted) !important; }
.flashcard-front { background: #172338 !important; border-color: #344861 !important; }
.flashcard-back { background: #101c30 !important; border-color: #34d6a0 !important; }
.fc-term { color: #f2f6ff !important; }
.fc-def { color: #cfdaeb !important; }
.diagram-box { background: #101c30 !important; border-color: #344861 !important; }
table.geo-table th { background: #1d2d45 !important; color: #61dcb5 !important; }
table.geo-table td { color: #d7e1ef !important; }
table.geo-table th, table.geo-table td { border-color: #344861 !important; }
.toast { background: #1a2940 !important; color: #f3f7ff !important; border-color: #dba94d !important; }
footer { color: #7587a3 !important; border-top-color: #283a54 !important; }

/* Generator cards and expandable summaries */
.subject-intro-panel { background: linear-gradient(125deg,#17263d,#111e32) !important; }
.subject-action-row { display:flex;flex-wrap:wrap;gap:.7rem;margin-top:1.2rem; }
.section-headline-row { display:flex;align-items:end;justify-content:space-between;gap:1rem;margin:1.6rem 0 .8rem; }
.section-headline-row h3 { margin:0;color:#f2f6ff; }
.section-headline-row p { margin:0;color:var(--text-muted);font-size:.82rem; }
.topic-emoji { font-size:1.2rem; }
.generator-panel { background:linear-gradient(145deg,#17253b,#111d31) !important; }
.generator-fields { display:flex;flex-direction:column;gap:1rem;margin-top:1.25rem; }
.generator-fields label { display:block;font-size:.84rem;font-weight:750;color:#d9e4f3;margin-bottom:.4rem; }
.generator-fields select { width:100%; }
.generator-two-col { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem; }
.generator-note { display:flex;flex-direction:column;gap:.35rem;padding:1rem 1.1rem;border:1px solid #344861;border-radius:13px;background:#101c30;color:#b6c5da;font-size:.84rem; }
.generator-note strong { color:#f2f6ff; }
.generator-loading { text-align:center;padding:1.5rem 0;color:#dce6f5; }
.generator-loading p { font-weight:750;color:#f5c86b; }
.generator-loading span,.generator-footnote { color:var(--text-muted);font-size:.8rem; }
.summary-intro { margin:1.6rem 0 .8rem; }
.summary-intro h3 { color:#f4f7ff;margin:.15rem 0 .3rem; }
.summary-accordion-list { display:grid;gap:.75rem;margin:0 0 1.7rem; }
.summary-accordion { overflow:hidden;background:#172338;border:1px solid #30435d;border-radius:15px;box-shadow:0 7px 20px rgba(0,0,0,.16); }
.summary-accordion > summary { list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:1rem 1.15rem;color:#eff4ff;font-size:.96rem;font-weight:750; }
.summary-accordion > summary::-webkit-details-marker { display:none; }
.summary-accordion > summary b { display:inline-block;color:#66dcb7;background:rgba(52,214,160,.12);border:1px solid rgba(52,214,160,.24);border-radius:8px;padding:.22rem .48rem;margin-right:.55rem;font-size:.76rem; }
.summary-accordion > summary small { display:inline-block;margin-left:.55rem;color:#8ea0bb;font-weight:550;font-size:.75rem; }
.summary-accordion[open] > summary { border-bottom:1px solid #30435d;background:#1b2b43; }
.summary-chevron { color:#95a8c5;font-size:1.1rem;transition:transform .18s ease; }
.summary-accordion[open] .summary-chevron { transform:rotate(180deg); }
.summary-content { padding:1rem 1.2rem 1.25rem;color:#c2cee0;font-size:.88rem;line-height:1.7; }
.summary-content p { margin:.2rem 0 .75rem; }
.summary-content ul { padding-left:1.2rem;margin:.5rem 0 .2rem; }
.summary-content li { margin:.35rem 0; }
.summary-content h4 { color:#e7effc;font-size:.92rem;margin:1rem 0 .2rem; }
.summary-content h4:first-child { margin-top:0; }
.summary-content b { color:#f4f7ff; }
.formula { background:#0c182a !important;border-color:#354b69 !important;color:#91b0ff !important; }
.math-generator-note { background:#101c30 !important;border-color:#354b69 !important;color:#c2cee0 !important; }
.math-generator-note strong { color:#f4f7ff !important; }
@media (max-width: 700px) {
  .generator-two-col { grid-template-columns:1fr; }
  .section-headline-row { align-items:start;flex-direction:column; }
  .subject-action-row .btn { flex:1 1 100%; }
  .summary-accordion > summary { align-items:flex-start; }
  .summary-accordion > summary small { display:block;margin:.3rem 0 0; }
}

/* Wiskunde module: match the same premium dark palette as the shared header. */
.math-app {
  --bg:#0b1220;--surface:#172338;--ink:#eef4ff;--muted:#a4b2c8;--line:#2a3a52;
  --blue:#6f95ff;--blue2:#4169e1;--blue-soft:rgba(111,149,255,.14);
  --green:#34d6a0;--green-soft:rgba(52,214,160,.13);--red:#ff7b96;--red-soft:rgba(255,123,150,.13);
  --shadow:0 10px 28px rgba(0,0,0,.24);
  color:var(--ink) !important;background:var(--bg) !important;
}
.math-app .topbar { background:rgba(12,22,40,.94) !important;border-color:var(--line) !important; }
.math-app .brand-name,.math-app .hero h1,.math-app .section-head h2,.math-app .chapter-card h3,.math-app .quick-panel h3,.math-app .view-head h2,.math-app .question,.math-app .info-card h3 { color:#f2f6ff !important; }
.math-app .brand-sub,.math-app .hero p,.math-app .section-head p,.math-app .chapter-card p,.math-app .quick-panel p,.math-app .view-head p,.math-app .muted-note { color:var(--muted) !important; }
.math-app .grade-pill { background:rgba(111,149,255,.14) !important;color:#b9cbff !important;border-color:#344a72 !important; }
.math-app .back-link { color:#b8c7dc !important; }
.math-app .back-link:hover { background:#20314a !important;color:#fff !important; }
.math-app .hero { background:radial-gradient(circle at 86% 16%,rgba(111,149,255,.15),transparent 35%),linear-gradient(115deg,#17263d,#111d31) !important;border-color:#30435e !important; }
.math-app .hero h1 span { color:#88a7ff !important; }
.math-app .hero-chip { background:#1d2d45 !important;border-color:#39506f !important;color:#c4d2e6 !important; }
.math-app .math-symbol { background:linear-gradient(145deg,#6687f4,#3559cf) !important; }
.math-app .stat,.math-app .chapter-card,.math-app .quick-panel,.math-app .practice-card,.math-app .info-card,.math-app .video-link { background:var(--surface) !important;border-color:var(--line) !important;color:var(--ink) !important;box-shadow:var(--shadow) !important; }
.math-app .stat-icon,.math-app .chapter-icon { background:rgba(111,149,255,.14) !important;color:#a9c1ff !important; }
.math-app .chapter-tag { background:#21314a !important;color:#aabbd2 !important;border-color:#364963 !important; }
.math-app .chapter-footer { color:#8eaeff !important; }
.math-app .chapter-footer small { color:#8b9db7 !important; }
.math-app .chapter-card:hover,.math-app .chapter-card:focus-visible { border-color:#6f95ff !important;box-shadow:0 12px 28px rgba(0,0,0,.3) !important; }
.math-app .quick-panel { background:linear-gradient(120deg,#172944,#172338) !important; }
.math-app .btn-light { background:#24344c !important;color:#dbe6f7 !important;border-color:#3b506e !important; }
.math-app .btn-light:hover { background:#2c405e !important; }
.math-app .practice-meta { color:#a7b5ca !important; }
.math-app .progress { background:#0d192b !important; }
.math-app .question { color:#f3f7ff !important; }
.math-app .answer { background:#101c30 !important;border-color:#344861 !important;color:#dfe8f6 !important; }
.math-app .answer:hover:not(:disabled) { background:#1a2b43 !important;border-color:#6f95ff !important; }
.math-app .answer .letter { background:#263852 !important;color:#b6c6dc !important; }
.math-app .answer.correct { background:rgba(52,214,160,.13) !important;color:#8aebcb !important;border-color:#34d6a0 !important; }
.math-app .answer.correct .letter { background:rgba(52,214,160,.2) !important;color:#8aebcb !important; }
.math-app .answer.wrong { background:rgba(255,123,150,.12) !important;color:#ff9aae !important;border-color:#ff7b96 !important; }
.math-app .feedback { background:#101c30 !important;color:#d9e5f4 !important;border-color:#344861 !important; }
.math-app .feedback.good { background:rgba(52,214,160,.1) !important;border-color:rgba(52,214,160,.4) !important; }
.math-app .feedback.bad { background:rgba(255,123,150,.1) !important;border-color:rgba(255,123,150,.4) !important; }
.math-app .result-box h2 { color:#f2f6ff !important; }
.math-app .result-box p { color:var(--muted) !important; }
.math-app .info-card p,.math-app .steps { color:#c2cee0 !important; }
.math-app .formula { background:#0c182a !important;border-color:#354b69 !important;color:#91b0ff !important; }
.math-app .video-link span { color:#91adff !important; }
.math-app .math-generator-panel { background:linear-gradient(145deg,#17253b,#111d31) !important; }
.math-app .math-generator-fields label { color:#d9e4f3 !important; }
.math-app .math-generator-fields select { background:#101c30 !important;color:#eef4ff !important;border-color:#3b506e !important; }
.math-app .math-generator-note { background:#101c30 !important;border-color:#354b69 !important;color:#c2cee0 !important; }
.math-app .math-generator-note strong { color:#f4f7ff !important; }
.math-app .math-generator-footnote { color:var(--muted) !important; }
.math-app .math-summary-area { margin-top:1.6rem; }
.math-app .summary-accordion { background:#172338 !important;border-color:#30435d !important; }
.math-app .summary-accordion > summary { color:#eff4ff !important; }
.math-app .summary-accordion[open] > summary { background:#1b2b43 !important;border-color:#30435d !important; }
.math-app .summary-content { color:#c2cee0 !important; }
.math-app .summary-content h4 { color:#e7effc !important; }
.math-app .summary-content b { color:#f4f7ff !important; }
.math-app .toast { background:#1a2940 !important;color:#f3f7ff !important;border-color:#3b506e !important; }
@media (max-width: 680px) { .math-app .hero { grid-template-columns:1fr !important; } .math-app .stats { grid-template-columns:1fr !important; } .math-app .chapter-grid { grid-template-columns:1fr !important; } .math-app .quick-panel { align-items:stretch !important;flex-direction:column !important; } }

/* ======================================================================
   SIGN IN, ACCOUNT SETTINGS, INVENTORY AND VIP
   ====================================================================== */
body:not(.app-ready) > header,
body:not(.app-ready) > main,
body:not(.app-ready) > footer { display:none !important; }
.auth-screen { position:fixed;inset:0;z-index:1000;display:grid;place-items:center;overflow-y:auto;padding:1.25rem;background:radial-gradient(circle at 12% 10%,rgba(16,185,129,.13),transparent 32%),radial-gradient(circle at 90% 90%,rgba(59,130,246,.13),transparent 34%),#07111f; }
.auth-screen[hidden] { display:none !important; }
.auth-screen.auth-overlay { background:rgba(3,8,16,.82);backdrop-filter:blur(12px); }
.auth-card { width:min(100%,480px);padding:clamp(1.25rem,4vw,2.2rem);border:1px solid #34445e;border-radius:24px;background:linear-gradient(160deg,#1b2a40,#101b2d 70%);box-shadow:0 25px 90px rgba(0,0,0,.48); }
.auth-brand { display:flex;align-items:center;gap:.8rem;margin-bottom:2rem; }
.auth-welcome { margin-bottom:1.4rem; }
.auth-welcome h1 { color:#fff;font-size:clamp(2rem,7vw,2.65rem);line-height:1.08;margin:.45rem 0 .75rem;font-weight:900;letter-spacing:-.04em; }
.auth-welcome h1 span { color:#55d6ad; }
.auth-welcome p { color:#aebbd0;font-size:.92rem;line-height:1.65; }
.auth-google-btn { display:flex;align-items:center;justify-content:center;gap:.8rem;width:100%;padding:.9rem 1rem;border:1px solid #50617a;border-radius:12px;background:#f8fafc;color:#182235;font:700 .95rem inherit;cursor:pointer;transition:transform .18s,box-shadow .18s; }
.auth-google-btn:hover { transform:translateY(-1px);box-shadow:0 8px 22px rgba(0,0,0,.18); }
.google-g { display:grid;place-items:center;width:25px;height:25px;border-radius:50%;background:#fff;color:#4285f4;font-size:1.05rem;font-weight:900; }
.auth-divider { display:flex;align-items:center;gap:.8rem;color:#8291a9;font-size:.78rem;margin:1.1rem 0; }
.auth-divider:before,.auth-divider:after { content:"";height:1px;flex:1;background:#34445e; }
.auth-form { display:flex;flex-direction:column;gap:.5rem; }
.auth-form label,.account-form-group label,.code-entry-panel label,.vip-setting-fields label { color:#d9e3f2;font-size:.8rem;font-weight:800; }
.auth-form input,.account-page input,.account-page select { width:100%;min-width:0;border:1px solid #3a4b65;border-radius:11px;background:#0b1627;color:#f4f7fb;padding:.78rem .9rem;font:inherit;outline:none; }
.auth-form input:focus,.account-page input:focus,.account-page select:focus { border-color:#35c99a;box-shadow:0 0 0 3px rgba(53,201,154,.12); }
.auth-actions { display:grid;grid-template-columns:1fr 1fr;gap:.65rem;margin-top:.55rem; }
.auth-actions .btn { margin-top:0; }
.text-button,.guest-btn { border:0;background:none;color:#6eddbb;font:700 .8rem inherit;cursor:pointer;padding:.55rem .1rem;text-align:left; }
.auth-message { min-height:1.2rem;color:#ff9da9;font-size:.8rem;margin:.35rem 0; }
.auth-bottom { display:flex;justify-content:space-between;align-items:center;gap:1rem;margin-top:.8rem;padding-top:1rem;border-top:1px solid #34445e; }
.auth-bottom > span { color:#8e9db4;font-size:.75rem; }
.guest-btn { white-space:nowrap;font-size:.84rem; }
.auth-privacy-note { color:#7788a2;font-size:.7rem;line-height:1.5;margin-top:.65rem; }
.account-nav { border-color:#43536c !important;color:#d3deed !important; }
.account-nav.locked { opacity:.56;filter:grayscale(1); }
.account-page { max-width:1100px;margin:0 auto; }
.account-hero-panel { display:flex;justify-content:space-between;align-items:center;gap:1rem; }
.account-layout { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem; }
.account-profile-card,.settings-card,.inventory-panel,.codes-panel-card,.vip-panel,.lifetime-admin-note { margin-bottom:0;min-width:0; }
.account-profile-heading { display:flex;align-items:center;gap:1rem;margin-bottom:1.5rem; }
.account-avatar { width:54px;height:54px;flex:0 0 54px;display:grid;place-items:center;border:1px solid rgba(16,185,129,.35);border-radius:17px;background:var(--emerald-bg);color:#69e0b8;font-size:1.45rem;font-weight:900; }
.account-profile-heading h3 { margin-bottom:.15rem; }
.account-form-group { display:flex;flex-direction:column;gap:.45rem; }
.account-inline-form { display:flex;gap:.55rem;align-items:center; }
.account-inline-form input { flex:1; }
.account-inline-form .btn { margin:0;white-space:nowrap; }
.muted-note { color:#8999b0;font-size:.76rem;line-height:1.55;margin-top:.35rem; }
.account-meta-row { display:flex;justify-content:space-between;align-items:center;gap:1rem;padding:.85rem 0;border-top:1px solid var(--border-color);margin-top:1rem;color:var(--text-muted);font-size:.82rem; }
.account-meta-row strong { color:var(--text-main); }
.account-signout { width:100%;margin-top:.3rem; }
.account-setting-row,.vip-toggle-row { display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.95rem 0;border-top:1px solid var(--border-color); }
.account-setting-row:first-of-type { margin-top:.6rem; }
.account-setting-row > span:first-child,.vip-toggle-row > span:first-child { display:flex;flex-direction:column;gap:.18rem; }
.account-setting-row strong,.vip-toggle-row strong { color:var(--text-main);font-size:.88rem; }
.account-setting-row small,.vip-toggle-row small { color:var(--text-muted);font-size:.75rem; }
.account-setting-row select { width:auto;max-width:180px; }
.inventory-list { display:grid;grid-template-columns:repeat(auto-fit,minmax(230px,1fr));gap:.75rem;margin-top:1rem; }
.inventory-empty { padding:1rem;border:1px dashed var(--border-color);border-radius:13px;color:var(--text-muted);font-size:.82rem;text-align:center; }
.inventory-item { display:flex;align-items:center;gap:.85rem;min-width:0;padding:.85rem;border:1px solid rgba(245,185,65,.3);border-radius:15px;background:linear-gradient(145deg,rgba(88,65,23,.24),rgba(14,23,37,.92)); }
.voucher-art { width:54px;height:46px;flex:0 0 54px;display:grid;place-items:center;position:relative;border:1px solid #e8bd58;border-radius:10px;background:linear-gradient(135deg,#fff1b9,#d9a83d 48%,#8d6420);color:#422c08;font-size:1.65rem;box-shadow:0 5px 15px rgba(215,166,62,.2); }
.voucher-art:after { content:"VIP";position:absolute;right:4px;bottom:3px;font-size:.48rem;font-weight:1000;letter-spacing:.04em; }
.inventory-item-copy { flex:1;min-width:0; }
.inventory-item-copy strong { display:block;color:#f4d58e;font-size:.84rem; }
.inventory-item-copy small { display:block;color:#b4a17d;font-size:.73rem;margin-top:.2rem; }
.inventory-item .btn { padding:.55rem .72rem;margin:0;font-size:.75rem; }
.codes-panel-card .panel-header { align-items:center; }
.code-entry-panel { padding-top:1rem;border-top:1px solid var(--border-color);margin-top:.8rem; }
.code-entry-panel .account-inline-form { margin-top:.45rem; }
.account-feedback { min-height:1.1rem;font-size:.78rem;color:#73ddb8;margin-top:.55rem; }
.account-feedback.error { color:#ff9da9; }
.account-locked-panel { text-align:center;padding:2.4rem 1.5rem;filter:saturate(.65); }
.account-locked-panel .locked-symbol { font-size:2.5rem;margin-bottom:.7rem;filter:grayscale(1); }
.account-locked-panel p { max-width:520px;margin:.5rem auto 1.2rem; }
.account-locked-panel .btn { margin:0 auto; }
.vip-panel { border-color:rgba(235,183,70,.55);background:linear-gradient(145deg,rgba(87,63,20,.35),var(--bg-card) 68%); }
.vip-panel-heading { display:flex;align-items:center;gap:.9rem; }
.vip-emblem { width:48px;height:48px;display:grid;place-items:center;border-radius:15px;border:1px solid rgba(245,192,83,.5);background:linear-gradient(145deg,#f5d98b,#a67521);color:#3b290a;font-size:1.7rem; }
.vip-eyebrow { color:#e7bd63; }
.vip-panel-heading h3 { color:#f4d991; }
.vip-timer-row { display:flex;justify-content:space-between;align-items:center;gap:1rem;margin:1.1rem 0;padding:1rem;border:1px solid rgba(235,183,70,.28);border-radius:13px;background:rgba(5,11,20,.38);color:#c2b18d;font-size:.82rem; }
.vip-timer-row strong { color:#ffe09a;font-size:1.15rem;font-variant-numeric:tabular-nums; }
.vip-lifetime-label { margin:1rem 0;padding:1rem;border:1px solid rgba(235,183,70,.28);border-radius:13px;color:#ffe09a;background:rgba(5,11,20,.38);font-weight:800; }
.vip-panel input[type="checkbox"] { appearance:none;width:45px;height:25px;flex:0 0 45px;border-radius:999px;border:1px solid #53627a;background:#29384e;position:relative;cursor:pointer;transition:.2s; }
.vip-panel input[type="checkbox"]:after { content:"";position:absolute;width:17px;height:17px;left:3px;top:3px;border-radius:50%;background:#bac6d6;transition:.2s; }
.vip-panel input[type="checkbox"]:checked { background:#b98b34;border-color:#f0c45d; }
.vip-panel input[type="checkbox"]:checked:after { left:23px;background:#fff3c6; }
.vip-panel input[type="checkbox"]:disabled { opacity:.45;cursor:not-allowed; }
.vip-setting-fields { display:flex;flex-direction:column;gap:.45rem;margin-top:.9rem; }
.vip-setting-fields select { width:100%; }
.vip-action-row { display:flex;flex-wrap:wrap;gap:.6rem;margin-top:1.2rem; }
.vip-action-row .btn { margin:0; }
.premium-setting { padding-top:.9rem;border-top:1px solid rgba(235,183,70,.2); }
.lifetime-admin-note { grid-column:1/-1; }
.lifetime-admin-note .account-meta-row { margin-top:.3rem; }
body.light-theme { --bg-main:#edf2f8;--bg-card:#fff;--bg-card-dark:#e5edf6;--bg-input:#fff;--border-color:#d2dce8;--border-light:#b9c7d8;--text-main:#192638;--text-muted:#607189;--text-dim:#8190a5; }
body.light-theme { background:#edf2f8;color:#192638; }
body.light-theme header { background:rgba(255,255,255,.94); }
body.light-theme .panel,body.light-theme .test-card,body.light-theme .home-stat,body.light-theme .stat-box,body.light-theme .review-card { background:#fff;color:#192638;border-color:#d2dce8; }
body.light-theme h1,body.light-theme h2,body.light-theme h3,body.light-theme .home-title,body.light-theme .home-stat strong { color:#172337; }
body.light-theme .home-hero { background:linear-gradient(135deg,#fff,#e7eff8); }
body.light-theme .home-copy,body.light-theme .card-desc,body.light-theme .subtitle { color:#5e6e83; }
body.light-theme .nav-tab-btn { background:#f1f5fa;color:#405169;border-color:#d2dce8; }
body.light-theme .nav-tab-btn.active { color:#fff;background:#059669;border-color:#059669; }
body.light-theme .account-page input,body.light-theme .account-page select { background:#f8fafc;color:#172337;border-color:#c8d4e2; }
body.gold-mode { --emerald:#e9bb55;--emerald-dark:#a87720;--emerald-bg:rgba(226,177,66,.15);--blue:#dfb450;--blue-dark:#a87720;--blue-bg:rgba(226,177,66,.13);--border-color:#574522; }
body.gold-mode header { border-color:#7a5c21;background:rgba(13,14,17,.96); }
body.gold-mode .brand-icon,body.gold-mode .subject-icon,body.gold-mode .account-avatar { color:#f5d98b;background:rgba(202,155,48,.16);border-color:rgba(237,190,83,.42); }
body.gold-mode .nav-tab-btn.active,body.gold-mode .card-open-hint,body.gold-mode .btn-emerald,body.gold-mode .btn-gradient { background:linear-gradient(110deg,#f4d98d,#b98426);border-color:#e6bd62;color:#33230a; }
body.gold-mode .home-kicker,body.gold-mode .section-eyebrow,body.gold-mode .home-title span { color:#e4bd65; }
body.gold-mode .home-hero { border-color:#816329;background:radial-gradient(circle at 90% 8%,rgba(212,164,62,.2),transparent 35%),linear-gradient(135deg,#282218,#121519); }
body.gold-mode .panel,body.gold-mode .test-card,body.gold-mode .home-stat { border-color:#4d4026; }
body.light-gold-mode { background:#f4f0e5 !important;color:#302814 !important;--bg-main:#f4f0e5;--bg-card:#fffdf8;--bg-card-dark:#f5edd9;--bg-input:#fffdf8;--border-color:#e4d5ae;--text-main:#302814;--text-muted:#746442;--text-dim:#99865c; }
body.light-gold-mode header { background:rgba(255,252,243,.96);border-color:#dcc58b; }
body.light-gold-mode .panel,body.light-gold-mode .test-card,body.light-gold-mode .home-stat { background:#fffdf8;color:#302814;border-color:#e4d5ae; }
body.light-gold-mode h1,body.light-gold-mode h2,body.light-gold-mode h3,body.light-gold-mode .home-title { color:#302814; }
body.light-gold-mode .home-hero { background:linear-gradient(135deg,#fffdf8,#eee2c1);border-color:#dcc58b; }
body.light-gold-mode .nav-tab-btn { background:#fffaf0;color:#705821;border-color:#e4d5ae; }
body.light-gold-mode .nav-tab-btn.active { background:linear-gradient(110deg,#f4d98d,#b98426);color:#33230a; }
body.light-gold-mode .account-page input,body.light-gold-mode .account-page select { background:#fff;color:#302814;border-color:#dcc58b; }
body.premium-mode .panel,body.premium-mode .test-card,body.premium-mode .home-stat { box-shadow:0 16px 36px rgba(167,124,36,.14);border-color:rgba(231,188,91,.48); }
body.premium-mode .home-hero { background-image:radial-gradient(circle at 85% 15%,rgba(255,220,125,.24),transparent 32%),linear-gradient(125deg,#2b2415,#15191f); }
body.premium-mode .vip-emblem { box-shadow:0 0 24px rgba(239,192,82,.25); }
@media(max-width:760px){.account-layout{grid-template-columns:1fr}.account-hero-panel{align-items:flex-start}.auth-bottom{align-items:flex-start;flex-direction:column;gap:.35rem}.auth-actions{grid-template-columns:1fr}.account-inline-form{align-items:stretch;flex-direction:column}.account-inline-form .btn{width:100%}.inventory-item{flex-wrap:wrap}.inventory-item .btn{flex:1}.account-setting-row{align-items:flex-start;flex-direction:column}.account-setting-row select{max-width:none;width:100%}}


/* Light mode must also recolour the isolated Wiskunde module, whose dark-mode
   component styles intentionally use stronger selectors. */
body.light-theme .math-app {
  --bg:#edf2f8;--surface:#ffffff;--ink:#1a2940;--muted:#61738c;--line:#d7e0eb;
  --blue:#4169e1;--blue2:#3159cf;--blue-soft:#edf2ff;--green:#0b9277;--green-soft:#e9f8f3;
  --red:#c84460;--red-soft:#fff0f3;--shadow:0 10px 28px rgba(24,43,77,.07);
  background:#edf2f8 !important;color:#1a2940 !important;
}
body.light-theme .math-app .topbar { background:rgba(255,255,255,.94) !important;border-color:#d7e0eb !important; }
body.light-theme .math-app .brand-name,
body.light-theme .math-app .hero h1,
body.light-theme .math-app .section-head h2,
body.light-theme .math-app .chapter-card h3,
body.light-theme .math-app .quick-panel h3,
body.light-theme .math-app .view-head h2,
body.light-theme .math-app .question,
body.light-theme .math-app .info-card h3,
body.light-theme .math-app .result-box h2 { color:#1a2940 !important; }
body.light-theme .math-app .brand-sub,
body.light-theme .math-app .hero p,
body.light-theme .math-app .section-head p,
body.light-theme .math-app .chapter-card p,
body.light-theme .math-app .quick-panel p,
body.light-theme .math-app .view-head p,
body.light-theme .math-app .muted-note,
body.light-theme .math-app .practice-meta,
body.light-theme .math-app .info-card p,
body.light-theme .math-app .steps { color:#61738c !important; }
body.light-theme .math-app .hero,
body.light-theme .math-app .stat,
body.light-theme .math-app .chapter-card,
body.light-theme .math-app .quick-panel,
body.light-theme .math-app .practice-card,
body.light-theme .math-app .info-card,
body.light-theme .math-app .video-link { background:#fff !important;border-color:#d7e0eb !important;color:#1a2940 !important;box-shadow:0 8px 24px rgba(24,43,77,.06) !important; }
body.light-theme .math-app .hero { background:linear-gradient(112deg,#fff 0%,#f5f8ff 65%,#eaf0ff 100%) !important; }
body.light-theme .math-app .hero-chip,
body.light-theme .math-app .math-expression { background:#f0f4ff !important;border-color:#d9e3fb !important;color:#35559b !important; }
body.light-theme .math-app .chapter-icon { background:#edf2ff !important;color:#4169e1 !important; }
body.light-theme .math-app .chapter-tag,
body.light-theme .math-app .grade-pill { background:#edf2ff !important;color:#3559cf !important;border-color:#dce5ff !important; }
body.light-theme .math-app .back-link { color:#526780 !important; }
body.light-theme .math-app .back-link:hover { background:#f0f4fa !important;color:#3159cf !important; }
body.light-theme .math-app .btn-light { background:#f1f4fa !important;color:#52647d !important;border-color:#dce4ef !important; }
body.light-theme .math-app .answer { background:#fff !important;color:#354761 !important;border-color:#dce4ef !important; }
body.light-theme .math-app .answer:hover:not(:disabled) { background:#f6f8ff !important; }
body.light-theme .math-app .answer .letter { background:#f0f3f9 !important;color:#7b8aa2 !important; }
body.light-theme .math-app .answer.correct { background:#effaf6 !important;color:#087e6a !important;border-color:#75cfb3 !important; }
body.light-theme .math-app .answer.wrong { background:#fff5f6 !important;color:#bd3c57 !important;border-color:#f0a4b3 !important; }
body.light-theme .math-app .feedback { background:#f7f9fd !important;color:#3d506a !important;border-color:#dfe6ef !important; }
body.light-theme .math-app .feedback.good { background:#effaf6 !important;color:#087e6a !important;border-color:#d0f1e5 !important; }
body.light-theme .math-app .feedback.bad { background:#fff7f7 !important;color:#a43b50 !important;border-color:#f8dce2 !important; }
body.light-theme .math-app .formula { background:#f2f5ff !important;color:#294fae !important;border-color:#dce5ff !important; }
body.light-theme .math-app .progress { background:#edf1f7 !important; }
body.light-theme .math-app .result-ring { background:#f7f9ff !important;color:#3159cf !important; }
body.light-theme .math-app .summary-accordion { background:#fff !important;border-color:#d7e0eb !important; }
body.light-theme .math-app .summary-accordion > summary { color:#263a58 !important; }
body.light-theme .math-app .summary-accordion[open] > summary { background:#f2f6fd !important;border-color:#d7e0eb !important; }
body.light-theme .math-app .summary-content,
body.light-theme .math-app .summary-content h4,
body.light-theme .math-app .summary-content b { color:#3f526c !important; }
body.light-theme .math-app .math-generator-panel,
body.light-theme .math-app .math-generator-note { background:#fff !important;color:#3d506a !important;border-color:#d7e0eb !important; }
body.light-theme .math-app .math-generator-fields label,
body.light-theme .math-app .math-generator-note strong { color:#263a58 !important; }
body.light-theme .math-app .math-generator-fields select { background:#fff !important;color:#263a58 !important;border-color:#d7e0eb !important; }
body.light-theme .math-app .toast { background:#fff !important;color:#263a58 !important;border-color:#dfc57e !important; }
body.light-theme { color-scheme:light; }
body.light-gold-mode { color-scheme:light; }


/* Light Gold variant for the Wiskunde app. */
body.light-gold-mode .math-app {
  --bg:#f4f0e5;--surface:#fffdf8;--ink:#302814;--muted:#746442;--line:#e4d5ae;
  --blue:#a87720;--blue2:#8a641d;--blue-soft:#f8efd9;--green:#8a6a24;--green-soft:#f6efd9;
  --red:#a64c42;--red-soft:#fff1eb;--shadow:0 10px 28px rgba(115,84,28,.08);
  background:#f4f0e5 !important;color:#302814 !important;
}
body.light-gold-mode .math-app .topbar { background:rgba(255,252,243,.96) !important;border-color:#dcc58b !important; }
body.light-gold-mode .math-app .brand-name,
body.light-gold-mode .math-app .hero h1,
body.light-gold-mode .math-app .section-head h2,
body.light-gold-mode .math-app .chapter-card h3,
body.light-gold-mode .math-app .quick-panel h3,
body.light-gold-mode .math-app .view-head h2,
body.light-gold-mode .math-app .question,
body.light-gold-mode .math-app .info-card h3,
body.light-gold-mode .math-app .result-box h2 { color:#302814 !important; }
body.light-gold-mode .math-app .brand-sub,
body.light-gold-mode .math-app .hero p,
body.light-gold-mode .math-app .section-head p,
body.light-gold-mode .math-app .chapter-card p,
body.light-gold-mode .math-app .quick-panel p,
body.light-gold-mode .math-app .view-head p,
body.light-gold-mode .math-app .muted-note,
body.light-gold-mode .math-app .practice-meta,
body.light-gold-mode .math-app .info-card p,
body.light-gold-mode .math-app .steps { color:#746442 !important; }
body.light-gold-mode .math-app .hero,
body.light-gold-mode .math-app .stat,
body.light-gold-mode .math-app .chapter-card,
body.light-gold-mode .math-app .quick-panel,
body.light-gold-mode .math-app .practice-card,
body.light-gold-mode .math-app .info-card,
body.light-gold-mode .math-app .video-link { background:#fffdf8 !important;border-color:#e4d5ae !important;color:#302814 !important;box-shadow:0 8px 24px rgba(115,84,28,.06) !important; }
body.light-gold-mode .math-app .hero { background:linear-gradient(112deg,#fffdf8 0%,#f8f0df 68%,#eee2c1 100%) !important; }
body.light-gold-mode .math-app .hero-chip,
body.light-gold-mode .math-app .math-expression,
body.light-gold-mode .math-app .chapter-icon,
body.light-gold-mode .math-app .chapter-tag,
body.light-gold-mode .math-app .grade-pill { background:#f7eed7 !important;color:#76551c !important;border-color:#e4d5ae !important; }
body.light-gold-mode .math-app .back-link { color:#705821 !important; }
body.light-gold-mode .math-app .back-link:hover { background:#f7efdE !important;color:#4d3810 !important; }
body.light-gold-mode .math-app .btn-light { background:#fbf5e7 !important;color:#705821 !important;border-color:#e4d5ae !important; }
body.light-gold-mode .math-app .answer { background:#fffdf8 !important;color:#514322 !important;border-color:#e4d5ae !important; }
body.light-gold-mode .math-app .answer:hover:not(:disabled) { background:#fbf5e7 !important; }
body.light-gold-mode .math-app .answer .letter { background:#f7eed7 !important;color:#76551c !important; }
body.light-gold-mode .math-app .answer.correct { background:#f2f7e9 !important;color:#4d6c31 !important;border-color:#cbd9a9 !important; }
body.light-gold-mode .math-app .answer.wrong { background:#fff2ef !important;color:#a64c42 !important;border-color:#e7bbb4 !important; }
body.light-gold-mode .math-app .feedback { background:#fbf7ed !important;color:#514322 !important;border-color:#e4d5ae !important; }
body.light-gold-mode .math-app .feedback.good { background:#f2f7e9 !important;color:#4d6c31 !important;border-color:#cbd9a9 !important; }
body.light-gold-mode .math-app .feedback.bad { background:#fff2ef !important;color:#a64c42 !important;border-color:#e7bbb4 !important; }
body.light-gold-mode .math-app .formula { background:#fbf4e2 !important;color:#8a641d !important;border-color:#e4d5ae !important; }
body.light-gold-mode .math-app .progress { background:#eee4cc !important; }
body.light-gold-mode .math-app .result-ring { background:#fffaf0 !important;color:#8a641d !important; }
body.light-gold-mode .math-app .summary-accordion { background:#fffdf8 !important;border-color:#e4d5ae !important; }
body.light-gold-mode .math-app .summary-accordion > summary { color:#514322 !important; }
body.light-gold-mode .math-app .summary-accordion[open] > summary { background:#f8efd9 !important;border-color:#e4d5ae !important; }
body.light-gold-mode .math-app .summary-content,
body.light-gold-mode .math-app .summary-content h4,
body.light-gold-mode .math-app .summary-content b { color:#514322 !important; }
body.light-gold-mode .math-app .math-generator-panel,
body.light-gold-mode .math-app .math-generator-note { background:#fffdf8 !important;color:#514322 !important;border-color:#e4d5ae !important; }
body.light-gold-mode .math-app .math-generator-fields label,
body.light-gold-mode .math-app .math-generator-note strong { color:#514322 !important; }
body.light-gold-mode .math-app .math-generator-fields select { background:#fffdf8 !important;color:#514322 !important;border-color:#e4d5ae !important; }
body.light-gold-mode .math-app .toast { background:#fffdf8 !important;color:#514322 !important;border-color:#d5b96f !important; }


/* =====================================================================
   STUDYHUB VIP GOLD — strong gold identity across the entire experience
   ===================================================================== */
body.gold-mode {
  --bg-main:#0b0906;
  --bg-card:#19150d;
  --bg-card-dark:#100d08;
  --bg-input:#120f09;
  --border-color:#72551f;
  --border-light:#9a7430;
  --text-main:#fff5d9;
  --text-muted:#d6c18d;
  --text-dim:#ab925d;
  --emerald:#f1cb68;
  --emerald-dark:#b78322;
  --emerald-bg:rgba(225,177,70,.16);
  --blue:#e9c46b;
  --blue-dark:#b78322;
  --blue-bg:rgba(225,177,70,.14);
  --purple:#e3c37c;
  --purple-dark:#a77a27;
  --purple-bg:rgba(225,177,70,.12);
  --amber:#ffd875;
  --amber-dark:#a97920;
  --amber-bg:rgba(255,205,91,.15);
  --brand:#d5a843;
  --brand-dark:#956719;
  --brand-soft:rgba(213,168,67,.16);
  color-scheme:dark;
  background:#0b0906 !important;
  background-image:radial-gradient(ellipse at 12% 0%,rgba(224,177,73,.13),transparent 34%),radial-gradient(ellipse at 95% 16%,rgba(151,104,25,.10),transparent 30%) !important;
}
body.gold-mode header {
  background:rgba(12,10,7,.97) !important;
  border-bottom-color:#73531e !important;
  box-shadow:0 8px 32px rgba(0,0,0,.42),0 1px 0 rgba(247,206,113,.12) !important;
}
body.gold-mode .brand-icon,
body.gold-mode .subject-icon,
body.gold-mode .account-avatar,
body.gold-mode .math-app .stat-icon,
body.gold-mode .math-app .chapter-icon {
  color:#ffe5a0 !important;
  background:linear-gradient(145deg,rgba(255,218,132,.22),rgba(153,103,21,.18)) !important;
  border:1px solid rgba(236,190,83,.55) !important;
  box-shadow:inset 0 1px 0 rgba(255,244,203,.16),0 5px 20px rgba(212,161,50,.12) !important;
}
body.gold-mode .brand-title,
body.gold-mode .home-title,
body.gold-mode .home-section-title,
body.gold-mode .home-stat strong,
body.gold-mode h2,
body.gold-mode h3,
body.gold-mode .math-app .hero h1,
body.gold-mode .math-app .section-head h2,
body.gold-mode .math-app .view-head h2,
body.gold-mode .math-app .chapter-card h3,
body.gold-mode .math-app .quick-panel h3,
body.gold-mode .math-app .info-card h3,
body.gold-mode .math-app .result-box h2 { color:#fff1c7 !important; }
body.gold-mode .brand-sub,
body.gold-mode .subtitle,
body.gold-mode .home-copy,
body.gold-mode .card-desc,
body.gold-mode .home-stat span,
body.gold-mode .math-app .hero p,
body.gold-mode .math-app .chapter-card p,
body.gold-mode .math-app .info-card p,
body.gold-mode .math-app .info-card li,
body.gold-mode .math-app .muted-note { color:#c8b483 !important; }
body.gold-mode .study-pill,
body.gold-mode .tag-amber,
body.gold-mode .math-app .chapter-tag {
  color:#ffe4a0 !important;
  background:rgba(200,151,48,.18) !important;
  border-color:rgba(235,191,91,.38) !important;
}
body.gold-mode .panel,
body.gold-mode .test-card,
body.gold-mode .home-stat,
body.gold-mode .flashcard-front,
body.gold-mode .flashcard-back,
body.gold-mode .diagram-box,
body.gold-mode .review-card,
body.gold-mode .stat-box,
body.gold-mode .math-app .stat,
body.gold-mode .math-app .chapter-card,
body.gold-mode .math-app .quick-panel,
body.gold-mode .math-app .practice-card,
body.gold-mode .math-app .info-card,
body.gold-mode .math-app .video-link {
  color:#fff1c7 !important;
  background:linear-gradient(145deg,#211a0e 0%,#151109 72%,#100d08 100%) !important;
  border-color:rgba(207,159,57,.52) !important;
  box-shadow:0 12px 30px rgba(0,0,0,.31),inset 0 1px 0 rgba(255,226,158,.055),0 0 0 1px rgba(194,145,42,.07) !important;
}
body.gold-mode .home-hero,
body.gold-mode .math-app .hero {
  background:radial-gradient(circle at 84% 14%,rgba(255,213,111,.24),transparent 31%),linear-gradient(122deg,#30230f 0%,#1a150c 54%,#100e09 100%) !important;
  border:1px solid rgba(239,195,91,.68) !important;
  box-shadow:0 18px 48px rgba(0,0,0,.38),inset 0 1px 0 rgba(255,226,158,.13),0 0 34px rgba(210,157,49,.10) !important;
}
body.gold-mode .home-title span,
body.gold-mode .home-kicker,
body.gold-mode .section-eyebrow,
body.gold-mode .math-app .eyebrow,
body.gold-mode .math-app .hero h1 span { color:#f4cf78 !important; }
body.gold-mode .nav-tab-btn,
body.gold-mode .install-app-btn {
  color:#f3dfb1 !important;
  background:linear-gradient(145deg,#211a0e,#151109) !important;
  border-color:#695022 !important;
}
body.gold-mode .nav-tab-btn.active,
body.gold-mode .card-open-hint,
body.gold-mode .btn-emerald,
body.gold-mode .btn-gradient,
body.gold-mode .btn-amber,
body.gold-mode .math-app .btn-primary {
  color:#2a1b06 !important;
  background:linear-gradient(115deg,#fff0b7 0%,#e8bd58 34%,#bd872b 68%,#f3d681 100%) !important;
  border:1px solid #f5d98a !important;
  box-shadow:0 7px 20px rgba(199,146,38,.24),inset 0 1px 0 rgba(255,255,255,.48) !important;
  font-weight:900 !important;
}
body.gold-mode .btn-secondary,
body.gold-mode .math-app .btn-light {
  background:linear-gradient(145deg,#2a2112,#191309) !important;
  color:#f2d99e !important;
  border-color:#765a28 !important;
}
body.gold-mode .subject-card-link:hover,
body.gold-mode .math-app .chapter-card:hover,
body.gold-mode .math-app .chapter-card:focus-visible {
  border-color:#f5d177 !important;
  box-shadow:0 0 0 2px rgba(247,204,105,.24),0 18px 40px rgba(0,0,0,.38),0 0 28px rgba(221,169,56,.17) !important;
}
body.gold-mode select,
body.gold-mode input[type="text"],
body.gold-mode input[type="email"],
body.gold-mode input[type="password"],
body.gold-mode input[type="number"],
body.gold-mode textarea,
body.gold-mode .math-app .math-expression,
body.gold-mode .math-app .answer {
  color:#fff0c7 !important;
  background:#110e08 !important;
  border-color:#6f5425 !important;
}
body.gold-mode .mc-option,
body.gold-mode .q-pill,
body.gold-mode .math-app .answer { background:#171208 !important;color:#f5e4bd !important;border-color:#5c4823 !important; }
body.gold-mode .mc-option:hover,
body.gold-mode .math-app .answer:hover:not(:disabled) { background:#2a200e !important;border-color:#d0a448 !important; }
body.gold-mode .mc-option.selected,
body.gold-mode .math-app .answer.correct { background:rgba(196,151,52,.2) !important;border-color:#e1bc63 !important;color:#ffe7a6 !important; }
body.gold-mode .progress-track,
body.gold-mode .math-app .progress { background:#171106 !important;border:1px solid #4a3819 !important; }
body.gold-mode .progress-fill,
body.gold-mode .math-app .progress>span { background:linear-gradient(90deg,#a6751e,#f5d277,#fff0b7) !important; }
body.gold-mode .grade-circle,
body.gold-mode .math-app .result-ring { border-color:#e3b84e !important;background:radial-gradient(circle,#2c210e,#100d08) !important;color:#ffe7a6 !important;box-shadow:0 0 0 5px rgba(222,174,70,.10),0 0 34px rgba(211,160,51,.17) !important; }
body.gold-mode .timer-badge { background:rgba(216,165,57,.16) !important;color:#ffe29b !important;border-color:#bd8d35 !important; }
body.gold-mode .flashcard-back { border-color:#dfb44f !important; }
body.gold-mode table.geo-table th { background:#34260f !important;color:#f6d889 !important; }
body.gold-mode table.geo-table th,body.gold-mode table.geo-table td { border-color:#6a5123 !important; }
body.gold-mode table.geo-table td { color:#eadbb6 !important; }
body.gold-mode .toast,.gold-mode .math-app .toast { background:#21190c !important;color:#fff1c7 !important;border:1px solid #98712a !important;box-shadow:0 14px 36px rgba(0,0,0,.42) !important; }
body.gold-mode .vip-panel,
body.gold-mode .admin-code-panel,
body.gold-mode .inventory-panel,
body.gold-mode .codes-panel-card {
  border:1px solid rgba(244,202,103,.72) !important;
  background:radial-gradient(circle at 95% 0%,rgba(249,208,111,.20),transparent 32%),linear-gradient(145deg,#2a210f,#171208 66%,#100d08) !important;
  box-shadow:0 16px 40px rgba(0,0,0,.38),0 0 30px rgba(202,151,48,.11),inset 0 1px 0 rgba(255,230,167,.12) !important;
}
body.gold-mode .vip-panel-heading h3,
body.gold-mode .vip-panel-heading .vip-eyebrow,
body.gold-mode .vip-status-text { color:#ffe3a0 !important; }
body.gold-mode .vip-emblem,
body.gold-mode .vip-premium-mark {
  background:linear-gradient(135deg,#fff2bd 0%,#e4b94f 44%,#805817 100%) !important;
  color:#392607 !important;
  border:1px solid #ffe29b !important;
  box-shadow:0 0 0 4px rgba(224,178,75,.12),0 9px 28px rgba(202,151,48,.27) !important;
}
body.gold-mode .vip-timer-row,
body.gold-mode .vip-lifetime-label { background:rgba(9,7,4,.62) !important;border-color:#98712d !important;color:#e8d09a !important; }
body.gold-mode .vip-timer-row strong { color:#ffe9a8 !important;text-shadow:0 0 16px rgba(245,202,104,.18); }
body.gold-mode .inventory-item { background:linear-gradient(120deg,rgba(255,228,153,.16),rgba(93,62,12,.22) 40%,rgba(13,10,5,.88)) !important;border-color:#bd9140 !important;box-shadow:inset 0 1px 0 rgba(255,237,180,.13),0 8px 22px rgba(0,0,0,.22) !important; }
body.gold-mode .inventory-item-copy strong { color:#ffe7a6 !important; }
body.gold-mode .inventory-item-copy small { color:#d5bd85 !important; }
body.gold-mode .voucher-art { transform:rotate(-3deg);box-shadow:0 0 0 3px rgba(221,175,78,.12),0 8px 25px rgba(224,174,66,.28) !important; }

/* The Light Gold palette keeps the gold identity while switching to cream. */
body.light-gold-mode {
  --bg-main:#f2ead6;--bg-card:#fffaf0;--bg-card-dark:#f6edd9;--bg-input:#fffdf7;
  --border-color:#d8bd7d;--border-light:#c49e4b;
  --text-main:#34270f;--text-muted:#75603a;--text-dim:#9a7f4d;
  --emerald:#a9781e;--emerald-dark:#805713;--emerald-bg:rgba(190,143,43,.14);
  --blue:#a9781e;--blue-dark:#805713;--blue-bg:rgba(190,143,43,.13);
  --purple:#8b6928;--purple-dark:#70501b;--purple-bg:rgba(190,143,43,.12);
  --amber:#a9781e;--amber-dark:#805713;--amber-bg:rgba(190,143,43,.15);
  color-scheme:light;background:#f2ead6 !important;
  background-image:radial-gradient(ellipse at 10% 0%,rgba(213,170,83,.20),transparent 34%),radial-gradient(ellipse at 95% 20%,rgba(169,120,30,.10),transparent 30%) !important;
}
body.light-gold-mode header { background:rgba(255,250,239,.96) !important;border-color:#d8bd7d !important;box-shadow:0 7px 24px rgba(105,75,23,.12) !important; }
body.light-gold-mode .brand-title,body.light-gold-mode h2,body.light-gold-mode h3,body.light-gold-mode .home-title,body.light-gold-mode .home-section-title,body.light-gold-mode .home-stat strong { color:#34270f !important; }
body.light-gold-mode .brand-sub,body.light-gold-mode .subtitle,body.light-gold-mode .home-copy,body.light-gold-mode .card-desc,body.light-gold-mode .home-stat span { color:#79633c !important; }
body.light-gold-mode .panel,body.light-gold-mode .test-card,body.light-gold-mode .home-stat,body.light-gold-mode .flashcard-front,body.light-gold-mode .flashcard-back,body.light-gold-mode .diagram-box,body.light-gold-mode .review-card,body.light-gold-mode .stat-box,body.light-gold-mode .math-app .stat,body.light-gold-mode .math-app .chapter-card,body.light-gold-mode .math-app .quick-panel,body.light-gold-mode .math-app .practice-card,body.light-gold-mode .math-app .info-card,body.light-gold-mode .math-app .video-link { background:linear-gradient(145deg,#fffdf7,#f7efdD) !important;color:#34270f !important;border-color:#d9be80 !important;box-shadow:0 10px 28px rgba(107,76,22,.09),inset 0 1px 0 #fff !important; }
body.light-gold-mode .home-hero,body.light-gold-mode .math-app .hero { background:radial-gradient(circle at 88% 10%,rgba(217,174,82,.20),transparent 30%),linear-gradient(120deg,#fffdf7,#f0e3c2) !important;border-color:#c9a65b !important; }
body.light-gold-mode .home-title span,body.light-gold-mode .home-kicker,body.light-gold-mode .section-eyebrow,body.light-gold-mode .math-app .eyebrow,body.light-gold-mode .math-app .hero h1 span { color:#98701e !important; }
body.light-gold-mode .nav-tab-btn { background:#fff9e9 !important;color:#72531a !important;border-color:#d9be80 !important; }
body.light-gold-mode .nav-tab-btn.active,body.light-gold-mode .card-open-hint,body.light-gold-mode .btn-emerald,body.light-gold-mode .btn-gradient,body.light-gold-mode .btn-amber,body.light-gold-mode .math-app .btn-primary { background:linear-gradient(115deg,#fff0b7,#e4bd58 38%,#b78322 70%,#f2d47f) !important;color:#302006 !important;border-color:#bd913e !important;box-shadow:0 7px 20px rgba(165,116,26,.18) !important; }
body.light-gold-mode select,body.light-gold-mode input,body.light-gold-mode textarea,body.light-gold-mode .math-app .answer { background:#fffdf7 !important;color:#34270f !important;border-color:#d2b46f !important; }
body.light-gold-mode .vip-panel,body.light-gold-mode .admin-code-panel,body.light-gold-mode .inventory-panel,body.light-gold-mode .codes-panel-card { background:radial-gradient(circle at 95% 0%,rgba(215,169,73,.19),transparent 33%),linear-gradient(145deg,#fff9e9,#f1e2bc) !important;border:1px solid #c39b4d !important;box-shadow:0 15px 35px rgba(135,96,28,.14) !important; }
body.light-gold-mode .vip-panel-heading h3,body.light-gold-mode .vip-premium-copy h4 { color:#4b3510 !important; }
body.light-gold-mode .vip-timer-row,body.light-gold-mode .vip-lifetime-label { background:rgba(255,248,225,.83) !important;border-color:#c9a65b !important;color:#71531a !important; }
body.light-gold-mode .vip-timer-row strong { color:#815b12 !important; }
body.light-gold-mode .inventory-item { background:linear-gradient(120deg,#fff4cf,#f3dfab,#fff9e8) !important;border-color:#c39b4d !important; }
body.light-gold-mode .inventory-item-copy strong { color:#63420d !important; }
body.light-gold-mode .inventory-item-copy small { color:#80652f !important; }

/* Premium Experience preview in the VIP settings panel. */
.vip-premium-showcase {
  position:relative;display:flex;align-items:center;gap:1rem;overflow:hidden;
  margin-top:1.1rem;padding:1.1rem;border-radius:18px;
  border:1px solid rgba(137,152,255,.28);
  background:radial-gradient(circle at 90% 0%,rgba(105,127,241,.15),transparent 35%),linear-gradient(125deg,#1a2240,#172033 58%,#10262b);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.07),0 12px 28px rgba(0,0,0,.2);
}
.vip-premium-mark { width:52px;height:52px;flex:0 0 52px;display:grid;place-items:center;border-radius:16px;font-size:1.8rem; }
.vip-premium-copy { min-width:0; }
.vip-premium-kicker { display:block;color:#aab6ff;font-size:.62rem;font-weight:950;letter-spacing:.18em;margin-bottom:.22rem; }
.vip-premium-copy h4 { color:#e5eaff;font-size:1.05rem;letter-spacing:-.025em;margin:0 0 .3rem; }
.vip-premium-copy p { color:#bdc8dd;font-size:.78rem;line-height:1.55;margin:0;max-width:620px; }
.vip-premium-perks { display:flex;flex-wrap:wrap;gap:.4rem;margin-top:.75rem; }
.vip-premium-perks span { padding:.32rem .56rem;border:1px solid rgba(137,152,255,.24);border-radius:99px;background:rgba(137,152,255,.08);color:#c5d0ff;font-size:.65rem;font-weight:800; }
.premium-setting { margin-top:.9rem;padding-top:.9rem;border-top:1px solid var(--border-color); }

/* =====================================================================
   MOBILE FIRST FINISH — navigation, forms, cards and practice screens
   ===================================================================== */
html { overflow-x:hidden;scroll-padding-top:110px;-webkit-text-size-adjust:100%; }
body { overflow-x:hidden;min-width:320px; }
button,select,input,textarea { font:inherit; }
button,.btn,.nav-tab-btn,.install-app-btn,.math-app .btn,.math-app .answer,.mc-option { touch-action:manipulation; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:3px solid rgba(109,140,255,.55);outline-offset:2px; }
img,svg,video,canvas { max-width:100%; }
#main,main { min-width:0;width:100%; }
.home-page,.account-page,.math-app,#section-tests,#section-generator,#section-quiz,#section-grading,#section-results,#section-learn,#section-summary { min-width:0; }
@media (max-width:760px) {
  .header-inner { display:flex;flex-direction:column;align-items:stretch;gap:.65rem;padding:.65rem .8rem !important; }
  .brand { min-width:0;max-width:100%; }
  .brand-title { font-size:1.05rem; }
  .brand-sub { font-size:.69rem; }
  header nav { width:100%;max-width:100%;display:flex;flex-wrap:nowrap;align-items:center;gap:.42rem;overflow-x:auto;overflow-y:hidden;padding:0 0 .28rem;scrollbar-width:none;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain; }
  header nav::-webkit-scrollbar { display:none; }
  header nav > button { flex:0 0 auto;min-height:44px;padding:.62rem .78rem;font-size:.78rem;white-space:nowrap; }
  .install-app-btn { min-height:44px; }
  main { padding:1rem .85rem 2rem !important; }
  .panel,.test-card { padding:1rem !important;border-radius:15px !important; }
  .home-hero { grid-template-columns:minmax(0,1fr) !important;padding:1.15rem !important;gap:.6rem !important; }
  .home-title { font-size:clamp(1.9rem,9vw,2.55rem) !important;overflow-wrap:anywhere; }
  .home-copy { font-size:.9rem; }
  .home-visual { min-height:110px !important; }
  .home-stats { grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:.55rem !important;margin: .85rem 0 1.2rem !important; }
  .home-stat { min-width:0;padding:.75rem !important; }
  .home-stat strong { font-size:1.15rem !important; }
  .home-stat span { font-size:.72rem !important; }
  .grid-tests,.grid-2,.grid-3,.grid-2,.flashcard-grid { grid-template-columns:minmax(0,1fr) !important; }
  .subject-card { min-height:unset !important; }
  .home-section-heading { align-items:flex-start !important;flex-direction:column;gap:.25rem; }
  .quiz-top-bar,.quiz-footer,.panel-header { align-items:flex-start;flex-wrap:wrap; }
  .quiz-footer { display:grid !important;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem !important; }
  .quiz-footer .btn { width:100%;min-height:44px;margin:0 !important; }
  .q-nav-pills { gap:.35rem; }
  .q-pill { width:36px;height:36px; }
  .question-text { font-size:1.02rem !important;overflow-wrap:anywhere; }
  .mc-option { align-items:flex-start;min-height:48px;padding:.78rem !important;font-size:.86rem !important; }
  .stats-row { grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:.55rem !important; }
  .grade-circle { width:112px !important;height:112px !important; }
  .account-layout { grid-template-columns:minmax(0,1fr) !important;gap:.75rem; }
  .account-hero-panel { align-items:stretch !important;flex-direction:column; }
  .account-hero-panel > .btn { width:100%; }
  .account-profile-heading { min-width:0;align-items:flex-start; }
  .account-profile-heading > div:last-child { min-width:0;overflow-wrap:anywhere; }
  .account-inline-form { align-items:stretch !important;flex-direction:column; }
  .account-inline-form input,.account-inline-form .btn { width:100% !important;min-height:44px; }
  .account-setting-row,.vip-toggle-row { align-items:flex-start !important;flex-direction:column;gap:.6rem; }
  .account-setting-row select,.vip-setting-fields select { width:100% !important;max-width:none !important;min-height:44px; }
  .inventory-list { grid-template-columns:minmax(0,1fr) !important; }
  .inventory-item { align-items:center;flex-wrap:wrap; }
  .inventory-item-copy { flex:1 1 calc(100% - 75px); }
  .inventory-item .btn { flex:1 1 100%;min-height:44px; }
  .vip-panel-heading { align-items:flex-start;flex-wrap:wrap; }
  .vip-panel-heading > div:nth-child(2) { flex:1 1 calc(100% - 70px);min-width:0; }
  .vip-timer-row { align-items:flex-start;flex-direction:column;gap:.3rem; }
  .vip-action-row { display:grid;grid-template-columns:minmax(0,1fr); }
  .vip-action-row .btn,.admin-code-panel > .btn { width:100%;min-height:46px; }
  .vip-premium-showcase { align-items:flex-start;padding:.9rem;gap:.7rem; }
  .vip-premium-mark { width:42px;height:42px;flex-basis:42px; }
  .vip-premium-perks { gap:.35rem; }
  .vip-premium-perks span { font-size:.61rem; }
  .admin-code-grid { grid-template-columns:minmax(0,1fr) !important; }
  .admin-code-result { min-width:0; }
  .admin-code-result input { min-width:0; }
  .math-app { width:100%;padding:14px 0 38px !important; }
  .math-app .hero { grid-template-columns:minmax(0,1fr) !important;padding:1.1rem !important; }
  .math-app .hero-art { min-height:95px !important; }
  .math-app .math-symbol { width:76px;height:76px;font-size:2.2rem; }
  .math-app .stats { grid-template-columns:repeat(2,minmax(0,1fr)) !important;gap:.55rem !important;margin:12px 0 22px !important; }
  .math-app .stat { min-width:0;padding:.72rem !important; }
  .math-app .chapter-grid,.math-app .content-grid { grid-template-columns:minmax(0,1fr) !important;gap:.7rem !important; }
  .math-app .chapter-card,.math-app .practice-card,.math-app .info-card { min-width:0;padding:1rem !important; }
  .math-app .view-head,.math-app .section-head { align-items:stretch !important;flex-direction:column; }
  .math-app .practice-actions { flex-wrap:wrap; }
  .math-app .practice-actions .btn { flex:1 1 100%;min-height:44px; }
  .math-app .math-generator-fields { grid-template-columns:minmax(0,1fr) !important; }
  .math-app .math-generator-panel { padding:1rem !important; }
  .math-app .math-generator-panel select,.math-app .math-generator-panel button { width:100%;min-height:44px; }
  .math-app .answer { min-height:48px;padding:.78rem !important; }
  .math-app .toast { right:12px !important;left:12px !important;bottom:calc(12px + env(safe-area-inset-bottom)) !important; }
  .diagram-box,.panel:has(table.geo-table) { max-width:100%;overflow-x:auto; }
  table.geo-table { min-width:500px; }
  footer { padding:1rem .8rem calc(1rem + env(safe-area-inset-bottom)); }
}
@media (max-width:420px) {
  .header-inner { padding:.55rem .65rem !important; }
  .brand-icon { width:36px;height:36px;flex:0 0 36px; }
  .brand-title { font-size:.98rem; }
  .brand-sub { display:none; }
  header nav > button { padding:.58rem .68rem;font-size:.74rem; }
  main { padding:.8rem .65rem 1.5rem !important; }
  .home-stats,.math-app .stats,.stats-row { grid-template-columns:minmax(0,1fr) !important; }
  .vip-premium-showcase { flex-direction:column; }
  .auth-screen { padding:.7rem;align-items:start; }
  .auth-card { border-radius:18px;padding:1.05rem; }
}
@media (prefers-reduced-motion:reduce) {
  *,*::before,*::after { scroll-behavior:auto !important;animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important; }
}


/* Admin VIP-code registry */
.admin-code-label-field { margin:.9rem 0; }
.admin-code-label-field input { width:100%;min-height:44px; }
.admin-code-library { margin-top:1.5rem;padding-top:1.15rem;border-top:1px solid var(--border-color); }
.admin-code-library-heading { display:flex;align-items:flex-start;justify-content:space-between;gap:1rem;margin-bottom:.9rem; }
.admin-code-library-heading h4 { color:var(--text-main);font-size:1rem;margin:0 0 .25rem; }
.admin-code-library-heading .muted-note { margin:0;max-width:680px; }
.admin-code-library-heading .btn { flex:0 0 auto;margin:0; }
.admin-code-security-note { margin:.8rem 0 1rem;padding:.75rem .85rem;border:1px solid rgba(230,185,83,.25);border-radius:11px;background:rgba(230,185,83,.07);color:var(--text-muted);font-size:.75rem;line-height:1.5; }
.admin-code-list { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.8rem; }
.admin-code-item { min-width:0;padding:1rem;border:1px solid var(--border-color);border-radius:15px;background:var(--bg-card-dark); }
.admin-code-item-top { display:flex;align-items:flex-start;justify-content:space-between;gap:.6rem; }
.admin-code-item-title { min-width:0;display:flex;flex-direction:column;gap:.18rem; }
.admin-code-item-title strong { color:var(--text-main);font-size:.92rem;overflow-wrap:anywhere; }
.admin-code-reference { color:var(--text-dim);font-size:.68rem;font-variant-numeric:tabular-nums;letter-spacing:.04em; }
.admin-code-status { flex:0 0 auto;padding:.28rem .55rem;border-radius:99px;background:rgba(16,185,129,.12);color:#69d7ae;font-size:.65rem;font-weight:900; }
.admin-code-status.status-disabled { background:rgba(148,163,184,.13);color:#a8b4c5; }
.admin-code-status.status-expired,.admin-code-status.status-exhausted { background:rgba(244,63,94,.12);color:#ff9aa6; }
.admin-code-description { margin:.8rem 0 .6rem;color:var(--text-main);font-size:.8rem;font-weight:750; }
.admin-code-meta { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.35rem .7rem;color:var(--text-muted);font-size:.69rem; }
.admin-code-meta span { min-width:0;overflow-wrap:anywhere; }
.admin-code-progress { height:6px;margin:.8rem 0;border-radius:99px;background:rgba(148,163,184,.15);overflow:hidden; }
.admin-code-progress span { display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#b98730,#f1d27b); }
.admin-code-actions { display:flex;flex-wrap:wrap;gap:.45rem; }
.admin-code-actions .btn { flex:1 1 auto;margin:0;min-height:39px;padding:.55rem .65rem;font-size:.73rem; }
.btn-danger-soft { border:1px solid rgba(244,100,115,.35);background:rgba(244,63,94,.1);color:#ff9aa6;border-radius:11px;font-weight:800;cursor:pointer; }
.btn-danger-soft:hover { background:rgba(244,63,94,.18);border-color:rgba(244,100,115,.65); }
.btn-danger-soft:disabled,.admin-code-actions .btn:disabled { opacity:.45;cursor:not-allowed; }
.admin-code-load-more { width:100%;margin-top:.8rem; }
body.gold-mode .admin-code-item { border-color:rgba(227,184,91,.36);box-shadow:inset 0 1px 0 rgba(255,225,154,.05); }
body.premium-mode .admin-code-item { box-shadow:0 12px 30px rgba(0,0,0,.2),inset 0 1px 0 rgba(255,228,160,.08); }
body.light-gold-mode .admin-code-item { background:rgba(255,255,255,.72);border-color:#d7bd83; }
body.light-gold-mode .admin-code-item-title strong,body.light-gold-mode .admin-code-description { color:#4b3510; }
body.light-gold-mode .admin-code-meta,body.light-gold-mode .admin-code-reference { color:#78643e; }
@media (max-width:760px) {
  .admin-code-library-heading { flex-direction:column; }
  .admin-code-library-heading .btn { width:100%;min-height:44px; }
  .admin-code-list { grid-template-columns:minmax(0,1fr); }
  .admin-code-actions { display:grid;grid-template-columns:repeat(2,minmax(0,1fr)); }
  .admin-code-actions .btn { min-height:44px; }
}

/* =====================================================================
   VIP CODE MANAGER — simple status + reward view
   ===================================================================== */
.admin-code-create-row { display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:1rem;margin:.9rem 0 .25rem; }
.admin-code-create-row .account-form-group { margin:0; }
.admin-code-create-row select { width:100%;min-height:46px; }
.admin-code-create-row > .btn { min-height:46px;white-space:nowrap; }
.admin-code-rule { margin:.65rem 0 1rem;line-height:1.55; }
.admin-code-item { border-radius:15px; }
.admin-code-item-top { align-items:center; }
.admin-code-reference { color:var(--text-main);font-size:.82rem;font-weight:900;letter-spacing:.04em; }
.admin-code-description { margin:.9rem 0 .85rem;font-size:.9rem;font-weight:850;letter-spacing:.01em; }
.admin-code-status { text-transform:uppercase;letter-spacing:.06em; }
.admin-code-status.status-active { background:rgba(16,185,129,.13);color:#65d9b1;border:1px solid rgba(16,185,129,.25); }
.admin-code-status.status-inactive { background:rgba(148,163,184,.13);color:#aeb9c8;border:1px solid rgba(148,163,184,.22); }
.admin-code-actions { display:flex;gap:.6rem;margin-top:.35rem; }
.admin-code-actions .btn { min-height:42px; }

/* =====================================================================
   VIP GOLD MODE — softer antique-gold accents, not a full gold wash
   ===================================================================== */
body.gold-mode {
  --bg-main:#0d0d0c;
  --bg-card:#191918;
  --bg-card-dark:#121211;
  --bg-input:#141412;
  --border-color:#4a412e;
  --border-light:#746344;
  --text-main:#f6f0e2;
  --text-muted:#bcb29d;
  --text-dim:#92866d;
  --emerald:#cfb574;
  --emerald-dark:#8e713a;
  --emerald-bg:rgba(195,163,94,.12);
  --blue:#c4ae7b;
  --blue-dark:#8e713a;
  --blue-bg:rgba(195,163,94,.10);
  --purple:#c3ad7b;
  --purple-dark:#8e713a;
  --purple-bg:rgba(195,163,94,.09);
  --amber:#dcc58d;
  --amber-dark:#8e713a;
  --amber-bg:rgba(195,163,94,.12);
  --brand:#bca16a;
  --brand-dark:#806638;
  --brand-soft:rgba(188,161,106,.12);
  background-image:radial-gradient(ellipse at 12% 0%,rgba(190,157,87,.055),transparent 34%),radial-gradient(ellipse at 95% 16%,rgba(151,116,52,.045),transparent 30%) !important;
}
body.gold-mode .panel,
body.gold-mode .test-card,
body.gold-mode .home-stat,
body.gold-mode .flashcard-front,
body.gold-mode .flashcard-back,
body.gold-mode .math-app .chapter-card,
body.gold-mode .math-app .practice-card,
body.gold-mode .math-app .info-card,
body.gold-mode .math-app .quick-panel {
  border-color:rgba(194,166,108,.22) !important;
  box-shadow:0 9px 24px rgba(0,0,0,.20) !important;
}
body.gold-mode header { border-bottom-color:rgba(194,166,108,.25) !important;box-shadow:0 6px 22px rgba(0,0,0,.25) !important; }
body.gold-mode .brand-icon,
body.gold-mode .subject-icon,
body.gold-mode .account-avatar,
body.gold-mode .math-app .stat-icon,
body.gold-mode .math-app .chapter-icon {
  background:rgba(190,157,87,.12) !important;
  border:1px solid rgba(194,166,108,.32) !important;
  box-shadow:none !important;
}
body.gold-mode .nav-tab-btn.active,
body.gold-mode .btn-emerald,
body.gold-mode .btn-gradient,
body.gold-mode .btn-amber,
body.gold-mode .math-app .btn-primary {
  background:linear-gradient(135deg,#b89b60,#8d7444) !important;
  color:#18140b !important;
  border-color:rgba(224,202,151,.46) !important;
  box-shadow:none !important;
}
body.gold-mode .vip-panel,
body.gold-mode .admin-code-panel,
body.gold-mode .inventory-panel,
body.gold-mode .codes-panel-card {
  border:1px solid rgba(194,166,108,.34) !important;
  background:linear-gradient(145deg,#201e19,#171613 72%,#12110f) !important;
  box-shadow:0 10px 28px rgba(0,0,0,.24) !important;
}
body.gold-mode .vip-emblem,
body.gold-mode .vip-premium-mark {
  background:linear-gradient(135deg,#e4d1a2,#b69a62) !important;
  color:#282012 !important;
  border:1px solid rgba(231,213,169,.55) !important;
  box-shadow:none !important;
}
body.gold-mode .inventory-item {
  background:linear-gradient(120deg,rgba(190,157,87,.10),rgba(26,24,19,.92)) !important;
  border-color:rgba(190,157,87,.38) !important;
  box-shadow:none !important;
}
body.gold-mode .voucher-art { box-shadow:0 0 0 2px rgba(190,157,87,.10),0 5px 14px rgba(0,0,0,.20) !important; }
body.gold-mode .admin-code-item { border-color:rgba(194,166,108,.24) !important;box-shadow:none !important; }

/* =====================================================================
   PREMIUM EXPERIENCE — a different study workspace, not just a colour
   ===================================================================== */
body.premium-mode {
  --premium-accent:#8998ff;
  --premium-accent-strong:#6274e8;
  --premium-teal:#52d6c4;
}
body.premium-mode header .header-inner {
  max-width:1320px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:.8rem;
}
body.premium-mode header nav {
  width:100%;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:.45rem;
  padding:.5rem;
  border:1px solid rgba(137,152,255,.22);
  border-radius:17px;
  background:linear-gradient(110deg,rgba(94,109,201,.12),rgba(55,184,171,.07)),var(--bg-card-dark);
}
body.premium-mode header nav .nav-tab-btn {
  border:1px solid transparent;
  background:transparent;
  border-radius:11px;
  padding:.58rem .82rem;
  transition:background .18s,border-color .18s,transform .18s;
}
body.premium-mode header nav .nav-tab-btn:hover { background:rgba(137,152,255,.10);border-color:rgba(137,152,255,.2);transform:translateY(-1px); }
body.premium-mode header nav .nav-tab-btn.active {
  background:linear-gradient(120deg,#596ee2,#327f93) !important;
  color:#fff !important;
  border-color:rgba(184,199,255,.32) !important;
  box-shadow:0 5px 16px rgba(75,96,198,.24) !important;
}
body.premium-mode #nav-premium {
  order:1;
  background:rgba(137,152,255,.13);
  border-color:rgba(137,152,255,.26);
  color:#b9c4ff;
  font-weight:900;
}
body.premium-mode #account-button { margin-left:auto; }
body.premium-mode .home-hero,
body.premium-mode .math-app .hero {
  background-image:radial-gradient(circle at 90% 4%,rgba(93,125,238,.16),transparent 30%),linear-gradient(125deg,#1b2340,#151c2c 65%,#11232b) !important;
  border-color:rgba(130,151,255,.34) !important;
}
body.premium-mode .panel,
body.premium-mode .test-card,
body.premium-mode .home-stat,
body.premium-mode .math-app .chapter-card,
body.premium-mode .math-app .practice-card,
body.premium-mode .math-app .info-card,
body.premium-mode .math-app .quick-panel {
  border-color:rgba(137,152,255,.22) !important;
  box-shadow:0 12px 30px rgba(0,0,0,.22),0 0 0 1px rgba(82,214,196,.035) !important;
}
body.premium-mode .vip-premium-showcase {
  border-color:rgba(137,152,255,.42) !important;
  background:linear-gradient(120deg,rgba(88,105,210,.17),rgba(42,168,158,.11)),var(--bg-card-dark) !important;
  box-shadow:0 10px 24px rgba(0,0,0,.18) !important;
}
body.premium-mode .vip-premium-kicker { color:#aab6ff !important; }
body.premium-mode .vip-premium-copy h4 { color:#e5eaff !important; }
body.premium-mode .vip-premium-copy p { color:#b7c2d9 !important; }
body.premium-mode .vip-premium-perks span { color:#c5d0ff !important;border-color:rgba(137,152,255,.24) !important;background:rgba(137,152,255,.08) !important; }

.premium-page { max-width:1220px;margin:0 auto; }
.premium-page-hero {
  display:flex;align-items:center;justify-content:space-between;gap:1.2rem;
  padding:clamp(1.2rem,3vw,2.2rem);margin-bottom:1.25rem;border-radius:23px;
  border:1px solid rgba(137,152,255,.30);
  background:radial-gradient(circle at 88% 12%,rgba(105,127,241,.22),transparent 30%),radial-gradient(circle at 10% 95%,rgba(54,191,180,.13),transparent 34%),linear-gradient(120deg,#1c2441,#172137 70%,#132b31);
  box-shadow:0 16px 38px rgba(0,0,0,.22);
}
.premium-page-eyebrow { color:#aab6ff;font-size:.69rem;font-weight:950;letter-spacing:.17em;margin-bottom:.55rem; }
.premium-page-hero h1 { color:#f1f4ff;font-size:clamp(1.55rem,3.2vw,2.45rem);line-height:1.08;letter-spacing:-.045em;margin:0 0 .55rem; }
.premium-page-hero p { color:#bdc8dd;max-width:680px;font-size:.92rem;line-height:1.65;margin:0; }
.premium-hero-badge { flex:0 0 86px;width:86px;height:86px;display:grid;place-items:center;border-radius:25px;background:linear-gradient(145deg,rgba(137,152,255,.27),rgba(82,214,196,.15));border:1px solid rgba(167,184,255,.34);color:#d7e1ff;font-size:2.6rem;box-shadow:inset 0 1px 0 rgba(255,255,255,.12),0 12px 24px rgba(0,0,0,.16); }
.premium-tool-grid { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem; }
.premium-tool-card { min-width:0;padding:1.2rem;border-radius:19px;border:1px solid var(--border-color);background:linear-gradient(145deg,var(--bg-card),var(--bg-card-dark));box-shadow:0 10px 24px rgba(0,0,0,.16); }
.premium-tool-heading { display:flex;align-items:center;gap:.8rem;margin-bottom:1rem; }
.premium-tool-icon { flex:0 0 42px;width:42px;height:42px;display:grid;place-items:center;border-radius:13px;background:rgba(137,152,255,.13);border:1px solid rgba(137,152,255,.24);color:#aab6ff;font-size:1.25rem;font-weight:900; }
.premium-tool-heading h2 { font-size:1.02rem;margin:0 0 .12rem; }
.premium-tool-heading p { color:var(--text-muted);font-size:.77rem;margin:0;line-height:1.45; }
.premium-focus-clock { text-align:center;font-size:clamp(3rem,8vw,4.4rem);line-height:1;font-weight:950;letter-spacing:-.06em;font-variant-numeric:tabular-nums;color:#e8edff;margin:1.15rem 0; }
.premium-progress-track { width:100%;height:9px;border-radius:99px;overflow:hidden;background:rgba(137,152,255,.13);border:1px solid rgba(137,152,255,.12); }
.premium-progress-track span { display:block;width:0;height:100%;border-radius:inherit;background:linear-gradient(90deg,#677bea,#52d6c4);transition:width .25s linear; }
.premium-focus-controls { display:grid;grid-template-columns:minmax(0,1.25fr) repeat(3,minmax(0,1fr));gap:.45rem;margin-top:.95rem; }
.premium-focus-controls select,
.premium-goal-controls select,
.premium-challenge-card select { min-width:0;width:100%;min-height:43px;padding:.6rem .7rem;border-radius:11px;background:var(--bg-input);color:var(--text-main);border:1px solid var(--border-color); }
.premium-focus-controls .btn { min-height:43px;margin:0;padding:.55rem .7rem;font-size:.78rem; }
.premium-tool-status { min-height:1.3rem;color:var(--text-muted);font-size:.74rem;line-height:1.5;margin:.85rem 0 0; }
.premium-goal-total { display:flex;align-items:baseline;gap:.5rem;margin:.5rem 0 1rem; }
.premium-goal-total strong { font-size:2.7rem;line-height:1;font-weight:950;letter-spacing:-.05em;color:var(--premium-accent,#8998ff);font-variant-numeric:tabular-nums; }
.premium-goal-total span { color:var(--text-muted);font-size:.85rem; }
.premium-goal-controls { display:grid;grid-template-columns:minmax(0,1fr) minmax(125px,.8fr);align-items:center;gap:.8rem;margin-top:1rem;color:var(--text-muted);font-size:.78rem; }
.premium-challenge-card > label { display:block;color:var(--text-muted);font-size:.76rem;font-weight:800;margin:.8rem 0 .4rem; }
.premium-challenge-button { width:100%;margin-top:.75rem;min-height:48px;background:linear-gradient(120deg,#596ee2,#327f93) !important;color:#fff !important;border:1px solid rgba(184,199,255,.3) !important; }
.premium-shortcut-list { display:grid;gap:.55rem;margin-top:.75rem; }
.premium-shortcut { display:grid;grid-template-columns:38px minmax(0,1fr) auto;align-items:center;gap:.65rem;width:100%;padding:.7rem;border:1px solid var(--border-color);border-radius:13px;background:var(--bg-card-dark);color:var(--text-main);text-align:left;cursor:pointer; }
.premium-shortcut:hover { border-color:rgba(137,152,255,.42);background:rgba(137,152,255,.07); }
.premium-shortcut > span:first-child { width:36px;height:36px;display:grid;place-items:center;border-radius:11px;background:rgba(137,152,255,.12);font-size:1.2rem; }
.premium-shortcut strong,.premium-shortcut small { display:block; }
.premium-shortcut strong { font-size:.82rem; }
.premium-shortcut small { color:var(--text-muted);font-size:.7rem;margin-top:.12rem; }
.premium-shortcut > span:last-child { color:var(--premium-accent,#8998ff);font-size:1.2rem; }
.premium-visually-hidden { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0; }
body.light-theme .premium-page-hero,body.light-theme .premium-tool-card { box-shadow:0 10px 25px rgba(37,56,95,.08); }
body.light-theme .premium-focus-clock { color:#24334e; }
body.light-theme .premium-page-hero { background:radial-gradient(circle at 88% 12%,rgba(105,127,241,.15),transparent 30%),linear-gradient(120deg,#e9edff,#e7f8f5); }
body.light-theme .premium-page-hero h1 { color:#1d2b48; }
body.light-theme .premium-page-hero p { color:#526582; }
body.light-theme .premium-hero-badge { color:#596ee2;background:linear-gradient(145deg,#dfe5ff,#d9f7f1); }
body.light-gold-mode.premium-mode .premium-page-hero { background:linear-gradient(120deg,#f0e8d2,#e7f1ee) !important;border-color:rgba(137,152,255,.25) !important; }
body.light-gold-mode.premium-mode .premium-page-hero h1 { color:#26324b !important; }
body.light-gold-mode.premium-mode .premium-page-hero p { color:#59677b !important; }

@media(max-width:760px) {
  .admin-code-create-row { grid-template-columns:minmax(0,1fr); }
  .admin-code-create-row > .btn { width:100%; }
  .premium-page-hero { align-items:flex-start; }
  .premium-hero-badge { width:58px;height:58px;flex-basis:58px;border-radius:18px;font-size:1.8rem; }
  .premium-tool-grid { grid-template-columns:minmax(0,1fr); }
  .premium-focus-controls { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .premium-focus-controls select { grid-column:1/-1; }
  .premium-focus-controls .btn { min-height:46px; }
  .premium-goal-controls { grid-template-columns:minmax(0,1fr); }
  body.premium-mode header nav { display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin; }
  body.premium-mode header nav .nav-tab-btn { flex:0 0 auto;white-space:nowrap; }
  body.premium-mode #account-button { margin-left:0; }
}
@media(max-width:420px) {
  .premium-page-hero { padding:1.05rem;gap:.65rem; }
  .premium-page-hero h1 { font-size:1.55rem; }
  .premium-tool-card { padding:1rem; }
  .premium-focus-controls { gap:.4rem; }
}

/* Final Premium override: Premium's identity is indigo/teal; Gold remains optional. */
body.premium-mode .home-hero,
body.premium-mode .math-app .hero {
  background-image:radial-gradient(circle at 90% 4%,rgba(93,125,238,.16),transparent 30%),linear-gradient(125deg,#1b2340,#151c2c 65%,#11232b) !important;
  border:1px solid rgba(130,151,255,.34) !important;
}
body.premium-mode .panel,
body.premium-mode .test-card,
body.premium-mode .home-stat,
body.premium-mode .math-app .chapter-card,
body.premium-mode .math-app .practice-card,
body.premium-mode .math-app .info-card,
body.premium-mode .math-app .quick-panel {
  border-color:rgba(137,152,255,.22) !important;
  box-shadow:0 12px 30px rgba(0,0,0,.22),0 0 0 1px rgba(82,214,196,.035) !important;
}
body.premium-mode header nav .nav-tab-btn.active,
body.premium-mode .btn-emerald,
body.premium-mode .btn-gradient,
body.premium-mode .btn-amber,
body.premium-mode .math-app .btn-primary {
  box-shadow:none !important;
  filter:none !important;
}
body.premium-mode .vip-emblem { box-shadow:0 0 0 4px rgba(137,152,255,.10),0 8px 22px rgba(75,96,198,.16) !important; }
body.premium-mode .vip-panel { border-color:rgba(137,152,255,.38) !important;box-shadow:0 12px 28px rgba(0,0,0,.25) !important; }
body.premium-mode .vip-premium-mark { animation:none !important; }


/* Code usage policy selector: clear desktop layout, stacked on phones. */
.admin-code-create-row-scoped { grid-template-columns:minmax(0,1fr) minmax(0,1.25fr) auto; }
.admin-code-usage-scope { margin:-.45rem 0 .8rem;color:var(--text-muted);font-size:.72rem;font-weight:750;letter-spacing:.045em; }
body.gold-mode .admin-code-usage-scope { color:#c5b58e; }
body.premium-mode .admin-code-usage-scope { color:#b7c2d9; }
@media(max-width:760px) { .admin-code-create-row-scoped { grid-template-columns:minmax(0,1fr); } }


/* =====================================================================
   STUDYHUB UPDATE · Frankfurt API · Premium study navigation
   ===================================================================== */

/* Gold is deliberately restrained: the regular subject colours stay visible. */
body.gold-mode {
  --emerald:#75b59a;
  --emerald-dark:#34896c;
  --emerald-bg:rgba(98,171,137,.12);
  --blue:#81a6d4;
  --blue-dark:#416f9f;
  --blue-bg:rgba(105,151,207,.11);
  --purple:#b09acb;
  --purple-dark:#8066a7;
  --purple-bg:rgba(155,126,190,.10);
  --amber:#c9b27b;
  --amber-dark:#937b48;
  --amber-bg:rgba(184,155,94,.11);
  --border-color:#403b30;
  --border-light:#625840;
  --text-main:#f2efe8;
  --text-muted:#b8b2a5;
  --text-dim:#8e8879;
  background-image:radial-gradient(ellipse at 12% 0%,rgba(190,157,87,.025),transparent 34%) !important;
}
body.gold-mode .panel,
body.gold-mode .test-card,
body.gold-mode .home-stat,
body.gold-mode .flashcard-front,
body.gold-mode .flashcard-back,
body.gold-mode .math-app .chapter-card,
body.gold-mode .math-app .practice-card,
body.gold-mode .math-app .info-card,
body.gold-mode .math-app .quick-panel {
  border-color:rgba(194,166,108,.12) !important;
  box-shadow:0 8px 22px rgba(0,0,0,.16) !important;
}
body.gold-mode header { border-bottom-color:rgba(194,166,108,.16) !important; }
body.gold-mode .nav-tab-btn.active {
  background:var(--bg-card) !important;
  color:#d7c49a !important;
  border:1px solid rgba(194,166,108,.22) !important;
  box-shadow:none !important;
}
body.gold-mode .btn-emerald,
body.gold-mode .btn-gradient,
body.gold-mode .math-app .btn-primary {
  background:var(--emerald-dark) !important;
  color:#fff !important;
  border-color:rgba(117,181,154,.22) !important;
}
body.gold-mode .btn-amber {
  background:rgba(184,155,94,.15) !important;
  color:#d7c49a !important;
  border:1px solid rgba(184,155,94,.24) !important;
  box-shadow:none !important;
}
body.gold-mode .brand-icon,
body.gold-mode .subject-icon,
body.gold-mode .account-avatar,
body.gold-mode .math-app .chapter-icon {
  background:rgba(184,155,94,.07) !important;
  border-color:rgba(194,166,108,.18) !important;
  box-shadow:none !important;
}
body.gold-mode .vip-panel,
body.gold-mode .admin-code-panel,
body.gold-mode .inventory-panel,
body.gold-mode .codes-panel-card {
  border-color:rgba(194,166,108,.23) !important;
  background:linear-gradient(145deg,#1c1b18,#151512) !important;
  box-shadow:none !important;
}
body.gold-mode .vip-emblem,
body.gold-mode .vip-premium-mark {
  background:rgba(184,155,94,.16) !important;
  color:#d7c49a !important;
  border:1px solid rgba(194,166,108,.24) !important;
  box-shadow:none !important;
}
body.gold-mode .inventory-item {
  background:linear-gradient(120deg,rgba(184,155,94,.06),rgba(26,24,19,.92)) !important;
  border-color:rgba(190,157,87,.20) !important;
  box-shadow:none !important;
}
body.light-gold-mode {
  --bg-main:#f5f3ed;
  --bg-card:#ffffff;
  --bg-card-dark:#faf9f5;
  --bg-input:#fff;
  --border-color:#e4dfd2;
  --border-light:#cfc6b2;
  --text-main:#252a32;
  --text-muted:#69717c;
  --text-dim:#858b93;
}
body.light-gold-mode .nav-tab-btn.active { background:#fff !important;color:#806b42 !important;border-color:rgba(160,135,83,.25) !important; }
body.light-gold-mode .btn-amber { background:rgba(184,155,94,.12) !important;color:#806b42 !important; }

/* Premium uses a distinct indigo/teal learning workspace, separate from Gold Mode. */
body.premium-mode header nav .subject-nav,
body.premium-mode header nav .math-nav { display:none !important; }
body.premium-mode header nav {
  justify-content:flex-start;
  gap:.55rem;
  background:linear-gradient(110deg,rgba(91,108,205,.13),rgba(50,160,153,.08)),var(--bg-card-dark);
  border-color:rgba(137,152,255,.16);
}
body.premium-mode header nav .nav-tab-btn {
  min-height:43px;
  padding:.65rem 1rem;
  border-radius:12px;
  font-size:.82rem;
  font-weight:850;
}
body.premium-mode header nav #nav-home { order:0; }
body.premium-mode header nav #nav-premium { order:1; }
body.premium-mode header nav #account-button { order:2;margin-left:auto; }
body.premium-mode header nav #nav-premium.active {
  background:linear-gradient(120deg,#566bd5,#2e8f91) !important;
  color:#fff !important;
  border-color:rgba(160,190,255,.28) !important;
}

.premium-subject-toolbar {
  display:none;
  max-width:1220px;
  margin:0 auto 1.15rem;
  padding:.75rem;
  align-items:center;
  justify-content:space-between;
  gap:1rem;
  border:1px solid rgba(137,152,255,.18);
  border-radius:17px;
  background:linear-gradient(110deg,rgba(91,108,205,.12),rgba(50,160,153,.07)),var(--bg-card);
  box-shadow:0 9px 24px rgba(0,0,0,.12);
}
body.premium-mode.premium-subject-context.subject-open:not(.math-open) #premium-geo-toolbar,
body.premium-mode.premium-subject-context.math-open #premium-math-toolbar { display:flex; }
.premium-subject-brand { display:flex;align-items:center;gap:.65rem;min-width:max-content;padding:.15rem .35rem; }
.premium-subject-brand-icon { width:39px;height:39px;display:grid;place-items:center;border-radius:12px;background:rgba(137,152,255,.13);border:1px solid rgba(137,152,255,.22);font-size:1.25rem; }
.premium-subject-brand small,.premium-subject-brand strong { display:block; }
.premium-subject-brand small { color:#9aa8dc;font-size:.58rem;font-weight:900;letter-spacing:.13em; }
.premium-subject-brand strong { color:var(--text-main);font-size:.87rem; }
.premium-subject-tabs { display:flex;align-items:center;gap:.38rem;min-width:0; }
.premium-subject-tabs button {
  min-height:42px;padding:.62rem .82rem;border:1px solid transparent;border-radius:11px;
  background:transparent;color:var(--text-muted);font:inherit;font-size:.75rem;font-weight:850;white-space:nowrap;cursor:pointer;
  transition:background .16s,border-color .16s,color .16s,transform .16s;
}
.premium-subject-tabs button:hover { background:rgba(137,152,255,.09);border-color:rgba(137,152,255,.16);color:var(--text-main);transform:translateY(-1px); }
.premium-subject-tabs button.active { background:linear-gradient(120deg,#566bd5,#2e8f91);color:#fff;border-color:rgba(160,190,255,.24);box-shadow:0 4px 12px rgba(72,94,181,.14); }
body.premium-mode .premium-subject-toolbar { border-color:rgba(137,152,255,.18) !important; }
body.premium-mode .subject-intro-panel { background:linear-gradient(120deg,rgba(86,107,213,.12),rgba(46,143,145,.06)),var(--bg-card) !important; }
body.premium-mode .geo-topic-grid .test-card {
  min-height:255px;display:flex;flex-direction:column;justify-content:space-between;gap:1.1rem;
  border-radius:18px !important;background:linear-gradient(145deg,var(--bg-card),var(--bg-card-dark)) !important;
}
body.premium-mode .geo-topic-grid .test-card h3 { font-size:1.12rem;letter-spacing:-.02em; }
body.premium-mode .geo-topic-grid .test-card .btn { min-height:46px;border-radius:11px;font-weight:850; }
body.premium-mode .math-app .hero { border-radius:22px !important; }
body.premium-mode .math-app .chapter-grid { gap:1rem; }
body.premium-mode .math-app .chapter-card {
  border-radius:18px !important;background:linear-gradient(145deg,var(--bg-card),var(--bg-card-dark)) !important;
  padding:1.15rem !important;transition:transform .16s,border-color .16s,box-shadow .16s;
}
body.premium-mode .math-app .chapter-card:hover { transform:translateY(-3px);border-color:rgba(137,152,255,.38) !important; }
body.premium-mode .math-app .chapter-footer span { color:#aab6ff !important;font-weight:900; }
body.premium-mode .math-app .btn-primary,
body.premium-mode .premium-page .btn-primary,
body.premium-mode .geo-topic-grid .btn {
  border-radius:12px !important;background:linear-gradient(120deg,#566bd5,#2e8f91) !important;color:#fff !important;
  border:1px solid rgba(160,190,255,.22) !important;box-shadow:0 5px 14px rgba(61,82,170,.14) !important;font-weight:850;
}
body.premium-mode .math-app .btn-light,
body.premium-mode .premium-page .btn-light { border-radius:12px !important;border:1px solid rgba(137,152,255,.18) !important;background:rgba(137,152,255,.07) !important;color:var(--text-main) !important; }
body.premium-mode .premium-tool-card { border-radius:20px;border-color:rgba(137,152,255,.18); }
body.premium-mode .premium-tool-card:nth-child(2) { background:linear-gradient(145deg,rgba(46,143,145,.09),transparent 70%),var(--bg-card-dark); }
body.premium-mode .premium-tool-card:nth-child(3) { background:linear-gradient(145deg,rgba(86,107,213,.10),transparent 70%),var(--bg-card-dark); }
body.premium-mode .premium-shortcut { border-radius:14px; }
body.premium-mode .vip-premium-showcase { border-color:rgba(137,152,255,.22) !important; }

/* Admin Codes is a dedicated settings sub-page, not a card mixed into normal settings. */
.account-hero-actions { display:flex;align-items:center;justify-content:flex-end;gap:.55rem;flex-wrap:wrap; }
#account-content.account-admin-codes-open > :not(#admin-code-panel) { display:none !important; }
#section-account.admin-code-focus #account-admin-menu { display:none !important; }
.admin-code-panel-heading { align-items:center; }
.admin-code-heading-actions { display:flex;align-items:center;gap:.55rem;flex-wrap:wrap; }
.admin-code-heading-actions .btn { min-height:42px; }
.admin-code-item { border-color:var(--border-color) !important;box-shadow:none !important; }
.admin-code-item-top { gap:.75rem; }
.admin-code-status.status-active { background:rgba(16,185,129,.12);color:#65d9b1;border-color:rgba(16,185,129,.22); }
.admin-code-status.status-inactive { background:rgba(148,163,184,.10);color:#aeb9c8;border-color:rgba(148,163,184,.18); }

@media(max-width:760px) {
  .premium-subject-toolbar { display:none !important;max-width:none;margin:0 0 .9rem;padding:.65rem;align-items:stretch;flex-direction:column;gap:.55rem; }
  body.premium-mode.premium-subject-context.subject-open:not(.math-open) #premium-geo-toolbar,
  body.premium-mode.premium-subject-context.math-open #premium-math-toolbar { display:flex !important; }
  .premium-subject-brand { padding:.1rem .2rem; }
  .premium-subject-tabs { overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;padding-bottom:2px; }
  .premium-subject-tabs button { flex:0 0 auto;min-height:43px;padding:.65rem .76rem; }
  .account-hero-actions { width:100%;justify-content:stretch; }
  .account-hero-actions .btn { flex:1 1 140px;min-height:44px; }
  .admin-code-panel-heading { align-items:flex-start; }
  .admin-code-heading-actions { width:100%;justify-content:space-between; }
  .admin-code-heading-actions .btn { flex:1; }
  #account-content.account-admin-codes-open > #admin-code-panel { min-width:0; }
}
@media(max-width:420px) {
  .premium-subject-toolbar { border-radius:14px; }
  .premium-subject-tabs button { font-size:.7rem;padding:.6rem .68rem; }
  .premium-hero-badge { display:none; }
}

/* Admin code manager occupies the full settings content width when opened. */
#account-content.account-admin-codes-open > #admin-code-panel { grid-column:1 / -1; width:100%; }


/* Lifetime VIP collectible — permanent item with an equip / store toggle. */
.lifetime-collectible {
  border-color: rgba(192, 164, 104, .34);
  background: linear-gradient(135deg, rgba(110, 91, 52, .18), rgba(20, 29, 43, .94) 72%);
}
.lifetime-collectible.is-equipped {
  box-shadow: inset 0 0 0 1px rgba(192, 164, 104, .12), 0 5px 18px rgba(0, 0, 0, .12);
}
.lifetime-collectible.is-stored { opacity: .82; }
.lifetime-voucher-art {
  border-color: #bba16a;
  background: linear-gradient(145deg, #ddd0a8, #a88e57 58%, #6b5935);
  color: #17191e;
  box-shadow: 0 4px 12px rgba(185, 156, 92, .12);
}
.lifetime-voucher-art:after { content: "∞"; font-size: .68rem; }
.lifetime-collectible-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: .42rem;
  padding: .13rem .42rem;
  border-radius: 999px;
  font-size: .58rem;
  font-weight: 900;
  letter-spacing: .09em;
}
.lifetime-collectible-state.active {
  color: #b9dfcb;
  background: rgba(58, 132, 94, .16);
  border: 1px solid rgba(104, 186, 139, .24);
}
.lifetime-collectible-state.inactive {
  color: var(--text-muted);
  background: rgba(116, 130, 151, .12);
  border: 1px solid rgba(116, 130, 151, .2);
}
body.light-theme .lifetime-collectible {
  background: linear-gradient(135deg, #f4f0e5, #fff 75%);
  border-color: #d6c9a9;
}
body.light-theme .lifetime-voucher-art {
  background: linear-gradient(145deg, #f0e5c8, #c3ad79 58%, #8b754b);
}
@media (max-width: 540px) {
  .lifetime-collectible { align-items: center; }
  .lifetime-collectible .inventory-item-copy { flex: 1 1 calc(100% - 76px); }
  .lifetime-collectible > .btn { min-height: 44px; flex: 1 1 100%; }
}
