/* Navigation Menu Layout Fix */
        :root { --app-safe-bottom: env(safe-area-inset-bottom, 0px); }
        html.native-insets-managed { --app-safe-bottom: 0px; }
        .app-nav {
            display: flex !important;
        }

        .main-content {
            padding-bottom: 24px !important;
        }

        @media (max-width: 768px) {
            :root {
                --nav-height-mobile: 50px;
            }

            .app-nav {
                bottom: var(--ad-banner-height, 0px) !important;
                height: calc(var(--nav-height-mobile) + var(--app-safe-bottom)) !important;
                min-height: calc(var(--nav-height-mobile) + var(--app-safe-bottom)) !important;
                padding-bottom: var(--app-safe-bottom) !important;
            }

            html.has-banner .app-nav {
                bottom: var(--ad-banner-height, 0px) !important;
                height: var(--nav-height-mobile) !important;
                min-height: var(--nav-height-mobile) !important;
                padding-bottom: 0 !important;
            }

            .app-nav .nav-btn {
                gap: 2px;
                padding: 4px 8px;
                font-size: 0.64rem;
                line-height: 1.1;
            }

            .app-nav .nav-btn i {
                font-size: 1rem;
                line-height: 1;
            }

            .main-content {
                padding-bottom: calc(var(--nav-height-mobile) + var(--app-safe-bottom) + 8px) !important;
            }

            html.has-banner .main-content {
                padding-bottom: calc(var(--nav-height-mobile) + var(--ad-banner-height, 0px) + 8px) !important;
            }

            .ask-ai-trigger {
                bottom: calc(var(--nav-height-mobile) + var(--app-safe-bottom) + 12px) !important;
            }

            html.has-banner .ask-ai-trigger {
                bottom: calc(var(--nav-height-mobile) + var(--ad-banner-height, 0px) + 12px) !important;
            }

            .ask-ai-modal {
                bottom: calc(var(--nav-height-mobile) + var(--app-safe-bottom) + 60px) !important;
            }

            html.has-banner .ask-ai-modal {
                bottom: calc(var(--nav-height-mobile) + var(--ad-banner-height, 0px) + 60px) !important;
            }

            .top-header {
                margin-bottom: 10px !important;
                gap: 8px !important;
            }

            .header-actions-mobile {
                margin-top: 10px !important;
            }

            /* The native banner occupies the final 50dp. Keep the close
               control attached to its upper-right edge instead of floating
               over the navigation labels. */
            #bannerCloseBtn,
            html.has-banner #bannerCloseBtn {
                width: 20px !important;
                height: 20px !important;
                right: 6px !important;
                bottom: calc(var(--ad-banner-height, 0px) + 1px) !important;
                border-width: 1px !important;
                box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3) !important;
            }

            #bannerCloseBtn svg {
                width: 8px;
                height: 8px;
            }
        }
    
