/**
 * Mobile document-scroll fix  (load LAST so it wins)
 *
 * THE recurring "pages can't scroll on mobile" bug — and it is ANDROID-ONLY
 * (iPhone/iOS Safari is unaffected). Root cause is structural CSS, not JS:
 *
 *   <html class="h-full ... overflow-x-hidden">
 *
 *   `overflow-x: hidden` makes <html> a SCROLL CONTAINER (per spec, its
 *   computed overflow-y can no longer be `visible` — it becomes `auto`).
 *   Android Chrome/WebView refuses to touch-scroll the ROOT element when the
 *   root is itself a scroll container; iOS Safari tolerates it. That is exactly
 *   why "Android = totally frozen, iPhone = fine". (`h-full` = height:100% made
 *   it worse by also pinning it to viewport height, but removing height alone
 *   was NOT enough — <html> was still a scroll container.)
 *
 * Fix: on small screens, take the scroll-container role OFF <html> entirely so
 * it's a plain document the VIEWPORT scrolls natively (the Android-reliable
 * behaviour), and move horizontal-overflow clipping down to <body>. Verified
 * live: html overflow-y visible (not a scroll container), document scrolls,
 * body still clips sideways overflow (no horizontal scroll), layout unchanged.
 *
 * IMPORTANT: never put `overflow-x: hidden` (or height:100%/h-full) on the
 * <html> element for the agent shell again — that is what keeps re-breaking
 * Android scroll. Clip horizontal overflow on <body> or an inner wrapper.
 */
@media (max-width: 1023px) {
    /* <html>: NOT a scroll container. Plain document, viewport scrolls it. */
    html,
    html.h-full,
    html.h-full.overflow-x-hidden,
    html.overflow-x-hidden {
        height: auto !important;
        min-height: 100% !important;
        overflow: visible !important;
    }

    /* <body>: takes over horizontal clipping. It becomes an auto-height scroll
       container (overflow-x:hidden forces overflow-y:auto) but since it grows
       to its content it never blocks the document scroll. */
    body,
    body[data-agent-shell="true"],
    body[data-agent-shell="true"]:not(.agent-sidebar-open) {
        height: auto !important;
        min-height: 100vh;
        overflow-x: hidden !important;
        overscroll-behavior-y: none;
    }

    /* Freeze the page behind the open sidebar drawer. */
    body.agent-sidebar-open,
    body.g-sidenav-pinned {
        overflow: hidden !important;
    }
}
