/* ─────────────────────────────────────────────────────────────
   Chat de voz (mini chat de cada VC) — PC: panel a la derecha · móvil: pantalla completa
   ───────────────────────────────────────────────────────────── */

/* icono «reception»: verde = hay gente conectada · blanco = vacío */
.vc-reception { display: inline-flex; align-items: center; color: #fff; transition: color .2s; flex: none; }
.vc-reception.on { color: #23a559; }

/* botones de chat con círculo de no leídos */
[data-vc-chat] { position: relative; }
.vc-chat-badge {
  position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; box-sizing: border-box;
  border-radius: 9px; background: #ed4245; color: #fff; font: 700 .68rem/18px 'Inter', sans-serif; text-align: center;
  pointer-events: none; box-shadow: 0 0 0 2px #111214;
}

/* icono de chat dentro de cada canal de voz de la lista */
.vc-row-chat {
  flex: none; display: none; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 6px; background: transparent; color: #b5bac1; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.vc-row-chat:hover { background: rgba(255,255,255,.1); color: #fff; }
.vc-row-chat .vc-chat-badge { top: -4px; right: -4px; box-shadow: 0 0 0 2px #17181c; }
.voice-item:hover .vc-row-chat, .vc-row-chat.has-unread { display: inline-flex; }
html.lock-mobile-layout .vc-row-chat { display: inline-flex; width: 32px; height: 32px; }

/* botón de chat de la llamada en móvil (abajo a la izquierda, como en la referencia) */
#vcChatFab {
  position: absolute; left: 16px; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 6;
  width: 56px; height: 56px; padding: 0; border-radius: 50%; border: 1px solid #26292F; background: #0a0a0c; color: #fff;
  display: grid; place-items: center; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
#vcChatFab:active { transform: scale(.95); }
@media (min-width: 769px) { html:not(.lock-mobile-layout) #vcChatFab { display: none; } }

/* ── panel del chat ── */
.vcc {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(380px, 100vw); z-index: 1000;
  display: flex; flex-direction: column; box-sizing: border-box;
  background: #17181c; color: #dbdee1; border-left: 1px solid #26292F;
  font-family: 'Inter', sans-serif; font-size: .92rem;
  transform: translateX(100%); visibility: hidden; transition: transform .2s ease, visibility 0s linear .2s;
  overscroll-behavior: contain;
}
.vcc.open { transform: none; visibility: visible; transition: transform .2s ease; }
.vcc-head { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 12px 0 16px; box-sizing: border-box; border-bottom: 1px solid #26292F; flex: none; }
.vcc-ic { color: #fff; display: inline-flex; }
.vcc-title { flex: 1; min-width: 0; }
.vcc-t1 { display: flex; align-items: center; gap: 8px; font-weight: 700; color: #fff; }
.vcc-t2 { font-size: .74rem; color: #949ba4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vcc-x, .vcc-back { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #b5bac1; display: grid; place-items: center; cursor: pointer; flex: none; }
.vcc-x:hover, .vcc-back:hover { background: rgba(255,255,255,.08); color: #fff; }
.vcc-back { display: none; margin-left: -8px; }

.vcc-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 0 8px; -webkit-overflow-scrolling: touch; }
.vcc-state { padding: 40px 24px; text-align: center; color: #949ba4; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vcc-state.empty svg { color: #4e5058; margin-bottom: 8px; }
.vcc-state p { margin: 0; line-height: 1.4; }
.vcc-state .sub { font-size: .8rem; color: #6d6f78; }
.vcc-state.err { color: #f38688; }
.vcc-retry { margin-top: 10px; padding: 7px 14px; border: 0; border-radius: 8px; background: #413CDD; color: #fff; font-weight: 600; cursor: pointer; }
.vcc-more, .vcc-start { text-align: center; font-size: .74rem; color: #6d6f78; padding: 4px 0 10px; }
.vcc-day { display: flex; align-items: center; gap: 10px; margin: 12px 16px 6px; color: #80848e; font-size: .72rem; font-weight: 600; }
.vcc-day::before, .vcc-day::after { content: ''; flex: 1; height: 1px; background: #26292F; }

.vcc-msg { position: relative; display: flex; gap: 10px; padding: 3px 16px; }
.vcc-msg:not(.grouped) { margin-top: 10px; }
.vcc-msg:hover { background: rgba(255,255,255,.035); }
.vcc-msg.sel { background: rgba(255,255,255,.06); }
.vcc-av { flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; color: #fff; font-size: .78rem; font-weight: 700; }
.vcc-av img { width: 100%; height: 100%; object-fit: cover; }
.vcc-msg.grouped { padding-left: 62px; }
.vcc-gt { position: absolute; left: 0; width: 62px; text-align: center; font-size: .66rem; color: #6d6f78; line-height: 1.5rem; visibility: hidden; }
.vcc-msg.grouped:hover .vcc-gt { visibility: visible; }
.vcc-body { min-width: 0; flex: 1; }
.vcc-meta { display: flex; align-items: baseline; gap: 8px; }
.vcc-name { color: #fff; font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcc-time { font-size: .68rem; color: #6d6f78; flex: none; }
.vcc-text { line-height: 1.4; word-break: break-word; overflow-wrap: anywhere; color: #dbdee1; }
.vcc-text a { color: #7f8cff; text-decoration: none; }
.vcc-text a:hover { text-decoration: underline; }
.vcc-edited { font-size: .66rem; color: #6d6f78; }
.vcc-media { display: block; max-width: 100%; max-height: 240px; border-radius: 8px; margin-top: 4px; }
.vcc-media.sticker { max-height: 140px; }
.vcc-file { display: inline-block; margin-top: 4px; padding: 6px 10px; border-radius: 8px; background: #22252b; color: #7f8cff; text-decoration: none; font-size: .84rem; }
.vcc-del {
  position: absolute; top: -8px; right: 14px; display: none; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0;
  border: 1px solid #26292F; border-radius: 8px; background: #1d2026; color: #f38688; cursor: pointer;
}
.vcc-del:hover { background: #ed4245; color: #fff; }
.vcc-msg:hover .vcc-del, .vcc-msg.sel .vcc-del { display: inline-flex; }

.vcc-new {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 76px; padding: 7px 14px; border: 0; border-radius: 16px;
  background: #413CDD; color: #fff; font-weight: 600; font-size: .8rem; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.4); z-index: 2;
}
.vcc-new[hidden] { display: none; }

.vcc-compose { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid #26292F; flex: none; }
.vcc-compose textarea {
  flex: 1; min-width: 0; resize: none; max-height: 140px; padding: 10px 12px; box-sizing: border-box; border: 1px solid #26292F; border-radius: 12px;
  background: #1d2026; color: #fff; font: inherit; line-height: 1.35; outline: none;
}
.vcc-compose textarea:focus { border-color: #413CDD; }
.vcc-send { flex: none; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 12px; background: #413CDD; color: #fff; display: grid; place-items: center; cursor: pointer; }
.vcc-send:disabled { background: #2a2d34; color: #6d6f78; cursor: default; }

/* ── móvil: pantalla completa (sube desde abajo) ── */
@media (max-width: 768px) {
  .vcc { width: 100%; border-left: 0; top: 0; height: 100dvh; transform: translateY(100%); }
  .vcc.open { transform: none; }
  .vcc-back { display: grid; }
  .vcc-x { display: none; }
}
html.lock-mobile-layout .vcc { width: 100%; border-left: 0; height: 100dvh; transform: translateY(100%); }
html.lock-mobile-layout .vcc.open { transform: none; }
html.lock-mobile-layout .vcc-back { display: grid; }
html.lock-mobile-layout .vcc-x { display: none; }
@media (prefers-reduced-motion: reduce) { .vcc, .vcc.open { transition: none; } }

/* ── PC: con el chat de voz abierto, la llamada se queda al lado (no tapada) ── */
@media (min-width: 769px) {
  html.vcc-open:not(.lock-mobile-layout) .vc-panel { right: min(380px, 100vw) !important; }
}
html:has(.vc-panel.fl-full) .vcc { z-index: 2100; }
