.pwa-install,
.pwa-ios,
.pwa-push {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(var(--bottom-nav-h, 62px) + env(safe-area-inset-bottom, 0px) + 12px);
    z-index: 950;
    display: none;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid rgba(188, 19, 254, 0.35);
    background: rgba(18, 4, 34, 0.96);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.pwa-install.is-visible,
.pwa-ios.is-visible,
.pwa-push.is-visible {
    display: flex;
}

.pwa-install__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    flex-shrink: 0;
}

.pwa-install__body,
.pwa-ios__body,
.pwa-push__body {
    flex: 1;
    min-width: 0;
}

.pwa-install__title,
.pwa-ios__title,
.pwa-push__title {
    margin: 0 0 2px;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
}

.pwa-install__text,
.pwa-ios__text,
.pwa-push__text {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.72);
}

.pwa-install__actions,
.pwa-ios__actions,
.pwa-push__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.pwa-install__btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 10px 14px;
    min-height: 44px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 1;
}

.pwa-install__btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #bc13fe, #7a0cb5);
}

.pwa-install__btn--ghost {
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.06);
}

.pwa-update {
    position: fixed;
    top: calc(var(--topbar-h, 58px) + env(safe-area-inset-top, 0px) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 960;
    display: none;
    align-items: center;
    gap: 10px;
    max-width: min(420px, calc(100vw - 24px));
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(188, 19, 254, 0.35);
    background: rgba(18, 4, 34, 0.96);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
}

.pwa-update.is-visible {
    display: flex;
}

.pwa-update__text {
    margin: 0;
    flex: 1;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.85);
}

.pwa-update__btn {
    appearance: none;
    border: 0;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, #bc13fe, #7a0cb5);
}

.pwa-stale {
    position: fixed;
    top: calc(var(--topbar-h, 58px) + env(safe-area-inset-top, 0px) + 10px);
    left: 12px;
    right: 12px;
    z-index: 940;
    display: none;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 193, 7, 0.35);
    background: rgba(40, 24, 8, 0.94);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.pwa-stale.is-visible {
    display: block;
}

.pwa-stale__text {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #ffe082;
    text-align: center;
}

.pwa-push-manage {
    display: none;
    align-items: center;
    gap: 12px;
    margin: 0 0 14px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(188, 19, 254, 0.28);
    background: rgba(18, 4, 34, 0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.pwa-push-manage.is-visible {
    display: flex;
    flex-wrap: wrap;
}

.pwa-push-manage.is-on {
    border-color: rgba(34, 211, 238, 0.35);
}

.pwa-push-manage.is-error {
    border-color: rgba(255, 107, 107, 0.35);
}

.pwa-push-manage__body {
    flex: 1;
    min-width: 0;
}

.pwa-push-manage__title {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 800;
    color: #fff;
}

.pwa-push-manage__text {
    margin: 0;
    font-size: 12px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

.pwa-push-manage__actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}

.pwa-push-manage__log {
    width: 100%;
    flex-basis: 100%;
    margin: 8px 0 0;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.28);
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 140px;
    overflow: auto;
}

@media (min-width: 1200px) {
    .pwa-install,
    .pwa-ios,
    .pwa-push {
        left: auto;
        right: 18px;
        bottom: 18px;
        max-width: 360px;
    }
}

@media (display-mode: standalone) {
    .pwa-install,
    .pwa-ios {
        display: none !important;
    }

    .topbar {
        padding-top: env(safe-area-inset-top, 0px);
    }

    .bottom-nav {
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
}

.is-pwa-standalone .topbar {
    padding-top: env(safe-area-inset-top, 0px);
}

.is-pwa-standalone .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.is-pwa-standalone .site-ads-footer-wrap,
.is-pwa-standalone .site-ads-inpage-top,
.is-pwa-standalone .site-ads-mobile-lead,
.is-pwa-standalone .site-ads-sidebar-wrap {
    display: none !important;
}

.pwa-push-toast {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: 12px;
    right: 12px;
    z-index: 1200;
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(188, 19, 254, 0.45);
    background: rgba(18, 4, 34, 0.97);
    color: #fff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.pwa-push-toast.is-visible {
    display: flex;
}

.pwa-push-toast strong {
    font-size: 14px;
}

.pwa-push-toast span {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.78);
}
