.ag-photo-control {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #16395d21;
  border-radius: 50%;
  background: #fff;
  color: #082b55;
  cursor: pointer;
  transition: background-color .18s, color .18s, box-shadow .18s;
}
.ag-photo-control > svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ag-photo-control:focus-visible, #tour-dialog .dialog-close:focus-visible { outline: 2px solid #169fc3; outline-offset: 3px; }
.ag-photo-control[hidden], .ag-photo-count[hidden] { display: none; }
.gallery-controls .ag-photo-control { padding: 0; box-shadow: 0 2px 6px #082b551c; }
.gallery-controls .ag-photo-control:hover { background: #eaf7fa; }
.gallery-controls span { color: #3c526d; font-variant-numeric: tabular-nums; font-weight: 600; }
#tour-dialog .dialog-close:hover { background: #eaf7fa; color: #082b55; }

dialog.ag-photo-viewer {
  --viewer-edge: clamp(12px, 3.2vw, 44px);
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #071426;
  color: #fff;
}
.ag-photo-viewer .lightbox-stage { position: absolute; inset: 0; width: 100%; height: 100%; padding: 62px clamp(12px, 5vw, 82px) 62px; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: zoom-in; }
.ag-photo-viewer .lightbox-stage.is-zoomed { cursor: grab; }
.ag-photo-viewer .lightbox-stage.is-zoomed:active { cursor: grabbing; }
.ag-photo-viewer .lightbox-stage img { display: block; max-width: 100%; max-height: calc(100dvh - 124px); border-radius: 10px; object-fit: contain; user-select: none; }
.ag-photo-viewer .ag-photo-control { background: #132a45d9; color: #fff; border-color: #ffffff26; box-shadow: 0 3px 14px #0004; backdrop-filter: blur(10px); }
.ag-photo-viewer .ag-photo-control:hover { background: #244767; }
.ag-photo-viewer .ag-photo-control:disabled { opacity: .43; cursor: default; }
.ag-photo-viewer .ag-photo-close { background: #f1f7f9; color: #0b2745; }
.ag-photo-viewer .ag-photo-close:hover { background: #d6edf4; }
.ag-photo-toolbar { position: absolute; top: max(10px, env(safe-area-inset-top)); right: var(--viewer-edge); display: flex; gap: 7px; }
.ag-photo-previous, .ag-photo-next { position: absolute; top: 50%; translate: 0 -50%; }
.ag-photo-previous { left: var(--viewer-edge); }
.ag-photo-next { right: var(--viewer-edge); }
.ag-photo-count { position: absolute; bottom: max(15px, env(safe-area-inset-bottom)); left: 50%; translate: -50% 0; padding: 7px 14px; border: 1px solid #fff3; border-radius: 50px; background: #132a45d9; color: #fff; font: 600 .85rem/1.3 system-ui, sans-serif; font-variant-numeric: tabular-nums; }
@media (max-width: 620px) {
  .ag-photo-viewer .lightbox-stage { padding-inline: 0; }
  .ag-photo-viewer .lightbox-stage img { border-radius: 0; }
  .ag-photo-previous, .ag-photo-next { top: auto; bottom: max(9px, env(safe-area-inset-bottom)); translate: none; }
}
