/* The installed home is a document, never a fixed one-viewport panel.
   This override is intentionally template-agnostic so a homepage refresh
   cannot accidentally reintroduce a scroll lock. */
html.pwa-standalone:has(body.public-home-shell),
html.pwa-standalone.pwa-scrollable-home {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
}

html.pwa-standalone body.public-home-shell,
html.pwa-standalone body.public-home-shell.pwa-scrollable-home {
    height: auto !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

html.pwa-standalone body.public-home-shell .public-main {
    display: block !important;
    flex: 0 0 auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

html.pwa-standalone body.public-home-shell :is(.home-landing, .directory-home) {
    display: block !important;
    flex: 0 0 auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
}

@media (max-width: 767.98px) {
    html:has(body.public-home-shell),
    html.pwa-standalone:has(body.public-home-shell) {
        height: auto !important;
        min-height: 100% !important;
        overflow-y: auto !important;
        overscroll-behavior-y: auto !important;
    }

    body.public-home-shell,
    html.pwa-standalone body.public-home-shell {
        height: auto !important;
        min-height: 100dvh !important;
        overflow-y: auto !important;
        overscroll-behavior-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    body.public-home-shell .public-main,
    body.public-home-shell :is(.home-landing, .directory-home) {
        display: block !important;
        flex: 0 0 auto !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
    }
}

/* Install prompt: communicate a useful benefit before asking for a commitment. */
@media (max-width: 767.98px) {
    .public-pwa-install-sheet {
        align-items: stretch;
        border-color: #c9ddef;
        border-radius: 16px;
        bottom: calc(5.35rem + env(safe-area-inset-bottom, 0px));
        box-shadow: 0 18px 42px rgba(15, 36, 66, .2);
        display: grid;
        gap: .85rem;
        grid-template-columns: minmax(0, 1fr);
        left: .8rem;
        padding: 1rem;
        right: .8rem;
    }

    .public-pwa-install-sheet__dismiss {
        align-items: center;
        background: #f5f8fc;
        border: 0;
        border-radius: 50%;
        color: #607491;
        display: inline-flex;
        height: 32px;
        justify-content: center;
        padding: 0;
        position: absolute;
        right: .7rem;
        top: .7rem;
        width: 32px;
    }

    .public-pwa-install-sheet__dismiss:focus-visible,
    .public-pwa-install-sheet__dismiss:hover {
        background: #e8f1fb;
        color: #1767df;
        outline: 0;
    }

    .public-pwa-install-sheet__dismiss svg {
        height: 17px;
        width: 17px;
    }

    .public-pwa-install-sheet__brand {
        align-items: flex-start;
        gap: .72rem;
        padding-right: 2rem;
    }

    .public-pwa-install-sheet__brand img {
        border-radius: 11px;
        height: 44px;
        width: 44px;
    }

    .public-pwa-install-sheet__brand > div {
        min-width: 0;
    }

    .public-pwa-install-sheet__eyebrow {
        color: #079968;
        display: block;
        font-size: .66rem;
        font-weight: 800;
        line-height: 1.1;
        margin-bottom: .22rem;
    }

    .public-pwa-install-sheet__brand h2 {
        color: #12213e;
        font-family: var(--jeebp-font-heading);
        font-size: 1rem;
        font-weight: 850;
        line-height: 1.2;
        margin: 0;
    }

    .public-pwa-install-sheet__brand p {
        color: #607491;
        font-size: .78rem;
        line-height: 1.42;
        margin: .28rem 0 0;
    }

    .public-pwa-install-sheet__actions {
        display: flex;
        gap: .45rem;
        justify-content: flex-end;
        width: 100%;
    }

    .public-pwa-install-sheet__actions .btn {
        min-height: 42px;
    }

    .public-pwa-install-sheet__actions .btn-primary {
        flex: 1 1 auto;
        font-weight: 800;
    }

    .public-pwa-install-sheet__actions .btn-link {
        color: #51657f;
        flex: 0 0 auto;
        padding-left: .45rem;
        padding-right: .45rem;
    }

    .public-pwa-install-sheet__ios-help {
        align-items: flex-start;
        background: #f1f8ff;
        border: 1px solid #cfe4fb;
        border-radius: 8px;
        color: #38536f;
        display: flex;
        font-size: .76rem;
        gap: .45rem;
        line-height: 1.42;
        margin: 0;
        padding: .65rem .7rem;
    }

    .public-pwa-install-sheet__ios-help[hidden] {
        display: none;
    }

    .public-pwa-install-sheet__ios-help svg {
        color: #1767df;
        flex: 0 0 auto;
        height: 16px;
        margin-top: .04rem;
        width: 16px;
    }
}

@media (max-width: 390px) {
    .public-pwa-install-sheet {
        left: .65rem;
        right: .65rem;
    }

    .public-pwa-install-sheet__brand p {
        font-size: .74rem;
    }
}
