.gallery_viewer {
    box-sizing: border-box;
    position: fixed;
    inset: 0;
    width: calc(100% - 24px);
    max-width: 1200px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 8px;
    border: 0;
    border-radius: 6px;
    background: #172025;
    color: #fff;
    font: 14px/1.4 Tahoma, sans-serif;
}
.gallery_viewer::backdrop { background: rgba(0, 0, 0, .85); }
.gallery_viewer_toolbar, .gallery_viewer_footer { display: flex; align-items: center; gap: 8px; }
.gallery_viewer_toolbar { justify-content: space-between; }
.gallery_viewer button { flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid #68767d; border-radius: 4px; background: #26343b; color: #fff; font: 28px/1 sans-serif; cursor: pointer; }
.gallery_viewer button:disabled { opacity: .3; cursor: default; }
.gallery_viewer button:focus-visible { outline: 3px solid #8dd9e0; outline-offset: 2px; }
.gallery_viewer_frame { position: relative; height: 65vh; height: 65dvh; min-height: 0; }
.gallery_viewer .gallery_viewer_frame img { display: block; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery_viewer_status { position: absolute; inset: 40% 0 auto; text-align: center; }
.gallery_viewer_caption { flex: 1; min-width: 0; max-height: 12vh; margin: 8px 0; overflow: auto; overflow-wrap: anywhere; }
@media (max-height: 450px) {
    .gallery_viewer_frame { height: 48vh; height: 48dvh; }
}
