html { scrollbar-gutter: stable; }
html.modal-open { overflow: hidden; }
html.modal-open body { position: fixed; width: 100%; overflow: hidden; }

.image-dialog {
  inset: 0; margin: 0; width: 100%; height: 100dvh;
  max-width: none; max-height: none; border: 0; border-radius: 0;
  background: transparent; box-shadow: none; color: white;
  padding: max(.4rem, env(safe-area-inset-top)) max(.75rem, env(safe-area-inset-right))
    max(.75rem, env(safe-area-inset-bottom)) max(.75rem, env(safe-area-inset-left));
}
.image-dialog::backdrop { background: rgb(9 17 15 / 91%); }
.image-dialog[open] { display: flex; flex-direction: column; }
.image-actions { display: flex; justify-content: flex-end; gap: .35rem; }
.image-actions button {
  width: 44px; height: 44px; padding: 0; color: white; background: transparent;
  border: 0; border-radius: 50%; font: 400 1.55rem/1 var(--sans); cursor: pointer;
}
.image-actions button:disabled { opacity: .35; }
.image-actions button:is(:hover, :focus-visible) { background: rgb(255 255 255 / 12%); }
.image-dialog .viewer-canvas {
  flex: 1; display: flex; min-height: 0; max-height: none; overflow: auto;
  background: transparent; border: 0; border-radius: 0; touch-action: none; overscroll-behavior: contain;
}
.image-dialog .viewer-canvas img, .image-dialog.is-zoomed .viewer-canvas img {
  flex: none; display: block; margin: auto; max-width: none; max-height: none;
  background: transparent; user-select: none; -webkit-user-select: none;
}
.image-dialog.is-zoomed .viewer-canvas img { cursor: grab; }
.image-dialog.is-zoomed .is-dragging img { cursor: grabbing; }
.viewer-status { text-align: center; }
.image-dialog .viewer-canvas img[src$=".png" i] { background-color: white; }
