        /* ==========================================================================
           STAGE MODE INNOVATIONS - Bento Layouts, Build Animations, 2D Transitions
           ========================================================================== */

        /* --- Innovation 1: Bento Slide Layouts --- */
        .focus-mode-overlay.stage-mode-active .stage-bento-split {
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-template-rows: auto 1fr;
            gap: 1.5rem;
            width: 100%;
            max-width: 95vw;
            min-height: 60vh;
            align-items: start;
            padding: 2rem;
            box-sizing: border-box;
        }

        .focus-mode-overlay.stage-mode-active .stage-bento-split>*:first-child {
            grid-column: 1 / -1;
            text-align: center;
        }

        .focus-mode-overlay.stage-mode-active .stage-bento-split .image-container {
            width: 100%;
            height: auto;
            max-height: 50vh;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border-radius: var(--border-radius-lg);
        }

        .focus-mode-overlay.stage-mode-active .stage-bento-split .image-container img {
            max-width: 100%;
            max-height: 50vh;
            object-fit: contain;
            border-radius: var(--border-radius);
        }

        .focus-mode-overlay.stage-mode-active .stage-bento-split-alt {
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-template-rows: auto 1fr;
            gap: 1.5rem;
            width: 100%;
            max-width: 95vw;
            min-height: 60vh;
            align-items: start;
            padding: 2rem;
            box-sizing: border-box;
        }

        .focus-mode-overlay.stage-mode-active .stage-bento-split-alt>*:first-child {
            grid-column: 1 / -1;
            text-align: center;
        }

        /* Alternate layout: Text on left, Image on right */
        .focus-mode-overlay.stage-mode-active .stage-bento-split-alt .bento-text-content {
            order: 1;
        }

        .focus-mode-overlay.stage-mode-active .stage-bento-split-alt .image-container {
            order: 2;
            width: 100%;
            height: auto;
            max-height: 50vh;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: hidden;
            border-radius: var(--border-radius-lg);
        }

        /* Hero Image Slide - Full width image with centered positioning */
        .focus-mode-overlay.stage-mode-active .stage-hero-image {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            min-height: 70vh;
            padding: 2rem;
            box-sizing: border-box;
        }

        .focus-mode-overlay.stage-mode-active .stage-hero-image .image-container {
            max-width: 85vw;
            max-height: 75vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .focus-mode-overlay.stage-mode-active .stage-hero-image .image-container img {
            max-width: 100%;
            max-height: 70vh;
            object-fit: contain;
            border-radius: var(--border-radius-lg);
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
        }

        /* Mobile responsiveness for Bento layouts */
        @media (max-width: 768px) {

            .focus-mode-overlay.stage-mode-active .stage-bento-split,
            .focus-mode-overlay.stage-mode-active .stage-bento-split-alt {
                grid-template-columns: 1fr;
                gap: 1rem;
                padding: 1rem;
            }

            .focus-mode-overlay.stage-mode-active .stage-bento-split-alt .bento-text-content,
            .focus-mode-overlay.stage-mode-active .stage-bento-split-alt .image-container {
                order: unset;
            }
        }

        /* --- Innovation 2: List Build Animations --- */
        .focus-mode-overlay.stage-mode-active li.stage-build-hidden {
            opacity: 0;
            transform: translateY(12px);
            pointer-events: none;
        }

        .focus-mode-overlay.stage-mode-active li.stage-build-visible {
            opacity: 1;
            transform: translateY(0);
            transition: opacity 0.45s cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1.0);
        }

        /* Ensure list items have proper spacing during animation */
        .focus-mode-overlay.stage-mode-active ul,
        .focus-mode-overlay.stage-mode-active ol {
            overflow: visible;
        }

        .focus-mode-overlay.stage-mode-active li {
            transition: opacity 0.45s cubic-bezier(0.25, 0.1, 0.25, 1.0),
                transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1.0);
        }

        /* --- Innovation 3: 2D Camera Transitions --- */
        .stage-camera-viewport {
            position: relative;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }

        .stage-camera-canvas {
            position: absolute;
            top: 0;
            left: 0;
            will-change: transform;
            transition: transform 0.7s cubic-bezier(0.25, 0.1, 0.25, 1.0);
        }

        .stage-camera-slide {
            position: absolute;
            width: 100vw;
            height: calc(100vh - 100px);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            padding: 2rem;
            box-sizing: border-box;
            overflow-y: auto;
            overflow-x: hidden;
        }

        /* Disable default scrolling when 2D camera is active */
        .focus-mode-overlay.stage-mode-active.stage-camera-active .focus-mode-body {
            overflow: hidden !important;
            scroll-behavior: auto !important;
        }

        /* Slide positioning uses CSS custom properties set by JS */
        .stage-camera-slide {
            left: calc(var(--slide-x, 0) * 100vw);
            top: calc(var(--slide-y, 0) * (100vh - 100px));
        }

        /* Smooth camera pan indicator for user feedback */
        .focus-mode-overlay.stage-mode-active.stage-camera-active .stage-camera-canvas::after {
            content: '';
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%);
            width: 60px;
            height: 4px;
            background: linear-gradient(90deg,
                    transparent 0%,
                    var(--primary-color) 50%,
                    transparent 100%);
            border-radius: 2px;
            opacity: 0;
            transition: opacity 0.3s ease;
            pointer-events: none;
        }

        .focus-mode-overlay.stage-mode-active.stage-camera-active.is-transitioning .stage-camera-canvas::after {
            opacity: 0.6;
        }

        /* --- Sigma Article Mode: Navigation Transition Effect --- */
        /* Subtle fade-pulse effect for presentation-like feel during scroll navigation */
        .focus-mode-overlay.sigma-mode-article .focus-mode-body {
            transition: opacity 0.25s ease-out;
        }

        .focus-mode-overlay.sigma-mode-article.article-nav-transitioning .focus-mode-body {
            opacity: 0.6;
        }

        /* Progress indicator for Article mode navigation */
        .focus-mode-overlay.sigma-mode-article::after {
            content: '';
            position: fixed;
            top: 50%;
            left: 50%;
            width: 0;
            height: 0;
            background: radial-gradient(circle, rgba(var(--primary-color-rgb), 0.15) 0%, transparent 70%);
            border-radius: 50%;
            transform: translate(-50%, -50%);
            pointer-events: none;
            opacity: 0;
            transition: width 0.35s ease-out, height 0.35s ease-out, opacity 0.35s ease-out;
            z-index: 9999;
        }

        .focus-mode-overlay.sigma-mode-article.article-nav-transitioning::after {
            width: 200px;
            height: 200px;
            opacity: 1;
        }

        /* Smooth scroll with enhanced easing for article mode */
        .focus-mode-overlay.sigma-mode-article .focus-mode-body {
            scroll-behavior: smooth;
        }

        /* Stage Mode Timer - Premium 3D & Aesthetic */
        .stage-timer-widget {
            position: fixed;
            top: 70px;
            right: 20px;
            background: rgba(var(--bg-secondary-rgb), 0.75);
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
            border: 1.5px solid rgba(var(--primary-color-rgb), 0.25);
            border-radius: 22px;
            padding: 1.1rem;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            box-shadow:
                0 8px 16px -4px rgba(0, 0, 0, 0.1),
                0 4px 8px -2px rgba(0, 0, 0, 0.06),
                inset 0 0 0 1px rgba(255, 255, 255, 0.15),
                0 0 0 0 rgba(var(--primary-color-rgb), 0);
            z-index: 10001;
            width: 135px;
            height: 135px;
            color: var(--text-primary);
            transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.3s ease,
                transform 0.2s ease;
            cursor: grab;
            overflow: hidden;
            user-select: none;
        }

        .stage-timer-widget:hover {
            transform: translateY(-3px) scale(1.03);
            background: rgba(var(--bg-secondary-rgb), 0.95);
            box-shadow:
                0 12px 28px -6px rgba(var(--primary-color-rgb), 0.3),
                0 8px 16px -4px rgba(0, 0, 0, 0.15),
                inset 0 0 0 1px rgba(255, 255, 255, 0.2),
                0 0 20px rgba(var(--primary-color-rgb), 0.15);
            border-color: rgba(var(--primary-color-rgb), 0.5);
        }

        /* SVG Progress Bar */
        .stage-timer-progress-svg {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 0;
            overflow: visible;
        }

        .stage-timer-progress-bg {
            fill: none;
            stroke: rgba(var(--text-primary-rgb), 0.1);
            stroke-width: 4;
        }

        .stage-timer-progress-fg {
            fill: none;
            stroke: var(--primary-color);
            stroke-width: 4;
            stroke-linecap: round;
            stroke-dasharray: 283;
            stroke-dashoffset: 0;
            transition: stroke-dashoffset 1s linear, stroke 0.3s ease;
            transform-origin: 50% 50%;
        }

        .stage-timer-widget.critical .stage-timer-progress-fg {
            stroke: var(--danger-color);
            filter: drop-shadow(0 0 4px rgba(var(--danger-color-rgb), 0.5));
        }

        .stage-timer-widget.critical .stage-timer-display-visual,
        .stage-timer-widget.critical .stage-timer-input {
            color: var(--danger-color);
        }

        .stage-timer-widget.running {
            border-color: var(--primary-color);
            border-width: 2px;
            box-shadow:
                0 12px 32px -8px rgba(var(--primary-color-rgb), 0.4),
                0 0 0 1px rgba(var(--primary-color-rgb), 0.4);
            background: rgba(var(--bg-secondary-rgb), 0.98);
            backdrop-filter: blur(20px);
            -webkit-backdrop-filter: blur(20px);
            animation: timer-pulse-soft 3s ease-in-out infinite;
            transform-style: preserve-3d;
            perspective: 1000px;
        }

        .stage-timer-widget.finished {
            border-color: var(--danger-color);
            border-width: 2px;
            background: rgba(var(--bg-secondary-rgb), 0.95);
            box-shadow:
                0 12px 32px -8px rgba(var(--danger-color-rgb), 0.5),
                0 0 0 1px rgba(var(--danger-color-rgb), 0.5);
            animation: timer-finished-glow 2s ease-in-out infinite;
        }

        .stage-timer-widget.finished .stage-timer-status {
            opacity: 1 !important;
            transform: translateY(0) !important;
        }

        .stage-timer-widget.finished .stage-timer-progress-fg {
            stroke: var(--danger-color);
            stroke-dashoffset: 283;
        }

        .stage-timer-widget.finished .stage-timer-display-visual,
        .stage-timer-widget.finished .stage-timer-label,
        .stage-timer-widget.finished .stage-timer-status,
        .stage-timer-widget.finished .stage-timer-input {
            color: var(--danger-color) !important;
            text-shadow: 0 2px 10px rgba(var(--danger-color-rgb), 0.25);
        }

        .stage-timer-widget.running .stage-timer-label {
            opacity: 0;
            transform: translateY(-5px);
            pointer-events: none;
        }

        .stage-timer-widget .stage-timer-label {
            transition: all 0.3s ease;
        }

        /* 3D Visual Display Container */
        .stage-timer-display-visual {
            display: none;
            font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
            font-size: 4rem;
            font-weight: 800;
            line-height: 1;
            color: var(--primary-color);
            text-align: center;
            width: 100%;
            height: 64px;
            perspective: 800px;
            transform-style: preserve-3d;
            text-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            letter-spacing: -0.02em;
            font-variant-numeric: tabular-nums;
        }

        .stage-timer-widget.running .stage-timer-display-visual {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Hide generic input when running */
        .stage-timer-widget.running .stage-timer-input {
            display: none;
        }

        /* Digit Animation - Smooth 3D Flip */
        .stage-timer-digit {
            display: inline-block;
            animation: digit-flip-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.25);
            backface-visibility: hidden;
            transform-origin: center bottom;
        }

        @keyframes digit-flip-in {
            0% {
                opacity: 0;
                transform: rotateX(-90deg) translateY(20px) scale(0.9);
            }

            100% {
                opacity: 1;
                transform: rotateX(0deg) translateY(0) scale(1);
            }
        }

        @keyframes timer-pulse-soft {

            0%,
            100% {
                box-shadow:
                    0 12px 32px -8px rgba(var(--primary-color-rgb), 0.4),
                    0 0 0 1px rgba(var(--primary-color-rgb), 0.4);
                transform: scale(1);
            }

            50% {
                box-shadow:
                    0 15px 40px -8px rgba(var(--primary-color-rgb), 0.5),
                    0 0 0 1px rgba(var(--primary-color-rgb), 0.6);
                transform: scale(1.02);
            }
        }

        @keyframes timer-finished-glow {

            0%,
            100% {
                transform: scale(1);
                box-shadow:
                    0 12px 32px -8px rgba(var(--danger-color-rgb), 0.5),
                    0 0 0 2px rgba(var(--danger-color-rgb), 0.6);
            }

            50% {
                transform: scale(1.03);
                box-shadow:
                    0 15px 40px -8px rgba(var(--danger-color-rgb), 0.6),
                    0 0 0 3px rgba(var(--danger-color-rgb), 0.4);
            }
        }

        .stage-timer-widget.hidden {
            display: none;
            opacity: 0;
            transform: scale(0.5);
            pointer-events: none;
        }

        .stage-timer-label {
            font-size: 0.65rem;
            opacity: 0.8;
            text-transform: uppercase;
            letter-spacing: 2px;
            font-weight: 700;
            color: var(--text-secondary);
        }

        .stage-timer-input {
            font-family: var(--font-display), sans-serif;
            font-size: 4rem;
            font-weight: 800;
            line-height: 1;
            font-variant-numeric: tabular-nums;
            color: var(--text-primary);
            background: transparent;
            border: none;
            text-align: center;
            width: 100%;
            outline: none;
            padding: 0;
            margin: 0;
            cursor: pointer;
            /* Pointer to indicate clickable */
            transition: opacity 0.2s ease, text-shadow 0.2s ease;
        }

        .stage-timer-input:hover {
            color: var(--primary-color);
        }

        .stage-timer-widget:active {
            cursor: grabbing;
        }

        .stage-timer-input::selection {
            background: rgba(var(--primary-color-rgb), 0.2);
            color: var(--primary-color);
        }

        /* Remove arrows from number input */
        .stage-timer-input::-webkit-outer-spin-button,
        .stage-timer-input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        .stage-timer-status {
            font-size: 0.75rem;
            color: var(--text-secondary);
            font-weight: 500;
            opacity: 0;
            transform: translateY(5px);
            transition: all 0.2s ease;
            height: 1rem;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .stage-timer-widget:hover .stage-timer-status,
        .stage-timer-widget.running .stage-timer-status {
            opacity: 1;
            transform: translateY(0);
        }

        /* Ring around timer - Visual only */
        .stage-timer-ring {
            position: absolute;
            top: -3px;
            left: -3px;
            width: calc(100% + 6px);
            height: calc(100% + 6px);
            pointer-events: none;
            border-radius: 24px;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .stage-timer-widget.running .stage-timer-ring {
            opacity: 0;
        }

        .stage-timer-widget.finished .stage-timer-ring {
            opacity: 0.9;
            background: conic-gradient(from 0deg,
                    var(--danger-color),
                    rgba(var(--danger-color-rgb), 0.4),
                    transparent,
                    rgba(var(--danger-color-rgb), 0.4),
                    var(--danger-color));
            animation: timer-ring-rotate 2s linear infinite;
            -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            -webkit-mask-composite: xor;
            mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
            mask-composite: exclude;
            padding: 2.5px;
        }

        @keyframes timer-ring-rotate {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }

        .laser-pointer {
            position: fixed;
            width: 15px;
            height: 15px;
            background-color: rgba(255, 20, 20, 0.8);
            border: 2px solid white;
            border-radius: 50%;
            box-shadow: 0 0 15px 5px rgba(255, 20, 20, 0.5);
            pointer-events: none;
            z-index: 99999;
            transform: translate(-50%, -50%);
            transition: transform 0.05s ease-out;
            display: none;
        }

        .focus-mode-body .is-visible.spotlight {
            opacity: 1 !important;
            transform: scale(1.03);
            box-shadow: 0 0 25px rgba(var(--primary-color-rgb), 0.5);
        }

        /* NEW: Style for keyboard-navigated spotlight */
        @keyframes glow-focus {
            from {
                box-shadow: 0 0 4px -2px var(--primary-color);
            }

            to {
                box-shadow: 0 0 13px 2.5px color-mix(in srgb, var(--primary-color) 60%, transparent);
            }
        }

        .focus-mode-body .spotlight-key-focus,
        .focus-mode-body .snippet:focus,
        .focus-mode-body .snippet:hover,
        .focus-mode-body .nk-accordion.spotlight-key-focus,
        .focus-mode-body .nk-accordion:focus {
            outline: none;
            box-shadow: 0 0 0 2px var(--primary-color), 0 4px 12px rgba(0, 0, 0, 0.15);
            animation: glow-focus 4.5s infinite alternate;
            border-color: var(--primary-color) !important;
        }

        .focus-mode-body .nk-mcq-block.spotlight-key-focus,
        .focus-mode-body .nk-mcq-block:focus {
            outline: none;
            box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 40%, transparent), 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .focus-mode-body .spotlight-key-focus,
        .focus-mode-body .snippet:focus,
        .focus-mode-body .snippet:hover {
            border: 2px solid var(--primary-color) !important;
            animation: glow-focus 4.5s infinite alternate;
        }

        /* --- NEW: Cinematic Effects --- */
        .focus-mode-overlay.cinematic-active .focus-mode-body .snippet.is-visible,
        .focus-mode-overlay.cinematic-active .focus-mode-body .nk-mcq-block.is-visible,
        .focus-mode-overlay.cinematic-active .focus-mode-body .nk-accordion.is-visible {
            opacity: 0.20;
            transform: translateY(10px) scaleY(1) scaleX(1);
            transition: opacity 0.4s ease-out, transform 0.4s ease-out, box-shadow 0.4s ease-out;
        }

        .focus-mode-overlay.cinematic-active .focus-mode-body .snippet.is-revealing,
        .focus-mode-overlay.cinematic-active .focus-mode-body .nk-mcq-block.is-revealing,
        .focus-mode-overlay.cinematic-active .focus-mode-body .nk-accordion.is-revealing {
            opacity: 1;
            transform: translateY(0) scaleY(1.03) scaleX(1.01);
            box-shadow: 0 8px 20px -5px rgba(0, 0, 0, 0.2);
            z-index: 10;
        }

        .reveal-word {
            opacity: 0;
            transition: opacity 0.2s ease-in-out;
        }

        .reveal-word.visible {
            opacity: 1;
        }

        /* Ken Burns effect for images remains, but is now more subtle */
        @keyframes ken-burns {
            0% {
                transform: scale(1.0) translate(0, 0);
            }

            100% {
                transform: scale(1.05) translate(1%, -1%);
            }
        }

        /* The Ken Burns animation now only applies to the snippet being revealed */
        .focus-mode-overlay.cinematic-active .snippet.is-revealing .image-container {
            overflow: hidden;
        }

        .focus-mode-overlay.cinematic-active .snippet.is-revealing .image-container img {
            animation: ken-burns 20s ease-in-out infinite alternate;
        }

        /* --- NEW: Blackout Screen --- */
        #blackout-screen {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: #000;
            z-index: 20002;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s ease-in-out;
        }

        .focus-mode-overlay.blackout-active #blackout-screen {
            opacity: 1;
            pointer-events: auto;
        }

        /* --- NEW: Spotlight Effect --- */
        .focus-mode-body.spotlight-active .snippet.is-visible:not(.spotlight),
        .focus-mode-body.spotlight-active .nk-mcq-block.is-visible:not(.spotlight) {
            opacity: 0.1 !important;
            transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
        }

        .focus-mode-body .is-visible.spotlight {
            opacity: 1 !important;
            transform: scale(1.03);
            box-shadow: 0 0 25px rgba(var(--primary-color-rgb), 0.5);
        }

        /* --- NEW: Live Annotation --- */
        .focus-mode-body {
            position: relative;
        }

        #annotation-canvas {
            position: absolute;
            top: 0;
            left: 0;
            max-width: 100%;
            z-index: 10;
            pointer-events: none;
        }

        .focus-mode-overlay.annotation-active #annotation-canvas {
            pointer-events: auto;
            cursor: crosshair;
        }

        .stage-mode-controls .btn-icon.annotation-btn.active {
            color: var(--text-on-primary);
            background-color: var(--primary-color);
        }

        /* --- UPGRADED: Teleprompter Mode (for Stage Mode) --- */
        .focus-mode-overlay.teleprompter-active {
            flex-direction: row;
            padding: 0;
        }

        #teleprompter-sidebar {
            position: relative;
            width: 30%;
            height: 100%;
            flex-shrink: 0;
            background-color: rgba(var(--bg-secondary-rgb), 0.7);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border-right: 1px solid var(--border-color);
            overflow-y: auto;
            overflow-x: hidden;
            padding: 3rem 0.3rem 1.5rem 0.6rem;
            font-family: var(--article-font-family);
            font-size: var(--teleprompter-font-size, 1.1rem);
            line-height: 1.6;
            animation: fadeIn 0.3s ease-out;
            z-index: 20002;
            white-space: normal;
            word-wrap: break-word;
            overflow-wrap: break-word;
            color: var(--text-primary);
            mask-image: linear-gradient(to bottom,
                    transparent 0%,
                    black 15%,
                    black 85%,
                    transparent 100%);
            scroll-behavior: smooth;
        }

        /* --- NEW: Aesthetic Teleprompter Scrollbar --- */
        #teleprompter-sidebar::-webkit-scrollbar {
            width: 8px;
        }

        #teleprompter-sidebar::-webkit-scrollbar-track {
            background: transparent;
        }

        #teleprompter-sidebar::-webkit-scrollbar-thumb {
            background-color: var(--border-color);
            border-radius: 4px;
            border: 2px solid transparent;
            background-clip: content-box;
        }

        #teleprompter-sidebar::-webkit-scrollbar-thumb:hover {
            background-color: var(--primary-color);
        }

        #teleprompter-sidebar blockquote {
            margin-left: 0.25em;
            padding-left: 0.5em;
            border-left: 3px solid var(--border-color);
            color: color-mix(in srgb, var(--text-primary), transparent 20%);
            font-style: italic;
        }

        /* --- NEW: "Smart" Text Highlight Logic --- */
        #teleprompter-sidebar :is(h1, h2, h3, h4, h5, h6, b, strong, [class*="highlight-"], [class*="text-"]) {
            color: var(--primary-color) !important;
            font-weight: 600 !important;
            background: none !important;
            border: none !important;
        }

        /* Hide complex blocks from the simple teleprompter view */
        #teleprompter-sidebar .nk-mcq-block,
        #teleprompter-sidebar .nk-timeline-block,
        #teleprompter-sidebar .chart-container,
        #teleprompter-sidebar .nk-accordion,
        #teleprompter-sidebar .nk-textile-deck,
        #teleprompter-sidebar .nk-audio-player,
        #teleprompter-sidebar .pdf-attachment-pill,
        #teleprompter-sidebar .image-container {
            display: none;
        }

        /* Ensure clean text flow */
        #teleprompter-sidebar p,
        #teleprompter-sidebar li {
            font-size: inherit !important;
            line-height: inherit !important;
            color: inherit !important;
        }

        #teleprompter-sidebar ul,
        #teleprompter-sidebar ol {
            padding-left: 1.5em;
        }

        #teleprompter-sidebar ul ul,
        #teleprompter-sidebar ol ol,
        #teleprompter-sidebar ol ul,
        #teleprompter-sidebar ul ol {
            padding-left: 0.25em;
            margin-left: 0;
            list-style-type: square !important;
        }

        .focus-mode-overlay.teleprompter-active .focus-mode-content {
            width: 70%;
            flex-grow: 1;
        }

        .focus-mode-overlay.teleprompter-active .stage-mode-controls {
            left: 65%;
        }

        .focus-mode-overlay.teleprompter-active #annotation-toolbar {
            left: 65%;
        }

        /* ---  Mobile Teleprompter (Bottom Bar) --- */
        body.mobile-view .focus-mode-overlay.teleprompter-active {
            flex-direction: column;
        }

        body.mobile-view .focus-mode-overlay.teleprompter-active .focus-mode-content {
            order: 1;
            width: 100%;
            height: 70%;
        }

        body.mobile-view #teleprompter-sidebar {
            order: 2;
            width: 100%;
            height: 30%;
            border-right: none;
            border-top: 1px solid var(--border-color);
        }

        body.mobile-view .focus-mode-overlay.teleprompter-active .stage-mode-controls,
        body.mobile-view .focus-mode-overlay.teleprompter-active #annotation-toolbar {
            left: 50%;
            bottom: 30%;
            margin-bottom: 0.5rem;
            transform: translateX(-50%);
        }

        /* --- NEW: Teleprompter-Specific Controls (V2 Design) --- */
        #teleprompter-controls {
            position: absolute;
            top: 0.75rem;
            right: 0.75rem;
            z-index: 10;
            display: none;
            align-items: center;
            gap: 4px;
            padding: 4px;
            background-color: rgba(var(--bg-secondary-rgb), 0.7);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow);
        }

        /* Only show the controls when the teleprompter is active */
        .focus-mode-overlay.teleprompter-active #teleprompter-controls {
            display: flex;
        }

        #teleprompter-controls .btn-icon {
            width: 32px;
            height: 32px;
            background-color: var(--bg-tertiary);
        }

        /* --- NEW: Teleprompter Resizer Handle --- */
        #teleprompter-resizer {
            position: absolute;
            z-index: 15;
            background-color: transparent;
            transition: background-color 0.2s ease-in-out;
        }

        #teleprompter-resizer:hover,
        #teleprompter-resizer.is-resizing {
            background-color: var(--primary-color);
            opacity: 0.7;
        }

        /* Desktop (Vertical Handle) */
        body:not(.mobile-view) #teleprompter-resizer {
            top: 0;
            bottom: 0;
            left: 100%;
            width: 8px;
            cursor: col-resize;
            transform: translateX(-50%);
        }

        /* Mobile (Horizontal Handle) */
        body.mobile-view #teleprompter-resizer {
            left: 0;
            right: 0;
            top: 0;
            height: 16px;
            cursor: row-resize;
            transform: translateY(-50%);
        }


        /* --- NEW: Annotation Toolbar Styles --- */
        #annotation-toolbar {
            position: fixed;
            bottom: 15px;
            left: 50%;
            transform: translateX(-50%);
            display: none;
            align-items: center;
            gap: 8px;
            padding: 8px;
            background-color: rgba(var(--bg-secondary-rgb), 0.8);
            backdrop-filter: blur(10px);
            -webkit-backdrop-filter: blur(10px);
            border: 1px solid var(--border-color);
            border-radius: var(--border-radius-lg);
            box-shadow: var(--shadow-lg);
            z-index: 20004;
            animation: slideUp 0.3s ease;
        }

        #annotation-toolbar .tool-btn.active {
            background-color: var(--bg-tertiary);
            color: var(--primary-color);
        }

        #annotation-toolbar .color-pick {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            border: 2px solid var(--border-color);
            cursor: pointer;
            transition: transform 0.2s ease;
        }

        #annotation-toolbar .color-pick:hover {
            transform: scale(1.1);
        }

        #annotation-toolbar .color-pick.active {
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-color) 60%, transparent);
        }

        #annotation-toolbar .btn-icon {
            width: 32px;
            height: 32px;
        }


        /* WHITEBOARD v3 - FULLSCREEN WITH BOTTOM TOOLBAR  */
        #whiteboard-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 25000;
            background: rgba(0, 0, 0, 0.85);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        #whiteboard-overlay.active {
            display: flex;
            animation: wbFadeIn 0.2s ease-out;
        }

        @keyframes wbFadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        /* Card - Near fullscreen */
        #whiteboard-card {
            width: 100%;
            max-width: 1400px;
            height: 100%;
            max-height: 100%;
            background: var(--bg-secondary);
            border-radius: 20px;
            box-shadow: 0 0 80px rgba(0, 0, 0, 0.5);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            animation: wbSlideIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        /* Fullscreen override for Stage Mode Screenshot */
        #whiteboard-overlay.is-fullscreen #whiteboard-card {
            max-width: 100% !important;
            border-radius: 0 !important;
            box-shadow: none !important;
        }

        @keyframes wbSlideIn {
            from {
                opacity: 0;
                transform: scale(0.95);
            }

            to {
                opacity: 1;
                transform: scale(1);
            }
        }

        /* Canvas area - MAXIMUM SPACE */
        #whiteboard-canvas-container {
            flex: 1;
            position: relative;
            overflow: hidden;
            background: var(--bg-primary);
            border-radius: 0 0 12px 12px;
            margin: 0 0.75rem 0.75rem 0.75rem;
        }

        /* Background variants */
        .wb-bg-sepia {
            background-color: #f8f1e3 !important;
            background-image: none !important;
        }

        .wb-bg-paper {
            background-color: #f7f5f0 !important;
            background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100' height='100' filter='url(%23noise)' opacity='0.5'/%3E%3C/svg%3E") !important;
        }

        #whiteboard-canvas {
            position: absolute;
            top: 0;
            left: 0;
            cursor: crosshair;
            touch-action: none;
            transform-origin: center center;
            z-index: 20;
        }

        /* Background image layer for screenshots - sits BELOW text boxes */
        #whiteboard-bg-image {
            position: absolute;
            top: 0;
            left: 0;
            z-index: 10;
            pointer-events: none;
            border-radius: 16px;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
        }

        /* Access items behind canvas when in Select Mode */
        .wb-tool-select #whiteboard-canvas,
        .wb-tool-hand #whiteboard-canvas,
        .wb-tool-image #whiteboard-canvas,
        .wb-tool-text #whiteboard-canvas {
            pointer-events: none;
        }

        /* Connector lines layer */
        #whiteboard-connectors {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 18;
        }


        /* Text boxes - PREMIUM GLASSMORPHISM DESIGN */
        .wb-text-box {
            position: absolute;
            padding: 10px 12px;
            background: linear-gradient(135deg,
                    rgba(var(--bg-secondary-rgb, 255, 255, 255), 0.85) 0%,
                    rgba(var(--bg-secondary-rgb, 255, 255, 255), 0.65) 100%);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            border: 2px solid var(--primary-color);
            border-radius: 16px;
            cursor: move;
            user-select: none;
            min-width: 120px;
            font-family: var(--font-body);
            font-size: 16px;
            color: var(--text-primary);
            box-shadow:
                0 4px 20px rgba(0, 0, 0, 0.1),
                0 0 0 1px rgba(255, 255, 255, 0.1) inset,
                0 1px 3px rgba(0, 0, 0, 0.05);
            z-index: 15;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .wb-text-box.active {
            z-index: 16;
        }

        .wb-text-box.dragging {
            z-index: 100;
        }


        /* LAYER 2: IMAGES (Bottom) */
        .wb-image-box {
            position: absolute;
            min-width: 50px;
            min-height: 50px;
            box-sizing: border-box;
            border: 2px solid transparent;
            border-radius: 12px;
            cursor: grab;
            user-select: none;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 5;
            pointer-events: none;
            transition: box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.2s ease;
        }

        .wb-image-box.active {
            z-index: 6;
            border-color: var(--primary-color);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        .wb-image-box:hover {
            border-color: var(--primary-color);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        .wb-image-box.dragging {
            cursor: grabbing !important;
            opacity: 0.95;
            transform: scale(1.02);
            box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
            z-index: 100;
        }

        .wb-image-box.dragging .wb-image-move-handle {
            cursor: grabbing;
            transform: scale(1.2);
        }

        .wb-image-box img {
            width: 100%;
            height: 100%;
            pointer-events: none;
            border-radius: 12px;
            object-fit: fill;
            display: block;
        }

        .wb-image-delete-handle {
            position: absolute;
            top: -10px;
            right: -10px;
            width: 24px;
            height: 24px;
            background: #ef4444;
            color: white;
            border-radius: 50%;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            font-weight: bold;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
            opacity: 0;
            pointer-events: none;
            transition: all 0.2s;
            z-index: 20;
            transform: scale(0.9);
        }

        .wb-image-delete-handle:hover {
            transform: scale(1.1) !important;
            background: #dc2626 !important;
            opacity: 1 !important;
        }

        /* Move Handle (Blue Dot - Top Left) */
        .wb-image-move-handle {
            position: absolute;
            top: -10px;
            left: -10px;
            width: 24px;
            height: 24px;
            background: var(--primary-color);
            color: white;
            border-radius: 50%;
            cursor: grab;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
            opacity: 0;
            pointer-events: none;
            transition: all 0.2s;
            z-index: 20;
            transform: scale(0.9);
        }

        .wb-image-move-handle::after {
            content: '✥';
            font-size: 14px;
        }

        .wb-image-move-handle:hover {
            transform: scale(1.1) !important;
            opacity: 1 !important;
        }

        /* Resize Handle (Bottom Right) */
        .wb-image-resize-handle {
            position: absolute;
            bottom: -6px;
            right: -6px;
            width: 16px;
            height: 16px;
            background: white;
            border: 2px solid var(--primary-color);
            border-radius: 50%;
            cursor: nwse-resize;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s, transform 0.2s;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        }

        .wb-image-resize-handle:hover {
            transform: scale(1.2) !important;
            opacity: 1 !important;
        }

        .wb-tool-select .wb-image-box,
        .wb-tool-hand .wb-image-box,
        .wb-tool-image .wb-image-box {
            pointer-events: auto;
        }

        .wb-tool-select .wb-image-box:hover .wb-image-delete-handle,
        .wb-tool-select .wb-image-box:hover .wb-image-move-handle,
        .wb-tool-select .wb-image-box:hover .wb-image-resize-handle,
        .wb-tool-hand .wb-image-box:hover .wb-image-delete-handle,
        .wb-tool-hand .wb-image-box:hover .wb-image-move-handle,
        .wb-tool-hand .wb-image-box:hover .wb-image-resize-handle,
        .wb-tool-image .wb-image-box:hover .wb-image-delete-handle,
        .wb-tool-image .wb-image-box:hover .wb-image-move-handle,
        .wb-tool-image .wb-image-box:hover .wb-image-resize-handle {
            opacity: 0.6;
            pointer-events: auto;
        }

        .wb-tool-select .wb-image-box.active .wb-image-delete-handle,
        .wb-tool-select .wb-image-box.active .wb-image-move-handle,
        .wb-tool-select .wb-image-box.active .wb-image-resize-handle,
        .wb-tool-hand .wb-image-box.active .wb-image-delete-handle,
        .wb-tool-hand .wb-image-box.active .wb-image-move-handle,
        .wb-tool-hand .wb-image-box.active .wb-image-resize-handle,
        .wb-tool-image .wb-image-box.active .wb-image-delete-handle,
        .wb-tool-image .wb-image-box.active .wb-image-move-handle,
        .wb-tool-image .wb-image-box.active .wb-image-resize-handle {
            opacity: 1;
            transform: scale(1);
            pointer-events: auto;
        }

        .wb-image-box.wb-spawn {
            animation: wbSpawnCard 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }



        .wb-text-box:hover {
            transform: translateY(-2px);
            box-shadow:
                0 4px 12px var(--wb-text-shadow-color),
                0 8px 24px var(--wb-text-shadow-color),
                0 0 0 1px var(--wb-text-inset-light) inset;
        }

        .wb-text-box.active {
            transform: translateY(-1px);
            box-shadow:
                0 4px 16px var(--wb-text-shadow-active),
                0 8px 32px var(--wb-text-shadow-active),
                0 0 24px rgba(var(--primary-color-rgb, 100, 100, 255), 0.12),
                0 0 0 1px rgba(255, 255, 255, 0.25) inset;
            border-color: var(--primary-color);
            border-width: 2.5px;
        }

