.video-player { min-height: 0; min-width: 0; background: #000; color: #f4f4f4; }
.showreel-dialog .video-player { display: grid; grid-template-rows: minmax(0, 1fr) auto; }
video { -webkit-touch-callout: none; pointer-events: none; }
video::-webkit-media-controls { display: none !important; }
video::-webkit-media-controls-enclosure { display: none !important; }
video::-webkit-media-controls-panel { display: none !important; }
.video-surface {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  background: #000;
}
.video-surface > img,
.video-surface > canvas,
.video-surface > video.video-decoder {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  pointer-events: none;
}
.video-surface > img { z-index: 1; background: #000; }
.video-surface > canvas { z-index: 2; background: #000; }
.video-surface > canvas[hidden] { display: none; }
.video-surface > video.video-decoder {
  /* Keep a full-size frame for canvas while placing native overlays off screen. */
  left: calc(100% + 100vw);
  right: auto;
  opacity: .01;
}
.showreel-dialog .video-surface,
.video-player:fullscreen .video-surface,
.video-player-expanded .video-surface {
  height: auto;
  align-self: stretch;
  aspect-ratio: auto !important;
}
.case-video .video-surface { max-height: min(72svh, 590px); }
.case-motion .case-video .video-surface { max-height: none; aspect-ratio: 16 / 9 !important; }
.video-player:fullscreen .video-surface,
.video-player-expanded .video-surface { max-height: none; }
.video-controls {
  display: flex;
  align-items: center;
  gap: clamp(2px, 1.2vw, 10px);
  padding: 3px 5px;
}
.video-controls button {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  place-items: center;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}
.video-controls button:hover { color: var(--accent); }
.video-controls svg { width: 20px; height: 20px; }
.video-controls input[type="range"] { width: 0; min-width: 0; flex: 1; accent-color: var(--accent); cursor: pointer; margin: 0; }
.video-controls .video-volume { max-width: 64px; }
.video-time { white-space: nowrap; font: 500 11px/1 var(--mono); }
@media (max-width: 600px), (pointer: coarse) { .video-controls .video-volume { display: none; } }
.video-player:fullscreen, .video-player.video-player-expanded {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.video-player.video-player-expanded { position: fixed; z-index: 100; inset: 0; }
.video-player:fullscreen video, .video-player.video-player-expanded video {
  width: 100%;
  height: 100%;
  max-height: none;
  min-height: 0;
  object-fit: contain;
}
body:has(.video-player-expanded) { overflow: hidden; }
