/*
 * Mobile layout guard
 *
 * Keep the bottom navigation anchored to the visual viewport without forcing
 * html/body to a viewport-based height. Page-specific styles must not set
 * 100vh/100svh/100dvh or flex stretching on html/body.
 */
:root {
    --mobile-menu-height: 56px;
}

@media (max-width: 991.98px) {
    html,
    body {
        height: auto !important;
        min-height: 0 !important;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    body {
        display: block !important;
    }

    .mobile-menu {
        position: fixed !important;
        inset: auto 0 0 0 !important;
        width: 100% !important;
        min-height: var(--mobile-menu-height);
        margin: 0 !important;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
        transform: none !important;
    }

    .footer-part {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Reserve only the real menu height so the footer text is not covered. */
    .footer-bottom {
        margin-bottom: 0 !important;
        padding-bottom: calc(var(--mobile-menu-height) + 20px + env(safe-area-inset-bottom, 0px)) !important;
    }
}
