/**
 * Native pull-to-refresh for pool and video chat browse (sidebar room list).
 * Requires html.ulgb-native-pull-refresh-video-chat (see ulgb_native_pull_refresh_config.php).
 *
 * Groups and channels use ulgb_native_pull_refresh_groups_channels.css (separate revert flag).
 *
 * Active only when NOT in an active session:
 *   - body.vc-body--vc-room-open  (pool / video in-room)
 *   - body.channels-modal-open      (channels live viewer — channels page unchanged here)
 *
 * Revert: set $ulgbNativePullRefreshVideoChatEnabled = false in config.
 */
@media screen and (max-width: 1024px) {
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat:has(
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open)
    ) {
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        height: auto;
    }

    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open):not(.ulgb-groups-home-iframe):not(.ulgb-no-native-pull-refresh) {
        overflow: visible !important;
        min-height: 100%;
    }

    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat:has(.navbar-bottom)
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open):not(.ulgb-no-native-pull-refresh) {
        padding-bottom: calc(85px + env(safe-area-inset-bottom, 0px));
    }

    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat:has(.navbar)
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open):not(.ulgb-groups-home-iframe):not(.ulgb-no-native-pull-refresh) {
        padding-top: var(--ulgb-mobile-content-top, 72px);
    }

    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .homepage-wrapper {
        position: relative !important;
        top: auto !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
        inset: auto !important;
        overflow: visible !important;
        min-height: calc(
            100dvh - var(--ulgb-mobile-content-top, 72px) - 85px - env(safe-area-inset-bottom, 0px)
        ) !important;
        height: auto !important;
        max-height: none !important;
    }

    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .homepage-main-content,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .homepage-main-container,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .vc-desktop-app,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .vc-layout,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .vc-sidebar,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .vc-sidebar-body,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .vc-mobile-browse-host,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .pool-center-box {
        overflow: visible !important;
        overscroll-behavior: auto !important;
        touch-action: auto !important;
        max-height: none !important;
        height: auto !important;
        min-height: 0 !important;
        flex: none !important;
    }

    /* Pool / video browse lists: let content grow with the document instead of inner panes. */
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) #vc-mobile-browse-host .vc-browse-inner,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) #vc-browse-categories-view,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) #vc-browse-rooms-view,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .vc-browse-room-list,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat
        body.video-chat-page:not(.groups-page):not(.channels-page):not(.vc-body--vc-room-open):not(.channels-modal-open) .vc-browse-category-grid {
        overflow: visible !important;
        overscroll-behavior: auto !important;
        touch-action: auto !important;
        max-height: none !important;
        height: auto !important;
        min-height: 0 !important;
        flex: none !important;
    }

    /* Full-screen overlays keep their own scroll while open. */
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat .groups-detail-modal-scroll-wrap,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat .channels-live-modal-overlay,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat .channels-setup-overlay,
    html.ulgb-native-pull-refresh-active.ulgb-native-pull-refresh-video-chat .vc-room-modal.vc-room-modal--open {
        overscroll-behavior: contain !important;
    }
}
