/* ── RPE Scale Popup Overlay ── */

.rpe-popup-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}
.rpe-popup-backdrop.rpe-popup-visible {
    opacity: 1;
}
.rpe-popup-backdrop.rpe-popup-hidden {
    pointer-events: none;
    opacity: 0;
}

/* ── Container ── */
.rpe-popup-container {
    position: relative;
    width: 90%;
    max-width: 370px;
    max-height: 96vh;
    overflow-y: auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 28px 22px 24px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #333;
}

/* ── Back / Close button ── */
.rpe-popup-close {
    position: absolute;
    top: 12px;
    left: 12px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #ffffff92;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    z-index: 1;
}
.rpe-popup-close::before {
    content: '';
    display: block;
    width: 11px;
    height: 11px;
    border-top: 4px solid rgb(254, 153, 0);
    border-left: 4px solid rgb(254, 153, 0);
    transform: rotate(-45deg);
    margin-left: 3px;
}

/* ── Title ── */
.rpe-popup-title {
    text-align: center;
    color: #3c6b64;
    font-size: 1.45rem;
    font-weight: 700;
    margin: 0 0 6px;
    font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}

/* ── Divider ── */
.rpe-popup-divider {
    width: 70%;
    height: 3px;
    border: none;
    background-color: #e9a566;
    margin: 0 auto 18px;
}

/* ── Mode toggle ── */
.rpe-popup-modes {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid #65b0a5;
}
.rpe-popup-mode-btn {
    flex: 1;
    padding: 10px 6px;
    font-size: 0.88rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s, color 0.2s;
    background: #fff;
    color: #3c6b64;
    font-family: inherit;
}
.rpe-popup-mode-btn.active {
    background: #65b0a5;
    color: #fff;
}

/* ── Subtitle ── */
.rpe-popup-subtitle {
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 14px;
    font-style: italic;
}

/* ── Scale table ── */
.rpe-scale-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
}
.rpe-scale-table td {
    padding: 4px 14px;
    font-weight: 700;
    font-size: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    color: #1a1a1a;
}
.rpe-scale-table tr:last-child td {
    border-bottom: none;
}
.rpe-scale-table .rpe-num {
    width: 40px;
    text-align: center;
    font-size: 1.15rem;
    padding-left: 8px;
    padding-right: 8px;
    border-right: 2px solid rgba(255, 255, 255, 0.5);
}
.rpe-scale-table .rpe-desc {
    text-align: center;
    font-size: 0.95rem;
}
