html.kwvm-open,
html.kwvm-open body {
    overflow: hidden !important;
}

.kwvm-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(18, 2, 4, 0.88);
    opacity: 0;
    transition: opacity 180ms ease;
}

.kwvm-overlay--visible {
    opacity: 1;
}

.kwvm-dialog {
    width: min(1180px, 100%);
    max-height: calc(100vh - 40px);
    overflow: hidden;
    color: #2d1917;
    background: #fffaf1;
    border: 1px solid #d2a43e;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

.kwvm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 22px;
    color: #fff;
    background: #640d15;
    border-bottom: 1px solid #d2a43e;
}

.kwvm-header h2 {
    margin: 0 !important;
    color: #fff !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    line-height: 1.1;
}

.kwvm-close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #fff;
    background: transparent;
    border: 1px solid rgba(240, 212, 138, 0.72);
    border-radius: 0;
    font: 400 35px/38px Arial, sans-serif;
    cursor: pointer;
}

.kwvm-close:hover,
.kwvm-close:focus-visible {
    color: #280406;
    background: #d2a43e;
    outline: none;
}

.kwvm-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 22px;
    max-height: calc(100vh - 120px);
    overflow: auto;
    padding: 22px;
}

.kwvm-panel {
    min-width: 0;
    text-align: center;
}

.kwvm-panel-title {
    margin: 0 0 12px !important;
    color: #640d15 !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
}

.kwvm-media-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    padding: 7px;
    background: #d2a43e;
}

.kwvm-media-frame img {
    display: block;
    width: 100%;
    max-height: calc(100vh - 230px);
    object-fit: contain;
    background: #1c0306;
}

.kwvm-media-frame--pdf {
    height: calc(100vh - 230px);
    min-height: 460px;
}

.kwvm-media-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.kwvm-full-link {
    display: inline-block;
    margin-top: 12px;
    color: #640d15 !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-decoration: underline;
    text-transform: uppercase;
}

@media (max-width: 781px) {
    .kwvm-overlay {
        align-items: flex-start;
        padding: 10px;
    }

    .kwvm-dialog {
        max-height: calc(100vh - 20px);
    }

    .kwvm-header {
        position: sticky;
        top: 0;
        z-index: 2;
        padding: 13px 14px;
    }

    .kwvm-grid {
        grid-template-columns: 1fr;
        gap: 34px;
        max-height: calc(100vh - 88px);
        padding: 16px;
    }

    .kwvm-media-frame img {
        max-height: none;
    }

    .kwvm-media-frame--pdf {
        height: 68vh;
        min-height: 420px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kwvm-overlay {
        transition: none;
    }
}

