/**
 * Sophicly Focus Mode v5.59
 * - NEW: Logo loader integration (desktop letters + mobile circle animation)
 * - NEW: Full container hidden until loader completes (no border flash)
 * - FOUC fix: Elements hidden initially for smooth first-load animation
 * - SPA transitions with directional animations
 * - Magic glow loading effect on header
 * - Smooth sidebar crossfade transitions
 * - Avatar: SureDash + custom dashboard + initials fallback
 * - Accessible: Previous/Next/Mark Complete with success message
 * - Glowing buttons for all footer actions
 * - Duolingo-style connecting lines (destination-colored)
 * - Animated active topic background
 * - Animated progress bars
 * - Purple gradient accents throughout
 * - Enhanced Unit Content list
 * - Maximize/minimize sidebar toggle
 * - User dropdown menu
 * - Status badge in content area
 * - Fonts: Proxima Soft Complete & Playfair Display Complete
 */
 
 /* WHITE FLASH FIX - Body starts black, matches loader */
body.sophicly-focus-mode,
body.ld-in-focus-mode {
    background: #000 !important;
}

/* After loaded, use theme background */
body.sophicly-focus-mode.sophicly-focus-ready,
body.ld-in-focus-mode.sophicly-focus-ready {
    background: var(--spl-bg) !important;
}

/* Hide container until JS says it's loaded */
body.sophicly-focus-mode .spl:not(.is-loaded),
body.ld-in-focus-mode .spl:not(.is-loaded) {
    visibility: hidden;
    opacity: 0;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes AnimationName {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes spl-glow-pulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(66, 161, 236, 0.4),
            0 0 40px rgba(77, 118, 253, 0.25),
            0 0 60px rgba(125, 249, 233, 0.15),
            inset 0 0 30px rgba(81, 218, 207, 0.1);
    }
    50% {
        box-shadow: 
            0 0 25px rgba(77, 118, 253, 0.45),
            0 0 50px rgba(125, 249, 233, 0.3),
            0 0 70px rgba(66, 161, 236, 0.2),
            inset 0 0 35px rgba(81, 218, 207, 0.15);
    }
}

@keyframes spl-success-appear {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   LOADER STYLES
   Desktop: Animated "Sophicly" letters with underline
   Mobile: Circle animation with logo
   ============================================================ */
#spl-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000000;
    background: #000;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hide loader by default when it shouldn't show */
#spl-loader.is-hidden {
    display: none;
}

/* Mobile/Desktop view switching */
.spl-loader__view--mobile {
    display: block;
}

.spl-loader__view--desktop {
    display: none;
}

@media (min-width: 801px) {
    .spl-loader__view--mobile {
        display: none;
    }
    .spl-loader__view--desktop {
        display: block;
    }
}

/* Mobile loader - wrapper sizing */
.spl-loader__animation-wrapper {
    height: 200px;
    width: 200px;
    position: relative;
    opacity: 1;
    transform: scale(1);
    transform-origin: center center;
}

/* Mobile loader - circle positioning */
.spl-loader__circle {
    border: 10px solid #fff;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    border-radius: 50%;
    opacity: 0;
    transform: scale(0.9);
}

/* Mobile loader - logo INSIDE the circle (centered) */
.spl-loader__logo {
    position: absolute;
    top: 50%;
    left: 50%;
    height: 100px;
    width: 100px;
    margin-top: -50px;
    margin-left: -50px;
    opacity: 0;
    transform: translateY(10px);
}

.spl-loader__logo-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

/* Desktop loader - title container */
.spl-loader__title-container {
    text-align: center;
    transform: translateY(-4vh);
}

/* Desktop loader - HIDE letters initially to prevent flash before JS runs */
.spl-loader__title-container > div:not(.spl-loader__underline) {
    display: inline-block;
    font-family: "Proxima Soft", "proxima soft", proxima-soft, var(--spl-font-body), sans-serif;
    font-size: 16vw;
    font-weight: 700;
    letter-spacing: -15px;
    color: #fff;
    /* CRITICAL: Hide initially - JS will reveal with animation */
    visibility: hidden;
    opacity: 0;
}

/* Desktop loader underline */
.spl-loader__underline {
    display: block;
    clear: both;
    height: 2.9vh;
    width: 99%;
    background-color: #fff;
    margin: 40px auto 0;
    padding: 0;
    transform-origin: left center;
    transform: scaleX(0);
    position: relative;
    top: 0;
}

/* Desktop loader kerning */
@media (min-width: 802px) {
    :root {
        --spl-kern-t: clamp(0, (100vw - 802px) / 598, 1);
    }
    
    .spl-loader__view--desktop .spl-loader__title-container > div:not(.spl-loader__underline) {
        letter-spacing: -15px;
        display: inline-block;
        position: relative;
        font-family: "Proxima Soft", "proxima soft", proxima-soft, var(--spl-font-body), sans-serif;
        font-weight: 700;
    }
    
    .spl-loader__view--desktop .spl-loader__title-container > div:nth-of-type(2) {
        margin-left: calc(0.010em + (0.030em - 0.010em) * var(--spl-kern-t));
    }
    .spl-loader__view--desktop .spl-loader__title-container > div:nth-of-type(3) {
        margin-left: calc(-0.020em + (-0.045em + 0.020em) * var(--spl-kern-t));
    }
    .spl-loader__view--desktop .spl-loader__title-container > div:nth-of-type(4) {
        margin-left: calc(-0.020em + (-0.045em + 0.020em) * var(--spl-kern-t));
    }
    .spl-loader__view--desktop .spl-loader__title-container > div:nth-of-type(5) {
        margin-left: calc(-0.030em + (-0.060em + 0.030em) * var(--spl-kern-t));
    }
    .spl-loader__view--desktop .spl-loader__title-container > div:nth-of-type(6) {
        margin-left: calc(-0.025em + (-0.055em + 0.025em) * var(--spl-kern-t));
    }
    .spl-loader__view--desktop .spl-loader__title-container > div:nth-of-type(7) {
        margin-left: calc(-0.020em + (-0.050em + 0.020em) * var(--spl-kern-t));
    }
    .spl-loader__view--desktop .spl-loader__title-container > div:nth-of-type(8) {
        margin-left: calc(-0.020em + (-0.050em + 0.020em) * var(--spl-kern-t));
    }
}

/* ============================================================
   INITIAL CONTAINER HIDDEN STATE
   Hide entire container (including borders) until loader completes
   ============================================================ */
.spl.is-loading-initial {
    visibility: hidden;
    opacity: 0;
}

/* Ensure smooth reveal after loader */
.spl {
    transition: opacity 0.1s ease-out, visibility 0.1s ease-out;
}

/* ============================================================
   CSS VARIABLES - LIGHT MODE (Default)
   Using Sophicly brand colors
   ============================================================ */
:root {
    /* Brand Colors - Sophicly Specific */
    --spl-primary: #5333ed;
    --spl-primary-dark: #2c003e;
    --spl-accent: #51dacf;
    --spl-accent-light: #7DF9E9;
    --spl-accent-pale: #d2fafb;
    --spl-blue: #4D76FD;
    --spl-blue-light: #42A1EC;
    --spl-success: #1CD991;
    --spl-warning: #ffc108;
    
    /* Sidebar (light mode) */
    --spl-sidebar-bg: #f7f9fa;
    --spl-sidebar-hover: #eef1f3;
    --spl-sidebar-active: #e4e8eb;
    --spl-sidebar-text: #1c1d1f;
    --spl-sidebar-muted: #6a6f73;
    --spl-sidebar-border: #e4e8eb;
    
    /* Content (light mode) */
    --spl-bg: #ffffff;
    --spl-bg-alt: #f7f9fa;
    --spl-text: #1c1d1f;
    --spl-text-muted: #6a6f73;
    --spl-border: #e4e8eb;
    
    /* Header */
    --spl-header-bg: #ffffff;
    --spl-header-border: #e4e8eb;
    
    /* Sizes */
    --spl-sidebar-width: 320px;
    --spl-header-height: 60px;
    --spl-radius: 8px;
    --spl-radius-sm: 4px;
    
    /* Fonts */
    --spl-font-body: 'Proxima Soft Complete', -apple-system, BlinkMacSystemFont, sans-serif;
    --spl-font-heading: 'Proxima Soft Complete', -apple-system, BlinkMacSystemFont, sans-serif;
    --spl-font-accent: 'Playfair Display Complete', Georgia, serif;
}

/* ============================================================
   DARK MODE VARIABLES
   Uses [data-theme="dark"] set on <html> by global theme toggle JS
   ============================================================ */
html[data-theme="dark"] {
    /* Sidebar (dark mode) — warm charcoal palette */
    --spl-sidebar-bg: #22282A;
    --spl-sidebar-hover: #2E3436;
    --spl-sidebar-active: #383E40;
    --spl-sidebar-text: #ffffff;
    --spl-sidebar-muted: #9da5b4;
    --spl-sidebar-border: #383E40;

    /* Content (dark mode) — warm charcoal palette */
    --spl-bg: #22282A;
    --spl-bg-alt: #2E3436;
    --spl-text: #ffffff;
    --spl-text-muted: #9da5b4;
    --spl-border: #383E40;

    /* Header (dark mode) — warm charcoal palette */
    --spl-header-bg: #22282A;
    --spl-header-border: #383E40;
}

/* ============================================================
   FOUC FIX - Hide elements initially for cinematic animation
   Using visibility:hidden + opacity:0 for GSAP autoAlpha
   SCOPED to :not(.is-loaded) so SPA navigation works after first load
   ============================================================ */
.spl:not(.is-loaded) .spl-header-left,
.spl:not(.is-loaded) .spl-header-center,
.spl:not(.is-loaded) .spl-header-right {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
}

.spl:not(.is-loaded) .spl-sidebar-header,
.spl:not(.is-loaded) .spl-sidebar-search,
.spl:not(.is-loaded) .spl-sidebar-progress-merged,
.spl:not(.is-loaded) .spl-metrics-row,
.spl:not(.is-loaded) .spl-nav {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-15px);
}

.spl:not(.is-loaded) .spl-content-header {
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
}

.spl:not(.is-loaded) .spl-entry > * {
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
}

.spl:not(.is-loaded) .spl-unit-content-list,
.spl:not(.is-loaded) .spl-footer {
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
}

/* Sidebar and main start transparent for cinematic background fade */
.spl:not(.is-loaded) .spl-sidebar,
.spl:not(.is-loaded) .spl-main {
    background-color: transparent !important;
}

/* Only apply theme backgrounds after loaded */
.spl.is-loaded .spl-sidebar {
    background-color: var(--spl-sidebar-bg) !important;
}

.spl.is-loaded .spl-main {
    background-color: var(--spl-bg) !important;
}

/* ============================================================
   RESET & HIDE THEME ELEMENTS
   ============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Aggressively hide theme header/footer */
body.sophicly-focus-mode #masthead,
body.sophicly-focus-mode .site-header,
body.sophicly-focus-mode header.site-header,
body.sophicly-focus-mode .etch-header,
body.sophicly-focus-mode #etch-header,
body.sophicly-focus-mode .header,
body.sophicly-focus-mode #colophon,
body.sophicly-focus-mode .site-footer,
body.sophicly-focus-mode footer.site-footer,
body.sophicly-focus-mode .etch-footer,
body.sophicly-focus-mode #etch-footer,
body.sophicly-focus-mode .footer,
body.sophicly-focus-mode .site-branding,
body.sophicly-focus-mode .main-navigation {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Admin bar support */
body.sophicly-focus-mode.admin-bar .spl-header {
    top: 32px;
}

body.sophicly-focus-mode.admin-bar .spl-sidebar {
    top: calc(var(--spl-header-height) + 32px);
    height: calc(100vh - var(--spl-header-height) - 32px);
}

@media screen and (max-width: 782px) {
    body.sophicly-focus-mode.admin-bar .spl-header {
        top: 46px;
    }
    body.sophicly-focus-mode.admin-bar .spl-sidebar {
        top: calc(var(--spl-header-height) + 46px);
        height: calc(100vh - var(--spl-header-height) - 46px);
    }
}

body.sophicly-focus-mode {
    margin: 0 !important;
    padding: 0 !important;
    /*background: var(--spl-bg) !important;*/
    font-family: var(--spl-font-body);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

html.spl-no-scroll {
    overflow: hidden;
}

/* ============================================================
   MAIN LAYOUT
   ============================================================ */
.spl {
    min-height: 100vh;
    background: var(--spl-bg);
    color: var(--spl-text);
}

.spl-body {
    min-height: calc(100vh - var(--spl-header-height));
}

/* ============================================================
   HEADER - FIXED
   ============================================================ */
.spl-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--spl-header-height);
    background: var(--spl-header-bg);
    border-bottom: 1px solid var(--spl-header-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15), 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 1000;
    gap: 16px;
}

/* Magic Glow Loading Effect */
.spl-header::before {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: inherit;
    background: transparent;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.8s ease-out, box-shadow 0.8s ease-out;
    pointer-events: none;
    box-shadow: 
        0 0 20px rgba(66, 161, 236, 0),
        0 0 40px rgba(77, 118, 253, 0),
        0 0 60px rgba(125, 249, 233, 0),
        inset 0 0 20px rgba(66, 161, 236, 0);
}

.spl-header.is-loading::before {
    opacity: 1;
    transition: opacity 0.3s ease-in, box-shadow 0.3s ease-in;
    box-shadow: 
        0 0 20px rgba(66, 161, 236, 0.4),
        0 0 40px rgba(77, 118, 253, 0.25),
        0 0 60px rgba(125, 249, 233, 0.15),
        inset 0 0 30px rgba(81, 218, 207, 0.1);
    animation: spl-glow-pulse 2s ease-in-out infinite;
}

/* Header left */
.spl-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

/* Mobile header alignment — consistent vertical center + spacing */
@media (max-width: 1024px) {
    .spl-header {
        padding: 0 12px;
        gap: 10px;
    }
    .spl-header-left {
        gap: 10px;
    }
    .spl-header-right {
        gap: 6px;
    }
    /* Shrink hamburger hit area to match visual button height */
    .spl-hamburger {
        width: auto;
        height: 36px;
        display: flex;
        align-items: center;
    }
    .spl-hamburger__link {
        height: 36px;
    }
}

/* ═══════════════════════════════════════════════════════════════
   HAMBURGER TRIGGER (replaces spl-sidebar-toggle)
   ═══════════════════════════════════════════════════════════════ */
.spl-hamburger {
    display: none;
    position: relative;
    width: 68px;
    height: 50px;
    flex-shrink: 0;
}

@media (max-width: 1024px) {
    .spl-hamburger {
        display: block;
    }
}

.spl-hamburger__link {
    display: block;
    width: 100%;
    height: 100%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none !important;
}

.spl-hamburger__link:hover,
.spl-hamburger__link:focus {
    text-decoration: none !important;
    outline: none;
}

.spl-hamburger__link:focus-visible {
    outline: 2px solid #7DF9E9;
    outline-offset: 4px;
    border-radius: 4px;
}

.spl-hamburger__icon {
    position: relative;
    height: 100%;
    width: 100%;
    top: 8px;
}

.spl-hamburger__bar {
    display: block !important;
    position: relative !important;
    left: 10px !important;
    width: 25px !important;
    height: 4px !important;
    background-color: #fff !important;
    border-radius: 0 !important;
    transition: none !important;
}

.spl-hamburger__bar--1 { top: 3px !important; }
.spl-hamburger__bar--2 { top: 9px !important; }
.spl-hamburger__bar--3 { top: 15px !important; }

.spl-hamburger__close-text {
    position: absolute;
    top: 15px;
    left: 5px;
    font-family: "proxima-soft", "Proxima Soft Complete", sans-serif;
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: none !important;
}



/* Light theme: black bars + close text */
html:not([data-theme="dark"]) .spl-hamburger__bar {
    background-color: #333 !important;
}
html:not([data-theme="dark"]) .spl-hamburger__close-text {
    color: #333;
}

@media (prefers-reduced-motion: reduce) {
    .spl-hamburger__bar,
    .spl-hamburger__close-text {
        transition: opacity 0.01ms !important;
    }
}

.spl-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.spl-logo img {
    width: 28px;
    height: auto;
    display: block;
}

.spl-logo-light {
    display: block;
}

.spl-logo-dark {
    display: none;
}

html[data-theme="dark"] .spl-logo-light {
    display: none;
}

html[data-theme="dark"] .spl-logo-dark {
    display: block;
}

/* Header Center - Breadcrumb */
.spl-header-center {
    flex: 1;
    min-width: 0;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.spl-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    max-width: 100%;
    overflow: hidden;
}

.spl-breadcrumb-link {
    font-family: var(--spl-font-accent);
    font-style: italic;
    color: var(--spl-text-muted);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

.spl-breadcrumb-link:hover {
    color: var(--spl-primary);
}

.spl-breadcrumb-sep {
    color: var(--spl-text-muted);
    flex-shrink: 0;
}

.spl-breadcrumb-current {
    font-family: var(--spl-font-body);
    color: var(--spl-text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

@media (max-width: 900px) {
    .spl-header-center {
        display: none;
    }
}

/* Header Right */
.spl-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Theme Toggle */
.spl-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--spl-bg-alt);
    border: 1px solid var(--spl-border);
    border-radius: 50%;
    cursor: pointer;
    color: var(--spl-text);
    transition: all 0.2s;
}

.spl-theme-toggle:hover {
    background: var(--spl-border);
}

.spl-icon-sun {
    display: none;
}

.spl-icon-moon {
    display: block;
}

.spl.spl-dark .spl-icon-sun {
    display: block;
}

.spl.spl-dark .spl-icon-moon {
    display: none;
}

/* Nav Arrows */
.spl-nav-arrows {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Maximize Button (desktop only) */
.spl-maximize-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    --btn-inner: hsla(252deg 20% 24% / 60%);
    --btn-outer: hsla(252deg 20% 18% / 50%);
    --btn-glow: hsla(252deg 70% 60% / 0%);
    background: radial-gradient(ellipse at 50% 10%, var(--btn-glow), transparent),
                radial-gradient(var(--btn-inner), var(--btn-outer));
    box-shadow:
        inset 0 4px 1px -3px rgba(255,255,255,0.1),
        inset 0 4px 8px 5px rgba(9,11,10,0.16),
        0 2px 0 1px #1a1e1c,
        0 2px 0 3px rgba(0,0,0,0.9),
        0 2px 0 4px rgba(255,255,255,0.04);
    cursor: pointer;
    color: var(--spl-header-text);
    transition: all 0.2s;
}

@media (max-width: 768px) {
    .spl-maximize-btn {
        display: none;
    }
}

.spl-maximize-btn:hover {
    --btn-glow: hsla(252deg 70% 65% / 25%);
    --btn-inner: hsla(252deg 55% 40% / 100%);
    --btn-outer: hsla(252deg 60% 35% / 100%);
    color: #fff;
    transform: translateY(-1px);
}
.spl-maximize-btn:active { transform: translateY(1px); }

html:not([data-theme="dark"]) .spl-maximize-btn {
    background: radial-gradient(ellipse at 50% 10%, rgba(77, 118, 253, 0), transparent), radial-gradient(#ECF3FF, #e0ebff);
    color: #4D76FD;
    border: none;
    box-shadow: inset 0 3px 1px -2px rgba(255, 255, 255, 0.8), inset 0 3px 6px 4px rgba(77, 118, 253, 0.08), 0 2px 0 1px #c8d4f0, 0 2px 0 2px rgba(77, 118, 253, 0.15), 0 2px 0 3px rgba(255, 255, 255, 0.4);
}
html:not([data-theme="dark"]) .spl-maximize-btn:hover {
    background: radial-gradient(ellipse at 50% 10%, rgba(77, 118, 253, 0.15), transparent), radial-gradient(#4D76FD, #3d5fd4);
    color: #fff;
    box-shadow: inset 0 -1px 2px rgba(255,255,255,0.3), inset 0 0 12px rgba(77, 118, 253, 0.15), 0 2px 0 1px rgba(77, 118, 253, 0.5), 0 2px 8px rgba(77, 118, 253, 0.25), 0 2px 0 3px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Maximized state */
.spl.is-maximized .spl-sidebar {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
}

.spl.is-maximized .spl-body {
    grid-template-columns: 1fr;
}

.spl.is-maximized .spl-main {
    margin-left: 0;
}

.spl.is-maximized .spl-content {
    max-width: 1200px;
    margin: 0 auto;
}

.spl-header-badge {
    display: none;
}

.spl-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    --btn-inner: hsla(252deg 20% 24% / 60%);
    --btn-outer: hsla(252deg 20% 18% / 50%);
    --btn-glow: hsla(252deg 70% 60% / 0%);
    background: radial-gradient(ellipse at 50% 10%, var(--btn-glow), transparent),
                radial-gradient(var(--btn-inner), var(--btn-outer));
    box-shadow:
        inset 0 4px 1px -3px rgba(255,255,255,0.1),
        inset 0 4px 8px 5px rgba(9,11,10,0.16),
        0 2px 0 1px #1a1e1c,
        0 2px 0 3px rgba(0,0,0,0.9),
        0 2px 0 4px rgba(255,255,255,0.04);
    color: var(--spl-text);
    text-decoration: none;
    transition: all 0.2s;
}

.spl-nav-btn:hover {
    --btn-glow: hsla(252deg 70% 65% / 25%);
    --btn-inner: hsla(252deg 55% 40% / 100%);
    --btn-outer: hsla(252deg 60% 35% / 100%);
    color: #fff;
    box-shadow:
        inset 0 -1px 2px rgba(255,255,255,0.2),
        inset 0 0 10px rgba(83,51,237,0.15),
        0 1px 0 1px rgba(83,51,237,0.5),
        0 2px 8px rgba(83,51,237,0.2);
    transform: translateY(-1px);
}
.spl-nav-btn:active { transform: translateY(1px); }

/* Light mode buttons — gold standard neumorphic blue */
html:not([data-theme="dark"]) .spl-nav-btn {
    background: radial-gradient(ellipse at 50% 10%, rgba(77, 118, 253, 0), transparent), radial-gradient(#ECF3FF, #e0ebff);
    color: #4D76FD;
    border: none;
    box-shadow: inset 0 3px 1px -2px rgba(255, 255, 255, 0.8), inset 0 3px 6px 4px rgba(77, 118, 253, 0.08), 0 2px 0 1px #c8d4f0, 0 2px 0 2px rgba(77, 118, 253, 0.15), 0 2px 0 3px rgba(255, 255, 255, 0.4);
}
html:not([data-theme="dark"]) .spl-nav-btn:hover {
    background: radial-gradient(ellipse at 50% 10%, rgba(77, 118, 253, 0.15), transparent), radial-gradient(#4D76FD, #3d5fd4);
    color: #fff;
    box-shadow: inset 0 -1px 2px rgba(255,255,255,0.3), inset 0 0 12px rgba(77, 118, 253, 0.15), 0 2px 0 1px rgba(77, 118, 253, 0.5), 0 2px 8px rgba(77, 118, 253, 0.25), 0 2px 0 3px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.spl-nav-btn.is-disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* User Dropdown */
.spl-user-dropdown {
    position: relative;
}

.spl-user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--spl-radius-sm);
    transition: background 0.2s;
}

.spl-user-trigger:hover {
    background: var(--spl-header-hover);
}

.spl-user-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--spl-text);
}

@media (max-width: 1024px) {
    .spl-user-name {
        display: none;
    }
}

/* Avatar wrapper */
.spl-user-avatar-wrapper {
    position: relative;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--spl-border);
    flex-shrink: 0;
}

.spl-user-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: none;
}

/* Initials fallback */
.spl-user-initials {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--spl-font-body);
    font-size: 13px;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--spl-primary), var(--spl-blue));
    border-radius: 50%;
}

.spl-user-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 240px;
    background: var(--spl-bg);
    border: 1px solid var(--spl-border);
    border-radius: var(--spl-radius);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.spl-user-dropdown.is-open .spl-user-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.spl-user-menu-section {
    padding: 12px 0;
}

.spl-user-menu-section:not(:last-child) {
    border-bottom: 1px solid var(--spl-border);
}

.spl-user-menu-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--spl-text-muted);
    padding: 0 16px 8px;
}

.spl-user-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    color: var(--spl-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.spl-user-menu-link:hover {
    background: var(--spl-bg-alt);
}

.spl-user-menu-link svg {
    width: 18px;
    height: 18px;
    opacity: 0.6;
}

.spl-user-menu-link:hover svg {
    opacity: 1;
}

.spl-user-menu-divider {
    height: 1px;
    background: var(--spl-border);
    margin: 4px 0;
}

.spl-user-menu-link.spl-logout {
    color: #e53935;
}

.spl-user-menu-link.spl-logout:hover {
    background: rgba(229, 57, 53, 0.1);
}

/* Missed Lessons Notification */
.spl-missed-notification {
    position: relative;
}

.spl-missed-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    --btn-inner: hsla(252deg 20% 24% / 60%);
    --btn-outer: hsla(252deg 20% 18% / 50%);
    --btn-glow: hsla(252deg 70% 60% / 0%);
    background: radial-gradient(ellipse at 50% 10%, var(--btn-glow), transparent),
                radial-gradient(var(--btn-inner), var(--btn-outer));
    box-shadow:
        inset 0 4px 1px -3px rgba(255,255,255,0.1),
        inset 0 4px 8px 5px rgba(9,11,10,0.16),
        0 2px 0 1px #1a1e1c,
        0 2px 0 3px rgba(0,0,0,0.9),
        0 2px 0 4px rgba(255,255,255,0.04);
    border-radius: 8px;
    color: var(--spl-text);
    cursor: pointer;
    transition: background 0.2s;
}

.spl-missed-trigger:hover {
    --btn-glow: hsla(252deg 70% 65% / 25%);
    --btn-inner: hsla(252deg 55% 40% / 100%);
    --btn-outer: hsla(252deg 60% 35% / 100%);
    color: #fff;
    transform: translateY(-1px);
}

html:not([data-theme="dark"]) .spl-missed-trigger {
    background: radial-gradient(ellipse at 50% 10%, rgba(77, 118, 253, 0), transparent), radial-gradient(#ECF3FF, #e0ebff);
    color: #4D76FD;
    border: none;
    box-shadow: inset 0 3px 1px -2px rgba(255, 255, 255, 0.8), inset 0 3px 6px 4px rgba(77, 118, 253, 0.08), 0 2px 0 1px #c8d4f0, 0 2px 0 2px rgba(77, 118, 253, 0.15), 0 2px 0 3px rgba(255, 255, 255, 0.4);
}
html:not([data-theme="dark"]) .spl-missed-trigger:hover {
    background: radial-gradient(ellipse at 50% 10%, rgba(77, 118, 253, 0.15), transparent), radial-gradient(#4D76FD, #3d5fd4);
    color: #fff;
    box-shadow: inset 0 -1px 2px rgba(255,255,255,0.3), inset 0 0 12px rgba(77, 118, 253, 0.15), 0 2px 0 1px rgba(77, 118, 253, 0.5), 0 2px 8px rgba(77, 118, 253, 0.25), 0 2px 0 3px rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.spl-missed-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border-radius: 8px;
}

.spl-missed-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 320px;
    background: var(--spl-bg);
    border: 1px solid var(--spl-border);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    z-index: 1000;
    overflow: hidden;
}

.spl-missed-notification.is-open .spl-missed-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.spl-missed-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--spl-warning);
    border-bottom: 1px solid var(--spl-border);
}

.spl-missed-header svg {
    color: var(--spl-warning);
}

.spl-missed-header.is-empty {
    color: var(--spl-success);
}

.spl-missed-header.is-empty svg {
    color: var(--spl-success);
}

.spl-missed-desc {
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--spl-text-muted);
    background: var(--spl-bg-alt);
}

.spl-missed-list {
    max-height: 240px;
    overflow-y: auto;
}

.spl-missed-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    text-decoration: none;
    border-bottom: 1px solid var(--spl-border);
    transition: background 0.2s;
}

.spl-missed-item:hover {
    background: var(--spl-bg-alt);
}

.spl-missed-item:last-child {
    border-bottom: none;
}

.spl-missed-type {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--spl-warning);
}

.spl-missed-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--spl-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spl-missed-more {
    padding: 12px 16px;
    font-size: 12px;
    color: var(--spl-text-muted);
    text-align: center;
    background: var(--spl-bg-alt);
}

@media (max-width: 480px) {
    .spl-missed-menu {
        width: 280px;
        right: -40px;
    }
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.spl-sidebar {
    position: fixed;
    top: var(--spl-header-height);
    left: 0;
    bottom: 0;
    width: var(--spl-sidebar-width);
    background: var(--spl-sidebar-bg);
    color: var(--spl-sidebar-text);
    border-right: none;
    box-shadow: 4px 0 12px rgba(0,0,0,0.1), 2px 0 4px rgba(0,0,0,0.06);
    display: flex;
    flex-direction: column;
    z-index: 900;
    overflow: visible;
    transform: translateX(0);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

@media (max-width: 1024px) {
    .spl-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .spl-sidebar.is-open {
        transform: translateX(0);
    }
}

/* Sidebar Header - Purple gradient */
.spl-sidebar-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-bottom: 1px solid var(--spl-sidebar-border);
    background: linear-gradient(45deg, var(--spl-primary) 0%, var(--spl-primary-dark) 100%);
    position: relative;
}

/* White text in sidebar header for both themes */
.spl-course-label {
    color: rgba(255,255,255,0.7) !important;
}
.spl-course-title {
    color: #fff !important;
}

.spl-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    flex-shrink: 0;
    --btn-inner: hsla(252deg 20% 24% / 60%);
    --btn-outer: hsla(252deg 20% 18% / 50%);
    --btn-glow: hsla(252deg 70% 60% / 0%);
    background: radial-gradient(ellipse at 50% 10%, var(--btn-glow), transparent),
                radial-gradient(var(--btn-inner), var(--btn-outer));
    box-shadow:
        inset 0 4px 1px -3px rgba(255,255,255,0.1),
        inset 0 4px 8px 5px rgba(9,11,10,0.16),
        0 2px 0 1px #1a1e1c,
        0 2px 0 3px rgba(0,0,0,0.9),
        0 2px 0 4px rgba(255,255,255,0.04);
    transition: all 0.2s;
}

.spl-back-btn:hover {
    --btn-glow: hsla(252deg 70% 65% / 25%);
    --btn-inner: hsla(252deg 55% 40% / 100%);
    --btn-outer: hsla(252deg 60% 35% / 100%);
    color: #fff;
    transform: translateY(-1px);
}
.spl-back-btn:active { transform: translateY(1px); }

.spl-course-info {
    flex: 1;
    min-width: 0;
}

.spl-course-label {
    display: block;
    font-family: var(--spl-font-accent);
    font-size: 12px;
    font-style: italic;
    letter-spacing: 0.3px;
    color: var(--spl-sidebar-muted);
    margin-bottom: 4px;
}

.spl-course-title {
    font-family: var(--spl-font-heading);
    font-size: 25px;
    font-weight: 700;
    line-height: 1.1;
    margin: 0;
    color: var(--spl-sidebar-text);
}

/* Sidebar Search */
.spl-sidebar-search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px;
    padding: 10px 14px;
    background: var(--spl-sidebar-hover);
    border-radius: var(--spl-radius);
    border: 1px solid transparent;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.spl-sidebar-search:focus-within {
    border-color: var(--spl-primary);
    box-shadow: 0 0 0 3px rgba(83, 51, 237, 0.15);
}

.spl-sidebar-search svg {
    color: var(--spl-sidebar-muted);
    flex-shrink: 0;
}

.spl-sidebar-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--spl-sidebar-text);
    font-family: var(--spl-font-body);
    font-size: 14px;
}

.spl-sidebar-search input::placeholder {
    color: var(--spl-sidebar-muted);
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR PROGRESS GRID (relocated from content area)
   ═══════════════════════════════════════════════════════════════ */
/* ═══════════════════════════════════════════════════════════════
   SIDEBAR: Course + Unit progress — single merged row
   ═══════════════════════════════════════════════════════════════ */
.spl-sidebar-progress-merged {
    display: flex;
    border-bottom: 1px solid var(--spl-sidebar-border);
    overflow: visible;
    position: relative;
    z-index: 2;
}

.spl-progress-cell {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 10px;
    cursor: pointer;
    position: relative;
    z-index: 1;
    border-radius: 0;
    border: 2px solid transparent;
    transition: transform 250ms ease-in-out,
                box-shadow 250ms ease-in-out,
                background 250ms ease-in-out,
                border-color 250ms ease-in-out,
                border-radius 250ms ease-in-out;
}

/* Disney+ hover: scale up, shadow, border brightens, corners round */
@media (hover: hover) {
    .spl-progress-cell:hover {
        transform: scale(1.14);
        z-index: 10;
        border-radius: 8px;
        box-shadow: rgba(0, 0, 0, 0.69) 0px 26px 30px -10px,
                    rgba(0, 0, 0, 0.73) 0px 16px 10px -10px;
        background: rgba(0,0,0,0.06);
        border-color: rgba(249, 249, 249, 0.6);
    }
    html[data-theme="dark"] .spl-progress-cell:hover {
        background: rgba(255,255,255,0.14);
    }
    /* Light theme: darker border */
    html[data-theme="light"] .spl-progress-cell:hover {
        border-color: rgba(0, 0, 0, 0.15);
    }
    /* Brighten the label and detail text on hover */
    .spl-progress-cell:hover .spl-progress-cell-label,
    .spl-progress-cell:hover .spl-progress-cell-detail {
        color: var(--spl-sidebar-text, #1a1a1e);
    }
    html[data-theme="dark"] .spl-progress-cell:hover .spl-progress-cell-label,
    html[data-theme="dark"] .spl-progress-cell:hover .spl-progress-cell-detail {
        color: #f0f0f2;
    }
}

.spl-progress-cell--course,
.spl-progress-cell--unit {
    border-right: 1px solid var(--spl-sidebar-border);
}

.spl-progress-cell--unit {
    background: rgba(255,255,255,0.02);
}

.spl-progress-cell--lesson {
    background: rgba(255,255,255,0.04);
}

html[data-theme="dark"] .spl-progress-cell--unit {
    background: rgba(255,255,255,0.03);
}

html[data-theme="dark"] .spl-progress-cell--lesson {
    background: rgba(255,255,255,0.05);
}

.spl-progress-cell-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--spl-sidebar-muted);
}

.spl-progress-cell-detail {
    font-family: 'Playfair Display Complete', 'Playfair Display', serif;
    font-style: italic;
    font-size: 11px;
    font-weight: 500;
    color: var(--spl-sidebar-muted);
}

/* Trophy in sidebar — 44px, ring on edge */
.spl-sidebar-progress-merged .spl-trophy-progress {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    max-width: 44px;
    max-height: 44px;
}

.spl-sidebar-progress-merged .spl-trophy-ring {
    width: 44px;
    height: 44px;
}

.spl-sidebar-progress-merged .spl-trophy-icon {
    width: 20px;
    height: 20px;
}

.spl-sidebar-progress-merged .spl-trophy-icon svg {
    width: 20px;
    height: 20px;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR: Process Score + Deadline — compact split row
   ═══════════════════════════════════════════════════════════════ */

.spl-metrics-row {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--spl-sidebar-border);
    overflow: visible;
    position: relative;
    z-index: 2;
}

.spl-metric {
    flex: 1;
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    z-index: 1;
    border-radius: 0;
    border: 2px solid transparent;
    transition: transform 250ms ease-in-out,
                box-shadow 250ms ease-in-out,
                background 250ms ease-in-out,
                border-color 250ms ease-in-out,
                border-radius 250ms ease-in-out;
    gap: 6px;
    padding: 8px 10px;
}

.spl-metric--score {
    border-right: 1px solid var(--spl-sidebar-border);
}

/* Disney+ hover for metric cells */
@media (hover: hover) {
    .spl-metric:hover {
        transform: scale(1.14);
        z-index: 10;
        border-radius: 8px;
        box-shadow: rgba(0, 0, 0, 0.69) 0px 26px 30px -10px,
                    rgba(0, 0, 0, 0.73) 0px 16px 10px -10px;
        background: rgba(0,0,0,0.06);
        border-color: rgba(249, 249, 249, 0.6);
    }
    html[data-theme="dark"] .spl-metric:hover {
        background: rgba(255,255,255,0.14);
    }
    html[data-theme="light"] .spl-metric:hover {
        border-color: rgba(0, 0, 0, 0.15);
    }
    .spl-metric:hover .spl-metric-label,
    .spl-metric:hover .spl-metric-icon {
        color: var(--spl-sidebar-text, #1a1a1e);
    }
    html[data-theme="dark"] .spl-metric:hover .spl-metric-label,
    html[data-theme="dark"] .spl-metric:hover .spl-metric-icon {
        color: #f0f0f2;
    }
}

/* Deadline stacks vertically: icon + value top, bar + label bottom */
.spl-metric--deadline {
    flex-wrap: wrap;
    gap: 4px 6px;
    padding: 6px 10px;
}

.spl-metric-icon {
    color: var(--spl-sidebar-muted);
    flex-shrink: 0;
}

.spl-metric-label {
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--spl-sidebar-muted);
    white-space: nowrap;
}

/* ─── Mini Process Score Ring ───────────────────────────────── */

.spl-metric-ring {
    position: relative;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
}

.spl-metric-ring svg {
    display: block;
}

html[data-theme="light"] .spl-metric-ring svg circle:first-child {
    stroke: rgba(0, 0, 0, 0.08);
}

.spl-metric-ring-fill {
    stroke: url(#trophy-ring-gradient);
    transition: stroke-dashoffset 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.spl-metric-ring-fill.is-excellent { stroke: #5333ed; }
.spl-metric-ring-fill.is-great { stroke: #4a7bf7; }
.spl-metric-ring-fill.is-good { stroke: #51dacf; }
.spl-metric-ring-fill.is-ok { stroke: #1CD991; }
.spl-metric-ring-fill.is-warning { stroke: #F5A623; }
.spl-metric-ring-fill.is-danger { stroke: #CC2244; }

.spl-metric-ring-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Playfair Display Complete', 'Playfair Display', serif;
    font-style: italic;
    font-size: 10px;
    font-weight: 600;
    color: var(--spl-sidebar-muted);
    transition: color 0.6s ease;
    line-height: 1;
    text-align: center;
}

/* Score value colour tiers — applied to ring-value */
.spl-metric-ring-value.is-excellent { color: #5333ed; }
.spl-metric-ring-value.is-great { color: #4a7bf7; }
.spl-metric-ring-value.is-good { color: #51dacf; }
.spl-metric-ring-value.is-ok { color: #1CD991; }
.spl-metric-ring-value.is-warning { color: #F5A623; }
.spl-metric-ring-value.is-danger { color: #CC2244; }

/* ─── Deadline value + bar ─────────────────────────────────── */

.spl-metric--deadline .spl-metric-value {
    font-family: 'Playfair Display Complete', 'Playfair Display', serif;
    font-style: italic;
    font-size: 12px;
    font-weight: 600;
    color: var(--spl-sidebar-muted);
    transition: color 0.6s ease;
    white-space: nowrap;
}

.spl-metric-value.is-plenty { color: #51dacf; }
.spl-metric-value.is-moderate { color: #F1C40F; }
.spl-metric-value.is-urgent { color: #E67E22; }
.spl-metric-value.is-overdue { color: #CC2244; }

.spl-metric-deadline-bar {
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

html[data-theme="light"] .spl-metric-deadline-bar {
    background: rgba(0, 0, 0, 0.08);
}

.spl-metric-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 1.2s cubic-bezier(0.23, 1, 0.32, 1);
}

.spl-metric-fill--deadline {
    background: linear-gradient(270deg, #51dacf, #42A1EC, #4D76FD, #42A1EC);
    background-size: 800% 800%;
    animation: AnimationName 20s ease infinite;
}

.spl-metric-fill--deadline.is-moderate {
    background: linear-gradient(90deg, #F1C40F, #E67E22);
}

.spl-metric-fill--deadline.is-urgent {
    background: linear-gradient(90deg, #E67E22, #CC2244);
}

.spl-metric-fill--deadline.is-overdue {
    background: #CC2244;
}

/* Loading state */
.spl-metric.is-loading .spl-metric-ring-value,
.spl-metric.is-loading .spl-metric-value {
    opacity: 0.3;
}

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR: Search trigger icon + modal
   ═══════════════════════════════════════════════════════════════ */
.spl-search-trigger {
    position: absolute;
    top: 16px;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--spl-sidebar-muted);
    border-radius: var(--spl-radius-sm);
    transition: color 0.2s, background 0.2s;
    z-index: 2;
}

.spl-search-trigger:hover {
    color: var(--spl-primary);
    background: var(--spl-sidebar-hover);
}

.spl-search-modal {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: var(--spl-sidebar-bg);
    border-bottom: 1px solid var(--spl-sidebar-border);
    padding: 12px 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.spl-search-modal.is-open {
    display: block;
}

.spl-search-modal-inner {
    display: flex;
    align-items: center;
    gap: 8px;
}

.spl-search-input {
    flex: 1;
    background: var(--spl-sidebar-hover);
    border: 1px solid transparent;
    border-radius: var(--spl-radius);
    padding: 10px 14px;
    color: var(--spl-sidebar-text);
    font-family: var(--spl-font-body);
    font-size: 14px;
    outline: none;
}

.spl-search-input:focus {
    border-color: var(--spl-primary);
    box-shadow: 0 0 0 3px rgba(83, 51, 237, 0.15);
}

.spl-search-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--spl-sidebar-muted);
    border-radius: var(--spl-radius-sm);
}

.spl-search-close:hover {
    color: var(--spl-primary);
    background: var(--spl-sidebar-hover);
}

.spl-progress-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.spl-progress-label {
    font-size: 13px;
    font-weight: 500;
}

.spl-progress-count {
    font-size: 13px;
    color: var(--spl-sidebar-muted);
}

.spl-progress-track {
    height: 4px;
    background: var(--spl-sidebar-active);
    border-radius: 2px;
    overflow: hidden;
}

.spl-progress-fill {
    height: 100%;
    border-radius: 2px;
}

/* Progress fill status colors - using Sophicly brand */
.spl-progress-fill.is-not-started {
    background: var(--spl-warning);
}

.spl-progress-fill.is-in-progress {
    background: linear-gradient(270deg, var(--spl-blue-light), var(--spl-blue), var(--spl-accent-light), var(--spl-blue));
    background-size: 800% 800%;
    animation: AnimationName 20s ease infinite;
}

.spl-progress-fill.is-complete {
    background: var(--spl-success);
}

/* ═══════════════════════════════════════════════════════════════
   MOBILE PROGRESS STRIP (visible when sidebar hidden)
   ═══════════════════════════════════════════════════════════════ */
/* Mobile footer removed — progress now shown in sidebar 3-column row */

/* Navigation */
.spl-nav {
    flex: 1;
    overflow-y: scroll;
    padding: 8px 0;
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
}

.spl-lessons-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Section Headers */
.spl-section {
    list-style: none;
}

.spl-section-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(83, 51, 237, 0.1) 0%, transparent 100%);
    border: none;
    border-left: 3px solid var(--spl-primary);
    cursor: pointer;
    color: var(--spl-sidebar-text);
    font-family: var(--spl-font-body);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    transition: background 0.2s;
}

html[data-theme="dark"] .spl-section-btn {
    background: linear-gradient(90deg, rgba(83, 51, 237, 0.2) 0%, transparent 100%);
}

.spl-section-btn:hover {
    background: linear-gradient(90deg, rgba(83, 51, 237, 0.2) 0%, transparent 100%);
}

html[data-theme="dark"] .spl-section-btn:hover {
    background: linear-gradient(90deg, rgba(83, 51, 237, 0.3) 0%, transparent 100%);
}

/* Plus icon for accordion */
.spl-section-icon {
    font-size: 20px;
    font-weight: 300;
    font-family: var(--spl-font-body);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
    transform-origin: center;
}

.spl-section-btn[aria-expanded="true"] .spl-section-icon {
    transform: rotate(45deg);
    color: var(--spl-accent);
}

.spl-section-btn[aria-expanded="false"] .spl-section-icon {
    transform: rotate(0deg);
}

/* Lesson Items */
.spl-lesson {
    list-style: none;
}

.spl-lesson.is-hidden {
    display: none;
}

.spl-lesson-row {
    display: flex;
    align-items: flex-start;
    position: relative;
}

/* Active indicator - Purple gradient */
.spl-lesson > .spl-lesson-row::before,
.spl-topic::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, var(--spl-primary), var(--spl-accent));
    opacity: 0;
    transform: scaleY(0);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.spl-lesson.is-active > .spl-lesson-row::before,
.spl-topic.is-active::before {
    opacity: 1;
    transform: scaleY(1);
}

.spl-lesson.is-active > .spl-lesson-row {
    background: linear-gradient(90deg, rgba(83, 51, 237, 0.1) 0%, transparent 100%);
}

html[data-theme="dark"] .spl-lesson.is-active > .spl-lesson-row {
    background: linear-gradient(90deg, rgba(83, 51, 237, 0.2) 0%, transparent 100%);
}

/* Active topic - animated gradient background */
.spl-topic.is-active {
    background: linear-gradient(270deg, var(--spl-blue-light), var(--spl-blue), var(--spl-accent-light), var(--spl-blue));
    background-size: 800% 800%;
    animation: AnimationName 20s ease infinite;
}

/* Expand button */
.spl-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 44px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--spl-sidebar-muted);
    padding: 0;
    flex-shrink: 0;
    margin-left: 8px;
    transition: color 0.2s;
}

.spl-expand:hover {
    color: var(--spl-primary);
}

/* Plus icon for expand */
.spl-expand-icon {
    font-size: 16px;
    font-weight: 300;
    font-family: var(--spl-font-body);
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.3s ease;
    transform-origin: center;
}

.spl-expand.is-open .spl-expand-icon {
    transform: rotate(45deg);
    color: var(--spl-accent);
}

.spl-expand:not(.is-open) .spl-expand-icon {
    transform: rotate(0deg);
}

/* Lesson Link */
.spl-lesson-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 12px 12px 4px;
    flex: 1;
    text-decoration: none;
    color: var(--spl-sidebar-text);
    min-width: 0;
    transition: background 0.2s, color 0.5s ease-out;
}

.spl-lesson:not(:has(.spl-expand)) .spl-lesson-link {
    padding-left: 40px;
}

.spl-lesson-row:hover {
    background: var(--spl-sidebar-hover);
}

.spl-lesson-row:hover .spl-lesson-title {
    color: var(--spl-blue);
}

/* Status */
.spl-status {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.spl-status-empty {
    width: 16px;
    height: 16px;
    border: 2px solid var(--spl-sidebar-muted);
    border-radius: 50%;
    transition: border-color 0.5s ease-out, background-color 0.5s ease-out;
}

.spl-topic.is-active .spl-status-empty {
    border-color: var(--spl-primary);
    box-shadow: 0 0 0 3px rgba(83, 51, 237, 0.2);
}

/* Lesson Text */
.spl-lesson-text {
    flex: 1;
    min-width: 0;
}

.spl-lesson-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.5s ease-out;
}

.spl-lesson-meta {
    display: block;
    font-family: 'Playfair Display Complete', 'Playfair Display', serif;
    font-style: italic;
    font-size: 12px;
    font-weight: 400;
    color: var(--spl-sidebar-muted);
    margin-top: 2px;
}

/* Topics */
.spl-topics {
    list-style: none;
    margin: 0;
    padding: 0;
    display: none;
    position: relative;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.5s ease-out, opacity 0.4s ease-out;
}

.spl-topics.is-open {
    display: block;
    max-height: 2000px;
    opacity: 1;
}

.spl-topic {
    position: relative;
    transition: background-color 0.5s ease-out;
}

/* ============================================================
   DUOLINGO-STYLE CONNECTING LINES
   ============================================================ */
.spl-topic:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 57px;
    width: 3px;
    border-radius: 1.5px;
    top: 32px;
    bottom: -12px;
    background: var(--spl-warning);
    z-index: 1;
    pointer-events: none;
}

/* If NEXT topic is complete, line is green */
.spl-topic:has(+ .spl-topic.is-complete)::after {
    background: var(--spl-success);
}

/* If NEXT topic is active/in-progress, line is animated */
.spl-topic:has(+ .spl-topic.is-active)::after {
    background: linear-gradient(180deg, var(--spl-blue-light), var(--spl-blue), var(--spl-accent-light), var(--spl-blue));
    background-size: 100% 800%;
    animation: AnimationName 20s ease infinite;
}

.spl-topic-link {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px 10px 48px;
    text-decoration: none;
    color: var(--spl-sidebar-text);
    transition: background 0.2s, color 0.5s ease-out;
    position: relative;
    z-index: 0;
}

.spl-topic.is-active .spl-topic-link {
    z-index: 2;
}

.spl-topic.is-active .spl-topic-title {
    color: #fff;
    transition: color 0.5s ease-out;
}

.spl-topic-link:hover {
    background: var(--spl-sidebar-hover);
}

.spl-topic-link:hover .spl-topic-title {
    color: var(--spl-blue);
}

.spl-topic-title {
    font-size: 14px;
    line-height: 1.4;
    transition: color 0.5s ease-out;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.spl-main {
    margin-left: var(--spl-sidebar-width);
    margin-top: var(--spl-header-height);
    min-height: calc(100vh - var(--spl-header-height));
    background: var(--spl-bg);
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr !important;
    transition: margin-left 0.3s ease;
}

.spl-main,
.spl-main * {
    writing-mode: horizontal-tb !important;
}

@media (max-width: 1024px) {
    .spl-main {
        margin-left: 0;
    }
}

.spl-content {
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 60px;
    box-sizing: border-box;
    display: block;
    transition: max-width 0.3s ease;
}

@media (max-width: 768px) {
    .spl-content {
        padding: 24px 20px;
    }
}

/* Content Header — REMOVED (progress grid relocated to sidebar) */
.spl-content-header {
    display: none !important;
}

/* Progress col label — reused in sidebar */
.spl-progress-col-label {
    font-family: var(--spl-font-accent);
    font-size: 13px;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.3px;
    color: var(--spl-text-muted);
    transition: color 0.3s ease;
}

/* Lesson Status Badge */
.spl-lesson-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    width: fit-content;
    transition: all 0.3s ease;
}

.spl-lesson-badge.is-not-started {
    background: var(--spl-warning);
    color: #1c1d1f;
}

.spl-lesson-badge.is-in-progress {
    background: linear-gradient(270deg, var(--spl-blue-light), var(--spl-blue), var(--spl-accent-light), var(--spl-blue));
    background-size: 800% 800%;
    color: #fff;
    animation: AnimationName 20s ease infinite;
}

.spl-lesson-badge.is-complete {
    background: var(--spl-success);
    color: #fff;
}

/* Unit progress bar wrap — kept for legacy/other uses */
.spl-unit-progress-bar-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* Trophy Progress Indicator */
/* Light theme: trophy gets visible grey background */
html:not([data-theme="dark"]) .spl-trophy-progress {
    background: #f0f0f5;
}

/* Light theme: no box shadows on sidebar/header */
html:not([data-theme="dark"]) .spl-header {
    box-shadow: none;
}
html:not([data-theme="dark"]) .spl-sidebar {
    box-shadow: none;
}

.spl-trophy-progress {
    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;
    max-width: 50px;
    max-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    flex-grow: 0;
    position: relative;
    background: var(--spl-bg-alt);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.spl-trophy-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 50px;
    height: 50px;
}

.spl-trophy-ring-fill {
    transition: stroke-dashoffset 0.8s cubic-bezier(0.23, 1, 0.32, 1),
                stroke 0.4s ease;
}

.spl-trophy-icon svg {
    transition: fill 0.4s ease;
}

.spl-trophy-ring-fill.is-not-started {
    stroke: var(--spl-warning);
}

.spl-trophy-ring-fill.is-in-progress {
    stroke: url(#trophy-ring-gradient);
}

.spl-trophy-ring-fill.is-complete {
    stroke: var(--spl-success);
}

.spl-trophy-icon {
    position: relative;
    z-index: 1;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spl-trophy-icon svg {
    width: 25px;
    height: 25px;
}

.spl-trophy-progress.is-not-started .spl-trophy-icon svg {
    fill: var(--spl-warning);
}

.spl-trophy-progress.is-in-progress .spl-trophy-icon svg {
    fill: url(#trophy-gradient-fill);
}

.spl-trophy-progress.is-complete .spl-trophy-icon svg {
    fill: var(--spl-success);
}

/* Legacy styles - hidden */
.spl-content-meta,
.spl-unit-progress-section,
.spl-status-badge {
    display: none;
}

/* Legacy grid breakpoint removed — progress grid now in sidebar */

/* Legacy label */
.spl-label {
    font-family: var(--spl-font-accent);
    font-size: 14px;
    font-weight: 400;
    font-style: italic;
    letter-spacing: 0.3px;
    color: var(--spl-text-muted);
    margin: 0 0 8px;
    display: none;
}

@media (max-width: 768px) {
    .spl-label {
        display: block;
    }
}

.spl-title {
    font-family: var(--spl-font-heading);
    font-size: 32px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--spl-text);
    margin: 0 0 16px;
    display: none;
    width: 100%;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

@media (max-width: 770px) {
    .spl-title {
        display: block;
        font-size: 28px;
    }
}

.spl-badge {
    display: none;
}

/* Unit Progress Bar */
.spl-unit-progress {
    margin: 0;
    max-width: 100%;
}

.spl-unit-progress-track {
    height: 4px;
    background: var(--spl-border);
    border-radius: 2px;
    overflow: hidden;
}

.spl-unit-progress-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.spl-unit-progress-fill.is-not-started {
    background: var(--spl-warning);
}

.spl-unit-progress-fill.is-in-progress {
    background: linear-gradient(270deg, var(--spl-blue-light), var(--spl-blue), var(--spl-accent-light), var(--spl-blue));
    background-size: 800% 800%;
    animation: AnimationName 20s ease infinite;
}

.spl-unit-progress-fill.is-complete {
    background: var(--spl-success);
}

.spl-unit-progress-percent {
    font-size: 11px;
    font-weight: 500;
    color: var(--spl-text-muted);
    transition: all 0.3s ease;
}

.spl-unit-progress-percent.is-not-started {
    color: var(--spl-warning);
}

.spl-unit-progress-percent.is-in-progress {
    background: linear-gradient(270deg, var(--spl-blue-light), var(--spl-blue), var(--spl-accent-light), var(--spl-blue));
    background-size: 800% 800%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: AnimationName 20s ease infinite;
}

.spl-unit-progress-percent.is-complete {
    color: var(--spl-success);
}

/* Unit Content List */
.spl-unit-content-list {
    margin: 40px 0;
    padding: 32px;
    border-radius: var(--spl-radius);
    background: var(--spl-bg-alt);
    border: 1px solid var(--spl-border);
    position: relative;
    overflow: hidden;
}

.spl-unit-content-list::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--spl-primary), var(--spl-blue), var(--spl-accent));
}

.spl-unit-content-title {
    font-family: var(--spl-font-heading);
    font-size: 20px;
    font-weight: 700;
    color: var(--spl-text);
    margin: 0 0 8px;
}

.spl-unit-content-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 14px;
    color: var(--spl-text-muted);
}

.spl-unit-content-progress,
.spl-unit-content-count {
    font-family: 'Playfair Display Complete', 'Playfair Display', serif;
    font-style: italic;
    font-weight: 600;
    color: var(--spl-primary);
}

.spl-unit-content-count {
    color: var(--spl-text-muted);
}

.spl-unit-topics-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.spl-unit-topic-item {
    border-radius: var(--spl-radius);
    transition: all 0.2s;
    background: var(--spl-bg);
    border: 1px solid transparent;
}

.spl-unit-topic-item:hover {
    border-color: var(--spl-primary);
    box-shadow: 0 2px 8px rgba(83, 51, 237, 0.1);
}

.spl-unit-topic-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    text-decoration: none;
    color: var(--spl-text);
}

.spl-unit-topic-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--spl-text-muted);
    min-width: 24px;
}

.spl-unit-topic-title {
    flex: 1;
    font-size: 15px;
    font-weight: 500;
}

.spl-unit-topic-item:hover .spl-unit-topic-title {
    color: var(--spl-primary);
}

.spl-unit-topic-item.is-complete .spl-unit-topic-title {
    color: var(--spl-text-muted);
}

.spl-unit-topic-status {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spl-unit-topic-circle {
    width: 20px;
    height: 20px;
    border: 2px solid var(--spl-border);
    border-radius: 50%;
    transition: border-color 0.2s;
}

.spl-unit-topic-item:hover .spl-unit-topic-circle {
    border-color: var(--spl-primary);
}

/* Entry Content */
.spl-entry {
    font-size: 16px;
    line-height: 1.8;
    color: var(--spl-text);
    width: 100%;
    max-width: 100%;
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
}

.spl-entry,
.spl-entry * {
    writing-mode: horizontal-tb !important;
}

.spl-entry h1, .spl-entry h2, .spl-entry h3,
.spl-entry h4, .spl-entry h5, .spl-entry h6 {
    font-family: var(--spl-font-heading);
    font-weight: 700;
    color: var(--spl-text);
    margin-top: 2em;
    margin-bottom: 0.5em;
    width: 100%;
}

.spl-entry h2 { font-size: 26px; }
.spl-entry h3 { font-size: 22px; }

.spl-entry p {
    margin-bottom: 1.5em;
    width: 100%;
    max-width: 75ch;
}

.spl-entry img, .spl-entry video, .spl-entry iframe {
    max-width: 100%;
    height: auto;
    border-radius: var(--spl-radius);
}

.spl-entry a {
    color: var(--spl-primary);
}

/* ============================================================
   GLOWING FOOTER BUTTONS & SUCCESS MESSAGE
   ============================================================ */

@property --btn-inner {
    syntax: "<color>";
    inherits: false;
    initial-value: rgba(50, 62, 55, 0.35);
}
@property --btn-outer {
    syntax: "<color>";
    inherits: false;
    initial-value: rgba(50, 62, 55, 0.25);
}
@property --btn-glow-inner {
    syntax: "<color>";
    inherits: false;
    initial-value: rgba(255, 255, 255, 0);
}
@property --btn-glow-outer {
    syntax: "<color>";
    inherits: false;
    initial-value: rgba(255, 255, 255, 0);
}

/* Hide LearnDash mark complete when in content area */
.spl-entry #sfwd-mark-complete,
.spl-entry .learndash_mark_complete_button,
.spl-entry form[id*="mark-complete"],
.spl-entry input.learndash_mark_complete_button {
    display: none !important;
}

.spl-actions {
    display: none;
}

/* Footer Container */
.spl-footer {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--spl-border);
}

/* Success Message */
.spl-success-message {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    margin-bottom: 24px;
    border-radius: var(--spl-radius);
    font-family: var(--spl-font-body);
    font-size: 15px;
    font-weight: 600;
    animation: spl-success-appear 0.4s ease-out;
}

.spl-success-message.is-visible {
    display: flex;
}

/* Success Message - Dark Mode */
html[data-theme="dark"] .spl-success-message {
    background: linear-gradient(135deg, rgba(28, 217, 145, 0.15), rgba(23, 181, 122, 0.1));
    border: 1px solid rgba(28, 217, 145, 0.3);
    color: var(--spl-accent-light);
}

html[data-theme="dark"] .spl-success-icon {
    color: var(--spl-success);
    filter: drop-shadow(0 0 8px rgba(28, 217, 145, 0.5));
}

/* Success Message - Light Mode */
html:not([data-theme="dark"]) .spl-success-message {
    background: linear-gradient(135deg, rgba(28, 217, 145, 0.12), rgba(23, 181, 122, 0.08));
    border: 1px solid rgba(28, 217, 145, 0.4);
    color: #17b57a;
}

html:not([data-theme="dark"]) .spl-success-icon {
    color: var(--spl-success);
}

/* Footer Row */
.spl-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.spl-footer-placeholder {
    width: 130px;
}

/* Base Glowing Button Style */
.spl-footer-btn,
.spl-footer-actions #sfwd-mark-complete input[type="submit"],
.spl-footer-actions .learndash_mark_complete_button,
.spl-footer-actions input[type="submit"] {
    position: relative;
    z-index: 1;
    border: none !important;
    font-size: 13px !important;
    padding: 8px 24px !important;
    font-family: var(--spl-font-body) !important;
    font-weight: 600 !important;
    letter-spacing: 0.02em;
    border-radius: 99em !important;
    cursor: pointer !important;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ===== DARK MODE BUTTONS ===== */

/* Previous Button - Dark Mode */
html[data-theme="dark"] .spl-btn-prev {
    --btn-inner: hsla(180deg 10% 22% / 35%);
    --btn-outer: hsla(180deg 10% 22% / 25%);
    --btn-glow-inner: hsla(174deg 83% 100% / 0%);
    background: radial-gradient(ellipse at 50% 10%, var(--btn-glow-inner), transparent), radial-gradient(var(--btn-inner), var(--btn-outer));
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 -1px rgba(0, 0, 0, 0.3);
    box-shadow: 
        inset 0 4px 1px -3px rgba(255, 255, 255, 0.1),
        inset 0 4px 8px 5px rgba(9, 11, 10, 0.16),
        0 2px 0 1px #1a1e1c,
        0 2px 0 3px rgba(0, 0, 0, 0.9),
        0 3px 0 3px rgba(255, 255, 255, 0.04);
    transition: --btn-glow-inner 200ms, --btn-inner 200ms, --btn-outer 500ms, box-shadow 200ms, transform 200ms;
}

html[data-theme="dark"] .spl-btn-prev:hover {
    --btn-glow-inner: hsla(174deg 83% 100% / 15%);
    --btn-inner: hsla(174deg 40% 45% / 100%);
    --btn-outer: hsla(174deg 60% 55% / 100%);
    color: white;
    box-shadow: 
        inset 0 -1px 2px 1px rgba(255, 255, 255, 0.3),
        inset 0 0 24px rgba(26, 77, 70, 0.3),
        0 3px 0 1px rgba(81, 218, 207, 0.6),
        inset 0 -1px 2px 1px rgba(255, 255, 255, 0.5),
        0 1px 2px rgba(255, 255, 255, 0.8),
        0 2px 16px rgba(255, 255, 255, 0.15),
        0 4px 32px 2px rgba(81, 218, 207, 0.25),
        0 3px 0 3px rgba(0, 0, 0, 0.8),
        0 3px 0 4px rgba(65, 170, 168, 0.4);
    text-shadow: 0 -1px rgba(65, 170, 168, 0.4), 0 0 4px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

html[data-theme="dark"] .spl-btn-prev:active {
    transform: translateY(1px);
}

/* Next Button - Dark Mode */
html[data-theme="dark"] .spl-btn-next {
    --btn-inner: hsla(252deg 10% 25% / 35%);
    --btn-outer: hsla(252deg 10% 25% / 25%);
    --btn-glow-inner: hsla(252deg 83% 100% / 0%);
    background: radial-gradient(ellipse at 50% 10%, var(--btn-glow-inner), transparent), radial-gradient(var(--btn-inner), var(--btn-outer));
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 -1px rgba(0, 0, 0, 0.3);
    box-shadow: 
        inset 0 4px 1px -3px rgba(255, 255, 255, 0.1),
        inset 0 4px 8px 5px rgba(9, 11, 10, 0.16),
        0 2px 0 1px #1a1e1c,
        0 2px 0 3px rgba(0, 0, 0, 0.9),
        0 3px 0 3px rgba(255, 255, 255, 0.04);
    transition: --btn-glow-inner 200ms, --btn-inner 200ms, --btn-outer 500ms, box-shadow 200ms, transform 200ms;
}

html[data-theme="dark"] .spl-btn-next:hover {
    --btn-glow-inner: hsla(252deg 83% 100% / 20%);
    --btn-inner: hsla(252deg 50% 55% / 100%);
    --btn-outer: hsla(252deg 83% 56% / 100%);
    color: white;
    box-shadow: 
        inset 0 -1px 2px 1px rgba(255, 255, 255, 0.3),
        inset 0 0 24px rgba(44, 0, 62, 0.3),
        0 3px 0 1px rgba(83, 51, 237, 0.7),
        inset 0 -1px 2px 1px rgba(255, 255, 255, 0.5),
        0 1px 2px rgba(255, 255, 255, 0.8),
        0 2px 16px rgba(255, 255, 255, 0.15),
        0 4px 32px 2px rgba(83, 51, 237, 0.35),
        0 3px 0 3px rgba(0, 0, 0, 0.8),
        0 3px 0 4px rgba(83, 51, 237, 0.4);
    text-shadow: 0 -1px rgba(44, 0, 62, 0.4), 0 0 4px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

html[data-theme="dark"] .spl-btn-next:active {
    transform: translateY(1px);
}

/* Mark Complete Button - Dark Mode */
html[data-theme="dark"] .spl-footer-actions #sfwd-mark-complete input[type="submit"],
html[data-theme="dark"] .spl-footer-actions .learndash_mark_complete_button,
html[data-theme="dark"] .spl-footer-actions input[type="submit"] {
    --btn-inner: hsla(158deg 10% 22% / 35%);
    --btn-outer: hsla(158deg 10% 22% / 25%);
    --btn-glow-inner: hsla(158deg 83% 100% / 0%);
    background: radial-gradient(ellipse at 50% 10%, var(--btn-glow-inner), transparent), radial-gradient(var(--btn-inner), var(--btn-outer)) !important;
    color: rgba(255, 255, 255, 0.7) !important;
    text-shadow: 0 -1px rgba(0, 0, 0, 0.3);
    box-shadow: 
        inset 0 4px 1px -3px rgba(255, 255, 255, 0.1),
        inset 0 4px 8px 5px rgba(9, 11, 10, 0.16),
        0 2px 0 1px #1a1e1c,
        0 2px 0 3px rgba(0, 0, 0, 0.9),
        0 3px 0 3px rgba(255, 255, 255, 0.04) !important;
    transition: --btn-glow-inner 200ms, --btn-inner 200ms, --btn-outer 500ms, box-shadow 200ms, transform 200ms !important;
}

html[data-theme="dark"] .spl-footer-actions #sfwd-mark-complete input[type="submit"]:hover,
html[data-theme="dark"] .spl-footer-actions .learndash_mark_complete_button:hover,
html[data-theme="dark"] .spl-footer-actions input[type="submit"]:hover {
    --btn-glow-inner: hsla(158deg 83% 100% / 20%);
    --btn-inner: hsla(158deg 50% 50% / 100%);
    --btn-outer: hsla(158deg 83% 48% / 100%);
    color: white !important;
    box-shadow: 
        inset 0 -1px 2px 1px rgba(255, 255, 255, 0.3),
        inset 0 0 24px rgba(26, 77, 46, 0.3),
        0 3px 0 1px rgba(28, 217, 145, 0.7),
        inset 0 -1px 2px 1px rgba(255, 255, 255, 0.5),
        0 1px 2px rgba(255, 255, 255, 0.8),
        0 2px 16px rgba(255, 255, 255, 0.15),
        0 4px 32px 2px rgba(28, 217, 145, 0.35),
        0 3px 0 3px rgba(0, 0, 0, 0.8),
        0 3px 0 4px rgba(28, 217, 145, 0.4) !important;
    text-shadow: 0 -1px rgba(23, 181, 122, 0.4), 0 0 4px rgba(255, 255, 255, 0.4);
    transform: translateY(-2px) !important;
}

html[data-theme="dark"] .spl-footer-actions #sfwd-mark-complete input[type="submit"]:active,
html[data-theme="dark"] .spl-footer-actions input[type="submit"]:active {
    transform: translateY(1px) !important;
}

/* ===== LIGHT MODE BUTTONS ===== */

/* Previous Button - Light Mode — gold standard neumorphic blue */
html:not([data-theme="dark"]) .spl-btn-prev {
    background: radial-gradient(ellipse at 50% 10%, rgba(77, 118, 253, 0), transparent), radial-gradient(#ECF3FF, #e0ebff);
    color: #4D76FD;
    text-shadow: none;
    box-shadow: inset 0 3px 1px -2px rgba(255, 255, 255, 0.8), inset 0 3px 6px 4px rgba(77, 118, 253, 0.08), 0 2px 0 1px #c8d4f0, 0 2px 0 2px rgba(77, 118, 253, 0.15), 0 2px 0 3px rgba(255, 255, 255, 0.4);
    transition: box-shadow 200ms, transform 200ms, background 200ms, color 200ms;
}

html:not([data-theme="dark"]) .spl-btn-prev:hover {
    background: radial-gradient(ellipse at 50% 10%, rgba(81, 218, 207, 0.15), transparent), radial-gradient(#41aaa8, #3a9997);
    color: #fff;
    box-shadow: inset 0 -1px 2px rgba(255, 255, 255, 0.3), inset 0 0 12px rgba(81, 218, 207, 0.15), 0 2px 0 1px rgba(65, 170, 168, 0.5), 0 2px 8px rgba(81, 218, 207, 0.25), 0 2px 0 3px rgba(255, 255, 255, 0.3);
    text-shadow: 0 -1px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

html:not([data-theme="dark"]) .spl-btn-prev:active {
    transform: translateY(1px);
}

/* Next Button - Light Mode — gold standard neumorphic blue */
html:not([data-theme="dark"]) .spl-btn-next {
    background: radial-gradient(ellipse at 50% 10%, rgba(77, 118, 253, 0), transparent), radial-gradient(#ECF3FF, #e0ebff);
    color: #4D76FD;
    text-shadow: none;
    box-shadow: inset 0 3px 1px -2px rgba(255, 255, 255, 0.8), inset 0 3px 6px 4px rgba(77, 118, 253, 0.08), 0 2px 0 1px #c8d4f0, 0 2px 0 2px rgba(77, 118, 253, 0.15), 0 2px 0 3px rgba(255, 255, 255, 0.4);
    transition: box-shadow 200ms, transform 200ms, background 200ms, color 200ms;
}

html:not([data-theme="dark"]) .spl-btn-next:hover {
    background: radial-gradient(ellipse at 50% 10%, rgba(77, 118, 253, 0.15), transparent), radial-gradient(#4D76FD, #3d5fd4);
    color: #fff;
    box-shadow: inset 0 -1px 2px rgba(255, 255, 255, 0.3), inset 0 0 12px rgba(77, 118, 253, 0.15), 0 2px 0 1px rgba(77, 118, 253, 0.5), 0 2px 8px rgba(77, 118, 253, 0.25), 0 2px 0 3px rgba(255, 255, 255, 0.3);
    text-shadow: 0 -1px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

html:not([data-theme="dark"]) .spl-btn-next:active {
    transform: translateY(1px);
}

/* Mark Complete Button - Light Mode — gold standard neumorphic green */
html:not([data-theme="dark"]) .spl-footer-actions #sfwd-mark-complete input[type="submit"],
html:not([data-theme="dark"]) .spl-footer-actions .learndash_mark_complete_button,
html:not([data-theme="dark"]) .spl-footer-actions input[type="submit"] {
    background: radial-gradient(ellipse at 50% 10%, rgba(28, 217, 145, 0), transparent), radial-gradient(#e8faf3, #d4f5e8) !important;
    color: #1aaf73 !important;
    text-shadow: none;
    box-shadow: inset 0 3px 1px -2px rgba(255, 255, 255, 0.8), inset 0 3px 6px 4px rgba(28, 217, 145, 0.08), 0 2px 0 1px #b8e4d2, 0 2px 0 2px rgba(28, 217, 145, 0.15), 0 2px 0 3px rgba(255, 255, 255, 0.4) !important;
    transition: box-shadow 200ms, transform 200ms, background 200ms, color 200ms !important;
}

html:not([data-theme="dark"]) .spl-footer-actions #sfwd-mark-complete input[type="submit"]:hover,
html:not([data-theme="dark"]) .spl-footer-actions .learndash_mark_complete_button:hover,
html:not([data-theme="dark"]) .spl-footer-actions input[type="submit"]:hover {
    background: radial-gradient(ellipse at 50% 10%, rgba(28, 217, 145, 0.15), transparent), radial-gradient(#1CD991, #18c282) !important;
    color: #fff !important;
    box-shadow: inset 0 -1px 2px rgba(255, 255, 255, 0.3), inset 0 0 12px rgba(28, 217, 145, 0.15), 0 2px 0 1px rgba(28, 217, 145, 0.5), 0 2px 8px rgba(28, 217, 145, 0.25), 0 2px 0 3px rgba(255, 255, 255, 0.3) !important;
    text-shadow: 0 -1px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px) !important;
}

html:not([data-theme="dark"]) .spl-footer-actions #sfwd-mark-complete input[type="submit"]:active,
html:not([data-theme="dark"]) .spl-footer-actions input[type="submit"]:active {
    transform: translateY(1px) !important;
}

/* Hide Mark Complete after success */
.spl-footer-actions.is-complete {
    display: none;
}

/* Disabled state during transitions */
.spl-btn-prev.is-loading,
.spl-btn-next.is-loading {
    pointer-events: none;
    opacity: 0.6;
}

/* ============================================================
   OVERLAY & SCROLLBAR
   ============================================================ */

.spl-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 850;
}

.spl-overlay.is-visible {
    display: block;
}

.spl-nav::-webkit-scrollbar {
    width: 6px;
}

.spl-nav::-webkit-scrollbar-track {
    background: var(--spl-sidebar-bg);
}

.spl-nav::-webkit-scrollbar-thumb {
    background: var(--spl-sidebar-active);
    border-radius: 3px;
}

/* ============================================================
   SPA TRANSITION STATES
   ============================================================ */

.spl-entry,
.spl-unit-content-list,
.spl-footer {
    will-change: opacity, transform;
}

.spl-content-header {
    will-change: auto;
}

/* Prevent scroll during transition */
.spl.is-transitioning {
    overflow: hidden;
}

.spl.is-transitioning .spl-content {
    pointer-events: none;
}

/* ============================================================
   PRINT STYLES
   ============================================================ */
@media print {
    .spl-sidebar, .spl-header, .spl-footer, .spl-actions {
        display: none !important;
    }
    .spl-main {
        margin: 0;
    }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .spl-content,
    .spl-topic,
    .spl-lesson,
    .spl-topics,
    .spl-entry > *,
    .spl-unit-content-list,
    .spl-footer,
    .spl-lesson-badge,
    .spl-unit-progress-fill,
    .spl-unit-progress-percent,
    .spl-trophy-progress,
    .spl-trophy-ring-fill,
    .spl-header::before,
    .spl-header-left,
    .spl-header-center,
    .spl-header-right,
    .spl-sidebar-header,
    .spl-sidebar-search,
    .spl-sidebar-progress-merged,
    .spl-metrics-row,
    .spl-nav,
    .spl-content-header {
        transition: none !important;
        animation: none !important;
    }

    /* Show everything immediately for reduced motion */
    .spl-header-left,
    .spl-header-center,
    .spl-header-right,
    .spl-sidebar-header,
    .spl-sidebar-search,
    .spl-sidebar-progress-merged,
    .spl-metrics-row,
    .spl-nav,
    .spl-content-header,
    .spl-entry > *,
    .spl-unit-content-list,
    .spl-footer {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .spl-header.is-loading::before {
        animation: none;
        box-shadow:
            0 0 20px rgba(66, 161, 236, 0.3),
            0 0 40px rgba(77, 118, 253, 0.2),
            0 0 60px rgba(125, 249, 233, 0.1);
    }
}

/* v5.58 — Review-mode banner pill. Was a full-width ribbon that pushed
   content down and created an ugly vertical gap between header and
   main area. Now a floating compact pill, fixed below the header and
   horizontally centred, out of layout flow. */
.spl-review-banner {
    position: fixed;
    /* v5.59 — sits just above the document area rather than crowding the
       header controls. 110px clears the course card / protocol chrome. */
    top: calc(var(--spl-header-height) + 110px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 60;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: linear-gradient(90deg, rgba(83, 51, 237, 0.92), rgba(81, 218, 207, 0.92));
    border: 1px solid rgba(81, 218, 207, 0.55);
    border-radius: 999px;
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
    pointer-events: auto;
    max-width: calc(100vw - 28px);
}

.spl-review-banner-icon {
    display: inline-flex;
    align-items: center;
    color: #51dacf;
}

.spl-review-banner-text {
    flex: 1;
    min-width: 0;
}

.spl-review-banner-text strong {
    color: #fff;
    font-weight: 600;
}

.spl-review-banner-mode {
    opacity: 0.75;
    margin-left: 4px;
}

.spl-review-banner-exit {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 10px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 120ms ease, border-color 120ms ease;
    white-space: nowrap;
}

.spl-review-banner-exit:hover,
.spl-review-banner-exit:focus {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.55);
}

/* Light-mode variant */
body.spl-light .spl-review-banner,
[data-theme="light"] .spl-review-banner {
    background: linear-gradient(90deg, rgba(83, 51, 237, 0.08), rgba(81, 218, 207, 0.10));
    border-bottom-color: rgba(65, 170, 168, 0.35);
    color: #2c003e;
}

body.spl-light .spl-review-banner-text strong,
[data-theme="light"] .spl-review-banner-text strong {
    color: #2c003e;
}

body.spl-light .spl-review-banner-exit,
[data-theme="light"] .spl-review-banner-exit {
    border-color: rgba(44, 0, 62, 0.3);
    color: #2c003e;
}

body.spl-light .spl-review-banner-exit:hover,
[data-theme="light"] .spl-review-banner-exit:hover {
    background: rgba(44, 0, 62, 0.06);
    border-color: rgba(44, 0, 62, 0.55);
}

@media (max-width: 640px) {
    .spl-review-banner {
        flex-wrap: wrap;
        padding: 8px 12px;
        font-size: 12px;
    }

    .spl-review-banner-exit {
        margin-left: auto;
    }
}