.image-gallery {
    box-sizing: border-box;
    width: fit-content;
    min-width: min(360px, 94vw);
    max-width: 94vw;
    max-height: 94vh;
    max-height: 94dvh;
    margin: auto;
    padding: 0 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    background: #111817;
    color: #f4f5f0;
    font-family: Arial, sans-serif;
    box-shadow: 0 28px 100px #0009, 0 0 0 1px #0004;
    animation: gallery-enter .2s ease-out;
}
.image-gallery::backdrop {
    background: rgba(5, 12, 10, .86);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
}
.image-gallery .gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 54px;
    padding: 0 2px 0 8px;
}
.image-gallery .gallery-label {
    color: #d7bc7a;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.image-gallery button {
    box-sizing: border-box;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    padding: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    background: rgba(16, 24, 22, .6);
    color: #fff;
    font-family: Arial, sans-serif;
    font-weight: 400;
    text-shadow: none;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.image-gallery button:hover {
    background: #33433a;
    border-color: #d7bc7a;
    transform: scale(1.06);
}
.image-gallery button:focus-visible { outline: 2px solid #d7bc7a; outline-offset: 4px; }
.image-gallery .gallery-close { width: 34px; height: 34px; font-size: 26px; line-height: 1; }
.image-gallery .gallery-stage { position: relative; overflow: hidden; border-radius: 9px; background: #090e0c; }
.image-gallery .gallery-image {
    display: block;
    width: auto;
    height: auto;
    max-width: calc(94vw - 26px);
    max-height: calc(94vh - 112px);
    max-height: calc(94dvh - 112px);
    margin: auto;
    border: 0;
    border-radius: 0;
    object-fit: contain;
}
.image-gallery .gallery-nav {
    position: absolute;
    top: calc(50% - 23px);
    width: 46px;
    height: 46px;
    font-size: 38px;
    line-height: 1;
    box-shadow: 0 3px 12px #0003;
    backdrop-filter: blur(6px);
}
.image-gallery .gallery-previous { left: 14px; }
.image-gallery .gallery-next { right: 14px; }
.image-gallery .gallery-nav svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}
.image-gallery .gallery-previous svg { transform: translateX(1px); }
.image-gallery .gallery-next svg { transform: translateX(-1px); }
.image-gallery .gallery-nav[hidden] { display: none; }
.image-gallery .gallery-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 50px;
    padding: 0 8px;
    font-size: 12px;
}
.image-gallery .gallery-caption { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #d4dbd5; }
.image-gallery .gallery-counter { flex-shrink: 0; font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: 2px; color: #a5b3a9; }
@keyframes gallery-enter { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
    .image-gallery { max-width: 96vw; min-width: 0; padding: 0 7px; border-radius: 12px; }
    .image-gallery .gallery-image { max-width: calc(96vw - 16px); max-height: calc(90dvh - 100px); }
    .image-gallery .gallery-header { min-height: 48px; gap: 12px; padding-left: 6px; }
    .image-gallery .gallery-label { font-size: 9px; letter-spacing: 1.5px; }
    .image-gallery .gallery-close { width: 32px; height: 32px; }
    .image-gallery .gallery-nav { width: 38px; height: 38px; top: calc(50% - 19px); font-size: 32px; }
    .image-gallery .gallery-nav svg { width: 22px; height: 22px; }
    .image-gallery .gallery-previous { left: 8px; }
    .image-gallery .gallery-next { right: 8px; }
    .image-gallery .gallery-footer { min-height: 44px; gap: 12px; padding: 0 6px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
    .image-gallery { animation: none; }
    .image-gallery button { transition: none; }
}
