.gallery>.photo-viewer-open{display:block;width:100%;padding:0;border:0;background:transparent;color:inherit;line-height:0;cursor:zoom-in;box-shadow:none}
.photo-viewer-open>img{display:block;width:100%;aspect-ratio:1;object-fit:cover}
.photo-viewer-open:focus-visible{outline:3px solid var(--focus,var(--ink));outline-offset:4px}
.photo-viewer{position:fixed;inset:0;width:100vw;max-width:none;height:100vh;height:100dvh;max-height:none;margin:0;padding:0;border:0;background:var(--background,#fff);color:var(--ink,#2b2528);z-index:10000;overscroll-behavior:contain}
.photo-viewer:not([open]){display:none}.photo-viewer[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto}
.photo-viewer::backdrop{background:rgba(43,37,40,.6)}
.photo-viewer-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 16px;border-bottom:1px solid var(--line,#eadce2)}
.photo-viewer-header h2{font-size:18px;margin:0}.photo-viewer button{font:inherit;min-height:44px;min-width:44px;padding:7px 12px;cursor:pointer}.photo-viewer button:disabled{cursor:default}
.photo-viewer-header [data-viewer-close]{flex-shrink:0;font-weight:500}.photo-viewer-header [data-viewer-close] span{font-size:24px;vertical-align:middle;margin-left:8px}
.photo-viewer button{touch-action:manipulation}
.photo-viewer-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:8px 16px}.photo-viewer-toolbar output{min-width:54px;text-align:center;font-variant-numeric:tabular-nums}
.photo-viewer-navigation{display:flex;align-items:center;gap:6px;margin-left:auto}.photo-viewer-navigation>span{min-width:50px;text-align:center;font-variant-numeric:tabular-nums}
.photo-viewer-stage{position:relative;min-width:0;min-height:0;overflow:hidden;background:var(--panel,#fff9fb);touch-action:none;user-select:none;overscroll-behavior:contain;cursor:grab}
.photo-viewer-stage.is-dragging{cursor:grabbing}.photo-viewer-stage:focus-visible{outline:2px solid var(--focus,var(--ink));outline-offset:-3px}
.photo-viewer-image{position:absolute;top:0;left:0;display:block;max-width:none;max-height:none;transform-origin:0 0;will-change:transform;pointer-events:none;user-select:none;image-orientation:from-image;filter:none}
.photo-viewer-message{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:12px;padding:20px;z-index:1;pointer-events:none}.photo-viewer-message button,.photo-viewer-message a{pointer-events:auto}.photo-viewer-message[hidden],.photo-viewer [hidden]{display:none}
.photo-viewer-message p{margin:0}.photo-viewer-footer{padding:6px 16px;text-align:center;border-top:1px solid var(--line,#eadce2);max-height:15vh;overflow:auto}.photo-viewer-footer p{margin:0;font-size:13px}
@media(max-width:600px){.photo-viewer-header,.photo-viewer-toolbar{padding:6px 8px}.photo-viewer-toolbar{gap:4px}.photo-viewer button{padding:6px 9px}.photo-viewer-navigation{margin-left:0}.photo-viewer-header h2{font-size:16px}}
@media(prefers-reduced-motion:reduce){.photo-viewer *{scroll-behavior:auto!important;transition:none!important}}

/* The stage nests the opener; keep theme button frames off the photograph. */
.gallery .photo-viewer-open,.gallery .photo-viewer-open:hover{display:block;width:100%;padding:0;border:0;background:transparent;box-shadow:none;line-height:0;cursor:zoom-in}
.gallery .photo-viewer-open>img,.gallery .photo-viewer-image{border:0;box-shadow:none;outline:0}
.gallery .photo-viewer-open:focus-visible,.gallery .photo-viewer-stage:focus-visible{outline:2px solid #536273;outline-offset:3px;box-shadow:none}
.gallery .gallery-overlay:focus-visible{outline:2px solid #536273;outline-offset:3px}
