/* Chamadas de voz (WhatsApp com clientes e, depois, equipe) */
:root { --call-green: #15803d; --call-red: #dc2626; }

.call-stack { position: fixed; top: 12px; right: 12px; z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100vw - 24px)); }
.call-card {
  background: var(--panel); border: 2px solid var(--call-green); border-radius: var(--radius); padding: 12px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap; box-shadow: 0 8px 28px rgba(0,0,0,.28);
  animation: call-pulse 1.4s ease-in-out infinite;
}
@keyframes call-pulse { 50% { box-shadow: 0 0 0 5px var(--accent-soft), 0 8px 28px rgba(0,0,0,.28); } }
@media (prefers-reduced-motion: reduce) { .call-card { animation: none; } }
.call-card .who { flex: 1; min-width: 120px; }
.call-card .who small { color: var(--muted); }
.call-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.call-accept { background: var(--call-green); border-color: var(--call-green); color: #fff; font-weight: 600; }
.btn.call-accept:hover { background: var(--call-green); filter: brightness(1.1); }
.btn.call-hang { background: var(--call-red); border-color: var(--call-red); color: #fff; font-weight: 600; }
.btn.call-hang:hover { background: var(--call-red); filter: brightness(1.1); }
.btn.on { background: var(--accent-soft); border-color: var(--accent); }

.call-panel {
  display: none; position: fixed; bottom: 16px; right: 16px; z-index: 60; width: min(380px, calc(100vw - 32px));
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
  box-shadow: 0 8px 28px rgba(0,0,0,.28); flex-direction: column; gap: 10px;
}
.call-panel.on { display: flex; }
.call-info { display: flex; gap: 12px; align-items: center; }
.call-info .who { display: flex; flex-direction: column; min-width: 0; }
.call-info .who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.call-state { color: var(--muted); font-variant-numeric: tabular-nums; }

/* linhas de chamada na conversa */
.bubble.call, .bubble.call_permission { align-self: center; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px 14px; color: var(--muted); max-width: 90%; }
.bubble.call .meta, .bubble.call_permission .meta { float: none; margin: 0 0 0 10px; }
.call-ico { margin-right: 6px; }
.btn.call-btn { display: inline-flex; gap: 6px; align-items: center; }

/* chamada da equipe (voz e video, em grupo) */
.call-card.team.soft { border-color: var(--line); animation: none; }
.tcall {
  position: fixed; right: 16px; bottom: 16px; z-index: 55; width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 32px);
  background: #0f1720; color: #e9edef; border-radius: 12px; box-shadow: 0 10px 34px rgba(0,0,0,.45); display: flex; flex-direction: column; overflow: hidden;
}
.tcall.min .tcall-grid { display: none; }
.tcall.big { width: min(1280px, calc(100vw - 32px)); height: calc(100vh - 32px); }
.tcall.big .tcall-grid { flex: 1; min-height: 0; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); align-content: start; }
.tcall.big.min { height: auto; }
.tcall-tile.screen { grid-column: 1 / -1; }
.tcall-tile:fullscreen { aspect-ratio: auto; border-radius: 0; }
.tcall-tile:fullscreen video { object-fit: contain; }
.tcall-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #1a262d; }
.tcall-head strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcall-head .btn { background: #2a3942; border-color: #2a3942; color: #e9edef; }
.tcall-time, .tcall-count { color: #8696a0; font-variant-numeric: tabular-nums; font-size: calc(13px * var(--fs, 1)); }
.tcall-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; padding: 10px; overflow: auto; }
.tcall-tile { position: relative; aspect-ratio: 16 / 9; background: #202c33; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.tcall-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.tcall-tile.screen video { object-fit: contain; }
.tcall-tile.novideo video { visibility: hidden; }
.tcall-ph { display: none; width: 64px; height: 64px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); place-items: center; font-size: calc(28px * var(--fs, 1)); font-weight: 700; }
.tcall-tile.novideo .tcall-ph { display: grid; }
.tcall-name, .tcall-state { position: absolute; font-size: calc(12px * var(--fs, 1)); background: rgba(0,0,0,.6); color: #fff; padding: 1px 9px; border-radius: 999px; }
.tcall-name { left: 8px; bottom: 6px; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tcall-state { right: 8px; top: 6px; }
.tcall-state:empty { display: none; }
.tcall-bar { display: flex; gap: 8px; flex-wrap: wrap; padding: 10px 14px; background: #1a262d; justify-content: center; }
.tcall-bar .btn { background: #2a3942; border-color: #2a3942; color: #e9edef; }
.tcall-bar .btn.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.tcall-bar .btn.call-hang { background: var(--call-red); border-color: var(--call-red); color: #fff; }
.call-rec { margin-left: 8px; }
.transcript { white-space: pre-wrap; line-height: 1.5; }

.tcall-meter { position: absolute; left: 8px; top: 8px; width: 46px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.22); overflow: hidden; }
.tcall-meter i { display: block; height: 100%; width: calc(var(--lv, 0) * 100%); background: #4ade80; transition: width .25s; }
.tcall-state.warn { background: var(--call-red); }

/* janela da chamada redimensionavel pelas bordas e cantos */
.tcall.sized { max-height: none; }
.tcall.sized .tcall-grid { flex: 1; min-height: 0; align-content: start; }
.tcall.sized.min { height: auto !important; }
.tcall-rz { position: absolute; z-index: 3; touch-action: none; }
.rz-n, .rz-s { left: 14px; right: 14px; height: 8px; cursor: ns-resize; } .rz-n { top: 0; } .rz-s { bottom: 0; }
.rz-e, .rz-w { top: 14px; bottom: 14px; width: 8px; cursor: ew-resize; } .rz-e { right: 0; } .rz-w { left: 0; }
.rz-ne, .rz-nw, .rz-se, .rz-sw { width: 16px; height: 16px; }
.rz-nw { top: 0; left: 0; cursor: nwse-resize; } .rz-se { bottom: 0; right: 0; cursor: nwse-resize; }
.rz-ne { top: 0; right: 0; cursor: nesw-resize; } .rz-sw { bottom: 0; left: 0; cursor: nesw-resize; }
.rz-se::after { content: ''; position: absolute; right: 3px; bottom: 3px; width: 9px; height: 9px; border-right: 2px solid rgba(255,255,255,.35); border-bottom: 2px solid rgba(255,255,255,.35); }
