/* Chat sequence: chat-sequence.js arms the list (.mw-chat--armed) and shows
   each .mw-chat__msg with .mw-chat__msg--in. A bubble that has not played yet
   keeps its space with visibility: hidden, so the layout never jumps. The
   typing dots (.mw-chat__typing, three <i>, no text) sit in the slot of the
   bubble they announce: 600 ms per bounce, each dot 133 ms after the last.
   Without JavaScript, and under reduced motion, every bubble shows.
   --mw-chat-typing-bg: the dots' bubble (default #fff).
   --mw-chat-dot: the dots (default #3d3b45; keep 3:1 on the bubble at .6 opacity).
   --mw-chat-typing-radius: the bubble's corners (default 20px 20px 20px 6px,
   the small one at the tail). */

.mw-chat__msg { position: relative; }

.mw-chat--armed .mw-chat__msg:not(.mw-chat__msg--in) { visibility: hidden; }

.mw-chat__typing {
  position: absolute;
  top: 0;
  left: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 14px 16px;
  border-radius: var(--mw-chat-typing-radius, 20px 20px 20px 6px);
  background: var(--mw-chat-typing-bg, #fff);
  visibility: visible;
}

.mw-chat__typing i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mw-chat-dot, #3d3b45);
  animation: mw-chat-dot .6s linear infinite;
}
.mw-chat__typing i:nth-child(2) { animation-delay: .133s; }
.mw-chat__typing i:nth-child(3) { animation-delay: .266s; }
.mw-chat--paused .mw-chat__typing i { animation-play-state: paused; }

@keyframes mw-chat-dot {
  0%, 60%, 100% { transform: translateY(0); opacity: .6; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .mw-chat--armed .mw-chat__msg { visibility: visible; }
  .mw-chat__typing { display: none; }
}
