    /* ===========================================================
       Lesson Mode Layout - Desktop Only
       When the Lesson button is clicked, UI elements shift to the left
       =========================================================== */

    /* Desktop-only lesson mode styles (min-width: 769px) */
    @media (min-width: 769px) {

        /* ============ TTS Overlay - Move to Top-Left Corner ============ */
        body.lesson-mode-active #tts-overlay-host {
            top: 20px !important;
            bottom: auto !important;
            left: 20px !important;
            right: auto !important;
            transform: none !important;
            transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        }

        /* Volume slider opens BELOW the button (not upward) when at top of screen */
        body.lesson-mode-active #tts-overlay-host::part(vol-box) {
            bottom: auto !important;
            top: calc(100% + 10px) !important;
            transform: translateY(0) !important;
        }

        /* ============ Chat UI - Constrained to Left 50% of Screen ============ */
        /* All chat-related elements fit within the left half (50vw) with 20px margin */

        body.lesson-mode-active .chat-container {
            left: 20px !important;
            right: auto !important;
            transform: none !important;
            width: calc(50vw - 40px) !important;
            max-width: calc(50vw - 40px) !important;
            min-width: 280px !important;
            transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        }

        body.lesson-mode-active .chat-container.chat-focused {
            left: 20px !important;
            transform: none !important;
        }

        body.lesson-mode-active .chat-header {
            left: 20px !important;
            right: auto !important;
            transform: none !important;
            width: calc(50vw - 40px) !important;
            max-width: calc(50vw - 40px) !important;
            min-width: 280px !important;
            transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        }

        body.lesson-mode-active .floating-mic-container {
            left: 20px !important;
            right: auto !important;
            transform: none !important;
            width: calc(50vw - 40px) !important;
            max-width: calc(50vw - 40px) !important;
            min-width: 280px !important;
            transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        }

        body.lesson-mode-active .standalone-action-buttons-container {
            left: 20px !important;
            right: auto !important;
            transform: none !important;
            width: calc(50vw - 40px) !important;
            max-width: calc(50vw - 40px) !important;
            min-width: 280px !important;
            transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        }

        /* ============ Chat Close Button - Move to Top-Left ============ */
        body.lesson-mode-active .chat-header .exit-chat-btn,
        body.lesson-mode-active #exit-chat-btn {
            position: absolute !important;
            left: 12px !important;
            right: auto !important;
            top: 6px !important;
            margin: 0 !important;
        }

        body.lesson-mode-active .chat-header-top {
            justify-content: flex-start !important;
            padding-left: 50px !important;
        }

        /* ============ Hide Timeline Event Notification ============ */
        body.lesson-mode-active .bio-notification,
        body.lesson-mode-active .timeline-notification,
        body.lesson-mode-active .bio-button .notification-dot,
        body.lesson-mode-active #bio-button .notification-dot,
        body.lesson-mode-active #bio-button-lab .notification-dot {
            display: none !important;
            opacity: 0 !important;
            visibility: hidden !important;
        }

        /* ============ Chat Header Buttons - Smaller & Compact ============ */
        body.lesson-mode-active .chat-header-buttons {
            gap: 4px !important;
            padding: 4px 8px !important;
        }

        body.lesson-mode-active .chat-header-buttons button,
        body.lesson-mode-active .chat-header-buttons .btn {
            font-size: 11px !important;
            padding: 4px 8px !important;
            min-width: auto !important;
            height: auto !important;
            line-height: 1.2 !important;
        }

        body.lesson-mode-active .chat-header-buttons button i,
        body.lesson-mode-active .chat-header-buttons .btn i {
            font-size: 11px !important;
        }

        /* ============ 3D Canvas/Character - Shift Left ============ */
        body.lesson-mode-active #canvas-container,
        body.lesson-mode-active canvas#viewer {
            transform: translateX(-15vw) !important;
            transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) !important;
        }

        /* ============ Lesson Button Active State ============ */
        body.lesson-mode-active #lesson-hub-button {
            background: rgba(201, 162, 39, 0.3) !important;
            border-color: rgba(201, 162, 39, 0.6) !important;
            box-shadow: 0 0 10px rgba(201, 162, 39, 0.3);
        }

        /* ============ Lesson Hub (Right 50% of Screen) ============ */
        body.lesson-mode-active #hist-sheet {
            right: 0 !important;
            left: auto !important;          /* reset any previous left */
            width: 50vw !important;
            max-width: 1400px !important;   /* optional cap */
        }

        body.lesson-mode-active #hist-overlay {
            right: 0 !important;
            left: auto !important;
            width: 50vw !important;
        }
    }

    /* ============ Mobile - Lesson Hub Full Width ============ */
    @media (max-width: 768px) {
        /* Lesson hub takes full width on mobile */
        body.lesson-mode-active #hist-sheet {
            left: 0 !important;
            right: 0 !important;
            width: 100vw !important;
        }

        body.lesson-mode-active #hist-overlay {
            left: 0 !important;
            right: 0 !important;
            width: 100vw !important;
        }

        /* Chat elements keep their default centered position on mobile */
        body.lesson-mode-active .chat-container,
        body.lesson-mode-active .floating-mic-container,
        body.lesson-mode-active .standalone-action-buttons-container,
        body.lesson-mode-active .chat-header {
            left: 50% !important;
            transform: translateX(-50%) !important;
            width: auto !important;
            max-width: none !important;
        }
    }

    /* ============ Smooth Transitions When Exiting Lesson Mode ============ */
    .chat-container,
    .floating-mic-container,
    .standalone-action-buttons-container,
    .chat-header,
    #canvas-container,
    canvas#viewer,
    #tts-overlay-host {
        transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    }

    .exit-chat-btn,
    #exit-chat-btn {
        transition: all 0.3s ease;
    }
