:root {
            /* Algebra Domain / Rose Theme override */
            --color-rose: #f43f5e;
            --color-rose-glow: rgba(244, 63, 94, 0.35);
            --color-accent: #f43f5e;
            --color-accent-glow: rgba(244, 63, 94, 0.35);

            --color-dist: #f43f5e;      /* Rose for Distributive Expansion */
            --color-double: #a855f7;    /* Purple for Double Expansion */
            --color-frac: #38bdf8;      /* Cyan for Fractional Division */
            --color-amber: #ffb000;     /* Amber for constant unit blocks */
            --color-amber-glow: rgba(255, 176, 0, 0.35);
        }

        /* Highlight active menu item for Algebra Domain */
        .sidebar-drawer .syllabus-item.active a {
            background: var(--color-rose) !important;
            box-shadow: 0 4px 20px var(--color-rose-glow) !important;
            color: var(--bg-color) !important;
        }

        .sidebar-drawer .syllabus-item.active a .syllabus-title {
            color: var(--bg-color) !important;
        }

        .sidebar-drawer .syllabus-item.active a .syllabus-desc {
            color: rgba(0, 0, 0, 0.6) !important;
        }

        section {
            margin-bottom: 6rem;
            scroll-margin-top: 2rem;
        }

        .section-header {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 1.75rem;
        }

        .section-tag {
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.8rem;
            color: var(--color-rose);
            background: rgba(244, 63, 94, 0.1);
            padding: 4px 10px;
            border-radius: 6px;
            border: 1px solid rgba(244, 63, 94, 0.2);
            text-shadow: 0 0 5px var(--color-rose-glow);
        }

        .section-header h2 {
            font-size: 1.75rem;
            font-weight: 700;
        }

        .section-intro {
            color: var(--text-muted);
            margin-bottom: 2rem;
            line-height: 1.6;
            font-size: 1rem;
            max-width: 850px;
        }

        .equation-box {
            font-family: 'Outfit', sans-serif;
            font-size: 1.5rem;
            font-weight: 700;
            text-align: center;
            padding: 1.25rem;
            background: rgba(255, 255, 255, 0.015);
            border-radius: 16px;
            border: 1px dashed rgba(255, 255, 255, 0.06);
            margin-bottom: 1.5rem;
            color: var(--text-color);
        }

        /* Controls styling */
        .slider-group {
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
            margin-bottom: 1.5rem;
        }

        .slider-row {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .slider-label {
            display: flex;
            justify-content: space-between;
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-muted);
        }

        .slider-row input[type="range"] {
            -webkit-appearance: none;
            width: 100%;
            height: 6px;
            background: rgba(255, 255, 255, 0.08);
            border-radius: 3px;
            outline: none;
            margin: 8px 0;
        }

        .slider-row input[type="range"]::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            cursor: pointer;
            transition: transform 0.1s ease;
        }

        /* Thumb colors by section */
        #distributive input[type="range"]::-webkit-slider-thumb {
            background: var(--color-dist);
            box-shadow: 0 0 8px var(--color-rose-glow);
        }
        #double input[type="range"]::-webkit-slider-thumb {
            background: var(--color-double);
            box-shadow: 0 0 8px var(--color-purple-glow);
        }
        #fraction input[type="range"]::-webkit-slider-thumb {
            background: var(--color-frac);
            box-shadow: 0 0 8px var(--color-cyan-glow);
        }

        .slider-row input[type="range"]::-webkit-slider-thumb:hover {
            transform: scale(1.2);
        }

        .formula-steps {
            background: rgba(0, 0, 0, 0.25);
            border-radius: 12px;
            padding: 1.25rem;
            font-family: 'JetBrains Mono', monospace;
            font-size: 0.85rem;
            line-height: 1.6;
            color: var(--text-color);
            border: 1px solid var(--card-border);
        }

        /* Action Buttons by theme */
        .btn-action {
            width: 100%;
            padding: 0.75rem;
            border-radius: 12px;
            font-family: 'Outfit', sans-serif;
            font-weight: 700;
            font-size: 0.9rem;
            cursor: pointer;
            transition: all var(--transition-speed) ease;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 1.5rem;
            border: 1px solid transparent;
        }

        .btn-dist {
            background: rgba(244, 63, 94, 0.1);
            color: var(--color-dist);
            border-color: rgba(244, 63, 94, 0.25);
        }
        .btn-dist:hover {
            background: var(--color-dist);
            color: #000;
            box-shadow: 0 4px 15px var(--color-rose-glow);
            transform: translateY(-1px);
        }

        .btn-double {
            background: rgba(168, 85, 247, 0.1);
            color: var(--color-double);
            border-color: rgba(168, 85, 247, 0.25);
        }
        .btn-double:hover:not(:disabled) {
            background: var(--color-double);
            color: #fff;
            box-shadow: 0 4px 15px var(--color-purple-glow);
            transform: translateY(-1px);
        }
        .btn-double:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        .btn-frac {
            background: rgba(56, 189, 248, 0.1);
            color: var(--color-frac);
            border-color: rgba(56, 189, 248, 0.25);
        }
        .btn-frac:hover {
            background: var(--color-frac);
            color: #000;
            box-shadow: 0 4px 15px var(--color-cyan-glow);
            transform: translateY(-1px);
        }

        /* Double Stage Controls Row */
        .stage-btn-row {
            display: flex;
            gap: 8px;
            margin-bottom: 1rem;
        }
        .btn-stage-control {
            flex: 1;
            padding: 0.5rem;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid var(--card-border);
            border-radius: 8px;
            color: var(--text-muted);
            font-size: 0.8rem;
            cursor: pointer;
            transition: all 0.2s ease;
            font-family: 'Outfit', sans-serif;
            font-weight: 600;
        }
        .btn-stage-control.active {
            background: rgba(168, 85, 247, 0.15);
            color: var(--color-double);
            border-color: rgba(168, 85, 247, 0.3);
        }

        /* Quiz styling */
        .quiz-option {
            background: rgba(255, 255, 255, 0.015);
            border: 1px solid var(--card-border);
            border-radius: 12px;
            padding: 1rem 1.25rem;
            margin-bottom: 0.75rem;
            cursor: pointer;
            transition: all var(--transition-speed) ease;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .quiz-option:hover {
            background: rgba(255, 255, 255, 0.04);
            border-color: rgba(255, 255, 255, 0.1);
            transform: translateX(4px);
        }

        .quiz-option.correct {
            background: rgba(16, 185, 129, 0.08);
            border-color: rgba(16, 185, 129, 0.3);
            color: #10b981;
        }

        .quiz-option.incorrect {
            background: rgba(244, 63, 94, 0.08);
            border-color: rgba(244, 63, 94, 0.3);
            color: #f43f5e;
        }

        .quiz-feedback {
            margin-top: 1rem;
            padding: 1rem;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid var(--card-border);
            font-size: 0.9rem;
            line-height: 1.5;
            display: none;
        }

        .quiz-score-overlay {
            text-align: center;
            padding: 2.5rem 2rem;
            background: rgba(0, 0, 0, 0.25);
            border-radius: 16px;
            border: 1px solid var(--card-border);
        }

        .term-box {
            background: rgba(244, 63, 94, 0.12);
            border: 1px solid rgba(244, 63, 94, 0.3);
            border-radius: 8px;
            padding: 0.5rem 0.75rem;
        }