/* graphics.css — merged: polish, boost, ultra, fx, look, flow, glass, smooth, liquid, wow, gx (readable build). */


/* ======== polish.css ======== */
/* =====================================================================
   polish.css — design layer. Loaded AFTER main.css; delete its <link> in
   index.html to switch it off. Dark = refined glass, Light = bright & friendly.
   ===================================================================== */

/* ---------- Shared: type, spacing, focus, motion ---------- */
:root {
    --pl-accent: #7c6cff;
    --pl-accent-2: #a78bfa;
    --pl-ring: 0 0 0 3px rgba(124, 108, 255, .35);
    --pl-ease: cubic-bezier(.22, 1, .36, 1);
    --pl-radius: 18px;
}

/* Words were running together ("GeniusAcademy", "Searchsessions") */
body, input, textarea, select, button, h1, h2, h3, p, span, label { word-spacing: .09em; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; line-height: 1.55; }
h1, h2, h3 { letter-spacing: -0.005em; line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }

/* Small all-caps labels were shouting; keep them, but quieter */
.tracking-wider, .tracking-widest { letter-spacing: .05em !important; }

::selection { background: rgba(124, 108, 255, .4); color: #fff; }
.light-theme ::selection { background: rgba(236, 72, 153, .22); color: #1e1b4b; }

/* Keyboard focus that is always visible */
:focus-visible { outline: 2px solid var(--pl-accent-2); outline-offset: 2px; border-radius: 10px; }
input:focus, textarea:focus, select:focus { outline: none; box-shadow: var(--pl-ring) !important; border-color: var(--pl-accent) !important; }

/* Inputs: roomier, calmer */
input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea {
    transition: border-color .2s var(--pl-ease), box-shadow .2s var(--pl-ease), background-color .2s var(--pl-ease);
}
input::placeholder, textarea::placeholder { opacity: .55; }
input[type=checkbox] { accent-color: var(--pl-accent); width: 16px; height: 16px; cursor: pointer; }

/* Buttons: responds to touch/press */
button, [role=button], a { -webkit-tap-highlight-color: transparent; }
button { transition: transform .18s var(--pl-ease), background-color .2s ease, border-color .2s ease, box-shadow .25s var(--pl-ease), filter .2s ease; }
button:not(:disabled):active { transform: scale(.97); }
button:disabled { cursor: not-allowed; opacity: .55; }

.bg-indigo-600, .bg-indigo-500 {
    background-image: linear-gradient(135deg, #6366f1 0%, #7c6cff 55%, #9b7bff 100%) !important;
    box-shadow: 0 10px 24px -10px rgba(99, 102, 241, .75), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.bg-indigo-600:hover, .bg-indigo-500:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* Entrance for dialogs (answers a click, so motion is welcome) */
@keyframes pl-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.glass-modal { animation: pl-rise .38s var(--pl-ease) both; }

/* Scrollbars */
* { scrollbar-width: thin; scrollbar-color: rgba(124, 108, 255, .4) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: rgba(124, 108, 255, .35); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(124, 108, 255, .6); background-clip: padding-box; border: 2px solid transparent; }

/* ---------- Dark: refined glass ---------- */
html:not(.light-theme) {
    --bg-panel: rgba(14, 18, 36, .58);
    --bg-card: rgba(14, 18, 36, .52);
    --border-glass: rgba(255, 255, 255, .09);
    --text-muted: #a3aec2;
}
html:not(.light-theme) .glass-panel,
html:not(.light-theme) .glass-card,
html:not(.light-theme) .glass-modal,
html:not(.light-theme) .glass-sidebar,
html:not(.light-theme) .glass-header,
html:not(.light-theme) .glass-main-panel {
    border-radius: var(--pl-radius);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .07) inset, 0 24px 48px -24px rgba(0, 0, 0, .75) !important;
}
html:not(.light-theme) .glass-card:hover,
html:not(.light-theme) .glass-panel:hover {
    border-color: rgba(167, 139, 250, .38) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .09) inset, 0 28px 56px -22px rgba(76, 58, 200, .45) !important;
}
html:not(.light-theme) .glass-modal {
    background: linear-gradient(180deg, rgba(24, 28, 54, .78), rgba(10, 13, 28, .84)) !important;
    border-color: rgba(167, 139, 250, .22) !important;
}
/* Quieter background so content leads */
html:not(.light-theme) .bg-blob-rose, html:not(.light-theme) .bg-blob-teal { opacity: .55; }

/* ---------- Light: bright & friendly ---------- */
.light-theme {
    --pl-accent: #6d5efc;
    --pl-accent-2: #ec4899;
    --pl-ring: 0 0 0 3px rgba(109, 94, 252, .25);
    --pl-radius: 24px;
    --text-main: #1e1b4b;
    --text-muted: #5b5f87;
    --border-glass: rgba(109, 94, 252, .16);
}
.light-theme body,
.light-theme #login-section {
    background:
        radial-gradient(900px 600px at 8% -5%, #ffe4f1 0%, transparent 60%),
        radial-gradient(800px 600px at 100% 0%, #dbeafe 0%, transparent 55%),
        radial-gradient(900px 700px at 50% 110%, #d1fae5 0%, transparent 55%),
        #fbf9ff !important;
    background-attachment: fixed !important;
    color: var(--text-main) !important;
}
.light-theme .glass-panel,
.light-theme .glass-card,
.light-theme .glass-modal,
.light-theme .glass-header {
    background: rgba(255, 255, 255, .86) !important;
    border: 1px solid rgba(109, 94, 252, .14) !important;
    border-radius: var(--pl-radius);
    box-shadow: 0 1px 0 #fff inset, 0 14px 34px -16px rgba(109, 94, 252, .28) !important;
}
.light-theme .glass-card:hover, .light-theme .glass-panel:hover {
    border-color: rgba(236, 72, 153, .35) !important;
    box-shadow: 0 1px 0 #fff inset, 0 20px 40px -16px rgba(236, 72, 153, .28) !important;
}
.light-theme .glass-sidebar,
.light-theme .glass-main-panel {
    background: rgba(255, 255, 255, .9) !important;
    border: 1px solid rgba(109, 94, 252, .14) !important;
    border-radius: 28px !important;
    box-shadow: 0 20px 44px -20px rgba(109, 94, 252, .32) !important;
}
.light-theme .bg-indigo-600, .light-theme .bg-indigo-500 {
    background-image: linear-gradient(135deg, #6d5efc 0%, #8b5cf6 50%, #ec4899 120%) !important;
    box-shadow: 0 12px 24px -10px rgba(139, 92, 246, .6), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.light-theme input:not([type=checkbox]):not([type=radio]):not([type=range]),
.light-theme select, .light-theme textarea {
    background: #fff !important;
    border-color: rgba(109, 94, 252, .22) !important;
    border-radius: 14px;
}
.light-theme .bg-blob-indigo { background: radial-gradient(circle, rgba(109, 94, 252, .16) 0%, transparent 70%) !important; }
.light-theme .bg-blob-cyan { background: radial-gradient(circle, rgba(14, 165, 233, .14) 0%, transparent 70%) !important; }
.light-theme .bg-blob-purple { background: radial-gradient(circle, rgba(236, 72, 153, .12) 0%, transparent 70%) !important; }

/* ---------- Motion safety ---------- */
@media (prefers-reduced-motion: reduce) {
    .glass-modal { animation: none; }
    button, input, select, textarea { transition: none !important; }
}



/* ======== boost.css ======== */
/* =====================================================================
   boost.css — smoother on phones, tablets and PCs, plus a few extra animations.
   Load it AFTER feed.css (it is meant to win over the older files). Delete its <link> to switch it off.
   Everything animated here is transform / opacity only. boost.js sets perf-full / perf-mid / perf-lite on <html>.
   ===================================================================== */
:root {
    --bx-ease: cubic-bezier(.22, 1, .36, 1);
    --bx-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* ---------- 1. Layers that cost a lot and are almost invisible ---------- */
/* The film-grain overlay was a full-screen SVG noise filter at ~2% opacity with a blend mode,
   animated every 1.2 s. Nobody can see it, but the GPU re-did it constantly. */
body::after { display: none !important; animation: none !important; }
/* The aurora keeps spinning, but without mix-blend-mode (which forces a full read-back of the page
   under it every frame) and on its own GPU layer. */
body::before { mix-blend-mode: normal !important; will-change: transform; }
/* Phones and tablets (and Samsung Internet in "Desktop site" mode) never get the giant spinning aurora layer:
   a 180vmax always-animated layer is what exhausts GPU memory there. */
@media (pointer: coarse), (max-width: 1023px) {
    body::before { display: none !important; will-change: auto !important; animation: none !important; }
}

/* ---------- 2. Never animate while it can't be seen or while scrolling ---------- */
/* (removed: universal html.tab-hidden rule — hidden tabs are frozen by the browser anyway, and it forced a full restyle) */
html.is-scrolling body::before,
html.is-scrolling .bg-blob-indigo, html.is-scrolling .bg-blob-cyan, html.is-scrolling .bg-blob-purple,
html.is-scrolling .bg-blob-rose, html.is-scrolling .bg-blob-teal,
html.is-scrolling .glass-card::before, html.is-scrolling .glass-card::after,
html.is-scrolling .gentle-float, html.is-scrolling .empty-state-float,
html.is-scrolling #profile-avatar, html.is-scrolling .xp-shine, html.is-scrolling .marquee-container > * {
    animation-play-state: paused !important;
}

/* ---------- 3. Cheaper transitions (no more "transition: all") ---------- */
.glass-card, .glass-panel, .nav-btn, button, .interactive-btn {
    transition-property: transform, opacity, background-color, border-color, box-shadow, color, filter !important;
}

/* ---------- 4. Tiers ---------- */
/* MID: decorative layers stand still and there is NO backdrop blur. (This used to switch blur(10px) back on for
   every card/panel on phones. A blurred layer behind the whole scrolling page is what made Samsung Internet drop the
   content while scrolling, leaving only the background.) */
html.perf-mid .bg-blob-indigo, html.perf-mid .bg-blob-cyan, html.perf-mid .bg-blob-purple,
html.perf-mid .bg-blob-rose, html.perf-mid .bg-blob-teal { animation: none !important; will-change: auto; }
html.perf-mid body::before { animation: none !important; }
html.perf-mid #fluid-canvas { display: none !important; }
html.perf-mid .glass-card, html.perf-mid .glass-panel, html.perf-mid .glass-modal,
html.perf-mid .glass-sidebar, html.perf-mid .glass-header, html.perf-mid .glass-main-panel {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
html.perf-mid .glass-card::before, html.perf-mid .glass-card::after { animation: none !important; }

/* LITE: no background effects, no blur, short transitions. Content and layout stay exactly the same. */
html.perf-lite body::before, html.perf-lite body::after,
html.perf-lite .bg-blob-indigo, html.perf-lite .bg-blob-cyan, html.perf-lite .bg-blob-purple,
html.perf-lite .bg-blob-rose, html.perf-lite .bg-blob-teal,
html.perf-lite #fluid-canvas, html.perf-lite #cursor-particles { display: none !important; }
html.perf-lite *, html.perf-lite *::before, html.perf-lite *::after {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
html.perf-lite .glass-card, html.perf-lite .glass-panel, html.perf-lite .glass-modal,
html.perf-lite .glass-sidebar, html.perf-lite .glass-header, html.perf-lite .glass-main-panel {
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset !important;
}
html.perf-lite .glass-card::before, html.perf-lite .glass-card::after,
html.perf-lite .gentle-float, html.perf-lite .empty-state-float, html.perf-lite .xp-shine { animation: none !important; }
html.perf-lite .m-enter > * { animation-duration: .2s !important; }

/* ---------- 5. Skip work for what is off screen (desktop too) ---------- */
/* Mouse devices only: on touch browsers (Samsung Internet) skipped rows can flash blank while flinging. */
@media (pointer: fine) {
    @supports (content-visibility: auto) {
        #tutoring-list > div, #bookmarks-list-container > div, #vidpriv-codes-list > div,
        #admin-lectures-list > div, #dashboard-leaderboard-grid > div {
            content-visibility: auto; contain-intrinsic-size: auto 80px;
        }
    }
}

/* ---------- 6. Smooth scrolling for mouse + trackpad (phones keep native momentum) ---------- */
@media (pointer: fine) {
    html { scroll-behavior: smooth; }
    #workspace-view-scroll { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) { html, #workspace-view-scroll { scroll-behavior: auto; } }

/* ---------- 7. Extra animations (all one-shot or hover-only; transform + opacity) ---------- */
@keyframes bxFadeUp { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@keyframes bxPopIn  { from { opacity: 0; transform: scale(.94) translate3d(0, 10px, 0); } to { opacity: 1; transform: none; } }
@keyframes bxToast  { from { opacity: 0; transform: translate3d(28px, 0, 0) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes bxGlow   { 0%, 100% { box-shadow: 0 0 0 0 rgba(124, 108, 255, .0); } 50% { box-shadow: 0 0 0 6px rgba(124, 108, 255, .18); } }
@keyframes bxLock   { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 60% { transform: rotate(9deg); } }

@media (prefers-reduced-motion: no-preference) {
    /* The login card and the portal fade up when the page first appears */
    #login-section > *, #portal-section { animation: bxFadeUp .6s var(--bx-ease) both; }
    #login-section > *:nth-child(2) { animation-delay: .08s; }
    #login-section > *:nth-child(3) { animation-delay: .16s; }

    /* Dialogs spring open on desktop (phones already get a bottom-sheet slide) */
    @media (min-width: 768px) {
        .modal-root:not(.hidden) > div { animation: bxPopIn .34s var(--bx-spring) both; }
        #toast-container > * { animation: bxToast .4s var(--bx-spring) both; }
    }

    /* Mouse-only hover touches */
    @media (hover: hover) and (pointer: fine) {
        #video-sessions-list > div { transition: transform .25s var(--bx-ease), border-color .25s ease, background-color .25s ease; }
        #video-sessions-list > div:hover { transform: translate3d(4px, 0, 0); }
        #video-sessions-list > div:hover .fa-lock, #video-sessions-list > div:hover [data-lucide="lock"] { animation: bxLock .6s ease; }
        #materials-grid > div, #feed-stream > div, #tutoring-list > div { transition: transform .3s var(--bx-ease), box-shadow .3s ease; }
        #materials-grid > div:hover, #tutoring-list > div:hover { transform: translate3d(0, -4px, 0); }
        .nav-btn:not(.bg-indigo-600\/15):hover { transform: translate3d(3px, 0, 0); }
    }

    /* Inputs ring softly when focused */
    input:focus-visible, textarea:focus-visible, select:focus-visible { animation: bxGlow 1.6s ease-in-out 1; }

    /* Notification bell badge pops */
    .ntf-badge.ntf-on { animation: bxPopIn .35s var(--bx-spring) both; }
}

/* ---------- 8. Reduced motion: keep everything visible and still ---------- */
@media (prefers-reduced-motion: reduce) {
    #login-section > *, #portal-section, .modal-root > div, #toast-container > * { animation: none !important; }
}

/* ---------- 9. At-risk students card (js/at-risk.js) ---------- */
.ar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ar-select { width: auto; margin: 0; min-width: 140px; }
.ar-high-txt { color: var(--sp-bad, #fb7185); font-weight: 800; }
.ar-item { align-items: flex-start; flex-wrap: wrap; }
.ar-name small { color: var(--sp-muted, #a3aec2); font-weight: 600; margin-left: 6px; }
.ar-tag.ar-high { background: rgba(251, 113, 133, .16); color: #fda4af; }
.ar-tag.ar-medium { background: rgba(251, 191, 36, .14); color: #fcd34d; }
.ar-reasons { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.ar-chip { font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: rgba(124, 108, 255, .14); color: #c4b5fd; }
.ar-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ar-sent { font-size: 11px; font-weight: 800; color: var(--sp-good, #34d399); }
.ar-item.ar-done { opacity: .6; }
.light-theme .ar-tag.ar-high { color: #be123c; }
.light-theme .ar-tag.ar-medium { color: #b45309; }
.light-theme .ar-chip { color: #6d5efc; background: rgba(109, 94, 252, .1); }
@media (max-width: 767px) { .ar-actions { width: 100%; margin-left: 0; } .ar-actions .sp-btn { flex: 1; min-height: 44px; } }
/* ---------- 10. Desktop: card borders only spin under the cursor ---------- */
/* Every card had its own conic border animating a CSS variable (--lg-angle) forever. That repaints on the main thread,
   every frame, for every card on screen. Now it is still for all cards and comes alive on the one you hover. */
@media (hover: hover) and (pointer: fine) {
    html.light-theme .glass-card::before, html.dark-theme .glass-card::before { animation: none !important; }
    html.light-theme .glass-card:hover::before, html.dark-theme .glass-card:hover::before {  }
}


/* ======== ultra.css ======== */
/* =====================================================================
   ultra.css v3 — LAYOUT ONLY. (The old glow/blur/animation layer was removed: fx.css, flow.css, glass.css and smooth.css
   already provide all of that, and stacking a second copy made phones stutter and fought their transforms.)
   What stays: the phone layout that stops the page from being wider than the screen, the admin console as bento
   tiles on phones, and a couple of desktop bento spans. Delete this <link> + ultra.js to remove.
   ===================================================================== */

/* ---- never let the page itself scroll sideways.
   IMPORTANT: use "clip", not "hidden". "hidden" on both <html> and <body> turns <body> into its own scroller and
   breaks position:sticky (the tab bar scrolled away with the page). "clip" just cuts the overflow and keeps the page normal. */
@media (max-width: 1023px) {
    html, body { overflow-x: clip; max-width: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
    #portal-section, #portal-section > main, #workspace-view-scroll, .view-panel { max-width: 100%; }
    img, video, canvas, iframe, svg:not(.lucide) { max-width: 100%; }
}

/* ---- desktop bento extras */
@media (min-width: 1024px) {
    #view-admin > .grid:first-child > :first-child { grid-column: span 2; }
    #view-admin > .grid ~ .grid { grid-auto-flow: dense; }
}

/* =====================================================================
   PHONES
   ===================================================================== */
/* A grid/flex child's min-width:auto lets wide content (button rows, SQL text, long IDs) stretch its column past the screen.
   Below: every track and item is allowed to shrink. Only real phones (<640px), so sm:/md: layouts are untouched. */
@media (max-width: 639px) {
    .grid:not([class*="grid-cols-["]):not([class*="grid-cols-2"]):not([class*="grid-cols-3"]):not([class*="grid-cols-4"]):not([class*="grid-cols-5"]):not([class*="grid-cols-7"]) { grid-template-columns: minmax(0, 1fr); }
    .grid.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .grid.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .grid.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .grid.grid-cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
    .grid > *, .flex > *, .view-panel > * { min-width: 0; }
    .view-panel :where(h1, h2, h3, h4, p, span, label, a, li, td) { overflow-wrap: anywhere; }
    /* tiny status badges (Restricted, Admin, Boy...) stay on one line instead of breaking mid-word */
    .view-panel span[class*="text-[8px]"], .view-panel span[class*="text-[9px]"], .view-panel span[class*="font-mono"] { overflow-wrap: normal; white-space: nowrap; flex-shrink: 0; }
    .u-clamp { max-width: 100% !important; min-width: 0 !important; overflow-wrap: anywhere; }

    /* every card header (title + buttons) wraps instead of overflowing */
    .view-panel .glass-card .flex.items-center.justify-between { flex-wrap: wrap; gap: .5rem .75rem; }
    .view-panel .glass-card .flex.items-center.justify-between > h3 { flex: 1 1 100%; }
    .view-panel .glass-card .flex.items-center.justify-between > div.flex { flex-wrap: wrap; width: 100%; }
    .view-panel .glass-card .flex.items-center.justify-between > div.flex > button { flex: 1 1 calc(50% - .5rem); justify-content: center; }
    #view-admin .glass-card .flex.items-center.justify-between > button { width: 100%; justify-content: center; }

    /* admin: SQL console */
    #view-admin textarea { height: 7rem !important; }
    #view-admin .glass-card .space-y-3 > .flex.items-center.justify-between { flex-direction: column; align-items: stretch; gap: .6rem; }
    #view-admin .glass-card .space-y-3 > .flex.items-center.justify-between button { width: 100%; }
    #sql-console-output { white-space: pre-wrap; word-break: break-word; }

    /* admin: students directory */
    #admin-students-grade-filter { max-width: 42%; }
    #admin-students-grade-chips { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
    #admin-students-grade-chips::-webkit-scrollbar { display: none; }
    #admin-students-grade-chips > button { flex: 0 0 auto; min-height: 36px; }
    #admin-students-list > div { padding: .9rem !important; gap: .7rem !important; }
    #admin-students-list > div > div:last-child {
        display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem !important;
        overflow: visible !important; padding-bottom: 0 !important; width: 100%;
    }
    #admin-students-list > div > div:last-child > button {
        white-space: normal !important; text-align: center; min-height: 40px; line-height: 1.2; justify-content: center;
        border-radius: .85rem !important; padding: .5rem .4rem !important; font-size: 11.5px !important;
    }
    #admin-students-list > div > div:last-child > button:last-child { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; }
    #admin-students-list h4 { font-size: 14px !important; }
    #admin-students-list .flex.items-center.gap-1\.5 { flex-wrap: wrap; }

    /* admin: sessions inventory */
    #admin-lectures-list > div { flex-wrap: wrap; gap: .6rem; padding: .85rem !important; }
    #admin-lectures-list > div > div:first-child { flex: 1 1 100%; }
    #admin-lectures-list > div > div:last-child { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: .45rem; }
    #admin-lectures-list > div > div:last-child > button { justify-content: center; border-radius: .85rem !important; }

    /* sessions-code tab */
    #view-codes form { grid-template-columns: minmax(0, 1fr) !important; }
    #vidpriv-codes-list, #vidpriv-bulk-list { min-width: 0; }
    #vidpriv-codes-list .flex { flex-wrap: wrap; }
}


/* ======== fx.css ======== */
/* =====================================================================
   fx.css — extra animation + graphics layer (pairs with js/fx.js). Load it LAST, after smooth.css.
   Delete its <link> and the fx.js <script> to switch everything off.
   Rules that keep it smooth: only transform / opacity are animated, no blur, no filters, no layout reads on scroll,
   and every effect is gated by the device tier (html.perf-full / perf-mid / perf-lite from boost.js) and by reduced-motion.
   ===================================================================== */
:root { --fx-ease: cubic-bezier(.22, 1, .36, 1); --fx-spring: cubic-bezier(.34, 1.56, .64, 1); }
.fx-o1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -14vmax; }
.fx-o1 i { background: radial-gradient(circle, rgba(99, 102, 241, .20), transparent 68%); --d: 28s; }
.fx-o2 { width: 40vmax; height: 40vmax; right: -10vmax; bottom: -12vmax; }
.fx-o2 i { background: radial-gradient(circle, rgba(6, 182, 212, .15), transparent 68%); --d: 32s; animation-delay: -9s; }
.fx-o3 { width: 30vmax; height: 30vmax; left: 38%; top: 30%; }
.fx-o3 i { background: radial-gradient(circle, rgba(236, 72, 153, .11), transparent 68%); --d: 36s; animation-delay: -15s; }
@keyframes fxFloat { from { transform: translate3d(-3%, -2%, 0) scale(1); } to { transform: translate3d(4%, 5%, 0) scale(1.12); } }
@keyframes fxTwinkle { 0%, 100% { opacity: 0; transform: scale(.6); } 50% { opacity: .85; transform: scale(1.3); } }
.fx-shoot { position: absolute; width: 120px; height: 2px; opacity: 0; border-radius: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(199, 210, 254, .95)); transform: rotate(28deg) translate3d(-200px, 0, 0); }
.fx-shoot.go { animation: fxShoot 1.1s ease-out forwards; }
@keyframes fxShoot { 0% { opacity: 0; transform: rotate(28deg) translate3d(-60px, 0, 0); } 15% { opacity: 1; } 100% { opacity: 0; transform: rotate(28deg) translate3d(520px, 0, 0); } }
.light-theme .fx-o1 i { background: radial-gradient(circle, rgba(109, 94, 252, .16), transparent 68%); }
.light-theme .fx-o2 i { background: radial-gradient(circle, rgba(14, 165, 233, .13), transparent 68%); }
.light-theme .fx-o3 i { background: radial-gradient(circle, rgba(236, 72, 153, .10), transparent 68%); }

/* ---------- 2. Cursor spotlight on cards (one card at a time, no movement of the card) ---------- */
.fx-spot { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 1; opacity: 0;
    background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(129, 140, 248, .16), transparent 70%);
    transition: opacity .25s ease; }
.fx-spot.on { opacity: 1; }
.light-theme .fx-spot { background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), rgba(109, 94, 252, .14), transparent 70%); }

/* ---------- 3. Click ripple (pointer, any button) ---------- */
.fx-rip-host { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; z-index: 0; }
.fx-rip { position: absolute; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: rgba(255, 255, 255, .38); opacity: .8; will-change: transform, opacity; }
.light-theme .fx-rip { background: rgba(109, 94, 252, .28); }

/* ---------- 4. Hearts + confetti (spawned by fx.js, removed when finished) ---------- */
.fx-heart { position: fixed; z-index: 100002; pointer-events: none; font-size: 18px; line-height: 1; will-change: transform, opacity; }
.fx-bit { position: fixed; left: 0; top: 0; z-index: 100002; pointer-events: none; width: 8px; height: 12px; border-radius: 2px; will-change: transform, opacity; }
@media (min-width: 1024px) { }

/* ---------- 6. Micro-motion (all transform / opacity) ---------- */
@media (prefers-reduced-motion: no-preference) {
    /* icons wiggle / nudge when you hover their button */
    @media (hover: hover) and (pointer: fine) {
    }
}
@keyframes fxNudge { 0% { transform: translate3d(0, 0, 0); } 40% { transform: translate3d(0, -3px, 0) scale(1.12); } 100% { transform: none; } }
@keyframes fxPop { 0% { transform: scale(.7); } 60% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes fxRing { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(14deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-5deg); } }
@keyframes fxRing2 { 0% { outline-offset: 6px; outline-color: rgba(165, 180, 252, 0); } 100% { outline-offset: 2px; outline-color: #a5b4fc; } }
@keyframes fxHead { from { opacity: 0; transform: translate3d(-14px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes fxRise { from { opacity: 0; transform: translate3d(0, 12px, 0); } to { opacity: 1; transform: none; } }
@keyframes fxGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ---------- 7. Weak devices / reduced motion: switch the extras off ---------- */
html.perf-lite .fx-orb, html.perf-lite .fx-star, html.perf-lite .fx-shoot, html.perf-lite .fx-spot { display: none !important; }
@media (prefers-reduced-motion: reduce) {
    #fx-bg, .fx-spot, .fx-rip-host, .fx-heart, .fx-bit { display: none !important; }
}
@media (max-width: 1023px), (pointer: coarse) { #fx-bg, .fx-spot { display: none !important; } }


/* ======== look.css ======== */
/* =====================================================================
   look.css — the visual upgrade: richer surfaces, clearer hierarchy, better tabs, buttons and fields, in dark AND light.
   Load it LAST (after fx.css). Delete its <link> to go back. Static paint only: no blur, no animated gradients, nothing new
   that costs frames. Uses ":not(#_)" to out-rank the older !important rules in main.css without editing them.
   ===================================================================== */
:root {
    --lk-a: #7c6cff; --lk-a2: #a78bfa; --lk-cy: #22d3ee; --lk-pk: #f472b6; --lk-ok: #34d399; --lk-warn: #fbbf24;
    --lk-r: 20px; --lk-ease: cubic-bezier(.22, 1, .36, 1);
}

/* ---------- 1. Page backdrop: a static mesh (painted once, never animated) ---------- */
html:not(.light-theme) body:not(#_) {
    background-color: #060912 !important;
    background-image:
        radial-gradient(1100px 640px at 8% -8%, rgba(99, 102, 241, .26), transparent 62%),
        radial-gradient(900px 560px at 100% 2%, rgba(168, 85, 247, .16), transparent 58%),
        radial-gradient(1000px 700px at 55% 118%, rgba(6, 182, 212, .13), transparent 62%) !important;
    background-repeat: no-repeat !important; background-attachment: scroll !important;
}

/* ---------- 2. Surfaces ---------- */
html:not(.light-theme) .glass-card:not(#_), html:not(.light-theme) .glass-panel:not(#_) {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, .012) 42%, rgba(255, 255, 255, 0)) !important;
    background-color: rgba(14, 19, 40, .78) !important;
    border: 1px solid rgba(255, 255, 255, .095) !important;
    border-top-color: rgba(255, 255, 255, .15) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 18px 40px -22px rgba(0, 0, 0, .85), 0 0 0 1px rgba(0, 0, 0, .25) !important;
}
html:not(.light-theme) .glass-card:not(#_):hover { border-color: rgba(167, 139, 250, .42) !important; box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 22px 46px -22px rgba(76, 58, 200, .55) !important; }
html:not(.light-theme) .glass-sidebar:not(#_), html:not(.light-theme) .glass-header:not(#_), html:not(.light-theme) .glass-main-panel:not(#_) {
    background-color: rgba(10, 14, 30, .56) !important;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 30%) !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
}
html.light-theme .glass-card:not(#_), html.light-theme .glass-panel:not(#_) {
    background-image: linear-gradient(180deg, #ffffff, #fbfaff) !important; background-color: #fff !important;
    border: 1px solid rgba(109, 94, 252, .13) !important;
    box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(30, 27, 75, .05), 0 16px 34px -20px rgba(79, 70, 229, .32) !important;
}
html.light-theme .glass-card:not(#_):hover { border-color: rgba(109, 94, 252, .4) !important; box-shadow: 0 1px 0 #fff inset, 0 20px 40px -18px rgba(79, 70, 229, .42) !important; }
html.light-theme .glass-sidebar:not(#_), html.light-theme .glass-header:not(#_), html.light-theme .glass-main-panel:not(#_) {
    background-color: rgba(255, 255, 255, .8) !important; border: 1px solid rgba(109, 94, 252, .12) !important;
}

/* ---------- 3. Navigation: the active tab is unmistakable ---------- */
.glass-sidebar .nav-btn { border-radius: 14px; font-weight: 700; letter-spacing: .005em; position: relative; }
html:not(.light-theme) .glass-sidebar .nav-btn:not(.bg-indigo-600\/15):hover { background: rgba(255, 255, 255, .06) !important; color: #fff !important; }
html:not(.light-theme) .glass-sidebar .nav-btn.bg-indigo-600\/15:not(#_) {
    background: linear-gradient(90deg, rgba(124, 108, 255, .34), rgba(139, 92, 246, .08)) !important; color: #fff !important;
    box-shadow: inset 3px 0 0 #a78bfa, 0 10px 24px -14px rgba(124, 108, 255, .9) !important;
}
html.light-theme .glass-sidebar .nav-btn.bg-indigo-600\/15:not(#_) {
    background: linear-gradient(135deg, #6d5efc, #8b5cf6 60%, #c084fc) !important; color: #fff !important;
    box-shadow: 0 12px 24px -12px rgba(109, 94, 252, .8) !important;
}
html.light-theme .glass-sidebar .nav-btn.bg-indigo-600\/15 svg, html.light-theme .glass-sidebar .nav-btn.bg-indigo-600\/15 i,
html.light-theme .glass-sidebar .nav-btn.bg-indigo-600\/15 span { color: #fff !important; stroke: #fff !important; }
html.light-theme .glass-sidebar .nav-btn:not(.bg-indigo-600\/15):hover { background: rgba(109, 94, 252, .08) !important; }

/* ---------- 4. Typography hierarchy ---------- */
#active-tab-title { font-size: 1.2rem; font-weight: 800; letter-spacing: -.015em; }
html:not(.light-theme) #active-tab-title { background: linear-gradient(90deg, #fff, #c7d2fe); -webkit-background-clip: text; background-clip: text; color: transparent; }
#welcome-message { letter-spacing: -.02em; font-weight: 800; }
h3.uppercase, h4.uppercase, .view-panel h3.text-xs { letter-spacing: .08em; }
.tabular-nums, [id^="dashboard-"][id$="percent"], [id^="dashboard-"][id$="minutes"], [id^="dashboard-"][id$="hours"] { font-variant-numeric: tabular-nums; }
.justify-between { gap: 10px; }

/* ---------- 5. Buttons, fields, chips ---------- */
html body .bg-indigo-600:not(#_), html body .bg-indigo-500:not(#_) {
    background-image: linear-gradient(135deg, #6366f1, #7c6cff 55%, #a78bfa) !important; border: 0;
    box-shadow: 0 10px 22px -10px rgba(99, 102, 241, .8), 0 1px 0 rgba(255, 255, 255, .25) inset !important;
}
html body .bg-indigo-600:not(#_):hover { box-shadow: 0 14px 28px -10px rgba(124, 108, 255, .95), 0 1px 0 rgba(255, 255, 255, .3) inset !important; }
html:not(.light-theme) input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not(#_), html:not(.light-theme) textarea:not(#_), html:not(.light-theme) select:not(#_) {
    background-color: rgba(6, 9, 22, .72) !important; border: 1px solid rgba(255, 255, 255, .1) !important; border-radius: 14px;
}
input:focus, textarea:focus, select:focus { border-color: var(--lk-a) !important; box-shadow: 0 0 0 4px rgba(124, 108, 255, .22) !important; }
html:not(.light-theme) [class*="rounded-full"][class*="bg-indigo-950"] { background: rgba(99, 102, 241, .16) !important; border-color: rgba(129, 140, 248, .3) !important; }

/* ---------- 6. Progress bars + stat blocks ---------- */
[id$="progress-bar"] > div, #dashboard-xp-progress-bar { background-image: linear-gradient(90deg, #6366f1, #a78bfa 55%, #22d3ee) !important; box-shadow: 0 0 14px rgba(124, 108, 255, .55); border-radius: 999px; }
html:not(.light-theme) [id$="progress-bar"]:not(#_) { background-color: rgba(255, 255, 255, .07); }

/* ---------- 7. Lists: rows read as separate, tappable things ---------- */
html:not(.light-theme) #feed-stream > div, html:not(.light-theme) #materials-grid > div, html:not(.light-theme) #tutoring-list > div { border-radius: var(--lk-r); }
html:not(.light-theme) .bg-slate-950\/40, html:not(.light-theme) .bg-slate-950\/30 { background-color: rgba(8, 12, 28, .55) !important; }

/* ---------- 8. Avatars + badges ---------- */
#profile-avatar, #login-logo { box-shadow: 0 0 0 2px rgba(124, 108, 255, .55), 0 10px 24px -10px rgba(124, 108, 255, .8) !important; }
[id^="badge-milestone"]:not(.grayscale) { box-shadow: 0 0 0 1px rgba(251, 191, 36, .55), 0 10px 22px -12px rgba(251, 191, 36, .8); background: linear-gradient(160deg, rgba(251, 191, 36, .16), rgba(251, 191, 36, .03)) !important; }

/* ---------- 9. Selection + scroll polish ---------- */
::selection { background: rgba(124, 108, 255, .45); color: #fff; }
.glass-main-panel, #workspace-view-scroll { scroll-padding-top: 12px; }

/* ---------- 10. Phones: bigger touch rhythm, no extra paint ---------- */
@media (max-width: 767px) {
    html:not(.light-theme) body:not(#_) { background-image: radial-gradient(700px 420px at 0% 0%, rgba(99, 102, 241, .22), transparent 62%), radial-gradient(600px 400px at 100% 100%, rgba(6, 182, 212, .12), transparent 62%) !important; }
    html body .glass-card:not(#_) { border-radius: 18px; }
    #active-tab-title { font-size: 1.05rem; }
}

/* Primary buttons keep white text in light mode (main.css turned it dark grey on the gradient) */
html.light-theme .bg-indigo-600:not(#_), html.light-theme .bg-indigo-500:not(#_),
html.light-theme .bg-indigo-600:not(#_) span, html.light-theme .bg-indigo-500:not(#_) span { color: #fff !important; }

/* Colored status pills stay readable in light mode (they were dark fills with dark text) */
html.light-theme .bg-amber-950:not(#_) { background-color: #fef3c7 !important; color: #92400e !important; border-color: #fcd34d !important; }
html.light-theme .bg-emerald-950:not(#_) { background-color: #d1fae5 !important; color: #047857 !important; border-color: #6ee7b7 !important; }
html.light-theme .bg-red-950\/40:not(#_), html.light-theme .bg-rose-950\/40:not(#_) { background-color: #ffe4e6 !important; color: #be123c !important; }


/* ======== flow.css ======== */
/* =====================================================================
   flow.css — motion + depth layer (pairs with js/flow.js). Load it LAST, after look.css.
   Delete its <link> and the flow.js <script> to switch everything off.

   1. Page transitions        4. Gradient mesh background     7. Animated counters (flow.js only)
   2. Micro-interactions      5. Frosted glass                8. Theme sweep
   3. Skeleton loaders        6. Spring sheets / menus

   Rules that keep it smooth on phones, iPads and PCs:
   - only transform / opacity / the individual `translate` + `scale` properties animate (compositor only)
   - hover effects exist ONLY for mouse devices; touch devices get tap feedback instead
   - backdrop blur is used only on SMALL floating things (nav pills, menus, toasts, dialog cards), never on the big page shells,
     and flow.js leaves it off on Samsung Internet (the browser that blanked the page while scrolling) and on weak devices
   - everything honours prefers-reduced-motion
   ===================================================================== */
:root {
    --flow-ease: cubic-bezier(.22, 1, .36, 1);
    /* flow.js replaces these with real spring curves (CSS linear()) when the browser supports them */
    --flow-spring: cubic-bezier(.34, 1.4, .64, 1);
    --flow-spring-ms: 520ms;
    --flow-spring-soft: cubic-bezier(.22, 1.15, .36, 1);
    --flow-surface: rgba(12, 16, 34, .62);
    --flow-edge: rgba(255, 255, 255, .12);
}
html.light-theme { --flow-surface: rgba(255, 255, 255, .72); --flow-edge: rgba(109, 94, 252, .18); }

/* =====================================================================
   1. PAGE TRANSITIONS — the old tab eases out in the direction you are going, the new one slides in (flow.js)
   ===================================================================== */
html body .view-panel.view-fade-out:not(#_) {
    transform: translate3d(var(--flow-out-x, 0px), 0, 0) scale(.985) !important;
    filter: blur(5px);
    transition: opacity .18s ease, transform .18s ease, filter .18s ease !important;
}
@media (prefers-reduced-motion: reduce) { html body .view-panel.view-fade-out:not(#_) { filter: none; } }

/* ---------- 1b. Sliding nav pill — the active-tab highlight glides instead of snapping (flow.js moves it) ---------- */
.glass-sidebar nav .nav-btn { position: relative; z-index: 1; }   /* sit above the pill, whatever DOM order it was inserted in */
#nav-pill {
    position: absolute; top: 0; left: 0; z-index: 0; opacity: 0; pointer-events: none;
    border-radius: 14px; will-change: transform, width, height, opacity;
    background: linear-gradient(90deg, rgba(124, 108, 255, .22), rgba(139, 92, 246, .06));
    box-shadow: inset 3px 0 0 #a78bfa, 0 10px 26px -14px rgba(124, 108, 255, .85), 0 0 0 1px rgba(167, 139, 250, .18) inset;
    transition-property: transform, width, height, opacity;
    transition-duration: .42s;
    transition-timing-function: var(--flow-spring, cubic-bezier(.22, 1, .36, 1));
}
html.light-theme #nav-pill {
    background: linear-gradient(135deg, rgba(109, 94, 252, .9), rgba(139, 92, 246, .78) 60%, rgba(192, 132, 252, .7));
    box-shadow: 0 12px 24px -12px rgba(109, 94, 252, .7);
}
/* Phones: the nav scrolls horizontally, so the pill must not add scroll-jank of its own */
@media (max-width: 767px) { #nav-pill { transition-duration: .32s; } }
@media (prefers-reduced-motion: reduce) { #nav-pill { display: none; } }
html.perf-lite #nav-pill { display: none; }

/* A slow light sweep drifts across the pill on strong devices only — one small, cheap, transform-only
   layer, not a page-wide effect, so it is safe to leave looping. */
html.perf-full #nav-pill { overflow: hidden; }
html.perf-full #nav-pill::after {
    content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
    background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%);
    transform: translateX(-120%);
    
}
@keyframes navPillSweep { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }
html.light-theme.perf-full #nav-pill::after { background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .45) 50%, transparent 70%); }

/* ---------- 1c. Header title refresh (flow.js plays a WAAPI glow+slide on #active-tab-title) ---------- */
#active-tab-title { display: inline-block; }

/* =====================================================================
   2. MICRO-INTERACTIONS
   Uses the separate `translate` / `scale` properties so it never fights the transforms other files set.
   ===================================================================== */
html.flow-on body .glass-card, html.flow-on body .fx-card, html.flow-on body #dashboard-leaderboard-grid > div {
    transition-property: translate, scale, transform, box-shadow, border-color, background-color !important;
    transition-duration: .35s, .35s, .25s, .35s, .2s, .2s !important;
    transition-timing-function: var(--flow-ease) !important;
}

/* Mouse + trackpad: cards lift and their shadow opens up; buttons grow a touch */
@media (hover: hover) and (pointer: fine) {
    /* (session cards, worksheets and tutoring rows already lift via sessions.css / boost.css, so they are not repeated here) */
    html.flow-on body .glass-card:not(#_):hover, html.flow-on body .fx-card:not(#_):hover, html.flow-on body #dashboard-leaderboard-grid > div:not(#_):hover {
        translate: 0 -4px;
        box-shadow: 0 1px 0 rgba(255, 255, 255, .09) inset, 0 30px 56px -24px rgba(76, 58, 200, .55), 0 10px 22px -12px rgba(0, 0, 0, .5) !important;
    }
    html.light-theme.flow-on body .glass-card:not(#_):hover, html.light-theme.flow-on body .fx-card:not(#_):hover {
        box-shadow: 0 1px 0 #fff inset, 0 28px 50px -22px rgba(79, 70, 229, .4), 0 8px 18px -10px rgba(30, 27, 75, .18) !important;
    }
    html.flow-on body button:not(:disabled):not(.nav-btn):not(.vc-btn):not(.sv-act):not(.sv-hit):not(#fx-top):hover,
    html.flow-on body .interactive-btn:not(:disabled):hover {
        scale: 1.035;
    }
}
/* Every device: a satisfying squash on press, and a springy release */
html.flow-on body button:not(.vc-btn):not(.sv-hit):not(.sv-act):not(.nav-btn),
html.flow-on body .interactive-btn {
    transition-property: scale, translate, background-color, border-color, color, box-shadow, opacity, filter !important;
    transition-duration: var(--flow-spring-ms), var(--flow-spring-ms), .2s, .2s, .2s, .25s, .2s, .2s !important;
    transition-timing-function: var(--flow-spring), var(--flow-spring), ease, ease, ease, ease, ease, ease !important;
}
html.flow-on body button:not(:disabled):not(.vc-btn):not(.sv-hit):not(.sv-act):not(#fx-top):active,
html.flow-on body .interactive-btn:not(:disabled):active { scale: .965; transition-duration: .08s !important; }   /* motion.js adds its own small squash on top */
html.flow-on body .nav-btn:not(:disabled):active { scale: .97; }
@media (pointer: coarse) {
    /* finger down on a card = it dips a little, instantly (no waiting for JS) */
    html.flow-on body .glass-card[onclick]:active, html.flow-on body .vs-row:active, html.flow-on body #materials-grid > div:active { scale: .985; }
}

/* =====================================================================
   3. SKELETON LOADERS — same size as the real thing, so nothing jumps when data arrives
   ===================================================================== */
@keyframes flowPulse { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }
@media (max-width: 767px) { }
@keyframes flowDriftA { 0% { transform: translate3d(0, 0, 0) rotate(0) scale(1); } 33% { transform: translate3d(9vmax, 5vmax, 0) rotate(28deg) scale(1.12); } 66% { transform: translate3d(3vmax, 13vmax, 0) rotate(70deg) scale(.96); } 100% { transform: translate3d(14vmax, 3vmax, 0) rotate(110deg) scale(1.08); } }
@keyframes flowDriftB { 0% { transform: translate3d(0, 0, 0) rotate(0) scale(1.05); } 40% { transform: translate3d(-12vmax, 8vmax, 0) rotate(-35deg) scale(.94); } 70% { transform: translate3d(-5vmax, 15vmax, 0) rotate(-60deg) scale(1.15); } 100% { transform: translate3d(-15vmax, 4vmax, 0) rotate(-95deg) scale(1); } }
@keyframes flowDriftC { 0% { transform: translate3d(0, 0, 0) rotate(0) scale(1); } 35% { transform: translate3d(12vmax, -9vmax, 0) rotate(40deg) scale(1.1); } 70% { transform: translate3d(22vmax, -3vmax, 0) rotate(75deg) scale(.95); } 100% { transform: translate3d(6vmax, -14vmax, 0) rotate(120deg) scale(1.12); } }
@keyframes flowDriftD { 0% { transform: translate3d(0, 0, 0) rotate(0) scale(1); } 50% { transform: translate3d(-14vmax, -8vmax, 0) rotate(-50deg) scale(1.18); } 100% { transform: translate3d(-4vmax, -16vmax, 0) rotate(-100deg) scale(.92); } }
/* Phones + iPads: two layers, smaller, slower on the GPU */
@media (pointer: coarse), (max-width: 1023px) {
}
/* the pill bar that sticks to the top of a phone while you scroll */
@media (max-width: 767px) {
}

/* =====================================================================
   6. SPRING SHEETS + MENUS (flow.js drives the gestures)
   ===================================================================== */
@media (max-width: 767px) {
    /* a small grab handle on every bottom sheet */
    html body .modal-root > div:not(.absolute):not(.fixed):not(.sticky):not(#_) { position: relative; }
    html body .modal-root > div:not(#_)::before {
        content: ''; position: absolute; top: 7px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 99px;
        background: rgba(255, 255, 255, .24); pointer-events: none;
    }
    html.light-theme body .modal-root > div:not(#_)::before { background: rgba(79, 70, 229, .25); }
    /* the sheet follows the finger with no transition in the way */
    .modal-root > div.flow-dragging { transition: none !important; will-change: transform; }
}
/* the notification menu opens with a real spring */
html.flow-on body #ntf-panel:not(#_) { transition: transform var(--flow-spring-ms) var(--flow-spring), opacity .2s ease, visibility 0s linear .22s; }
html.flow-on body #ntf-panel.ntf-open:not(#_) { transition: transform var(--flow-spring-ms) var(--flow-spring), opacity .2s ease, visibility 0s; }

/* =====================================================================
   8. THEME SWEEP
   ===================================================================== */
/* Browsers with the View Transitions API: the new theme grows out of the toggle button as a circle (flow.js animates it) */
html.flow-vt::view-transition-old(root), html.flow-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
html.flow-vt::view-transition-old(root) { z-index: 1; }
html.flow-vt::view-transition-new(root) { z-index: 2; }
/* everyone else: a soft-edged panel of the new theme's colour wipes across */
#flow-sweep { position: fixed; inset: 0; z-index: 2147483000; pointer-events: none; will-change: transform; transform: translate3d(-105%, 0, 0); }
#flow-sweep::after { content: ''; position: absolute; top: 0; bottom: 0; right: -60px; width: 60px; background: linear-gradient(90deg, var(--sw, #060912), rgba(0, 0, 0, 0)); }

/* =====================================================================
   Reduced motion: nothing moves, everything is still there
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
    html.flow-on body .glass-card:hover, html.flow-on body .fx-card:hover { translate: none; }
    html.flow-on body button:hover, html.flow-on body button:active { scale: 1 !important; }
    #flow-sweep { display: none; }
}


/* ======== glass.css ======== */
/* =====================================================================
   glass.css v2 — Apple "liquid glass" + bento tiles.   LOAD IT LAST (after flow.css). Pairs with js/smooth.js.
   Delete its <link> (and the smooth.js <script>) to go back.

   THE LOOK (copied from the notification capsule: bright frosted body, a thin light rim that is brightest at the top-left,
   a soft inner glow, big rounded corners, one soft shadow):
     - tiles  = 28px radius, translucent tinted fill, specular rim (inset light), inner glow, a faint colour accent per tile
     - sub-boxes inside tiles = 20px frosted pieces
     - buttons = capsules, fields = 16px, chat bubbles = Messages-style with one tighter corner
     - the dashboard is a real bento: unequal tiles, even 14-18px gaps, each tile with its own colour accent

   WHERE REAL BLUR IS USED (and why it is not on every tile):
     backdrop blur only shows when something is BEHIND the glass. Tiles sit on a soft colour mesh, so blurring that changes nothing you
     can see, but it costs GPU time on every frame and is the main reason weak phones stutter. So blur stays only on things that float
     over content: toasts, dialogs, the notification menu (flow.css turns those on when the device can afford it).
     Everything else gets the same look from the rim light + gradients, which cost nothing.
   ===================================================================== */
:root {
    --g-ease: cubic-bezier(.22, 1, .36, 1);
    --g-spring: var(--flow-spring, cubic-bezier(.34, 1.4, .64, 1));
    --g-r-tile: 28px;       /* cards + bento tiles */
    --g-r-shell: 32px;      /* sidebar + main panel */
    --g-r-sub: 20px;        /* boxes inside a tile */

    /* dark glass */
    --g-rim-d: inset 0 1px 1px rgba(255, 255, 255, .55), inset 1px 0 1px rgba(255, 255, 255, .12), inset 0 0 0 1px rgba(255, 255, 255, .10), inset 0 -1px 1px rgba(255, 255, 255, .16);
    --g-glow-d: inset 0 0 26px rgba(255, 255, 255, .055);
    --g-drop-d: 0 20px 42px -22px rgba(2, 4, 16, .7), 0 2px 8px rgba(2, 4, 16, .22);
    /* light glass (the capsule in your screenshot) */
    --g-rim-l: inset 0 1px 1px #fff, inset 0 0 0 1px rgba(255, 255, 255, .65), inset 0 -1px 1px rgba(109, 94, 252, .16);
    --g-glow-l: inset 0 0 28px rgba(255, 255, 255, .45);
    --g-drop-l: 0 18px 38px -20px rgba(79, 70, 229, .40), 0 0 0 1px rgba(109, 94, 252, .07);
}

/* ---------------------------------------------------------------------
   0. Cheaper cards on EVERY device
   Each card used to be its own GPU layer (will-change) with a 3D context (preserve-3d). isolation keeps the stacking the glow edge
   needs without a layer per card.
   --------------------------------------------------------------------- */
html body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
    will-change: auto !important;
    transform-style: flat !important;
    isolation: isolate;
}
@media (hover: hover) and (pointer: fine) {
    html.perf-full body :is(.glass-card, .fx-card, .dash-cell):not(#_):not(#__):hover { will-change: transform !important; }   /* only the one under the cursor */
}

/* ---------------------------------------------------------------------
   1. TILES — DARK
   The first background layer is the cursor light (smooth.js sets --lx/--ly on the hovered tile; it sits off-screen when idle).
   --g-accent is a per-tile colour (see the bento section).
   --------------------------------------------------------------------- */
html:not(.light-theme) body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
    background-color: rgba(22, 28, 62, .42) !important;
    background-image:
        radial-gradient(260px circle at var(--lx, -400px) var(--ly, -400px), rgba(255, 255, 255, .17), rgba(255, 255, 255, 0) 70%),
        radial-gradient(320px 230px at 100% 0%, var(--g-accent, transparent), rgba(0, 0, 0, 0) 72%),
        radial-gradient(220px 140px at 6% 0%, rgba(255, 255, 255, .20), rgba(255, 255, 255, 0) 72%),
        linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 34%, rgba(255, 255, 255, .015) 66%, rgba(255, 255, 255, .09)) !important;
    background-repeat: no-repeat !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    border-radius: var(--g-r-tile) !important;
    box-shadow: var(--g-rim-d), var(--g-glow-d), var(--g-drop-d) !important;
}
html:not(.light-theme) body :is(.glass-card, .fx-card, .dash-cell):not(#_):not(#__):hover {
    border-color: rgba(167, 139, 250, .38) !important;
}

/* the soft colour swirl in a card edge (main.css) — gentle at rest, brighter on hover, no animation */
html body .glass-card:not(#_):not(#__)::before { opacity: .22 !important; transition: opacity .35s var(--g-ease); border-radius: inherit; }
html body .glass-card:not(#_):not(#__):hover::before { opacity: .6 !important; }

/* ---------------------------------------------------------------------
   1b. TILES — LIGHT  (frosted white, like the capsule in the screenshot)
   --------------------------------------------------------------------- */
html.light-theme body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .52) !important;
    background-image:
        radial-gradient(260px circle at var(--lx, -400px) var(--ly, -400px), rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%),
        radial-gradient(320px 230px at 100% 0%, var(--g-accent-l, transparent), rgba(255, 255, 255, 0) 72%),
        radial-gradient(240px 150px at 6% 0%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 72%),
        linear-gradient(135deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .34) 40%, rgba(232, 228, 255, .34) 70%, rgba(255, 255, 255, .7)) !important;
    background-repeat: no-repeat !important;
    border: 1px solid rgba(255, 255, 255, .78) !important;
    border-radius: var(--g-r-tile) !important;
    box-shadow: var(--g-rim-l), var(--g-glow-l), var(--g-drop-l) !important;
}
html.light-theme body :is(.glass-card, .fx-card, .dash-cell):not(#_):not(#__):hover {
    box-shadow: var(--g-rim-l), var(--g-glow-l), 0 26px 48px -22px rgba(79, 70, 229, .5), 0 0 0 1px rgba(109, 94, 252, .22) !important;
}

/* ---------------------------------------------------------------------
   2. BENTO — the dashboard grid: unequal tiles, even gaps, one colour accent each
   (the grid + spans already exist in index.html; this only styles them)
   --------------------------------------------------------------------- */
html body #view-dashboard > .grid { gap: 14px !important; }
@media (min-width: 768px) { html body #view-dashboard > .grid { gap: 18px !important; } }

#dash-cell-profile   { --g-accent: rgba(99, 102, 241, .30);  --g-accent-l: rgba(99, 102, 241, .20); }
#dash-cell-progress  { --g-accent: rgba(45, 212, 191, .22);  --g-accent-l: rgba(20, 184, 166, .18); }
#dash-cell-xp        { --g-accent: rgba(168, 85, 247, .26);  --g-accent-l: rgba(168, 85, 247, .18); }
#dash-cell-rankings  { --g-accent: rgba(251, 191, 36, .16);  --g-accent-l: rgba(251, 191, 36, .20); }
#dash-cell-analytics { --g-accent: rgba(34, 211, 238, .22);  --g-accent-l: rgba(14, 165, 233, .16); }

/* bento tiles breathe a little more */
html body .dash-cell:not(#_):not(#__) { padding: 22px !important; }
@media (max-width: 767px) { html body .dash-cell:not(#_):not(#__) { padding: 18px !important; } }

/* the same springy lift the cards have (flow.css only knew about .glass-card) */
html.flow-on body .dash-cell:not(#_):not(#__) {
    transition-property: translate, scale, box-shadow, border-color, background-color !important;
    transition-duration: .4s, .4s, .35s, .25s, .25s !important;
    transition-timing-function: var(--g-ease) !important;
}
@media (hover: hover) and (pointer: fine) {
    html.flow-on body .dash-cell:not(#_):not(#__):hover { translate: 0 -4px; }
}

/* ---------------------------------------------------------------------
   3. SHELLS: sidebar, main panel, header
   --------------------------------------------------------------------- */
html:not(.light-theme) body :is(.glass-sidebar, .glass-main-panel):not(#_):not(#__) {
    background-color: rgba(12, 16, 38, .38) !important;
    background-image:
        radial-gradient(300px 200px at 0% 0%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 65%),
        linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 20%) !important;
    border: 1px solid rgba(255, 255, 255, .09) !important;
    border-radius: var(--g-r-shell) !important;
    box-shadow: var(--g-rim-d), 0 30px 64px -30px rgba(2, 4, 16, .85) !important;
}
html.light-theme body :is(.glass-sidebar, .glass-main-panel):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .44) !important;
    background-image:
        radial-gradient(320px 210px at 0% 0%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 65%),
        linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .2) 28%) !important;
    border: 1px solid rgba(255, 255, 255, .8) !important;
    border-radius: var(--g-r-shell) !important;
    box-shadow: var(--g-rim-l), 0 30px 60px -30px rgba(79, 70, 229, .42), 0 0 0 1px rgba(109, 94, 252, .07) !important;
}
html:not(.light-theme) body .glass-header:not(#_):not(#__) { background-color: rgba(255, 255, 255, .03) !important; box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset !important; }
html.light-theme body .glass-header:not(#_):not(#__) { background-color: rgba(255, 255, 255, .4) !important; box-shadow: 0 1px 0 #fff inset !important; }

/* navigation: capsule-ish tabs */
html body .glass-sidebar .nav-btn:not(#_):not(#__) { border-radius: 18px; }

/* ---------------------------------------------------------------------
   4. SUB-BOXES inside tiles become small frosted pieces
   --------------------------------------------------------------------- */
html:not(.light-theme) body :is([class*="bg-slate-950/"], [class*="bg-slate-900/"], [class*="bg-[#0b0f19]/"], [class*="bg-[#05070c]/"]):not(button):not(input):not(select):not(textarea):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .05) !important;
    border-color: rgba(255, 255, 255, .09) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .16), inset 0 0 0 1px rgba(255, 255, 255, .03);
}
html.light-theme body :is([class*="bg-slate-950/"], [class*="bg-slate-900/"]):not(button):not(input):not(select):not(textarea):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .62) !important;
    border-color: rgba(109, 94, 252, .13) !important;
    box-shadow: inset 0 1px 1px #fff, 0 0 0 1px rgba(255, 255, 255, .4);
}
html body :is(#dash-cell-profile, #dash-cell-progress, #dash-cell-xp, #dash-cell-rankings, #dash-cell-analytics) :is([class*="bg-slate-950/"], [class*="bg-slate-900/"]):not(button):not(input):not(#_):not(#__) { border-radius: var(--g-r-sub); }

/* ---------------------------------------------------------------------
   5. FIELDS + BUTTONS
   --------------------------------------------------------------------- */
html:not(.light-theme) body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .06) !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 4px rgba(2, 4, 16, .3) inset, 0 1px 0 rgba(255, 255, 255, .08) !important;
}
html.light-theme body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .72) !important;
    border: 1px solid rgba(109, 94, 252, .18) !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 4px rgba(79, 70, 229, .10) inset, 0 1px 0 #fff !important;
}
html body :is(input, textarea, select):not(#_):not(#__):focus { box-shadow: 0 0 0 4px rgba(124, 108, 255, .24) !important; border-color: #8b7bff !important; }

/* primary buttons: glossy capsule (static highlights only) */
html body :is(.bg-indigo-600, .bg-indigo-500):not(#_):not(#__):not(.nav-btn) {
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 52%),
        linear-gradient(135deg, #6366f1, #7c6cff 55%, #a78bfa) !important;
    box-shadow: 0 1px 1px rgba(255, 255, 255, .55) inset, 0 -9px 14px -9px rgba(49, 46, 129, .55) inset, 0 12px 24px -12px rgba(99, 102, 241, .85) !important;
}
html.light-theme body :is(.bg-indigo-600, .bg-indigo-500):not(#_):not(#__):not(.nav-btn) {
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, .36), rgba(255, 255, 255, 0) 52%),
        linear-gradient(135deg, #6d5efc, #8b5cf6 58%, #c084fc) !important;
}
html body :is(button, a):is(.bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-emerald-500):not(#_):not(#__):not(.nav-btn) { border-radius: 999px !important; }
/* small bordered icon buttons: soft glass discs/pills */
html:not(.light-theme) body button[class*="border-white"]:not([class*="bg-indigo"]):not([class*="bg-emerald"]):not([class*="bg-red"]):not(.nav-btn):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .06) !important; border-color: rgba(255, 255, 255, .13) !important; border-radius: 14px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .22);
}

/* ---------------------------------------------------------------------
   6. FLOATING THINGS: dialogs, toasts, menus  (flow.css adds the blur when the device can afford it)
   --------------------------------------------------------------------- */
html:not(.light-theme) body :is(.modal-root > div, .glass-modal, #ntf-panel, #toast-container > *):not(#_):not(#__) {
    border: 1px solid rgba(255, 255, 255, .12) !important;
    box-shadow: var(--g-rim-d), var(--g-glow-d), 0 36px 72px -28px rgba(2, 4, 16, .85) !important;
}
html.light-theme body :is(.modal-root > div, .glass-modal, #ntf-panel, #toast-container > *):not(#_):not(#__) {
    border: 1px solid rgba(255, 255, 255, .85) !important;
    box-shadow: var(--g-rim-l), var(--g-glow-l), 0 34px 70px -30px rgba(79, 70, 229, .5), 0 0 0 1px rgba(109, 94, 252, .1) !important;
}
html body :is(.modal-root > div, .glass-modal):not(#_):not(#__) { border-radius: 30px !important; }
html body #ntf-panel:not(#_):not(#__) { border-radius: 24px !important; }
html body #toast-container > *:not(#_):not(#__) { border-radius: 22px !important; }
@media (max-width: 767px) { html body .modal-root > div:not(#_):not(#__) { border-radius: 30px 30px 0 0 !important; } }
/* no blur available (phones, Samsung Internet, weak devices): the dialog must be almost solid, or the page shows through the text */
html:not(.flow-blur):not(.light-theme) body :is(.modal-root > div, .glass-modal, #ntf-panel):not(#_):not(#__) { background-color: rgba(14, 19, 42, .96) !important; }
html:not(.flow-blur).light-theme body :is(.modal-root > div, .glass-modal, #ntf-panel):not(#_):not(#__) { background-color: rgba(255, 255, 255, .96) !important; }

/* ---------------------------------------------------------------------
   7. LIQUID LIGHT — strong desktop + mouse only (smooth.js moves the light; this just stops the old spotlight doubling up)
   --------------------------------------------------------------------- */
.fx-spot { display: none !important; }
@media (hover: hover) and (pointer: fine) {
    html.perf-full body :is(.bg-indigo-600, .bg-indigo-500):not(#_):not(#__):not(:disabled):hover { filter: brightness(1.07); }
}

/* ---------------------------------------------------------------------
   8. CHAT BUBBLES — Messages-style, dark + light (and the light-mode fix)
   Received message = div.justify-start > div ; your own = div.justify-end > div  (markup in renderChatMessages)
   Light-mode bug this fixes: the received bubble stayed dark slate while main.css made every <p> and small label dark grey in light
   mode → dark text on a dark bubble. It is now frosted white with dark text.
   --------------------------------------------------------------------- */
#chat-messages-list > div > div { border-radius: 22px !important; }
#chat-messages-list > .justify-start > div:not(#_):not(#__) { border-bottom-left-radius: 8px !important; }
#chat-messages-list > .justify-end > div:not(#_):not(#__) { border-bottom-right-radius: 8px !important; }

/* received — dark */
html:not(.light-theme) #chat-messages-list > .justify-start > div:not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .08) !important;
    background-image: linear-gradient(160deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .02)) !important;
    border: 1px solid rgba(255, 255, 255, .10);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .4), 0 8px 18px -12px rgba(2, 4, 16, .6);
    color: #e8ecf6;
}
/* your own — both themes: glossy indigo */
#chat-messages-list > .justify-end > div:not(#_):not(#__) {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 55%), linear-gradient(135deg, #6366f1, #7c6cff 60%, #9b7bff) !important;
    box-shadow: 0 1px 1px rgba(255, 255, 255, .55) inset, 0 10px 20px -12px rgba(99, 102, 241, .8);
    color: #fff;
}
/* received — LIGHT */
html.light-theme #chat-messages-list > .justify-start > div:not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .88) !important;
    background-image: linear-gradient(160deg, #ffffff, rgba(243, 240, 255, .92)) !important;
    border: 1px solid rgba(109, 94, 252, .16);
    box-shadow: inset 0 1px 1px #fff, 0 10px 22px -14px rgba(79, 70, 229, .45);
    color: #1e1b4b !important;
}
html.light-theme #chat-messages-list > .justify-start > div p:not(#_):not(#__) { color: #1e1b4b !important; }                       /* the message text */
html.light-theme #chat-messages-list > .justify-start > div > p.font-bold:not(#_):not(#__) { color: #4338ca !important; }           /* sender name */
html.light-theme #chat-messages-list > .justify-start > div span:not(#_):not(#__) { color: rgba(30, 27, 75, .58) !important; }       /* time + "edited" */
html.light-theme #chat-messages-list > .justify-start > div button:not(#_):not(#__) { color: #4f46e5 !important; }                  /* Translate / Hide translation */
html.light-theme #chat-messages-list > .justify-start > div i:not(#_):not(#__),
html.light-theme #chat-messages-list > .justify-start > div svg:not(#_):not(#__) { color: #4f46e5 !important; stroke: currentColor !important; }
html.light-theme #chat-messages-list > .justify-start > div a:not(#_):not(#__) { background: rgba(109, 94, 252, .10) !important; color: #4338ca !important; }
html.light-theme #chat-messages-list > .justify-start > div [class*="border-white"]:not(#_):not(#__) { border-color: rgba(109, 94, 252, .22) !important; }
html.light-theme #chat-messages-list > .justify-end > div p:not(#_):not(#__),
html.light-theme #chat-messages-list > .justify-end > div span:not(#_):not(#__),
html.light-theme #chat-messages-list > .justify-end > div button:not(#_):not(#__),
html.light-theme #chat-messages-list > .justify-end > div i:not(#_):not(#__),
html.light-theme #chat-messages-list > .justify-end > div svg:not(#_):not(#__) { color: #fff !important; }
html.light-theme #chat-messages-list { color: #1e1b4b; }

/* ---------------------------------------------------------------------
   9. SMOOTHNESS (works with js/smooth.js)
   --------------------------------------------------------------------- */
/* looping animations that are scrolled off-screen are paused by smooth.js */
.sm-off, .sm-off::before, .sm-off::after { animation-play-state: paused !important; }
/* page scrolling: no rubber-band chaining out of inner lists */
.overflow-y-auto, .overflow-auto, #chat-messages-list { overscroll-behavior: contain; }
/* text stays crisp while things move */
html body { -webkit-font-smoothing: antialiased; }

/* ---------------------------------------------------------------------
   10. PHONES + TABLETS + WEAK DEVICES
   --------------------------------------------------------------------- */
@media (max-width: 1023px), (pointer: coarse) {
    /* no backdrop blur on anything that scrolls with the page (recomputed every frame = the stutter on weak phones) */
    html body :is(.glass-sidebar, .glass-main-panel, .glass-header, .glass-card, .glass-panel, .glass-sidebar nav):not(#_):not(#__):not(#___) {
        -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    }

    /* the same look with cheaper paint: no cursor-light layer, no inner glow, smaller shadows */
    html:not(.light-theme) body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
        background-image:
            radial-gradient(260px 180px at 100% 0%, var(--g-accent, transparent), rgba(0, 0, 0, 0) 72%),
            radial-gradient(180px 110px at 6% 0%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 72%),
            linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02) 50%, rgba(255, 255, 255, .06)) !important;
        box-shadow: var(--g-rim-d), 0 8px 18px -12px rgba(2, 4, 16, .8) !important;
    }
    html.light-theme body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
        background-image:
            radial-gradient(260px 180px at 100% 0%, var(--g-accent-l, transparent), rgba(255, 255, 255, 0) 72%),
            radial-gradient(200px 120px at 6% 0%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 72%),
            linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .34) 55%, rgba(232, 228, 255, .4)) !important;
        box-shadow: var(--g-rim-l), 0 8px 18px -12px rgba(79, 70, 229, .4) !important;
    }
    html body :is(.glass-sidebar, .glass-main-panel, .glass-header):not(#_):not(#__) { box-shadow: inset 0 1px 1px rgba(255, 255, 255, .3) !important; }
    html.light-theme body :is(.glass-sidebar, .glass-main-panel, .glass-header):not(#_):not(#__) { box-shadow: inset 0 1px 1px #fff !important; }

    /* the edge swirl stays a still tint; nothing is lit by a cursor */
    html body .glass-card:not(#_):not(#__)::before { animation: none !important; transition: none; }
    #fx-bg, #cursor-particles { display: none !important; }

    /* chat: bubbles appear without the float-in animation */
    #chat-messages-list > div > div, #ai-chat-board > div { animation: none !important; }

    /* smaller radii read better on a small screen */
    :root { --g-r-tile: 24px; --g-r-shell: 26px; }
}

/* weak / measured-slow devices (boost.js decides): drop what is left */
html.perf-lite body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card, .glass-sidebar, .glass-main-panel):not(#_):not(#__) {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    background-image: linear-gradient(150deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25) !important;
}
html.light-theme.perf-lite body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
    background-image: linear-gradient(150deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .4)) !important;
    box-shadow: inset 0 1px 1px #fff, 0 0 0 1px rgba(109, 94, 252, .10) !important;
}
html.perf-lite body .glass-card:not(#_):not(#__)::before { display: none !important; }

/* ---------------------------------------------------------------------
   11. Accessibility
   --------------------------------------------------------------------- */
@media (prefers-reduced-transparency: reduce) {
    html:not(.light-theme) body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card, .glass-sidebar, .glass-main-panel, .glass-header, .glass-modal):not(#_):not(#__) { background-color: #0f1530 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
    html.light-theme body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card, .glass-sidebar, .glass-main-panel, .glass-header, .glass-modal):not(#_):not(#__) { background-color: #fff !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    html body .glass-card:not(#_):not(#__)::before { transition: none !important; }
    html body .dash-cell:not(#_):not(#__):hover { translate: none !important; }
}


/* ======== smooth.css ======== */
/* =====================================================================
   smooth.css — removes the effects that made scrolling and clicking lag.
   Load it LAST (after boost.css). Delete its <link> to switch it off.
   What it fixes, in order of how much it cost:
     1. Every card repainted itself every frame (spinning glow border + sliding sheen, both "paint" animations
        that cannot run on the GPU). Now they are still / hover-only.
     2. Every card, panel and list row had its own backdrop blur. Blur is now only on the 3 big shells + dialogs.
     3. Off-screen rows are skipped, long lists are isolated so one change does not re-lay-out the page.
   ===================================================================== */

/* ---------- 1. Paint animations on cards: the biggest cost ---------- */
/* The glowing edge used to spin forever by animating a registered custom property (--lg-angle). That forces the
   browser to repaint the conic gradient of EVERY card on EVERY frame. Fixed angle now; hover still brightens it. */
html body .glass-card:not(#_)::before,
html body .dark-theme .glass-card:not(#_)::before,
html body .light-theme .glass-card:not(#_)::before {
    animation: none !important;
    --lg-angle: 135deg;
}
html body #profile-avatar, html body #login-logo { animation: none !important; --lg-angle: 135deg; }

/* The idle "sheen" slid a 250%-wide gradient across every card forever (animating background-position = repaint).
   Browsers with scroll-driven animations already replace it; the rest get it switched off. Hover still sweeps. */
@supports not (animation-timeline: view()) {
    html body .glass-card:not(#_), html body .dark-theme .glass-card:not(#_), html body .light-theme .glass-card:not(#_) { animation: none !important; }
}

/* Other forever-loops that repaint (not compositor-only) */
html body .xp-shine, html body #dashboard-xp-progress-bar::after,
html body .text-shimmer, html body .border-shimmer, html body .premium-glow, html body .premium-glow::before {
    animation: none !important;
}
.rank-emerald, .rank-blue, .rank-amber { animation: none !important; }

/* ---------- 2. Backdrop blur: keep it where it is seen, drop it where it is repeated ---------- */
html body .glass-card:not(#_), html body .glass-panel:not(#_),
html body .dark-theme .glass-card:not(#_), html body .light-theme .glass-card:not(#_),
html body .dark-theme .glass-panel:not(#_), html body .light-theme .glass-panel:not(#_),
html body [class*="backdrop-blur"], html body .feed-card, html body .sp-card {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
/* The three big shells keep a light blur (one layer each, cheaper radius, no extra saturate pass) */
html body .glass-sidebar:not(#_), html body .glass-header:not(#_), html body .glass-main-panel:not(#_),
html body .dark-theme .glass-sidebar:not(#_), html body .dark-theme .glass-header:not(#_), html body .dark-theme .glass-main-panel:not(#_),
html body .light-theme .glass-sidebar:not(#_), html body .light-theme .glass-header:not(#_), html body .light-theme .glass-main-panel:not(#_) {
    -webkit-backdrop-filter: blur(10px) !important; backdrop-filter: blur(10px) !important;
}
/* Dialogs: only one is open at a time, so a blur is fine */
html body .glass-modal:not(#_), html body .dark-theme .glass-modal:not(#_), html body .light-theme .glass-modal:not(#_) {
    -webkit-backdrop-filter: blur(14px) !important; backdrop-filter: blur(14px) !important;
}
/* While the page scrolls, the shells do not re-blur whatever slides under them */
html.is-scrolling .glass-sidebar, html.is-scrolling .glass-header, html.is-scrolling .glass-main-panel {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
/* Phones and weak devices: no blur anywhere (mobile.css/boost.css already do most of this) */
@media (max-width: 1023px), (pointer: coarse) {
    html body * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
    html body .vc-bar, html body .vc-menu { background-color: rgba(6, 10, 22, .92) !important; }
}
html.perf-mid body *, html.perf-lite body * { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }

/* ---------- 3. Skip work for what is off screen, isolate list changes ---------- */
@supports (content-visibility: auto) {
    #feed-stream > div, #materials-grid > div, #video-sessions-list > div, #feedback-list > div,
    #admin-students-list > div, #tutoring-list > div, #bookmarks-list-container > div, #vidpriv-codes-list > div {
        content-visibility: auto; contain-intrinsic-size: auto 220px;
    }
    #feed-stream > div { contain-intrinsic-size: auto 260px; }
}
/* ---------- 4. Scrolling ---------- */
/* Decorative layers stand still while a scroll is in progress (boost.js sets .is-scrolling on mouse/trackpad devices) */
html.is-scrolling .bg-blob-indigo, html.is-scrolling .bg-blob-cyan, html.is-scrolling .bg-blob-purple,
html.is-scrolling .bg-blob-rose, html.is-scrolling .bg-blob-teal { animation-play-state: paused !important; }
/* The fluid canvas is a soft glow: let the compositor stretch it */
#fluid-canvas { image-rendering: auto; will-change: auto; }

/* ---------- 5. Hover costs ---------- */
/* Hover sheen/lift on cards re-rasterises the card; keep the lift (GPU) and drop the big shadow swap */
@media (hover: hover) and (pointer: fine) {
    html body .glass-card:not(#_):hover, html body .dark-theme .glass-card:not(#_):hover, html body .light-theme .glass-card:not(#_):hover {
        transition-duration: .25s !important;
    }
}

/* ---------- 6. Reduced motion: nothing moves ---------- */
@media (prefers-reduced-motion: reduce) {
    html body .glass-card:not(#_), html body .glass-card:not(#_)::before { animation: none !important; }
}

/* =====================================================================
   7. LOOK — calmer, cleaner, more consistent (no new effects, nothing that costs frames)
   ===================================================================== */
:root { --ui-ease: cubic-bezier(.22, 1, .36, 1); }

/* Cards: one consistent radius, a crisp hairline, soft depth instead of glow */
html body .glass-card:not(#_) { border-radius: 20px; }
html:not(.light-theme) body:not(.light-theme) .glass-card:not(#_), html:not(.light-theme) body:not(.light-theme) .glass-panel:not(#_) {
    border: 1px solid rgba(255, 255, 255, .08) !important;
    background-color: rgba(15, 20, 40, .62) !important;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 12px 28px -18px rgba(0, 0, 0, .7) !important;
}
html:not(.light-theme) body:not(.light-theme) .glass-card:not(#_):hover { border-color: rgba(129, 140, 248, .35) !important; }
html.light-theme .glass-card:not(#_), html.light-theme .glass-panel:not(#_), body.light-theme .glass-card:not(#_), body.light-theme .glass-panel:not(#_) {
    background-color: rgba(255, 255, 255, .94) !important;
    box-shadow: 0 1px 0 #fff inset, 0 10px 26px -16px rgba(79, 70, 229, .3) !important;
}

/* Tabs: the active one reads clearly */
.nav-btn { border-radius: 14px; transition: background-color .2s var(--ui-ease), color .2s var(--ui-ease), transform .2s var(--ui-ease); }
.nav-btn.bg-indigo-600\/15 { box-shadow: 0 0 0 1px rgba(129, 140, 248, .35) inset; }

/* Buttons and fields: same height rhythm, softer corners, visible focus */
button { border-radius: 12px; }
input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea { border-radius: 12px; }
:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }

/* Text: easier to read, headings tighter */
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeSpeed; }
h2, h3 { letter-spacing: -.01em; }
p, li { line-height: 1.6; }

/* Lists breathe a little more */
#feed-stream { display: flex; flex-direction: column; gap: 16px; }
#feed-stream > div { margin: 0 !important; }

/* Softer, faster page transitions */
.view-panel { animation-duration: .22s !important; }
@media (prefers-reduced-motion: reduce) { .view-panel { animation: none !important; } }

/* Thin, quiet scrollbars */
* { scrollbar-width: thin; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(129, 140, 248, .35); border-radius: 999px; }

/* =====================================================================
   ===== LIQUID GLASS + BENTO + BLUR (merged from glass.css) — this file must load AFTER flow.css =====
   ===================================================================== */
/* =====================================================================
   glass.css v2 — Apple "liquid glass" + bento tiles.   LOAD IT LAST (after flow.css). Pairs with js/smooth.js.
   Delete its <link> (and the smooth.js <script>) to go back.

   THE LOOK (copied from the notification capsule: bright frosted body, a thin light rim that is brightest at the top-left,
   a soft inner glow, big rounded corners, one soft shadow):
     - tiles  = 28px radius, translucent tinted fill, specular rim (inset light), inner glow, a faint colour accent per tile
     - sub-boxes inside tiles = 20px frosted pieces
     - buttons = capsules, fields = 16px, chat bubbles = Messages-style with one tighter corner
     - the dashboard is a real bento: unequal tiles, even 14-18px gaps, each tile with its own colour accent

   WHERE REAL BLUR IS USED (and why it is not on every tile):
     backdrop blur only shows when something is BEHIND the glass. Tiles sit on a soft colour mesh, so blurring that changes nothing you
     can see, but it costs GPU time on every frame and is the main reason weak phones stutter. So blur stays only on things that float
     over content: toasts, dialogs, the notification menu (flow.css turns those on when the device can afford it).
     Everything else gets the same look from the rim light + gradients, which cost nothing.
   ===================================================================== */
:root {
    --g-ease: cubic-bezier(.22, 1, .36, 1);
    --g-spring: var(--flow-spring, cubic-bezier(.34, 1.4, .64, 1));
    --g-r-tile: 28px;       /* cards + bento tiles */
    --g-r-shell: 32px;      /* sidebar + main panel */
    --g-r-sub: 20px;        /* boxes inside a tile */

    /* dark glass */
    --g-rim-d: inset 0 1.5px 1px rgba(255, 255, 255, .72), inset 1px 0 1px rgba(255, 255, 255, .20), inset 0 0 0 1px rgba(255, 255, 255, .12), inset -1px -1px 1px rgba(255, 255, 255, .26), inset 0 -1px 1px rgba(255, 255, 255, .16);
    --g-glow-d: inset 0 0 34px rgba(255, 255, 255, .075), inset 0 -26px 40px -30px rgba(167, 139, 250, .5);
    --g-drop-d: 0 20px 42px -22px rgba(2, 4, 16, .7), 0 2px 8px rgba(2, 4, 16, .22);
    /* light glass (the capsule in your screenshot) */
    --g-rim-l: inset 0 1.5px 1px #fff, inset 0 0 0 1px rgba(255, 255, 255, .7), inset -1px -1px 1px rgba(255, 255, 255, .9), inset 0 -1px 1px rgba(109, 94, 252, .18);
    --g-glow-l: inset 0 0 34px rgba(255, 255, 255, .6), inset 0 -26px 40px -30px rgba(139, 92, 246, .28);
    --g-drop-l: 0 18px 38px -20px rgba(79, 70, 229, .40), 0 0 0 1px rgba(109, 94, 252, .07);
}

/* ---------------------------------------------------------------------
   0. Cheaper cards on EVERY device
   Each card used to be its own GPU layer (will-change) with a 3D context (preserve-3d). isolation keeps the stacking the glow edge
   needs without a layer per card.
   --------------------------------------------------------------------- */
html body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
    will-change: auto !important;
    transform-style: flat !important;
    isolation: isolate;
}
@media (hover: hover) and (pointer: fine) {
    html.perf-full body :is(.glass-card, .fx-card, .dash-cell):not(#_):not(#__):hover { will-change: transform !important; }   /* only the one under the cursor */
}

/* ---------------------------------------------------------------------
   1. TILES — DARK
   The first background layer is the cursor light (smooth.js sets --lx/--ly on the hovered tile; it sits off-screen when idle).
   --g-accent is a per-tile colour (see the bento section).
   --------------------------------------------------------------------- */
html:not(.light-theme) body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
    background-color: rgba(22, 28, 62, .34) !important;
    background-image:
        radial-gradient(260px circle at var(--lx, -400px) var(--ly, -400px), rgba(255, 255, 255, .17), rgba(255, 255, 255, 0) 70%),
        radial-gradient(320px 230px at 100% 0%, var(--g-accent, transparent), rgba(0, 0, 0, 0) 72%),
        radial-gradient(220px 140px at 6% 0%, rgba(255, 255, 255, .20), rgba(255, 255, 255, 0) 72%),
        linear-gradient(135deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03) 34%, rgba(255, 255, 255, .015) 66%, rgba(255, 255, 255, .09)) !important;
    background-repeat: no-repeat !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    border-radius: var(--g-r-tile) !important;
    box-shadow: var(--g-rim-d), var(--g-glow-d), var(--g-drop-d) !important;
}
html:not(.light-theme) body :is(.glass-card, .fx-card, .dash-cell):not(#_):not(#__):hover {
    border-color: rgba(167, 139, 250, .38) !important;
}

/* the soft colour swirl in a card edge (main.css) — gentle at rest, brighter on hover, no animation */
html body .glass-card:not(#_):not(#__)::before { opacity: .22 !important; transition: opacity .35s var(--g-ease); border-radius: inherit; }
html body .glass-card:not(#_):not(#__):hover::before { opacity: .6 !important; }

/* ---------------------------------------------------------------------
   1b. TILES — LIGHT  (frosted white, like the capsule in the screenshot)
   --------------------------------------------------------------------- */
html.light-theme body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .44) !important;
    background-image:
        radial-gradient(260px circle at var(--lx, -400px) var(--ly, -400px), rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 70%),
        radial-gradient(320px 230px at 100% 0%, var(--g-accent-l, transparent), rgba(255, 255, 255, 0) 72%),
        radial-gradient(240px 150px at 6% 0%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 72%),
        linear-gradient(135deg, rgba(255, 255, 255, .85), rgba(255, 255, 255, .34) 40%, rgba(232, 228, 255, .34) 70%, rgba(255, 255, 255, .7)) !important;
    background-repeat: no-repeat !important;
    border: 1px solid rgba(255, 255, 255, .78) !important;
    border-radius: var(--g-r-tile) !important;
    box-shadow: var(--g-rim-l), var(--g-glow-l), var(--g-drop-l) !important;
}
html.light-theme body :is(.glass-card, .fx-card, .dash-cell):not(#_):not(#__):hover {
    box-shadow: var(--g-rim-l), var(--g-glow-l), 0 26px 48px -22px rgba(79, 70, 229, .5), 0 0 0 1px rgba(109, 94, 252, .22) !important;
}

/* ---------------------------------------------------------------------
   2. BENTO — the dashboard grid: unequal tiles, even gaps, one colour accent each
   (the grid + spans already exist in index.html; this only styles them)
   --------------------------------------------------------------------- */
html body #view-dashboard > .grid { gap: 14px !important; }
@media (min-width: 768px) { html body #view-dashboard > .grid { gap: 18px !important; } }

#dash-cell-profile   { --g-accent: rgba(99, 102, 241, .30);  --g-accent-l: rgba(99, 102, 241, .20); }
#dash-cell-progress  { --g-accent: rgba(45, 212, 191, .22);  --g-accent-l: rgba(20, 184, 166, .18); }
#dash-cell-xp        { --g-accent: rgba(168, 85, 247, .26);  --g-accent-l: rgba(168, 85, 247, .18); }
#dash-cell-rankings  { --g-accent: rgba(251, 191, 36, .16);  --g-accent-l: rgba(251, 191, 36, .20); }
#dash-cell-analytics { --g-accent: rgba(34, 211, 238, .22);  --g-accent-l: rgba(14, 165, 233, .16); }

/* bento tiles breathe a little more */
html body .dash-cell:not(#_):not(#__) { padding: 22px !important; }
@media (max-width: 767px) { html body .dash-cell:not(#_):not(#__) { padding: 18px !important; } }

/* the same springy lift the cards have (flow.css only knew about .glass-card) */
html.flow-on body .dash-cell:not(#_):not(#__) {
    transition-property: translate, scale, box-shadow, border-color, background-color !important;
    transition-duration: .4s, .4s, .35s, .25s, .25s !important;
    transition-timing-function: var(--g-ease) !important;
}
@media (hover: hover) and (pointer: fine) {
    html.flow-on body .dash-cell:not(#_):not(#__):hover { translate: 0 -4px; }
}

/* ---------------------------------------------------------------------
   3. SHELLS: sidebar, main panel, header
   --------------------------------------------------------------------- */
html:not(.light-theme) body :is(.glass-sidebar, .glass-main-panel):not(#_):not(#__) {
    background-color: rgba(12, 16, 38, .38) !important;
    background-image:
        radial-gradient(300px 200px at 0% 0%, rgba(255, 255, 255, .10), rgba(255, 255, 255, 0) 65%),
        linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, 0) 20%) !important;
    border: 1px solid rgba(255, 255, 255, .09) !important;
    border-radius: var(--g-r-shell) !important;
    box-shadow: var(--g-rim-d), 0 30px 64px -30px rgba(2, 4, 16, .85) !important;
}
html.light-theme body :is(.glass-sidebar, .glass-main-panel):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .44) !important;
    background-image:
        radial-gradient(320px 210px at 0% 0%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 65%),
        linear-gradient(180deg, rgba(255, 255, 255, .75), rgba(255, 255, 255, .2) 28%) !important;
    border: 1px solid rgba(255, 255, 255, .8) !important;
    border-radius: var(--g-r-shell) !important;
    box-shadow: var(--g-rim-l), 0 30px 60px -30px rgba(79, 70, 229, .42), 0 0 0 1px rgba(109, 94, 252, .07) !important;
}
html:not(.light-theme) body .glass-header:not(#_):not(#__) { background-color: rgba(255, 255, 255, .03) !important; box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset !important; }
html.light-theme body .glass-header:not(#_):not(#__) { background-color: rgba(255, 255, 255, .4) !important; box-shadow: 0 1px 0 #fff inset !important; }

/* navigation: capsule-ish tabs */
html body .glass-sidebar .nav-btn:not(#_):not(#__) { border-radius: 18px; }

/* ---------------------------------------------------------------------
   4. SUB-BOXES inside tiles become small frosted pieces
   --------------------------------------------------------------------- */
html:not(.light-theme) body :is([class*="bg-slate-950/"], [class*="bg-slate-900/"], [class*="bg-[#0b0f19]/"], [class*="bg-[#05070c]/"]):not(button):not(input):not(select):not(textarea):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .05) !important;
    border-color: rgba(255, 255, 255, .09) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .16), inset 0 0 0 1px rgba(255, 255, 255, .03);
}
html.light-theme body :is([class*="bg-slate-950/"], [class*="bg-slate-900/"]):not(button):not(input):not(select):not(textarea):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .62) !important;
    border-color: rgba(109, 94, 252, .13) !important;
    box-shadow: inset 0 1px 1px #fff, 0 0 0 1px rgba(255, 255, 255, .4);
}
html body :is(#dash-cell-profile, #dash-cell-progress, #dash-cell-xp, #dash-cell-rankings, #dash-cell-analytics) :is([class*="bg-slate-950/"], [class*="bg-slate-900/"]):not(button):not(input):not(#_):not(#__) { border-radius: var(--g-r-sub); }

/* ---------------------------------------------------------------------
   5. FIELDS + BUTTONS
   --------------------------------------------------------------------- */
html:not(.light-theme) body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .06) !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 4px rgba(2, 4, 16, .3) inset, 0 1px 0 rgba(255, 255, 255, .08) !important;
}
html.light-theme body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), textarea, select):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .72) !important;
    border: 1px solid rgba(109, 94, 252, .18) !important;
    border-radius: 16px !important;
    box-shadow: 0 2px 4px rgba(79, 70, 229, .10) inset, 0 1px 0 #fff !important;
}
html body :is(input, textarea, select):not(#_):not(#__):focus { box-shadow: 0 0 0 4px rgba(124, 108, 255, .24) !important; border-color: #8b7bff !important; }

/* primary buttons: glossy capsule (static highlights only) */
html body :is(.bg-indigo-600, .bg-indigo-500):not(#_):not(#__):not(.nav-btn) {
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, .32), rgba(255, 255, 255, 0) 52%),
        linear-gradient(135deg, #6366f1, #7c6cff 55%, #a78bfa) !important;
    box-shadow: 0 1px 1px rgba(255, 255, 255, .55) inset, 0 -9px 14px -9px rgba(49, 46, 129, .55) inset, 0 12px 24px -12px rgba(99, 102, 241, .85) !important;
}
html.light-theme body :is(.bg-indigo-600, .bg-indigo-500):not(#_):not(#__):not(.nav-btn) {
    background-image:
        linear-gradient(180deg, rgba(255, 255, 255, .36), rgba(255, 255, 255, 0) 52%),
        linear-gradient(135deg, #6d5efc, #8b5cf6 58%, #c084fc) !important;
}
html body :is(button, a):is(.bg-indigo-600, .bg-indigo-500, .bg-emerald-600, .bg-emerald-500):not(#_):not(#__):not(.nav-btn) { border-radius: 999px !important; }
/* small bordered icon buttons: soft glass discs/pills */
html:not(.light-theme) body button[class*="border-white"]:not([class*="bg-indigo"]):not([class*="bg-emerald"]):not([class*="bg-red"]):not(.nav-btn):not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .06) !important; border-color: rgba(255, 255, 255, .13) !important; border-radius: 14px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .22);
}

/* ---------------------------------------------------------------------
   6. FLOATING THINGS: dialogs, toasts, menus  (flow.css adds the blur when the device can afford it)
   --------------------------------------------------------------------- */
html:not(.light-theme) body :is(.modal-root > div, .glass-modal, #ntf-panel, #toast-container > *):not(#_):not(#__) {
    border: 1px solid rgba(255, 255, 255, .12) !important;
    box-shadow: var(--g-rim-d), var(--g-glow-d), 0 36px 72px -28px rgba(2, 4, 16, .85) !important;
}
html.light-theme body :is(.modal-root > div, .glass-modal, #ntf-panel, #toast-container > *):not(#_):not(#__) {
    border: 1px solid rgba(255, 255, 255, .85) !important;
    box-shadow: var(--g-rim-l), var(--g-glow-l), 0 34px 70px -30px rgba(79, 70, 229, .5), 0 0 0 1px rgba(109, 94, 252, .1) !important;
}
html body :is(.modal-root > div, .glass-modal):not(#_):not(#__) { border-radius: 30px !important; }
html body #ntf-panel:not(#_):not(#__) { border-radius: 24px !important; }
html body #toast-container > *:not(#_):not(#__) { border-radius: 22px !important; }
@media (max-width: 767px) { html body .modal-root > div:not(#_):not(#__) { border-radius: 30px 30px 0 0 !important; } }
/* no blur available (phones, Samsung Internet, weak devices): the dialog must be almost solid, or the page shows through the text */
html:not(.flow-blur):not(.light-theme) body :is(.modal-root > div, .glass-modal, #ntf-panel):not(#_):not(#__) { background-color: rgba(14, 19, 42, .96) !important; }
html:not(.flow-blur).light-theme body :is(.modal-root > div, .glass-modal, #ntf-panel):not(#_):not(#__) { background-color: rgba(255, 255, 255, .96) !important; }

/* ---------------------------------------------------------------------
   7. LIQUID LIGHT — strong desktop + mouse only (smooth.js moves the light; this just stops the old spotlight doubling up)
   --------------------------------------------------------------------- */
.fx-spot { display: none !important; }
@media (hover: hover) and (pointer: fine) {
    html.perf-full body :is(.bg-indigo-600, .bg-indigo-500):not(#_):not(#__):not(:disabled):hover { filter: brightness(1.07); }
}

/* ---------------------------------------------------------------------
   8. CHAT BUBBLES — Messages-style, dark + light (and the light-mode fix)
   Received message = div.justify-start > div ; your own = div.justify-end > div  (markup in renderChatMessages)
   Light-mode bug this fixes: the received bubble stayed dark slate while main.css made every <p> and small label dark grey in light
   mode → dark text on a dark bubble. It is now frosted white with dark text.
   --------------------------------------------------------------------- */
#chat-messages-list > div > div { border-radius: 22px !important; }
#chat-messages-list > .justify-start > div:not(#_):not(#__) { border-bottom-left-radius: 8px !important; }
#chat-messages-list > .justify-end > div:not(#_):not(#__) { border-bottom-right-radius: 8px !important; }

/* received — dark */
html:not(.light-theme) #chat-messages-list > .justify-start > div:not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .08) !important;
    background-image: linear-gradient(160deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .02)) !important;
    border: 1px solid rgba(255, 255, 255, .10);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .4), 0 8px 18px -12px rgba(2, 4, 16, .6);
    color: #e8ecf6;
}
/* your own — both themes: glossy indigo */
#chat-messages-list > .justify-end > div:not(#_):not(#__) {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .28), rgba(255, 255, 255, 0) 55%), linear-gradient(135deg, #6366f1, #7c6cff 60%, #9b7bff) !important;
    box-shadow: 0 1px 1px rgba(255, 255, 255, .55) inset, 0 10px 20px -12px rgba(99, 102, 241, .8);
    color: #fff;
}
/* received — LIGHT */
html.light-theme #chat-messages-list > .justify-start > div:not(#_):not(#__) {
    background-color: rgba(255, 255, 255, .88) !important;
    background-image: linear-gradient(160deg, #ffffff, rgba(243, 240, 255, .92)) !important;
    border: 1px solid rgba(109, 94, 252, .16);
    box-shadow: inset 0 1px 1px #fff, 0 10px 22px -14px rgba(79, 70, 229, .45);
    color: #1e1b4b !important;
}
html.light-theme #chat-messages-list > .justify-start > div p:not(#_):not(#__) { color: #1e1b4b !important; }                       /* the message text */
html.light-theme #chat-messages-list > .justify-start > div > p.font-bold:not(#_):not(#__) { color: #4338ca !important; }           /* sender name */
html.light-theme #chat-messages-list > .justify-start > div span:not(#_):not(#__) { color: rgba(30, 27, 75, .58) !important; }       /* time + "edited" */
html.light-theme #chat-messages-list > .justify-start > div button:not(#_):not(#__) { color: #4f46e5 !important; }                  /* Translate / Hide translation */
html.light-theme #chat-messages-list > .justify-start > div i:not(#_):not(#__),
html.light-theme #chat-messages-list > .justify-start > div svg:not(#_):not(#__) { color: #4f46e5 !important; stroke: currentColor !important; }
html.light-theme #chat-messages-list > .justify-start > div a:not(#_):not(#__) { background: rgba(109, 94, 252, .10) !important; color: #4338ca !important; }
html.light-theme #chat-messages-list > .justify-start > div [class*="border-white"]:not(#_):not(#__) { border-color: rgba(109, 94, 252, .22) !important; }
html.light-theme #chat-messages-list > .justify-end > div p:not(#_):not(#__),
html.light-theme #chat-messages-list > .justify-end > div span:not(#_):not(#__),
html.light-theme #chat-messages-list > .justify-end > div button:not(#_):not(#__),
html.light-theme #chat-messages-list > .justify-end > div i:not(#_):not(#__),
html.light-theme #chat-messages-list > .justify-end > div svg:not(#_):not(#__) { color: #fff !important; }
html.light-theme #chat-messages-list { color: #1e1b4b; }

/* ---------------------------------------------------------------------
   9. SMOOTHNESS (works with js/smooth.js)
   --------------------------------------------------------------------- */
/* looping animations that are scrolled off-screen are paused by smooth.js */
.sm-off, .sm-off::before, .sm-off::after { animation-play-state: paused !important; }
/* page scrolling: no rubber-band chaining out of inner lists */
.overflow-y-auto, .overflow-auto, #chat-messages-list { overscroll-behavior: contain; }
/* text stays crisp while things move */
html body { -webkit-font-smoothing: antialiased; }

/* ---------------------------------------------------------------------
   10. PHONES + TABLETS + WEAK DEVICES
   --------------------------------------------------------------------- */
@media (max-width: 1023px), (pointer: coarse) {
    /* no backdrop blur on anything that scrolls with the page (recomputed every frame = the stutter on weak phones) */
    html body :is(.glass-sidebar, .glass-main-panel, .glass-header, .glass-card, .glass-panel, .glass-sidebar nav):not(#_):not(#__):not(#___) {
        -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    }

    /* the same look with cheaper paint: no cursor-light layer, no inner glow, smaller shadows */
    html:not(.light-theme) body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
        background-image:
            radial-gradient(260px 180px at 100% 0%, var(--g-accent, transparent), rgba(0, 0, 0, 0) 72%),
            radial-gradient(180px 110px at 6% 0%, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 72%),
            linear-gradient(135deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02) 50%, rgba(255, 255, 255, .06)) !important;
        box-shadow: var(--g-rim-d), 0 8px 18px -12px rgba(2, 4, 16, .8) !important;
    }
    html.light-theme body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
        background-image:
            radial-gradient(260px 180px at 100% 0%, var(--g-accent-l, transparent), rgba(255, 255, 255, 0) 72%),
            radial-gradient(200px 120px at 6% 0%, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 72%),
            linear-gradient(135deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .34) 55%, rgba(232, 228, 255, .4)) !important;
        box-shadow: var(--g-rim-l), 0 8px 18px -12px rgba(79, 70, 229, .4) !important;
    }
    html body :is(.glass-sidebar, .glass-main-panel, .glass-header):not(#_):not(#__) { box-shadow: inset 0 1px 1px rgba(255, 255, 255, .3) !important; }
    html.light-theme body :is(.glass-sidebar, .glass-main-panel, .glass-header):not(#_):not(#__) { box-shadow: inset 0 1px 1px #fff !important; }

    /* the edge swirl stays a still tint; nothing is lit by a cursor */
    html body .glass-card:not(#_):not(#__)::before { animation: none !important; transition: none; }
    #fx-bg, #cursor-particles { display: none !important; }

    /* chat: bubbles appear without the float-in animation */
    #chat-messages-list > div > div, #ai-chat-board > div { animation: none !important; }

    /* smaller radii read better on a small screen */
    :root { --g-r-tile: 24px; --g-r-shell: 26px; }
}

/* weak / measured-slow devices (boost.js decides): drop what is left */
html.perf-lite body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card, .glass-sidebar, .glass-main-panel):not(#_):not(#__) {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    background-image: linear-gradient(150deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .25) !important;
}
html.light-theme.perf-lite body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(#_):not(#__) {
    background-image: linear-gradient(150deg, rgba(255, 255, 255, .8), rgba(255, 255, 255, .4)) !important;
    box-shadow: inset 0 1px 1px #fff, 0 0 0 1px rgba(109, 94, 252, .10) !important;
}
html.perf-lite body .glass-card:not(#_):not(#__)::before { display: none !important; }

/* ---------------------------------------------------------------------
   11. Accessibility
   --------------------------------------------------------------------- */
@media (prefers-reduced-transparency: reduce) {
    html:not(.light-theme) body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card, .glass-sidebar, .glass-main-panel, .glass-header, .glass-modal):not(#_):not(#__) { background-color: #0f1530 !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
    html.light-theme body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card, .glass-sidebar, .glass-main-panel, .glass-header, .glass-modal):not(#_):not(#__) { background-color: #fff !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
}
@media (prefers-reduced-motion: reduce) {
    html body .glass-card:not(#_):not(#__)::before { transition: none !important; }
    html body .dash-cell:not(#_):not(#__):hover { translate: none !important; }
}

/* =====================================================================
   12. MORE LIQUID GLASS (v3)
   ===================================================================== */

/* 12a. A richer colour mesh behind everything. Glass only reads as glass when there is colour behind it. Painted once, never animated. */
html:not(.light-theme) body:not(#_):not(#__) {
    background-color: #050816 !important;
    background-image:
        radial-gradient(900px 600px at 6% -6%, rgba(99, 102, 241, .42), rgba(0, 0, 0, 0) 62%),
        radial-gradient(800px 560px at 102% 4%, rgba(236, 72, 153, .24), rgba(0, 0, 0, 0) 60%),
        radial-gradient(900px 640px at 60% 112%, rgba(6, 182, 212, .27), rgba(0, 0, 0, 0) 62%),
        radial-gradient(700px 520px at -8% 78%, rgba(139, 92, 246, .28), rgba(0, 0, 0, 0) 62%) !important;
    background-repeat: no-repeat !important; background-attachment: scroll !important;
}
html.light-theme body:not(#_):not(#__) {
    background-color: #f7f5ff !important;
    background-image:
        radial-gradient(900px 600px at 6% -6%, rgba(129, 140, 248, .46), rgba(255, 255, 255, 0) 62%),
        radial-gradient(800px 560px at 102% 4%, rgba(244, 114, 182, .34), rgba(255, 255, 255, 0) 60%),
        radial-gradient(900px 640px at 60% 112%, rgba(45, 212, 191, .32), rgba(255, 255, 255, 0) 62%),
        radial-gradient(700px 520px at -8% 78%, rgba(192, 132, 252, .34), rgba(255, 255, 255, 0) 62%) !important;
    background-repeat: no-repeat !important; background-attachment: scroll !important;
}
@media (max-width: 767px) {
    html:not(.light-theme) body:not(#_):not(#__) {
        background-image:
            radial-gradient(620px 420px at 0% 0%, rgba(99, 102, 241, .40), rgba(0, 0, 0, 0) 64%),
            radial-gradient(520px 380px at 100% 40%, rgba(236, 72, 153, .20), rgba(0, 0, 0, 0) 64%),
            radial-gradient(620px 440px at 30% 100%, rgba(6, 182, 212, .24), rgba(0, 0, 0, 0) 64%) !important;
    }
    html.light-theme body:not(#_):not(#__) {
        background-image:
            radial-gradient(620px 420px at 0% 0%, rgba(129, 140, 248, .44), rgba(255, 255, 255, 0) 64%),
            radial-gradient(520px 380px at 100% 40%, rgba(244, 114, 182, .30), rgba(255, 255, 255, 0) 64%),
            radial-gradient(620px 440px at 30% 100%, rgba(45, 212, 191, .28), rgba(255, 255, 255, 0) 64%) !important;
    }
}

/* 12b. REAL blur on the big shells (sidebar + main panel), strong desktops only. One layer each. Tiles inside them are NOT blurred again:
        a blur inside a blurred parent can only see that parent, so it would cost GPU time and show nothing.
        "blur-max" (the blur button in the header) forces this on any desktop that is not in "off"; boost.js drops it by itself if the frame rate dips. */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
    html:is(.perf-full, .blur-max):not(.blur-off):not(.flow-samsung) body :is(.glass-sidebar, .glass-main-panel):not(#_):not(#__):not(#___):not(#____) {
        -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
        backdrop-filter: blur(24px) saturate(180%) !important;
    }
    /* the colour swirl in the card edge turns while you hover that one card (repaints only that card) */
    html:is(.perf-full, .blur-max):not(.blur-off) body .glass-card:not(#_):not(#__):not(#___):hover::before {  }
}

/* 12c. Navigation: the active tab is a glowing glass capsule */
html body .glass-sidebar .nav-btn.bg-indigo-600\/15:not(#_):not(#__):not(#___) {
    background-color: rgba(124, 108, 255, .22) !important;
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .30), rgba(255, 255, 255, 0) 55%), linear-gradient(135deg, rgba(124, 108, 255, .55), rgba(167, 139, 250, .20)) !important;
    border-radius: 18px !important;
    box-shadow: inset 0 1.5px 1px rgba(255, 255, 255, .6), inset 0 0 0 1px rgba(255, 255, 255, .16), 0 10px 22px -12px rgba(124, 108, 255, .9) !important;
    color: #fff !important;
}
html.light-theme body .glass-sidebar .nav-btn.bg-indigo-600\/15:not(#_):not(#__):not(#___) {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .4), rgba(255, 255, 255, 0) 55%), linear-gradient(135deg, #6d5efc, #8b5cf6 60%, #c084fc) !important;
}
@media (max-width: 767px) {
    html body .glass-sidebar nav .nav-btn:not(#_):not(#__) { border-radius: 999px !important; }
    html body .glass-sidebar nav .nav-btn.bg-indigo-600\/15:not(#_):not(#__):not(#___) { border-radius: 999px !important; }
}

/* 12d. Progress bars + chips + stat pills */
html body :is([id$="progress-bar"] > div, #dashboard-xp-progress-bar):not(#_):not(#__) {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 60%), linear-gradient(90deg, #6366f1, #a78bfa 55%, #22d3ee) !important;
    box-shadow: 0 0 16px rgba(124, 108, 255, .6), inset 0 1px 1px rgba(255, 255, 255, .6);
}
html:not(.light-theme) body [class*="rounded-full"][class*="border"][class*="bg-"]:not(button):not(input):not(#_):not(#__) {
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .35);
}
html.light-theme body [class*="rounded-full"][class*="border"][class*="bg-"]:not(button):not(input):not(#_):not(#__) {
    box-shadow: inset 0 1px 1px #fff;
}
html body #theme-icon, html body #profile-avatar { box-shadow: 0 0 0 2px rgba(255, 255, 255, .35), 0 10px 24px -10px rgba(124, 108, 255, .85) !important; }

/* 12e. THE TAB TITLE ON PHONES (dark mode) WAS INVISIBLE.
   main.css turns #active-tab-title into a dark pill on phones with "background: #111827 !important", which wipes out the gradient that
   look.css clips into the letters — but look.css still sets the text colour to transparent. Result: transparent text on a dark pill.
   Fix: a real text colour, and the pill becomes a glass capsule. */
html body #active-tab-title:not(#_):not(#__) { color: #f4f6ff !important; -webkit-text-fill-color: #f4f6ff !important; text-shadow: 0 1px 8px rgba(2, 4, 16, .45); }
html.light-theme body #active-tab-title:not(#_):not(#__) { color: #1e1b4b !important; -webkit-text-fill-color: #1e1b4b !important; text-shadow: none; }
@media (max-width: 767px) {
    html:not(.light-theme) body #active-tab-title:not(#_):not(#__) {
        background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .06)) !important;
        border: 1px solid rgba(255, 255, 255, .22) !important;
        box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5), 0 6px 16px -8px rgba(2, 4, 16, .7) !important;
        -webkit-background-clip: border-box !important; background-clip: border-box !important;
        font-size: 12px !important;
    }
    html.light-theme body #active-tab-title:not(#_):not(#__) {
        background: linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .7)) !important;
        border: 1px solid rgba(109, 94, 252, .2) !important;
        box-shadow: inset 0 1px 1px #fff, 0 6px 16px -8px rgba(79, 70, 229, .35) !important;
    }
    html body .glass-header:not(#_):not(#__) { border-radius: 24px !important; }
}

/* =====================================================================
   13. BLUR EVERYWHERE — blur-in entrances, blurred dialogs, blur-focus, blur reveal on scroll (v4)
   Tiers:  FULL  = html.perf-full or html.blur-max (the blur button in the header)   -> everything below
           MID   = phones / most laptops (html.perf-mid)                             -> short, small one-shot blur-ins only
           LITE / html.blur-off / reduced motion                                     -> none of it
   Every animation ends on a normal un-filtered element (fill-mode "backwards"), because a leftover "filter: blur(0)" would switch off
   the backdrop blur of everything inside it.
   ===================================================================== */
@keyframes gBlurIn   { from { opacity: 0; filter: blur(18px); transform: translate3d(0, 18px, 0) scale(.985); } to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes gBlurSoft { from { opacity: 0; filter: blur(8px);  transform: translate3d(0, 12px, 0); }            to { opacity: 1; filter: blur(0); transform: none; } }
@keyframes gBlurPop  { from { opacity: 0; filter: blur(16px); }                                                 to { opacity: 1; filter: blur(0); } }
@keyframes gBlurScroll { from { opacity: 0; filter: blur(14px); transform: translate3d(0, 26px, 0) scale(.98); } to { opacity: 1; filter: blur(0); transform: none; } }

@media (prefers-reduced-motion: no-preference) {

    /* 13a. A tab opens: its blocks fade up out of a blur, one after another (motion.js adds .m-enter; the delays come from motion.css) */
    html:is(.perf-full, .blur-max):not(.blur-off) body .m-enter > *:nth-child(-n+8) {
        animation-name: gBlurIn; animation-duration: .75s; animation-timing-function: var(--g-ease); animation-fill-mode: backwards;
    }
    html.perf-mid:not(.blur-max):not(.blur-off):not(.flow-samsung) body .m-enter > *:nth-child(-n+4) {
        animation-name: gBlurSoft; animation-duration: .5s; animation-timing-function: var(--g-ease); animation-fill-mode: backwards;
    }

    /* 13b. Page load: the login card and the portal come out of a blur */
    html:is(.perf-full, .blur-max):not(.blur-off) #login-section > * { animation-name: gBlurSoft; animation-duration: .8s; animation-fill-mode: backwards; }
    html:is(.perf-full, .blur-max):not(.blur-off) #portal-section { animation-name: gBlurPop; animation-duration: .7s; animation-fill-mode: backwards; }
    html.perf-mid:not(.blur-max):not(.blur-off):not(.flow-samsung) #login-section > * { animation-name: gBlurSoft; animation-duration: .6s; animation-fill-mode: backwards; }

    /* 13c. Dialogs: the card resolves out of a blur */
    @media (min-width: 768px) {
        html:is(.perf-full, .blur-max):not(.blur-off) body .modal-root:not(.hidden) > div:not(#_) {
            animation: bxPopIn .34s var(--bx-spring, cubic-bezier(.34, 1.56, .64, 1)) backwards, gBlurPop .55s var(--g-ease) backwards;
        }
    }
    @media (max-width: 767px) {
        html.perf-mid:not(.blur-off):not(.flow-samsung) body .modal-root:not(.hidden) > div:not(#_) {
            animation: mSheet .38s var(--m-ease, cubic-bezier(.22, 1, .36, 1)) both, gBlurPop .45s var(--g-ease) backwards !important;
        }
    }

    /* 13d. Chat: new bubbles resolve out of a blur (desktop) */
    html:is(.perf-full, .blur-max):not(.blur-off) body #chat-messages-list > div > div:not(#_):not(#__) { animation: gBlurSoft .45s var(--g-ease) backwards; }
}

/* 13e. The dimmed page behind a dialog is blurred (strong desktops) */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
    html:is(.perf-full, .blur-max):not(.blur-off):not(.flow-samsung) body .modal-root:not(.hidden):not(#_):not(#__):not(#___) {
        -webkit-backdrop-filter: blur(14px) saturate(125%) !important; backdrop-filter: blur(14px) saturate(125%) !important;
    }
}

/* 13f. Blur-focus: hover one tile and the others in its grid soften, so the one you are on pops (desktop + mouse) */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
    html:is(.perf-full, .blur-max):not(.blur-off) body :is(#view-dashboard > .grid, #materials-grid) > * {
        transition: filter .4s var(--g-ease), opacity .4s var(--g-ease), translate .4s var(--g-ease), box-shadow .35s var(--g-ease), border-color .25s ease;
    }
    html:is(.perf-full, .blur-max):not(.blur-off) body #view-dashboard > .grid:has(> :hover) > :not(:hover),
    html:is(.perf-full, .blur-max):not(.blur-off) body #materials-grid:has(> :hover) > :not(:hover) {
        filter: blur(2.5px) saturate(.85); opacity: .72;
    }
}

/* 13g. Blur reveal as you scroll (Chromium / Safari 26+: the browser drives it from the scroll position, no JavaScript) */
@supports (animation-timeline: view()) {
    @media (hover: hover) and (pointer: fine) and (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
        html:is(.perf-full, .blur-max):not(.blur-off) body :is(#materials-grid > div, #feed-stream > div):not(#_) {
            animation: gBlurScroll linear backwards; animation-timeline: view(); animation-range: entry 0% entry 45%;
        }
    }
}

/* 13h. The blur button (js/smooth.js adds it next to the theme button) */
#sm-blur-btn { position: relative; }
#sm-blur-btn[data-level="off"] { opacity: .5; }
#sm-blur-btn[data-level="max"] { color: #c4b5fd; box-shadow: 0 0 0 1px rgba(167, 139, 250, .5), 0 0 14px rgba(124, 108, 255, .45); }

/* 13i. Off switch: no blur effects at all */
html.blur-off body *, html.blur-off body *::before, html.blur-off body *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
html.blur-off body .m-enter > *, html.blur-off #login-section > *, html.blur-off #portal-section { filter: none !important; }

/* =====================================================================
   14. MORE BENTO + MORE BLUR + TILT (v5)
   ===================================================================== */

/* 14a. BENTO LAYOUTS — unequal tiles that pack tightly (grid-auto-flow: dense fills the gaps) */
html body #view-dashboard > .grid { grid-auto-flow: dense; }
@media (min-width: 768px) {
    html body #materials-grid { grid-auto-flow: dense; }
    html body #materials-grid > :nth-child(5n + 1) { grid-column: span 2; }                       /* every fifth material is a wide tile */
    html body #dashboard-leaderboard-grid { grid-auto-flow: dense; }
    html body #dashboard-leaderboard-grid > :first-child { grid-column: span 2; }                 /* the leader gets the big tile */
    html body #tutoring-list > :first-child { grid-column: span 2; }                              /* the next session gets the wide tile */
}
@media (min-width: 1400px) {
    /* the community feed becomes a two-column bento on wide screens; the newest post spans the full width */
    html body #feed-stream { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; grid-auto-flow: dense; }
    html body #feed-stream > :first-child { grid-column: 1 / -1; }
}
/* bento tiles all get the same tight, even rhythm */
html body :is(#materials-grid, #dashboard-leaderboard-grid, #tutoring-list) { gap: 14px; }
@media (min-width: 768px) { html body :is(#materials-grid, #dashboard-leaderboard-grid, #tutoring-list) { gap: 18px; } }

/* 14b. TILT — bento tiles lean toward the cursor (smooth.js sets --rx/--ry; strong desktops + mouse only) */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) and (prefers-reduced-motion: no-preference) {
    html:is(.perf-full, .blur-max):not(.blur-off) body .dash-cell:not(#_):not(#__):not(#___):hover {
        transform: perspective(1100px) rotateX(calc(var(--ry, 0) * -3deg)) rotateY(calc(var(--rx, 0) * 3deg)) !important;
    }
}

/* 14c. MORE BLUR-INS: every stagger list (leaderboard, sessions, support, admin...) resolves out of a blur, first 12 rows */
@media (prefers-reduced-motion: no-preference) {
    html:is(.perf-full, .blur-max):not(.blur-off) body .stagger-container:not(#feed-stream):not(#materials-grid) > *:nth-child(-n+12):not(#_) {
        animation-name: gBlurSoft; animation-duration: .55s; animation-timing-function: var(--g-ease); animation-fill-mode: backwards;
    }
}

/* 14d. FROSTED VIDEO CONTROLS — the control bar and its menus blur the picture behind them (strong desktops only; phones keep them solid) */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
    html:is(.perf-full, .blur-max):not(.blur-off):not(.flow-samsung) body :is(#video-theater .vc-bar, #video-theater .vc-menu, #video-theater .vc-tip):not(#_):not(#__):not(#___) {
        -webkit-backdrop-filter: blur(18px) saturate(165%) !important; backdrop-filter: blur(18px) saturate(165%) !important;
        background-color: rgba(10, 14, 32, .45) !important;
    }
}

/* 14e. Hover on a bento tile: a slightly stronger glow ring in its own accent colour */
@media (hover: hover) and (pointer: fine) {
    html:not(.light-theme) body .dash-cell:not(#_):not(#__):hover { border-color: rgba(255, 255, 255, .22) !important; }
}


/* ======== liquid.css ======== */
/* =====================================================================
   liquid.css  (v6) — toast fix, per-tile blur, more bento, and 60+ animations.
   Load it LAST (after stage.css). Pairs with js/liquid.js. Delete both to go back.

   It sits on top of the layers you already have and obeys them:
     - device tiers from boost.js  (html.perf-full / perf-mid / perf-lite)
     - the Blur button from smooth.js  (html.blur-max / html.blur-off)
     - fx.js's switch for decorative extras  (html.fx-on) and prefers-reduced-motion
   Smoothness rules: every animation is transform / opacity (compositor only); looping ones exist only on strong desktops,
   pause while you scroll or the tab is hidden, and one-shot ones end on a plain un-filtered element.
   Numbers A01-A66 below are the animations, so you can find and delete any one of them.
   ===================================================================== */
:root {
    --lq-ease: cubic-bezier(.22, 1, .36, 1);
    --lq-spring: cubic-bezier(.34, 1.56, .64, 1);
    --lq-soft: cubic-bezier(.4, 0, .2, 1);
}

/* =====================================================================
   1. TOASTS (bottom right) — readable on ANY background, both themes
   The old light-mode toast was a see-through light capsule with dark text, so over the dark video (or anywhere blur
   is not available: phones, Samsung Internet, weak PCs) the words vanished. Now the body is solid enough to carry its
   own text colour, the blur is only a bonus, and each type has its own accent.
   ===================================================================== */
html body #toast-container { gap: 10px; }
html body #toast-container > *:not(#_):not(#__) {
    --tt: 99, 102, 241;                      /* accent colour (info) */
    --tt-ic: 165, 180, 252;                  /* icon colour */
    --tt-ink: #eef1ff;                       /* text */
    --tt-glass: rgba(15, 20, 44, .93);
    position: relative; overflow: hidden; isolation: isolate;
    min-width: min(260px, 92vw); max-width: min(400px, 92vw);
    padding: 11px 16px 15px 11px !important; gap: 12px !important;
    border-radius: 20px !important; font-size: 12.5px !important; line-height: 1.35;
    color: var(--tt-ink) !important;
    background-color: var(--tt-glass) !important;
    background-image:
        linear-gradient(100deg, rgba(var(--tt), .30), rgba(var(--tt), 0) 64%),
        linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, 0) 52%) !important;
    border: 1px solid rgba(var(--tt), .5) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .5), inset 0 0 0 1px rgba(255, 255, 255, .05), 0 18px 40px -16px rgba(2, 4, 16, .85), 0 0 26px -10px rgba(var(--tt), .65) !important;
}
html body #toast-container > .bg-indigo-950\/90:not(#_):not(#__) { --tt: 16, 185, 129; --tt-ic: 110, 231, 183; }     /* success */
html body #toast-container > .bg-red-950\/90:not(#_):not(#__)    { --tt: 244, 63, 94;  --tt-ic: 253, 164, 175; }     /* error   */

html.light-theme body #toast-container > *:not(#_):not(#__) {
    --tt: 99, 102, 241; --tt-ic: 79, 70, 229; --tt-ink: #1e1b4b; --tt-glass: rgba(255, 255, 255, .955);
    border: 1px solid rgba(var(--tt), .38) !important;
    background-image:
        linear-gradient(100deg, rgba(var(--tt), .16), rgba(var(--tt), 0) 62%),
        linear-gradient(180deg, rgba(255, 255, 255, .9), rgba(255, 255, 255, 0) 60%) !important;
    box-shadow: inset 0 1px 1px #fff, 0 0 0 1px rgba(255, 255, 255, .6), 0 18px 38px -16px rgba(79, 70, 229, .5), 0 4px 10px -4px rgba(30, 27, 75, .18) !important;
}
html.light-theme body #toast-container > .bg-indigo-950\/90:not(#_):not(#__) { --tt: 16, 185, 129; --tt-ic: 4, 120, 87;  --tt-ink: #064e3b; }
html.light-theme body #toast-container > .bg-red-950\/90:not(#_):not(#__)    { --tt: 244, 63, 94;  --tt-ic: 190, 18, 60; --tt-ink: #881337; }

/* the words and the icon always take the toast's own colours (main.css paints every light-mode svg near-black and spans slate) */
html body #toast-container > * > span:not(#_):not(#__) { color: var(--tt-ink) !important; -webkit-text-fill-color: var(--tt-ink) !important; font-weight: 700; }
html body #toast-container > * > :is(svg, i):not(#_):not(#__) {
    flex: none; width: 30px !important; height: 30px !important; padding: 7px; box-sizing: border-box; border-radius: 50%;
    color: rgb(var(--tt-ic)) !important; stroke: rgb(var(--tt-ic)) !important; background: rgba(var(--tt), .2);
}

/* A01 the timer line under every toast runs down exactly as long as the toast stays (3.5 s) */
html body #toast-container > *::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; pointer-events: none;
    background: linear-gradient(90deg, rgb(var(--tt)), rgba(var(--tt), .35));
    transform-origin: 0 50%; animation: lqToastBar 3.5s linear forwards;
}
@keyframes lqToastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
html body #toast-container > .toast-slide-out::after { animation-play-state: paused; }
/* A02 the icon bubble rings once as the toast lands */
html body #toast-container > * > :is(svg, i)::before { content: none; }
@keyframes lqRingOut { 0% { box-shadow: 0 0 0 0 rgba(var(--tt), .55); } 100% { box-shadow: 0 0 0 14px rgba(var(--tt), 0); } }
@media (prefers-reduced-motion: no-preference) {
    html body #toast-container > * > :is(svg, i):not(#_):not(#__) { animation: lqRingOut .9s var(--lq-ease) .25s 1 backwards, toastIconPop .4s var(--lq-spring) .1s both; }
}

/* =====================================================================
   2. REAL BLUR ON EVERY TILE (strong desktops with a mouse; the Blur button still rules)
   Before: one big blur on the main panel. A blur inside a blurred parent can only see that parent, so the tiles
   never refracted anything. Now the panel is clear, and each tile blurs what is really behind it (the ambient
   layer from liquid.js, the orbs, the mesh), which is what makes it look like glass.
   Auto = blur 16px.  Max (header blur button) = 26px, sidebar too.  Off / weak devices / phones = none of this.
   ===================================================================== */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
    html:is(.perf-full, .blur-max):not(.blur-off):not(.flow-samsung) body .glass-main-panel:not(#_):not(#__):not(#___):not(#____):not(#_____) {
        -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    }
    html:is(.perf-full, .blur-max):not(.blur-off):not(.flow-samsung) body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(.glass-card .glass-card):not(.glass-card .fx-card):not(#_):not(#__):not(#___):not(#____):not(#_____) {
        -webkit-backdrop-filter: blur(16px) saturate(170%) !important; backdrop-filter: blur(16px) saturate(170%) !important;
    }
    html.blur-max:not(.blur-off):not(.flow-samsung) body :is(.glass-card, .glass-panel, .fx-card, .dash-cell, .tilt-lift-card):not(.glass-card .glass-card):not(.glass-card .fx-card):not(#_):not(#__):not(#___):not(#____):not(#_____) {
         
    }
    /* the header floats over scrolling content, so its blur is always visible */
    html:is(.perf-full, .blur-max):not(.blur-off):not(.flow-samsung) body .glass-header:not(#_):not(#__):not(#___):not(#____) {
        -webkit-backdrop-filter: blur(20px) saturate(180%) !important; backdrop-filter: blur(20px) saturate(180%) !important;
    }
}
/* tiles are translucent a bit more once real blur sits behind them */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
    html.perf-full:not(.blur-off):not(.flow-samsung):not(.light-theme) body :is(.dash-cell, .glass-card):not(#_):not(#__):not(#___) { background-color: rgba(20, 26, 58, .34) !important; }
    html.perf-full.light-theme:not(.blur-off):not(.flow-samsung) body :is(.dash-cell, .glass-card):not(#_):not(#__):not(#___) { background-color: rgba(255, 255, 255, .42) !important; }
}

/* =====================================================================
   3. AMBIENT LIQUID LAYER (built by js/liquid.js; strong desktops only): aurora ribbons + glass bubbles behind the tiles
   ===================================================================== */
#lq-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; contain: strict; }
#lq-bg .lq-rib { position: absolute; left: -20vmax; width: 90vmax; height: 30vmax; border-radius: 50%; will-change: transform; opacity: .9; }
#lq-bg .lq-r1 { top: 6vh;  background: radial-gradient(closest-side, rgba(99, 102, 241, .46), rgba(99, 102, 241, 0));  }
#lq-bg .lq-r2 { top: 52vh; background: radial-gradient(closest-side, rgba(34, 211, 238, .34), rgba(34, 211, 238, 0));  }
#lq-bg .lq-r3 { top: 28vh; left: 20vmax; background: radial-gradient(closest-side, rgba(244, 114, 182, .30), rgba(244, 114, 182, 0));  }
/* A03 / A04 / A05  three aurora ribbons drift and breathe */
@keyframes lqRibA { from { transform: translate3d(-6vmax, 0, 0) rotate(-8deg) scale(1); } to { transform: translate3d(22vmax, 6vh, 0) rotate(7deg) scale(1.18); } }
@keyframes lqRibB { from { transform: translate3d(18vmax, 0, 0) rotate(8deg) scale(1.1); } to { transform: translate3d(-10vmax, -8vh, 0) rotate(-6deg) scale(.95); } }

#lq-bg .lq-bub {
    position: absolute; border-radius: 50%; will-change: transform; opacity: .95;
    background:
        radial-gradient(circle at 30% 26%, rgba(255, 255, 255, .85) 0 3%, rgba(255, 255, 255, 0) 16%),
        radial-gradient(circle at 50% 50%, rgba(var(--b), .55), rgba(var(--b), .22) 62%, rgba(var(--b), .5) 100%);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28), inset 0 -10px 30px rgba(var(--b), .5), 0 20px 50px -20px rgba(var(--b), .6);
    
}
/* A06-A12  seven glass bubbles float up and sideways at their own speed */
@keyframes lqBub { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(var(--x, 40px), calc(var(--y, -80px) * .5), 0) scale(1.08); } 100% { transform: translate3d(calc(var(--x, 40px) * -.6), var(--y, -80px), 0) scale(.94); } }
html.light-theme #lq-bg .lq-bub { opacity: .75; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .8), inset 0 -10px 30px rgba(var(--b), .35), 0 20px 50px -20px rgba(var(--b), .45); }
html.light-theme #lq-bg .lq-r1 { background: radial-gradient(closest-side, rgba(129, 140, 248, .42), rgba(129, 140, 248, 0)); }
html.light-theme #lq-bg .lq-r2 { background: radial-gradient(closest-side, rgba(45, 212, 191, .34), rgba(45, 212, 191, 0)); }
html.light-theme #lq-bg .lq-r3 { background: radial-gradient(closest-side, rgba(244, 114, 182, .32), rgba(244, 114, 182, 0)); }
html:not(.fx-on) #lq-bg, html.perf-lite #lq-bg { display: none; }
#lq-bg .lq-off { animation-play-state: paused !important; }
@media (prefers-reduced-motion: reduce) { #lq-bg * { animation: none !important; } }
@media (max-width: 1023px), (pointer: coarse) { #lq-bg { display: none; } }

/* A13  the little living blob under the glass of each dashboard tile (injected by liquid.js) */
.lq-blob { position: absolute; z-index: -1; width: 70%; height: 70%; left: 22%; top: -18%; border-radius: 50%; pointer-events: none; will-change: transform;
    background: radial-gradient(closest-side, var(--g-accent, rgba(124, 108, 255, .3)), rgba(0, 0, 0, 0));  }
html.light-theme .lq-blob { background: radial-gradient(closest-side, var(--g-accent-l, rgba(124, 108, 255, .25)), rgba(255, 255, 255, 0)); }
@keyframes lqBlob { from { transform: translate3d(-10%, -6%, 0) scale(1); } to { transform: translate3d(34%, 40%, 0) scale(1.35); } }
.lq-blob.lq-off { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .lq-blob { animation: none; } }

/* A14  a soft cursor-following glass orb (desktop, strong devices; moved by liquid.js with transform only) */
#lq-cursor { position: fixed; left: 0; top: 0; z-index: 3; width: 190px; height: 190px; margin: -95px 0 0 -95px; border-radius: 50%; pointer-events: none; opacity: 0;
    background: radial-gradient(closest-side, rgba(167, 139, 250, .22), rgba(167, 139, 250, 0)); transition: opacity .4s ease; will-change: transform; }
#lq-cursor.on { opacity: 1; }
html.light-theme #lq-cursor { background: radial-gradient(closest-side, rgba(236, 72, 153, .16), rgba(236, 72, 153, 0)); }

/* =====================================================================
   4. MORE BENTO — accents and layouts for every tab, not just the dashboard
   ===================================================================== */
/* one colour per tile, cycling, for the lists that are tiles (the glass layer reads --g-accent / --g-accent-l) */
html body :is(#materials-grid, #feed-stream, #tutoring-list, #dashboard-leaderboard-grid) > :nth-child(5n + 1) { --g-accent: rgba(99, 102, 241, .26);  --g-accent-l: rgba(99, 102, 241, .18); }
html body :is(#materials-grid, #feed-stream, #tutoring-list, #dashboard-leaderboard-grid) > :nth-child(5n + 2) { --g-accent: rgba(45, 212, 191, .22);  --g-accent-l: rgba(20, 184, 166, .17); }
html body :is(#materials-grid, #feed-stream, #tutoring-list, #dashboard-leaderboard-grid) > :nth-child(5n + 3) { --g-accent: rgba(244, 114, 182, .22); --g-accent-l: rgba(236, 72, 153, .15); }
html body :is(#materials-grid, #feed-stream, #tutoring-list, #dashboard-leaderboard-grid) > :nth-child(5n + 4) { --g-accent: rgba(251, 191, 36, .18);  --g-accent-l: rgba(251, 191, 36, .2); }
html body :is(#materials-grid, #feed-stream, #tutoring-list, #dashboard-leaderboard-grid) > :nth-child(5n + 5) { --g-accent: rgba(34, 211, 238, .22);  --g-accent-l: rgba(14, 165, 233, .16); }
#view-account > .grid > :nth-child(1), #view-admin > .grid:first-child > :nth-child(1) { --g-accent: rgba(99, 102, 241, .28);  --g-accent-l: rgba(99, 102, 241, .2); }
#view-account > .grid > :nth-child(2), #view-admin > .grid:first-child > :nth-child(2) { --g-accent: rgba(244, 114, 182, .24); --g-accent-l: rgba(236, 72, 153, .16); }
#view-account > .grid > :nth-child(3)  { --g-accent: rgba(45, 212, 191, .22);  --g-accent-l: rgba(20, 184, 166, .17); }
#view-admin > .grid ~ .grid > :nth-child(1) { --g-accent: rgba(251, 191, 36, .2);   --g-accent-l: rgba(251, 191, 36, .2); }
#view-admin > .grid ~ .grid > :nth-child(2) { --g-accent: rgba(34, 211, 238, .22);  --g-accent-l: rgba(14, 165, 233, .16); }
#view-codes .glass-card { --g-accent: rgba(251, 191, 36, .2); --g-accent-l: rgba(251, 191, 36, .2); }
#support-faq { --g-accent: rgba(167, 139, 250, .26); --g-accent-l: rgba(139, 92, 246, .18); }
#vs-playlist-card { --g-accent: rgba(99, 102, 241, .28); --g-accent-l: rgba(99, 102, 241, .2); }
#streak-card { --g-accent: rgba(251, 146, 60, .24); --g-accent-l: rgba(249, 115, 22, .16); }

/* My Account becomes a 12-column bento: the first card wide, the second narrow, the third full width */
@media (min-width: 1024px) {
    html body #view-account > .grid { grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense; gap: 18px; }
    html body #view-account > .grid > :nth-child(1) { grid-column: span 7; }
    html body #view-account > .grid > :nth-child(2) { grid-column: span 5; }
    html body #view-account > .grid > :nth-child(3) { grid-column: 1 / -1; }
}
/* Support: the FAQ is a centred tile; admin tiles share the same rhythm */
@media (min-width: 768px) { html body :is(#view-admin, #view-account) > .grid { gap: 18px; } }
/* wide screens: the playlist cards and bento rows breathe a little more */
@media (min-width: 1280px) { html body #vs-layout { max-width: 1200px; } }
/* every tile reads as one object: even inner padding and a firmer title row */
html body :is(#view-account, #view-admin, #view-codes) .glass-card { padding: 22px; }
@media (max-width: 767px) { html body :is(#view-account, #view-admin, #view-codes) .glass-card { padding: 18px; } }

/* A15  hover: a tile lifts and its accent colour glows through the glass (desktop) */
@media (hover: hover) and (pointer: fine) {
    html.fx-on body :is(#view-account, #view-admin, #view-codes) .glass-card:hover { box-shadow: var(--g-rim-d, none), 0 26px 52px -24px var(--g-accent, rgba(99, 102, 241, .4)) !important; }
    html.fx-on.light-theme body :is(#view-account, #view-admin, #view-codes) .glass-card:hover { box-shadow: var(--g-rim-l, none), 0 26px 52px -24px var(--g-accent-l, rgba(99, 102, 241, .4)) !important; }
}

/* =====================================================================
   5. MORE LIQUID GLASS — detail on the small things
   ===================================================================== */
/* glass capsules for the filter chips and small pills (static paint, no cost) */
html:not(.light-theme) body :is(#materials-type-filters button, #faq-chips button, .faq-chip):not(#_):not(#__) {
    background-image: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 60%) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, .45), 0 6px 14px -8px rgba(2, 4, 16, .7); border-radius: 999px !important;
}
html.light-theme body :is(#materials-type-filters button, #faq-chips button, .faq-chip):not(#_):not(#__) {
    background-image: linear-gradient(180deg, #fff, rgba(255, 255, 255, 0) 70%) !important;
    box-shadow: inset 0 1px 1px #fff, 0 6px 14px -8px rgba(79, 70, 229, .35); border-radius: 999px !important;
}
/* scrollbars: glass thumbs that glow on hover */
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, rgba(167, 139, 250, .55), rgba(99, 102, 241, .4)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25); }
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, rgba(196, 181, 253, .85), rgba(129, 140, 248, .65)); }
/* the header gets a soft shadow once the page has scrolled (liquid.js toggles html.lq-stuck) */
html body .glass-header { transition: box-shadow .35s var(--lq-ease); }
html.lq-stuck body .glass-header:not(#_):not(#__) { box-shadow: var(--g-rim-d, none), 0 18px 36px -20px rgba(2, 4, 16, .8) !important; }
html.lq-stuck.light-theme body .glass-header:not(#_):not(#__) { box-shadow: var(--g-rim-l, none), 0 18px 36px -20px rgba(79, 70, 229, .45) !important; }
/* modals: the blurred dimmer is tinted so the glass card pops */
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
    html:is(.perf-full, .blur-max):not(.blur-off):not(.flow-samsung) body .modal-root:not(.hidden):not(#_):not(#__):not(#___):not(#____) { background-color: rgba(8, 10, 28, .42) !important; }
    html.light-theme:is(.perf-full, .blur-max):not(.blur-off):not(.flow-samsung) body .modal-root:not(.hidden):not(#_):not(#__):not(#___):not(#____) { background-color: rgba(238, 236, 255, .5) !important; }
}

/* =====================================================================
   6. ANIMATIONS  (all gated: html.fx-on + no reduced-motion; the heavy ones only on strong desktops)
   ===================================================================== */
@keyframes lqPop      { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.12); } 100% { opacity: 1; transform: none; } }
@keyframes lqRise     { from { opacity: 0; transform: translate3d(0, 26px, 0) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes lqFromL    { from { opacity: 0; transform: translate3d(-46px, 0, 0) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes lqFromR    { from { opacity: 0; transform: translate3d(46px, 0, 0) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes lqFromT    { from { opacity: 0; transform: translate3d(0, -34px, 0) scale(.94); } to { opacity: 1; transform: none; } }
@keyframes lqFromBR   { from { opacity: 0; transform: translate3d(36px, 36px, 0) scale(.92); } to { opacity: 1; transform: none; } }
@keyframes lqZoom     { from { opacity: 0; transform: scale(.82); } to { opacity: 1; transform: none; } }
@keyframes lqTilt     { from { opacity: 0; transform: perspective(700px) rotateY(-14deg) translate3d(-20px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes lqDrop     { from { opacity: 0; transform: translate3d(0, -12px, 0); } to { opacity: 1; transform: none; } }
@keyframes lqRing     { from { stroke-dashoffset: 219.9; } }
@keyframes lqGlint    { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(260%); } }
@keyframes lqFlame    { 0%, 100% { transform: scale(1) rotate(-3deg); } 25% { transform: scale(1.1, 1.18) rotate(3deg); } 50% { transform: scale(.96, 1.06) rotate(-2deg); } 75% { transform: scale(1.08, 1.12) rotate(4deg); } }
@keyframes lqBreathe  { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }
@keyframes lqFloatY   { 0%, 100% { transform: translate3d(0, 0, 0); } 50% { transform: translate3d(0, -7px, 0); } }
@keyframes lqWiggle   { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg) scale(1.1); } 60% { transform: rotate(7deg) scale(1.1); } }
@keyframes lqSpin     { to { transform: rotate(360deg); } }
@keyframes lqShake    { 0%, 100% { transform: translate3d(0, 0, 0); } 20%, 60% { transform: translate3d(-5px, 0, 0); } 40%, 80% { transform: translate3d(5px, 0, 0); } }
@keyframes lqBeat     { 0%, 100% { transform: scale(1); } 20% { transform: scale(1.28); } 40% { transform: scale(.94); } 60% { transform: scale(1.14); } }
@keyframes lqNudgeR   { 0%, 70%, 100% { transform: translate3d(0, 0, 0); } 82% { transform: translate3d(4px, 0, 0); } 92% { transform: translate3d(-1px, 0, 0); } }
@keyframes lqPulseS   { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@keyframes lqCharIn   { from { opacity: 0; transform: translate3d(0, .55em, 0) rotate(5deg); } to { opacity: 1; transform: none; } }
@keyframes lqWave     { 0% { transform: scale(.2); opacity: .55; } 100% { transform: scale(4.2); opacity: 0; } }
@keyframes lqSpark    { 0% { transform: translate3d(0, 0, 0) scale(1); opacity: 1; } 100% { transform: translate3d(var(--sx), var(--sy), 0) scale(0); opacity: 0; } }
@keyframes lqPlop     { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }

@media (prefers-reduced-motion: no-preference) {
    /* A51 the dashboard lock/unlock icons shake when a locked card is hovered (hover only) */

    /* ---------- 6d. Hover / press (mouse devices) ---------- */
    @media (hover: hover) and (pointer: fine) {
        /* A56 the copy / download / upload icons hop */
        html.fx-on button:hover > svg:is(.lucide-copy, .lucide-download, .lucide-upload, .lucide-file-up, .lucide-file-down) { animation: lqFloatY .6s ease; }
        /* A60 chips and filter pills pop up */
        html.fx-on :is(#materials-type-filters button, #faq-chips button, .faq-chip, .fx-chip):hover { transform: translate3d(0, -2px, 0) scale(1.05); }
        html.fx-on :is(#materials-type-filters button, #faq-chips button, .faq-chip, .fx-chip) { transition: transform .25s var(--lq-spring); }
    }
    /* A74 tab title letters rise one by one (liquid.js splits the text) */
    .lq-ch { display: inline-block; animation: lqCharIn .5s var(--lq-ease) backwards; animation-delay: calc(var(--i, 0) * 28ms); white-space: pre; }
    /* A75 click sparks and the login wave are spawned by liquid.js */
    .lq-spark { position: fixed; z-index: 100003; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; pointer-events: none; animation: lqSpark .65s var(--lq-ease) forwards; }
    #lq-wave { position: fixed; left: 50%; top: 50%; z-index: 100004; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; pointer-events: none;
        background: radial-gradient(closest-side, rgba(167, 139, 250, .0) 58%, rgba(167, 139, 250, .55) 72%, rgba(34, 211, 238, .25) 86%, rgba(34, 211, 238, 0) 100%); animation: lqWave 1.15s var(--lq-ease) forwards; will-change: transform, opacity; }
    html.light-theme #lq-wave { background: radial-gradient(closest-side, rgba(129, 140, 248, 0) 58%, rgba(129, 140, 248, .5) 72%, rgba(244, 114, 182, .25) 86%, rgba(244, 114, 182, 0) 100%); }
}

/* phones / tablets: the entrances above stay (cheap), the always-on loops and blurs above are already desktop-only */
@media (max-width: 1023px), (pointer: coarse) {
}
/* reduced motion / lite devices: everything off, content fully visible */
@media (prefers-reduced-motion: reduce) {
    .lq-ch, .lq-spark, #lq-wave { animation: none !important; }
    html body #toast-container > *::after { animation: none; transform: scaleX(1); }
}
html.perf-lite .lq-blob, html.perf-lite #lq-cursor { display: none !important; }


/* ======== wow.css ======== */
/* =====================================================================
   wow.css — the big animation pass (pairs with js/wow.js). SELF-CONTAINED: it needs no other CSS or JS file from the site.
   Load it LAST:  <link rel="stylesheet" href="/css/wow.css">      Delete that <link> + the wow.js <script> to switch it all off.

   Rules (so phones stay smooth): only transform / opacity / clip-path and the individual `translate` `scale` `rotate`
   properties are animated; no blur, no filters, no animated gradients, no layout reads while scrolling.
   Tiers (set by wow.js): html.wow-on = allowed (not reduced-motion, not a weak device)
                          html.wow-fx = desktop + mouse + strong device (cursor glow, magnetic buttons)
                          html.wow-touch = phones / tablets (only the cheap, one-shot effects)
   ===================================================================== */
:root {
    --wow-ease: cubic-bezier(.22, 1, .36, 1);
    --wow-spring: cubic-bezier(.34, 1.56, .64, 1);
    --wow-a: 124, 108, 255;
}

/* ---------- 2. Page-load: one orchestrated entrance (portal shell) ---------- */
@keyframes wowNavIn   { from { opacity: 0; translate: -18px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes wowHeadIn  { from { opacity: 0; translate: 0 -14px; } to { opacity: 1; translate: 0 0; } }
@keyframes wowTileIn  { from { opacity: 0; translate: 0 22px; scale: .96; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes wowWipe    { from { clip-path: inset(0 100% 0 0); opacity: .2; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
@keyframes wowFloatY  { 0%, 100% { translate: 0 0; } 50% { translate: 0 -5px; } }
@keyframes wowBreathe { 0%, 100% { scale: 1; } 50% { scale: 1.045; } }
@keyframes wowPing    { 0% { scale: 1; opacity: .55; } 80%, 100% { scale: 2.1; opacity: 0; } }
@keyframes wowBellIdle{ 0%, 88%, 100% { rotate: 0deg; } 91% { rotate: 14deg; } 94% { rotate: -12deg; } 97% { rotate: 7deg; } }
@keyframes wowToastBar{ from { transform: scaleX(1); } to { transform: scaleX(0); } }
@keyframes wowFade    { from { opacity: 0; } to { opacity: 1; } }
@keyframes wowShake   { 0%, 100% { translate: 0 0; } 20% { translate: -7px 0; } 40% { translate: 6px 0; } 60% { translate: -4px 0; } 80% { translate: 3px 0; } }
@keyframes wowCheck   { from { stroke-dashoffset: 30; } to { stroke-dashoffset: 0; } }
@keyframes wowSpark   { 0% { transform: translate3d(0, 0, 0) scale(.2); opacity: 1; } 100% { transform: translate3d(var(--sx), var(--sy), 0) scale(1); opacity: 0; } }
@keyframes wowRowIn   { from { opacity: 0; translate: -10px 0; } to { opacity: 1; translate: 0 0; } }
@keyframes wowPopBadge{ 0% { scale: .4; opacity: 0; } 60% { scale: 1.25; opacity: 1; } 100% { scale: 1; } }

@media (prefers-reduced-motion: no-preference) {

    /* notification badge: soft ring + the bell nods now and then */
    @media (hover: hover) and (pointer: fine) {
    }

    /* ---------- hover + press micro-interactions (mouse only, compositor-only properties) ---------- */
    @media (hover: hover) and (pointer: fine) {
    }
}

/* ---------- 7. Scroll-driven reveals: pure CSS, runs on the compositor, zero JS (Chrome/Edge/Samsung 115+, Safari 26+) ---------- */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        @keyframes wowScrollIn { from { opacity: 0; translate: 0 26px; scale: .97; } to { opacity: 1; translate: 0 0; scale: 1; } }
        @keyframes wowScrollHead { from { opacity: 0; translate: -18px 0; } to { opacity: 1; translate: 0 0; } }
    }
}

/* ---------- 8. Scroll progress bar from motion.js gets a glow, and the top bar shimmer on route change ---------- */
#m-progress { box-shadow: 0 0 10px rgba(var(--wow-a), .8); }

/* ---------- 9. Weak devices / reduced motion: everything above that loops is switched off ---------- */
html.perf-lite #login-logo, html.perf-lite #login-section .glass-card,
html.perf-lite .ntf-badge::after, html.perf-lite #toast-container > *::after { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
}
/* phones: loops that are not worth the battery */
@media (pointer: coarse), (max-width: 1023px) {
    #login-section .glass-card:first-of-type { animation: none !important; }
}


/* =====================================================================
   PART 2 — made after seeing feed.css / grades.css / sessions.css / notifications.css / voice-assistant.css / stage.css
   ===================================================================== */

/* ---------- A. Backdrop-blur budget (the biggest paint cost on the site) ----------
   Every .glass-card / .glass-panel / .fx-card / .gl-card carried its own backdrop-filter (up to blur(30px) saturate(190%)).
   look.css already gives those surfaces an almost solid fill (opaque white in light mode, 78% navy in dark), so the blur
   is invisible but the GPU still re-blurs every card on every scroll frame. Cards lose it; the big chrome (sidebar, header,
   dialogs, voice card) keeps its glass. The Blur button on the header still wins: "Max" puts everything back. */
html:not(.blur-max) .glass-card:not(#_), html:not(.blur-max) .glass-panel:not(#_),
html:not(.blur-max) .fx-card:not(#_), html:not(.blur-max) .gl-card:not(#_), html:not(.blur-max) .sp-card:not(#_),
html:not(.blur-max) input:not(#_), html:not(.blur-max) textarea:not(#_), html:not(.blur-max) select:not(#_) {
    -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
}
/* the small status pill on the voice overlay blurs a card that is already blurred */
#va-status:not(#_) { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
/* the voice overlay is hidden (visibility) most of the time but its waves kept running: freeze them until it opens */
#va-overlay:not(.va-show) *, #va-overlay:not(.va-show) *::before, #va-overlay:not(.va-show) *::after { animation-play-state: paused !important; }

/* ---------- B. Feed: like, comments, composer ---------- */
@keyframes wowBeat { 0% { scale: 1; } 25% { scale: 1.35; } 45% { scale: .92; } 65% { scale: 1.15; } 100% { scale: 1; } }
@keyframes wowSlideUp { from { opacity: 0; translate: 0 14px; } to { opacity: 1; translate: 0 0; } }
@keyframes wowGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes wowChipIn { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
@keyframes wowSheetItem { from { opacity: 0; translate: 0 10px; } to { opacity: 1; translate: 0 0; } }
@media (prefers-reduced-motion: no-preference) {
}

/* ---------- C. Feed cards, grade card, admin cards reveal as they scroll in (CSS only, every device) ---------- */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
    }
}
html.perf-lite .fx-comment, html.perf-lite .gl-row, html.perf-lite .ar-item, html.perf-lite .vs-row, html.perf-lite .fx-chip, html.perf-lite .ar-chip { animation: none !important; }
@media (prefers-reduced-motion: reduce) { }



/* ======== gx (v2: glass + motion) ======== */
/* =====================================================================
   gx — v2 layer: more glassmorphism + more motion, all gated by the device tier from boost.js
   (html.perf-full / perf-mid / perf-lite) and prefers-reduced-motion. Animations only touch transform/opacity/
   background-position (compositor-cheap); backdrop blur is used sparingly and only on big, few surfaces.
   Remove this whole section (and the "gx" block at the end of graphics.js) to go back to v1.
   ===================================================================== */
:root{--gx-ease:cubic-bezier(.22,1,.36,1);--gx-spring:cubic-bezier(.34,1.56,.64,1);--gx-a:#7c6cff;--gx-b:#22d3ee;--gx-c:#f472b6}

/* ---------- 0. Optimisations (all tiers) ---------- */
#feed-stream>div,#materials-grid>div,#video-sessions-list>div,#tutoring-list>div{content-visibility:auto;contain-intrinsic-size:auto 170px}
html.perf-lite *,html.perf-lite *::before,html.perf-lite *::after{-webkit-backdrop-filter:none!important;backdrop-filter:none!important}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}

/* ---------- 1. Glass: FULL tier (desktop / strong devices) ---------- */
html.perf-full:not(.light-theme) .glass-card:not(#_):not(#__),html.perf-full:not(.light-theme) .glass-panel:not(#_):not(#__){
  background-color:rgba(16,22,46,.46)!important;
  background-image:radial-gradient(280px circle at var(--gx-x,50%) var(--gx-y,-30%),rgba(255,255,255,.11),transparent 62%),linear-gradient(155deg,rgba(255,255,255,.085),rgba(255,255,255,.015) 38%,rgba(124,108,255,.05))!important;
  
  border:1px solid rgba(255,255,255,.12)!important;border-top-color:rgba(255,255,255,.26)!important;border-left-color:rgba(255,255,255,.18)!important;
  box-shadow:0 1px 0 rgba(255,255,255,.18) inset,0 0 0 1px rgba(0,0,0,.28),0 22px 46px -24px rgba(0,0,0,.8),0 0 40px -22px rgba(124,108,255,.5)!important;
  transition:transform .45s var(--gx-ease),border-color .3s,box-shadow .45s var(--gx-ease),background-color .3s;
}
html.perf-full:not(.light-theme) .glass-card:not(#_):not(#__):hover{border-color:rgba(167,139,250,.5)!important;background-color:rgba(20,27,56,.55)!important;box-shadow:0 1px 0 rgba(255,255,255,.24) inset,0 0 0 1px rgba(0,0,0,.28),0 28px 56px -22px rgba(76,58,200,.7),0 0 60px -18px rgba(124,108,255,.7)!important}
html.perf-full .glass-sidebar:not(#_):not(#__),html.perf-full .glass-header:not(#_):not(#__){-webkit-backdrop-filter:blur(26px) saturate(1.8);backdrop-filter:blur(26px) saturate(1.8)}
html.perf-full:not(.light-theme) .glass-sidebar:not(#_):not(#__){background-color:rgba(9,13,30,.5)!important;border-right:1px solid rgba(255,255,255,.1)!important;box-shadow:1px 0 0 rgba(255,255,255,.06) inset,24px 0 60px -30px rgba(0,0,0,.7)!important}
html.perf-full:not(.light-theme) .glass-header:not(#_):not(#__){background-color:rgba(9,13,30,.42)!important;border-bottom:1px solid rgba(255,255,255,.1)!important}
/* modal overlays: frosted backdrop + panel */
html.perf-full .modal-root:not(.hidden){-webkit-backdrop-filter:blur(9px) saturate(1.2);backdrop-filter:blur(9px) saturate(1.2);background-color:rgba(3,5,14,.55)!important}
html.perf-full:not(.light-theme) .modal-root>div:not(#_):not(#__){background-color:rgba(14,19,40,.62)!important;-webkit-backdrop-filter:blur(22px) saturate(1.7);backdrop-filter:blur(22px) saturate(1.7);border:1px solid rgba(255,255,255,.16)!important;border-top-color:rgba(255,255,255,.3)!important;box-shadow:0 1px 0 rgba(255,255,255,.2) inset,0 40px 90px -30px rgba(0,0,0,.9),0 0 80px -30px rgba(124,108,255,.6)!important}
/* inputs: frosted wells */
html.perf-full:not(.light-theme) input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]):not(#_):not(#__),html.perf-full:not(.light-theme) textarea:not(#_):not(#__),html.perf-full:not(.light-theme) select:not(#_):not(#__){background-color:rgba(255,255,255,.045)!important;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);border:1px solid rgba(255,255,255,.14)!important;box-shadow:0 1px 0 rgba(255,255,255,.06) inset,0 8px 20px -14px rgba(0,0,0,.7)}
/* toasts */
html.perf-full #toast-container>*{-webkit-backdrop-filter:blur(16px) saturate(1.6);backdrop-filter:blur(16px) saturate(1.6);border:1px solid rgba(255,255,255,.2);box-shadow:0 1px 0 rgba(255,255,255,.22) inset,0 18px 40px -16px rgba(0,0,0,.75)}

/* light theme glass (full + mid) */
html.perf-full.light-theme .glass-card:not(#_):not(#__),html.perf-full.light-theme .glass-panel:not(#_):not(#__),html.perf-mid.light-theme .glass-card:not(#_):not(#__){
  background-color:rgba(255,255,255,.58)!important;
  background-image:radial-gradient(280px circle at var(--gx-x,50%) var(--gx-y,-30%),rgba(255,255,255,.9),transparent 62%),linear-gradient(155deg,rgba(255,255,255,.8),rgba(245,243,255,.4))!important;
  border:1px solid rgba(255,255,255,.85)!important;
  box-shadow:0 1px 0 #fff inset,0 0 0 1px rgba(109,94,252,.1),0 20px 44px -22px rgba(79,70,229,.38)!important}
html.perf-full.light-theme .glass-card:not(#_):not(#__){}
html.perf-full.light-theme .modal-root>div:not(#_):not(#__){background-color:rgba(255,255,255,.72)!important;-webkit-backdrop-filter:blur(22px) saturate(1.6);backdrop-filter:blur(22px) saturate(1.6);border:1px solid rgba(255,255,255,.9)!important}

/* ---------- 2. Glass: MID tier (phones / tablets) — light blur on the few big bars only, frosted by colour elsewhere ---------- */
html.perf-mid:not(.light-theme) .glass-card:not(#_):not(#__){background-color:rgba(18,24,50,.7)!important;border:1px solid rgba(255,255,255,.12)!important;border-top-color:rgba(255,255,255,.22)!important;box-shadow:0 1px 0 rgba(255,255,255,.14) inset,0 14px 30px -20px rgba(0,0,0,.8)!important}
html.perf-mid .glass-sidebar:not(#_):not(#__),html.perf-mid .glass-header:not(#_):not(#__){-webkit-backdrop-filter:blur(12px) saturate(1.4);backdrop-filter:blur(12px) saturate(1.4)}
html.perf-mid .modal-root:not(.hidden){-webkit-backdrop-filter:blur(5px);backdrop-filter:blur(5px)}

/* ---------- 3. Motion: FULL + MID (cheap ones) ---------- */
@keyframes gx-pop{0%{opacity:0;transform:translateY(26px) scale(.93)}60%{opacity:1}100%{opacity:1;transform:none}}
@keyframes gx-fade{from{opacity:0}to{opacity:1}}
@keyframes gx-sweep{0%{background-position:160% 0}100%{background-position:-60% 0}}
@keyframes gx-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
@keyframes gx-pulse{0%,100%{opacity:.55;transform:scale(1)}50%{opacity:1;transform:scale(1.06)}}
@keyframes gx-flow{0%{background-position:0% 50%}100%{background-position:200% 50%}}
@keyframes gx-slide{from{opacity:0;transform:translateX(-14px)}to{opacity:1;transform:none}}
@keyframes gx-ring{0%{box-shadow:0 0 0 0 rgba(124,108,255,.55)}100%{box-shadow:0 0 0 14px rgba(124,108,255,0)}}

html:not(.perf-lite) .modal-root:not(.hidden){animation:gx-fade .28s ease both}
html:not(.perf-lite) .modal-root:not(.hidden)>div{animation:gx-pop .5s var(--gx-spring) both}
html:not(.perf-lite) #toast-container>*{animation:gx-slide .45s var(--gx-spring) both}
html:not(.perf-lite) .glass-sidebar .nav-btn svg,html:not(.perf-lite) .glass-sidebar .nav-btn i{transition:transform .35s var(--gx-spring)}
html:not(.perf-lite) .glass-sidebar .nav-btn:hover svg,html:not(.perf-lite) .glass-sidebar .nav-btn:hover i{transform:scale(1.18) rotate(-7deg)}
html:not(.perf-lite) .glass-sidebar .nav-btn{transition:transform .3s var(--gx-ease),background-color .25s,box-shadow .3s}
html:not(.perf-lite) .glass-sidebar .nav-btn:not(.bg-indigo-600\/15):hover{transform:translateX(5px)}
html:not(.perf-lite) #feed-stream>div,html:not(.perf-lite) #materials-grid>div,html:not(.perf-lite) #video-sessions-list>div,html:not(.perf-lite) #tutoring-list>div{transition:transform .4s var(--gx-ease),box-shadow .4s var(--gx-ease),border-color .3s}
html:not(.perf-lite) #feed-stream>div:hover,html:not(.perf-lite) #materials-grid>div:hover,html:not(.perf-lite) #video-sessions-list>div:hover,html:not(.perf-lite) #tutoring-list>div:hover{transform:translateY(-4px)}

/* ---------- 4. Motion: FULL only (the showy ones) ---------- */
html.perf-full #profile-avatar,html.perf-full #login-logo{}
html.perf-full [id^="badge-milestone"]:not(.grayscale){}
html.perf-full [id^="badge-milestone"]:not(.grayscale):nth-child(2n){animation-delay:-1.4s}
html.perf-full [id^="badge-milestone"]:not(.grayscale):nth-child(3n){animation-delay:-2.6s}
html.perf-full #welcome-message{background:linear-gradient(90deg,#fff 0%,#c7d2fe 25%,#67e8f9 50%,#f0abfc 75%,#fff 100%);background-size:200% 100%;-webkit-background-clip:text;background-clip:text;-webkit-text-fill-color:transparent;color:transparent;}
html.perf-full.light-theme #welcome-message{background-image:linear-gradient(90deg,#4f46e5,#a855f7,#ec4899,#4f46e5);background-size:200% 100%}
html.perf-full [id$="progress-bar"]>div,html.perf-full #dashboard-xp-progress-bar{background-size:220% 100%!important;}
/* primary buttons: gliding light sweep + magnetic pull (--gx-mx/--gx-my set by JS; "translate" is independent of transform) */
html.perf-full button.bg-indigo-600:not(.absolute):not(.fixed):not(.sticky):not(.relative),html.perf-full button.bg-indigo-500:not(.absolute):not(.fixed):not(.sticky):not(.relative){position:relative}
html.perf-full button.bg-indigo-600:not(.absolute):not(.fixed):not(.sticky)::after,html.perf-full button.bg-indigo-500:not(.absolute):not(.fixed):not(.sticky)::after{content:"";position:absolute;inset:0;border-radius:inherit;pointer-events:none;background:linear-gradient(105deg,transparent 35%,rgba(255,255,255,.34) 50%,transparent 65%);background-size:250% 100%;background-position:160% 0;opacity:0;transition:opacity .25s}
html.perf-full button.bg-indigo-600:not(:disabled):hover::after,html.perf-full button.bg-indigo-500:not(:disabled):hover::after{opacity:1;}
html.perf-full button.bg-indigo-600,html.perf-full button.bg-indigo-500{translate:var(--gx-mx,0) var(--gx-my,0);transition:translate .25s var(--gx-ease),transform .18s var(--gx-ease),box-shadow .25s var(--gx-ease),filter .2s}

/* thin glass scrollbars */
@media (hover:hover){html:not(.perf-lite) *{scrollbar-width:thin;scrollbar-color:rgba(167,139,250,.45) transparent}
html:not(.perf-lite) ::-webkit-scrollbar{width:9px;height:9px}html:not(.perf-lite) ::-webkit-scrollbar-thumb{background:linear-gradient(180deg,rgba(167,139,250,.55),rgba(34,211,238,.4));border-radius:99px;border:2px solid transparent;background-clip:padding-box}html:not(.perf-lite) ::-webkit-scrollbar-track{background:transparent}}