.jpv-figure {
    margin: 0 0 1.5rem;
}

.jpv-viewer {
    position: relative;
    width: 100%;
    height: var(--jpv-height, 520px);
    min-height: 240px;
    overflow: hidden;
    background: #161616;
    border-radius: 16px;
    touch-action: none;
    user-select: none;
    outline: none;
}

.jpv-viewer:focus-visible {
    box-shadow: 0 0 0 3px rgba(158, 24, 86, 0.35);
}

.jpv-canvas {
    display: block;
    width: 100%;
    height: 100%;
    cursor: grab;
}

.jpv-canvas:active {
    cursor: grabbing;
}

.jpv-loading {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: grid;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, #2b2b2b, #111);
    font: 600 15px/1.4 "Open Sans", "Segoe UI", sans-serif;
}

.jpv-viewer.is-ready .jpv-loading {
    display: none;
}

.jpv-controls {
    position: absolute;
    left: 18px;
    bottom: 18px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.jpv-button {
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 52px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    color: #2b2b2b;
    line-height: 0;
    text-align: center;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.24);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.jpv-button:hover,
.jpv-button:focus-visible {
    background: #fff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 7px 22px rgba(0, 0, 0, 0.3);
    outline: none;
}

.jpv-button:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.75), 0 0 0 6px rgba(158, 24, 86, 0.6);
}

.jpv-button[aria-pressed="true"] {
    background: #9e1856;
    color: #fff;
}

.jpv-button svg {
    display: block;
    width: 27px;
    height: 27px;
    flex: 0 0 27px;
    margin: 0;
    padding: 0;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.4;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

.jpv-button[data-type="zoom-in"] svg,
.jpv-button[data-type="zoom-out"] svg {
    width: 29px;
    height: 29px;
    flex-basis: 29px;
    stroke-width: 2.6;
}

.jpv-button[data-type="home"] svg {
    width: 26px;
    height: 26px;
    flex-basis: 26px;
}

.jpv-button[data-type="auto"] svg,
.jpv-button[data-type="fullscreen"] svg {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
}

.jpv-compass {
    position: absolute;
    right: 14px;
    top: 14px;
    z-index: 5;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.92);
    font: 700 13px/1 "Open Sans", "Segoe UI", sans-serif;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}

.jpv-compass span {
    display: block;
    transform-origin: center;
}

.jpv-hotspots {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.jpv-hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}

.jpv-hotspot a,
.jpv-hotspot button {
    box-sizing: border-box;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #9e1856;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.jpv-hotspot-label {
    position: absolute;
    left: 50%;
    bottom: 38px;
    transform: translateX(-50%);
    white-space: nowrap;
    padding: 6px 9px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font: 600 13px/1.2 "Open Sans", "Segoe UI", sans-serif;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.jpv-hotspot:hover .jpv-hotspot-label,
.jpv-hotspot:focus-within .jpv-hotspot-label {
    opacity: 1;
}

.jpv-caption {
    margin-top: 0.65rem;
    color: #666;
    font-size: 0.95rem;
}

.jpv-error {
    padding: 1rem;
    border-left: 4px solid #b32d2e;
    background: #fff3f3;
}

.jpv-viewer:fullscreen {
    height: 100vh;
    border-radius: 0;
}

.jpv-viewer:fullscreen .jpv-canvas {
    width: 100vw;
    height: 100vh;
}

@media (max-width: 600px) {
    .jpv-viewer {
        height: min(var(--jpv-height, 520px), 68vh);
        border-radius: 12px;
    }

    .jpv-controls {
        left: 12px;
        bottom: 12px;
        gap: 8px;
    }

    .jpv-button {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
        flex-basis: 48px;
    }

    .jpv-button svg {
        width: 25px;
        height: 25px;
        flex-basis: 25px;
    }
}
