.image-viewer {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(9, 13, 19, .97);
  color: #f7fafc;
  overflow: hidden;
  font: inherit;
}
/* The shared dialog contract caps width and adds a frame; the viewer stays full screen. */
html[data-ui] body dialog.image-viewer { max-width: none; max-height: none; border: 0; border-radius: 0; }
.image-viewer[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.image-viewer::backdrop { background: #080b12e8; backdrop-filter: blur(8px); }
.image-viewer header { display: flex; gap: 16px; align-items: center; justify-content: space-between; padding: 16px 24px; border-bottom: 1px solid #ffffff20; }
.image-viewer header strong { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.image-viewer-tools { display: flex; gap: 8px; flex-shrink: 0; }
.image-viewer button, .image-viewer a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 8px 14px; border: 1px solid #ffffff38; border-radius: 10px; background: #ffffff0a; color: #f7fafc; font: inherit; font-size: 13px; text-decoration: none; cursor: pointer; }
.image-viewer button:hover, .image-viewer a:hover { background: #ffffff20; }
.image-viewer .image-viewer-close { font-size: 26px; padding: 3px 10px; }
.image-viewer :focus-visible { outline: 2px solid #83d9ec; outline-offset: 3px; }
.image-viewer-stage {
  box-sizing: border-box;
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 24px;
}
.image-viewer-stage img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 48px);
  max-height: calc(100dvh - 140px);
  object-fit: contain;
  box-shadow: 0 16px 64px #0007;
}
.image-viewer-stage.is-actual { display: block; text-align: center; }
.image-viewer-stage.is-actual img { max-width: none; max-height: none; margin: 0 auto; }
.image-viewer-info { text-align: center; font-size: 12px; color: #c2ccd8; margin: 0; padding: 8px 12px 16px; }
.image-zoomable { cursor: zoom-in; }
.image-zoomable:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 600px) {
  .image-viewer header { padding: 12px; flex-wrap: wrap; gap: 8px; }
  .image-viewer header strong { flex-basis: 100%; }
  .image-viewer-tools { width: 100%; }
  .image-viewer-close { margin-inline-start: auto; }
  .image-viewer-stage { padding: 10px; }
  .image-viewer-stage img { max-width: calc(100vw - 20px); max-height: calc(100dvh - 190px); }
  .image-viewer-tools button, .image-viewer-tools a { font-size: 12px; }
}
