/* Let every film keep its native frame proportions, without letterboxing. */
#work-modal video.video-frame {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  max-height: none;
  object-fit: contain;
  background: transparent;
  border: 0;
}

/* Video previews fit the video itself; image previews keep their existing layout. */
#media-dialog.video-only {
  width: max-content;
  height: max-content;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  box-shadow: none;
}
#media-dialog.video-only .media-content {
  display: block;
  width: max-content;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: visible;
  background: transparent;
}
#media-dialog.video-only .media-content video {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  max-width: min(1100px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
  border: 0;
}
#media-dialog.video-only .media-bar {
  position: absolute;
  inset: 0;
  z-index: 20;
  height: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  overflow: visible;
  background: transparent;
  pointer-events: none;
}
#media-dialog.video-only #media-title {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
#media-dialog.video-only .media-bar .dialog-close {
  position: absolute;
  z-index: 21;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  color: #fff;
  border: 1px solid #ffffffa6;
  background: #21150fcc;
  box-shadow: 0 2px 12px #0004;
  pointer-events: auto;
}
