/* InfiNet: installed web app (standalone) safe-area fixes for phones.
   Active only when html has .pwa-standalone (set by an inline head script when
   navigator.standalone === true or display-mode is standalone/fullscreen).
   Normal browser tabs and desktop never get these rules. */
@media (max-width: 768px) {
    html.pwa-standalone {
        --pwa-top: env(safe-area-inset-top, 0px);
    }

    /* Side menu panel: keep the logo and title below the status bar / notch */
    html.pwa-standalone .sidebar {
        padding-top: var(--pwa-top) !important;
        box-sizing: border-box !important;
    }
    html.pwa-standalone .sidebar-header {
        margin-top: 0 !important;
    }

    /* Home page: fixed header (token pill, theme, sparkle, Pricing, avatar) */
    html.pwa-standalone.pwa-home .chat-header,
    html.pwa-standalone.pwa-home body.light-mode .chat-header {
        padding-top: calc(0.75rem + var(--pwa-top)) !important;
    }
    html.pwa-standalone.pwa-home .main-content {
        padding-top: calc(70px + var(--pwa-top)) !important;
    }

    /* Other pages (profile, pricing, docs, features, legal): push page content down */
    html.pwa-standalone.pwa-subpage .main-content {
        padding-top: var(--pwa-top) !important;
    }

    /* Reset password: centered card, keep clear of the status bar */
    html.pwa-standalone.pwa-reset body {
        padding-top: calc(20px + var(--pwa-top)) !important;
    }
}

@media (max-width: 480px) {
    html.pwa-standalone.pwa-home .chat-header,
    html.pwa-standalone.pwa-home body.light-mode .chat-header {
        padding-top: calc(0.6rem + var(--pwa-top)) !important;
    }
}
