/* Голосовые сообщения: проигрыватель (.vc) и панель записи в окне чата (.chat-rec). Общий файл для сайта и админки «Диалоги».
   Цвета заданы переменными: --vc-on (цвет проигранной части и кнопки), --vc-bar (непроигранная), --vc-fg (время). Тёмная тема админки — .dark. */
.vc { --vc-on:var(--chat-accent, #00809C); --vc-bar:#C3D3D9; --vc-fg:#0F2530; --vc-btn:var(--vc-on); --vc-icon:#fff; display:flex; align-items:center; gap:10px; width:240px; max-width:100%; }
.dark .vc { --vc-bar:#4B5B63; --vc-fg:#E5E7EB; }
.vc-play { flex:none; width:36px; height:36px; padding:0; border:0; border-radius:50%; background:var(--vc-btn); color:var(--vc-icon); display:flex; align-items:center; justify-content:center; cursor:pointer; transition:transform .15s, filter .15s; }
.vc-play:hover { filter:brightness(1.08); } .vc-play:active { transform:scale(.94); }
.vc-play:focus-visible { outline:2px solid var(--vc-on); outline-offset:2px; }
.vc-play svg { width:16px; height:16px; fill:currentColor; display:block; } .vc-play .pl { margin-left:2px; } .vc-play .pa { display:none; }
.vc.playing .vc-play .pl { display:none; } .vc.playing .vc-play .pa { display:block; }
.vc.loading .vc-play { opacity:.65; }
.vc-wave { flex:1; min-width:0; height:30px; display:flex; align-items:center; gap:2px; cursor:pointer; }
.vc-wave i { flex:1; min-width:2px; max-width:4px; border-radius:2px; background:var(--vc-bar); transition:background .12s; }
.vc-wave i.on { background:var(--vc-on); }
.vc-time { flex:none; min-width:34px; text-align:right; font:600 12px/1 Onest, system-ui, sans-serif; font-variant-numeric:tabular-nums; color:var(--vc-fg); opacity:.78; }
.vc.err .vc-time { color:#C0392B; opacity:1; } .vc.err .vc-wave { opacity:.45; }

/* внутри цветного пузыря (своё сообщение посетителя, ответ оператора в админке): белая кнопка и светлая «волна» */
.chat-msg.me .vc, .ci-msg.op .vc { --vc-bar:rgba(255,255,255,.42); --vc-on:#fff; --vc-fg:#fff; --vc-btn:#fff; }
.chat-msg.me .vc .vc-play { --vc-icon:var(--chat-accent, #00809C); }
.ci-msg.op .vc .vc-play { --vc-icon:#00809C; }
.chat-text.chat-voice, .ci-text.ci-voice { padding:9px 12px; }

/* ---------- панель записи в окне чата ---------- */
.chat-rec { display:flex; align-items:center; gap:6px; padding:5px; background:#fff; border:1px solid var(--chat-accent, #00809C); border-radius:26px; box-shadow:0 0 0 3px rgba(0,128,156,.12); animation:vrIn .18s ease-out; }
.chat-rec[hidden] { display:none; }
.vr-x, .vr-go { flex:none; width:38px; height:38px; padding:0; border-radius:50%; border:0; display:flex; align-items:center; justify-content:center; cursor:pointer; transition:background .15s, filter .15s; }
.vr-x { background:transparent; color:#8A989F; } .vr-x:hover { background:#F2F5F6; color:#C0392B; }
.vr-go { background:var(--chat-accent, #00809C); color:#fff; } .vr-go:hover { filter:brightness(1.08); }
.vr-x svg, .vr-go svg { width:20px; height:20px; display:block; }
.vr-go .go-send { display:none; } .chat-rec.is-review .vr-go .go-stop { display:none; } .chat-rec.is-review .vr-go .go-send { display:block; }
.vr-go .go-stop { fill:currentColor; }
.vr-body { flex:1; min-width:0; display:flex; align-items:center; gap:10px; }
.vr-dot { flex:none; width:10px; height:10px; border-radius:50%; background:#E5484D; animation:vrPulse 1.1s ease-in-out infinite; }
.vr-time { flex:none; min-width:34px; font:600 14px/1 Onest, system-ui, sans-serif; font-variant-numeric:tabular-nums; color:#0F2530; }
.vr-live { flex:1; min-width:0; height:28px; display:flex; align-items:center; justify-content:flex-end; gap:2px; overflow:hidden; }
.vr-live i { flex:none; width:3px; border-radius:2px; background:var(--chat-accent, #00809C); opacity:.85; transition:height .1s; }
.vr-review { flex:1; min-width:0; display:none; } .vr-review .vc { width:100%; }
.chat-rec.is-review .vr-dot, .chat-rec.is-review .vr-time, .chat-rec.is-review .vr-live { display:none; } .chat-rec.is-review .vr-review { display:block; }
@keyframes vrPulse { 0%, 100% { opacity:1; transform:scale(1); } 50% { opacity:.35; transform:scale(.8); } }
@keyframes vrIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
@media (prefers-reduced-motion: reduce) { .vr-dot, .chat-rec { animation:none; } .vc-play, .vc-wave i { transition:none; } }
