html.image-viewer-open {
  overflow: hidden;
}

.image-viewer {
  box-sizing: border-box;
  width: fit-content;
  max-width: min(72rem, calc(100% - 2rem));
  max-height: calc(100dvh - 2rem);
  margin: auto;
  padding: 0.75rem;
  border: 1px solid #c3d2e2;
  border-radius: 0.75rem;
  color: #142b40;
  background: #fff;
}

.image-viewer[open] {
  display: grid;
  justify-items: center;
  gap: 0.75rem;
}

.image-viewer::backdrop {
  background: rgb(11 24 39 / 78%);
}

.image-viewer .image-viewer-close {
  justify-self: end;
  width: auto;
  min-height: 44px;
  padding: 0.4rem 1rem;
  border: 1px solid #809cb8;
  border-radius: 0.45rem;
  color: #142b40;
  background: #f3f7fb;
  font: inherit;
  cursor: pointer;
}

.image-viewer .image-viewer-close:hover {
  background: #e5effa;
}

.image-viewer .image-viewer-close:focus-visible {
  outline: 2px solid #155f9c;
  outline-offset: 2px;
}

.image-viewer img {
  display: block;
  width: auto;
  min-width: min(36rem, calc(100vw - 4rem));
  max-width: min(69rem, calc(100vw - 4rem));
  max-height: calc(100dvh - 7rem);
  object-fit: contain;
}

.image-viewer [hidden] {
  display: none;
}
