/* Indicador "escribiendo…" (barra justo encima de la caja de mensaje) */
/* Superpuesto: NO ocupa sitio en el layout, así la caja de texto queda
   exactamente donde estaba antes (sin subirla) en móvil y PC. */
.message-form-wrap { position: relative; }
#typingBar {
  position: absolute;
  left: 14px; right: 14px; bottom: 100%;
  z-index: 11;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 20px;
  margin: 0;
  padding: 0 4px;
  font-size: .82rem;
  color: #B5BAC1;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events: none;
}
#typingBar.on { opacity: 1; transform: none; }
#typingBar .tb-txt { overflow: hidden; text-overflow: ellipsis; }
#typingBar .tb-txt b { color: #fff; font-weight: 700; }
#typingBar .tb-dots { display: inline-flex; align-items: center; gap: 3px; flex-shrink: 0; }
#typingBar .tb-dots i {
  width: 5px; height: 5px; border-radius: 50%;
  background: #B5BAC1; display: block;
  animation: tbBounce 1.2s infinite ease-in-out;
}
#typingBar .tb-dots i:nth-child(2) { animation-delay: .16s; }
#typingBar .tb-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes tbBounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
#typingBar .tb-avs { display: inline-flex; align-items: center; flex-shrink: 0; }
#typingBar .tb-av {
  width: 20px; height: 20px; border-radius: 50%;
  margin-left: -6px; overflow: hidden; flex-shrink: 0;
  border: 2px solid var(--bg-dark, #1B1E24);
  box-sizing: content-box;
  display: flex; align-items: center; justify-content: center;
  font-size: .55rem; font-weight: 700; color: #fff;
  animation: tbPop .2s ease-out;
}
#typingBar .tb-av:first-child { margin-left: 0; }
#typingBar .tb-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
@keyframes tbPop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
