/* Mobile navigation compatibility; the desktop 1600x900 design remains intact. */
@media (max-width: 900px), (hover: none) and (pointer: coarse) {
    #courseReveal {
        touch-action: pan-y;
    }

    /* Decorative Page 1 layers must never become the touch target owner. */
    .hero-slide::after,
    .hero-slide .particle-field,
    .hero-slide .hero-glow,
    .hero-slide .floating-icon,
    .hero-slide .hero-footer,
    .hero-slide .navigation-hint {
        pointer-events: none !important;
    }

    /* Page 1 previously hid all global navigation. Keep the mobile fallback. */
    body:has(#courseReveal > .slides > section:nth-child(1).present) .course-nav,
    body:has(#courseReveal > .slides > section:nth-child(1).present) .reveal .slide-number {
        display: flex !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    body:has(#courseReveal > .slides > section:nth-child(1).present) .course-nav {
        pointer-events: auto !important;
    }

    .course-nav button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        padding: 0 !important;
        touch-action: manipulation;
    }

    body.is-windowed-safe .course-nav {
        bottom: 4px !important;
    }

    body.is-windowed-safe .reveal .slide-number {
        bottom: 18px !important;
    }

    body.is-windowed-safe .reading-lens-launcher,
    body.is-windowed-safe:has(.page-jump-panel.is-open) .reading-lens-launcher,
    body.is-windowed-safe .text-dock-launcher,
    body.is-windowed-safe:has(.page-jump-panel.is-open) .text-dock-launcher {
        bottom: 4px !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        touch-action: manipulation;
    }

    body.is-windowed-safe .text-dock-launcher,
    body.is-windowed-safe:has(.page-jump-panel.is-open) .text-dock-launcher {
        right: calc(max(8px, env(safe-area-inset-right)) + 48px) !important;
    }

    body.is-windowed-safe .reading-lens-launcher,
    body.is-windowed-safe:has(.page-jump-panel.is-open) .reading-lens-launcher {
        right: max(8px, env(safe-area-inset-right)) !important;
    }

    .text-dock-body {
        touch-action: pan-y;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .watch-video,
    .video-controls,
    button,
    input,
    textarea,
    select,
    [draggable="true"] {
        touch-action: manipulation;
    }

    .video-frame.video-floating,
    .video-floating .floating-video-chrome,
    .video-floating .floating-video-resize {
        touch-action: none;
    }
}

