.wcr-content-preview-dialog {
  width: min(920px, 88vw);
  height: min(640px, 82vh);
  overflow: hidden;
}

.wcr-content-preview-dialog::backdrop {
  background: rgba(3, 18, 26, .80);
  backdrop-filter: blur(3px);
}

.wcr-preview-shell {
  overflow: hidden;
}

.wcr-preview-shell > header,
.wcr-preview-shell > footer {
  padding: 12px 18px;
}

.wcr-preview-shell > header h2 {
  font-size: 20px;
}

.wcr-preview-close {
  width: 38px;
  height: 38px;
  font-size: 27px;
}

.wcr-preview-stage {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 14px;
}

.wcr-preview-stage > img,
.wcr-preview-stage > video,
.wcr-preview-stage > iframe {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.wcr-audio-preview,
.wcr-generic-preview {
  box-sizing: border-box;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
}

.wcr-generic-preview img {
  min-height: 0;
  max-height: min(300px, 45vh);
  object-fit: contain;
}

@media (max-width: 650px) {
  .wcr-content-preview-dialog {
    width: min(94vw, 920px);
    height: min(72vh, 640px);
    border-radius: 12px;
  }
}

/* Image previews always show the complete image, with proportional letterboxing. */
.wcr-preview-stage:has(> img) {
  display: flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden !important;
}

.wcr-preview-stage > img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: auto;
  object-fit: contain !important;
  object-position: center center !important;
}
