.chat-message > .chat-video-tile {
  position: relative;
  display: block;
  box-sizing: border-box;
  inline-size: min(21rem, 72vw, calc(var(--chat-video-ratio, 1.33333) * 18rem));
  max-inline-size: 100%;
  min-inline-size: 0;
  aspect-ratio: var(--chat-video-ratio, 4 / 3);
  margin-block: 2px 5px;
  border-radius: 9px;
  overflow: hidden;
  background: linear-gradient(150deg, #275650, #143631 78%);
  color: #fff;
}

.chat-video-tile .chat-video-action {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  inline-size: 100%;
  block-size: 100%;
  border: 0;
  border-radius: inherit;
  padding: 0 0 12px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.chat-video-action:focus-visible {
  outline: 2px solid #d6f59d;
  outline-offset: -3px;
}

.chat-video-icon {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  inline-size: 44px;
  block-size: 44px;
  border: 1px solid #cce5d2;
  border-radius: 50%;
  background: #e8f4eb1c;
  font: 28px/1 system-ui, sans-serif;
}

.chat-video-action:hover .chat-video-icon {
  background: #e8f4eb35;
}

.chat-video-tile:not(.is-downloading) .chat-video-icon::before {
  content: "";
  border-block: 7px solid transparent;
  border-inline-start: 10px solid currentColor;
  margin-inline-start: 3px;
}

.chat-video-progress,
.chat-video-summary,
.chat-video-status {
  position: absolute;
  inset-inline: 8px;
  pointer-events: none;
}

.chat-video-summary {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1px 5px;
  inset-block-end: 8px;
  font-size: 11px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.chat-video-progress {
  inset-block-end: 27px;
  inline-size: calc(100% - 16px);
  block-size: 5px;
  border-radius: 4px;
  overflow: hidden;
  appearance: none;
  border: 0;
  background: #ffffff30;
  accent-color: #b7e19d;
}

.chat-video-progress::-webkit-progress-bar { background: #ffffff30; }
.chat-video-progress::-webkit-progress-value { background: #b7e19d; }
.chat-video-progress::-moz-progress-bar { background: #b7e19d; }

.chat-video-progress[hidden],
.chat-video-percent[hidden] {
  display: none;
}

.chat-video-status {
  inset-block-start: 8px;
  text-align: center;
  color: #f0fff2;
  font-size: 11px;
  line-height: 1.2;
}

.chat-video-view > a { margin-inline-start: 10px; }
