/* CENTRAL DE COMUNICAÇÃO — estilos. Tokens locais sob .cc (herdam a marca do produto: vermelho, Inter, Archivo Black nos números).
   Ideia de design: "quem falou" e "até onde a mensagem chegou" legíveis de relance.
     - voz humana  = balão grafite (à direita)      - voz automática = balão claro, borda tracejada (à direita)
     - teste       = balão claro, borda pontilhada  - responsável    = balão branco (à esquerda)
     - entrega     = TRILHA de 3 marcas (enviada, entregue, lida): cada marca só acende com o seu próprio fato — "enviada" nunca parece "entregue".
   Vermelho da marca só onde há sinal: não lidas, enviar, foco. Sem gradientes decorativos, sem cartões idênticos: a visão geral é um painel de instrumentos. */

.cc-host { display: block; position: relative; }
/* Os tokens valem em .cc-host (não só em .cc): os MODAIS são anexados ao host, fora da seção .cc. */
.cc, .cc-host {
  --cc-ink: #17181c; --cc-mute: #666b73; --cc-faint: #9a9ea6; --cc-line: #e6e8ec; --cc-line-2: #eef0f3;
  --cc-paper: #ffffff; --cc-surface: #f6f7f9; --cc-canvas: #eceef2; --cc-graphite: #252830;
  --cc-brand: var(--verde, #D81324); --cc-brand-tint: var(--vermelho-tint, #fdf1f1);
  --cc-ok: var(--ok, #0e9d57); --cc-ok-bg: var(--ok-bg, #e2f7ec); --cc-warn: var(--warn, #c48a12); --cc-warn-bg: var(--warn-bg, #fdf3d9);
  --cc-bad: var(--bad, #db3b3b); --cc-bad-bg: var(--bad-bg, #fce3e3); --cc-info: var(--info, #2f77c4);
  --cc-r: 14px; --cc-r-sm: 10px;
  --cc-alt: clamp(560px, calc(100vh - 330px), 940px);
  color: var(--cc-ink);
  font-feature-settings: "tnum" 1;
}
@supports (height: 100dvh) { .cc, .cc-host { --cc-alt: clamp(560px, calc(100dvh - 330px), 940px); } }
.cc *, .cc *::before, .cc *::after, .cc-host *, .cc-host *::before, .cc-host *::after { box-sizing: border-box; }
.cc button, .cc-host button { font: inherit; }
.cc :focus-visible, .cc-host :focus-visible { outline: 2px solid var(--cc-brand); outline-offset: 2px; border-radius: 6px; }
.cc-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.cc-nota { display: block; font-size: 12.5px; color: var(--cc-mute); font-weight: 400; }
.cc-link { background: none; border: 0; padding: 2px 0; color: var(--cc-brand); font-weight: 600; font-size: 13px; cursor: pointer; }
.cc-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.cc-tel { font-variant-numeric: tabular-nums; letter-spacing: .3px; color: var(--cc-mute); font-size: 13px; }

/* ---------- topo e abas ---------- */
.cc-topo { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.cc-titulo { font-size: 22px; font-weight: 750; letter-spacing: -.4px; line-height: 1.15; }
.cc-sub { font-size: 13.5px; color: var(--cc-mute); margin-top: 4px; max-width: 60ch; }
.cc-topo-estado { display: flex; gap: 8px; flex-wrap: wrap; }
.cc-pill { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--cc-surface); color: var(--cc-mute); border: 1px solid var(--cc-line); white-space: nowrap; }
.cc-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cc-faint); flex: none; }
.cc-pill--ok { background: var(--cc-ok-bg); color: #0a7a44; border-color: transparent; } .cc-pill--ok .cc-dot { background: var(--cc-ok); }
.cc-pill--atencao { background: var(--cc-warn-bg); color: #8a6208; border-color: transparent; } .cc-pill--atencao .cc-dot { background: var(--cc-warn); }
.cc-pill--critico { background: var(--cc-bad-bg); color: #a92727; border-color: transparent; } .cc-pill--critico .cc-dot { background: var(--cc-bad); }
.cc-pill--carregando .cc-dot { animation: cc-pulso 1.1s ease-in-out infinite; }

.cc-abas { position: relative; display: flex; gap: 2px; border-bottom: 1px solid var(--cc-line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.cc-abas::-webkit-scrollbar { display: none; }
.cc-aba { position: relative; background: none; border: 0; padding: 11px 14px 12px; font-size: 14px; font-weight: 550; color: var(--cc-mute); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; transition: color .15s; }
.cc-aba:hover { color: var(--cc-ink); }
.cc-aba[aria-selected="true"] { color: var(--cc-ink); font-weight: 700; }
.cc-aba-marca { position: absolute; left: 0; bottom: -1px; height: 2px; width: var(--w, 0); background: var(--cc-brand); transform: translateX(var(--x, 0)); transition: transform .28s cubic-bezier(.4,0,.2,1), width .28s cubic-bezier(.4,0,.2,1); border-radius: 2px; }
.cc-badge, .cc-contador { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--cc-brand); color: #fff; font-size: 11.5px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }

/* ---------- avatar ---------- */
.cc-avatar { position: relative; flex: none; display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; background: hsl(var(--h, 210) 55% 92%); color: hsl(var(--h, 210) 45% 30%); font-weight: 700; user-select: none; }
.cc-avatar--s { width: 32px; height: 32px; font-size: 12px; } .cc-avatar--m { width: 44px; height: 44px; font-size: 15px; } .cc-avatar--g { width: 76px; height: 76px; font-size: 26px; }
.cc-avatar-ini { position: relative; z-index: 0; }
.cc-avatar-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }

/* ---------- trilha de entrega ---------- */
.cc-trilha { position: relative; display: inline-flex; align-items: center; gap: 2px; padding: 4px 2px; cursor: default; vertical-align: middle; --off: #d5d8de; --c1: #8a9099; --c2: var(--cc-ok); --c3: var(--cc-info); }
.cc-marca { position: relative; width: 10px; height: 4px; border-radius: 2px; background: var(--off); display: block; transition: background .25s; }
.cc-marca:nth-child(1).cc-marca--feito { background: var(--c1); } .cc-marca:nth-child(2).cc-marca--feito { background: var(--c2); } .cc-marca:nth-child(3).cc-marca--feito { background: var(--c3); }
.cc-marca--andamento { background: var(--c1); animation: cc-pulso 1s ease-in-out infinite; }
.cc-marca--falha { background: var(--cc-bad) !important; } .cc-marca--atencao { background: var(--cc-warn) !important; } .cc-marca--cancelado { background: #b3b7be !important; }
.cc-status-txt { font-size: 11.5px; font-weight: 600; color: var(--cc-mute); margin-left: 4px; }
.cc-status-txt--read { color: var(--cc-brand); } .cc-status-txt--failed { color: var(--cc-bad); } .cc-status-txt--delivery_unknown { color: #8a6208; }
/* tooltips (hover na marca; foco por teclado na trilha inteira) */
[data-dica] { --dx: 0; }
.cc-marca[data-dica]:hover::after, .cc-trilha[data-dica]:focus-visible::after {
  content: attr(data-dica); position: absolute; bottom: calc(100% + 8px); right: 0; z-index: 40; width: max-content; max-width: 250px;
  background: #1c1e24; color: #fff; padding: 7px 10px; border-radius: 8px; font-size: 12px; font-weight: 500; line-height: 1.35; white-space: normal; text-align: left; letter-spacing: 0;
  box-shadow: 0 8px 22px rgba(0,0,0,.22); pointer-events: none;
}
.cc-trilha[data-dica]:focus-visible::after { bottom: auto; top: calc(100% + 6px); }

/* ---------- blocos, painel de instrumentos, grade ---------- */
.cc-bloco { background: var(--cc-paper); border: 1px solid var(--cc-line); border-radius: var(--cc-r); padding: 18px 20px; }
.cc-bloco-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.cc-bloco-cab h2, .cc-auto-cab h2 { font-size: 15px; font-weight: 700; letter-spacing: -.1px; }
.cc-sub-h { font-size: 13.5px; font-weight: 700; margin: 18px 0 8px; }
.cc-grade { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cc-grade--auto { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.cc-coluna { display: grid; gap: 16px; }

.cc-painel { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--cc-paper); border: 1px solid var(--cc-line); border-radius: var(--cc-r); margin-bottom: 16px; overflow: hidden; }
.cc-medida { display: flex; flex-direction: column; gap: 6px; padding: 18px 20px; border: 0; border-left: 1px solid var(--cc-line-2); background: transparent; text-align: left; min-width: 0; }
.cc-medida:first-child { border-left: 0; }
button.cc-medida { cursor: pointer; transition: background .15s; } button.cc-medida:hover { background: var(--cc-surface); }
.cc-medida-rot { font-size: 12.5px; color: var(--cc-mute); font-weight: 500; }
.cc-medida-val { font-size: 15px; font-weight: 650; display: flex; align-items: center; min-height: 34px; }
.cc-medida-nota { font-size: 12px; color: var(--cc-faint); }
.cc-num { font-family: "Archivo Black", Inter, sans-serif; font-size: 30px; line-height: 1; letter-spacing: -.5px; font-weight: 400; }
.cc-medida--marca .cc-num { color: var(--cc-brand); } .cc-medida--critico .cc-num { color: var(--cc-bad); }
.cc-estado { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.cc-estado--ok .cc-dot { background: var(--cc-ok); box-shadow: 0 0 0 4px var(--cc-ok-bg); } .cc-estado--atencao .cc-dot { background: var(--cc-warn); } .cc-estado--critico .cc-dot { background: var(--cc-bad); box-shadow: 0 0 0 4px var(--cc-bad-bg); }

.cc-alertas, .cc-proximos, .cc-lista-simples { list-style: none; display: grid; }
.cc-alerta { display: grid; grid-template-columns: 4px 1fr auto; gap: 12px; align-items: start; padding: 11px 0; border-top: 1px solid var(--cc-line-2); }
.cc-alerta:first-child { border-top: 0; padding-top: 2px; }
.cc-alerta-marca { align-self: stretch; border-radius: 2px; background: var(--cc-faint); }
.cc-alerta--critico .cc-alerta-marca { background: var(--cc-bad); } .cc-alerta--atencao .cc-alerta-marca { background: var(--cc-warn); } .cc-alerta--info .cc-alerta-marca { background: var(--cc-info); }
.cc-alerta strong { font-size: 13.5px; } .cc-alerta p { font-size: 12.5px; color: var(--cc-mute); margin-top: 2px; }
.cc-proximos li { display: grid; grid-template-columns: 112px 1fr auto; gap: 10px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--cc-line-2); font-size: 13.5px; }
.cc-proximos li:first-child { border-top: 0; }
.cc-proximos time { font-variant-numeric: tabular-nums; color: var(--cc-mute); font-size: 12.5px; } .cc-proximos em { font-style: normal; font-size: 12px; color: var(--cc-faint); }
.cc-lista-simples li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--cc-line-2); }
.cc-lista-simples li:first-child { border-top: 0; } .cc-lista-simples strong { font-size: 13.5px; }
.cc-lista-dir { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.cc-tag { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--cc-surface); color: var(--cc-mute); white-space: nowrap; }
.cc-tag--ok { background: var(--cc-ok-bg); color: #0a7a44; } .cc-tag--atencao { background: var(--cc-warn-bg); color: #8a6208; } .cc-tag--critico { background: var(--cc-bad-bg); color: #a92727; }

/* ---------- vazio, erro, skeleton ---------- */
.cc-vazio { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 20px; color: var(--cc-mute); }
.cc-vazio .icon { color: var(--cc-faint); padding: 12px; box-sizing: content-box; background: var(--cc-surface); border-radius: 50%; }
.cc-vazio strong { color: var(--cc-ink); font-size: 14.5px; } .cc-vazio p { font-size: 13px; max-width: 34ch; line-height: 1.5; }
.cc-erro { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin: 10px; border-radius: var(--cc-r-sm); background: var(--cc-bad-bg); color: #8f2020; } .cc-erro p { font-size: 13px; } .cc-erro > div { flex: 1; }
.cc-skel { display: block; background: linear-gradient(90deg, #eef0f3 0%, #f7f8fa 50%, #eef0f3 100%); background-size: 200% 100%; animation: cc-brilho 1.3s linear infinite; border-radius: 8px; }
.cc-skel-item { display: grid; grid-template-columns: 44px 1fr; gap: 12px; padding: 14px; align-items: center; } .cc-skel-item > div { display: grid; gap: 8px; }
.cc-skel--av { width: 44px; height: 44px; border-radius: 50%; } .cc-skel--l1 { height: 12px; width: 60%; } .cc-skel--l2 { height: 10px; width: 85%; }
.cc-skel-chat { display: grid; gap: 14px; padding: 24px; } .cc-skel--b1 { height: 44px; width: 46%; } .cc-skel--b2 { height: 60px; width: 56%; justify-self: end; } .cc-skel--b3 { height: 38px; width: 34%; } .cc-skel--b4 { height: 52px; width: 50%; justify-self: end; }
.cc-skel-painel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; margin-bottom: 16px; } .cc-skel--medida { height: 92px; }
.cc-skel-blocos { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; } .cc-skel--bloco { height: 260px; }
.cc-skel-tabela { display: grid; gap: 8px; padding: 6px 0; } .cc-skel--linha { height: 40px; }

/* ---------- conversas: espaço de 3 colunas ---------- */
.cc-espaco { position: relative; display: grid; grid-template-columns: 344px minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr); height: var(--cc-alt); background: var(--cc-paper); border: 1px solid var(--cc-line); border-radius: var(--cc-r); overflow: hidden; }
.cc-espaco[data-cc-detalhes-aberto="false"] { grid-template-columns: 344px minmax(0, 1fr) 0; }
.cc-lista { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--cc-line); background: var(--cc-paper); }
.cc-lista-cab { padding: 16px 16px 4px; display: grid; gap: 10px; border-bottom: 1px solid var(--cc-line-2); }
.cc-lista-titulo { font-size: 16px; font-weight: 750; }
.cc-busca { display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 38px; border-radius: 10px; background: var(--cc-surface); border: 1.5px solid transparent; color: var(--cc-faint); transition: border-color .15s, background .15s; }
.cc-busca:focus-within { background: #fff; border-color: var(--cc-brand); box-shadow: 0 0 0 3px rgba(216,19,36,.12); }
.cc-busca input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font: inherit; font-size: 13.5px; color: var(--cc-ink); }
.cc-busca--larga { max-width: 420px; }
.cc-filtros { display: flex; gap: 6px; flex-wrap: wrap; padding: 2px 0 12px; }
.cc-filtro { flex: none; border: 1px solid var(--cc-line); background: var(--cc-paper); color: var(--cc-mute); font-size: 12.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: background .15s, color .15s, border-color .15s; }
.cc-filtro:hover { background: var(--cc-surface); }
.cc-filtro[aria-selected="true"] { background: var(--cc-ink); color: #fff; border-color: var(--cc-ink); }
.cc-filtro em { font-style: normal; font-size: 11.5px; opacity: .72; }
.cc-itens { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.cc-itens--compacto { max-height: 420px; }

.cc-item { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--cc-line-2); cursor: pointer; outline-offset: -2px; transition: background .12s; }
.cc-item:hover { background: var(--cc-surface); }
.cc-item.is-ativo { background: var(--cc-brand-tint); box-shadow: inset 3px 0 0 var(--cc-brand); }
.cc-item-corpo { display: grid; gap: 3px; min-width: 0; }
.cc-item-linha { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.cc-item-nome { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-item.is-nao-lida .cc-item-nome { font-weight: 750; }
.cc-item-hora { font-size: 11.5px; color: var(--cc-faint); flex: none; } .cc-item.is-nao-lida .cc-item-hora { color: var(--cc-brand); font-weight: 700; }
.cc-item-empresa { justify-content: flex-start; font-size: 12.5px; color: var(--cc-mute); }
.cc-item-emp { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cc-item-emp em { font-style: normal; color: var(--cc-faint); }
.cc-item-un { color: var(--cc-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 0 1 auto; }
.cc-item-un::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--cc-faint); margin: 0 7px 2px 0; vertical-align: middle; }
.cc-item-pend { color: var(--cc-warn); display: inline-flex; margin-left: auto; }
.cc-item-previa { display: flex; align-items: center; gap: 4px; min-width: 0; font-size: 13px; color: var(--cc-mute); }
.cc-item.is-nao-lida .cc-item-previa { color: var(--cc-ink); }
.cc-item-texto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .cc-item-sem { color: var(--cc-faint); }
.cc-item-cat { display: inline-flex; color: var(--cc-faint); } .cc-item-trilha .cc-trilha { padding: 3px 0; }
.cc-item-mais { position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; border-radius: 8px; background: var(--cc-paper); color: var(--cc-mute); cursor: pointer; opacity: 0; box-shadow: 0 0 0 1px var(--cc-line); transition: opacity .12s; }
.cc-item:hover .cc-item-mais, .cc-item:focus-within .cc-item-mais { opacity: 1; } .cc-item-mais:hover { color: var(--cc-ink); }
.cc-item.is-nova { animation: cc-entra .35s ease both; }

/* ---------- chat ---------- */
/* Coluna da conversa = composição vertical: cabeçalho (altura própria) + mensagens (todo o resto, rolam sozinhas) + composer (sempre visível). Nada depende de altura presumida. */
.cc-chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; background: var(--cc-canvas); }
.cc-chat > [data-cc-chat-cab], .cc-chat > [data-cc-composer-area] { flex: 0 0 auto; min-width: 0; }
.cc-chat > [data-cc-composer-area] { max-height: 46%; overflow-y: auto; }   /* rede de segurança: avisos de bloqueio longos nunca engolem as mensagens */
/* Cabeçalho = grade de 2 linhas com altura própria (nunca cresce com o nº de empresas): [nome · telefone · status] / [associações]; avatar e "detalhes" ocupam as duas. */
.cc-chat-cab { flex-shrink: 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av topo btn" "av emp btn"; column-gap: 12px; row-gap: 3px; align-items: center; padding: 12px 16px; max-height: 104px; overflow: hidden; background: var(--cc-paper); border-bottom: 1px solid var(--cc-line); }
.cc-chat-cab > .cc-avatar { grid-area: av; }
.cc-chat-topo { grid-area: topo; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; }
.cc-chat-cab > .cc-btn-detalhes { grid-area: btn; }
.cc-chat-nome { flex: 1 1 auto; min-width: 0; font-size: 15.5px; font-weight: 700; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-chat-empresa { grid-area: emp; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap; min-width: 0; overflow: hidden; font-size: 12.5px; color: var(--cc-mute); margin: 0; }
.cc-chat-assoc { flex: 0 0 auto; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--cc-ink); }
.cc-chat-empresa.tem-mais .cc-chat-assoc { max-width: calc(100% - 56px); }   /* reserva o lugar do "+N" */
.cc-chat-empresa .cc-chips--cab { flex: 0 1 auto; min-width: 0; overflow: hidden; display: flex; flex-wrap: nowrap; gap: 4px; }   /* só os chips encolhem: o rótulo ("47 unidades associadas") não perde nem 1 px até o limite reservado ao "+N" */
.cc-chat-empresa .cc-chips--cab .cc-chip { display: block; flex: 0 1 auto; min-width: 0; max-width: 168px; overflow: hidden; text-overflow: ellipsis; }
.cc-chat-empresa .cc-chip--mais { display: inline-flex; flex: none; max-width: none; }   /* o "+N" é irmão do grupo (fora do overflow): nunca é cortado nem encolhido */
.cc-mais-todas { display: none; }
.cc-chip--acao { font: inherit; font-size: 12px; cursor: pointer; transition: background .15s, color .15s; } .cc-chip--acao:hover { background: var(--cc-line-2); color: var(--cc-ink); } .cc-chip--acao:focus-visible { outline: 2px solid var(--cc-brand); outline-offset: -2px; }   /* dentro da caixa: o overflow do resumo cortaria um anel externo */
.cc-chips { display: inline-flex; gap: 4px; flex-wrap: wrap; } .cc-chip { display: inline-flex; padding: 1px 8px; border-radius: 6px; background: var(--cc-surface); border: 1px solid var(--cc-line); font-size: 12px; color: var(--cc-mute); white-space: nowrap; } .cc-chip--mais { color: var(--cc-faint); }
.cc-chat-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: nowrap; justify-content: flex-end; white-space: nowrap; }
.cc-icone-btn { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: var(--cc-mute); cursor: pointer; transition: background .15s, color .15s; }
.cc-icone-btn:hover, .cc-icone-btn.is-ativo { background: var(--cc-surface); color: var(--cc-ink); }
.cc-voltar { display: none; }

.cc-fluxo { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 22px 10px; display: flex; flex-direction: column; scroll-behavior: auto; }
.cc-fluxo-vazio, .cc-chat-vazio { flex: 1; display: grid; place-content: center; justify-items: center; gap: 10px; }
.cc-janela, .cc-mais-antigas { text-align: center; font-size: 12px; color: var(--cc-faint); margin-bottom: 8px; } .cc-mais-antigas { margin-bottom: 12px; }
.cc-dia { display: flex; justify-content: center; margin: 14px 0 10px; } .cc-dia span { font-size: 12px; font-weight: 600; color: var(--cc-mute); background: rgba(255,255,255,.75); border: 1px solid var(--cc-line); padding: 3px 12px; border-radius: 999px; }
.cc-grupo { display: flex; flex-direction: column; gap: 3px; margin-bottom: 12px; max-width: 100%; }
.cc-grupo--entrada { align-items: flex-start; } .cc-grupo--saida { align-items: flex-end; }

.cc-msg { position: relative; max-width: min(74%, 620px); padding: 8px 12px 5px; border-radius: 14px; font-size: 14px; line-height: 1.45; background: var(--cc-paper); box-shadow: 0 1px 1px rgba(20,24,32,.06); word-break: break-word; }
.cc-grupo--entrada .cc-msg { border-top-left-radius: 4px; } .cc-grupo--entrada .cc-msg + .cc-msg { border-top-left-radius: 14px; }
.cc-grupo--saida .cc-msg { border-top-right-radius: 4px; } .cc-grupo--saida .cc-msg + .cc-msg { border-top-right-radius: 14px; }
.cc-msg-texto { white-space: pre-wrap; } .cc-msg-texto--midia { color: var(--cc-mute); display: flex; gap: 6px; align-items: center; font-size: 13px; }
.cc-msg-rodape { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 2px; font-size: 11px; color: var(--cc-faint); } .cc-msg-rodape time { font-variant-numeric: tabular-nums; }
.cc-msg-erro { display: block; font-size: 12px; color: var(--cc-bad); margin-top: 2px; }
.cc-reenviar { margin-top: 6px; border: 1px solid currentColor; background: transparent; color: inherit; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 8px; cursor: pointer; }
.cc-msg-mais { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; display: grid; place-items: center; border: 0; border-radius: 6px; background: rgba(255,255,255,.9); color: var(--cc-mute); cursor: pointer; opacity: 0; transition: opacity .12s; }
.cc-grupo--saida .cc-msg-mais { right: auto; left: 4px; } .cc-msg:hover .cc-msg-mais, .cc-msg:focus-within .cc-msg-mais { opacity: 1; }
.cc-msg.is-nova { animation: cc-entra .28s cubic-bezier(.2,.8,.2,1) both; } .cc-msg.is-local { opacity: .82; }

/* voz da equipe: grafite */
.cc-msg--manual { background: var(--cc-graphite); color: #f3f4f7; }
.cc-msg--manual .cc-msg-rodape { color: rgba(255,255,255,.55); }
.cc-msg--manual .cc-trilha { --off: rgba(255,255,255,.26); --c1: #c9ced6; --c2: #5fd39a; --c3: #7db7ff; }
.cc-msg--manual .cc-status-txt { color: rgba(255,255,255,.7); } .cc-msg--manual .cc-status-txt--failed { color: #ff9a9a; } .cc-msg--manual .cc-status-txt--read { color: #fff; }
.cc-msg--manual .cc-msg-mais { background: rgba(255,255,255,.14); color: #fff; }
/* voz automática: claro, tracejado */
.cc-msg--automatica { background: var(--cc-paper); border: 1.5px dashed rgba(216,19,36,.38); padding: 6.5px 10.5px 3.5px; }
/* teste: claro, pontilhado */
.cc-msg--teste { background: var(--cc-paper); border: 1.5px dotted #9aa0aa; padding: 6.5px 10.5px 3.5px; }
.cc-msg.is-falha:not(.cc-msg--manual) { border-color: var(--cc-bad); }
.cc-grupo-voz { display: flex; align-items: center; gap: 5px; font-size: 11.5px; color: var(--cc-mute); font-weight: 550; margin: 1px 4px 0; }
.cc-grupo-voz--manual { color: var(--cc-ink); } .cc-operador { color: var(--cc-faint); font-weight: 500; }
.cc-operador::before { content: ""; display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--cc-faint); margin-right: 5px; vertical-align: middle; }

/* composer */
.cc-composer { flex-shrink: 0; background: var(--cc-paper); border-top: 1px solid var(--cc-line); padding: 10px 14px 8px; }
.cc-composer-linha { display: flex; align-items: flex-end; gap: 10px; }
.cc-input { flex: 1; min-height: 42px; max-height: 132px; resize: none; padding: 10px 16px; border-radius: 21px; border: 1.5px solid transparent; background: var(--cc-surface); font: inherit; font-size: 14px; line-height: 1.4; color: var(--cc-ink); outline: none; transition: border-color .15s, background .15s; overflow-y: auto; }
.cc-input:focus { background: #fff; border-color: var(--cc-brand); box-shadow: 0 0 0 3px rgba(216,19,36,.12); }
.cc-input:disabled { color: var(--cc-faint); cursor: not-allowed; }
.cc-enviar { flex: none; width: 42px; height: 42px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--cc-brand); color: #fff; cursor: pointer; transition: transform .12s, background .15s, opacity .15s; }
.cc-enviar:hover:not(:disabled) { transform: scale(1.06); background: var(--verde-med, #AE0D1A); } .cc-enviar:active:not(:disabled) { transform: scale(.96); }
.cc-enviar:disabled { background: #d7dae0; cursor: not-allowed; }
.cc-composer-dica { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--cc-faint); padding: 5px 6px 0; }
.cc-contador-txt.is-excedeu { color: var(--cc-bad); font-weight: 700; }
.cc-composer-erro { font-size: 12.5px; color: var(--cc-bad); padding: 0 6px 8px; }
.cc-bloqueio { display: flex; gap: 10px; padding: 10px 12px; margin-bottom: 10px; border-radius: 10px; background: var(--cc-warn-bg); color: #6e4d06; font-size: 12.5px; } .cc-bloqueio ul { margin: 3px 0 0 16px; }

/* contexto */
.cc-contexto { min-width: 0; min-height: 0; overflow-y: auto; background: var(--cc-paper); border-left: 1px solid var(--cc-line); }
.cc-espaco[data-cc-detalhes-aberto="false"] .cc-contexto { visibility: hidden; border-left: 0; }
.cc-ctx { display: grid; }
.cc-ctx-topo { position: relative; display: grid; justify-items: center; gap: 4px; padding: 26px 20px 18px; text-align: center; border-bottom: 1px solid var(--cc-line-2); }
.cc-fechar-ctx { position: absolute; left: 10px; top: 10px; display: none; }
.cc-ctx-nome { font-size: 16px; font-weight: 750; margin-top: 8px; } .cc-ctx-cargo { font-size: 13px; color: var(--cc-mute); }
.cc-ctx-sec { padding: 16px 20px; border-bottom: 1px solid var(--cc-line-2); }
.cc-ctx-sec h4, .cc-ctx-bloco h4 { font-size: 12.5px; font-weight: 700; color: var(--cc-mute); margin-bottom: 8px; }
.cc-ctx-empresas { list-style: none; display: grid; gap: 12px; } .cc-ctx-emp { display: grid; gap: 6px; }
.cc-ctx-emp-linha { display: flex; align-items: center; justify-content: space-between; gap: 8px; } .cc-ctx-emp .cc-link { justify-self: start; }
.cc-ctx-situacao { list-style: none; display: grid; gap: 8px; }
.cc-ctx-situacao li { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--cc-mute); }
.cc-ctx-situacao strong { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; } .cc-ctx-situacao .is-ok strong { color: #0a7a44; } .cc-ctx-situacao .is-pend strong { color: #8a6208; }
.cc-ctx-pend { font-size: 13px; color: var(--cc-mute); } .cc-ctx-pend.is-atencao { color: #8a6208; font-weight: 600; }
.cc-ctx-bloco + .cc-ctx-bloco { margin-top: 14px; }
.cc-ctx-msg { font-size: 13px; line-height: 1.4; } .cc-ctx-vazio { font-size: 12.5px; color: var(--cc-faint); }
.cc-ctx-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--cc-faint); margin-top: 4px; }
.cc-ctx-acoes { display: grid; gap: 8px; padding: 16px 20px 24px; } .cc-ctx-acoes .btn { justify-content: center; }
.cc-veu { position: absolute; inset: 0; background: rgba(20,22,28,.35); z-index: 19; }

/* menu contextual e toast */
.cc-menu-flut { position: absolute; z-index: 60; }
.cc-menu { list-style: none; min-width: 190px; padding: 6px; background: var(--cc-paper); border: 1px solid var(--cc-line); border-radius: 12px; box-shadow: 0 14px 34px rgba(20,24,32,.18); animation: cc-entra .14s ease both; }
.cc-menu-item { width: 100%; display: flex; align-items: center; gap: 9px; padding: 8px 10px; border: 0; background: transparent; border-radius: 8px; font-size: 13.5px; color: var(--cc-ink); cursor: pointer; text-align: left; }
.cc-menu-item:hover:not(:disabled), .cc-menu-item:focus-visible { background: var(--cc-surface); } .cc-menu-item:disabled { color: var(--cc-faint); cursor: default; }
.cc-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); background: #1c1e24; color: #fff; padding: 9px 16px; border-radius: 10px; font-size: 13px; z-index: 90; box-shadow: 0 10px 28px rgba(0,0,0,.25); animation: cc-entra .2s ease both; }

/* ---------- automações ---------- */
.cc-auto-cab { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; } .cc-auto-resumo { font-size: 13.5px; color: var(--cc-mute); margin-top: 3px; }
.cc-linha-tempo { list-style: none; position: relative; }
.cc-passo { display: grid; grid-template-columns: 58px 22px minmax(0, 1fr); gap: 10px; padding-bottom: 20px; position: relative; }
.cc-passo::before { content: ""; position: absolute; left: calc(58px + 10px + 10px); top: 16px; bottom: -2px; width: 2px; background: var(--cc-line); transform: translateX(-1px); }
.cc-passo:last-child::before { display: none; } .cc-passo:last-child { padding-bottom: 0; }
.cc-passo-hora { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; color: var(--cc-ink); padding-top: 1px; }
.cc-passo-no { width: 14px; height: 14px; margin: 3px 4px 0; border-radius: 50%; background: var(--cc-paper); border: 2.5px solid var(--cc-line); position: relative; z-index: 1; }
.cc-passo--reforco .cc-passo-no { border-color: var(--cc-warn); } .cc-passo--limite .cc-passo-no { border-color: var(--cc-brand); background: var(--cc-brand); } .cc-passo--enviada .cc-passo-no { border-color: var(--cc-ok); }
.cc-passo-corpo strong { font-size: 14px; } .cc-passo-corpo p { font-size: 13px; color: var(--cc-mute); margin-top: 2px; line-height: 1.45; }
.cc-fatos { display: grid; gap: 0; } .cc-fatos > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 14px; padding: 10px 0; border-top: 1px solid var(--cc-line-2); font-size: 13.5px; } .cc-fatos > div:first-child { border-top: 0; }
.cc-fatos dt { color: var(--cc-mute); } .cc-fatos dd { line-height: 1.45; }
.cc-bloco--ativacao { margin-top: 16px; }

/* ---------- histórico, destinatários ---------- */
.cc-barra { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.cc-filtros-hist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 12px; align-items: end; background: var(--cc-paper); border: 1px solid var(--cc-line); border-radius: var(--cc-r); padding: 14px 16px; margin-bottom: 14px; }
.cc-filtros-hist label { display: grid; gap: 5px; font-size: 12.5px; color: var(--cc-mute); font-weight: 550; }
.cc-filtros-hist select, .cc-filtros-hist input { height: 36px; padding: 0 10px; border: 1.5px solid var(--cc-line); border-radius: 9px; font: inherit; font-size: 13.5px; background: #fff; color: var(--cc-ink); min-width: 0; }
.cc-filtros-hist select:focus, .cc-filtros-hist input:focus { outline: none; border-color: var(--cc-brand); box-shadow: 0 0 0 3px rgba(216,19,36,.12); }
.cc-filtro-largo { grid-column: span 2; } .cc-filtros-acoes { display: flex; gap: 8px; }
.cc-tabela-wrap { background: var(--cc-paper); border: 1px solid var(--cc-line); border-radius: var(--cc-r); overflow-x: auto; }
.cc-tabela { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 980px; }
.cc-tabela th { text-align: left; font-size: 12.5px; font-weight: 650; color: var(--cc-mute); padding: 11px 14px; background: var(--cc-surface); border-bottom: 1px solid var(--cc-line); white-space: nowrap; }
.cc-tabela td { padding: 11px 14px; border-bottom: 1px solid var(--cc-line-2); vertical-align: middle; } .cc-tabela tbody tr:last-child td { border-bottom: 0; } .cc-tabela tbody tr:hover { background: #fafbfc; }
.cc-td-data { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--cc-mute); } .cc-td-previa { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-td-acoes { white-space: nowrap; text-align: right; } .cc-td-acoes .cc-link + .cc-link { margin-left: 12px; }
.cc-origem { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--cc-mute); }
.cc-pessoa { display: flex; align-items: center; gap: 10px; }
.cc-paginacao { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 14px; font-size: 13px; color: var(--cc-mute); }

/* ---------- configurações ---------- */
.cc-config { display: grid; gap: 16px; }
.cc-cfg { display: grid; } .cc-cfg-linha { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; padding: 11px 0; border-top: 1px solid var(--cc-line-2); font-size: 13.5px; } .cc-cfg-linha:first-child { border-top: 0; }
.cc-cfg-linha dt { color: var(--cc-mute); } .cc-cfg-linha dd { line-height: 1.45; }
.cc-tecnico { padding: 0; } .cc-tecnico summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; gap: 12px; padding: 16px 20px; font-size: 15px; font-weight: 700; } .cc-tecnico summary::-webkit-details-marker { display: none; }
.cc-tecnico summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--cc-mute); border-bottom: 2px solid var(--cc-mute); transform: rotate(-45deg); transition: transform .2s; align-self: center; } .cc-tecnico[open] summary::before { transform: rotate(45deg); }
.cc-tecnico summary em { font-style: normal; font-size: 12.5px; font-weight: 400; color: var(--cc-mute); }
.cc-tecnico > .cc-cfg, .cc-tecnico > .cc-skel-tabela { padding: 0 20px 16px; }

/* ---------- animações ---------- */
@keyframes cc-pulso { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes cc-brilho { to { background-position: -200% 0; } }
@keyframes cc-entra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- responsivo ---------- */
@media (min-width: 821px) and (max-width: 1000px) {
  .cc-chat-meta { flex-direction: column; align-items: flex-end; gap: 2px; }   /* coluna do chat estreita (gaveta de detalhes): telefone e status empilham para o nome não virar "Ma…" */
}
@media (max-width: 1279px) {
  .cc-espaco, .cc-espaco[data-cc-detalhes-aberto="false"] { grid-template-columns: 320px minmax(0, 1fr); }
  .cc-contexto { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 92%); z-index: 20; transform: translateX(102%); transition: transform .28s cubic-bezier(.4,0,.2,1); box-shadow: -14px 0 34px rgba(20,24,32,.16); visibility: visible !important; border-left: 1px solid var(--cc-line); }
  .cc-espaco[data-cc-detalhes-aberto="true"] .cc-contexto { transform: none; }
  .cc-fechar-ctx { display: grid; }
  .cc-painel { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cc-medida:nth-child(4) { border-left: 0; } .cc-medida:nth-child(n+4) { border-top: 1px solid var(--cc-line-2); }
  .cc-grade, .cc-grade--auto { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .cc, .cc-host { --cc-alt: clamp(480px, calc(100vh - 250px), 900px); }
  @supports (height: 100dvh) { .cc, .cc-host { --cc-alt: clamp(480px, calc(100dvh - 250px), 900px); } }
  .cc-titulo { font-size: 19px; } .cc-sub { display: none; }
  .cc-espaco, .cc-espaco[data-cc-detalhes-aberto="false"] { grid-template-columns: minmax(0, 1fr); border-radius: 12px; }
  .cc-espaco[data-cc-tela="lista"] .cc-chat, .cc-espaco[data-cc-tela="lista"] .cc-contexto { display: none; }
  .cc-espaco[data-cc-tela="chat"] .cc-lista, .cc-espaco[data-cc-tela="chat"] .cc-contexto { display: none; }
  .cc-espaco[data-cc-tela="detalhes"] .cc-lista, .cc-espaco[data-cc-tela="detalhes"] .cc-chat { display: none; }
  .cc-lista { border-right: 0; }
  .cc-contexto { position: static; width: auto; transform: none; box-shadow: none; border-left: 0; display: block; }
  .cc-espaco[data-cc-tela="detalhes"] .cc-contexto { display: block; } .cc-veu { display: none; }
  .cc-voltar { display: grid; grid-area: vol; } .cc-chat-meta .cc-pill { display: none; }
  .cc-chat-cab { grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "vol av topo btn" "vol av emp emp"; padding: 10px; column-gap: 8px; }   /* celular: a 2ª linha passa por baixo do botão de detalhes (mais largura para o resumo) */
  .cc-chat-empresa .cc-chips--cab { display: none; } .cc-chat-empresa.tem-mais .cc-chat-assoc { max-width: calc(100% - 84px); } .cc-chip--mais .cc-mais-n { display: none; } .cc-chip--mais .cc-mais-todas { display: inline; }   /* celular: só o resumo + "Ver todas" (o toque abre os detalhes) */
  .cc-fluxo { padding: 12px 12px 6px; } .cc-msg { max-width: 86%; }
  .cc-item-mais { display: none; }   /* no celular o menu da conversa abre no toque longo (evento contextmenu) e o botão sobreporia o horário */
  .cc-msg-mais { opacity: 1; }
  .cc-painel { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cc-medida { border-left: 0; border-top: 1px solid var(--cc-line-2); } .cc-medida:nth-child(2n) { border-left: 1px solid var(--cc-line-2); } .cc-medida:nth-child(-n+2) { border-top: 0; }
  .cc-proximos li { grid-template-columns: 1fr; gap: 2px; } .cc-fatos > div, .cc-cfg-linha { grid-template-columns: 1fr; gap: 4px; }
  .cc-filtro-largo { grid-column: span 1; } .cc-passo { grid-template-columns: 48px 20px minmax(0, 1fr); } .cc-passo::before { left: calc(48px + 10px + 10px); }
  .cc-skel-painel, .cc-skel-blocos { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .cc *, .cc *::before, .cc *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
