.image-preview {
  position: fixed;
  inset: 0;
  width: fit-content;
  max-width: min(94vw, 1200px);
  max-height: 94dvh;
  padding: 0;
  margin: auto;
  border: 1px solid #596751;
  border-radius: 14px;
  background: #1b211a;
  overflow: hidden;
}

.image-preview::backdrop {
  background: #080a08db;
}

.image-preview img {
  display: block;
  max-width: 100%;
  max-height: 92dvh;
  object-fit: contain;
}

.image-preview .image-preview-close {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #829573;
  border-radius: 50%;
  background: #192018;
  color: #f6f8f1;
  font: 26px/1 system-ui, sans-serif;
}

.image-preview-close:focus-visible {
  outline: 2px solid #c8fb56;
  outline-offset: 2px;
}

@media print {
  .image-preview { display: none; }
}
