.gallery-lightbox[open] { display:flex;flex-direction:column;gap:12px;height:calc(100dvh - 40px);max-height:calc(100dvh - 40px);overflow:hidden; }
.gallery-photo-stage { display:grid;place-items:center;flex:1 1 auto;min-height:0; }
.gallery-photo-stage #lightbox-image { display:block;width:100%;height:100%;max-width:100%;max-height:100%;min-height:0;object-fit:contain; }
.gallery-info-toggle { display:inline-flex;align-items:center;justify-content:center;gap:8px;align-self:center;min-height:44px;padding:8px 14px;border:1px solid #666;background:#111;color:#ddd;font:inherit;font-size:.8rem;cursor:pointer; }
.gallery-info-toggle:focus-visible,.gallery-photo-info button:focus-visible,.gallery-photo-info input:focus-visible { outline:2px solid #eee;outline-offset:3px; }
.gallery-info-toggle[hidden],.gallery-photo-info[hidden],.gallery-photo-info [hidden] { display:none; }
.gallery-photo-info { flex:none;max-height:30dvh;overflow:auto;overscroll-behavior:contain;touch-action:pan-y;scrollbar-width:thin;padding:0 16px; }
.gallery-photo-info-heading { display:none; }
.gallery-photo-info .gallery-photo-date { color:#999;letter-spacing:normal;line-height:1.5; }
.gallery-photo-info .gallery-photo-date span { margin-inline-end:10px; }
.gallery-photo-copy-actions { display:flex;flex-wrap:wrap;justify-content:center;gap:8px 16px;margin-top:8px; }
.gallery-photo-copy-actions > button,.gallery-photo-info-heading button { min-height:44px;padding:6px 0;background:transparent;color:#aaa;border:0;font:inherit;font-size:.75rem;text-decoration:underline;text-underline-offset:3px;cursor:pointer; }
.gallery-photo-info .local-feedback { text-align:center;letter-spacing:normal; }
/* The caption note sits on #111 on mobile and on the modal backdrop elsewhere.
   Keep its existing typography while retaining contrast on both surfaces. */
.gallery-photo-info .gallery-translation-note { color:#888; }
.gallery-photo-manual { display:grid;gap:8px;margin:8px 0;font-size:.75rem; }
.gallery-photo-manual input { box-sizing:border-box;width:100%;min-width:0;min-height:44px;padding:8px;border:1px solid #666;background:#111;color:#ddd;font:inherit; }
.gallery-lightbox-navigation { flex:none;margin-top:0; }
@media(max-width:600px) {
 .gallery-lightbox[open] { width:calc(100vw - 16px);height:calc(100dvh - max(16px,env(safe-area-inset-top)) - max(16px,env(safe-area-inset-bottom)));max-height:calc(100dvh - 32px); }
 .gallery-photo-info { box-sizing:border-box;max-height:42dvh;padding:12px 16px;background:#111;border-top:1px solid #555; }
 .gallery-photo-info-heading { display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px; }
 .gallery-photo-info-heading h2 { margin:0;color:#ccc;font:500 .8rem 'Ubuntu',sans-serif; }
 .gallery-photo-info .gallery-lightbox-caption { max-height:none;text-align:left;letter-spacing:normal; }
 .gallery-photo-info .gallery-translation-note,.gallery-photo-info .gallery-photo-date,.gallery-photo-info .local-feedback { text-align:left; }
 .gallery-photo-copy-actions { justify-content:flex-start; }
 .gallery-lightbox-navigation { padding:0 4px max(8px,env(safe-area-inset-bottom));gap:8px; }
 .gallery-lightbox-navigation button { padding:8px 10px;font-size:.75rem; }
 .gallery-lightbox-close { top:max(18px,env(safe-area-inset-top));right:max(16px,env(safe-area-inset-right)); }
}
