
    /* Document lock. iOS Safari does not reliably honour overflow:hidden on the
       body once a touch drag is already moving, so the body is pinned at its
       saved offset instead — the one lock every mobile engine respects. The
       offset is restored on close, so the page never appears to jump. */
    html.dr-vp-locked,
    html.dr-vp-locked body {
        overflow: hidden !important;
        overscroll-behavior: none !important;
    }
    html.dr-vp-locked body {
        position: fixed !important;
        top: var(--dr-lock-y, 0px) !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
    }
    /* Desktop fullscreen room: the page under it stops scrolling. On <html>,
       not <body>: assets/index.css gives html its own overflow-x, so a body
       overflow:hidden never reached the window and the page's scrollbar stood
       beside the room's. Toggled by js/footer/13-tallest-visible-height-seen-with.js. */
    html.dr-desk-locked {
        overflow: hidden !important;
    }
    /* Keyboard up: iOS keeps reporting the home-indicator inset even though the
       keyboard now covers it, which floated the composer above the keyboard on a
       dead band of background. */
    html.dr-kb-open .deal-room-container.chat-tab-active .chat-input-area {
        padding-bottom: 12px !important;
    }
    /* The hint line under the composer is the first thing worth losing when the
       keyboard has taken half the screen. */
    html.dr-kb-open .deal-room-container.chat-tab-active .chat-input-hint {
        display: none !important;
    }
    /* Keyboard up: the bottom tab bar goes away and its 56px come back to the
       room. Left in place it either sat behind the keyboard (the room still
       reserved its height, cutting the composer short) or floated over the
       composer, depending on the engine. Phone apps hide their tab bar while
       typing for the same reason. Each selector repeats a sizing rule from the
       mobile chat block with html.dr-kb-open in front, so it outranks it. */
    html.dr-kb-open .hb-tabbar {
        display: none !important;
    }
    html.dr-kb-open body.hb-has-tabbar #chatInterface,
    html.dr-kb-open body.hb-has-tabbar .chat-interface {
        padding-bottom: 0 !important;
    }
    @media (max-width: 1024px) {
        html.dr-kb-open body.hb-has-tabbar .deal-room-container.locked-to-deal.chat-tab-active,
        html.dr-kb-open body.hb-has-tabbar .deal-room-container.locked-to-deal:has(#deal-chat-view:not([style*="display: none"])),
        html.dr-kb-open body.hb-has-tabbar .deal-room-container.locked-to-deal,
        html.dr-kb-open body.hb-has-tabbar .deal-room-container {
            inset: 0 !important;
            height: var(--dr-vv-h, 100dvh) !important;
            max-height: var(--dr-vv-h, 100dvh) !important;
        }
    }

    @media (max-width: 1024px), (pointer: coarse) {
        /* The third cause of the drift, and on iOS the loudest one: any input
           under 16px makes Safari ZOOM the page on focus. That zoom rescales the
           layout viewport, so the fixed overlay grows past the screen and slides
           — the composer visibly jumping up then settling, with the page behind
           appearing at the bottom edge. 16px is the exact threshold; the desktop
           composer keeps its 15.5px. Same floor for every other field inside the
           room so no other tab can trigger the zoom either. */
        .deal-room-container #deal-chat-view .chat-input-box input#chatMessage,
        .deal-room-container input[type="text"],
        .deal-room-container input[type="email"],
        .deal-room-container input[type="tel"],
        .deal-room-container input[type="url"],
        .deal-room-container input[type="search"],
        .deal-room-container input[type="password"],
        .deal-room-container input[type="number"],
        .deal-room-container textarea,
        .deal-room-container select {
            font-size: 16px !important;
        }

        /* Last-resort cover: if any engine still leaves a sliver between the
           overlay and the bottom of the screen mid-animation, what shows through
           should be the room's own backdrop rather than a dimmed slice of the
           page. Fully hidden behind the fullscreen room the rest of the time. */
        #chatOverlay {
            background-color: #0b1120 !important;
        }
    }
