.sevencode-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 16px;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.sevencode-popup-overlay.is-open {
    display: flex;
    opacity: 1;
    animation: sevencodePopupFadeIn 0.25s ease;
}
@keyframes sevencodePopupFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sevencode-popup-modal {
    position: relative;
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: sevencodePopupSlideUp 0.3s ease;
}
@keyframes sevencodePopupSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Close button - positioned INSIDE the modal at top-right
   so it never gets cut off by the viewport edge. */
.sevencode-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s ease, transform 0.15s ease;
}
.sevencode-popup-close:hover {
    background: #fff;
    transform: scale(1.08);
}
.sevencode-popup-close:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.sevencode-popup-body { padding: 0; }
.sevencode-popup-link { display: block; line-height: 0; }
.sevencode-popup-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}
.sevencode-popup-html {
    padding: 24px;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
}
.sevencode-popup-html a { color: #0073aa; }

@media (max-width: 480px) {
    .sevencode-popup-overlay { padding: 12px; }
    .sevencode-popup-modal { max-width: 100% !important; }
    .sevencode-popup-close {
        top: 6px;
        right: 6px;
        width: 34px;
        height: 34px;
        font-size: 22px;
    }
}
