.gallery-viewer-open { overflow: hidden; }
.gallery-viewer {
    box-sizing: border-box;
    width: min(1200px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    padding: 0;
    border: 1px solid #9c7546;
    border-radius: 8px;
    background: #06121d;
    color: #e7edf3;
    box-shadow: 0 24px 100px #000c;
    font: 15px/1.5 system-ui, sans-serif;
}
.gallery-viewer::backdrop { background: rgb(0 5 12 / 90%); }
.gallery-viewer__header { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid #304052; }
.gallery-viewer__caption { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.gallery-viewer__button {
    flex: 0 0 auto; min-height: 44px; padding: 8px 14px;
    border: 1px solid #9c7546; border-radius: 4px;
    background: #112436; color: #fff; font: inherit; cursor: pointer;
}
.gallery-viewer__button:disabled { opacity: .5; cursor: default; }
.gallery-viewer__button:focus-visible, .gallery-viewer__stage:focus-visible { outline: 3px solid #f7bc71; outline-offset: -3px; }
.gallery-viewer__stage { display: flex; align-items: center; justify-content: center; overflow: auto; height: min(70dvh, 760px); background: #02070c; }
.gallery-viewer__image { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-viewer__stage--actual { display: block; }
.gallery-viewer__stage--actual .gallery-viewer__image { max-width: none; max-height: none; margin: auto; }
.gallery-viewer__status { margin: 0; padding: 10px 16px; }
.gallery-viewer__status:empty { display: none; }
[data-gallery-view] { cursor: zoom-in; }
@media (max-width: 600px) {
    .gallery-viewer { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); }
    .gallery-viewer__header { flex-wrap: wrap; gap: 8px; padding: 10px; }
    .gallery-viewer__caption { flex-basis: 100%; }
    .gallery-viewer__stage { height: 60dvh; }
    .gallery-viewer__button { flex: 1; }
}
