/* NEXUS-skinned LearnPress lesson design (migrated from Deep Space Lab 2026-05-22).
   Palette: base #020617 / surface #0F172A|#1E293B; cyan #00F2FF (primary), violet #A78BFA (insight), emerald #34D399 (success); Orbitron/Inter. */

        /* ═══════════════════════════════════════════════════
           SECTION A — CAGE BREAKER + DARK PAGE CANVAS
           ═══════════════════════════════════════════════════ */

        /* Force dark background on the whole lesson page body */
        body.viewing-course-item,
        body.lp-page,
        body.learnpress-page,
        body.single-lp_lesson,
        body.single-lp_course {
            background-color: #020617 !important;
            background:       #020617 !important;
        }

        /* ── Strip TwentyTwentyFive/block-theme side padding ────────────
           The theme wraps everything in .wp-site-blocks with
           padding: 0 clamp(30px,5vw,50px), which creates the white
           strip on the right. Kill it for lesson/course views.
        ──────────────────────────────────────────────────────────────── */
        body.viewing-course-item .wp-site-blocks,
        body.single-lp_course   .wp-site-blocks,
        body.single-lp_lesson   .wp-site-blocks,
        body.learnpress-page    .wp-site-blocks {
            padding-left:  0 !important;
            padding-right: 0 !important;
            --wp--style--root--padding-left:  0px !important;
            --wp--style--root--padding-right: 0px !important;
        }
        body.viewing-course-item .lp-archive-courses,
        body.single-lp_course   .lp-archive-courses,
        body.single-lp_lesson   .lp-archive-courses {
            padding: 0 !important;
            margin:  0 !important;
            width:  100% !important;
            max-width: 100% !important;
        }
        /* Also kill has-global-padding on course/lesson page */
        body.viewing-course-item .has-global-padding,
        body.single-lp_course   .has-global-padding {
            padding-left:  0 !important;
            padding-right: 0 !important;
        }

        /* Dark all LP content containers — prevents white bleed-through */
        #popup-course,
        #popup-content,
        #learn-press-content-item,
        .content-item-scrollable,
        .content-item-wrap,
        .content-item-summary,
        .content-item-description,
        .course-item-summary,
        .lp-lesson-wrapper,
        .learnpress-content,
        .lp-content {
            background-color: #020617 !important;
            background:       #020617 !important;
            color:            #CBD5E1 !important;
            max-width: 100% !important;
            width:     100% !important;
            padding:     0  !important;
            margin:      0  !important;
            overflow-x: visible !important;
        }
        /* Ensure the popup-course fills all available horizontal space */
        #popup-course {
            min-height: 100vh !important;
            position: relative !important;
        }
        /* Kill any box-model constraints LP or the theme applies */
        .lp-archive-courses,
        #popup-course,
        #popup-content {
            box-sizing: border-box !important;
        }

        /* Center the lesson content area — all LP popup configurations */
        #learn-press-content-item,
        .content-item-scrollable {
            display: block !important;
            width: 100% !important;
        }
        .content-item-wrap,
        .content-item-summary {
            width: 100% !important;
            max-width: 100% !important;
            margin-left:  0 !important;
            margin-right: 0 !important;
        }
        .content-item-description {
            width: 100% !important;
            max-width: 100% !important;
            margin: 0 !important;
            padding: 0 !important;
        }
        /* The wrapper itself centers its children */
        #grit-lesson-wrapper {
            margin-left:  auto !important;
            margin-right: auto !important;
        }

        /* Any headings or text that LP renders OUTSIDE #grit-lesson-wrapper */
        .content-item-description h1,
        .content-item-description h2,
        .content-item-description h3,
        .content-item-description p,
        .content-item-description li,
        .content-item-summary h1,
        .content-item-summary h2,
        .content-item-summary h3 {
            color: #CBD5E1 !important;
        }

        /* ═══════════════════════════════════════════════════
           NUCLEAR DARK — beats the lesson HTML's own embedded
           light-mode <style id="grit-design-system"> which sets
           background:#fff on #grit-lesson-wrapper.
           Doubled-ID selector (#grit-lesson-wrapper#grit-lesson-wrapper)
           has higher specificity than a single-ID rule, so we win
           even without !important where the lesson CSS uses !important.
           ═══════════════════════════════════════════════════ */

        /* Beat the embedded lesson CSS background:#ffffff */
        #grit-lesson-wrapper#grit-lesson-wrapper {
            background:       #020617 !important;
            background-color: #020617 !important;
            color: #CBD5E1 !important;
        }

        /* Ensure all direct-child colours also survive */
        #grit-lesson-wrapper,
        #grit-lesson-wrapper .the-story,
        #grit-lesson-wrapper .the-grind,
        #grit-lesson-wrapper .the-spark,
        #grit-lesson-wrapper .spark-block,
        #grit-lesson-wrapper .article-body,
        #grit-lesson-wrapper .shift-section,
        #grit-lesson-wrapper .big-question,
        #grit-lesson-wrapper .hero-banner,
        #grit-lesson-wrapper .hero-card {
            color: #CBD5E1 !important;
        }

        /* The lesson's own CSS sets these to dark text — override */
        #grit-lesson-wrapper#grit-lesson-wrapper h2 { color: #E0FBFF !important; }
        #grit-lesson-wrapper#grit-lesson-wrapper h3 { color: #CFFAFE !important; }
        #grit-lesson-wrapper#grit-lesson-wrapper p  { color: #CBD5E1 !important; }
        #grit-lesson-wrapper#grit-lesson-wrapper li { color: #CBD5E1 !important; }

        /* The lesson CSS sets .the-story and .the-grind to white/light — nuke it */
        #grit-lesson-wrapper#grit-lesson-wrapper .the-story {
            background: #0F172A !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .the-grind {
            background: #0B1322 !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .try-this {
            background: rgba(167,139,250,0.06) !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .real-world-card {
            background: rgba(0,242,255,0.06) !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .progress-checkpoint {
            background: rgba(52,211,153,0.07) !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .reflect-callout {
            background: rgba(167,139,250,0.07) !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .journal-prompt {
            background: rgba(167,139,250,0.08) !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .key-takeaway-card {
            background: #0F172A !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .key-concept-card {
            background: #1E293B !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .pull-quote p {
            color: #F8FAFC !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .field-notes {
            background: rgba(167,139,250,0.08) !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .ba-before {
            background: rgba(248,113,113,0.10) !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .ba-after {
            background: rgba(52,211,153,0.08) !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .aside-block {
            background: rgba(167,139,250,0.08) !important;
        }
        #grit-lesson-wrapper#grit-lesson-wrapper .sls-open-question {
            background: rgba(0,242,255,0.07) !important;
        }
        /* article-body - transparent so page dark bg shows through */
        #grit-lesson-wrapper#grit-lesson-wrapper .article-body {
            background: transparent !important;
        }

        /* Stop WordPress/Elementor/Hello theme white backgrounds */
        #grit-lesson-wrapper div,
        #grit-lesson-wrapper section,
        #grit-lesson-wrapper article {
            box-sizing: border-box;
        }

        /* Any element the theme is forcing white on */
        .content-item-description .entry-content,
        .content-item-description .post-content,
        .content-item-description .elementor-section,
        .content-item-description .elementor-widget-wrap,
        .content-item-description .elementor-widget-container,
        .single-lp_lesson .entry-content,
        .learn-press-content-item .entry-content {
            background: #020617 !important;
            background-color: #020617 !important;
            color: #CBD5E1 !important;
        }

        /* ── Sidebar: current lesson highlight ──────────── */
        #popup-sidebar .course-item.current .course-item-title {
            font-weight: 800 !important;
            color: #00F2FF !important;
        }
        #popup-sidebar .course-item.current {
            background: rgba(0,242,255,0.12) !important;
            border-left: 4px solid #00F2FF !important;
            border-radius: 0 8px 8px 0 !important;
        }
        #popup-sidebar .course-item.current .course-item__link {
            font-weight: 700 !important;
            color: #00F2FF !important;
        }

        /* ═══════════════════════════════════════════════════
           SECTION B — UI ENHANCEMENTS
           ═══════════════════════════════════════════════════ */

        /* ── Hide site header/footer inside LP lesson popup ─ */
        /* LearnPress is supposed to suppress these but some     */
        /* themes (Elementor/Hello) let them bleed through.      */
        body.viewing-course-item footer,
        body.viewing-course-item footer.elementor-location-footer,
        body.viewing-course-item .site-footer,
        body.viewing-course-item #footer,
        body.viewing-course-item [data-elementor-type="footer"],
        body.lp-page footer,
        body.learnpress-page footer.elementor-location-footer,
        #popup-course ~ footer,
        #popup-course ~ [data-elementor-type="footer"] {
            display: none !important;
            height: 0 !important;
            overflow: hidden !important;
            visibility: hidden !important;
        }

        /* ── popup-header: dark bar so all icons are readable ─ */
        #popup-header {
            background: #0f172a !important;
            border-bottom: 2px solid rgba(167,139,250,0.3) !important;
            min-height: 52px !important;
            display: flex !important;
            align-items: center !important;
        }

        /* ── Close X — pure white, large, unmissable ─────────  */
        /* Target every selector LP uses for the close button     */
        #popup-header a.back-course,
        #popup-header a.back-course i,
        #popup-header a.back-course i.lp-icon-times,
        #popup-header .lp-icon-times,
        #popup-header i.lp-icon-times,
        a.back-course i,
        .back-course i,
        .back-course .lp-icon-times {
            color: #ffffff !important;
            fill:  #ffffff !important;
            opacity: 1 !important;
            visibility: visible !important;
            font-size: 1.8rem !important;
            font-weight: 900 !important;
            line-height: 1 !important;
            text-shadow: 0 0 8px rgba(0,0,0,0.8) !important;
            -webkit-text-stroke: 0.5px rgba(255,255,255,0.3) !important;
        }
        /* All other header icons (sidebar toggle, angles) */
        #popup-header i[class*="lp-icon-angle"],
        #popup-header #sidebar-toggle,
        #popup-header #sidebar-toggle + label,
        #popup-header #sidebar-toggle + label i,
        #popup-header label[for="sidebar-toggle"] {
            color: #ffffff !important;
            opacity: 1 !important;
            font-size: 1.2rem !important;
        }

        /* ── Hide LP's native prev/next footer bar ─────────────────────
           Keep it in the DOM (do NOT use display:none). LP's JS needs it
           live to inject hrefs. Off-screen positioning hides it from the
           student. window.slsGoNext uses it as a fallback URL source.
        ─────────────────────────────────────────────────────────────── */
        #popup-footer {
            position: fixed !important;
            bottom: -9999px !important;
            left:   -9999px !important;
            width:  1px !important;
            height: 1px !important;
            overflow: hidden !important;
            opacity: 0 !important;
            pointer-events: none !important;
            z-index: -9999 !important;
        }

        /* Remove padding the page reserved for the fixed footer */
        .content-item-scrollable,
        #learn-press-content-item {
            padding-bottom: 0 !important;
            margin-bottom: 0 !important;
        }

        /* ═══════════════════════════════════════════════════
           SECTION C — NUCLEAR TITLE SUPPRESSION
           (titles live inside lesson HTML, not WP template)
           ═══════════════════════════════════════════════════ */
        .content-item-summary .course-item-title,
        .content-item-summary .lesson-title,
        .course-item-title.lesson-title,
        #popup-header .course-title,
        .learn-press-breadcrumb,
        .entry-title,
        header.entry-header {
            display: none !important;
            height: 0 !important;
            margin: 0 !important;
            padding: 0 !important;
            visibility: hidden !important;
            opacity: 0 !important;
        }

        /* ═══════════════════════════════════════════════════════════
           SECTION D — DESIGN SYSTEM: DARK MODE (Deep Space Lab)
           ═══════════════════════════════════════════════════════════

           ELEVATION MODEL
           ─────────────────────────────────────────────────────────
           bg-base    #020617  — page canvas, the void
           bg-l1      #0B1322  — article body, reading zone
           bg-l2      #0F172A  — raised cards (Story, Grind)
           bg-l3      #1E293B  — nested / secondary cards
           bg-l4      #334155  — hover states, deepest nesting

           ACCENT PALETTE
           ─────────────────────────────────────────────────────────
           Science Blue   #00F2FF  — primary brand accent (brightened for dark)
           Neon Teal      #00F2FF  — discovery moments
           Science Gold   #A78BFA  — key insights, gold accents
           Bio Green      #34D399  — success, checkpoints
           Amber Warm     #A78BFA  — reflection, warmth, pause
           Cosmic Violet  #A78BFA  — creative, journaling
           ═══════════════════════════════════════════════════════════ */

        /* ── CSS Custom Properties ─────────────────────────── */
        #grit-lesson-wrapper {
            --bg-base:       #020617;
            --bg-l1:         #0B1322;
            --bg-l2:         #0F172A;
            --bg-l3:         #1E293B;
            --bg-l4:         #334155;

            --accent-blue:   #00F2FF;
            --accent-teal:   #00F2FF;
            --accent-gold:   #A78BFA;
            --accent-green:  #34D399;
            --accent-amber:  #A78BFA;
            --accent-violet: #A78BFA;
            --accent-red:    #F87171;

            --text-primary:  #F8FAFC;
            --text-body:     #CBD5E1;
            --text-muted:    #94A3B8;
            --text-subtle:   #94A3B8;

            --border-soft:   rgba(100,140,180,0.14);
            --border-mid:    rgba(100,140,180,0.26);
            --border-strong: rgba(100,140,180,0.42);

            /* Legacy variable aliases so existing component HTML still resolves */
            --brand-gold:        var(--accent-blue);
            --brand-gold-bright: var(--accent-violet);
            --brand-dark:        var(--bg-l2);
            --brand-slate:       var(--bg-l3);
            --brand-gray:        var(--bg-l1);
            --brand-text:        var(--text-body);
            --dark:              var(--bg-base);

            font-family: 'Inter', sans-serif;
            background-color: var(--bg-base) !important;
            background: var(--bg-base) !important;
            color: var(--text-body);
            width: 100% !important;
            max-width: 100% !important;
            margin: 0 !important;
            position: relative;
            display: block;
            box-sizing: border-box;
            min-height: 60vh;
        }

        /* ── Typography ─────────────────────────────────────── */
        #grit-lesson-wrapper .serif-italic {
            font-family: 'Orbitron', serif !important;
            font-style: italic !important;
            font-weight: 900 !important;
        }
        #grit-lesson-wrapper h1 {
            font-size: 2.5rem !important;
            margin: 0.5rem 0 !important;
            line-height: 1.1;
            color: var(--text-primary) !important;
        }
        #grit-lesson-wrapper h2 {
            font-size: 1.8rem !important;
            margin: 2rem 0 1rem !important;
            line-height: 1.2;
            color: #E0FBFF !important;
        }
        #grit-lesson-wrapper h3 {
            font-size: 1.3rem !important;
            margin: 1.5rem 0 0.75rem !important;
            color: #CFFAFE !important;
        }
        #grit-lesson-wrapper p {
            margin-bottom: 1.5rem;
            font-size: 1rem !important;
            color: #CBD5E1 !important;
            line-height: 1.8;
        }
        #grit-lesson-wrapper ul,
        #grit-lesson-wrapper ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
        #grit-lesson-wrapper li {
            margin-bottom: 0.55rem;
            line-height: 1.7;
            color: #CBD5E1 !important;
        }
        #grit-lesson-wrapper span { color: #CBD5E1; }
        #grit-lesson-wrapper strong { color: #F8FAFC !important; }
        #grit-lesson-wrapper a {
            color: var(--accent-teal);
            text-decoration: underline;
            text-decoration-color: rgba(0,242,255,0.35);
            text-underline-offset: 3px;
        }
        #grit-lesson-wrapper a:hover { color: #7FECFF; text-decoration-color: rgba(0,242,255,0.7); }

        /* ── Layout: Full-width blocks ────────────────────── */
        #grit-lesson-wrapper .full-width-section,
        #grit-lesson-wrapper .hero-card,
        #grit-lesson-wrapper .shift-section {
            width: 100% !important;
            box-sizing: border-box;
            margin: 0 !important;
            padding: 5rem 10% !important;
            position: relative;
            z-index: 1;
        }

        /* ── Layout: Centered narrative ──────────────────── */
        #grit-lesson-wrapper .article-body {
            width: 92% !important;
            max-width: 820px !important;
            margin: 0 auto !important;
            padding: 2.5rem 1rem 3rem !important;
            background: transparent !important;
        }
        @media (max-width: 900px) {
            #grit-lesson-wrapper .article-body {
                width: 96% !important;
                padding: 1.5rem 0.75rem 2rem !important;
            }
        }
        #grit-lesson-wrapper article,
        #grit-lesson-wrapper > section:not(.full-width-section):not(.hero-card):not(.shift-section) {
            width: 82% !important;
            max-width: 1100px !important;
            margin: 3.5rem auto !important;
            padding: 0 !important;
            box-sizing: border-box;
            display: block;
        }

        /* ═══════════════════════════════════════════════════
           HERO BANNER (kept dark — just refined)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .hero-banner {
            min-height: 380px;
            position: relative;
            display: flex;
            align-items: flex-end;
            overflow: hidden;
            width: 100%;
            background: var(--bg-base);
        }
        #grit-lesson-wrapper .hero-overlay {
            position: absolute; inset: 0;
            background: linear-gradient(
                to top,
                rgba(2,6,23,0.98)  0%,
                rgba(2,6,23,0.65)  45%,
                rgba(2,6,23,0.18) 100%
            );
        }
        #grit-lesson-wrapper .hero-bg {
            position: absolute; inset: 0;
            background-size: cover;
            background-position: center;
            filter: brightness(0.55) saturate(1.1);
        }
        #grit-lesson-wrapper .hero-content {
            position: relative; z-index: 2;
            padding: 3rem 4rem 3.5rem;
            width: 100%;
        }
        #grit-lesson-wrapper .hero-content h1 {
            color: #ffffff !important;
            font-size: clamp(1.9rem, 4vw, 3.2rem) !important;
            text-shadow: 0 2px 24px rgba(0,0,0,0.7);
            letter-spacing: -0.01em;
        }
        #grit-lesson-wrapper .hero-eyebrow {
            display: inline-block;
            color: var(--accent-gold);
            font-size: 0.7rem; font-weight: 700;
            letter-spacing: 0.22em; text-transform: uppercase;
            margin-bottom: 0.8rem;
            text-shadow: 0 0 20px rgba(167,139,250,0.5);
        }

        /* ── Hero Card (alternate full-width hero) ────────── */
        #grit-lesson-wrapper .hero-card {
            background: linear-gradient(135deg, #020617 0%, #0F172A 50%, #1E293B 100%) !important;
            color: #ffffff !important;
            border-bottom: 6px solid var(--accent-gold) !important;
            overflow: hidden;
        }
        #grit-lesson-wrapper .hero-card::before {
            content: "";
            position: absolute; inset: 0;
            opacity: 0.07;
            background-image: radial-gradient(var(--accent-blue) 1px, transparent 1px);
            background-size: 28px 28px;
            z-index: 0;
        }
        #grit-lesson-wrapper .hero-card > * { position: relative; z-index: 1; }
        #grit-lesson-wrapper .hero-card h1 { color: #ffffff !important; }

        /* ═══════════════════════════════════════════════════
           BIG QUESTION (cinematic pull-in)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .big-question {
            background: #010309;
            border: 1px solid rgba(167,139,250,0.28);
            border-left: 5px solid var(--accent-gold);
            border-radius: 22px;
            padding: 3rem 3.5rem;
            margin: 3rem 0;
            position: relative;
            overflow: hidden;
        }
        #grit-lesson-wrapper .big-question::after {
            content: "?";
            position: absolute; right: 2rem; top: -1rem;
            font-size: 14rem; font-weight: 900;
            color: rgba(167,139,250,0.04);
            line-height: 1; pointer-events: none; user-select: none;
        }
        #grit-lesson-wrapper .big-question .bq-label {
            display: block;
            color: var(--accent-gold);
            font-size: 0.65rem; font-weight: 900;
            letter-spacing: 0.22em; text-transform: uppercase;
            margin-bottom: 1rem;
        }
        #grit-lesson-wrapper .big-question p {
            font-family: 'Orbitron', Georgia, serif !important;
            font-style: italic !important;
            font-size: clamp(1.3rem, 2.5vw, 1.85rem) !important;
            color: #FFFFFF !important;
            font-weight: 700 !important;
            line-height: 1.5 !important;
            margin: 0 !important;
            text-shadow: 0 1px 16px rgba(0,0,0,0.5);
        }

        /* ═══════════════════════════════════════════════════
           THE SPARK (concept intro — vivid dark card)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .the-spark,
        #grit-lesson-wrapper .spark-block {
            background: linear-gradient(135deg, #0F172A 0%, #0B1322 100%);
            color: var(--text-primary);
            border-radius: 20px;
            padding: 2.5rem 3rem;
            margin: 2rem 0;
            border-left: 6px solid var(--accent-teal);
            position: relative;
            overflow: hidden;
        }
        #grit-lesson-wrapper .the-spark::before,
        #grit-lesson-wrapper .spark-block::before {
            content: "";
            position: absolute; inset: 0;
            background: radial-gradient(ellipse at 0% 50%, rgba(0,242,255,0.08) 0%, transparent 60%);
            pointer-events: none;
        }
        #grit-lesson-wrapper .the-spark h2,
        #grit-lesson-wrapper .the-spark h3,
        #grit-lesson-wrapper .spark-block h2,
        #grit-lesson-wrapper .spark-block h3 { color: var(--accent-teal) !important; }
        #grit-lesson-wrapper .the-spark p,
        #grit-lesson-wrapper .the-spark li,
        #grit-lesson-wrapper .the-spark span,
        #grit-lesson-wrapper .the-spark a,
        #grit-lesson-wrapper .spark-block p { color: #CFFAFE !important; }

        /* ═══════════════════════════════════════════════════
           THE STORY (narrative block)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .the-story {
            background: #0F172A !important;
            border: 1px solid rgba(100,140,180,0.14) !important;
            border-radius: 18px !important;
            padding: 2rem 2.5rem !important;
            margin: 2rem 0 !important;
            border-top: 4px solid #00F2FF !important;
        }
        #grit-lesson-wrapper .the-story h2,
        #grit-lesson-wrapper .the-story h3 { color: #CFFAFE !important; }
        #grit-lesson-wrapper .the-story p,
        #grit-lesson-wrapper .the-story li,
        #grit-lesson-wrapper .the-story span,
        #grit-lesson-wrapper .the-story strong { color: #CBD5E1 !important; }

        /* ═══════════════════════════════════════════════════
           THE GRIND (deep content / protocol)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .the-grind {
            background: #0B1322 !important;
            border: 1px solid rgba(100,140,180,0.14) !important;
            border-radius: 18px !important;
            padding: 2rem 2.5rem !important;
            margin: 2rem 0 !important;
        }
        #grit-lesson-wrapper .the-grind h2,
        #grit-lesson-wrapper .the-grind h3 { color: #CFFAFE !important; }
        #grit-lesson-wrapper .the-grind p,
        #grit-lesson-wrapper .the-grind li,
        #grit-lesson-wrapper .the-grind span,
        #grit-lesson-wrapper .the-grind strong { color: #CBD5E1 !important; }

        /* ═══════════════════════════════════════════════════
           SHIFT SECTION (lesson close / synthesis)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .shift-section {
            background: linear-gradient(135deg, #010309 0%, #0B1322 60%, #0F172A 100%) !important;
            color: #ffffff !important;
            border-bottom: 12px solid var(--accent-gold) !important;
            border-radius: 28px !important;
            margin: 3rem 0 !important;
            overflow: hidden;
            box-shadow: 0 8px 40px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.04);
        }
        #grit-lesson-wrapper .shift-section h2,
        #grit-lesson-wrapper .shift-section h3 { color: var(--accent-gold) !important; }
        #grit-lesson-wrapper .shift-section p,
        #grit-lesson-wrapper .shift-section li,
        #grit-lesson-wrapper .shift-section span { color: #CFFAFE !important; }
        #grit-lesson-wrapper .shift-watermark {
            position: absolute; top: -1rem; right: -1rem;
            font-size: 12rem; font-weight: 900;
            color: rgba(255,255,255,0.025);
            user-select: none; line-height: 0.7;
            pointer-events: none; text-transform: uppercase; z-index: 0;
        }

        /* ═══════════════════════════════════════════════════
           REFLECT CALLOUT (pause & think — amber warmth)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .reflect-callout {
            background: rgba(167,139,250,0.07);
            border-left: 5px solid var(--accent-amber);
            border-radius: 0 16px 16px 0;
            padding: 1.5rem 2rem;
            margin: 2.5rem 0;
            border: 1px solid rgba(167,139,250,0.18);
            border-left: 5px solid var(--accent-amber);
        }
        #grit-lesson-wrapper .reflect-callout::before {
            content: "⏸  PAUSE & REFLECT";
            display: block;
            font-size: 0.68rem; font-weight: 900;
            letter-spacing: 0.18em; color: var(--accent-amber);
            margin-bottom: 0.8rem; text-transform: uppercase;
        }
        #grit-lesson-wrapper .reflect-callout p {
            color: #DDD6FE !important;
            font-style: italic; margin-bottom: 0 !important;
        }

        /* ═══════════════════════════════════════════════════
           REAL WORLD CARD (connection — teal science)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .real-world-card {
            background: rgba(0,242,255,0.06);
            border: 1px solid rgba(0,242,255,0.22);
            border-radius: 18px;
            padding: 2rem 2.5rem;
            margin: 2.5rem 0;
        }
        #grit-lesson-wrapper .real-world-card::before {
            content: "🌍  REAL WORLD CONNECTION";
            display: block;
            font-size: 0.68rem; font-weight: 900;
            letter-spacing: 0.18em; color: var(--accent-teal);
            margin-bottom: 0.8rem; text-transform: uppercase;
        }
        #grit-lesson-wrapper .real-world-card h3 { color: var(--accent-teal) !important; }
        #grit-lesson-wrapper .real-world-card p,
        #grit-lesson-wrapper .real-world-card li { color: #CFFAFE !important; }

        /* ═══════════════════════════════════════════════════
           KEY CONCEPT CARD (definition — elevated dark)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .key-concept-card {
            background: #1E293B !important;
            color: #F8FAFC !important;
            border-radius: 16px !important;
            padding: 1.5rem 2rem !important;
            margin: 2rem 0 !important;
            border: 1px solid rgba(100,140,180,0.26) !important;
            border-left: 4px solid #00F2FF !important;
        }
        #grit-lesson-wrapper .key-concept-card strong {
            color: var(--accent-teal);
            display: block; margin-bottom: 0.4rem;
            font-size: 0.78rem; letter-spacing: 0.12em;
            text-transform: uppercase;
        }
        #grit-lesson-wrapper .key-concept-card p,
        #grit-lesson-wrapper .key-concept-card li,
        #grit-lesson-wrapper .key-concept-card span {
            color: #CBD5E1 !important; margin-bottom: 0 !important;
        }

        /* ═══════════════════════════════════════════════════
           PULL QUOTE (cinematic highlight)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .pull-quote {
            padding: 2.5rem 4rem !important;
            margin: 3.5rem 0 !important;
            text-align: center !important;
            position: relative !important;
            background: rgba(0,242,255,0.08) !important;
            border-radius: 20px !important;
            border: 1px solid rgba(100,140,180,0.14) !important;
        }
        #grit-lesson-wrapper .pull-quote::before {
            content: "C";
            font-family: 'Orbitron', Georgia, serif;
            font-size: 10rem; color: var(--accent-gold); opacity: 0.18;
            position: absolute; top: -2.5rem; left: 1.5rem;
            line-height: 1; pointer-events: none;
        }
        #grit-lesson-wrapper .pull-quote p {
            font-family: 'Orbitron', Georgia, serif !important;
            font-style: italic !important; font-size: 1.5rem !important;
            color: #F8FAFC !important; font-weight: 700 !important;
            line-height: 1.5 !important;
            text-shadow: 0 1px 12px rgba(0,0,0,0.4);
        }

        /* ═══════════════════════════════════════════════════
           PROGRESS CHECKPOINT (success — bio green)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .progress-checkpoint {
            background: rgba(52,211,153,0.07);
            border: 1px solid rgba(52,211,153,0.25);
            border-radius: 18px;
            padding: 2rem 2.5rem;
            margin: 2.5rem 0;
        }
        #grit-lesson-wrapper .progress-checkpoint::before {
            content: "✅  CHECKPOINT";
            display: block; font-size: 0.68rem; font-weight: 900;
            letter-spacing: 0.18em; color: var(--accent-green);
            margin-bottom: 0.8rem;
        }
        #grit-lesson-wrapper .progress-checkpoint h3 { color: var(--accent-green) !important; }
        #grit-lesson-wrapper .progress-checkpoint p,
        #grit-lesson-wrapper .progress-checkpoint li { color: #A7F3D0 !important; }

        /* ═══════════════════════════════════════════════════
           TRY THIS (activity — gold action energy)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .try-this {
            background: rgba(167,139,250,0.06);
            border: 2px solid rgba(167,139,250,0.28);
            border-radius: 22px;
            padding: 2rem 2.5rem;
            margin: 2.5rem 0;
        }
        #grit-lesson-wrapper .try-this::before {
            content: "⚡  TRY THIS";
            display: block; font-size: 0.68rem; font-weight: 900;
            letter-spacing: 0.18em; color: var(--accent-gold);
            margin-bottom: 0.8rem;
        }
        #grit-lesson-wrapper .try-this h3 { color: var(--accent-gold) !important; }
        #grit-lesson-wrapper .try-this p,
        #grit-lesson-wrapper .try-this li { color: #DDD6FE !important; }

        /* Try This — inner activity markup (time badge, title, numbered steps).
           These elements use div/span/ol rather than h3, so the rules above miss
           them and they were rendering as plain body text. */
        #grit-lesson-wrapper .try-this { position: relative; }
        #grit-lesson-wrapper .try-this .time-badge {
            display: inline-flex; align-items: center; gap: 0.4em;
            background: rgba(167,139,250,0.14);
            border: 1px solid rgba(167,139,250,0.45);
            color: #DDD6FE !important;
            font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
            text-transform: uppercase; line-height: 1;
            padding: 0.3rem 0.72rem; border-radius: 999px;
            margin-bottom: 1rem;
        }
        #grit-lesson-wrapper .try-this .time-badge img.emoji {
            width: 1em; height: 1em; margin: 0; vertical-align: -0.12em;
        }
        #grit-lesson-wrapper .try-this .activity-title {
            color: var(--text-primary) !important;
            font-weight: 800; font-size: 1.2rem; line-height: 1.3;
            letter-spacing: -0.01em; margin: 0 0 0.85rem;
        }
        #grit-lesson-wrapper .try-this .activity-steps {
            list-style: none; counter-reset: tt-step;
            margin: 1.1rem 0 0; padding: 0;
        }
        #grit-lesson-wrapper .try-this .activity-steps > li {
            counter-increment: tt-step; position: relative;
            padding-left: 2.7rem; margin-bottom: 0.9rem;
            color: #DDD6FE !important;
        }
        #grit-lesson-wrapper .try-this .activity-steps > li:last-child { margin-bottom: 0; }
        #grit-lesson-wrapper .try-this .activity-steps > li::before {
            content: counter(tt-step);
            position: absolute; left: 0; top: 0.05em;
            width: 1.75rem; height: 1.75rem; border-radius: 50%;
            background: rgba(167,139,250,0.16);
            border: 1px solid rgba(167,139,250,0.5);
            color: var(--accent-violet);
            font-weight: 800; font-size: 0.82rem;
            display: flex; align-items: center; justify-content: center;
        }
        #grit-lesson-wrapper .try-this .activity-steps > li strong { color: var(--accent-blue); }

        /* ═══════════════════════════════════════════════════
           BEFORE / AFTER contrast block
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .before-after {
            display: grid; grid-template-columns: 1fr 1fr;
            gap: 2px; border-radius: 18px;
            overflow: hidden; margin: 2.5rem 0;
            border: 1px solid var(--border-soft);
        }
        #grit-lesson-wrapper .ba-before {
            background: rgba(248,113,113,0.1);
            padding: 1.75rem 2rem;
        }
        #grit-lesson-wrapper .ba-before::before {
            content: "✗  MISCONCEPTION";
            display: block; font-size: 0.62rem; font-weight: 900;
            letter-spacing: 0.16em; color: var(--accent-red);
            margin-bottom: 0.75rem;
        }
        #grit-lesson-wrapper .ba-before p,
        #grit-lesson-wrapper .ba-before li { color: #FECACA !important; }
        #grit-lesson-wrapper .ba-after {
            background: rgba(52,211,153,0.08);
            padding: 1.75rem 2rem;
        }
        #grit-lesson-wrapper .ba-after::before {
            content: "✓  REALITY";
            display: block; font-size: 0.62rem; font-weight: 900;
            letter-spacing: 0.16em; color: var(--accent-green);
            margin-bottom: 0.75rem;
        }
        #grit-lesson-wrapper .ba-after p,
        #grit-lesson-wrapper .ba-after li { color: #A7F3D0 !important; }

        /* ═══════════════════════════════════════════════════
           ASIDE BLOCK (supplementary note — violet)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .aside-block {
            float: right; width: 37%;
            margin: 0 0 1.5rem 2rem;
            background: rgba(167,139,250,0.08);
            border-left: 4px solid var(--accent-violet);
            border-radius: 0 16px 16px 0;
            padding: 1.25rem 1.5rem;
            border: 1px solid rgba(167,139,250,0.2);
            border-left: 4px solid var(--accent-violet);
        }
        #grit-lesson-wrapper .aside-block p,
        #grit-lesson-wrapper .aside-block li { color: #DDD6FE !important; font-size: 0.95rem; }

        /* ═══════════════════════════════════════════════════
           DEEP DIVE (expandable detail — subtle dark)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .deep-dive {
            border: 2px dashed rgba(100,140,180,0.25);
            border-radius: 16px;
            margin: 2rem 0; overflow: hidden;
        }
        #grit-lesson-wrapper .deep-dive summary {
            padding: 1.1rem 1.5rem; cursor: pointer;
            font-weight: 700; color: var(--accent-blue);
            background: var(--bg-l2);
            list-style: none;
            border-bottom: 1px solid var(--border-soft);
        }
        #grit-lesson-wrapper .deep-dive summary:hover { background: var(--bg-l3); }
        #grit-lesson-wrapper .deep-dive[open] { border-color: rgba(0,242,255,0.3); }
        #grit-lesson-wrapper .deep-dive > *:not(summary) {
            background: var(--bg-l1);
            padding: 1.25rem 1.5rem;
        }
        #grit-lesson-wrapper .deep-dive p,
        #grit-lesson-wrapper .deep-dive li { color: var(--text-body) !important; }

        /* ═══════════════════════════════════════════════════
           JOURNAL PROMPT (reflective writing — violet)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .journal-prompt {
            background: rgba(167,139,250,0.08);
            border-left: 5px solid var(--accent-violet);
            border-radius: 0 18px 18px 0;
            padding: 1.75rem 2rem;
            margin: 2.5rem 0;
            border: 1px solid rgba(167,139,250,0.22);
            border-left: 5px solid var(--accent-violet);
        }
        #grit-lesson-wrapper .journal-prompt::before {
            content: "✍️  JOURNAL";
            display: block; font-size: 0.68rem; font-weight: 900;
            letter-spacing: 0.18em; color: var(--accent-violet);
            margin-bottom: 0.8rem;
        }
        #grit-lesson-wrapper .journal-prompt p { color: #DDD6FE !important; }

        /* ── Submit button (journal / open question) ──────── */
        #grit-lesson-wrapper .sls-submit-btn {
            display: inline-block; margin: 1rem 0 0;
            padding: 0.65rem 1.75rem;
            background: var(--accent-violet); color: #ffffff;
            font-size: 0.875rem; font-weight: 700;
            border: none; border-radius: 100px; cursor: pointer;
            transition: opacity 0.2s, transform 0.15s;
        }
        #grit-lesson-wrapper .sls-submit-btn:hover { opacity: 0.88; transform: translateY(-1px); }
        #grit-lesson-wrapper .sls-submit-btn.sls-submitted {
            background: var(--accent-green); cursor: default;
        }

        /* ── WYSIWYG editor area ──────────────────────────── */
        #grit-lesson-wrapper .sls-editor-wrap { background: var(--bg-l3); border-radius: 12px; }
        #grit-lesson-wrapper .sls-editor-toolbar {
            background: var(--bg-l4);
            border-bottom: 1px solid var(--border-soft);
            border-radius: 12px 12px 0 0;
        }
        #grit-lesson-wrapper .sls-ed-btn {
            background: transparent; border: 1px solid var(--border-soft);
            color: var(--text-muted); border-radius: 6px;
        }
        #grit-lesson-wrapper .sls-ed-btn:hover,
        #grit-lesson-wrapper .sls-ed-btn.sls-ed-active {
            background: rgba(0,242,255,0.15); border-color: var(--accent-blue);
            color: var(--accent-blue);
        }
        #grit-lesson-wrapper .sls-editor-area {
            background: var(--bg-l2); color: var(--text-body);
            border: 1px solid var(--border-soft); border-radius: 0 0 12px 12px;
            min-height: 120px; padding: 1rem 1.25rem;
            caret-color: var(--accent-teal);
        }
        #grit-lesson-wrapper .sls-word-count { color: var(--text-subtle); }
        #grit-lesson-wrapper .sls-wc-good    { color: var(--accent-amber) !important; }
        #grit-lesson-wrapper .sls-wc-great   { color: var(--accent-green) !important; }

        /* ═══════════════════════════════════════════════════
           OPEN QUESTION (blue tint — analytical)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .sls-open-question {
            background: rgba(0,242,255,0.07);
            border: 2px solid rgba(0,242,255,0.22);
            border-radius: 18px;
            padding: 2rem 2.5rem; margin: 2.5rem 0;
        }
        #grit-lesson-wrapper .sls-open-question .sls-oq-question {
            color: #CFFAFE !important;
            font-weight: 600; margin-bottom: 1rem !important;
        }
        #grit-lesson-wrapper .sls-open-question p { color: var(--text-body) !important; }

        /* ═══════════════════════════════════════════════════
           GAMIFIED KNOWLEDGE CHECK QUIZ
           ═══════════════════════════════════════════════════ */
        .the-spark .grit-quiz-block, .the-story .grit-quiz-block,
        .the-grind .grit-quiz-block, .narrative-block .grit-quiz-block,
        .detail-block .grit-quiz-block {
            margin-left: -2rem !important; margin-right: -2rem !important;
        }
        #grit-lesson-wrapper .grit-quiz-block {
            background: #05080F;
            border-radius: 24px;
            padding: 2.5rem; margin: 3rem 0;
            border: 1px solid rgba(167,139,250,0.2);
            box-shadow: 0 4px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
            position: relative;
        }
        #grit-lesson-wrapper .grit-quiz-block::before {
            content: "🧠  KNOWLEDGE CHECK";
            display: block; font-size: 0.68rem; font-weight: 900;
            letter-spacing: 0.18em; color: var(--accent-gold); margin-bottom: 0.5rem;
        }
        #grit-lesson-wrapper .quiz-xp-badge {
            position: absolute; top: 1.5rem; right: 1.75rem;
            background: rgba(167,139,250,0.12); border: 1px solid rgba(167,139,250,0.28);
            color: var(--accent-gold); font-size: 0.72rem; font-weight: 900;
            letter-spacing: 0.08em; padding: 0.3rem 0.75rem; border-radius: 100px;
        }
        #grit-lesson-wrapper .quiz-question,
        #grit-lesson-wrapper .grit-quiz-block > p {
            font-size: 1.1rem !important; font-weight: 700 !important;
            color: #F8FAFC !important; margin: 1rem 0 1.5rem !important;
            line-height: 1.55;
        }
        #grit-lesson-wrapper .quiz-options { display: grid !important; gap: 0.65rem; }
        #grit-lesson-wrapper .quiz-btn {
            background: rgba(255,255,255,0.04); border: 2px solid rgba(255,255,255,0.1);
            color: #CBD5E1; padding: 1rem 1.25rem; border-radius: 12px;
            cursor: pointer; font-size: 0.95rem; text-align: left;
            transition: background 0.18s, border-color 0.18s, transform 0.12s;
            font-family: 'Inter', sans-serif; line-height: 1.45;
            display: flex; align-items: flex-start; gap: 0.85rem; min-height: 44px;
        }
        #grit-lesson-wrapper .quiz-btn .quiz-letter {
            width: 28px; height: 28px; min-width: 28px; border-radius: 50%;
            border: 2px solid rgba(255,255,255,0.2);
            display: flex; align-items: center; justify-content: center;
            font-size: 0.78rem; font-weight: 900; color: var(--text-muted);
            flex-shrink: 0;
            transition: background 0.18s, border-color 0.18s, color 0.18s;
        }
        #grit-lesson-wrapper .quiz-btn:hover:not([disabled]) {
            background: rgba(167,139,250,0.09); border-color: rgba(167,139,250,0.4);
            transform: translateX(4px); color: #F8FAFC;
        }
        #grit-lesson-wrapper .quiz-btn.quiz-selected {
            background: rgba(0,242,255,0.14); border-color: var(--accent-blue);
        }
        #grit-lesson-wrapper .quiz-btn.quiz-selected .quiz-letter {
            background: var(--accent-blue); border-color: var(--accent-blue); color: #fff;
        }
        #grit-lesson-wrapper .quiz-btn.quiz-correct {
            background: rgba(52,211,153,0.14) !important; border-color: var(--accent-green) !important;
        }
        #grit-lesson-wrapper .quiz-btn.quiz-correct .quiz-letter {
            background: var(--accent-green); border-color: var(--accent-green); color: #fff;
        }
        #grit-lesson-wrapper .quiz-btn.quiz-wrong {
            background: rgba(248,113,113,0.1) !important;
            border-color: var(--accent-red) !important; opacity: 0.7;
        }
        #grit-lesson-wrapper .quiz-btn.quiz-wrong .quiz-letter {
            background: var(--accent-red); border-color: var(--accent-red); color: #fff;
        }
        #grit-lesson-wrapper .quiz-submit {
            width: 100%;
            background: linear-gradient(135deg, var(--accent-blue), var(--accent-teal));
            color: #ffffff; border: none;
            padding: 1rem 2rem; border-radius: 12px; font-weight: 900;
            font-size: 1rem; cursor: pointer; margin-top: 0.75rem;
            transition: opacity 0.18s, transform 0.12s; min-height: 44px;
            font-family: 'Inter', sans-serif;
            letter-spacing: 0.04em;
        }
        #grit-lesson-wrapper .quiz-submit:hover:not([disabled]) { opacity: 0.88; transform: translateY(-2px); }
        #grit-lesson-wrapper .quiz-submit:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }
        #grit-lesson-wrapper .quiz-result {
            margin-top: 1.25rem; border-radius: 12px; padding: 1.25rem 1.5rem;
            font-size: 0.95rem; font-weight: 600; display: none;
        }
        #grit-lesson-wrapper .quiz-result.quiz-result-correct {
            background: rgba(52,211,153,0.12); border: 1px solid rgba(52,211,153,0.3);
            color: #A7F3D0;
        }
        #grit-lesson-wrapper .quiz-result.quiz-result-wrong {
            background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.25);
            color: #FECACA;
        }
        #grit-lesson-wrapper .quiz-guidance-text {
            margin-top: 0.75rem; font-size: 0.88rem;
            color: var(--text-muted); font-style: italic;
        }

        /* ═══════════════════════════════════════════════════
           KEY TAKEAWAY CARD
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .key-takeaway-card {
            background: #0F172A !important;
            border: 1px solid rgba(100,140,180,0.26) !important;
            border-radius: 18px !important; padding: 1.75rem 2rem !important; margin: 2rem 0 !important;
            box-shadow: 0 2px 12px rgba(0,0,0,0.3) !important;
        }
        #grit-lesson-wrapper .key-takeaway-card .kt-label {
            display: flex; align-items: center; gap: 0.6rem;
            font-size: 0.72rem; font-weight: 900; text-transform: uppercase;
            letter-spacing: 0.12em; color: var(--accent-gold); margin-bottom: 0.85rem;
        }
        #grit-lesson-wrapper .key-takeaway-card .kt-label::before { content: "💡"; font-size: 1rem; }
        #grit-lesson-wrapper .key-takeaway-card p {
            color: #CBD5E1 !important; font-style: italic; margin: 0 !important;
            font-size: 1.05rem !important; line-height: 1.75 !important;
        }

        /* ═══════════════════════════════════════════════════
           ACHIEVEMENT TOAST
           ═══════════════════════════════════════════════════ */
        #sls-achievement-toast {
            position: fixed; top: 1.5rem; left: 50%;
            transform: translateX(-50%) translateY(-140px);
            z-index: 999999;
            background: linear-gradient(135deg, #1A1033, #2A1A4D);
            border: 1px solid rgba(167,139,250,0.5);
            color: var(--accent-gold);
            padding: 0.85rem 1.75rem; border-radius: 2rem;
            box-shadow: 0 8px 40px rgba(0,0,0,0.7), 0 0 30px rgba(167,139,250,0.2);
            display: flex; align-items: center; gap: 0.75rem;
            font-weight: 700; font-size: 0.9rem;
            transition: transform 0.4s cubic-bezier(0.175,0.885,0.32,1.275);
            pointer-events: none;
        }
        #sls-achievement-toast.toast-visible { transform: translateX(-50%) translateY(0); }

        /* ═══════════════════════════════════════════════════
           SCROLL PROGRESS BAR
           ═══════════════════════════════════════════════════ */
        #gritProgress {
            position: fixed; left: 0; top: 0; width: 100%; height: 5px;
            background: rgba(255,255,255,0.05); z-index: 999999;
        }
        #gritBar {
            height: 100%;
            background: linear-gradient(90deg, var(--accent-blue), var(--accent-teal));
            width: 0%; transition: width 0.15s ease;
            box-shadow: 0 0 12px rgba(0,242,255,0.6);
        }
        .admin-bar #gritProgress { top: 32px; }
        @media screen and (max-width: 782px) { .admin-bar #gritProgress { top: 46px; } }

        /* ─────────────────────────────────────────────────
           PREV / NEXT NAV BAR
           ───────────────────────────────────────────────── */
        #popup-footer {
            position: static !important;
            bottom: auto !important; left: auto !important;
            right: auto !important; width: 100% !important;
            display: block !important; visibility: visible !important;
            height: auto !important; overflow: visible !important;
        }
        #popup-footer {
            background: linear-gradient(135deg, #010309 0%, #020617 100%) !important;
            border-top: 2px solid rgba(167,139,250,0.3) !important;
            padding: 2.5rem 3rem !important;
            box-sizing: border-box !important;
            font-family: 'Inter', sans-serif !important;
        }
        #popup-footer .course-item-nav {
            display: flex !important; justify-content: space-between !important;
            align-items: center !important; width: 100% !important; gap: 1rem !important;
        }
        #popup-footer .course-item-nav__name {
            display: block !important;
            font-size: 0.7rem !important; font-weight: 700 !important;
            letter-spacing: 0.15em !important; text-transform: uppercase !important;
            color: var(--text-subtle) !important; margin-bottom: 0.5rem !important;
        }
        #popup-footer .course-item-nav .prev a,
        #popup-footer .course-item-nav .next a {
            display: inline-flex !important; align-items: center !important;
            gap: 0.6rem !important; padding: 0.95rem 2.25rem !important;
            border-radius: 50px !important; font-size: 0.92rem !important;
            font-weight: 800 !important; letter-spacing: 0.06em !important;
            text-transform: uppercase !important; text-decoration: none !important;
            color: #ffffff !important; white-space: nowrap !important;
            transition: transform 0.2s ease, box-shadow 0.2s ease !important;
        }
        #popup-footer .course-item-nav .prev a {
            background: rgba(255,255,255,0.07) !important;
            border: 2px solid rgba(255,255,255,0.2) !important;
        }
        #popup-footer .course-item-nav .prev a:hover {
            background: rgba(255,255,255,0.14) !important;
            border-color: rgba(255,255,255,0.45) !important;
            transform: translateY(-2px) !important;
        }
        #popup-footer .course-item-nav .next a {
            border: 2px solid transparent !important;
            box-shadow: 0 4px 20px rgba(0,242,255,0.25) !important;
            background: linear-gradient(90deg, #155E75, #0E7490, #00F2FF, #0E7490, #155E75) !important;
            background-size: 200% auto !important;
            animation: sls-footer-shimmer 3s linear infinite !important;
        }
        #popup-footer .course-item-nav .next a:hover {
            transform: translateY(-3px) !important;
            box-shadow: 0 8px 30px rgba(0,242,255,0.5) !important;
        }
        @keyframes sls-footer-shimmer {
            0%   { background-position: -200% center; }
            100% { background-position:  200% center; }
        }
        @media (max-width: 640px) {
            #popup-footer { padding: 2rem 1.5rem !important; }
            #popup-footer .course-item-nav { flex-direction: column !important; align-items: stretch !important; }
            #popup-footer .course-item-nav .prev a,
            #popup-footer .course-item-nav .next a { justify-content: center !important; width: 100% !important; }
        }
        .content-item-scrollable, #learn-press-content-item {
            padding-bottom: 0 !important; margin-bottom: 0 !important;
        }

        /* ═══════════════════════════════════════════════════
           STAT ROW / DATA HIGHLIGHT
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .stat-row {
            background: #0F172A !important;
            border: 1px solid rgba(100,140,180,0.14) !important;
            border-radius: 18px !important; padding: 1.75rem 2rem !important;
            margin: 2rem 0 !important; display: flex !important; gap: 1.5rem !important;
            align-items: center !important; flex-wrap: wrap !important;
        }
        #grit-lesson-wrapper .stat-row .stat-number {
            font-size: 2.8rem; font-weight: 900;
            color: var(--accent-teal); line-height: 1;
            font-family: 'Orbitron', sans-serif;
        }
        #grit-lesson-wrapper .stat-row .stat-label { color: var(--text-muted); font-size: 0.9rem; }
        #grit-lesson-wrapper .stat-row p { color: var(--text-body) !important; }

        /* ═══════════════════════════════════════════════════
           FIELD NOTES (practitioner insight — warm)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .field-notes {
            background: rgba(167,139,250,0.08) !important;
            border: 1px solid rgba(167,139,250,0.22) !important;
            border-radius: 16px !important; padding: 1.75rem 2rem !important; margin: 2rem 0 !important;
        }
        #grit-lesson-wrapper .field-notes::before {
            content: "🔬  FIELD NOTES";
            display: block; font-size: 0.68rem; font-weight: 900;
            letter-spacing: 0.18em; color: var(--accent-amber); margin-bottom: 0.8rem;
        }
        #grit-lesson-wrapper .field-notes p,
        #grit-lesson-wrapper .field-notes li { color: #DDD6FE !important; }

        /* ═══════════════════════════════════════════════════
           WP PARAGRAPH FIXES
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper > p,
        .content-item-description > p { display: none !important; height: 0; margin: 0; }

        /* ═══════════════════════════════════════════════════
           IMAGE CONSTRAINTS
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper img { max-width: 100%; height: auto; display: block; }
        #grit-lesson-wrapper .lesson-image {
            margin: 2.5rem auto; max-width: 680px;
            border-radius: 16px; overflow: hidden;
            box-shadow: 0 8px 40px rgba(0,0,0,0.5);
            border: 1px solid var(--border-soft);
            /* Wiley charts/diagrams are transparent PNGs with dark text labels.
               A white surface keeps them readable on the dark page; opaque
               photos cover the white via object-fit:cover below. */
            background: #ffffff;
        }
        #grit-lesson-wrapper .lesson-image img {
            width: 100%; display: block; max-width: 100%;
            height: auto; object-fit: cover;
        }
        #grit-lesson-wrapper .image-caption {
            background: #0F172A !important; padding: 0.75rem 1.25rem !important;
            font-size: 0.85rem !important; color: #94A3B8 !important;
            border-top: 1px solid rgba(100,140,180,0.14) !important; font-style: italic !important;
        }
        #grit-lesson-wrapper .image-grid {
            display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 1rem; margin: 2.5rem 0;
            max-width: 900px; margin-left: auto; margin-right: auto;
        }
        #grit-lesson-wrapper .image-grid .lesson-image { margin: 0; max-width: 100%; }
        /* Bare images (no wrapper class) — respect intrinsic size so small
           Wiley callout icons don't blow up to 680px. Large figures still cap
           at 680px via max-width. The soft white card lets transparent-PNG
           charts (e.g. For Dummies FICO/diagrams) show their dark labels on
           the dark page; opaque photos cover it. */
        #grit-lesson-wrapper .the-grind img,
        #grit-lesson-wrapper .the-story img,
        #grit-lesson-wrapper .article-body > img {
            max-width: 680px; width: auto; height: auto;
            display: block; margin: 1.5rem auto;
            border-radius: 16px; box-shadow: 0 8px 40px rgba(0,0,0,0.5);
            border: 1px solid var(--border-soft);
            background: rgba(255,255,255,0.96);
            padding: 0.5rem;
        }

        /* ── Thumbnail images (decorative icons) ─────────── */
        #grit-lesson-wrapper .thumbnail-image {
            display: flex !important; align-items: flex-start !important;
            gap: 1rem !important; margin: 1.5rem 0 !important;
        }
        #grit-lesson-wrapper .thumbnail-image img,
        .thumbnail-image img {
            width: 52px !important; min-width: 52px !important; max-width: 52px !important;
            height: 52px !important; max-height: 52px !important;
            object-fit: contain !important; flex-shrink: 0 !important;
            border-radius: 8px !important; box-shadow: none !important;
            margin: 0 !important; padding: 0 !important;
            display: inline-block !important;
            /* Soft white card so the original (book-page) icon art reads cleanly
               on the dark page; was filter: brightness(0.9) which dimmed icons. */
            background: #ffffff !important;
        }
        #grit-lesson-wrapper .thumbnail-image .thumb-content { flex: 1; min-width: 0; }
        #grit-lesson-wrapper .thumbnail-image h3,
        #grit-lesson-wrapper .thumbnail-image h4 { margin-top: 0.1rem; margin-bottom: 0.4rem; }

        /* ═══════════════════════════════════════════════════
           TABLES — override Wiley EPUB inline styles
           Wiley/For Dummies tables come through with inline bgcolor/style
           on rows and cells ("background:#ffffff", "color:#000", etc.) that
           fight the dark theme — alternating rows render LIGHT on the dark
           page while the cell text inherits LIGHT from the theme = invisible
           "white-on-white". These rules win on specificity + !important so
           the table always uses the Nexus palette regardless of what the
           EPUB extractor preserved.
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper table {
            width: 100% !important; max-width: 100% !important;
            border-collapse: collapse !important;
            background: transparent !important;
            color: var(--text-body) !important;
            margin: 1.75rem 0 !important;
            font-size: 0.95rem !important;
            font-family: 'Inter', sans-serif !important;
        }
        #grit-lesson-wrapper table caption {
            color: var(--text-primary) !important;
            font-weight: 700 !important; text-align: left !important;
            margin-bottom: 0.75rem !important;
            font-size: 0.95rem !important;
        }
        /* Header row — themed regardless of EPUB inline colour. Covers both
           proper <thead><th> and tables where the first <tr> has <th>s. */
        #grit-lesson-wrapper table thead th,
        #grit-lesson-wrapper table > thead > tr > th,
        #grit-lesson-wrapper table > tbody > tr:first-child > th,
        #grit-lesson-wrapper table > tr:first-child > th {
            background: var(--bg-l3) !important;
            color: var(--text-primary) !important;
            text-align: left !important;
            border: 1px solid var(--border-mid) !important;
            padding: 0.85rem 1rem !important;
            font-weight: 700 !important;
        }
        /* Neutralise inline row backgrounds (Wiley alternates "background:#fff" /
           "background:#f3f4f6" / similar on rows) so zebra below wins. */
        #grit-lesson-wrapper table tbody tr,
        #grit-lesson-wrapper table tr,
        #grit-lesson-wrapper table tr[style],
        #grit-lesson-wrapper table tr[bgcolor],
        #grit-lesson-wrapper table tr[class] {
            background: transparent !important;
        }
        #grit-lesson-wrapper table td,
        #grit-lesson-wrapper table td[style],
        #grit-lesson-wrapper table td[bgcolor],
        #grit-lesson-wrapper table th[style] {
            background: transparent !important;
            color: var(--text-body) !important;
            border: 1px solid var(--border-soft) !important;
            padding: 0.75rem 1rem !important;
            vertical-align: top !important;
        }
        /* Zebra: every other body row gets the raised surface so rows are
           readable without relying on any inline EPUB colours. */
        #grit-lesson-wrapper table tbody tr:nth-child(odd) td {
            background: var(--bg-l2) !important;
        }
        /* Strong cells/links inside tables — keep readable. */
        #grit-lesson-wrapper table strong,
        #grit-lesson-wrapper table b { color: var(--text-primary) !important; }
        #grit-lesson-wrapper table a { color: var(--accent-teal) !important; }

        /* ═══════════════════════════════════════════════════
           CONNECTION CARD — "recall a concept from an earlier lesson"
           Generator markup: .connection-card > .cc-icon + .cc-body(.cc-label,p)
           ═══════════════════════════════════════════════════ */
        #grit-lesson-wrapper .connection-card {
            display: flex; align-items: flex-start; gap: 1rem;
            background: rgba(0,242,255,0.05);
            border: 1px solid rgba(0,242,255,0.22);
            border-left: 4px solid var(--accent-blue);
            border-radius: 14px;
            padding: 1.1rem 1.4rem;
            margin: 1.75rem 0;
        }
        #grit-lesson-wrapper .connection-card .cc-icon { flex-shrink: 0; font-size: 1.4rem; line-height: 1.4; }
        #grit-lesson-wrapper .connection-card .cc-icon img.emoji { width: 1.2em; height: 1.2em; vertical-align: -0.18em; }
        #grit-lesson-wrapper .connection-card .cc-body { flex: 1; min-width: 0; }
        #grit-lesson-wrapper .connection-card .cc-label {
            font-size: 0.66rem; font-weight: 800; letter-spacing: 0.16em;
            text-transform: uppercase; color: var(--accent-blue); margin-bottom: 0.4rem;
        }
        #grit-lesson-wrapper .connection-card p,
        #grit-lesson-wrapper .connection-card li { color: var(--text-body) !important; margin: 0; }

        /* ═══════════════════════════════════════════════════
           TTS READER — floating Web Speech player. Markup is emitted in the
           lesson (theme-native generator); behaviour is wired by lesson.js
           slsInitTts(). #sls-tts-player is position:fixed (outside the wrapper).
           ═══════════════════════════════════════════════════ */
        .sls-tts-player {
            position: fixed; bottom: 2rem; left: 2rem; z-index: 9990;
            display: inline-flex; align-items: center; gap: 0.5rem;
            background: var(--bg-l3, #1E293B);
            border: 1px solid rgba(0,242,255,0.35);
            border-radius: 50px;
            box-shadow: 0 4px 22px rgba(0,0,0,0.45);
            padding: 0.55rem 1.2rem;
            font-family: 'Inter', sans-serif; font-size: 0.85rem;
            color: #F8FAFC !important; line-height: 1 !important;
            transition: box-shadow 0.2s ease, transform 0.2s ease;
        }
        .sls-tts-player:hover { box-shadow: 0 6px 30px rgba(0,242,255,0.30); transform: translateY(-2px); }
        .sls-tts-listen {
            display: inline-flex; align-items: center; gap: 0.4rem;
            background: none; border: none; color: #F8FAFC;
            font-size: 0.82rem; font-weight: 600; cursor: pointer;
            padding: 0; letter-spacing: 0.04em; line-height: 1;
        }
        .sls-tts-listen:hover { color: var(--accent-blue, #00F2FF); }
        .sls-tts-icon { flex-shrink: 0; }
        .sls-tts-controls { align-items: center; gap: 0.45rem; }
        .sls-tts-ctrl {
            background: rgba(0,242,255,0.12); border: 1px solid rgba(0,242,255,0.30);
            color: #F8FAFC; border-radius: 50%; width: 1.9rem; height: 1.9rem;
            display: inline-flex; align-items: center; justify-content: center;
            cursor: pointer; font-size: 0.75rem; padding: 0; flex-shrink: 0;
            line-height: 1; transition: background 0.15s;
        }
        .sls-tts-ctrl:hover { background: rgba(0,242,255,0.28); }
        .sls-tts-speed {
            background: rgba(0,242,255,0.10); border: 1px solid rgba(0,242,255,0.28);
            color: #F8FAFC; border-radius: 20px; padding: 0.22rem 0.55rem;
            font-size: 0.76rem; cursor: pointer; outline: none;
        }
        .sls-tts-speed option { background: var(--bg-l2, #0F172A); color: #F8FAFC; }
        .sls-tts-status {
            color: var(--accent-violet, #A78BFA); font-size: 0.76rem; font-weight: 700;
            min-width: 4.5rem; white-space: nowrap; letter-spacing: 0.02em;
        }
        #sls-tts-player * { box-sizing: border-box !important; }

        /* ═══════════════════════════════════════════════════
           RESPONSIVE
           ═══════════════════════════════════════════════════ */
        @media (max-width: 768px) {
            #grit-lesson-wrapper .full-width-section,
            #grit-lesson-wrapper .hero-card,
            #grit-lesson-wrapper .shift-section { padding: 3rem 6% !important; }
            #grit-lesson-wrapper h1              { font-size: 1.9rem !important; }
            #grit-lesson-wrapper .pull-quote     { padding: 2rem 1.5rem; }
            #grit-lesson-wrapper .before-after   { grid-template-columns: 1fr; }
            #grit-lesson-wrapper .aside-block    { float: none; width: 100%; margin: 0 0 1.5rem; }
            #grit-lesson-wrapper .big-question   { padding: 2rem; }
            #grit-lesson-wrapper .hero-content   { padding: 2rem 1.5rem 2.5rem; }
        }
