/* Fit the chat bubble to the video width after applying the height limit. */
.app .chat .row .bubble.ghrVisualBubble:has(.ghrVideoPreview) {
  box-sizing: border-box;
  width: fit-content;
  max-width: min(78%, 440px);
}

.app .chat .row .bubble.ghrVisualBubble .ghrVideoPreview {
  width: min(432px, calc(min(62dvh, 530px) * var(--ghr-video-ratio, 1.778)));
  max-width: 100%;
  background: transparent;
}

.app .chat .ghrVideoPreview .ghrVideoFrame {
  object-fit: cover;
}

/* Let the caption and action row wrap to the video, including narrow clips. */
.app .chat .ghrVisualBubble:has(.ghrVideoPreview) > :not(.ghrVideoPreview) {
  contain: inline-size;
}

@media (max-width: 650px) {
  .app .chat .row .bubble.ghrVisualBubble:has(.ghrVideoPreview) {
    max-width: min(79%, 370px);
  }
}
