/* 🚀 Premium Animations & Smooth Transitions */
        @keyframes slideUpFade {
            from {
                opacity: 0;
                transform: translateY(16px) scale(0.985);
            }
            to {
                opacity: 1;
                transform: translateY(0) scale(1);
            }
        }

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

        @keyframes toastSlideIn {
            0% {
                opacity: 0;
                transform: translateX(120%) scale(0.9);
            }
            70% {
                transform: translateX(-8px) scale(1.02);
            }
            100% {
                opacity: 1;
                transform: translateX(0) scale(1);
            }
        }

        @keyframes toastSlideOut {
            0% {
                opacity: 1;
                transform: translateX(0) scale(1);
            }
            100% {
                opacity: 0;
                transform: translateX(130%) scale(0.9);
            }
        }

        @keyframes heartPop {
            0% { transform: scale(1); }
            50% { transform: scale(1.45); }
            100% { transform: scale(1); }
        }

        @keyframes pulseGlow {
            0%, 100% { opacity: 0.15; }
            50% { opacity: 0.35; }
        }

        /* Active page animations with GPU-composited hardware acceleration */
        html {
            scroll-behavior: smooth !important;
        }
        .overflow-y-auto, .overflow-y-scroll {
            scroll-behavior: smooth !important;
            -webkit-overflow-scrolling: touch !important; /* Premium elastic inertia scrolling */
        }

        .view-panel {
            animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            will-change: transform, opacity;
            backface-visibility: hidden;
            perspective: 1000px;
        }
        /* Page-change crossfade: applied for ~140ms right before a tab is hidden,
           so switching pages eases out instead of cutting instantly. */
        .view-panel.view-fade-out {
            animation: none !important;
            opacity: 0 !important;
            transform: translateY(-8px) scale(0.985) !important;
            transition: opacity 0.14s ease, transform 0.14s ease;
            pointer-events: none;
        }
        /* Login ⇄ Portal crossfade — this used to be an instant hard cut, the
           single biggest visual jump in the whole app. Now it eases out/in. */
        #login-section, #portal-section { transition: opacity 0.18s ease; }
        .app-fade-out { opacity: 0 !important; pointer-events: none; }
        .app-fade-in { animation: slideUpFade 0.45s cubic-bezier(0.16, 1, 0.3, 1) both; }

        /* 🌊 Global smoothing pass: every Tailwind transition-* utility in the app
           (buttons, nav items, cards, badges — hundreds of elements) upgrades from
           Tailwind's default ease to one consistent, premium "settle" curve, so
           hovers/focus/active states feel like one smooth system instead of each
           hand-tuned duration-300 fighting its neighbours. Safe: this only
           overrides the timing-function, never which properties animate. */
        .transition-all, .transition, .transition-colors, .transition-transform,
        .transition-opacity, .transition-shadow, [class*="transition-all"] {
            transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1) !important;
        }
        /* Buttons want a snappier, springier release than cards/panels do */
        button, .interactive-btn, .nav-btn, .ripple-btn {
            transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1) !important;
        }

        /* Modal animate states — now covers every modal in the app (Student/Video/
           Material/Request/Tutoring/New-Chat/Liked-Users/Student-Stats) so all of
           them pop in consistently instead of only the original four. */
        #student-modal:not(.hidden) > div,
        #edit-student-modal:not(.hidden) > div,
        #video-modal:not(.hidden) > div,
        #material-upload-modal:not(.hidden) > div,
        #request-account-modal:not(.hidden) > div,
        #tutoring-modal:not(.hidden) > div,
        #new-chat-modal:not(.hidden) > div,
        #liked-users-modal:not(.hidden) > div,
        #student-stats-modal:not(.hidden) > div {
            animation: modalScaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }

        /* Smooth modal EXIT — a fade + gentle scale-down driven by a plain CSS
           transition (not a keyframe, so it can be interrupted cleanly), applied
           via the .modal-closing class right before .hidden lands. Every modal
           in the app used to just vanish instantly on close before this. */
        #student-modal, #video-modal, #material-upload-modal, #request-account-modal,
        #tutoring-modal, #new-chat-modal, #liked-users-modal, #student-stats-modal {
            transition: opacity 0.2s ease;
        }
        #student-modal > div, #video-modal > div, #material-upload-modal > div,
        #request-account-modal > div, #tutoring-modal > div, #new-chat-modal > div,
        #liked-users-modal > div, #student-stats-modal > div {
            transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1), opacity 0.2s ease;
        }
        .modal-closing { opacity: 0 !important; pointer-events: none; }
        .modal-closing > div { animation: none !important; transform: scale(0.95) translateY(6px) !important; opacity: 0 !important; }

        /* 🖱️ Custom smooth scrollbar — every scroll area in the app used to use
           the bare browser default. Now it's a soft indigo thumb that brightens
           on hover, with a transition instead of an instant color swap. */
        .overflow-y-auto, .overflow-y-scroll, .overflow-auto {
            scrollbar-width: thin;
            scrollbar-color: rgba(99, 102, 241, 0.35) transparent;
        }
        .overflow-y-auto::-webkit-scrollbar, .overflow-y-scroll::-webkit-scrollbar, .overflow-auto::-webkit-scrollbar { width: 7px; height: 7px; }
        .overflow-y-auto::-webkit-scrollbar-track, .overflow-y-scroll::-webkit-scrollbar-track, .overflow-auto::-webkit-scrollbar-track { background: transparent; }
        .overflow-y-auto::-webkit-scrollbar-thumb, .overflow-y-scroll::-webkit-scrollbar-thumb, .overflow-auto::-webkit-scrollbar-thumb {
            background-color: rgba(99, 102, 241, 0.35);
            border-radius: 999px;
            transition: background-color 0.25s ease;
        }
        .overflow-y-auto:hover::-webkit-scrollbar-thumb, .overflow-y-scroll:hover::-webkit-scrollbar-thumb, .overflow-auto:hover::-webkit-scrollbar-thumb {
            background-color: rgba(129, 140, 248, 0.65);
        }

        /* 🧭 Nav icons get a small springy bounce on hover instead of sitting
           static — cheap, subtle, and now applied to every sidebar item. */
        @keyframes navIconBounce {
            0%, 100% { transform: translateY(0) scale(1); }
            35% { transform: translateY(-2px) scale(1.12); }
            60% { transform: translateY(0.5px) scale(0.97); }
        }
        .nav-btn:hover [data-lucide] { animation: navIconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1); }

        /* 🔎 Inputs get a soft glow that eases in on focus rather than the
           instant hard outline swap Tailwind gives them by default. */
        input, textarea, select {
            transition: border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                        box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                        background-color 0.25s ease !important;
        }
        input:focus, textarea:focus, select:focus {
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
        }

        /* 🏷️ Badges/pills breathe in gently when they first render (XP badge,
           rank badge, filter chips) instead of just appearing mid-layout. */
        [id*="badge"], [id*="rank"] { animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) both; }

        /* Liking bounce effect */
        .fill-red-500 {
            animation: heartPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }

        /* Custom Toast overrides */
        .toast-slide-in {
            animation: toastSlideIn 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }
        .toast-slide-out {
            animation: toastSlideOut 0.35s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
        }

        /* Submitted items highlight transitions */
        .fade-in-item {
            animation: slideUpFade 0.35s ease-out forwards;
        }

        /* Premium glow-pulse on important workspace cards */
        .premium-glow {
            position: relative;
            overflow: hidden;
        }
        .premium-glow::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.15), transparent 70%);
            pointer-events: none;
        }

        /* Interactive scaling on click states */
        .interactive-btn {
            transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .interactive-btn:active {
            transform: scale(0.96);
        }

        /* Extra high fidelity custom styles and gradients */
        @keyframes floatSparks {
            0% { transform: translateY(0px) rotate(0deg); opacity: 0.2; }
            50% { transform: translateY(-10px) rotate(180deg); opacity: 0.6; }
            100% { transform: translateY(0px) rotate(360deg); opacity: 0.2; }
        }
        .animate-float-spark {
            
        }
        .radial-progress-ring {
            transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .dashboard-header-glow {
            box-shadow: 0 0 50px -12px rgba(99, 102, 241, 0.15);
        }
        .glass-panel {
            background: rgba(11, 15, 25, 0.65);
            
            
            border: 1px solid rgba(31, 41, 55, 0.7);
            transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
        }
        .glass-panel:hover {
            border-color: rgba(99, 102, 241, 0.25);
            box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
            transform: translateY(-2px);
        }
        .rank-emerald {
            background: rgba(6, 78, 59, 0.2);
            border: 1px solid rgba(16, 185, 129, 0.2);
            color: #10b981;
            text-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
        }
        .rank-blue {
            background: rgba(30, 58, 138, 0.2);
            border: 1px solid rgba(59, 130, 246, 0.2);
            color: #3b82f6;
            text-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
        }
        .rank-amber {
            background: rgba(120, 53, 4, 0.2);
            border: 1px solid rgba(245, 158, 11, 0.2);
            color: #f59e0b;
            text-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
        }
        .rank-red {
            background: rgba(239, 68, 68, 0.03) !important;
            border: 1px solid rgba(239, 68, 68, 0.4) !important;
            color: #ef4444 !important;
            text-shadow: none !important;
        }

        /* 💎 Premium Ambient Glassmorphic Styling and Background Blobs */
        .bg-blob-indigo {
            position: fixed;
            width: 600px;
            height: 600px;
            background: radial-gradient(circle, rgba(99, 102, 241, 0.12) 0%, rgba(99, 102, 241, 0) 70%);
            top: -150px;
            right: -150px;
            /* filter blur replaced with native radial gradient */
            pointer-events: none;
            z-index: 0;
            
        }
        .bg-blob-cyan {
            position: fixed;
            width: 600px;
            height: 600px;
            background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, rgba(6, 182, 212, 0) 70%);
            bottom: -150px;
            left: -150px;
            /* filter blur replaced with native radial gradient */
            pointer-events: none;
            z-index: 0;
            
        }
        .bg-blob-purple {
            position: fixed;
            width: 500px;
            height: 500px;
            background: radial-gradient(circle, rgba(139, 92, 246, 0.07) 0%, rgba(139, 92, 246, 0) 70%);
            top: 40%;
            left: 20%;
            /* filter blur replaced with native radial gradient */
            pointer-events: none;
            z-index: 0;
            
        }

        /* Standard Glassmorphic Elements */
        .glass-card {
            background: rgba(15, 23, 42, 0.4);
            
            
            border: 1px solid rgba(255, 255, 255, 0.08);
            box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .glass-card:hover {
            border-color: rgba(99, 102, 241, 0.25);
            box-shadow: 0 12px 40px -10px rgba(99, 102, 241, 0.15);
            background: rgba(15, 23, 42, 0.48);
            transform: translateY(-2px);
        }

        .glass-sidebar {
            background: rgba(11, 15, 25, 0.55) !important;
            backdrop-filter: blur(8px) !important;
            -webkit-backdrop-filter: blur(8px) !important;
            border: 1px solid rgba(255, 255, 255, 0.08) !important;
            box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.45) !important;
            border-radius: 24px !important;
            position: relative;
            z-index: 30;
        }

        .glass-header {
            background: rgba(11, 15, 25, 0.2);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        }

        .glass-modal {
            background: rgba(11, 15, 25, 0.55);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.1);
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
        }

        .glass-main-panel {
            background: rgba(11, 15, 25, 0.35) !important;
            
            
            border: 1px solid rgba(255, 255, 255, 0.08) !important;
            box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.35) !important;
            border-radius: 24px !important;
        }

        /* ===================================================================== */
        /* 🌗 GLOBAL THEME VARIABLES & SYSTEM LIGHT/DARK OVERRIDES */
        /* ===================================================================== */
        :root {
            --bg-main: #020308; /* Deep rich matte onyx */
            --bg-panel: rgba(10, 15, 30, 0.45); /* High clarity glass panel background */
            --bg-card: rgba(8, 12, 24, 0.5); /* Deep matte carbon card */
            --border-glass: rgba(255, 255, 255, 0.08); /* Extremely fine refraction outline */
            --text-main: #ffffff;
            --text-muted: #94a3b8;
            --bg-input: rgba(5, 7, 12, 0.65);
            --shadow-soft: 0 20px 40px -15px rgba(0, 0, 0, 0.6);
            --neumorphic-flat: 8px 8px 16px rgba(0, 0, 0, 0.45), -8px -8px 16px rgba(255, 255, 255, 0.01);
            --neumorphic-inset: inset 3px 3px 6px rgba(0, 0, 0, 0.45), inset -3px -3px 6px rgba(255, 255, 255, 0.01);
        }

        .light-theme {
            --bg-main: #f1f5f9;
            --bg-panel: rgba(255, 255, 255, 0.75);
            --bg-card: rgba(255, 255, 255, 0.65);
            --border-glass: rgba(99, 102, 241, 0.15);
            --text-main: #0f172a;
            --text-muted: #475569;
            --bg-input: rgba(255, 255, 255, 0.9);
            --shadow-soft: 0 10px 30px -5px rgba(99, 102, 241, 0.05);
            --neumorphic-flat: 4px 4px 10px rgba(99, 102, 241, 0.04), -4px -4px 10px rgba(255, 255, 255, 0.9);
            --neumorphic-inset: inset 2px 2px 4px rgba(99, 102, 241, 0.04), inset -2px -2px 4px rgba(255, 255, 255, 0.9);
        }
        
        .light-theme .shadow-2xl {
            box-shadow: 0 25px 50px -12px rgba(99, 102, 241, 0.08) !important;
        }
        .light-theme .shadow-xl {
            box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.06) !important;
        }
        .light-theme .shadow-lg {
            box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.05) !important;
        }
        .light-theme .shadow-md {
            box-shadow: 0 4px 6px -2px rgba(99, 102, 241, 0.03) !important;
        }
        .light-theme .shadow-sm {
            box-shadow: 0 1px 2px 0 rgba(99, 102, 241, 0.02) !important;
        }

        /* Strip shadows inside Light Mode - Softened instead of stripped! */
        .light-theme .shadow-2xl:not(.glass-sidebar):not(.glass-main-panel),
        .light-theme .shadow-xl:not(.glass-sidebar):not(.glass-main-panel),
        .light-theme .shadow-lg:not(.glass-sidebar):not(.glass-main-panel),
        .light-theme .shadow-md:not(.glass-sidebar):not(.glass-main-panel),
        .light-theme .shadow-sm:not(.glass-sidebar):not(.glass-main-panel),
        .light-theme .shadow:not(.glass-sidebar):not(.glass-main-panel),
        .light-theme [class*="shadow-"]:not(.glass-sidebar):not(.glass-main-panel) {
            box-shadow: 0 8px 30px rgba(99, 102, 241, 0.04) !important;
            text-shadow: none !important;
            filter: none !important;
        }

        /* Override dynamic Glass elements to support neumorphic variables */
        .glass-panel {
            background: var(--bg-panel) !important;
            
            
            border: 1px solid var(--border-glass) !important;
            box-shadow: var(--neumorphic-flat) !important;
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .glass-panel:hover {
            border-color: rgba(99, 102, 241, 0.35) !important;
            box-shadow: var(--shadow-soft), var(--neumorphic-flat) !important;
        }
        .glass-card {
            background: var(--bg-card) !important;
            
            
            border: 1px solid var(--border-glass) !important;
            box-shadow: var(--neumorphic-flat) !important;
            transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .glass-card:hover {
            border-color: rgba(99, 102, 241, 0.25) !important;
            box-shadow: var(--shadow-soft), var(--neumorphic-flat) !important;
        }
        .glass-sidebar {
            background: var(--bg-panel) !important;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border-right: 1px solid var(--border-glass) !important;
            box-shadow: var(--neumorphic-flat) !important;
        }
        .glass-header {
            background: var(--bg-panel) !important;
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-bottom: 1px solid var(--border-glass) !important;
            box-shadow: var(--neumorphic-flat) !important;
        }
        .glass-modal {
            background: var(--bg-panel) !important;
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid var(--border-glass) !important;
            box-shadow: var(--shadow-soft), var(--neumorphic-flat) !important;
        }

        .light-theme .glass-sidebar {
            background: #ffffff !important;
            border: 1px solid #e2e8f0 !important;
            box-shadow: 10px 10px 20px #cbd5e1, -10px -10px 20px #ffffff !important;
            border-radius: 24px !important;
        }
        .light-theme .glass-main-panel {
            background: #ffffff !important;
            border: 1px solid #e2e8f0 !important;
            box-shadow: 10px 10px 20px #cbd5e1, -10px -10px 20px #ffffff !important;
            border-radius: 24px !important;
        }

        /* 🌓 Light Theme Global Style Overrides */
        .light-theme {
            color-scheme: light;
        }
        .light-theme body {
            background: #f8fafc !important;
            color: #0f172a !important;
        }
        .light-theme #login-section {
            background: #f8fafc !important;
        }

        /* Adapt glowing background blobs in light mode to soft pastel glows */
        .light-theme .bg-blob-indigo {
            background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0) 70%) !important;
        }
        .light-theme .bg-blob-cyan {
            background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, rgba(6, 182, 212, 0) 70%) !important;
        }
        .light-theme .bg-blob-purple {
            background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, rgba(139, 92, 246, 0) 70%) !important;
        }

        /* Typography Remaking: Soft slate shades instead of solid pitch black, preserving legibility & beauty */
        
        /* 🌊 Dynamic Liquid Fluid Background Animations for the Blobs */
        @keyframes liquidMove1 {
            0% { transform: translate(0, 0) scale(1) rotate(0deg); }
            33% { transform: translate(120px, -80px) scale(1.15) rotate(120deg); }
            66% { transform: translate(-80px, 60px) scale(0.9) rotate(240deg); }
            100% { transform: translate(0, 0) scale(1) rotate(360deg); }
        }
        @keyframes liquidMove2 {
            0% { transform: translate(0, 0) scale(1.1) rotate(0deg); }
            33% { transform: translate(-100px, 90px) scale(0.85) rotate(-120deg); }
            66% { transform: translate(90px, -60px) scale(1.1) rotate(-240deg); }
            100% { transform: translate(0, 0) scale(1.1) rotate(-360deg); }
        }
        @keyframes liquidMove3 {
            0% { transform: translate(0, 0) scale(0.95) rotate(0deg); }
            50% { transform: translate(80px, 120px) scale(1.1) rotate(180deg); }
            100% { transform: translate(0, 0) scale(0.95) rotate(360deg); }
        }

        .bg-blob-indigo {
            
        }
        .bg-blob-cyan {
            
        }
        .bg-blob-purple {
            
        }

        /* Ambient glass overrides with high transparency for liquid background */
        .light-theme .glass-sidebar {
            background: rgba(255, 255, 255, 0.45) !important;
            backdrop-filter: blur(8px) !important;
            -webkit-backdrop-filter: blur(8px) !important;
            border: 1px solid rgba(255, 255, 255, 0.5) !important;
            box-shadow: 0 10px 40px -10px rgba(99, 102, 241, 0.05) !important;
            border-radius: 24px !important;
        }
        .light-theme .glass-main-panel {
            background: rgba(255, 255, 255, 0.35) !important;
            
            
            border: 1px solid rgba(255, 255, 255, 0.4) !important;
            box-shadow: 0 10px 40px -10px rgba(99, 102, 241, 0.05) !important;
            border-radius: 24px !important;
        }
        .light-theme .glass-card {
            background: rgba(255, 255, 255, 0.45) !important;
            
            
            border: 1px solid rgba(255, 255, 255, 0.5) !important;
            box-shadow: 0 8px 30px rgba(99, 102, 241, 0.04) !important;
        }
        .light-theme .glass-card:hover {
            border-color: rgba(99, 102, 241, 0.3) !important;
            box-shadow: 0 12px 36px rgba(99, 102, 241, 0.08) !important;
        }

        /* Soft pastel glowing liquid background blobs in light theme with radial gradient refraction */
        .light-theme .bg-blob-indigo {
            background: radial-gradient(circle, rgba(99, 102, 241, 0.18) 0%, rgba(99, 102, 241, 0) 70%) !important;
        }
        .light-theme .bg-blob-cyan {
            background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(6, 182, 212, 0) 70%) !important;
        }
        .light-theme .bg-blob-purple {
            background: radial-gradient(circle, rgba(168, 85, 247, 0.14) 0%, rgba(168, 85, 247, 0) 70%) !important;
        }

        /* Soft dark typography overrides for amazing readability with proper visual hierarchy */
        .light-theme h1,
        .light-theme h2,
        .light-theme h3,
        .light-theme h4,
        .light-theme h5,
        .light-theme h6,
        .light-theme .font-black,
        .light-theme #user-name,
        .light-theme #welcome-message {
            color: #0f172a !important; /* slate-900 */
        }

        .light-theme p,
        .light-theme .font-medium,
        .light-theme label,
        .light-theme td,
        .light-theme th {
            color: #334155 !important; /* slate-700 */
        }

        .light-theme span:not(.text-white):not([class*="bg-"]):not([class*="text-indigo"]):not([class*="text-cyan"]):not([class*="text-emerald"]):not([class*="text-amber"]):not([class*="text-purple"]):not([class*="text-red"]) {
            color: #475569 !important; /* slate-600 */
        }

        .light-theme .text-gray-400,
        .light-theme .text-gray-500,
        .light-theme .text-slate-400,
        .light-theme .text-slate-500 {
            color: #64748b !important; /* slate-500 */
        }

        /* Colorful legible brand text colors in light mode */
        .light-theme .text-indigo-400 {
            color: #4f46e5 !important; /* indigo-600 */
        }
        .light-theme .text-indigo-300 {
            color: #4338ca !important; /* indigo-700 */
        }
        .light-theme .text-\[\#2dd4bf\] {
            color: #0d9488 !important; /* teal-600 */
        }
        .light-theme .text-\[\#2dd4bf\] {
            color: #0d9488 !important; /* teal-600 */
        }
        .light-theme .text-cyan-400 {
            color: #0891b2 !important; /* cyan-600 */
        }
        .light-theme .text-emerald-400 {
            color: #059669 !important; /* emerald-600 */
        }
        .light-theme .text-amber-400 {
            color: #d97706 !important; /* amber-600 */
        }
        .light-theme .text-purple-400 {
            color: #7c3aed !important; /* purple-600 */
        }
        .light-theme .text-red-400 {
            color: #dc2626 !important; /* red-600 */
        }

        /* Outer transparent/frosted background cards overrides */
        .light-theme .bg-slate-900\/30 {
            background-color: rgba(255, 255, 255, 0.45) !important;
        }
        .light-theme .bg-slate-950\/40 {
            background-color: rgba(255, 255, 255, 0.6) !important;
        }
        .light-theme .bg-slate-950\/50 {
            background-color: rgba(255, 255, 255, 0.5) !important;
        }
        .light-theme .bg-slate-950\/60 {
            background-color: rgba(255, 255, 255, 0.6) !important;
        }
        .light-theme .bg-slate-950\/20 {
            background-color: rgba(255, 255, 255, 0.3) !important;
        }
        .light-theme .bg-slate-950\/30 {
            background-color: rgba(255, 255, 255, 0.4) !important;
        }
        .light-theme .bg-indigo-950\/80 {
            background-color: rgba(99, 102, 241, 0.15) !important;
            color: #4f46e5 !important;
        }

        .light-theme .text-\[10px\],
        .light-theme .text-\[11px\],
        .light-theme .text-\[9px\] {
            color: #475569 !important;
            text-shadow: none !important;
            background-image: none !important;
            filter: none !important;
        }

        /* 🛡️ SOLID ACCENT BACKGROUND CONTRAST PRESERVATION ENGINES */
        .light-theme .bg-indigo-600,
        .light-theme .bg-indigo-600 *,
        .light-theme .bg-indigo-700,
        .light-theme .bg-indigo-700 *,
        .light-theme .bg-emerald-600,
        .light-theme .bg-emerald-600 *,
        .light-theme .bg-emerald-500,
        .light-theme .bg-emerald-500 *,
        .light-theme .bg-red-600,
        .light-theme .bg-red-600 *,
        .light-theme .bg-red-500,
        .light-theme .bg-red-500 * {
            color: #ffffff !important;
        }

        /* Restores text color inside the active/inactive login role tabs on hover */
        .light-theme #tab-student:not(.bg-indigo-600):hover,
        .light-theme #tab-admin:not(.bg-indigo-600):hover {
            color: #0f172a !important;
        }

        /* Standardizes dynamic Tailwind utility overrides securely with backslash escapes */
        .light-theme .bg-\[\#05070c\] {
            background-color: var(--bg-input) !important;
            color: #0f172a !important;
        }
        .light-theme .bg-\[\#0b0f19\] {
            background-color: var(--bg-panel) !important;
        }
        .light-theme .border-\[\#1f2937\] {
            border-color: var(--border-glass) !important;
        }
        .light-theme .divide-\[\#1f2937\]\/50 > * + * {
            border-color: var(--border-glass) !important;
        }
        .light-theme input, .light-theme select, .light-theme textarea {
            background-color: var(--bg-input) !important;
            color: #0f172a !important;
            border-color: var(--border-glass) !important;
        }
        .light-theme input::placeholder, .light-theme textarea::placeholder {
            color: #94a3b8 !important;
        }

        /* Premium Navigation Bar text & states */
        .light-theme .nav-btn {
            color: #475569 !important;
        }
        .light-theme .nav-btn:hover {
            color: #0f172a !important;
            background-color: rgba(99, 102, 241, 0.08) !important;
        }
        .light-theme .nav-btn.text-indigo-400 {
            color: #4f46e5 !important;
            background-color: rgba(99, 102, 241, 0.12) !important;
        }
        .light-theme .nav-btn.text-red-400 {
            color: #dc2626 !important;
            background-color: rgba(239, 68, 68, 0.1) !important;
        }

        /* Remove Shadows and Gradient Backgrounds in Light mode */
        .light-theme .bg-slate-950\/40 {
            background-color: rgba(255, 255, 255, 0.55) !important;
            border-color: var(--border-glass) !important;
        }
        .light-theme .hover\:bg-white\/5:hover {
            background-color: rgba(15, 23, 42, 0.05) !important;
        }
        .light-theme .bg-slate-900\/20 {
            background-color: rgba(255, 255, 255, 0.25) !important;
        }
        .light-theme .bg-slate-900\/30 {
            background-color: rgba(255, 255, 255, 0.35) !important;
        }
        .light-theme .bg-slate-950\/50 {
            background-color: rgba(255, 255, 255, 0.45) !important;
        }
        .light-theme .bg-\[\#05070c\]\/50 {
            background-color: rgba(255, 255, 255, 0.45) !important;
        }
        .light-theme .bg-gradient-to-br.from-indigo-950\/20 {
            background-image: none !important;
            background-color: #ffffff !important;
        }
        .light-theme .bg-\[\#0b0f19\]\/60 {
            background-color: rgba(255, 255, 255, 0.6) !important;
        }
        .light-theme .bg-\[\#0b0f19\]\/30 {
            background-color: rgba(255, 255, 255, 0.3) !important;
        }
        .light-theme .border-white\/5 {
            border-color: var(--border-glass) !important;
        }
        .light-theme .border-white\/10 {
            border-color: var(--border-glass) !important;
        }
        .light-theme .bg-slate-950\/60 {
            background-color: var(--bg-input) !important;
        }
        .light-theme .bg-slate-950\/20 {
            background-color: rgba(255, 255, 255, 0.25) !important;
        }
        .light-theme .bg-slate-800\/40:hover {
            background-color: rgba(99, 102, 241, 0.08) !important;
        }

        /* Video player components in Light Mode */
        .light-theme #secure-player {
            border-color: var(--border-glass) !important;
        }
        .light-theme #player-placeholder {
            background-color: #f1f5f9 !important;
        }

        /* 🎚️ Timestamp sliders used by checkpoints and bookmarks */
        .time-slider {
            -webkit-appearance: none;
            appearance: none;
            height: 4px;
            border-radius: 999px;
            background: rgba(99, 102, 241, 0.18);
            outline: none;
            cursor: pointer;
        }
        .time-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            appearance: none;
            width: 13px;
            height: 13px;
            border-radius: 50%;
            background: #6366f1;
            border: 2px solid #fff;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
            transition: transform 0.15s ease;
        }
        .time-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
        .time-slider::-moz-range-thumb {
            width: 13px;
            height: 13px;
            border-radius: 50%;
            background: #6366f1;
            border: 2px solid #fff;
            box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
            cursor: pointer;
        }
        .time-slider::-moz-range-track {
            height: 4px;
            border-radius: 999px;
            background: rgba(99, 102, 241, 0.18);
        }
        .time-slider:disabled { opacity: 0.4; cursor: not-allowed; }

        .light-theme .time-slider,
        .light-theme .time-slider::-moz-range-track {
            background: rgba(79, 70, 229, 0.22);
        }

        /* Adaptive Checkpoint Alert overlays inside Light Theme */
        .light-theme .bg-emerald-950\/80 {
            background-color: rgba(16, 185, 129, 0.12) !important;
            color: #065f46 !important;
            border-color: rgba(16, 185, 129, 0.3) !important;
        }
        .light-theme .bg-red-950\/80 {
            background-color: rgba(239, 68, 68, 0.12) !important;
            color: #991b1b !important;
            border-color: rgba(239, 68, 68, 0.3) !important;
        }

        /* Adaptive Light Toast notifications */
        .light-theme .bg-indigo-950\/80 {
            background-color: rgba(255, 255, 255, 0.95) !important;
            color: #1e1b4b !important;
            border-color: rgba(99, 102, 241, 0.3) !important;
        }

        /* 🌓 Vibrant Lucide Icon Colors inside Light Theme */
        .light-theme i, .light-theme svg {
            stroke: currentColor !important;
        }
        .light-theme .nav-btn i {
            color: #475569 !important;
        }
        .light-theme .nav-btn:hover i {
            color: #0f172a !important;
        }
        .light-theme .nav-btn.text-indigo-400 i {
            color: #4f46e5 !important;
        }
        .light-theme .nav-btn.text-red-400 i {
            color: #dc2626 !important;
        }
        .light-theme .bg-indigo-950\/80 i,
        .light-theme .bg-indigo-950 i,
        .light-theme .bg-indigo-500\/10 i {
            color: #4f46e5 !important;
        }
        .light-theme .bg-amber-500\/10 i,
        .light-theme .bg-amber-950 i {
            color: #d97706 !important;
        }
        .light-theme .bg-emerald-500\/10 i,
        .light-theme .bg-emerald-950 i {
            color: #059669 !important;
        }
        .light-theme .bg-red-500\/10 i,
        .light-theme .bg-red-950 i {
            color: #dc2626 !important;
        }
        .light-theme .text-indigo-400 i,
        .light-theme .text-indigo-400 {
            color: #4f46e5 !important;
        }
        .light-theme .text-cyan-400 i,
        .light-theme .text-cyan-400 {
            color: #0891b2 !important;
        }
        .light-theme .text-emerald-400 i,
        .light-theme .text-emerald-400 {
            color: #059669 !important;
        }
        .light-theme .text-amber-400 i,
        .light-theme .text-amber-400 {
            color: #d97706 !important;
        }

        /* Neumorphic flat button overrides */
        .light-theme .neumorphic-flat-btn {
            box-shadow: none !important;
            background-color: #ffffff !important;
            border: 1px solid #e2e8f0 !important;
        }
        .light-theme .neumorphic-flat-btn:active {
            box-shadow: none !important;
        }

        /* 🌈 Modern Glowing Gradients (Dark Mode Only) */
        .text-glow-gradient {
            background: linear-gradient(135deg, #818cf8, #6366f1, #06b6d4, #a855f7);
            -webkit-background-clip: text;
            background-clip: text;
            -webkit-text-fill-color: transparent;
            background-size: 200% auto;
            
            filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.25));
        }
        @keyframes textShimmer {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        /* Gradient Borders on Cards in Dark Mode */
        .border-glow-gradient {
            position: relative;
            border: 1px solid transparent !important;
        }
        .border-glow-gradient::before {
            content: '';
            position: absolute;
            inset: -1px;
            border-radius: inherit;
            padding: 1px;
            background: linear-gradient(135deg, #6366f1, #06b6d4, #a855f7, #6366f1);
            background-size: 300% 300%;
            
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            mask-composite: exclude;
            pointer-events: none;
            z-index: 1;
            transition: opacity 0.3s ease;
        }
        @keyframes borderShimmer {
            0% { background-position: 0% 50%; }
            50% { background-position: 100% 50%; }
            100% { background-position: 0% 50%; }
        }

        /* Hover Tilt & Lift (Dark Mode Only) */
        .tilt-lift-card {
            transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1), border-color 0.25s, box-shadow 0.25s !important;
            transform-style: preserve-3d;
            will-change: transform, box-shadow, border-color;
        }

        /* Micro-interactions & Ripple click feedback styles */
        .ripple-btn {
            position: relative;
            overflow: hidden;
        }
        .click-ripple-circle {
            position: absolute;
            border-radius: 50%;
            background: rgba(99, 102, 241, 0.35);
            transform: scale(0);
            animation: rippleEffect 0.6s linear;
            pointer-events: none;
        }
        @keyframes rippleEffect {
            to {
                transform: scale(2.5);
                opacity: 0;
            }
        }

        /* 🌓 Reset overrides inside Light Theme */
        .light-theme .text-glow-gradient {
            background: none !important;
            -webkit-background-clip: border-box !important;
            background-clip: border-box !important;
            -webkit-text-fill-color: currentColor !important;
            color: var(--text-main) !important;
            text-shadow: none !important;
            filter: none !important;
        }
        .light-theme .border-glow-gradient::before {
            display: none !important;
        }
        .light-theme .border-glow-gradient {
            border: 1px solid var(--border-glass) !important;
        }

        .light-theme .click-ripple-circle {
            background: rgba(15, 23, 42, 0.1) !important;
        }

        /* 🚀 Scroll-Driven 3D Assembly & Context-Aware Styles */
        .assemble-3d-card {
            opacity: 0;
            transform: translateY(40px) rotateX(10deg) scale(0.96);
            transform-style: preserve-3d;
            perspective: 1200px;
            transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
        }
        .assemble-3d-card.assembled {
            opacity: 1;
            transform: translateY(0) rotateX(0deg) scale(1);
        }

        /* Disables all transitions and assemblies in Light Mode for performance */
        .light-theme .assemble-3d-card {
            opacity: 1 !important;
            transform: none !important;
            transition: none !important;
        }

        /* Infinite Ticker Style Specifications */
        @keyframes marquee {
            0% { transform: translateX(0); }
            100% { transform: translateX(-50%); }
        }
        .marquee-container {
            display: flex;
            overflow: hidden;
            user-select: none;
            mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
            -webkit-mask-image: linear-gradient(to right, transparent, #000 15%, #000 85%, transparent);
        }
        .marquee-content {
            display: flex;
            flex-shrink: 0;
            min-width: 100%;
            gap: 3rem;
            align-items: center;
            animation: marquee 25s linear infinite;
        }
        .marquee-content:hover {
            animation-play-state: paused;
        }
        .light-theme .marquee-container {
            background-color: #f1f5f9 !important;
            border-color: #e2e8f0 !important;
        }

        /* Number particle styles */
        .number-particle {
            position: absolute;
            pointer-events: none;
            border-radius: 50%;
            mix-blend-mode: screen;
            will-change: transform, opacity;
            z-index: 9999;
        }

        /* Fluid canvas enabled in light theme! */

        .light-theme .view-panel {
            animation: none !important;
            opacity: 1 !important;
            transform: none !important;
        }

        /* 🌓 Premium Light Mode Contrast & Icon Enhancements */
        .light-theme .glass-card,
        .light-theme .glass-panel,
        .light-theme .glass-sidebar,
        .light-theme .glass-main-panel,
        .light-theme .border,
        .light-theme [class*="border-"] {
            border-color: #94a3b8 !important; /* Darker outline borders in Light Mode (Slate-400) */
        }
        .light-theme .glass-card:hover,
        .light-theme .glass-panel:hover,
        .light-theme [class*="border-"]:hover {
            border-color: #475569 !important; /* Defined outlines on card focus/hover (Slate-600) */
        }
        .light-theme i,
        .light-theme svg,
        .light-theme [data-lucide] {
            stroke: #000000 !important; /* True black strokes for Lucide icons */
            stroke-width: 2.3px !important; /* Enhanced outline thickness for high contrast */
        }
        .light-theme .bg-indigo-600 i,
        .light-theme .bg-indigo-700 i,
        .light-theme .bg-emerald-600 i,
        .light-theme .bg-emerald-500 i,
        .light-theme .bg-red-600 i,
        .light-theme .bg-red-500 i,
        .light-theme .bg-amber-500 i,
        .light-theme .bg-amber-600 i,
        .light-theme .bg-indigo-600 svg,
        .light-theme .bg-indigo-700 svg,
        .light-theme .bg-emerald-600 svg,
        .light-theme .bg-emerald-500 svg,
        .light-theme .bg-red-600 svg,
        .light-theme .bg-red-500 svg,
        .light-theme .bg-amber-500 svg,
        .light-theme .bg-amber-600 svg,
        .light-theme .privilege-btn i,
        .light-theme .privilege-btn svg {
            stroke: #ffffff !important; /* Maintain sharp white strokes inside solid color action blocks */
        }

        /* Red Admin Title / Badge Contrast Overrides in Light Mode */
        .light-theme .bg-red-950 {
            background-color: #fef2f2 !important; /* Soft alert red */
            border: 1px solid #fca5a5 !important;  /* Sharp light red outline */
        }
        .light-theme .text-red-400,
        .light-theme span.text-red-400,
        .light-theme .bg-red-950 span {
            color: #dc2626 !important; /* Deep readable red */
            font-weight: 800 !important;
        }

        /* Privilege Button Theme Styles */
        .privilege-btn {
            background-color: #6366f1 !important;
            border: 1px solid #4f46e5 !important;
            color: #ffffff !important;
        }
        .privilege-btn:hover {
            background-color: #4f46e5 !important;
            border-color: #4338ca !important;
            color: #ffffff !important;
        }
        .light-theme .privilege-btn,
        .light-theme .privilege-btn * {
            background-color: #4f46e5 !important;
            border: 1px solid #3730a3 !important;
            color: #ffffff !important; /* Absolute white text safety overrides */
        }
        .light-theme .privilege-btn:hover {
            background-color: #3730a3 !important;
            color: #ffffff !important;
        }

        /* Admin Directories Helper Buttons in Light Mode */
        .light-theme .admin-edit-btn {
            background-color: #e0e7ff !important;
            border: 1px solid #c7d2fe !important;
            color: #4f46e5 !important;
        }
        .light-theme .admin-edit-btn:hover {
            background-color: #c7d2fe !important;
            color: #3730a3 !important;
        }
        .light-theme .admin-delete-btn {
            background-color: #fee2e2 !important;
            border: 1px solid #fecaca !important;
            color: #dc2626 !important;
        }
        .light-theme .admin-delete-btn:hover {
            background-color: #fecaca !important;
            color: #991b1b !important;
        }
        .light-theme .admin-edit-btn i,
        .light-theme .admin-edit-btn svg {
            stroke: #4f46e5 !important;
        }
        .light-theme .admin-delete-btn i,
        .light-theme .admin-delete-btn svg {
            stroke: #dc2626 !important;
        }

        /* ===================================================================== */
        /* 💎 HIGH FIDELITY GLASSMORPHISM & CUSTOM NEON STYLING OVERRIDES */
        /* ===================================================================== */
        
        /* 🎨 Custom Cursor in dark mode (blend-mode inverted circle) */
        #custom-cursor { display: none !important; }
        #custom-cursor.active {
            width: 44px;
            height: 44px;
            opacity: 0.95;
            background-color: #ffffff;
        }
        
        /* Cursor touch ripples (works on desktop click and mobile hold too) */
        .touch-ripple {
            position: fixed;
            width: 15px;
            height: 15px;
            border-radius: 50%;
            background-color: #ffffff;
            /* mix-blend-mode disabled for GPU performance */
            pointer-events: none;
            z-index: 99998;
            transform: translate(-50%, -50%);
            animation: rippleAnim 0.7s cubic-bezier(0.1, 0.8, 0.2, 1) forwards;
            will-change: transform, opacity;
        }
        @keyframes rippleAnim {
            0% {
                transform: translate(-50%, -50%) scale(0.3);
                opacity: 0.95;
            }
            100% {
                transform: translate(-50%, -50%) scale(4);
                opacity: 0;
            }
        }

        /* 🌈 Neon Gradient Borders & Text (Applied under dark-theme only) */
        .dark-theme .gradient-text,
        .dark-theme .text-gradient-neon {
            background: linear-gradient(135deg, #00f2fe 0%, #06b6d4 50%, #ffffff 100%) !important;
            -webkit-background-clip: text !important;
            background-clip: text !important;
            -webkit-text-fill-color: transparent !important;
            display: inline-block;
        }
        
        /* Glow and Scale Transform for Client Downloads */
        .download-btn-glow {
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
        }
        .download-btn-glow:hover {
            transform: scale(1.05) translateY(-2px) !important;
            box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.45), 0 0 15px rgba(99, 102, 241, 0.25) !important;
            border-color: rgba(99, 102, 241, 0.6) !important;
            background: rgba(15, 23, 42, 0.65) !important;
        }

        /* Glassmorphism Cards with Gradient Border Hack */
        .dark-theme .glass-card {
            position: relative;
            background: rgba(10, 15, 30, 0.45) !important;
            
            
            border: 1px solid transparent !important;
            background-clip: padding-box !important;
            box-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.4) !important;
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
            transform-style: preserve-3d;
            will-change: transform, box-shadow;
        }
        
        .dark-theme .glass-card::before {
            content: '';
            position: absolute;
            top: -1px; bottom: -1px; left: -1px; right: -1px;
            background: linear-gradient(135deg, rgba(168, 85, 247, 0.2) 0%, rgba(99, 102, 241, 0.08) 50%, rgba(6, 182, 212, 0.2) 100%);
            border-radius: inherit;
            z-index: -1;
            pointer-events: none;
            transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            opacity: 0.7;
        }
        .dark-theme .glass-card:hover::before {
            opacity: 1;
            background: linear-gradient(135deg, rgba(168, 85, 247, 0.5) 0%, rgba(99, 102, 241, 0.3) 50%, rgba(6, 182, 212, 0.5) 100%);
        }
        
        /* Enhanced Glass Navbars & Panes in Dark Theme */
        .dark-theme .glass-sidebar {
            background: rgba(10, 15, 30, 0.6) !important;
            backdrop-filter: blur(8px) saturate(180%) !important;
            -webkit-backdrop-filter: blur(8px) saturate(180%) !important;
            border: 1px solid rgba(255, 255, 255, 0.08) !important;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), inset 0 1px 0 0 rgba(255, 255, 255, 0.05) !important;
        }
        .dark-theme .glass-main-panel {
            background: rgba(10, 15, 30, 0.35) !important;
            
            
            border: 1px solid rgba(255, 255, 255, 0.06) !important;
            box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4) !important;
        }
        .dark-theme .glass-header {
            background: rgba(10, 15, 30, 0.35) !important;
            backdrop-filter: blur(8px) saturate(170%) !important;
            -webkit-backdrop-filter: blur(8px) saturate(170%) !important;
            border-bottom: 1px solid rgba(255, 255, 255, 0.06) !important;
        }
        .dark-theme .glass-modal {
            background: rgba(8, 12, 24, 0.75) !important;
            backdrop-filter: blur(8px) saturate(200%) !important;
            -webkit-backdrop-filter: blur(8px) saturate(200%) !important;
            border: 1px solid rgba(255, 255, 255, 0.12) !important;
            box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 0 rgba(255, 255, 255, 0.1) !important;
        }

        /* 🌓 Light Theme Neumorphic Styles (Clean Disable of custom features for crisp viewing) */
        .light-theme #custom-cursor { display: none !important; }
        .light-theme .touch-ripple {
            display: block !important;
        }
        .light-theme .gradient-text,
        .light-theme .text-gradient-neon {
            background: none !important;
            background-image: none !important;
            -webkit-background-clip: border-box !important;
            background-clip: border-box !important;
            -webkit-text-fill-color: #0f172a !important;
            color: #0f172a !important;
        }
        .light-theme .glass-card::before {
            content: '';
            position: absolute;
            top: -1px; bottom: -1px; left: -1px; right: -1px;
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.25) 0%, rgba(168, 85, 247, 0.15) 50%, rgba(6, 182, 212, 0.25) 100%) !important;
            border-radius: inherit;
            z-index: -1;
            pointer-events: none;
            transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
            opacity: 0.8;
        }
        .light-theme .glass-card:hover::before {
            opacity: 1;
            background: linear-gradient(135deg, rgba(99, 102, 241, 0.5) 0%, rgba(168, 85, 247, 0.35) 50%, rgba(6, 182, 212, 0.5) 100%) !important;
        }
        .light-theme .glass-card {
            position: relative;
            background: rgba(255, 255, 255, 0.45) !important;
            
            
            border: 1px solid rgba(255, 255, 255, 0.5) !important;
            box-shadow: 0 10px 40px -10px rgba(99, 102, 241, 0.05) !important;
            transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), 
                        box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1) !important;
            transform-style: preserve-3d;
            will-change: transform, box-shadow;
        }
        .light-theme .glass-card:hover {
            border-color: rgba(99, 102, 241, 0.35) !important;
            box-shadow: 0 15px 35px rgba(99, 102, 241, 0.12) !important;
            transform: translateY(-4px) !important;
        }
        
        /* Interactive Card Lifting only (cleaner fallback in light theme) */
        .light-theme .glass-card:hover {
            transform: translateY(-8px) !important;
            box-shadow: 15px 15px 30px #cbd5e1, -15px -15px 30px #ffffff !important;
        }
        /* Fluid canvas enabled in light theme! */
        /* 🎛️ CUSTOM COMPACT SCROLLBAR DESIGN (ULTRA-THIN & COLORFUL) */
        /* Webkit-based browsers (Chrome, Safari, Edge, Opera) */
        *::-webkit-scrollbar,
        ::-webkit-scrollbar {
            width: 2px !important;
            height: 2px !important;
        }
        
        /* Dark Theme Scrollbar */
        .dark-theme *::-webkit-scrollbar-track,
        .dark-theme ::-webkit-scrollbar-track,
        .dark-theme::-webkit-scrollbar-track {
            background: transparent !important;
        }
        .dark-theme *::-webkit-scrollbar-thumb,
        .dark-theme ::-webkit-scrollbar-thumb,
        .dark-theme::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, #6366f1, #a855f7, #06b6d4, #ec4899) !important;
            border-radius: 99px !important;
        }
        .dark-theme *::-webkit-scrollbar-thumb:hover,
        .dark-theme ::-webkit-scrollbar-thumb:hover,
        .dark-theme::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, #4f46e5, #9333ea, #0891b2) !important;
        }
        
        /* Light Theme Scrollbar */
        .light-theme *::-webkit-scrollbar-track,
        .light-theme ::-webkit-scrollbar-track,
        .light-theme::-webkit-scrollbar-track {
            background: transparent !important;
        }
        .light-theme *::-webkit-scrollbar-thumb,
        .light-theme ::-webkit-scrollbar-thumb,
        .light-theme::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, #6366f1, #a855f7, #06b6d4, #ec4899) !important;
            border-radius: 99px !important;
        }
        .light-theme *::-webkit-scrollbar-thumb:hover,
        .light-theme ::-webkit-scrollbar-thumb:hover,
        .light-theme::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, #6366f1, #a855f7, #06b6d4) !important;
        }
        
        /* Firefox Fallback */
        * {
            scrollbar-width: thin !important;
        }
        .dark-theme {
            scrollbar-color: #6366f1 #020308 !important;
        }
        .light-theme {
            scrollbar-color: #cbd5e1 #f1f5f9 !important;
        }
    
        /* ===================================================================== */
        /* 🌗 ULTRA-POLISHED PREMIUM LIGHT THEME OVERRIDES (NO GRADIENTS, NO DARK FADES) */
        /* ===================================================================== */
        .light-theme, 
        .light-theme body {
            background-color: #f8fafc !important;
            background-image: none !important;
            color: #0f172a !important;
        }

        /* ❌ Strip any and all background gradients in white mode per user preference */
        .light-theme .bg-gradient-to-br,
        .light-theme .bg-gradient-to-r,
        .light-theme .bg-gradient-to-t,
        .light-theme .bg-gradient-to-l,
        .light-theme [class*="bg-gradient-to-"] {
            background: #ffffff !important;
            background-image: none !important;
        }

        /* Gorgeous gradient progress bar in light mode matching bento styles */
        .light-theme #dashboard-xp-progress-bar {
            background: linear-gradient(90deg, #6366f1, #a855f7, #06b6d4) !important;
        }

        /* Make radial progress ring use the original gorgeous gradient stroke in light mode */
        .light-theme #dashboard-progress-ring {
            stroke: url(#wheelGradient) !important;
        }

        /* 💎 Frosted Glassmorphism Backdrops and Translucent Cards in Light Mode */
        .light-theme .bg-slate-900\/30,
        .light-theme .bg-slate-950\/40,
        .light-theme .bg-slate-950\/50,
        .light-theme .bg-slate-950\/60,
        .light-theme .bg-slate-950\/20,
        .light-theme .bg-slate-950\/30,
        .light-theme .bg-slate-950\/35,
        .light-theme .bg-slate-900\/40,
        .light-theme .bg-slate-950,
        .light-theme .bg-slate-900,
        .light-theme .bg-indigo-950\/80,
        .light-theme .bg-indigo-950\/10,
        .light-theme .bg-slate-950\/25,
        .light-theme .bg-slate-950\/30,
        .light-theme .bg-black\/80 {
            background-color: rgba(255, 255, 255, 0.45) !important;
            background-image: none !important;
            backdrop-filter: blur(8px) saturate(180%) !important;
            -webkit-backdrop-filter: blur(8px) saturate(180%) !important;
            border-color: rgba(99, 102, 241, 0.15) !important;
            box-shadow: 0 8px 30px rgba(99, 102, 241, 0.04) !important;
        }

        /* 💎 Standout items inside white cards (list rows, note logs, playlist rows) must be crisp slate-50/100 instead of white-on-white */
        .light-theme #dashboard-leaderboard-grid > div,
        .light-theme #video-notes-log > div,
        .light-theme #curriculum-playlist-log > div,
        .light-theme #admin-students-directory-list > div,
        .light-theme #admin-videos-inventory-list > div,
        .light-theme .sidebar-item {
            background-color: #f1f5f9 !important;
            border-color: #cbd5e1 !important;
            color: #0f172a !important;
        }

        /* Perfect navigation button states for light mode sidebar items */
        .light-theme .sidebar-item.active,
        .light-theme .nav-btn.active,
        .light-theme .nav-btn.bg-indigo-600\/15 {
            background-color: #4f46e5 !important;
            color: #ffffff !important;
            border-left-color: #4338ca !important;
        }
        .light-theme .sidebar-item.active i,
        .light-theme .nav-btn.active i,
        .light-theme .nav-btn.bg-indigo-600\/15 i {
            color: #ffffff !important;
        }

        /* Standardize ultra-thin colorful gradient scrollbars in light mode */
        .light-theme *::-webkit-scrollbar-thumb,
        .light-theme ::-webkit-scrollbar-thumb,
        .light-theme::-webkit-scrollbar-thumb {
            background: linear-gradient(180deg, #6366f1, #a855f7, #06b6d4, #ec4899) !important;
            border-radius: 99px !important;
        }
        .light-theme *::-webkit-scrollbar-thumb:hover,
        .light-theme ::-webkit-scrollbar-thumb:hover,
        .light-theme::-webkit-scrollbar-thumb:hover {
            background: linear-gradient(180deg, #4f46e5, #9333ea, #0891b2, #db2777) !important;
        }
        .light-theme {
            scrollbar-color: #6366f1 #f1f5f9 !important;
        }

        /* Standard slate text visibility guarantees for headers and secondary items */
        .light-theme h1,
        .light-theme h2,
        .light-theme h3,
        .light-theme h4,
        .light-theme h5,
        .light-theme h6,
        .light-theme .font-black,
        .light-theme #user-name,
        .light-theme #welcome-message {
            color: #0f172a !important; /* Slate-900 */
        }
        .light-theme p,
        .light-theme .font-medium,
        .light-theme label,
        .light-theme td,
        .light-theme th,
        .light-theme span:not(.text-white) {
            color: #334155 !important; /* Slate-700 */
        }
        .light-theme .text-gray-400,
        .light-theme .text-gray-500,
        .light-theme .text-slate-400,
        .light-theme .text-slate-500 {
            color: #475569 !important; /* Slate-600 */
        }

        /* 📱 MOBILE RESPONSIVENESS BOOSTER & HORIZONTAL NAV LAYOUT */
        @media (max-width: 767px) {
            /* Compact bento grid layout on mobile screens */
            body {
                padding: 4px !important;
            }
            #portal-section {
                padding: 8px !important;
                gap: 12px !important;
            }
            #portal-section > main {
                padding: 12px 8px !important;
            }
            .grid {
                gap: 12px !important;
            }
            .p-5, .p-6, .p-8 {
                padding: 14px !important;
            }
            
            /* Sidebar horizontal nav touch ups */
            .glass-sidebar {
                border-radius: 16px !important;
                margin-bottom: 4px !important;
                padding: 8px !important;
            }
            .glass-sidebar > div {
                padding: 8px !important;
            }
            .glass-sidebar nav {
                padding: 4px !important;
                gap: 8px !important;
            }
            .nav-btn {
                padding: 8px 12px !important;
                font-size: 11px !important;
                border-radius: 8px !important;
            }
            
            /* Typography scaling for gorgeous mobile presentation */
            h1 { font-size: 1.4rem !important; }
            h2, #welcome-message { font-size: 1.1rem !important; }
            h3 { font-size: 0.9rem !important; }
            p, span { font-size: 11px !important; }
            .text-xs { font-size: 10px !important; }
            .text-[10px], .text-[11px], .text-[9px] { font-size: 9px !important; }
            
            /* Bento box columns must stay readable - stack single columns */
            .md:col-span-2, .lg:col-span-2, .xl:col-span-2,
            .md:col-span-3, .lg:col-span-3, .xl:col-span-3,
            .md:col-span-1, .lg:col-span-1, .xl:col-span-1 {
                grid-column: span 1 / span 1 !important;
            }
            
            /* Profile & Standing Cell mobile layout */
            #welcome-message {
                word-break: break-word !important;
            }
            #co-assistant-chat-input {
                font-size: 11px !important;
            }
            
            /* Download App Buttons Mobile Layout: stack elegantly */
            .grid-cols-3 {
                grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
            }
            .download-btn-glow {
                padding: 10px !important;
            }
            
            /* Leaderboard row stacking on mobile */
            #dashboard-leaderboard-grid {
                grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
                gap: 8px !important;
            }
            #dashboard-leaderboard-grid > div {
                padding: 10px !important;
            }
            
            /* Hide non-essential graphics to save mobile vertical scroll */
            #custom-cursor { display: none !important; }
            #portal-section > main {
                padding: 16px 12px !important;
            }
            .grid {
                gap: 16px !important;
            }
            .p-5 {
                padding: 16px !important;
            }
            
            /* Sidebar turns into a sleek header + horizontal tabs navigation bar */
            .glass-sidebar {
                border-radius: 20px !important;
                border: 1px solid var(--border-glass) !important;
                margin-bottom: 8px !important;
                background: var(--bg-panel) !important;
                box-shadow: var(--neumorphic-flat) !important;
            }
            
            /* Hide chunky desktop AI box on mobile to save vertical space */
            #sidebar-quick-prompts-container, 
            .glass-sidebar > div.flex-1 {
                display: none !important;
            }
        }

        /* ===================================================================== */
        /* 📱✨ MOBILE 100x POLISH PASS — extra breakpoints, safe-areas, bigger    */
        /* touch targets, smoother entrance animations, and a proper video       */
        /* theater on phones. This is layered ON TOP of the block above and      */
        /* never removes anything from it.                                      */
        /* ===================================================================== */

        /* Respect notches / home-indicators on iPhone & modern Android phones */
        @supports (padding: max(0px)) {
            body {
                padding-left: max(4px, env(safe-area-inset-left)) !important;
                padding-right: max(4px, env(safe-area-inset-right)) !important;
                padding-bottom: max(4px, env(safe-area-inset-bottom)) !important;
            }
        }

        @media (max-width: 767px) {
            /* Buttery entrance animation for every screen/tab switch on mobile */
            #portal-section main, #login-section > div {
                animation: slideUpFade 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            }

            /* Bigger, thumb-friendly tap targets everywhere */
            button, .interactive-btn, .nav-btn, select, input[type="text"], input[type="password"], input[type="url"], textarea {
                min-height: 40px;
            }
            .nav-btn i, .nav-btn [data-lucide] {
                width: 16px !important;
                height: 16px !important;
            }

            /* Sidebar nav becomes a slick horizontally-scrollable pill bar */
            .glass-sidebar nav {
                display: flex !important;
                flex-direction: row !important;
                overflow-x: auto !important;
                -webkit-overflow-scrolling: touch !important;
                scrollbar-width: none !important;
                scroll-snap-type: x proximity !important;
            }
            .glass-sidebar nav::-webkit-scrollbar { display: none !important; }
            .glass-sidebar nav .nav-btn {
                scroll-snap-align: start;
                white-space: nowrap;
                flex: 0 0 auto;
                width: auto !important;
                min-width: max-content;
                padding: 8px 10px !important;
                font-size: 10px !important;
            }

            /* Modals: full-height sheet feel instead of a cramped floating box */
            .modal-root > div, .glass-modal {
                max-height: 92vh !important;
                overflow-y: auto !important;
                border-radius: 22px 22px 0 0 !important;
                width: 100% !important;
                max-width: 100% !important;
                margin: 0 !important;
                position: relative;
            }
            .modal-root:not(.hidden) {
                align-items: flex-end !important;
                padding: 0 !important;
            }

            /* Secure video theater: force a real 16:9 box that never overflows the viewport */
            #video-theater {
                aspect-ratio: 16 / 9 !important;
                width: 100% !important;
                border-radius: 14px !important;
            }
            #video-watermark-teacher, #video-watermark-student {
                font-size: 7px !important;
                white-space: nowrap;
                max-width: 90%;
                overflow: hidden;
                text-overflow: ellipsis;
            }
            #secure-player, #youtube-player {
                border-radius: 14px !important;
            }

            /* Toasts float above thumb-reach, not under it */
            #toast-container {
                bottom: 14px !important;
                right: 10px !important;
                left: 10px !important;
                align-items: stretch !important;
            }

            /* Feed composer & cards get comfier spacing for one-thumb scrolling */
            #feed-stream > div {
                border-radius: 16px !important;
            }
        }

        /* Extra-small phones (SE / mini class devices) */
        @media (max-width: 380px) {
            h1 { font-size: 1.2rem !important; }
            h2, #welcome-message { font-size: 1rem !important; }
            .p-5, .p-6, .p-8 { padding: 10px !important; }
            .glass-sidebar nav { gap: 4px !important; }
            .nav-btn { padding: 7px 9px !important; font-size: 10px !important; }
        }

        /* Landscape phones: keep the video theater the hero and shrink chrome around it */
        @media (max-width: 900px) and (orientation: landscape) {
            #video-theater { aspect-ratio: 16 / 8 !important; }
            .glass-sidebar { padding: 4px !important; }
        }

        /* Touch devices get the same visual language with substantially less
           compositing work: smoother scrolling and far less battery use. */
        @media (max-width: 1023px), (prefers-reduced-motion: reduce) {
            #fluid-canvas { display: none !important; }
            .glass-card, .glass-panel, .glass-sidebar, .glass-header, .glass-main-panel, .glass-modal {
                backdrop-filter: blur(12px) saturate(130%) !important;
                -webkit-backdrop-filter: blur(12px) saturate(130%) !important;
            }
            .glass-card, .liquid-glass-card, .ripple-btn::after {
                animation: none !important;
            }
            *, *::before, *::after { scroll-behavior: auto !important; }
        }

        /* A full-size conversation—not a tiny desktop card—on phones/tablets. */
        @media (max-width: 1023px) {
            #view-co-assistant { min-height: calc(100dvh - 8.5rem); }
            #view-co-assistant > .grid {
                height: auto !important;
                min-height: calc(100dvh - 10rem) !important;
                grid-template-columns: 1fr !important;
                gap: 12px !important;
            }
            #view-co-assistant > .grid > :first-child {
                height: auto !important;
                max-height: 138px;
                min-height: 0;
            }
            #ai-sessions-list { display: flex; gap: 7px; overflow-x: auto; overflow-y: hidden; }
            #ai-sessions-list > div { min-width: 145px; flex: 0 0 auto; }
            #view-co-assistant > .grid > :last-child {
                min-height: min(610px, calc(100dvh - 15rem));
                height: calc(100dvh - 15rem) !important;
            }
            #ai-chat-board { min-height: 230px; }
            #view-co-assistant .bg-indigo-950\/20 { display: none; }
        }

        @media (max-width: 767px) {
            /* Conversation comes first on a phone; saved session management is
               still available on tablet/desktop but would otherwise push the
               composer below the fold. */
            #view-co-assistant > .grid > :first-child { display: none !important; }
            #view-co-assistant > .grid { min-height: 0 !important; }
            #view-co-assistant > .grid > :last-child { min-height: 0; height: auto !important; }
            #ai-chat-board { flex: 0 1 auto; height: min(34dvh, 280px); min-height: 210px; }
            #ai-chat-prompt { min-width: 0; font-size: 14px !important; }
            #view-co-assistant button { min-height: 44px; }
        }

    
        /* 🌗 SYNCHRONIZED SIMULTANEOUS THEME TRANSITION ENGINE */
        html.theme-transitioning,
        html.theme-transitioning *,
        html.theme-transitioning *::before,
        html.theme-transitioning *::after {
            transition: background-color 0.25s ease-in-out !important,
                        border-color 0.25s ease-in-out !important,
                        color 0.25s ease-in-out !important,
                        fill 0.25s ease-in-out !important,
                        stroke 0.25s ease-in-out !important,
                        box-shadow 0.25s ease-in-out !important,
                        opacity 0.25s ease-in-out !important;
        }

        /* Light Mode Contrast Enhancements */
        .light-theme h1, .light-theme h2, .light-theme h3, .light-theme h4, .light-theme h5, .light-theme h6,
        .light-theme .font-black, .light-theme #user-name, .light-theme #welcome-message {
            color: #0f172a !important;
        }
        .light-theme p, .light-theme label, .light-theme td, .light-theme th, .light-theme .font-medium {
            color: #334155 !important;
        }
        .light-theme span:not(.text-white):not([class*="bg-"]):not([class*="text-indigo"]):not([class*="text-cyan"]):not([class*="text-emerald"]):not([class*="text-amber"]):not([class*="text-purple"]):not([class*="text-red"]) {
            color: #475569 !important;
        }
        .light-theme .text-gray-400, .light-theme .text-gray-500, .light-theme .text-slate-400, .light-theme .text-slate-500 {
            color: #475569 !important;
        }
        .light-theme input, .light-theme select, .light-theme textarea {
            background-color: rgba(255, 255, 255, 0.95) !important;
            color: #0f172a !important;
            border-color: #cbd5e1 !important;
        }
        .light-theme input::placeholder, .light-theme textarea::placeholder {
            color: #64748b !important;
        }
        .light-theme i, .light-theme svg, .light-theme [data-lucide] {
            stroke: #0f172a !important;
        }
        .light-theme .bg-indigo-600 i, .light-theme .bg-indigo-700 i, .light-theme .bg-emerald-600 i, 
        .light-theme .bg-emerald-500 i, .light-theme .bg-red-600 i, .light-theme .bg-red-500 i,
        .light-theme .bg-indigo-600 svg, .light-theme .bg-indigo-700 svg, .light-theme .bg-emerald-600 svg, 
        .light-theme .bg-emerald-500 svg, .light-theme .bg-red-600 svg, .light-theme .bg-red-500 svg {
            stroke: #ffffff !important;
        }

        /* ===================================================================== */
        /* 💎 FINAL PREMIUM GLASSMORPHISM SYSTEM — Single Authoritative Source   */
        /* Placed last on purpose so it always wins the cascade and guarantees   */
        /* a real frosted-glass look (deep blur + saturation + soft top-light    */
        /* highlight) everywhere .glass-panel/card/sidebar/header/modal is used. */
        /* ===================================================================== */
        .dark-theme .glass-panel,
        .dark-theme .glass-card,
        .dark-theme .glass-sidebar,
        .dark-theme .glass-header,
        .dark-theme .glass-main-panel {
            background: linear-gradient(155deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.015) 100%), rgba(13, 17, 28, 0.5) !important;
            backdrop-filter: blur(22px) saturate(165%) !important;
            -webkit-backdrop-filter: blur(22px) saturate(165%) !important;
            border: 1px solid rgba(255, 255, 255, 0.12) !important;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
        }
        .dark-theme .glass-panel:hover,
        .dark-theme .glass-card:hover {
            border-color: rgba(99, 102, 241, 0.4) !important;
            box-shadow: 0 14px 42px rgba(99, 102, 241, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
        }
        .dark-theme .glass-sidebar {
            background: rgba(10, 14, 24, 0.48) !important;
            backdrop-filter: blur(24px) saturate(165%) !important;
            -webkit-backdrop-filter: blur(24px) saturate(165%) !important;
        }
        .dark-theme .glass-header {
            background: rgba(10, 14, 24, 0.32) !important;
            backdrop-filter: blur(20px) saturate(160%) !important;
            -webkit-backdrop-filter: blur(20px) saturate(160%) !important;
        }
        .dark-theme .glass-modal {
            background: linear-gradient(160deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.01) 100%), rgba(9, 12, 22, 0.68) !important;
            backdrop-filter: blur(28px) saturate(180%) !important;
            -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
            border: 1px solid rgba(255, 255, 255, 0.14) !important;
            box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
        }

        .light-theme .glass-panel,
        .light-theme .glass-card,
        .light-theme .glass-sidebar,
        .light-theme .glass-header,
        .light-theme .glass-main-panel {
            background: linear-gradient(155deg, rgba(255, 255, 255, 0.82) 0%, rgba(255, 255, 255, 0.5) 100%) !important;
            backdrop-filter: blur(22px) saturate(160%) !important;
            -webkit-backdrop-filter: blur(22px) saturate(160%) !important;
            border: 1px solid rgba(255, 255, 255, 0.65) !important;
            box-shadow: 0 8px 30px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
        }
        .light-theme .glass-panel:hover,
        .light-theme .glass-card:hover {
            border-color: rgba(99, 102, 241, 0.35) !important;
            box-shadow: 0 16px 38px rgba(99, 102, 241, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
        }
        .light-theme .glass-modal {
            background: linear-gradient(160deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.68) 100%) !important;
            backdrop-filter: blur(26px) saturate(170%) !important;
            -webkit-backdrop-filter: blur(26px) saturate(170%) !important;
            border: 1px solid rgba(255, 255, 255, 0.75) !important;
            box-shadow: 0 30px 60px rgba(99, 102, 241, 0.1), inset 0 1px 0 rgba(255, 255, 255, 1) !important;
        }

        /* ═════════════════════════════════════════════════════════════════════ */
        /* 🧊 LIQUID GLASS 2.0 — ULTRA PREMIUM ENHANCEMENT LAYER (added on request) */
        /* Pure add-on. Placed last so it wins the cascade. Nothing above this    */
        /* block was touched. Adds: deeper true-glass blur/saturation, a moving   */
        /* specular sheen that sweeps across cards on hover, a slow rotating      */
        /* iridescent edge glow, a soft corner "glint", a subtle film-grain for   */
        /* realism, richer multi-hued ambient liquid blobs, and glassy focus      */
        /* states for inputs/buttons so the whole app feels like one material.    */
        /* ═════════════════════════════════════════════════════════════════════ */

        @property --lg-angle {
            syntax: '<angle>';
            initial-value: 0deg;
            inherits: false;
        }
        @keyframes lgRotateEdge {
            to { --lg-angle: 360deg; }
        }
        @keyframes lgSheenIdle {
            0%, 100% { background-position: 160% 160%, 0 0, 0 0; }
            50% { background-position: 120% 120%, 0 0, 0 0; }
        }
        @keyframes lgGrain {
            0%, 100% { transform: translate(0, 0); }
            10% { transform: translate(-1%, -2%); }
            30% { transform: translate(2%, 1%); }
            50% { transform: translate(-2%, 2%); }
            70% { transform: translate(1%, -1%); }
            90% { transform: translate(-1%, 2%); }
        }

        /* True-glass depth boost: stronger blur + saturation + a touch of
           contrast/brightness so light genuinely "bends" through panels. */
        .dark-theme .glass-card,
        .dark-theme .glass-panel,
        .dark-theme .glass-sidebar,
        .dark-theme .glass-header,
        .dark-theme .glass-main-panel,
        .dark-theme .glass-modal {
            backdrop-filter: blur(30px) saturate(190%) contrast(1.06) brightness(1.04) !important;
            -webkit-backdrop-filter: blur(30px) saturate(190%) contrast(1.06) brightness(1.04) !important;
        }
        .light-theme .glass-card,
        .light-theme .glass-panel,
        .light-theme .glass-sidebar,
        .light-theme .glass-header,
        .light-theme .glass-main-panel,
        .light-theme .glass-modal {
            backdrop-filter: blur(28px) saturate(180%) contrast(1.03) brightness(1.02) !important;
            -webkit-backdrop-filter: blur(28px) saturate(180%) contrast(1.03) brightness(1.02) !important;
        }

        /* Moving specular sheen — a soft diagonal band of light that glides
           across every glass card. Painted as a background layer (never
           overflows, never needs overflow:hidden, never clips dropdowns). */
        .dark-theme .glass-card {
            background-image:
                linear-gradient(115deg, transparent 28%, rgba(255,255,255,0.09) 45%, rgba(255,255,255,0.16) 50%, rgba(255,255,255,0.09) 55%, transparent 72%),
                radial-gradient(180px 140px at 12% 0%, rgba(255,255,255,0.14), transparent 65%),
                linear-gradient(155deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.015) 100%),
                rgba(11, 15, 26, 0.5) !important;
            background-size: 250% 250%, 100% 100%, 100% 100%, 100% 100% !important;
            background-position: 160% 160%, 0 0, 0 0, 0 0 !important;
            background-repeat: no-repeat !important;
            border-color: rgba(255,255,255,0.10) !important;
            box-shadow: 0 10px 34px -12px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.09), inset 0 -12px 24px -18px rgba(99,102,241,0.12) !important;
            transition: background-position 1.15s cubic-bezier(0.19,1,0.22,1), transform 0.45s cubic-bezier(0.16,1,0.3,1), box-shadow 0.45s cubic-bezier(0.16,1,0.3,1), border-color 0.4s ease !important;
            
        }
        .dark-theme .glass-card:hover {
            background-position: -40% -40%, 0 0, 0 0, 0 0 !important;
            transform: translateY(-5px) !important;
            border-color: rgba(129, 140, 248, 0.4) !important;
            box-shadow: 0 20px 46px -14px rgba(99,102,241,0.28), inset 0 1px 0 rgba(255,255,255,0.14), inset 0 -12px 24px -18px rgba(99,102,241,0.18) !important;
            animation-play-state: paused;
        }
        .light-theme .glass-card {
            background-image:
                linear-gradient(115deg, transparent 28%, rgba(255,255,255,0.55) 45%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0.55) 55%, transparent 72%),
                radial-gradient(180px 140px at 12% 0%, rgba(255,255,255,0.6), transparent 65%),
                linear-gradient(155deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0.15) 100%),
                rgba(255, 255, 255, 0.42) !important;
            background-size: 250% 250%, 100% 100%, 100% 100%, 100% 100% !important;
            background-position: 160% 160%, 0 0, 0 0, 0 0 !important;
            background-repeat: no-repeat !important;
            transition: background-position 1.15s cubic-bezier(0.19,1,0.22,1), transform 0.45s cubic-bezier(0.16,1,0.3,1), box-shadow 0.45s cubic-bezier(0.16,1,0.3,1), border-color 0.4s ease !important;
            
        }
        .light-theme .glass-card:hover {
            background-position: -40% -40%, 0 0, 0 0, 0 0 !important;
            transform: translateY(-5px) !important;
            animation-play-state: paused;
        }

        /* Slow rotating iridescent edge — replaces the flat gradient border
           glow with a living conic sweep of indigo → violet → cyan light. */
        .dark-theme .glass-card::before,
        .light-theme .glass-card::before {
            background: conic-gradient(from var(--lg-angle), rgba(99,102,241,0.55), rgba(168,85,247,0.5), rgba(6,182,212,0.55), rgba(99,102,241,0.55)) !important;
            
            opacity: 0.55 !important;
        }
        .dark-theme .glass-card:hover::before,
        .light-theme .glass-card:hover::before {
            opacity: 0.95 !important;
        }

        /* Sidebar / header / main-panel / modal get a permanent soft top
           highlight + corner glint so they read as curved glass, not flat tint. */
        .dark-theme .glass-sidebar,
        .dark-theme .glass-main-panel,
        .dark-theme .glass-header {
            background-image:
                radial-gradient(220px 160px at 0% 0%, rgba(255,255,255,0.07), transparent 60%),
                linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 18%) !important;
            box-shadow: 0 20px 50px -16px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.09) !important;
        }
        .dark-theme .glass-modal {
            background-image:
                radial-gradient(260px 200px at 8% -4%, rgba(255,255,255,0.10), transparent 60%),
                linear-gradient(165deg, rgba(255,255,255,0.09) 0%, rgba(255,255,255,0.015) 100%) !important;
            box-shadow: 0 36px 80px rgba(0,0,0,0.65), inset 0 1px 0 rgba(255,255,255,0.14) !important;
        }
        .light-theme .glass-sidebar,
        .light-theme .glass-main-panel,
        .light-theme .glass-header {
            background-image:
                radial-gradient(220px 160px at 0% 0%, rgba(255,255,255,0.7), transparent 60%),
                linear-gradient(180deg, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 18%) !important;
        }
        .light-theme .glass-modal {
            background-image:
                radial-gradient(260px 200px at 8% -4%, rgba(255,255,255,0.85), transparent 60%),
                linear-gradient(165deg, rgba(255,255,255,0.7) 0%, rgba(255,255,255,0.2) 100%) !important;
        }

        /* Glassy inputs, selects & textareas — frosted + soft indigo focus glow */
        input[type="text"], input[type="password"], input[type="number"],
        input[type="email"], input[type="tel"], input[type="search"],
        textarea, select {
            backdrop-filter: blur(14px) saturate(160%) !important;
            -webkit-backdrop-filter: blur(14px) saturate(160%) !important;
            transition: box-shadow 0.35s ease, border-color 0.35s ease, background-color 0.35s ease !important;
        }
        .dark-theme input[type="text"]:focus, .dark-theme input[type="password"]:focus,
        .dark-theme input[type="number"]:focus, .dark-theme input[type="email"]:focus,
        .dark-theme input[type="tel"]:focus, .dark-theme input[type="search"]:focus,
        .dark-theme textarea:focus, .dark-theme select:focus {
            box-shadow: 0 0 0 4px rgba(99,102,241,0.16), inset 0 1px 0 rgba(255,255,255,0.06) !important;
            background-color: rgba(15,23,42,0.6) !important;
        }
        .light-theme input[type="text"]:focus, .light-theme input[type="password"]:focus,
        .light-theme input[type="number"]:focus, .light-theme input[type="email"]:focus,
        .light-theme input[type="tel"]:focus, .light-theme input[type="search"]:focus,
        .light-theme textarea:focus, .light-theme select:focus {
            box-shadow: 0 0 0 4px rgba(99,102,241,0.12), inset 0 1px 0 rgba(255,255,255,0.7) !important;
        }

        /* Buttons get a quick glassy press + glow, without changing their color */
        button {
            -webkit-tap-highlight-color: transparent;
        }
        button:active {
            transform: scale(0.97);
        }

        /* Richer, more colorful liquid ambience — two extra drifting blobs
           layered behind everything, tuned very low-opacity so text stays crisp. */
        .bg-blob-rose {
            position: fixed;
            width: 520px;
            height: 520px;
            background: radial-gradient(circle, rgba(236, 72, 153, 0.07) 0%, rgba(236, 72, 153, 0) 70%);
            top: 10%;
            right: 10%;
            pointer-events: none;
            z-index: 0;
            
        }
        .bg-blob-teal {
            position: fixed;
            width: 460px;
            height: 460px;
            background: radial-gradient(circle, rgba(45, 212, 191, 0.07) 0%, rgba(45, 212, 191, 0) 70%);
            bottom: 8%;
            right: 25%;
            pointer-events: none;
            z-index: 0;
            
        }
        .light-theme .bg-blob-rose {
            background: radial-gradient(circle, rgba(236, 72, 153, 0.05) 0%, rgba(236, 72, 153, 0) 70%) !important;
        }
        .light-theme .bg-blob-teal {
            background: radial-gradient(circle, rgba(45, 212, 191, 0.05) 0%, rgba(45, 212, 191, 0) 70%) !important;
        }

        /* Ultra-fine film grain over the whole app — the last 1% that sells
           "real glass" instead of a flat blur. Barely visible, additive blend. */
        body::after {
            content: '';
            position: fixed;
            inset: -10%;
            width: 120%;
            height: 120%;
            pointer-events: none;
            z-index: 1;
            opacity: 0.025;
            mix-blend-mode: overlay;
            background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
            
        }
        .light-theme body::after {
            opacity: 0.018;
        }

        @media (prefers-reduced-motion: reduce) {
            .dark-theme .glass-card, .light-theme .glass-card,
            .dark-theme .glass-card::before, .light-theme .glass-card::before,
            .bg-blob-rose, .bg-blob-teal, body::after {
                animation: none !important;
            }
        }

        /* ------------------------------------------------------------------
           MOBILE / TABLET CLARITY PASS
           Keep the portal quick and readable instead of expensive frosted UI.
           ------------------------------------------------------------------ */
        .glass-card, .glass-panel, .glass-sidebar, .glass-header, .glass-main-panel,
        .glass-modal, .dashboard-header-glow, input, select, textarea,
        #toast-container > * {
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
        .glass-card, .glass-panel, .glass-sidebar, .glass-header, .glass-main-panel,
        .glass-modal {
            background-image: none !important;
        }
        .light-theme .glass-card, .light-theme .glass-panel, .light-theme .glass-sidebar,
        .light-theme .glass-header, .light-theme .glass-main-panel, .light-theme .glass-modal {
            background: #ffffff !important;
            border-color: #cbd5e1 !important;
            color: #0f172a !important;
        }
        .light-theme #view-co-assistant .bg-slate-900\/60,
        .light-theme #view-co-assistant .bg-indigo-600\/15,
        .light-theme #view-co-assistant .bg-indigo-950\/80 {
            background: #eef2ff !important;
            border-color: #a5b4fc !important;
            color: #172554 !important;
        }
        .light-theme #view-co-assistant p,
        .light-theme #view-co-assistant span,
        .light-theme #view-co-assistant button {
            color: #172554 !important;
        }
        .light-theme #view-co-assistant button.bg-indigo-600,
        .light-theme #view-co-assistant button.bg-indigo-700 {
            color: #ffffff !important;
        }
        @media (max-width: 1023px) {
            body { background: #f8fafc !important; }
            #portal-section { gap: 10px !important; }
            .glass-sidebar { position: sticky; top: 0; z-index: 40; }
            .glass-card, .glass-panel, .glass-main-panel { border-radius: 18px !important; }
            .nav-btn { min-height: 44px !important; }
            .grid { gap: 12px !important; }
            .shadow-2xl, .shadow-xl, .shadow-lg { box-shadow: 0 5px 18px rgba(15,23,42,.08) !important; }
        }
        @media (max-width: 767px) {
            body { padding: 0 !important; }
            #portal-section { padding: 8px !important; }
            #portal-section > main { padding: 10px !important; }
            h1 { font-size: 1.35rem !important; }
            p, span { font-size: 12px !important; }
            #ai-chat-board { height: min(43dvh, 360px) !important; }
        }

        /* ═════════════════════════════════════════════════════════════════════ */
        /* ✨ VISUAL SYSTEM V3 — "10000x BETTER" PASS (added on request)          */
        /* Pure add-on layer, placed last. Premium type pairing, a living aurora  */
        /* mesh backdrop, gradient CTA buttons with a real shine sweep, a glowing */
        /* active-nav pill, gradient avatar rings, upgraded XP/rank badges, and   */
        /* a refined focus system. Nothing above this block was edited.          */
        /* ═════════════════════════════════════════════════════════════════════ */

        /* — Type system: a display font for weight/impact, a humanist body font,
             and a real mono for numbers/IDs/XP — swapped in everywhere for free. */
        body, input, textarea, select, button {
            font-family: 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif !important;
        }
        h1, h2, h3, .font-black, .font-extrabold {
            font-family: 'Outfit', 'Plus Jakarta Sans', ui-sans-serif, system-ui, sans-serif !important;
            letter-spacing: -0.01em;
        }
        .font-mono {
            font-family: 'JetBrains Mono', ui-monospace, monospace !important;
        }

        /* — Living aurora mesh behind the blobs: a huge, extremely slow-rotating
             conic gradient that gives the whole app a sense of depth and motion
             without ever distracting from content (kept under the UI, z-index 0). */
        @keyframes lgAuroraSpin {
            to { transform: rotate(360deg); }
        }
        body::before {
            content: '';
            position: fixed;
            top: 50%;
            left: 50%;
            width: 180vmax;
            height: 180vmax;
            z-index: 0;
            pointer-events: none;
            opacity: 0.5;
            background: conic-gradient(from 0deg at 50% 50%,
                rgba(99,102,241,0.05), rgba(168,85,247,0.045), rgba(6,182,212,0.05),
                rgba(236,72,153,0.04), rgba(45,212,191,0.045), rgba(99,102,241,0.05));
            transform: translate(-50%, -50%) rotate(0deg);
            
            mix-blend-mode: screen;
        }
        .light-theme body::before {
            opacity: 0.28;
            mix-blend-mode: normal;
        }

        /* — Gradient CTA buttons: every solid-indigo call-to-action in the app
             becomes a living indigo→violet→cyan gradient with a diagonal shine
             that sweeps across on hover, plus a soft color-matched glow. */
        .bg-indigo-600 {
            background: linear-gradient(115deg, #4f46e5 0%, #6366f1 35%, #8b5cf6 70%, #4f46e5 100%) !important;
            background-size: 220% 220% !important;
            background-position: 0% 50% !important;
            box-shadow: 0 8px 24px -8px rgba(99,102,241,0.55) !important;
            transition: background-position 0.6s ease, box-shadow 0.35s ease, transform 0.35s cubic-bezier(0.16,1,0.3,1) !important;
        }
        .bg-indigo-600:hover, .hover\:bg-indigo-500:hover {
            background-position: 100% 50% !important;
            box-shadow: 0 12px 32px -8px rgba(99,102,241,0.7), 0 0 24px rgba(139,92,246,0.35) !important;
            transform: translateY(-1px) !important;
        }
        .bg-indigo-600:active {
            transform: translateY(0) scale(0.98) !important;
        }

        /* — Active nav pill: a soft glassy gradient fill + glow so the current
             page always reads instantly, in both themes. */
        .dark-theme .nav-btn.bg-indigo-600\/15 {
            background: linear-gradient(115deg, rgba(99,102,241,0.22), rgba(139,92,246,0.14)) !important;
            box-shadow: inset 0 1px 0 rgba(255,255,255,0.08), 0 4px 16px -6px rgba(99,102,241,0.4) !important;
            position: relative;
        }
        .dark-theme .nav-btn.bg-indigo-600\/15::before {
            content: '';
            position: absolute;
            left: 0; top: 20%; bottom: 20%;
            width: 3px;
            border-radius: 4px;
            background: linear-gradient(180deg, #818cf8, #a78bfa, #67e8f9);
            box-shadow: 0 0 10px rgba(129,140,248,0.7);
        }
        .nav-btn {
            transition: transform 0.3s cubic-bezier(0.16,1,0.3,1), background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease !important;
        }
        .nav-btn:hover {
            transform: translateX(2px);
        }

        /* — Gradient rings on avatars/logo: a slim conic halo that gently spins,
             turning plain profile pictures into a focal point. */
        #profile-avatar, #login-logo {
            position: relative;
        }
        .dark-theme #profile-avatar, .dark-theme #login-logo,
        .light-theme #profile-avatar, .light-theme #login-logo {
            border-radius: 0.75rem;
            background-image: linear-gradient(var(--bg-panel), var(--bg-panel)), conic-gradient(from 0deg, #6366f1, #8b5cf6, #06b6d4, #6366f1);
            background-origin: border-box;
            background-clip: padding-box, border-box;
            border: 2px solid transparent;
            
        }

        /* — Upgraded XP / rank badges: subtle gradient fill + soft pulse glow
             instead of a flat tinted box, across all three rank colors. */
        .rank-emerald, .rank-blue, .rank-amber {
            position: relative;
            box-shadow: 0 0 0 1px currentColor inset, 0 0 16px -6px currentColor !important;
        }
        #dashboard-xp-badge-level {
            background: linear-gradient(120deg, rgba(99,102,241,0.25), rgba(139,92,246,0.15)) !important;
            box-shadow: 0 0 14px -4px rgba(99,102,241,0.5) !important;
        }

        /* — Refined, glassy focus-visible ring app-wide (keyboard accessibility
             gets a premium look instead of the default browser outline). */
        button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
            outline: none !important;
            box-shadow: 0 0 0 3px rgba(99,102,241,0.45), 0 0 0 5px rgba(99,102,241,0.15) !important;
            border-radius: 0.5rem;
        }

        /* — Gentle global default easing for anything already animating, without
             overriding any component that defines its own timing function. */
        * {
            transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
        }

        @media (prefers-reduced-motion: reduce) {
            body::before, .dark-theme #profile-avatar, .dark-theme #login-logo,
            .light-theme #profile-avatar, .light-theme #login-logo {
                animation: none !important;
            }
        }

        /* Remove the hazy glass filter throughout the portal. Opaque surfaces
           stay readable in either theme and render more smoothly on all devices. */
        .glass-card, .glass-panel, .glass-sidebar, .glass-header, .glass-main-panel,
        .glass-modal, #video-bookmarks-container, #admin-feed-composer, #feed-stream > div {
            backdrop-filter: none !important;
            -webkit-backdrop-filter: none !important;
        }
        [class*="backdrop-blur"] { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }
        .group > .absolute[class*="blur-"] { display: none !important; }
        *:hover { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }

        /* Final mobile and tablet clarity pass: opaque panels are easier to read,
           faster to draw, and avoid the foggy glass effect on smaller screens. */
        @media (max-width: 1023px) {
            .glass-card, .glass-panel, .glass-sidebar, .glass-header, .glass-main-panel,
            .glass-modal, #video-bookmarks-container, #admin-feed-composer, #feed-stream > div {
                backdrop-filter: none !important;
                -webkit-backdrop-filter: none !important;
            }
            .dark-theme, .dark-theme body { background: #020617 !important; }
            .dark-theme .glass-main-panel, .dark-theme .glass-sidebar,
            .dark-theme .glass-header, .dark-theme .glass-card, .dark-theme .glass-modal {
                background: #0b1220 !important;
                box-shadow: none !important;
            }
        }

        @media (max-width: 767px) {
            #active-tab-title {
                background: #111827 !important;
                border: 1px solid #334155 !important;
                border-radius: 999px !important;
                padding: 7px 12px !important;
                font-size: 11px !important;
                line-height: 1.1 !important;
            }
            .light-theme #active-tab-title { background: #ffffff !important; border-color: #cbd5e1 !important; color: #172033 !important; }
            .glass-header { padding-left: 12px !important; padding-right: 12px !important; border-radius: 20px !important; margin: 6px 6px 0 !important; border: 1px solid #1e293b !important; }
            .light-theme .glass-header { border-color: #cbd5e1 !important; }
            #portal-section > main { padding-left: 10px !important; padding-right: 10px !important; }
            #view-co-assistant #ai-chat-board { min-height: 48dvh !important; padding: 14px !important; font-size: 14px !important; line-height: 1.55 !important; }
            #view-co-assistant #ai-chat-board p, #view-co-assistant #ai-chat-board span { font-size: 14px !important; line-height: 1.55 !important; }
            #ai-chat-prompt { font-size: 14px !important; min-height: 48px !important; }
            #feed-stream { gap: 12px !important; width: 100% !important; }
            #feed-stream > div { width: 100% !important; box-sizing: border-box !important; padding: 14px !important; border-radius: 18px !important; background: #0f172a !important; overflow-wrap: anywhere !important; }
            #feed-stream .flex.items-start.justify-between, #feed-stream .flex.items-center.justify-between { gap: 10px !important; }
            #feed-stream .flex.items-center.gap-2\.5 { min-width: 0 !important; gap: 9px !important; }
            #feed-stream h4, #feed-stream p, #feed-stream span { max-width: 100% !important; overflow-wrap: anywhere !important; }
            #feed-stream img { max-width: 100% !important; object-fit: cover !important; }
            #feed-stream .feed-post-header { display: block !important; }
            #feed-stream .feed-author { width: 100% !important; align-items: flex-start !important; }
            #feed-stream .feed-author-meta { min-width: 0 !important; }
            #feed-stream .feed-author-name { display: block !important; }
            #feed-stream .feed-author-name h4 { font-size: 13px !important; line-height: 1.35 !important; white-space: normal !important; }
            #feed-stream .feed-author-badges { display: flex !important; flex-direction: column !important; align-items: flex-start !important; width: 100% !important; margin-top: 5px !important; }
            #feed-stream .feed-author-badges span { margin-left: 0 !important; white-space: normal !important; line-height: 1.35 !important; }
            #feed-stream .feed-post-actions { width: 100% !important; justify-content: space-between !important; margin-top: 9px !important; padding-top: 8px !important; border-top: 1px solid rgba(148,163,184,.16) !important; }
            #feed-stream > div > p { font-size: 14px !important; line-height: 1.65 !important; word-break: normal !important; overflow-wrap: break-word !important; }
            #feed-stream .feed-comment-header, #feed-stream .feed-reply-header { display: block !important; }
            #feed-stream .feed-comment-author, #feed-stream .feed-reply-author { width: 100% !important; min-width: 0 !important; align-items: flex-start !important; }
            #feed-stream .feed-comment-header > span, #feed-stream .feed-reply-header > span { display: block !important; margin-top: 6px !important; padding-top: 6px !important; border-top: 1px solid rgba(148,163,184,.16) !important; }
            #feed-stream .ml-4 { margin-left: 8px !important; padding-left: 8px !important; }
            #feed-stream .feed-comment-header + p, #feed-stream .feed-reply-header + p { font-size: 13px !important; line-height: 1.6 !important; word-break: normal !important; overflow-wrap: break-word !important; }
            #view-co-assistant #ai-chat-board { min-height: 58dvh !important; height: 58dvh !important; font-size: 15px !important; }
            .light-theme #feed-stream > div { background: #ffffff !important; border-color: #cbd5e1 !important; }
            #feed-stream img { width: 38px !important; height: 38px !important; }
            #view-feed { padding-left: 2px !important; padding-right: 2px !important; }
        }

        /* ═════════════════════════════════════════════════════════════════════ */
        /* ✨ CURSOR PARTICLE FIELD — desktop only.                               */
        /* A drifting constellation of dots that gently reacts to the mouse,     */
        /* sitting behind every panel at z-index 0 (same layer as the aurora     */
        /* mesh above). Below 1024px it never renders — initCursorParticles()    */
        /* keeps the canvas hidden and skips the animation loop entirely on      */
        /* phones/tablets, and the JS re-checks this on every resize.            */
        /* ═════════════════════════════════════════════════════════════════════ */
        #cursor-particles {
            position: fixed;
            inset: 0;
            width: 100vw;
            height: 100vh;
            z-index: 0;
            pointer-events: none;
            display: none; /* initCursorParticles() only switches this on for desktop viewports */
        }

        /* Bring the glass blur back, but only at desktop widths, so the particle
           field is visible — softly frosted — through every tab panel, card,
           sidebar, header and modal. Mobile/tablet keeps the opaque, faster
           panels from the clarity pass above untouched. Matches the selector
           list of the rule that turned blur off, plus every Tailwind
           backdrop-blur-* utility, so this wins the cascade by coming later. */
        @media (min-width: 1024px) {
            .glass-card, .glass-panel, .glass-sidebar, .glass-header, .glass-main-panel,
            .glass-modal, #video-bookmarks-container, #admin-feed-composer, #feed-stream > div,
            [class*="backdrop-blur"] {
                backdrop-filter: blur(18px) saturate(150%) !important;
                -webkit-backdrop-filter: blur(18px) saturate(150%) !important;
            }
            /* (no :hover variant on purpose — hovering a tab must never change the blur behind it) */
        }

        /* ===================================================================== */
        /* 🖥️✨ DESKTOP PREMIUM POLISH PASS — purely additive visual refinement  */
        /* for wider screens. Scoped to (min-width: 768px) so nothing here ever */
        /* touches the phone layout, which stays exactly as it was.             */
        /* ===================================================================== */
        @media (min-width: 768px) {

            /* Richer, more dimensional page backdrop behind the glass panels */
            .dark-theme body {
                background:
                    radial-gradient(ellipse 900px 500px at 12% -5%, rgba(99, 102, 241, 0.10), transparent 60%),
                    radial-gradient(ellipse 800px 600px at 100% 10%, rgba(6, 182, 212, 0.07), transparent 55%),
                    radial-gradient(ellipse 700px 500px at 50% 110%, rgba(139, 92, 246, 0.08), transparent 55%),
                    var(--bg-main) !important;
            }
            .light-theme body {
                background:
                    radial-gradient(ellipse 900px 500px at 12% -5%, rgba(99, 102, 241, 0.06), transparent 60%),
                    radial-gradient(ellipse 800px 600px at 100% 10%, rgba(6, 182, 212, 0.05), transparent 55%),
                    #f8fafc !important;
            }

            /* Sidebar: crisper edge, subtle top highlight, gentle depth */
            .glass-sidebar {
                border-radius: 22px !important;
                position: relative;
                overflow: hidden;
            }
            .glass-sidebar::after {
                content: '';
                position: absolute;
                inset: 0 0 auto 0;
                height: 1px;
                background: linear-gradient(90deg, transparent, rgba(129, 140, 248, 0.5), transparent);
                pointer-events: none;
            }

            /* Active nav item gets a clean accent bar + gentle glow instead of just a tint */
            .nav-btn.bg-indigo-600\/15 {
                position: relative;
                box-shadow: 0 8px 20px -8px rgba(99, 102, 241, 0.35) !important;
            }
            .nav-btn.bg-indigo-600\/15::before {
                content: '';
                position: absolute;
                left: -1px;
                top: 20%;
                bottom: 20%;
                width: 3px;
                border-radius: 3px;
                background: linear-gradient(180deg, #818cf8, #6366f1);
            }
            .nav-btn {
                transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease !important;
            }
            .nav-btn:hover {
                transform: translateX(3px);
            }

            /* Cards lift subtly on hover for a tactile, premium feel */
            .glass-card {
                transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s ease, box-shadow 0.35s ease !important;
            }
            .glass-card:hover {
                transform: translateY(-3px);
            }

            /* Primary buttons get a soft directional sheen on hover */
            button.bg-indigo-600 {
                position: relative;
                overflow: hidden;
                transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
            }
            button.bg-indigo-600:hover {
                transform: translateY(-1px);
                box-shadow: 0 10px 24px -8px rgba(99, 102, 241, 0.55) !important;
            }
            button.bg-indigo-600:active {
                transform: translateY(0);
            }

            /* Section headings: a touch more breathing room and refined tracking */
            h1, h2, h3 {
                letter-spacing: -0.01em;
            }

            /* Slim-looking but full-size-hit-box custom scrollbar for desktop
               panels: the scrollbar track/hit area stays a comfortable width
               to grab, but the visible thumb is rendered much thinner via a
               transparent border + background-clip trick, with a soft glow. */
            .overflow-y-auto::-webkit-scrollbar,
            .overflow-y-scroll::-webkit-scrollbar {
                width: 10px;
                height: 10px;
            }
            .overflow-y-auto::-webkit-scrollbar-track,
            .overflow-y-scroll::-webkit-scrollbar-track {
                background: transparent;
            }
            .overflow-y-auto::-webkit-scrollbar-thumb,
            .overflow-y-scroll::-webkit-scrollbar-thumb {
                background-color: rgba(129, 140, 248, 0.6);
                background-clip: padding-box;
                border: 3.5px solid transparent;
                border-radius: 999px;
                box-shadow: 0 0 6px rgba(99, 102, 241, 0.55), 0 0 2px rgba(129, 140, 248, 0.9);
                transition: background-color 0.2s ease, box-shadow 0.2s ease;
            }
            .overflow-y-auto::-webkit-scrollbar-thumb:hover,
            .overflow-y-scroll::-webkit-scrollbar-thumb:hover {
                background-color: rgba(129, 140, 248, 0.9);
                box-shadow: 0 0 10px rgba(99, 102, 241, 0.85), 0 0 4px rgba(129, 140, 248, 1);
            }
            /* Firefox: closest equivalent (no glow/thumb-shrink support there) */
            .overflow-y-auto, .overflow-y-scroll {
                scrollbar-width: thin;
                scrollbar-color: rgba(129, 140, 248, 0.6) transparent;
            }

            /* Login card: a bit more presence and a crisper edge on the wider screen */
            #login-section > div {
                box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.55), var(--neumorphic-flat) !important;
            }
            #login-section input[type="text"]:focus,
            #login-section input[type="password"]:focus {
                box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15) !important;
            }

            /* Materials & feed cards: slightly richer border on hover to match the lift */
            #materials-grid .glass-card:hover,
            #feed-stream .glass-card:hover {
                border-color: rgba(99, 102, 241, 0.4) !important;
            }

            /* ----- New: extra motion, kept desktop-only on purpose ----- */

            /* Active nav accent bar breathes gently instead of sitting static */
            @keyframes navBarGlow {
                0%, 100% { opacity: 0.65; box-shadow: 0 0 6px rgba(129, 140, 248, 0.4); }
                50% { opacity: 1; box-shadow: 0 0 12px rgba(129, 140, 248, 0.8); }
            }
            .nav-btn.bg-indigo-600\/15::before {
                
            }

            /* Chat Lock overlay entrance */
            @keyframes chatLockFadeIn {
                0%   { opacity: 0; }
                100% { opacity: 1; }
            }
            #chat-lock-overlay.chat-lock-fade-in { animation: chatLockFadeIn 0.22s ease-out; }
            #chat-lock-overlay.chat-lock-fade-in > div {
                animation: chatBubbleIn 0.3s ease-out;
            }

            /* 🎙️ Click-to-record mic button — expanding sonar rings while recording */
            .voice-rec-ring {
                position: absolute;
                inset: 0;
                border-radius: 0.75rem;
                border: 2px solid rgba(248, 113, 113, 0.65);
                animation: voiceRecPulse 1.6s ease-out infinite;
                pointer-events: none;
            }
            @keyframes voiceRecPulse {
                0%   { transform: scale(0.85); opacity: 0.9; }
                100% { transform: scale(1.9); opacity: 0; }
            }
            #chat-voice-btn.is-recording {
                color: #f87171 !important;
                background: rgba(248, 113, 113, 0.12) !important;
            }
            #chat-voice-btn.is-recording i {
                animation: voiceMicBob 0.9s ease-in-out infinite;
            }
            @keyframes voiceMicBob {
                0%, 100% { transform: scale(1); }
                50% { transform: scale(1.18); }
            }
            /* Translate button spinner while a lookup is in flight */
            .translate-spin i { animation: spin 0.8s linear infinite; }
            @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
            /* Avatar saved — quick success glow ring */
            @keyframes avatarSavedGlow {
                0%   { box-shadow: 0 0 0 0 rgba(99,102,241,0.8); }
                70%  { box-shadow: 0 0 0 10px rgba(99,102,241,0); }
                100% { box-shadow: 0 0 0 0 rgba(99,102,241,0); }
            }
            .avatar-saved-flash { animation: avatarSavedGlow 0.9s ease-out; }
            /* Fresh chat bubble slide-in */
            @keyframes chatBubbleIn {
                0%   { opacity: 0; transform: translateY(8px) scale(0.97); }
                100% { opacity: 1; transform: translateY(0) scale(1); }
            }
            .chat-bubble-new { animation: chatBubbleIn 0.28s ease-out; }

            /* Profile avatar gets a slow, subtle float — alive, not distracting */
            @keyframes avatarFloat {
                0%, 100% { transform: translateY(0); }
                50% { transform: translateY(-3px); }
            }
            #profile-avatar {
                
            }

            /* Primary buttons: soft sweeping shine on hover */
            @keyframes buttonSheen {
                0% { transform: translateX(-120%) skewX(-15deg); }
                100% { transform: translateX(220%) skewX(-15deg); }
            }
            button.bg-indigo-600::after {
                content: '';
                position: absolute;
                top: 0;
                left: 0;
                width: 35%;
                height: 100%;
                background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.25), transparent);
                opacity: 0;
                pointer-events: none;
            }
            button.bg-indigo-600:hover::after {
                opacity: 1;
                animation: buttonSheen 0.9s ease forwards;
            }

            /* Icons nudge and brighten on nav hover for a livelier feel */
            .nav-btn:hover [data-lucide] {
                transform: scale(1.1);
                transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
            }

            /* Tab content eases in with a touch more spring than the base animation */
            .view-panel {
                animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !important;
            }
        }
        /* ===================================================================== */
        /* 📱✨ MOBILE PREMIUM POLISH PASS v2 — additive-only visual refinement  */
        /* for phones, tuned to stay cheap (no blur/animation additions, since  */
        /* the perf-focused rules above already strip those on touch devices). */
        /* Nothing here changes layout, structure, or spacing — only look/feel.*/
        /* ===================================================================== */
        @media (max-width: 767px) {

            /* Same layered depth as desktop, but static (no animated blobs) so
               it costs nothing extra on a phone GPU/battery. */
            .dark-theme body {
                background:
                    radial-gradient(ellipse 500px 350px at 15% -5%, rgba(99, 102, 241, 0.12), transparent 60%),
                    radial-gradient(ellipse 450px 400px at 100% 15%, rgba(6, 182, 212, 0.08), transparent 55%),
                    radial-gradient(ellipse 400px 350px at 50% 115%, rgba(139, 92, 246, 0.09), transparent 55%),
                    var(--bg-main) !important;
            }
            .light-theme body {
                background:
                    radial-gradient(ellipse 500px 350px at 15% -5%, rgba(99, 102, 241, 0.07), transparent 60%),
                    radial-gradient(ellipse 450px 400px at 100% 15%, rgba(6, 182, 212, 0.05), transparent 55%),
                    #f8fafc !important;
            }

            /* Real tap feedback everywhere touch replaces hover */
            .glass-card, .glass-panel {
                transition: transform 0.15s ease, border-color 0.2s ease !important;
            }
            .glass-card:active, .glass-panel:active {
                transform: scale(0.985);
            }
            button.bg-indigo-600, .ripple-btn {
                transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease !important;
            }
            button.bg-indigo-600:active {
                transform: scale(0.96);
            }

            /* Active tab in the pill bar gets a small glowing underline instead
               of just a flat tint, so it reads clearly while thumb-scrolling. */
            .glass-sidebar nav .nav-btn.bg-indigo-600\/15 {
                position: relative;
                box-shadow: 0 4px 14px -4px rgba(99, 102, 241, 0.5) !important;
            }
            .glass-sidebar nav .nav-btn.bg-indigo-600\/15::after {
                content: '';
                position: absolute;
                left: 16%;
                right: 16%;
                bottom: 2px;
                height: 2px;
                border-radius: 2px;
                background: linear-gradient(90deg, #818cf8, #6366f1);
            }

            /* Crisper card edges and a touch more lift on the login card */
            #login-section > div {
                box-shadow: 0 20px 45px -18px rgba(0, 0, 0, 0.55), var(--neumorphic-flat) !important;
            }
            .glass-card, #materials-grid > div, #feed-stream > div {
                border-radius: 18px !important;
            }

            /* Slightly punchier focus ring on inputs — easier to see mid-tap */
            input:focus, textarea:focus, select:focus {
                box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18) !important;
            }
        }

        /* ==================================================================
           🎬 EXTRA MOTION LAYER — entrance pop-ins, stagger reveals,
           celebration confetti & small micro-interactions.
           Cards stay flat/static on hover (tilt was intentionally disabled
           above) — everything here is about arrival + feedback, not tilt.
           ================================================================== */

        @keyframes cardPopIn {
            0%   { opacity: 0; transform: translateY(16px) scale(0.97); }
            60%  { opacity: 1; }
            100% { opacity: 1; transform: translateY(0) scale(1); }
        }
        /* Applied by applyStaggerReveal() to the direct children of any
           freshly re-rendered list/grid (materials, videos, feed, admin
           tables, leaderboard, AI chat sessions). --stagger-i is set
           per-item in JS so cards cascade in instead of popping at once. */
        .stagger-pop {
            animation: cardPopIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
            animation-delay: calc(min(var(--stagger-i, 0), 8) * 55ms);
        }

        /* Dashboard bento cells + any nested grid cascade in on first paint */
        .stagger-container > * {
            animation: cardPopIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
        }
        .stagger-container > *:nth-child(1) { animation-delay: 0.02s; }
        .stagger-container > *:nth-child(2) { animation-delay: 0.08s; }
        .stagger-container > *:nth-child(3) { animation-delay: 0.14s; }
        .stagger-container > *:nth-child(4) { animation-delay: 0.20s; }
        .stagger-container > *:nth-child(5) { animation-delay: 0.26s; }
        .stagger-container > *:nth-child(6) { animation-delay: 0.32s; }
        .stagger-container > *:nth-child(n+7) { animation-delay: 0.38s; }

        /* ==================================================================
           ✨ POLISH PASS v3 — additive-only: skeleton loaders, smoother AI
           typing dots, button loading→success morph, completion pop-ins,
           and gentle floating empty-state illustrations. Nothing here
           changes layout — only feel, and only on top of what already
           exists above. */

        /* Skeleton shimmer — ready-to-use placeholder for any element
           still waiting on a D1 fetch (swap real content in once loaded). */
        @keyframes skeletonShimmer {
            0% { background-position: -200% 0; }
            100% { background-position: 200% 0; }
        }
        .skeleton {
            background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.14) 37%, rgba(255,255,255,0.06) 63%);
            background-size: 400% 100%;
            animation: skeletonShimmer 1.4s ease infinite;
            border-radius: 8px;
            color: transparent !important;
        }
        .light-theme .skeleton {
            background: linear-gradient(90deg, rgba(15,23,42,0.06) 25%, rgba(15,23,42,0.12) 37%, rgba(15,23,42,0.06) 63%);
            background-size: 400% 100%;
        }

        /* Smoother "Co Assistant is thinking" dots (replaces the default
           Tailwind bounce on the loader bubble with a gentler pulse). */
        @keyframes typingPulse {
            0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
            30% { transform: translateY(-4px); opacity: 1; }
        }
        .typing-dot { animation: typingPulse 1s ease-in-out infinite; }

        /* Button loading → success morph. Use with btnMorphStart() /
           btnMorphSuccess() / btnMorphReset() (see script section). */
        .btn-morphing { pointer-events: none; opacity: 0.85; }
        .btn-morph-spinner {
            display: inline-block; width: 14px; height: 14px;
            border: 2px solid rgba(255,255,255,0.35);
            border-top-color: #fff;
            border-radius: 50%;
            animation: spin 0.7s linear infinite;
        }
        @keyframes btnSuccessFlash {
            0% { transform: scale(1); }
            30% { transform: scale(1.04); }
            100% { transform: scale(1); }
        }
        .btn-morph-success {
            background-color: #10b981 !important;
            border-color: #10b981 !important;
            animation: btnSuccessFlash 0.4s ease-out;
        }

        /* Satisfying pop when a session/lecture gets its completed checkmark */
        @keyframes checkPopIn {
            0% { transform: scale(0); opacity: 0; }
            60% { transform: scale(1.3); opacity: 1; }
            100% { transform: scale(1); }
        }
        .completion-check-pop { animation: checkPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both; }

        /* Gentle float for empty-state illustrations ("All caught up!") */
        @keyframes emptyStateFloat {
            0%, 100% { transform: translateY(0); opacity: 0.65; }
            50% { transform: translateY(-6px); opacity: 1; }
        }
        .empty-state-float {  }

        /* Desktop login card now gets a proper arrival too (previously mobile-only) */
        #login-section > div {
            animation: modalScaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
        }

        /* Login error banner shakes every time it appears (no JS needed —
           replays automatically whenever the "hidden" class is removed) */
        @keyframes shakeError {
            10%, 90% { transform: translateX(-1px); }
            20%, 80% { transform: translateX(2px); }
            30%, 50%, 70% { transform: translateX(-4px); }
            40%, 60% { transform: translateX(4px); }
        }
        #login-error:not(.hidden) {
            animation: shakeError 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
        }

        /* Nav item gets a quick confident pop when it becomes the active tab */
        @keyframes navPop {
            0%   { transform: scale(0.94); }
            55%  { transform: scale(1.035); }
            100% { transform: scale(1); }
        }
        .nav-pop { animation: navPop 0.32s cubic-bezier(0.34, 1.56, 0.64, 1); }

        /* Playful wiggle for small icon-only buttons on hover */
        @keyframes iconWiggle {
            0%, 100% { transform: rotate(0deg); }
            25% { transform: rotate(-12deg); }
            75% { transform: rotate(12deg); }
        }
        .icon-wiggle-hover:hover i,
        .icon-wiggle-hover:hover svg { animation: iconWiggle 0.4s ease-in-out; }

        /* Soft diagonal shine sweeping across the XP bar, layered on top of
           its existing width transition — reads as "energy", not distraction */
        @keyframes xpShine {
            0%   { transform: translateX(-140%) skewX(-20deg); }
            100% { transform: translateX(260%) skewX(-20deg); }
        }
        #dashboard-xp-progress-bar { position: relative; overflow: hidden; }
        #dashboard-xp-progress-bar::after {
            content: '';
            position: absolute;
            top: 0; left: 0; height: 100%; width: 35%;
            background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
            
            animation-delay: 1.2s;
        }

        /* Confetti burst fired on lecture completion / +XP milestones */
        @keyframes confettiFall {
            0%   { transform: translateY(-10px) rotate(0deg); opacity: 1; }
            100% { transform: translateY(70vh) rotate(540deg); opacity: 0; }
        }
        .confetti-piece {
            position: fixed;
            top: -10px;
            border-radius: 2px;
            pointer-events: none;
            z-index: 9999;
            animation: confettiFall 1.4s cubic-bezier(0.35, 0.0, 0.65, 1) forwards;
        }

        /* Gentle idle float for badges/rank pills so they never feel static */
        @keyframes gentleFloatY {
            0%, 100% { transform: translateY(0); }
            50% { transform: translateY(-4px); }
        }
        .gentle-float {  }

        /* Slightly punchier press feedback on every ripple/interactive button */
        .ripple-btn:active { transform: scale(0.95); }

        /* ==================================================================
           ✨ POLISH PASS v4 — more small delight animations: star-rating
           pop, toast icon bounce-in, admin rows now cascade in with the
           same stagger used by materials/videos/feed. */
        @keyframes starPop {
            0% { transform: scale(1) rotate(0deg); }
            40% { transform: scale(1.35) rotate(-8deg); }
            70% { transform: scale(0.95) rotate(4deg); }
            100% { transform: scale(1) rotate(0deg); }
        }
        .star-pop { animation: starPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }

        @keyframes toastIconPop {
            0% { transform: scale(0) rotate(-45deg); opacity: 0; }
            60% { transform: scale(1.2) rotate(8deg); opacity: 1; }
            100% { transform: scale(1) rotate(0deg); }
        }
        .toast-icon-pop { animation: toastIconPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both; }

        /* Nav icon gives a tiny confirming bounce the moment its tab becomes active */
        @keyframes navIconLand {
            0% { transform: scale(0.7); }
            60% { transform: scale(1.25); }
            100% { transform: scale(1); }
        }
        .nav-icon-land { animation: navIconLand 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }

        /* Search inputs get an animated focus underline instead of just a border flash */
        .search-underline-anim { position: relative; }
        .search-underline-anim::after {
            content: '';
            position: absolute;
            left: 12px; right: 12px; bottom: 0;
            height: 2px;
            background: linear-gradient(90deg, #6366f1, #22d3ee);
            transform: scaleX(0);
            transform-origin: left;
            transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
            border-radius: 2px;
        }
        .search-underline-anim:focus-within::after { transform: scaleX(1); }
    
        /* 🎛️ CUSTOM VIDEO PLAYER UI */
        #video-theater { -webkit-tap-highlight-color: transparent; }
        #video-theater.vc-idle { cursor: none; }
        #youtube-player-wrap iframe { pointer-events: none; } /* no YouTube hover UI, ever */
        /* NATIVE YOUTUBE BAR MODE (YT_NATIVE_BAR): YouTube's own control bar (with its real quality menu) is used.
           Our glass bar is hidden. A shield covers the picture but leaves the bottom strip free, so only the bar can be
           clicked: the logo link, the title link and the "More videos" tiles can never be reached. */
        #video-theater.yt-native #youtube-player-wrap iframe { pointer-events: auto; }
        #video-theater.yt-native #vc-bar, #video-theater.yt-native .vc-yt-shade { display: none !important; }
        #video-theater.yt-native #vc-shield { display: block !important; bottom: 64px; }
        #video-theater.yt-native #vc-cover { bottom: 64px; }
        #vc-native-fs { display: none; position: absolute; top: 10px; right: 10px; z-index: 45; width: 38px; height: 38px; align-items: center; justify-content: center;
                        border: 0; border-radius: 9999px; color: #fff; background: rgba(10,15,30,0.62); cursor: pointer; }
        #vc-native-fs:hover { background: rgba(99,102,241,0.8); }
        #vc-native-fs svg { width: 20px; height: 20px; }
        #video-theater.yt-native #vc-native-fs { display: flex; }
        /* Permanent strip over YouTube's own control row. controls:0 keeps it off most of the
           time, but YouTube still flashes its native play/seek bar for a frame on certain state
           changes (buffering, quality switches, ad breaks) regardless of hover. This sits above
           the iframe but below our own shield/bar/cover, so any flash reads as a dim gradient
           instead of YouTube's actual UI — independent of whether our own bar is shown or faded. */
        #yt-hd-loading { position: absolute; inset: 0; z-index: 25; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
                         background: radial-gradient(circle at 50% 40%, #12122b, #02030a 75%); color: #c7d2fe; font: 800 12px ui-monospace, monospace; letter-spacing: .08em; }
        .yt-hd-spin { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(165,180,252,.25); border-top-color: #818cf8; animation: ytHdSpin .8s linear infinite; }
        @keyframes ytHdSpin { to { transform: rotate(360deg); } }
        .vc-yt-shade { position: absolute; left: 0; right: 0; bottom: 0; height: 76px; z-index: 15; pointer-events: none;
                        background: linear-gradient(to top, rgba(2,6,23,0.94), rgba(2,6,23,0.55) 55%, rgba(2,6,23,0) 100%); }
        @media (max-width: 640px) { .vc-yt-shade { height: 56px; } }
        #video-theater:fullscreen, #video-theater.vc-pseudo-fs { aspect-ratio: auto !important; border-radius: 0 !important; width: 100%; height: 100%; }
        #video-theater.vc-pseudo-fs { position: fixed !important; inset: 0; z-index: 9999; }
        #video-theater:fullscreen #secure-player, #video-theater.vc-pseudo-fs #secure-player { object-fit: contain; }
        .vc-shield { position: absolute; inset: 0; z-index: 20; cursor: pointer; }

        /* top title strip — also hides YouTube's own title/channel overlay */
        .vc-top { position: absolute; left: 0; right: 0; top: 0; z-index: 25; display: flex; align-items: center; gap: 10px; padding: 16px 18px 46px; pointer-events: none; transition: opacity .3s ease;
                  background: linear-gradient(to bottom, rgba(2,6,23,0.99) 0%, rgba(2,6,23,0.94) 55%, rgba(2,6,23,0) 100%); }
        .vc-top.vc-hide { opacity: 0; }
        .vc-pill { flex: none; padding: 3px 8px; border-radius: 9999px; font: 800 9px/1 ui-monospace, monospace; letter-spacing: .12em; color: #c7d2fe; background: rgba(99,102,241,0.28); border: 1px solid rgba(129,140,248,0.45); }
        .vc-title { min-width: 0; font: 700 14px/1.2 system-ui, sans-serif; color: #f8fafc; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 8px rgba(0,0,0,.6); }

        /* paused / ready / finished cover — hides YouTube's paused UI and "more videos" grid */
        .vc-cover { position: absolute; inset: 0; z-index: 26; display: flex; align-items: center; justify-content: center; text-align: center; pointer-events: none; animation: vcFade .3s ease;
                    background: rgba(5,7,12,0.94); }
        .vc-cover.hidden { display: none; }
        /* PAUSED: no overlay at all — no purple wash, no blur, no big button — so the frame stays fully visible.
           (Play/resume stays one tap away: tap the picture or use the play button in the control bar.)
           READY (autoplay was blocked): transparent, only the play button shows. LOADING / FINISHED keep a neutral dark cover. */
        .vc-cover[data-mode="paused"] { display: none; }
        .vc-cover[data-mode="ready"] { background: transparent; }
        .vc-cover-inner { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 24px 54px; max-width: 90%; }
        .vc-cover-play { width: 78px; height: 78px; border-radius: 9999px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(135deg,#6366f1,#8b5cf6); box-shadow: 0 0 0 10px rgba(99,102,241,0.18), 0 14px 44px rgba(99,102,241,0.55); animation: vcPulse 2.4s ease-in-out infinite; }
        .vc-cover-play svg { width: 32px; height: 32px; margin-left: 4px; }
        .vc-cover-badge { margin-top: 8px; font: 800 10px/1 ui-monospace, monospace; letter-spacing: .2em; color: #a5b4fc; }
        .vc-cover-title { font: 800 clamp(15px, 2.4vw, 22px)/1.25 system-ui, sans-serif; color: #fff; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
        .vc-cover-sub { font: 600 12px ui-monospace, monospace; color: #94a3b8; }
        @keyframes vcFade { from { opacity: 0; } to { opacity: 1; } }
        @keyframes vcPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

        .vc-spinner { position: absolute; left: 50%; top: 50%; z-index: 27; width: 46px; height: 46px; margin: -23px 0 0 -23px; border-radius: 9999px; border: 3px solid rgba(255,255,255,0.18); border-top-color: #818cf8; animation: vcSpin .8s linear infinite; pointer-events: none; }
        .vc-spinner.hidden { display: none; }
        @keyframes vcSpin { to { transform: rotate(360deg); } }

        /* double-tap skip feedback */
        .vc-skip { position: absolute; top: 50%; z-index: 27; width: 110px; height: 110px; margin-top: -55px; border-radius: 9999px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: #fff; background: rgba(15,23,42,0.55); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); opacity: 0; transform: scale(.8); pointer-events: none; }
        .vc-skip svg { width: 28px; height: 28px; }
        .vc-skip span { font: 800 12px ui-monospace, monospace; }
        .vc-skip-l { left: 9%; } .vc-skip-r { right: 9%; }
        .vc-skip.show { animation: vcSkip .6s ease forwards; }
        @keyframes vcSkip { 0% { opacity: 0; transform: scale(.7); } 25% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.08); } }

        /* floating glass control bar */
        .vc-bar { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 40; padding: 4px 12px 8px; color: #fff; border-radius: 18px; border: 1px solid rgba(255,255,255,0.1);
                  background: rgba(10,15,30,0.62); -webkit-backdrop-filter: blur(16px) saturate(1.4); backdrop-filter: blur(16px) saturate(1.4); box-shadow: 0 10px 40px rgba(0,0,0,0.55);
                  transition: opacity .3s ease, transform .3s ease; user-select: none; -webkit-user-select: none; }
        .vc-bar.vc-hide { opacity: 0; transform: translateY(8px); pointer-events: none; }
        #video-theater:fullscreen .vc-bar, #video-theater.vc-pseudo-fs .vc-bar { left: 18px; right: 18px; bottom: 18px; }
        .vc-row { display: flex; align-items: center; gap: 4px; }
        .vc-spacer { flex: 1 1 auto; }
        .vc-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; padding: 0 8px; border: 0; border-radius: 9999px; background: transparent; color: #e2e8f0; cursor: pointer; font: 800 11px/1 ui-monospace, monospace; transition: background .15s, color .15s, transform .15s; }
        .vc-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }
        .vc-btn:active { transform: scale(.92); }
        .vc-btn svg { width: 20px; height: 20px; }
        .vc-main { width: 46px; min-width: 46px; height: 46px; margin-right: 4px; color: #fff; background: linear-gradient(135deg,#6366f1,#8b5cf6); box-shadow: 0 6px 20px rgba(99,102,241,0.5); }
        .vc-main:hover { background: linear-gradient(135deg,#818cf8,#a78bfa); }
        .vc-main svg { width: 22px; height: 22px; }
        .vc-n { position: absolute; font-size: 7px; font-weight: 900; pointer-events: none; }
        .vc-time { font: 700 12px ui-monospace, monospace; color: #cbd5e1; padding: 0 8px; white-space: nowrap; letter-spacing: .02em; }
        .vc-vol { display: flex; align-items: center; }
        .vc-speed-btn { background: rgba(255,255,255,0.08); }

        .vc-seekwrap { position: relative; height: 22px; display: flex; align-items: center; }
        .vc-seekwrap::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 9999px; background: rgba(255,255,255,0.18); transition: height .15s, margin-top .15s; }
        .vc-buf { position: absolute; left: 0; top: 50%; height: 5px; margin-top: -2.5px; width: 0; border-radius: 9999px; background: rgba(255,255,255,0.32); transition: height .15s, margin-top .15s; }
        .vc-seekwrap:hover::before, .vc-seekwrap:hover .vc-buf { height: 7px; margin-top: -3.5px; }
        .vc-range { -webkit-appearance: none; appearance: none; background: transparent; cursor: pointer; margin: 0; --p: 0%; position: relative; }
        .vc-seek { width: 100%; height: 22px; }
        .vc-volume { width: 76px; height: 18px; }
        .vc-range::-webkit-slider-runnable-track { height: 5px; border-radius: 9999px; background: linear-gradient(to right, #818cf8, #a78bfa var(--p), transparent var(--p)); }
        .vc-volume::-webkit-slider-runnable-track { background: linear-gradient(to right, #fff var(--p), rgba(255,255,255,0.25) var(--p)); }
        .vc-seek:hover::-webkit-slider-runnable-track { height: 7px; }
        .vc-range::-moz-range-track { height: 5px; border-radius: 9999px; background: transparent; }
        .vc-range::-moz-range-progress { height: 5px; border-radius: 9999px; background: linear-gradient(to right, #818cf8, #a78bfa); }
        .vc-volume::-moz-range-track { background: rgba(255,255,255,0.25); }
        .vc-volume::-moz-range-progress { background: #fff; }
        .vc-range::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -4.5px; border-radius: 9999px; background: #fff; box-shadow: 0 0 0 4px rgba(129,140,248,0.45), 0 2px 8px rgba(0,0,0,.5); opacity: 0; transition: opacity .15s; }
        .vc-range::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 9999px; background: #fff; box-shadow: 0 0 0 4px rgba(129,140,248,0.45); opacity: 0; }
        .vc-seek:hover::-webkit-slider-thumb, .vc-seek:active::-webkit-slider-thumb, .vc-volume:hover::-webkit-slider-thumb { opacity: 1; margin-top: -3.5px; }
        .vc-seek:hover::-moz-range-thumb, .vc-volume:hover::-moz-range-thumb { opacity: 1; }
        .vc-tip { position: absolute; bottom: 26px; transform: translateX(-50%); padding: 4px 8px; border-radius: 8px; font: 800 11px ui-monospace, monospace; color: #fff; background: rgba(2,6,23,0.92); border: 1px solid rgba(255,255,255,0.14); pointer-events: none; white-space: nowrap; }
        .vc-tip.hidden { display: none; }

        .vc-speed-wrap { position: relative; }
        .vc-menu { position: absolute; right: 0; bottom: 48px; min-width: 88px; padding: 6px; border-radius: 14px; background: rgba(10,15,30,0.96); border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 14px 40px rgba(0,0,0,0.6); }
        .vc-menu.hidden { display: none; }
        #vc-quality-menu { min-width: 110px; }
        .vc-menu button { display: block; width: 100%; padding: 8px 12px; border: 0; border-radius: 9px; background: transparent; color: #cbd5e1; font: 700 12px ui-monospace, monospace; text-align: left; cursor: pointer; }
        .vc-menu button:hover { background: rgba(255,255,255,0.1); color: #fff; }
        .vc-menu button.on { color: #c7d2fe; background: rgba(99,102,241,0.25); }
        @media (max-width: 640px) {
            .vc-volume { display: none; }
            .vc-bar { left: 6px; right: 6px; bottom: 6px; padding: 2px 8px 6px; border-radius: 14px; }
            .vc-btn { min-width: 32px; height: 32px; padding: 0 5px; }
            .vc-main { width: 40px; min-width: 40px; height: 40px; }
            .vc-time { font-size: 10px; padding: 0 4px; }
            .vc-top { padding: 10px 12px 26px; } .vc-title { font-size: 12px; }
            .vc-cover-play { width: 60px; height: 60px; } .vc-cover-inner { padding-bottom: 44px; }
            .vc-skip { width: 84px; height: 84px; margin-top: -42px; }
        }