.pwa-install[hidden] {
    display: none !important;
}

.pwa-install {
    position: fixed;
    z-index: 1050;
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
    left: auto;
    width: auto;
    max-width: calc(100% - 32px);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.55rem;
    background: transparent;
    border: 0;
    box-shadow: none;
    text-align: left;
    pointer-events: none;
}

.pwa-install-bar,
.pwa-install-card {
    pointer-events: auto;
}

.pwa-install-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.pwa-install-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    border: 0;
    border-radius: 999px;
    background: #667eea;
    color: #fff;
    font: inherit;
    font-weight: 700;
    font-size: 0.98rem;
    line-height: 1;
    padding: 13px 18px;
    min-height: 48px;
    box-shadow: 0 0 0 3px #fff, 0 10px 24px rgba(20, 24, 60, 0.35);
    cursor: pointer;
}

.pwa-install-fab svg {
    display: block;
    flex: 0 0 auto;
}

.pwa-install-fab:hover {
    background: #5568d3;
}

.pwa-install-close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 1.35rem;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    cursor: pointer;
}

.pwa-install-close:hover {
    background: #f3f4f8;
}

.pwa-install-card {
    width: min(280px, calc(100vw - 32px));
    background: #fff;
    color: #333;
    border-radius: 12px;
    padding: 0.8rem 0.9rem;
    box-shadow: 0 12px 32px rgba(40, 48, 90, 0.22);
}

.pwa-install-card[hidden] {
    display: none !important;
}

.pwa-install-card strong {
    display: block;
    color: #3d4db7;
    font-size: 1rem;
}

.pwa-install-card p {
    margin: 0.3rem 0 0;
    color: #444;
    font-size: 0.9rem;
    line-height: 1.4;
}

body.login-page .pwa-install {
    bottom: calc(52px + env(safe-area-inset-bottom));
}

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

@media print {
    .pwa-install {
        display: none !important;
    }
}
