.ck-content [data-popup-id] {
    color: #868686;
    cursor: pointer;
    text-decoration: underline;
}

.ck-content [data-popup-id]:hover {
    opacity: 0.8;
    transition: all ease 0.2s ;
}

.ck-content [data-popup-id]:hover {
    opacity: 0.85;
}

.cms-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.55);
    box-sizing: border-box;
}

.cms-popup-overlay[hidden] {
    display: none !important;
}

.cms-popup-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 320px;
    max-width: 860px;
    min-height: 200px;
    max-height: min(560px, 80vh);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    box-sizing: border-box;
}

.cms-popup-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 24px;
    box-sizing: border-box;
}

.cms-popup-body.cms-popup-loading,
.cms-popup-body.cms-popup-error {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 140px;
    color: #666;
    font-size: 0.95rem;
}

.cms-popup-footer {
    flex: 0 0 auto;
    padding: 12px 24px 20px;
    border-top: 1px solid #eee;
    background: #fff;
    text-align: center;
    box-sizing: border-box;
}

.cms-popup-ok-btn {
    display: inline-block;
    min-width: 140px;
    padding: 10px 36px;
    border: none;
    border-radius: 4px;
    background: #F5B6C3;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.cms-popup-ok-btn:hover {
    background: #da8c9b;
}

.cms-popup-ok-btn:focus-visible {
    outline: 1px solid #F5B6C3;
}

.cms-popup-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #eee;
    border-top-color: #da8c9b;
    border-radius: 50%;
    animation: cms-popup-spin 0.7s linear infinite;
}

@keyframes cms-popup-spin {
    to {
        transform: rotate(360deg);
    }
}

body.cms-popup-open {
    overflow: hidden;
}

@media (max-width: 991px) {
    .cms-popup-overlay {
        padding: 20px;
    }

    .cms-popup-dialog {
        min-width: 280px;
        max-width: min(560px, calc(100vw - 40px));
        min-height: 180px;
        max-height: min(520px, 78vh);
    }

    .cms-popup-body {
        padding: 18px 20px;
    }

    .cms-popup-footer {
        padding: 12px 20px 18px;
    }
}

@media (max-width: 767px) {
    .cms-popup-overlay {
        padding: 16px;
        align-items: center;
    }

    .cms-popup-dialog {
        min-width: 0;
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
        min-height: 160px;
        max-height: min(480px, 85vh);
        border-radius: 6px;
    }

    .cms-popup-body {
        padding: 16px;
    }

    .cms-popup-footer {
        padding: 10px 16px 16px;
    }

    .cms-popup-ok-btn {
        width: 100%;
        max-width: 280px;
        min-width: 0;
        padding: 12px 24px;
        font-size: 0.95rem;
    }
}
