.gallery-viewer{box-sizing:border-box;width:min(92vw,960px);max-width:none;max-height:calc(100dvh - 26px);border:1px solid #53624f;border-radius:15px;background:#212b22;box-shadow:0 20px 90px #10171094;overflow:auto}
.gallery-viewer::backdrop{background:#121710df}
.gallery-viewer-frame{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.gallery-viewer-header,.gallery-viewer-controls{display:flex;align-items:center;padding:7px 13px;background:#253127;color:#f4f7ef;min-height:54px;gap:10px}
.gallery-viewer-header{justify-content:space-between;border-bottom:1px solid #485747;font-size:.89rem;font-weight:700}
.gallery-viewer-controls{justify-content:center;border-top:1px solid #485747}
.gallery-viewer .photo-dialog-inner{display:grid;place-items:center;min-height:0;height:min(74dvh,calc(100dvh - 145px),760px);background:#161e17}
.gallery-viewer img{display:block;width:100%;height:100%;min-height:0;max-height:none;object-fit:contain}
.gallery-viewer button{position:static;transform:none;width:40px;height:40px;border:1px solid #657662;border-radius:9px;color:#eff6e8;background:#344538;transition:background .15s,color .15s,border-color .15s}
.gallery-viewer button:hover,.gallery-viewer button:focus-visible{background:#e5f0cc;color:#1c2a1c;border-color:#e5f0cc}
.gallery-viewer button:focus-visible{outline:2px solid #e5f0cc;outline-offset:2px}
.gallery-viewer button[hidden]{display:none}
.gallery-viewer .photo-count{min-width:66px;min-height:0;margin:0;color:#edf2e8;font-size:.86rem;font-variant-numeric:tabular-nums}
@media(max-width:520px){.gallery-viewer .photo-dialog-inner{height:min(62dvh,calc(100dvh - 155px),max(240px,110vw))}.gallery-viewer{width:calc(100vw - 20px);border-radius:11px}.gallery-viewer-header,.gallery-viewer-controls{padding-inline:9px}.gallery-viewer button{width:44px;height:44px}}
@media(prefers-reduced-motion:reduce){.gallery-viewer button{transition:none}}
