.mppl-gallery {
    --mppl-accent: #fd5b04;
    --mppl-height: 260px;
    --mppl-fit: cover;
    position: relative;
    width: 100%;
}

.mppl-gallery * {
    box-sizing: border-box;
}

.mppl-gallery-stage {
    position: relative;
    display: block;
    width: 100%;
    height: var(--mppl-height);
    min-height: 120px;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 16px;
    background:
        linear-gradient(135deg, rgba(253,91,4,.95), rgba(45,28,18,.88)),
        repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 1px, transparent 1px 10px);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 18px 45px rgba(0,0,0,.25);
    cursor: zoom-in;
}

.mppl-gallery-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: var(--mppl-fit);
    object-position: center;
    opacity: 0;
    transform: scale(1.015);
    transition: opacity 420ms ease, transform 650ms ease;
    pointer-events: none;
}

.mppl-gallery-slide.is-active {
    opacity: 1;
    transform: scale(1);
}

.mppl-gallery-badge,
.mppl-open-hint {
    position: absolute;
    z-index: 2;
    border-radius: 999px;
    color: #fff;
    background: rgba(0,0,0,.62);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    font-size: 12px;
    line-height: 1;
}

.mppl-gallery-badge {
    top: 12px;
    right: 12px;
    padding: 7px 10px;
}

.mppl-open-hint {
    left: 12px;
    bottom: 12px;
    padding: 8px 11px;
    opacity: .9;
}

.mppl-gallery-controls {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}

.mppl-control {
    width: 38px;
    height: 34px;
    border: 1px solid rgba(255,255,255,.16);
    border-radius: 999px;
    color: #fff;
    background: rgba(255,255,255,.08);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.mppl-control:hover,
.mppl-control:focus-visible {
    background: var(--mppl-accent);
    transform: translateY(-1px);
}

.mppl-gallery-warning {
    border-left: 4px solid #fd5b04;
    padding: 10px 12px;
    background: #fff7f1;
    color: #2b160c;
}

.mppl-lightbox[hidden] {
    display: none !important;
}

.mppl-lightbox {
    --mppl-accent: #fd5b04;
    position: fixed !important;
    inset: 0 !important;
    z-index: 2147483647 !important;
    display: grid;
    place-items: center;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: clamp(16px, 3vw, 32px);
    overflow: hidden;
    isolation: isolate;
    background: rgba(0,0,0,.94);
    box-sizing: border-box;
}

.mppl-lightbox *,
.mppl-lightbox *::before,
.mppl-lightbox *::after {
    box-sizing: border-box;
}

.mppl-lightbox-figure {
    margin: 0;
    width: min(96vw, 1400px);
    max-width: calc(100vw - 64px);
    max-height: calc(100dvh - 64px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.mppl-lightbox-img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: calc(100dvh - 112px);
    margin: 0 auto;
    border-radius: 14px;
    object-fit: contain;
    object-position: center;
    box-shadow: 0 20px 80px rgba(0,0,0,.7);
}

.mppl-lightbox-caption {
    flex: 0 0 auto;
    margin-top: 12px;
    color: rgba(255,255,255,.82);
    font-size: 14px;
}

.mppl-lightbox-close,
.mppl-lightbox-nav {
    position: fixed !important;
    z-index: 2147483647 !important;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 999px;
    color: #fff;
    background: rgba(20,20,20,.76);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}

.mppl-lightbox-close:hover,
.mppl-lightbox-close:focus-visible,
.mppl-lightbox-nav:hover,
.mppl-lightbox-nav:focus-visible {
    background: var(--mppl-accent);
    transform: scale(1.04);
}

.mppl-lightbox-close {
    top: max(14px, env(safe-area-inset-top));
    right: max(14px, env(safe-area-inset-right));
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 32px;
    line-height: 38px;
}

.mppl-lightbox-nav {
    top: 50%;
    width: 52px;
    height: 52px;
    padding: 0;
    font-size: 38px;
    line-height: 44px;
    transform: translateY(-50%);
}

.mppl-lightbox-nav:hover,
.mppl-lightbox-nav:focus-visible {
    transform: translateY(-50%) scale(1.04);
}

.mppl-lightbox-prev {
    left: max(14px, env(safe-area-inset-left));
}

.mppl-lightbox-next {
    right: max(14px, env(safe-area-inset-right));
}

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

@media (max-width: 700px) {
    .mppl-open-hint {
        display: none;
    }

    .mppl-lightbox {
        padding: 14px;
    }

    .mppl-lightbox-figure {
        width: 100%;
        max-width: calc(100vw - 28px);
        max-height: calc(100dvh - 28px);
    }

    .mppl-lightbox-img {
        max-height: calc(100dvh - 84px);
        border-radius: 10px;
    }

    .mppl-lightbox-close {
        top: max(10px, env(safe-area-inset-top));
        right: max(10px, env(safe-area-inset-right));
    }

    .mppl-lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 32px;
    }

    .mppl-lightbox-prev {
        left: max(8px, env(safe-area-inset-left));
    }

    .mppl-lightbox-next {
        right: max(8px, env(safe-area-inset-right));
    }
}
