/* Windowed-safe viewport adapter. The 1600x900 Reveal baseline is unchanged. */
:root {
    --windowed-nav-safe-zone: 56px;
}

body.is-windowed-safe {
    padding-bottom: var(--windowed-nav-safe-zone);
    box-sizing: border-box;
}

body.is-windowed-safe #courseReveal {
    width: 100vw !important;
    height: calc(100vh - var(--windowed-nav-safe-zone)) !important;
    height: calc(100dvh - var(--windowed-nav-safe-zone)) !important;
    margin: 0 !important;
}

/* Keep all viewport controls in the independent strip below Reveal. */
body.is-windowed-safe .course-nav,
body.is-windowed-safe:has(#unitBeaconHub.present) .course-nav {
    left: 50% !important;
    right: auto !important;
    bottom: 11px !important;
    transform: translateX(-50%) !important;
}

body.is-windowed-safe .reveal .slide-number {
    left: 50% !important;
    right: auto !important;
    bottom: 19px !important;
    transform: translateX(-50%) !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: 12px !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    transform: none !important;
}

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

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

body.is-windowed-safe .page-jump-panel {
    right: 10px;
    bottom: calc(var(--windowed-nav-safe-zone) + 10px);
}

@media (max-height: 680px) {
    :root { --windowed-nav-safe-zone: 48px; }
    body.is-windowed-safe .course-nav { bottom: 8px !important; }
    body.is-windowed-safe .reveal .slide-number { bottom: 16px !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: 8px !important;
        width: 29px !important;
        height: 29px !important;
        min-width: 29px !important;
        min-height: 29px !important;
    }
}

