.app-popup-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 0, 0, 0.45);
    z-index: 2147483647;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    overflow-y: auto;
}

.app-popup-overlay.is-visible {
    display: flex;
}

.app-popup-card {
    width: min(430px, calc(100vw - 32px));
    max-width: 430px;
    max-height: calc(100dvh - 32px);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    border: 1px solid #e8ecf2;
    animation: appPopupIn 0.2s ease-out;
}

@keyframes appPopupIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.app-popup-head {
    padding: 12px 16px;
    font-weight: 700;
    font-size: 15px;
    color: #1b2a41;
    border-bottom: 1px solid #edf1f7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-popup-head i {
    font-size: 15px;
}

.app-popup-body {
    padding: 18px 16px 8px;
    color: #2a3748;
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-line;
    word-break: break-word;
    overflow-y: auto;
}

.app-popup-actions {
    padding: 12px 16px 16px;
    text-align: right;
}

.app-popup-btn {
    border: 0;
    border-radius: 8px;
    padding: 8px 16px;
    color: #ffffff;
    background: #1e88e5;
    font-weight: 600;
}

.app-popup-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 136, 229, 0.25);
}

.app-popup-card.type-success .app-popup-head i,
.app-popup-card.type-success .app-popup-head {
    color: #1e9e5a;
}

.app-popup-card.type-warning .app-popup-head i,
.app-popup-card.type-warning .app-popup-head {
    color: #d28a00;
}

.app-popup-card.type-error .app-popup-head i,
.app-popup-card.type-error .app-popup-head {
    color: #d93025;
}

.app-popup-card.type-info .app-popup-head i,
.app-popup-card.type-info .app-popup-head {
    color: #1e88e5;
}

@media (max-width: 576px) {
    .app-popup-overlay {
        padding: 12px;
        align-items: center;
        justify-content: center;
    }

    .app-popup-card {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
        border-radius: 10px;
        margin: 0 auto;
    }

    .app-popup-head {
        padding: 10px 12px;
        font-size: 14px;
    }

    .app-popup-body {
        padding: 14px 12px 8px;
        font-size: 13px;
        max-height: calc(100dvh - 170px);
    }

    .app-popup-actions {
        padding: 10px 12px 12px;
        text-align: center;
    }

    .app-popup-btn {
        min-width: 96px;
        padding: 9px 16px;
        font-size: 16px;
    }
}

@media (max-height: 500px) {
    .app-popup-overlay {
        align-items: flex-start;
        padding-top: 8px;
    }

    .app-popup-card {
        max-height: calc(100dvh - 16px);
    }

    .app-popup-body {
        max-height: calc(100dvh - 150px);
    }
}
