.vpdf-kunci,
.vpdf-kunci body {
    overflow: hidden;
}

.vpdf {
    --vpdf-biru: #0a4495;
    --vpdf-emas: #f5b921;
    --vpdf-latar: #1b2536;
    position: fixed;
    inset: 0;
    z-index: 1090;
    display: flex;
    flex-direction: column;
    background: rgba(15, 23, 38, 0.96);
    color: #fff;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    opacity: 0;
    transition: opacity .2s cubic-bezier(.2, .7, .3, 1);
}

.vpdf.is-buka {
    opacity: 1;
}

.vpdf-kepala {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(10, 20, 36, 0.85);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.vpdf-judul {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 700;
    font-size: .95rem;
}

.vpdf-judul span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vpdf-judul i {
    color: #ff8a80;
    font-size: 1.1rem;
}

.vpdf-alat {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.vpdf-info {
    font-variant-numeric: tabular-nums;
    font-size: .82rem;
    color: rgba(255, 255, 255, 0.75);
    min-width: 58px;
    text-align: right;
    margin-right: 4px;
}

.vpdf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.vpdf-btn:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.vpdf-btn:active {
    transform: scale(.96);
}

.vpdf-btn:focus-visible,
.vpdf-aksi:focus-visible,
.vpdf-gulir:focus-visible {
    outline: 3px solid var(--vpdf-emas);
    outline-offset: 2px;
}

.vpdf-gulir {
    flex: 1;
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 18px 16px 28px;
}

.vpdf-halaman {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: min-content;
}

.vpdf-lembar {
    position: relative;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    flex-shrink: 0;
}

.vpdf-lembar:not(.is-siap)::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(100deg, #eef1f6 30%, #f8f9fc 50%, #eef1f6 70%);
    background-size: 200% 100%;
    animation: vpdfKilau 1.3s linear infinite;
}

.vpdf-lembar.is-gagal::after {
    animation: none;
    background: #f3f4f7;
}

.vpdf-lembar canvas {
    display: block;
}

.vpdf-nomor {
    position: absolute;
    right: 8px;
    bottom: 6px;
    z-index: 1;
    font-size: .72rem;
    font-weight: 700;
    color: #6b7c95;
    background: rgba(255, 255, 255, .9);
    border-radius: 6px;
    padding: 1px 6px;
    font-variant-numeric: tabular-nums;
}

.vpdf-lembar.is-siap .vpdf-nomor {
    display: none;
}

.vpdf-memuat,
.vpdf-galat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin-top: 18vh;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
}

.vpdf-galat i {
    font-size: 2rem;
    color: var(--vpdf-emas);
}

.vpdf-putar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--vpdf-emas);
    animation: vpdfPutar .8s linear infinite;
}

.vpdf-kaki {
    display: flex;
    justify-content: center;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: rgba(10, 20, 36, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.vpdf-aksi {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    border: 0;
    background: #fff;
    color: var(--vpdf-biru);
    font-weight: 800;
    font-size: .95rem;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, background .15s ease;
}

.vpdf-aksi:active {
    transform: scale(.97);
}

.vpdf-aksi.is-on {
    background: var(--vpdf-emas);
    color: #1c1c1c;
}

@keyframes vpdfKilau {
    to {
        background-position: -200% 0;
    }
}

@keyframes vpdfPutar {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 575.98px) {
    .vpdf-kepala {
        padding: 8px 10px;
    }

    .vpdf-btn {
        width: 36px;
        height: 36px;
    }

    .vpdf-judul {
        font-size: .86rem;
    }

    .vpdf-gulir {
        padding: 12px 8px 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vpdf,
    .vpdf-btn,
    .vpdf-aksi {
        transition: none;
    }

    .vpdf-lembar:not(.is-siap)::after,
    .vpdf-putar {
        animation: none;
    }
}
