html.pwa-installed #pwaInstallBtn {
    display: none !important;
}

@media (display-mode: standalone),
(display-mode: fullscreen),
(display-mode: minimal-ui),
(display-mode: window-controls-overlay) {
    #pwaInstallBtn {
        display: none !important;
    }
}

#pwaInstallModal {
    z-index: 1100;
}

#pwaInstallModal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    overflow-y: auto;
}

#pwaInstallModal .modal-content {
    width: 92%;
    max-width: 680px;
    height: auto !important;
    max-height: calc(100dvh - 48px) !important;
    margin: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    border-radius: 12px;
}

#pwaInstallModal .modal-header {
    flex: 0 0 auto;
}

#pwaInstallModal .modal-body {
    padding: 28px 36px 36px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.pwa-install-btn i {
    margin-right: 6px;
    font-size: 13px;
}

.pwa-install-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 16px;
    margin-bottom: 28px;
}

.pwa-install-logo {
    width: 96px;
    height: 96px;
    background: #2d2d2d;
    border: 2px solid #444;
    border-radius: 22px;
    padding: 18px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    flex-shrink: 0;
}

.pwa-install-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pwa-install-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 600;
}

.pwa-install-header p {
    margin: 0;
    color: #aaaaaa;
    font-size: 0.95rem;
    line-height: 1.55;
    max-width: 420px;
}

.pwa-install-browser-label {
    margin: 0 0 16px;
    color: #888888;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
}

.pwa-install-native-btn {
    width: 100%;
    margin-bottom: 24px;
    padding: 14px 20px;
    font-size: 1rem;
}

.pwa-install-instructions {
    background: #252525;
    border: 1px solid #444;
    border-radius: 10px;
    padding: 22px 24px;
}

.pwa-install-instructions h4 {
    margin: 0 0 16px;
    color: #ffffff;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pwa-install-instructions h4 i {
    color: #dc3545;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.pwa-install-steps {
    margin: 0;
    padding-left: 1.35rem;
    color: #cccccc;
    font-size: 0.95rem;
    line-height: 1.65;
}

.pwa-install-steps li {
    margin-bottom: 10px;
}

.pwa-install-steps li:last-child {
    margin-bottom: 0;
}

.pwa-install-steps strong {
    color: #ffffff;
}

.pwa-install-note {
    margin-top: 18px;
    margin-bottom: 0;
    padding: 14px 16px;
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    color: #dddddd;
    font-size: 0.88rem;
    line-height: 1.55;
}

@media (min-width: 769px) {
    #pwaInstallModal .modal-body {
        padding: 32px 44px 44px;
    }

    .pwa-install-header {
        margin-bottom: 32px;
    }

    .pwa-install-instructions {
        padding: 26px 28px;
    }
}

@media (max-width: 768px) {
    #pwaInstallModal {
        overflow: hidden !important;
    }

    #pwaInstallModal.show {
        align-items: stretch !important;
        justify-content: stretch !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    #pwaInstallModal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
    }

    @supports not (height: 100dvh) {
        #pwaInstallModal .modal-content {
            height: 100svh !important;
            max-height: 100svh !important;
        }
    }

    @supports not (height: 100svh) {
        #pwaInstallModal .modal-content {
            height: 100vh !important;
            max-height: 100vh !important;
        }
    }

    #pwaInstallModal .modal-header {
        padding: 14px 16px !important;
        flex: 0 0 auto !important;
    }

    #pwaInstallModal .modal-header h2 {
        font-size: 1.1rem !important;
    }

    #pwaInstallModal .modal-body {
        padding: 20px 18px 32px !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    .pwa-install-header {
        gap: 12px;
        margin-bottom: 22px;
    }

    .pwa-install-logo {
        width: 80px;
        height: 80px;
        padding: 14px;
        border-radius: 18px;
    }

    .pwa-install-header h3 {
        font-size: 1.2rem;
    }

    .pwa-install-header p {
        font-size: 0.9rem;
    }

    .pwa-install-native-btn {
        margin-bottom: 20px;
        padding: 13px 18px;
    }

    .pwa-install-instructions {
        padding: 18px 16px;
    }

    .pwa-install-instructions h4 {
        font-size: 1rem;
        flex-wrap: wrap;
    }

    .pwa-install-steps {
        font-size: 0.9rem;
        padding-left: 1.2rem;
    }
}
