.video-viewport {
  position: relative;
  flex: none;
  width: 100%;
  height: 100%;
}

.video-surface {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 50%;
}

.video-stage.has-video { touch-action: none; }
.video-stage.is-zoomed .video-viewport { cursor: grab; }
.video-stage.is-zoomed .video-viewport:active { cursor: grabbing; }
.video-stage video { pointer-events: none; }
.video-stage [hidden] { display: none !important; }

.video-tools {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: max(10px, env(safe-area-inset-right));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  max-width: calc(100% - 20px);
  border: 1px solid rgba(238, 243, 251, .28);
  border-radius: 4px;
  background: rgba(15, 24, 43, .88);
  touch-action: manipulation;
}

.video-tools button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 3px;
  background: transparent;
}

.video-tools button:hover:not(:disabled) { background: var(--card); }
.video-tools button:focus-visible { outline: 2px solid var(--accent-2); outline-offset: -2px; }
.video-tools button img { width: 20px; height: 20px; filter: invert(1); pointer-events: none; }
.video-tools output { flex: 0 0 48px; text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }

.video-stage.touch-viewer .video-tools button:not(#fullscreenBtn):not(.touch-tool),
.video-stage.touch-viewer .video-tools output { display: none; }

.video-tools button[aria-pressed="true"] { background: #245b89; }
.video-stage.pointer-mode .video-viewport { cursor: crosshair; }
.remote-pointer {
  position: absolute;
  width: 0;
  height: 0;
  z-index: 1;
  pointer-events: none;
  transform-origin: 0 0;
}
.remote-pointer svg {
  position: absolute;
  left: -10px;
  top: -10px;
  width: 64px;
  height: 64px;
  overflow: visible;
}
.remote-pen svg {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
}

html.video-fullscreen, html.video-fullscreen body { overflow: hidden; overscroll-behavior: none; }
.video-stage.page-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.video-stage:fullscreen,
.video-stage:-webkit-full-screen,
.video-stage.page-fullscreen {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  border: 0;
  box-shadow: none;
}
