/* PWA install banner - chic bottom sheet + iOS how-to */
.pwa-banner,
.pwa-howto {
    font-family: var(--body-font, 'Segoe UI', system-ui, -apple-system, sans-serif);
    color: #eef2f8;
}

.pwa-banner {
    position: fixed;
    left: 50%;
    bottom: 20px;
    width: min(92vw, 440px);
    z-index: 9990;
    transform: translate(-50%, 16px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .5s cubic-bezier(.22, 1, .36, 1), transform .5s cubic-bezier(.22, 1, .36, 1);
}

.pwa-banner.in {
    opacity: 1;
    transform: translate(-50%, 0);
    pointer-events: auto;
}

.pwa-banner-card {
    position: relative;
    overflow: hidden;
    border-radius: 26px;
    padding: 22px 22px 18px;
    background: linear-gradient(150deg, rgba(24, 32, 52, .96), rgba(8, 12, 22, .96));
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35), 0 34px 90px rgba(0, 0, 0, .55);
}

/* hairline light sweep on the top edge */
.pwa-banner-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 12%;
    right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
}

.pwa-banner-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: rgba(238, 242, 248, .75);
    font-size: .95rem;
    cursor: pointer;
    transition: background .25s, color .25s, transform .25s;
}

.pwa-banner-close:hover {
    background: rgba(255, 255, 255, .16);
    color: #fff;
    transform: rotate(90deg);
}

.pwa-banner-top {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-right: 36px;
    margin-bottom: 12px;
}

.pwa-banner-logo {
    width: 58px;
    height: 58px;
    flex-shrink: 0;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .28);
    box-shadow: 0 0 0 4px rgba(232, 197, 118, .14), 0 12px 28px rgba(0, 0, 0, .45);
}

.pwa-banner-kicker {
    display: block;
    font-size: .68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .22em;
    color: #e7c684;
    margin-bottom: 2px;
}

.pwa-banner-title {
    margin: 0;
    font-family: var(--heading-font, 'Segoe UI', sans-serif);
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: .01em;
    color: #fff;
}

.pwa-banner-text {
    margin: 0 0 16px;
    font-size: .9rem;
    line-height: 1.55;
    color: rgba(226, 232, 240, .82);
}

.pwa-banner-actions {
    display: flex;
    gap: 10px;
}

.pwa-btn {
    font-family: inherit;
    font-weight: 600;
    font-size: .92rem;
    line-height: 1;
    border: none;
    border-radius: 999px;
    padding: 13px 20px;
    cursor: pointer;
    transition: transform .2s, box-shadow .25s, background .25s, color .25s, border-color .25s;
}

.pwa-btn:active {
    transform: scale(.97);
}

.pwa-btn-primary {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #241a06;
    background: linear-gradient(135deg, #f3dfae, #d8b371 55%, #c19a4b);
    box-shadow: 0 10px 24px rgba(198, 154, 76, .35), inset 0 1px 0 rgba(255, 255, 255, .55);
}

.pwa-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(198, 154, 76, .45), inset 0 1px 0 rgba(255, 255, 255, .55);
}

.pwa-btn-primary i {
    font-size: .88rem;
}

.pwa-btn-ghost {
    background: transparent;
    color: rgba(238, 242, 248, .8);
    border: 1px solid rgba(255, 255, 255, .22);
}

.pwa-btn-ghost:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .45);
    background: rgba(255, 255, 255, .06);
}

/* iOS how-to sheet */
.pwa-howto {
    position: fixed;
    inset: 0;
    z-index: 10002;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity .3s ease, visibility .3s ease;
}

.pwa-howto.in {
    visibility: visible;
    opacity: 1;
}

.pwa-howto-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(3, 6, 12, .6);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.pwa-howto-sheet {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: 88vh;
    overflow-y: auto;
    background: linear-gradient(160deg, #121a2c, #080c16);
    border: 1px solid rgba(255, 255, 255, .14);
    border-bottom: none;
    border-radius: 30px 30px 0 0;
    padding: 26px 24px calc(24px + env(safe-area-inset-bottom));
    box-shadow: 0 -20px 70px rgba(0, 0, 0, .6);
    transform: translateY(40px);
    transition: transform .38s cubic-bezier(.22, 1, .36, 1);
}

.pwa-howto.in .pwa-howto-sheet {
    transform: translateY(0);
}

.pwa-howto-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: rgba(238, 242, 248, .8);
    font-size: 1rem;
    cursor: pointer;
    transition: background .25s, color .25s;
}

.pwa-howto-close:hover {
    background: rgba(255, 255, 255, .16);
    color: #fff;
}

.pwa-howto-head {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-right: 44px;
    margin-bottom: 18px;
}

.pwa-howto-logo {
    width: 66px;
    height: 66px;
    flex-shrink: 0;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, .3);
    box-shadow: 0 14px 30px rgba(0, 0, 0, .45);
}

.pwa-howto-title {
    margin: 0 0 3px;
    font-family: var(--heading-font, 'Segoe UI', sans-serif);
    font-size: 1.3rem;
    font-weight: 700;
    color: #fff;
}

.pwa-howto-lead {
    margin: 0;
    font-size: .92rem;
    color: rgba(226, 232, 240, .8);
    line-height: 1.5;
}

.pwa-howto-steps {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
    display: grid;
    gap: 12px;
}

.pwa-howto-step {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .09);
}

.pwa-step-num {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: .92rem;
    color: #2a1c05;
    background: linear-gradient(135deg, #f0d9a4, #c9a24f);
    box-shadow: 0 6px 16px rgba(198, 154, 76, .3);
}

.pwa-howto-step strong {
    display: block;
    font-size: .98rem;
    color: #fff;
    margin-bottom: 2px;
}

.pwa-howto-step p {
    margin: 0;
    font-size: .86rem;
    line-height: 1.5;
    color: rgba(226, 232, 240, .78);
}

.pwa-howto-step p b {
    color: #f2ddaa;
    font-weight: 600;
}

.pwa-howto-footer {
    margin: -4px 0 0;
    font-size: .8rem;
    text-align: center;
    color: rgba(203, 213, 225, .6);
    line-height: 1.5;
}

@media (max-width: 480px) {
    .pwa-banner {
        bottom: 14px;
        bottom: calc(14px + env(safe-area-inset-bottom));
        width: min(94vw, 440px);
    }

    .pwa-banner-card {
        padding: 18px 18px 14px;
        border-radius: 22px;
    }

    .pwa-banner-actions {
        flex-direction: column-reverse;
    }

    .pwa-btn-primary,
    .pwa-btn-ghost {
        width: 100%;
    }
}

@media (max-width: 360px) {
    .pwa-banner-logo {
        width: 50px;
        height: 50px;
    }

    .pwa-banner-title {
        font-size: 1.05rem;
    }

    .pwa-banner-text {
        font-size: .84rem;
        margin-bottom: 12px;
    }

    .pwa-btn {
        padding: 12px 16px;
        font-size: .88rem;
    }
}
