/* Lightweight, self-contained lightbox. All rules scoped to #tzgl-viewer. */
#tzgl-viewer { position: fixed; inset: 0; z-index: 2147483000; display: none; background: rgba(5, 8, 15, .95); color: #fff; font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; box-sizing: border-box; }
#tzgl-viewer *, #tzgl-viewer *::before, #tzgl-viewer *::after { box-sizing: border-box; }
#tzgl-viewer.tzgl-open { display: flex; align-items: center; justify-content: center; }
#tzgl-viewer button { font: inherit; -webkit-appearance: none; appearance: none; border: 0; color: #fff; background: rgba(24, 28, 38, .8); border-radius: 9px; cursor: pointer; min-width: 46px; min-height: 46px; padding: 0; display: flex; align-items: center; justify-content: center; touch-action: manipulation; }
#tzgl-viewer button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
#tzgl-viewer button[hidden] { display: none !important; }
#tzgl-viewer .tzgl-top { position: absolute; left: 0; right: 0; top: 0; z-index: 3; display: flex; justify-content: space-between; align-items: center; padding: calc(10px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-right, 0px)) 10px calc(14px + env(safe-area-inset-left, 0px)); pointer-events: none; }
#tzgl-viewer .tzgl-top button { pointer-events: auto; font-size: 34px; line-height: 1; }
#tzgl-viewer .tzgl-count { font-size: 15px; letter-spacing: .03em; background: rgba(0,0,0,.35); border-radius: 5px; padding: 5px 11px; }
#tzgl-viewer .tzgl-stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; padding: calc(65px + env(safe-area-inset-top, 0px)) 65px calc(74px + env(safe-area-inset-bottom, 0px)); }
#tzgl-viewer .tzgl-image { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; box-shadow: none; border: 0; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: pan-y; }
#tzgl-viewer .tzgl-prev, #tzgl-viewer .tzgl-next { position: absolute; z-index: 3; top: 50%; transform: translateY(-50%); font-size: 39px; line-height: 1; }
#tzgl-viewer .tzgl-prev { left: calc(10px + env(safe-area-inset-left, 0px)); }
#tzgl-viewer .tzgl-next { right: calc(10px + env(safe-area-inset-right, 0px)); }
#tzgl-viewer .tzgl-caption { position: absolute; bottom: calc(13px + env(safe-area-inset-bottom, 0px)); left: 12%; right: 12%; z-index: 2; text-align: center; font-size: 14px; line-height: 1.4; max-height: 3em; overflow: hidden; pointer-events: none; }
#tzgl-viewer .tzgl-error { display: none; color: #fff; background: rgba(100, 20, 20, .8); padding: 16px; border-radius: 5px; }
#tzgl-viewer.tzgl-failed .tzgl-error { display: block; }
#tzgl-viewer.tzgl-failed .tzgl-image { display: none; }
@media (max-width: 680px) {
  #tzgl-viewer .tzgl-stage { padding: calc(60px + env(safe-area-inset-top, 0px)) 8px calc(116px + env(safe-area-inset-bottom, 0px)); }
  #tzgl-viewer .tzgl-prev, #tzgl-viewer .tzgl-next { top: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: none; }
  #tzgl-viewer .tzgl-caption { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); left: 8px; right: 8px; }
}
@media (prefers-reduced-motion: reduce) { #tzgl-viewer, #tzgl-viewer * { animation: none !important; transition: none !important; } }
