html.photo-viewer-open { overflow: hidden; }
dialog.photo-viewer { position:fixed; inset:0; margin:0; padding:0; width:100%; max-width:none; height:100%; height:100dvh; max-height:none; border:0; border-radius:0; background:#101412; color:#fff; overflow:hidden; }
dialog.photo-viewer[open] { display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto minmax(0,1fr) auto; }
.photo-viewer::backdrop { background:rgba(0,0,0,.95); }
.photo-toolbar { display:flex; align-items:center; justify-content:space-between; padding:calc(8px + env(safe-area-inset-top)) 16px 8px; }
.photo-count { font-size:16px; font-variant-numeric:tabular-nums; }
.photo-viewer button { display:flex; align-items:center; justify-content:center; width:48px; height:48px; padding:0; border:1px solid #ffffff40; border-radius:50%; background:#ffffff12; color:white; font-size:30px; line-height:1; cursor:pointer; }
.photo-viewer button:disabled { opacity:.25; cursor:default; }
.photo-viewer :focus-visible { outline:3px solid #a6d6ac; outline-offset:-3px; }
.photo-stage { position:relative; min-width:0; min-height:0; width:100%; }
.photo-track { display:flex; height:100%; min-height:0; width:100%; overflow-x:auto; overflow-y:hidden; scroll-snap-type:x mandatory; overscroll-behavior-x:contain; scrollbar-width:none; }
.photo-track::-webkit-scrollbar { display:none; }
.photo-slide { flex:0 0 100%; min-width:0; height:100%; position:relative; display:flex; align-items:center; justify-content:center; scroll-snap-align:center; scroll-snap-stop:always; }
.photo-slide img { display:block; width:100%; height:100%; object-fit:contain; user-select:none; }
.photo-status { position:absolute; left:20px; right:20px; text-align:center; padding:12px; background:#101412dc; color:#eee; pointer-events:none; }
.photo-footer { display:flex; align-items:center; justify-content:center; gap:16px; padding:8px 16px calc(12px + env(safe-area-inset-bottom)); }
.photo-hint { color:#d0d8d2; font-size:13px; }
.photo-viewer .photo-arrow { display:none; position:absolute; top:50%; transform:translateY(-50%); z-index:2; background:rgba(16,20,18,.8); box-shadow:0 2px 10px #0005; }
.photo-prev { left:20px; }
.photo-next { right:20px; }
.photo-arrow svg { width:26px; height:26px; display:block; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
@media (min-width:761px) and (hover:hover) and (pointer:fine) {
  .photo-viewer:not(.photo-single) .photo-arrow { display:flex; }
  .photo-arrow:not(:disabled):hover { background:#356c39; border-color:#a6d6ac; }
}
