.vpiv-clickable {
    cursor: zoom-in;
}

.vpiv-modal[hidden] {
    display: none;
}

.vpiv-modal {
    position: fixed;
    inset: 0;
    z-index: 1000000;
    display: block;
    background: rgba(12, 12, 12, 0.96);
    color: #fff;
    touch-action: none;
}

.vpiv-toolbar {
    position: absolute;
    top: 18px;
    right: 18px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vpiv-zoom-group {
    display: grid;
    grid-template-columns: 42px 64px 42px;
    align-items: center;
    height: 44px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(24, 24, 24, 0.72);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.vpiv-control,
.vpiv-scale,
.vpiv-close {
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.vpiv-control {
    width: 42px;
    height: 42px;
}

.vpiv-scale {
    width: 64px;
    height: 26px;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    border-left: 1px solid rgba(255, 255, 255, 0.16);
    font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0.02em;
}

.vpiv-close {
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: rgba(24, 24, 24, 0.72);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.vpiv-control:hover,
.vpiv-scale:hover,
.vpiv-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.vpiv-control:active,
.vpiv-close:active {
    transform: scale(0.94);
}

.vpiv-control:focus-visible,
.vpiv-scale:focus-visible,
.vpiv-close:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 2px;
}

.vpiv-toolbar svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.5;
    stroke-linecap: round;
}

.vpiv-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    cursor: default;
}

.vpiv-stage.is-zoomed {
    cursor: grab;
}

.vpiv-stage.is-dragging {
    cursor: grabbing;
}

.vpiv-image {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    max-width: 92vw;
    max-height: 92vh;
    width: auto;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    will-change: transform;
}

body.vpiv-open {
    overflow: hidden;
}

@media (max-width: 767px) {
    .vpiv-toolbar {
        top: 12px;
        right: 12px;
        gap: 8px;
    }

    .vpiv-zoom-group {
        grid-template-columns: 40px 58px 40px;
        height: 42px;
    }

    .vpiv-control {
        width: 40px;
        height: 40px;
    }

    .vpiv-scale {
        width: 58px;
    }

    .vpiv-close {
        width: 42px;
        height: 42px;
    }

    .vpiv-image {
        max-width: 100vw;
        max-height: 100vh;
    }
}
