a[data-image-viewer] { cursor: zoom-in; }
html:has(.image-viewer[open]) { overflow: hidden; }
.image-viewer {
  position: fixed;
  box-sizing: border-box;
  inline-size: min(1200px, calc(100% - 24px));
  max-inline-size: none;
  max-block-size: calc(100dvh - 24px);
  margin: auto;
  padding: 0;
  border: 1px solid #adc4df;
  border-radius: 16px;
  background: #f8fbff;
  color: #102640;
  box-shadow: 0 24px 80px #081d45a6;
}
.image-viewer::backdrop { background: #06152cde; }
.image-viewer [hidden] { display: none; }
.image-viewer-shell {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-block-size: calc(100dvh - 26px);
}
.image-viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px clamp(8px, 2vw, 20px);
}
.image-viewer-bar h2 {
  margin: 0;
  font-size: clamp(.875rem, .77rem + .45vw, 1.125rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.image-viewer button {
  flex: none;
  min-inline-size: 44px;
  min-block-size: 44px;
  padding: 0 9px;
  border: 1px solid #a8c6e3;
  border-radius: 8px;
  background: #eef7ff;
  color: #07579e;
  font: inherit;
  font-size: 1.45rem;
  cursor: pointer;
}
.image-viewer button:hover { background: #deefff; }
.image-viewer button:focus-visible {
  outline: 3px solid #075fb1;
  outline-offset: 2px;
}
.image-viewer-stage {
  min-block-size: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  padding: 8px;
  background: #e5edf7;
}
.image-viewer-stage img {
  display: block;
  inline-size: auto;
  block-size: auto;
  max-inline-size: 100%;
  max-block-size: max(80px, calc(100dvh - 122px));
  object-fit: contain;
}
