#iosPwaStatusbarShield {
    position: fixed;
    inset: 0 0 auto;
    height: env(safe-area-inset-top, 0px);
    background: var(--status-bar-surface, var(--app-statusbar-bg, #fff)) !important;
    pointer-events: none;
    z-index: calc(var(--z-overlay, 10000) - 1);
    opacity: 1;
    filter: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

body.app-shared-shell {
    --status-bar-surface: var(--color-surface, var(--app-statusbar-bg, #fff));
}

body.results-dialog-active > #iosPwaStatusbarShield {
    z-index: calc(var(--z-results-dialog, 22000) + 2);
}

/* The shell above an embedded document owns the safe-area strip. */
body.mobile-shell-embed > .status-bar-cover { display: none; }

/* On mobile home the sticky menu paints the safe area and both header rows.
   The hidden cover retains the same computed color for theme-color sync. */
@media (max-width: 767px) {
    body.home-adopted.app-shared-shell:not(.results-dialog-active,.mobile-shell-open,.mobile-shell-embed) {
        > #iosPwaStatusbarShield { visibility: hidden; }
        #appMenuRegion { background: var(--status-bar-surface) !important; isolation: isolate; }
        #appMenuRegion .header-title::after { content: none; }
    }
}

@media (prefers-color-scheme: dark) {
    html:not([data-theme]) body {
        --status-bar-surface: #151f30;
    }
}

html[data-theme="dark"] #iosPwaStatusbarShield.status-bar-cover {
    background: var(--status-bar-surface, var(--app-statusbar-bg, #14171b)) !important;
}
