.am-popup {
    position: absolute;
    z-index: 100001;
    display: none;
    box-sizing: border-box;
    max-width: calc(100vw - 32px);
    margin: 0 auto;
    overflow: hidden;
    text-align: left;
    color: var(--pure-white, #fff);
    background: linear-gradient(180deg, var(--medium-navy, #1f2a44) 0%, var(--deep-navy, #121a2f) 100%);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
    border-radius: 20px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5);
}

@media all and (min-width: 321px) {
    .am-popup {
        min-width: 320px;
    }
}

.am-popup .am-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0;
    padding: 24px 28px;
    font-size: 1rem;
    font-weight: 700;
    background: transparent;
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
}

.am-popup .am-popup-title {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 1.125rem;
    line-height: 1.35;
    color: var(--pure-white, #fff);
}

.am-popup .am-popup-close-icon {
    order: 2;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0;
    padding: 0;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
    border-radius: 12px;
    color: var(--cool-grey, #b3bac7);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.am-popup .am-popup-close-icon:hover,
.am-popup .am-popup-close-icon:focus {
    color: var(--pure-white, #fff);
    border-color: var(--classic-gold, #d4af37);
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
    outline: none;
}

.am-popup .am-popup-close-icon:after {
    content: "\00d7";
    font-size: 1.5rem;
    line-height: 1;
}

.am-popup .am-popup-content {
    max-height: min(70vh, calc(100vh - 180px));
    padding: 28px;
    overflow-x: hidden;
    overflow-y: auto;
    color: var(--cool-grey, #b3bac7);
    font-size: 13px;
    font-family: var(--font-family);
}

.am-popup .am-popup-content::-webkit-scrollbar {
    width: 10px;
}

.am-popup .am-popup-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
}

.am-popup .am-popup-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.55);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

#mask {
    position: fixed;
    inset: 0;
    z-index: 100000;
    width: 100%;
    height: 100%;
    background: rgba(4, 8, 18, 0.78);
    opacity: 1;
    filter: none;
    -moz-opacity: 1;
    backdrop-filter: blur(8px);
}

@media (max-width: 767px) {
    .am-popup {
        max-width: calc(100vw - 20px);
        border-radius: 16px;
    }

    .am-popup .am-popup-header {
        padding: 18px 20px;
        gap: 12px;
    }

    .am-popup .am-popup-title {
        font-size: 1rem;
    }

    .am-popup .am-popup-close-icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .am-popup .am-popup-content {
        max-height: calc(100vh - 150px);
        padding: 20px;
    }
}

.am-popup-content a {
    color: var(--classic-gold);
}

.cancel-subscription-popup-text,
.close-subscription-popup-text {
    margin-bottom: 1em;
}

.cancel-subscription-buttons,
.close-subscription-buttons,
.upgrade-subscription-buttons {
    display: flex;
    gap: 1em;
    align-items: center;
}

#cancel-subscription-yes,
#close-subscription-yes {
    font-family: inherit;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.25);
    color: var(--danger-red);
}

#cancel-subscription-yes:hover,
#close-subscription-yes:hover {
    background: rgba(231, 76, 60, 0.2);
    transform: translateY(-1px);
}

.upgrade-subscription-yes {
    font-family: inherit;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all var(--transition-fast);
    white-space: nowrap;
    background: rgba(212, 175, 55, 0.14);
    border: 1px solid rgba(212, 175, 55, 0.32);
    color: var(--classic-gold);
}

.upgrade-subscription-yes:hover {
    background: rgba(212, 175, 55, 0.24);
    color: var(--pure-white);
}

.am-upgrade-options {
    margin-bottom: 1em;
}

.am-upgrade-options input[type=radio] {
    width: auto;
    accent-color: var(--classic-gold);
}