.tweet-media.tweet-video {
  position: relative;
  width: min(100%, calc(510px * var(--video-ratio, 1.777778)));
  aspect-ratio: var(--video-ratio, 1.777778);
  max-width: 100%;
  background: #000;
  isolation: isolate;
}
.tweet-media.tweet-video > video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
}
.tweet-video-ui { position: absolute; inset: 0; color: #fff; pointer-events: none; }
.tweet-video-ui button, .tweet-video-ui input { pointer-events: auto; }
.tweet-video-ui button { color: #fff; touch-action: manipulation; border: 0; }
.tweet-video-ui svg { display: block; width: 20px; height: 20px; }
.video-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #0009;
}
.video-center-play svg { width: 28px; height: 28px; margin-left: 4px; }
.tweet-video[data-paused="false"] .video-center-play,
.tweet-video[data-video-error="true"] .video-center-play { display: none; }
.video-controls {
  position: absolute;
  inset: auto 0 0;
  padding: 14px 8px 3px;
  background: linear-gradient(transparent, #000b);
  opacity: 0;
  pointer-events: none;
}
.video-controls button, .video-controls input { pointer-events: none; }
.tweet-video[data-controls-visible="true"] .video-controls,
.tweet-video[data-paused="true"] .video-controls,
.tweet-video:focus-within .video-controls { opacity: 1; }
.tweet-video[data-controls-visible="true"] .video-controls :is(button, input),
.tweet-video[data-paused="true"] .video-controls :is(button, input),
.tweet-video:focus-within .video-controls :is(button, input) { pointer-events: auto; }
.video-controls-row { display: flex; align-items: center; gap: 1px; min-width: 0; }
.video-control {
  display: grid;
  place-items: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 50%;
  background: transparent;
}
.video-time { flex: 1; padding: 0 3px; font-size: 12px; line-height: 16px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.video-seek {
  display: block;
  appearance: none;
  -webkit-appearance: none;
  width: calc(100% - 12px);
  height: 18px;
  margin: 0 6px;
  padding: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
  background: transparent;
  touch-action: pan-y;
}
.video-seek::-webkit-slider-runnable-track { height: 3px; border-radius: 2px; background: linear-gradient(to right, #fff var(--video-progress, 0%), #ffffff65 var(--video-progress, 0%)); }
.video-seek::-moz-range-track { height: 3px; border-radius: 2px; background: #ffffff65; }
.video-seek::-moz-range-progress { height: 3px; border-radius: 2px; background: #fff; }
.video-seek::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%; border: 0; background: #fff; margin-top: -3.5px; }
.video-seek::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; border: 0; background: #fff; }
.tweet-video-ui :focus-visible { outline: 2px solid #fff; outline-offset: -2px; }
.video-seek:focus-visible { outline-offset: 2px; border-radius: 2px; }
.video-error { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 8px 12px; border-radius: 6px; background: #000b; font-size: 13px; white-space: nowrap; }
.tweet-media.tweet-video:fullscreen { width: 100%; height: 100%; max-width: none; max-height: none; aspect-ratio: auto; border: 0; border-radius: 0; }
.tweet-media.tweet-video:fullscreen .video-controls { padding-inline: 16px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
@media (hover: hover) and (pointer: fine) {
  .video-control:hover { background: #ffffff26; }
  .video-center-play:hover { background: #000b; }
}
@media (pointer: coarse) {
  .video-control { width: 44px; height: 44px; flex-basis: 44px; padding: 12px; }
  .video-seek { height: 28px; }
}
