/* ── Esqueleto de carga de mensajes (estilo Discord) ───────────────
   Recuadros redondeados con degradado animado que simulan mensajes,
   imágenes/GIF/vídeos mientras se carga el historial. */
.messages-area.msg-loading { overflow: hidden !important; }
.messages-area.msg-loading > :not(.msg-skeleton) { display: none !important; }

.msg-skeleton {
  min-height: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 22px;
  padding: 16px 16px 14px;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  transition: opacity .18s ease;
}
.msg-skeleton.sk-out { opacity: 0; }
.sk-row { display: flex; gap: 14px; align-items: flex-start; }
.sk-col { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.sk-head { display: flex; gap: 12px; align-items: center; }

.sk-avatar, .sk-bar, .sk-media, .media-skel::after {
  background-color: rgba(255,255,255,.055);
  background-image: linear-gradient(100deg,
    rgba(255,255,255,0) 20%, rgba(255,255,255,.075) 50%, rgba(255,255,255,0) 80%);
  background-size: 220% 100%;
  background-repeat: no-repeat;
  animation: skShimmer 1.4s ease-in-out infinite;
}
.sk-avatar { width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; }
.sk-bar { height: 14px; border-radius: 8px; }
.sk-media { width: min(100%, 320px); height: 200px; border-radius: 10px; margin-top: 4px; }
@keyframes skShimmer {
  0%   { background-position: 160% 0; }
  100% { background-position: -60% 0; }
}

/* Imágenes / GIF / vídeos / stickers dentro de mensajes reales: recuadro
   con degradado animado hasta que el archivo termina de cargar. */
.media-skel { position: relative; min-height: 120px; min-width: 160px; }
.media-skel > img, .media-skel > video, .media-skel > .msg-video-play-btn { opacity: 0; }
.media-skel::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 10px;
  background-color: #23262c;
  z-index: 2;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .sk-avatar, .sk-bar, .sk-media, .media-skel::after { animation: none; }
}
