/* ── Overlay ── */
.rpm-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: rpmFadeIn 0.25s ease;
}

@keyframes rpmFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ── Modal box ── */
.rpm-modal {
    position: relative;
    background: transparent;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.35);
    max-width: 95vw;
    max-height: 95vh;
    display: inline-flex;
    flex-direction: column;
    overflow: hidden;
    animation: rpmSlideUp 0.28s ease;
    line-height: 0;
}

@keyframes rpmSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Close button ── */
.rpm-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: rgba(0,0,0,0.55);
    border: none;
    color: #fff;
    font-size: 22px;
    line-height: 1;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.rpm-close:hover { background: rgba(0,0,0,0.8); }

/* ── Content area ── */
.rpm-content {
    display: flex;
    line-height: 0;
}

/* ── Image ── */
.rpm-image {
    display: block;
    max-width: 95vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

/* ── PDF ── */
.rpm-pdf-wrap {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}
.rpm-pdf-wrap iframe {
    width: 100%;
    height: 65vh;
    border: none;
    border-radius: 8px 8px 0 0;
    display: block;
}
.rpm-pdf-link {
    display: block;
    text-align: center;
    padding: 10px;
    background: #f1f1f1;
    font-size: 13px;
    color: #0073aa;
    text-decoration: none;
    border-top: 1px solid #ddd;
}
.rpm-pdf-link:hover { background: #e5e5e5; }

/* ── Mobile ── */
@media (max-width: 600px) {
    .rpm-image {
        max-width: 98vw;
        max-height: 85vh;
    }
    .rpm-pdf-wrap iframe {
        height: 55vh;
    }
    .rpm-close {
        top: 6px;
        right: 8px;
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}
