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

.ipe-lock {
    overflow: hidden !important;
}

.ipe-viewer {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    background: rgba(12, 14, 18, .84);
    color: #fff;
    touch-action: none;
}

.ipe-viewer.is-open {
    display: block;
}

.ipe-viewer[data-theme="light"] {
    background: rgba(245, 247, 251, .92);
    color: #172033;
}

.ipe-stage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ipe-img {
    max-width: min(92vw, 1400px);
    max-height: calc(100vh - 132px);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform .18s ease, opacity .16s ease;
    will-change: transform;
}

.ipe-viewer.no-thumbs .ipe-img {
    max-height: calc(100vh - 76px);
}

.ipe-topbar {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
}

.ipe-counter,
.ipe-btn,
.ipe-arrow {
    border: 0;
    color: #fff;
    background: rgba(0, 0, 0, .48);
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
    backdrop-filter: blur(10px);
}

.ipe-viewer[data-theme="light"] .ipe-counter,
.ipe-viewer[data-theme="light"] .ipe-btn,
.ipe-viewer[data-theme="light"] .ipe-arrow {
    color: #172033;
    background: rgba(255, 255, 255, .82);
}

.ipe-counter {
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 800;
    pointer-events: auto;
}

.ipe-toolbar {
    display: flex;
    gap: 9px;
    pointer-events: auto;
}

.ipe-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    transition: transform .16s ease, background .16s ease;
}

.ipe-btn:hover,
.ipe-arrow:hover {
    transform: translateY(-1px);
    background: rgba(0,0,0,.68);
}

.ipe-viewer[data-theme="light"] .ipe-btn:hover,
.ipe-viewer[data-theme="light"] .ipe-arrow:hover {
    background: rgba(255,255,255,.96);
}

.ipe-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
}

.ipe-arrow:hover {
    transform: translateY(-50%) scale(1.03);
}

.ipe-prev { left: 16px; }
.ipe-next { right: 16px; }

.ipe-caption {
    position: absolute;
    left: 50%;
    bottom: 88px;
    transform: translateX(-50%);
    max-width: min(900px, 80vw);
    padding: 8px 12px;
    color: #fff;
    background: rgba(0,0,0,.42);
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ipe-viewer[data-theme="light"] .ipe-caption {
    color: #172033;
    background: rgba(255,255,255,.82);
}

.ipe-thumbs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 8px;
    padding: 10px;
    overflow-x: auto;
    background: rgba(0,0,0,.56);
    scrollbar-width: thin;
}

.ipe-viewer[data-theme="light"] .ipe-thumbs {
    background: rgba(255,255,255,.72);
}

.ipe-thumb {
    flex: 0 0 82px;
    height: 56px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    opacity: .62;
    cursor: pointer;
    padding: 0;
    background: transparent;
}

.ipe-thumb.is-active {
    opacity: 1;
    border-color: #fff;
}

.ipe-viewer[data-theme="light"] .ipe-thumb.is-active {
    border-color: #6259f6;
}

.ipe-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ipe-hidden {
    display: none !important;
}

@media (max-width: 768px) {
    .ipe-topbar {
        left: 10px;
        right: 10px;
        top: 10px;
    }
    .ipe-toolbar {
        gap: 6px;
    }
    .ipe-btn {
        width: 36px;
        height: 36px;
    }
    .ipe-arrow {
        width: 42px;
        height: 42px;
        font-size: 24px;
    }
    .ipe-prev { left: 10px; }
    .ipe-next { right: 10px; }
    .ipe-img {
        max-width: 100vw;
        max-height: calc(100vh - 96px);
    }
    .ipe-thumb {
        flex-basis: 66px;
        height: 46px;
    }
    .ipe-caption {
        bottom: 74px;
        max-width: 86vw;
    }
}

