/* Isolated modal styles; no effect on the gallery's existing layout. */
dialog.avd-image-viewer {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  border: 0;
  padding: max(76px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(8, 10, 12, .96);
  color: #fff;
  overflow: auto;
  overscroll-behavior: contain;
}
dialog.avd-image-viewer[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
dialog.avd-image-viewer::backdrop { background: rgba(0, 0, 0, .85); }
.avd-image-viewer .avd-image-full {
  display: block;
  flex: 0 1 auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  max-height: calc(100dvh - 160px);
  min-height: 0;
  object-fit: contain;
  cursor: zoom-out;
}
.avd-image-viewer .avd-image-caption {
  flex: 0 0 auto;
  margin: 0;
  max-width: 72ch;
  font-size: 14px;
  line-height: 1.5;
  color: #fff;
  text-align: center;
}
.avd-image-viewer .avd-image-close {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 1;
  min-width: 100px;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #fff;
  border-radius: 4px;
  background: #15191d;
  color: #fff;
  font: 600 16px/1.4 sans-serif;
  cursor: pointer;
}
.avd-image-viewer .avd-image-close:focus-visible { outline: 3px solid #f0c9a4; outline-offset: 3px; }
