/* Central de Atendimento — visual no formato do WhatsApp Web (medidas e cores de referência,
   sem os desenhos nem a marca do WhatsApp). Tema claro e escuro. */

:root {
  --wa-rail: #f7f5f3;
  --wa-painel: #ffffff;
  --wa-fundo: #efeae2;
  --wa-faixa: #f0f2f5;
  --wa-texto: #111b21;
  --wa-suave: #667781;
  --wa-linha: #e9edef;
  --wa-borda: #d1d7db;
  --wa-hover: #f5f6f6;
  --wa-ativo: #f0f2f5;
  --wa-verde: #25d366;
  --wa-verde-forte: #1daa61;
  --wa-verde-texto: #008069;
  --wa-chip-ativo: #d9fdd3;
  --wa-chip-ativo-texto: #15603e;
  --wa-saida: #d9fdd3;
  --wa-entrada: #ffffff;
  --wa-nota: #fff6d6;
  --wa-nota-texto: #8a6100;
  --wa-azul-tique: #53bdeb;
  --wa-sistema: #ffffff;
  --wa-sistema-texto: #54656f;
  --wa-sombra: 0 1px 0.5px rgba(11, 20, 26, 0.13);
  --wa-padrao: rgba(84, 101, 111, 0.06);
  --wa-perigo: #ea0038;
  --wa-fonte: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --wa-rail: #242727; --wa-painel: #1e1e1e; --wa-fundo: #0a0a0a; --wa-faixa: #3c3c3c;
    --wa-texto: #fafafa; --wa-suave: #a5a5a5; --wa-linha: #222424; --wa-borda: #3b3d3d;
    --wa-hover: #2a2a2a; --wa-ativo: #353535; --wa-chip-ativo: #103529; --wa-chip-ativo-texto: #d9fdd3;
    --wa-saida: #2a5a43; --wa-entrada: #2c2e2e; --wa-nota: #3d3417; --wa-nota-texto: #f7d26b;
    --wa-sistema: #242626; --wa-sistema-texto: #a5a5a5; --wa-padrao: rgba(255, 255, 255, 0.09);
    --wa-verde-texto: #21c063; --wa-verde: #21c063;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --wa-rail: #242727; --wa-painel: #1e1e1e; --wa-fundo: #0a0a0a; --wa-faixa: #3c3c3c;
  --wa-texto: #fafafa; --wa-suave: #a5a5a5; --wa-linha: #222424; --wa-borda: #3b3d3d;
  --wa-hover: #2a2a2a; --wa-ativo: #353535; --wa-chip-ativo: #103529; --wa-chip-ativo-texto: #d9fdd3;
  --wa-saida: #2a5a43; --wa-entrada: #2c2e2e; --wa-nota: #3d3417; --wa-nota-texto: #f7d26b;
  --wa-sistema: #242626; --wa-sistema-texto: #a5a5a5; --wa-padrao: rgba(255, 255, 255, 0.09);
  --wa-verde-texto: #21c063; --wa-verde: #21c063;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--wa-painel); color: var(--wa-texto); font-family: var(--wa-fonte); font-size: 14.2px; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
svg { display: block; }

/* ---------- casca: trilho + conteúdo ---------- */
.ca-casca { display: grid; grid-template-columns: 64px minmax(0, 1fr); height: 100dvh; overflow: hidden; }
.ca-trilho { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; background: var(--wa-rail); border-right: 1px solid var(--wa-linha); }
.ca-trilho-sep { width: 32px; height: 1px; background: var(--wa-borda); margin: 6px 0; }
.ca-trilho-fim { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ca-trilho button, .ca-trilho a { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: var(--wa-suave); text-decoration: none; }
.ca-trilho button:hover, .ca-trilho a:hover { background: var(--wa-ativo); }
.ca-trilho button.ativo { background: var(--wa-borda); color: var(--wa-texto); }
.ca-trilho svg { width: 24px; height: 24px; fill: currentColor; }
.ca-trilho-badge { position: absolute; top: -3px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--wa-verde); color: #fff; font-size: 11.5px; font-weight: 600; line-height: 20px; text-align: center; border: 2px solid var(--wa-rail); }
.ca-eu { width: 32px; height: 32px; border-radius: 50%; background: var(--wa-verde-texto); color: #fff; font-weight: 600; font-size: 13px; display: grid; place-items: center; }

/* ---------- área de conversas ---------- */
.wa-app { display: grid; grid-template-columns: minmax(340px, 30%) minmax(0, 1fr); height: 100dvh; min-width: 0; background: var(--wa-painel); }
.wa-lado { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--wa-linha); background: var(--wa-painel); }
.wa-topo { display: flex; align-items: center; gap: 6px; min-height: 64px; padding: 10px 16px 6px 20px; }
.wa-topo h1 { margin: 0 auto 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.2px; }
.wa-icone { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: transparent; color: var(--wa-suave); }
.wa-icone:hover, .wa-icone.ativo { background: var(--wa-ativo); }
.wa-icone svg { width: 24px; height: 24px; fill: currentColor; }
.wa-icone-cheio { background: var(--wa-texto); color: var(--wa-painel); }
.wa-icone-cheio:hover { background: var(--wa-texto); opacity: .9; }

.wa-pesquisa { position: relative; margin: 4px 12px 8px; }
.wa-pesquisa input { width: 100%; height: 40px; padding: 0 16px 0 46px; border: 1px solid transparent; border-radius: 24px; background: var(--wa-faixa); outline: none; }
.wa-pesquisa input:focus { border-color: var(--wa-verde-texto); background: var(--wa-painel); }
.wa-pesquisa input::placeholder { color: var(--wa-suave); }
.wa-pesquisa-icone { position: absolute; left: 14px; top: 50%; translate: 0 -50%; color: var(--wa-suave); }
.wa-pesquisa-icone svg { width: 20px; height: 20px; fill: currentColor; }

.wa-chips { display: flex; gap: 8px; padding: 2px 12px 10px; overflow-x: auto; scrollbar-width: none; }
.wa-chips button { flex: none; height: 32px; padding: 0 12px; border: 1px solid var(--wa-borda); border-radius: 16px; background: var(--wa-painel); color: var(--wa-suave); font-size: 14px; font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.wa-chips button:hover { background: var(--wa-hover); }
.wa-chips button.ativo { background: var(--wa-chip-ativo); border-color: var(--wa-chip-ativo); color: var(--wa-chip-ativo-texto); }
.wa-chips small { font-size: 12px; font-weight: 600; }
.wa-chips select { height: 32px; padding: 0 10px; border: 1px solid var(--wa-borda); border-radius: 16px; background: var(--wa-painel); color: var(--wa-suave); font-size: 14px; }

.wa-arquivadas { display: flex; align-items: center; gap: 15px; width: 100%; padding: 12px 20px 12px 30px; border: 0; background: transparent; text-align: left; }
.wa-arquivadas:hover { background: var(--wa-hover); }
.wa-arquivadas svg { width: 20px; height: 20px; fill: var(--wa-verde-texto); }
.wa-arquivadas span { flex: 1; font-size: 16px; }
.wa-arquivadas small { color: var(--wa-verde-texto); font-size: 12px; font-weight: 600; }

.wa-lista { flex: 1; min-height: 0; margin: 0; padding: 0 0 8px; list-style: none; overflow-y: auto; }
.wa-lista li > button { display: flex; align-items: center; gap: 13px; width: calc(100% - 16px); margin: 0 8px; padding: 0 12px 0 10px; height: 72px; border: 0; border-radius: 12px; background: transparent; text-align: left; }
.wa-lista li > button:hover { background: var(--wa-hover); }
.wa-lista li > button.ativo { background: var(--wa-ativo); }
.wa-item { flex: 1; min-width: 0; display: grid; gap: 2px; padding: 12px 0; align-self: stretch; align-content: center; }
.wa-item-linha { display: flex; align-items: center; gap: 6px; min-width: 0; }
.wa-item-linha strong { flex: 1; min-width: 0; overflow: hidden; font-size: 16.5px; font-weight: 400; text-overflow: ellipsis; white-space: nowrap; }
.wa-item-linha time { flex: none; color: var(--wa-suave); font-size: 12px; }
.wa-item-linha time.nova { color: var(--wa-verde-forte); font-weight: 600; }
.wa-item-previa > span:first-child { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; overflow: hidden; color: var(--wa-suave); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.wa-item-previa > span:first-child > span { overflow: hidden; text-overflow: ellipsis; }
.wa-item-previa.forte > span:first-child { color: var(--wa-texto); }
.wa-badge { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--wa-verde); color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
.wa-badge-ponto { width: 12px; min-width: 0; height: 12px; padding: 0; }
.wa-fixada svg { width: 18px; height: 18px; fill: var(--wa-suave); }
.wa-etiqueta { display: inline-flex; align-items: center; gap: 4px; flex: none; max-width: 45%; overflow: hidden; color: var(--wa-suave); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }
.wa-etiqueta::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--cor, #8b5cf6); }
.wa-selo-sensivel { flex: none; padding: 0 6px; border-radius: 4px; background: #fde8ec; color: #b4233c; font-size: 11px; font-style: normal; }
.wa-vazio { padding: 28px 24px; color: var(--wa-suave); text-align: center; font-size: 14px; }
.wa-mais button { display: block; margin: 8px auto; padding: 8px 16px; border: 1px solid var(--wa-borda); border-radius: 18px; background: transparent; color: var(--wa-verde-texto); }
.wa-erro { margin: 8px 12px; padding: 8px 12px; border-radius: 8px; background: #fde8ec; color: #b4233c; font-size: 13.5px; }

.wa-avatar { flex: none; border-radius: 50%; object-fit: cover; }
.wa-avatar-vazio { display: grid; place-items: center; background: #dfe5e7; color: #fff; }
.wa-avatar-vazio svg { width: 62%; height: 62%; fill: currentColor; }

/* menus suspensos */
.wa-menu { position: relative; }
.wa-menu > ul { position: absolute; z-index: 30; top: 44px; right: 0; min-width: 220px; margin: 0; padding: 8px 0; list-style: none; border-radius: 16px; background: var(--wa-painel); box-shadow: 0 2px 5px rgba(11,20,26,.26), 0 2px 10px rgba(11,20,26,.16); }
.wa-menu > ul button { display: block; width: calc(100% - 16px); margin: 0 8px; padding: 10px 16px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 14.5px; }
.wa-menu > ul button:hover { background: var(--wa-hover); }

/* nova conversa */
.wa-nova { display: grid; gap: 8px; margin: 0 12px 10px; padding: 12px; border-radius: 12px; background: var(--wa-faixa); }
.wa-nova input { height: 38px; padding: 0 12px; border: 1px solid var(--wa-borda); border-radius: 8px; background: var(--wa-painel); }
.wa-nova button { height: 36px; border: 0; border-radius: 18px; background: var(--wa-verde-texto); color: #fff; font-weight: 600; }

/* ---------- tela vazia ---------- */
.wa-boasvindas { display: grid; place-items: center; background: var(--wa-faixa); border-bottom: 6px solid var(--wa-verde); text-align: center; padding: 24px; }
.wa-boasvindas-cartao { max-width: 460px; padding: 32px; border-radius: 24px; background: var(--wa-painel); }
.wa-boasvindas svg { width: 120px; height: 90px; margin: 0 auto 18px; }
.wa-boasvindas h2 { margin: 0 0 8px; font-size: 26px; font-weight: 400; }
.wa-boasvindas p { margin: 0; color: var(--wa-suave); line-height: 1.5; }
.wa-boasvindas-atalhos { display: flex; justify-content: center; gap: 24px; margin-top: 26px; }
.wa-boasvindas-atalhos button { display: grid; justify-items: center; gap: 8px; border: 0; background: transparent; color: var(--wa-suave); font-size: 13px; }
.wa-boasvindas-atalhos span { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--wa-faixa); }
.wa-boasvindas-atalhos svg { width: 24px; height: 24px; margin: 0; fill: var(--wa-texto); }

/* ---------- conversa ---------- */
.wa-conversa-e-painel { display: flex; min-width: 0; min-height: 0; }
.wa-conversa { position: relative; flex: 1; display: flex; flex-direction: column; min-width: 0; min-height: 0; background-color: var(--wa-fundo);
  background-image: radial-gradient(var(--wa-padrao) 1.2px, transparent 1.3px), radial-gradient(var(--wa-padrao) 1.2px, transparent 1.3px);
  background-size: 28px 28px; background-position: 0 0, 14px 14px; }
.wa-topo-conversa { z-index: 5; min-height: 64px; padding: 10px 16px; gap: 8px; background: var(--wa-painel); border-left: 1px solid var(--wa-linha); min-width: 0; }
.wa-voltar { display: none; }
.wa-quem { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; text-align: left; padding: 0; }
.wa-quem > span { min-width: 0; display: grid; }
.wa-quem strong { overflow: hidden; font-size: 16px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; }
.wa-quem small { overflow: hidden; color: var(--wa-suave); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.wa-chamado { display: flex; align-items: center; gap: 6px; flex: none; }
.wa-selo-chamado { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border: 1px solid var(--wa-borda); border-radius: 16px; background: var(--wa-painel); color: var(--wa-texto); font-size: 13.5px; font-weight: 500; white-space: nowrap; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.wa-selo-chamado.fila { border-color: #f5c46b; background: var(--wa-nota); color: var(--wa-nota-texto); }
.wa-selo-chamado svg { width: 16px; height: 16px; fill: currentColor; flex: none; }
.wa-botao-fechar-chamado { color: var(--wa-perigo); }

.wa-mensagens { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 6% 8px; display: flex; flex-direction: column; }
.wa-dia { display: flex; justify-content: center; margin: 10px 0 8px; position: sticky; top: 4px; z-index: 2; }
.wa-dia span { padding: 5px 12px; border-radius: 8px; background: var(--wa-sistema); color: var(--wa-sistema-texto); font-size: 12.5px; box-shadow: var(--wa-sombra); }
.wa-sistema { display: flex; justify-content: center; margin: 6px 0; }
.wa-sistema span { max-width: 80%; padding: 5px 12px; border-radius: 8px; background: var(--wa-sistema); color: var(--wa-sistema-texto); font-size: 12.5px; text-align: center; box-shadow: var(--wa-sombra); }
.wa-sistema.chamado span { background: #e7f3ff; color: #1e4f80; }
:root[data-theme="dark"] .wa-sistema.chamado span { background: #13324a; color: #a9d3ff; }
.wa-restrito { margin: 16px auto; max-width: 520px; padding: 12px 16px; border-radius: 10px; background: #fde8ec; color: #8f1d32; text-align: center; }

.wa-linha { display: flex; margin: 1px 0; }
.wa-linha-saida { justify-content: flex-end; }
.wa-linha-nota { justify-content: center; }
.wa-balao { position: relative; max-width: min(65%, 560px); padding: 6px 7px 8px 9px; border-radius: 8px; background: var(--wa-entrada); box-shadow: var(--wa-sombra); word-wrap: break-word; }
.wa-linha-saida .wa-balao { background: var(--wa-saida); }
.wa-com-ponta { margin-top: 10px; }
.wa-linha-entrada .wa-com-ponta { border-top-left-radius: 0; }
.wa-linha-saida .wa-com-ponta { border-top-right-radius: 0; }
.wa-linha-entrada .wa-com-ponta::before, .wa-linha-saida .wa-com-ponta::before { content: ""; position: absolute; top: 0; width: 8px; height: 13px; }
.wa-linha-entrada .wa-com-ponta::before { left: -8px; background: var(--wa-entrada); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.wa-linha-saida .wa-com-ponta::before { right: -8px; background: var(--wa-saida); clip-path: polygon(0 0, 100% 0, 0 100%); }
.wa-balao p { margin: 0; white-space: pre-wrap; line-height: 19px; font-size: 14.2px; }
.wa-balao p::after { content: ""; display: inline-block; width: 70px; }
.wa-balao a { color: #027eb5; }
.wa-mencao { color: #027eb5; font-weight: 500; }
:root[data-theme="dark"] .wa-mencao { color: #53bdeb; }
.wa-balao code { padding: 0 3px; border-radius: 3px; background: rgba(0,0,0,.06); font-family: ui-monospace, monospace; font-size: 13px; }
.wa-nota { max-width: min(75%, 620px); background: var(--wa-nota); border: 1px dashed #e0b84c; }
.wa-nota .wa-autor { color: var(--wa-nota-texto) !important; }
.wa-destaque { animation: wa-pisca 1.8s ease-out; }
@keyframes wa-pisca { 0%, 40% { box-shadow: 0 0 0 3px #f5c46b; } 100% { box-shadow: var(--wa-sombra); } }
.wa-autor { display: block; margin-bottom: 2px; font-size: 12.8px; font-weight: 500; }
.wa-hora { position: absolute; right: 7px; bottom: 3px; display: flex; align-items: center; gap: 3px; color: var(--wa-suave); font-size: 11px; white-space: nowrap; }
.wa-tique { display: inline-flex; color: var(--wa-suave); }
.wa-tique svg { width: 16px; height: 11px; fill: currentColor; }
.wa-tique.lido { color: var(--wa-azul-tique); }
.wa-apagada { color: var(--wa-suave); font-style: italic; }
.wa-reacoes { position: absolute; left: 8px; bottom: -14px; padding: 1px 6px; border-radius: 12px; background: var(--wa-painel); box-shadow: var(--wa-sombra); font-size: 13px; }
.wa-linha:has(.wa-reacoes) { margin-bottom: 14px; }
.wa-citacao { display: grid; gap: 1px; width: 100%; margin: 0 0 4px; padding: 6px 10px; border: 0; border-left: 4px solid #06cf9c; border-radius: 7px; background: rgba(0,0,0,.05); text-align: left; }
.wa-citacao strong { font-size: 12.8px; font-weight: 500; }
.wa-citacao span { overflow: hidden; color: var(--wa-suave); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }

.wa-acoes-mensagem { position: absolute; top: 2px; right: 3px; z-index: 3; opacity: 0; }
.wa-balao:hover .wa-acoes-mensagem, .wa-acoes-mensagem[open] { opacity: 1; }
.wa-acoes-mensagem summary { list-style: none; width: 26px; height: 22px; border-radius: 50%; color: var(--wa-suave); text-align: center; cursor: pointer; background: inherit; }
.wa-acoes-mensagem summary::-webkit-details-marker { display: none; }
.wa-acoes-mensagem > div { position: absolute; right: 0; top: 24px; min-width: 190px; padding: 8px 0; border-radius: 14px; background: var(--wa-painel); box-shadow: 0 2px 5px rgba(11,20,26,.26), 0 2px 10px rgba(11,20,26,.16); }
.wa-acoes-mensagem button { display: block; width: calc(100% - 16px); margin: 0 8px; padding: 9px 14px; border: 0; border-radius: 9px; background: transparent; text-align: left; font-size: 14.5px; }
.wa-acoes-mensagem button:hover { background: var(--wa-hover); }

.wa-imagem { display: block; padding: 0; margin: -3px -4px 4px -6px; border: 0; border-radius: 6px; overflow: hidden; background: transparent; }
.wa-imagem img { display: block; max-width: 330px; max-height: 340px; width: 100%; object-fit: cover; }
.wa-video { display: block; max-width: 330px; border-radius: 6px; margin-bottom: 4px; }
.wa-audio-linha { display: flex; align-items: center; gap: 8px; min-width: 260px; }
.wa-audio { height: 40px; flex: 1; }
.wa-audio-duracao { color: var(--wa-suave); font-size: 11.5px; }
.wa-transcricao { margin: 6px 0 2px; font-size: 13.5px; line-height: 1.4; white-space: pre-wrap; max-width: 420px; }
.wa-transcricao-rotulo { display: block; font-size: 11px; color: var(--wa-suave); margin-bottom: 2px; }
.wa-documento { display: flex; align-items: center; gap: 10px; min-width: 240px; margin-bottom: 4px; padding: 10px; border-radius: 6px; background: rgba(0,0,0,.05); text-decoration: none; color: inherit; }
.wa-documento span:last-child { display: grid; }
.wa-documento small { color: var(--wa-suave); font-size: 12px; }
.wa-documento-icone { font-size: 26px; }
.wa-arquivo-pendente { color: var(--wa-suave); font-style: italic; }

.wa-ir-fim { position: absolute; right: 20px; bottom: 84px; z-index: 6; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--wa-painel); color: var(--wa-suave); box-shadow: 0 1px 3px rgba(11,20,26,.3); display: grid; place-items: center; }
.wa-ir-fim svg { width: 24px; height: 24px; fill: currentColor; }

/* ---------- compositor ---------- */
.wa-envio { position: relative; z-index: 5; padding: 6px 16px 10px; }
.wa-envio-aviso { margin: 0 0 6px; padding: 6px 12px; border-radius: 8px; background: var(--wa-nota); color: var(--wa-nota-texto); font-size: 13px; }
.wa-envio-alvo { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 8px 10px 8px 12px; border-left: 4px solid #06cf9c; border-radius: 10px; background: var(--wa-painel); }
.wa-envio-alvo > div { flex: 1; min-width: 0; display: grid; }
.wa-envio-alvo strong { color: #06a07a; font-size: 13px; font-weight: 500; }
.wa-envio-alvo span { overflow: hidden; color: var(--wa-suave); font-size: 13px; white-space: nowrap; text-overflow: ellipsis; }
.wa-envio-campos { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 6px; padding: 8px; border-radius: 12px; background: var(--wa-painel); }
.wa-envio-campos input, .wa-envio-campos select, .wa-envio textarea.wa-campo { flex: 1; min-width: 160px; height: 38px; padding: 0 10px; border: 1px solid var(--wa-borda); border-radius: 8px; background: var(--wa-painel); }
.wa-envio textarea.wa-campo { width: 100%; height: 90px; padding: 8px 10px; margin-bottom: 6px; }
.wa-envio-campos button { height: 38px; padding: 0 14px; border: 1px solid var(--wa-borda); border-radius: 19px; background: transparent; }
.wa-anexo-previa { display: flex; align-items: center; gap: 12px; margin: 0 0 6px; padding: 8px 12px; border-radius: 12px; background: var(--wa-painel); }
.wa-anexo-previa img, .wa-anexo-previa video { max-height: 120px; border-radius: 8px; }
.wa-anexo-previa button { margin-left: auto; border: 0; background: transparent; color: var(--wa-perigo); }

.wa-compositor { display: flex; align-items: flex-end; gap: 4px; min-height: 52px; padding: 5px 6px; border-radius: 26px; background: var(--wa-painel); box-shadow: 0 1px 2px rgba(11,20,26,.12); }
.wa-compositor.nota { background: var(--wa-nota); box-shadow: 0 0 0 1px #e0b84c; }
.wa-compositor textarea { flex: 1; min-height: 42px; max-height: 140px; padding: 11px 8px; border: 0; background: transparent; outline: none; resize: none; line-height: 20px; }
.wa-compositor textarea::placeholder { color: var(--wa-suave); }
.wa-compositor .wa-icone { width: 42px; height: 42px; color: var(--wa-texto); }
.wa-enviar { display: grid; place-items: center; width: 42px; height: 42px; flex: none; border: 0; border-radius: 50%; background: var(--wa-verde); color: #fff; }
.wa-enviar svg { width: 22px; height: 22px; fill: currentColor; }
.wa-compositor .wa-gravando { color: var(--wa-perigo); }

.wa-popover { position: absolute; bottom: 70px; left: 16px; z-index: 20; padding: 8px; border-radius: 16px; background: var(--wa-painel); box-shadow: 0 2px 5px rgba(11,20,26,.26), 0 2px 10px rgba(11,20,26,.16); }
.wa-popover-anexos { display: grid; min-width: 220px; }
.wa-popover-anexos button { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 0; border-radius: 10px; background: transparent; text-align: left; font-size: 14.5px; }
.wa-popover-anexos button:hover { background: var(--wa-hover); }
.wa-popover-anexos i { display: grid; place-items: center; width: 24px; font-style: normal; font-size: 18px; }
.wa-emoji-picker { display: grid; grid-template-columns: repeat(10, 36px); gap: 2px; max-height: 260px; overflow-y: auto; }
.wa-emoji-picker button { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; font-size: 22px; }
.wa-emoji-picker button:hover { background: var(--wa-hover); }
.wa-emoji-picker .wa-largo { grid-column: 1 / -1; width: auto; font-size: 13px; }
.wa-sticker-picker { display: flex; flex-wrap: wrap; gap: 6px; max-width: 420px; max-height: 260px; overflow-y: auto; }
.wa-sticker-picker button { border: 0; border-radius: 8px; background: transparent; padding: 2px; }
.wa-sticker-picker button:first-child { width: 100%; padding: 10px; background: var(--wa-faixa); }
.wa-sticker-picker small { color: var(--wa-suave); }
.wa-envios-falhas { margin: 6px 0 0; font-size: 12.5px; color: var(--wa-suave); }
.wa-envio-opcoes { display: flex; gap: 14px; align-items: center; margin: 4px 4px 0; font-size: 12.5px; color: var(--wa-suave); }
.wa-envio-opcoes label, .wa-opcao { display: flex; gap: 6px; align-items: center; }
.wa-opcao { margin: 0 0 6px; font-size: 13px; }
.wa-destinos { display: grid; gap: 4px; max-height: 180px; overflow: auto; font-size: 13.5px; }
.wa-envios-falhas div { display: flex; gap: 8px; align-items: center; }
.wa-envios-falhas button { border: 0; background: transparent; color: var(--wa-verde-texto); }

/* ---------- painel lateral (dados do contato, busca, transferir) ---------- */
.wa-painel { width: clamp(320px, 30vw, 440px); flex: none; display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--wa-linha); background: var(--wa-painel); }
.wa-painel-topo { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 16px; }
.wa-painel-topo h2 { flex: 1; margin: 0; font-size: 16px; font-weight: 500; }
.wa-painel-corpo { flex: 1; min-height: 0; overflow-y: auto; }
.wa-painel-bloco { padding: 14px 28px 18px; border-bottom: 1px solid var(--wa-linha); }
.wa-painel-bloco:last-child { border-bottom: 0; }
.wa-painel-bloco h4 { margin: 0 0 10px; color: var(--wa-suave); font-size: 14px; font-weight: 400; }
.wa-perfil { display: grid; justify-items: center; gap: 4px; text-align: center; padding-top: 20px; }
.wa-perfil .wa-avatar { margin-bottom: 12px; }
.wa-perfil h3 { margin: 0; font-size: 22px; font-weight: 400; }
.wa-perfil p { margin: 0; color: var(--wa-suave); font-size: 16px; }
.wa-acoes-rapidas { display: flex; justify-content: center; gap: 16px; margin-top: 16px; }
.wa-acoes-rapidas button { display: grid; justify-items: center; gap: 6px; width: 76px; border: 0; background: transparent; font-size: 13px; color: var(--wa-texto); }
.wa-acoes-rapidas span { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 26px; border: 1px solid var(--wa-borda); }
.wa-acoes-rapidas svg { width: 22px; height: 22px; fill: currentColor; }
.wa-notas textarea { width: 100%; min-height: 70px; padding: 8px 0; border: 0; border-bottom: 2px solid transparent; background: transparent; resize: vertical; outline: none; color: var(--wa-texto); }
.wa-notas textarea:focus { border-bottom-color: var(--wa-verde-texto); }
.wa-campo-linha { display: grid; gap: 6px; margin-bottom: 12px; }
.wa-campo-linha span { color: var(--wa-suave); font-size: 13px; }
.wa-campo-linha select, .wa-campo-linha input { width: 100%; min-width: 0; height: 38px; padding: 0 10px; border: 1px solid var(--wa-borda); border-radius: 8px; background: var(--wa-painel); }
.wa-alternar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wa-alternar input { width: 40px; height: 22px; accent-color: var(--wa-verde-texto); }
.wa-linha-acao { display: flex; align-items: center; gap: 22px; width: 100%; padding: 14px 0; border: 0; background: transparent; text-align: left; font-size: 16px; }
.wa-linha-acao svg { width: 22px; height: 22px; fill: var(--wa-suave); }
.wa-linha-acao.perigo, .wa-linha-acao.perigo svg { color: var(--wa-perigo); fill: var(--wa-perigo); }
.wa-grade { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.wa-grade button { aspect-ratio: 1; padding: 0; border: 0; border-radius: 6px; overflow: hidden; background: var(--wa-faixa); }
.wa-grade img { width: 100%; height: 100%; object-fit: cover; }
.wa-abas { display: flex; gap: 8px; margin-bottom: 12px; }
.wa-abas button { height: 30px; padding: 0 12px; border: 1px solid var(--wa-borda); border-radius: 15px; background: transparent; color: var(--wa-suave); }
.wa-abas button.ativo { background: var(--wa-chip-ativo); border-color: var(--wa-chip-ativo); color: var(--wa-chip-ativo-texto); }
.wa-docs { margin: 0; padding: 0; list-style: none; }
.wa-docs li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--wa-linha); }
.wa-docs a { color: inherit; text-decoration: none; }
.wa-docs button { border: 0; background: transparent; color: var(--wa-suave); }
.wa-suave { color: var(--wa-suave); }
.wa-resultados { margin: 0; padding: 0; list-style: none; overflow-y: auto; }
.wa-resultados button { display: grid; gap: 2px; width: 100%; padding: 12px 24px; border: 0; border-bottom: 1px solid var(--wa-linha); background: transparent; text-align: left; }
.wa-resultados button:hover { background: var(--wa-hover); }
.wa-resultados small { color: var(--wa-suave); font-size: 12px; }
.wa-historico { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.wa-historico li { padding: 8px 0; border-bottom: 1px solid var(--wa-linha); }
.wa-historico small { display: block; color: var(--wa-suave); }
.wa-botao { height: 40px; padding: 0 22px; border: 0; border-radius: 20px; background: var(--wa-verde-texto); color: #fff; font-weight: 600; }
.wa-botao-sec { height: 40px; padding: 0 22px; border: 1px solid var(--wa-borda); border-radius: 20px; background: transparent; color: var(--wa-verde-texto); font-weight: 600; }

/* visualizador de imagem */
.wa-visualizador { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: color-mix(in srgb, var(--wa-painel) 94%, transparent); }
.wa-visualizador img { position: relative; max-width: 90vw; max-height: 82vh; object-fit: contain; }
.wa-visualizador-barra { position: absolute; top: 12px; right: 16px; display: flex; gap: 6px; z-index: 2; }
.wa-fundo-fechar { position: absolute; inset: 0; border: 0; background: transparent; cursor: default; }

/* ---------- telas de administração ---------- */
.ca-pagina { height: 100dvh; overflow-y: auto; background: var(--wa-faixa); }
.ca-pagina-conteudo { max-width: 980px; margin: 0 auto; padding: 28px 24px 60px; }
.ca-pagina h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.ca-pagina > div > p { margin: 0 0 22px; color: var(--wa-suave); }
.ca-cartao { margin-bottom: 18px; padding: 18px 20px; border-radius: 14px; background: var(--wa-painel); }
.ca-cartao h2 { margin: 0 0 14px; font-size: 16px; font-weight: 600; }
.ca-tabela { width: 100%; border-collapse: collapse; font-size: 14px; }
.ca-tabela th { color: var(--wa-suave); font-weight: 500; text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--wa-linha); }
.ca-tabela td { padding: 10px 8px; border-bottom: 1px solid var(--wa-linha); vertical-align: top; }
.ca-tabela tr.inativo td { color: var(--wa-suave); }
.ca-tabela button { border: 0; background: transparent; color: var(--wa-verde-texto); font-weight: 500; }
.ca-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.ca-form label { display: grid; gap: 5px; color: var(--wa-suave); font-size: 13px; }
.ca-form input, .ca-form select { height: 38px; padding: 0 10px; border: 1px solid var(--wa-borda); border-radius: 8px; background: var(--wa-painel); color: var(--wa-texto); }
.ca-marcas { display: flex; flex-wrap: wrap; gap: 6px 14px; grid-column: 1 / -1; }
.ca-marcas label { display: flex; align-items: center; gap: 6px; color: var(--wa-texto); font-size: 14px; }
.ca-ok { color: var(--wa-verde-texto); font-size: 13.5px; }

/* telas médias: o painel lateral abre por cima da conversa, sem espremer o cabeçalho */
@media (max-width: 1280px) {
  .wa-painel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 40; box-shadow: -2px 0 12px rgba(11,20,26,.18); }
  .wa-chamado .wa-rotulo-longo { display: none; }
}

/* ---------- celular ---------- */
@media (max-width: 860px) {
  .ca-casca { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 58px; }
  .ca-trilho { grid-row: 2; flex-direction: row; justify-content: space-around; padding: 0 8px; border-right: 0; border-top: 1px solid var(--wa-linha); }
  .ca-trilho-sep, .ca-trilho-fim .ca-eu { display: none; }
  .ca-trilho-fim { margin: 0; flex-direction: row; }
  .wa-app { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 58px); }
  .wa-lado { min-width: 0; }
  .wa-app.wa-com-conversa .wa-lado { display: none; }
  .wa-app:not(.wa-com-conversa) .wa-boasvindas { display: none; }
  .wa-voltar { display: grid; }
  .wa-painel { position: fixed; inset: 0 0 58px 0; z-index: 40; width: auto; }
  .wa-mensagens { padding: 10px 12px 8px; }
  .wa-balao { max-width: 85%; }
  .wa-selo-chamado { max-width: 110px; }
  .wa-chamado .wa-rotulo-longo { display: none; }
  .wa-topo-conversa { padding: 8px 8px; }
}


/* =====================================================================
   Layout no formato do WhatsApp para Mac (referência enviada pelo escritório):
   trilho com rótulos, lista com topo centralizado, balões arredondados com a
   bolinha de quem escreveu no grupo e campo de mensagem em pílula. Sem desenhos
   de fundo nem marca do WhatsApp.
   ===================================================================== */
body { font-size: 14px; }

/* trilho com rótulos */
.ca-casca { grid-template-columns: 200px minmax(0, 1fr); }
.ca-trilho { align-items: stretch; gap: 4px; padding: 14px 10px 12px; border-right: 0; }
.ca-trilho button, .ca-trilho a, .ca-trilho-info, .ca-voce { display: flex; align-items: center; gap: 12px; width: 100%; height: 38px; padding: 0 10px; border-radius: 10px; place-items: initial; color: var(--wa-texto); font-size: 14.5px; font-weight: 500; }
.ca-trilho button.ativo { background: var(--wa-ativo); color: var(--wa-texto); }
.ca-trilho svg { width: 21px; height: 21px; flex: none; }
.ca-rotulo { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-align: left; }
.ca-trilho-badge { position: static; border: 0; background: transparent; color: var(--wa-suave); font-size: 12.5px; font-weight: 500; min-width: 0; padding: 0; }
.ca-trilho-info { color: var(--wa-texto); cursor: default; }
.ca-trilho-conta { color: var(--wa-suave); font-size: 12.5px; }
.ca-trilho-secao { padding: 10px 10px 3px; color: var(--wa-suave); font-size: 12.5px; font-weight: 500; }
.ca-trilho-fim { align-items: stretch; gap: 4px; }
.ca-voce { margin-top: 8px; }
.ca-eu { width: 26px; height: 26px; flex: none; }
@media (max-width: 1180px) {
  .ca-casca { grid-template-columns: 68px minmax(0, 1fr); }
  .ca-trilho { align-items: center; padding: 12px 0; }
  .ca-trilho button, .ca-trilho a, .ca-trilho-info, .ca-voce { width: 44px; padding: 0; justify-content: center; position: relative; }
  .ca-rotulo, .ca-trilho-conta { display: none; }
  .ca-trilho-badge { position: absolute; top: -2px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--wa-verde); color: #111; font-size: 11.5px; font-weight: 700; line-height: 20px; }
}

/* lista */
.wa-app { grid-template-columns: minmax(360px, 32%) minmax(0, 1fr); }
.wa-lado { border-right: 1px solid var(--wa-linha); }
.wa-topo-lista { display: grid; grid-template-columns: 38px 1fr 38px; align-items: center; padding: 10px 14px 4px; }
.wa-topo-lista h1 { margin: 0; text-align: center; font-size: 16px; font-weight: 600; }
.wa-redondo { background: var(--wa-ativo); color: var(--wa-texto); }
.wa-nova-conversa { width: 38px; height: 38px; background: var(--wa-verde); color: #0b0c0c; }
.wa-nova-conversa:hover { background: var(--wa-verde); filter: brightness(1.08); }
.wa-nova-conversa svg { width: 22px; height: 22px; }
.wa-menu-esquerda > ul { left: 0; right: auto; }
.wa-pesquisa { margin: 6px 14px 8px; }
.wa-pesquisa input { height: 36px; border-radius: 18px; background: var(--wa-ativo); font-size: 14px; }
.wa-chips { gap: 10px; padding: 2px 16px 10px; }
.wa-chips button { height: 38px; padding: 0 16px; border-radius: 19px; border-color: var(--wa-borda); background: transparent; color: var(--wa-suave); font-size: 15.5px; font-weight: 500; }
.wa-chips button.ativo { background: var(--wa-chip-ativo); border-color: var(--wa-chip-ativo); color: var(--wa-chip-ativo-texto); font-weight: 600; }
.wa-chips select { height: 38px; border-radius: 19px; background: transparent; }
.wa-arquivadas { padding: 14px 20px 14px 34px; gap: 22px; }
.wa-arquivadas svg { fill: var(--wa-suave); }
.wa-arquivadas span { color: var(--wa-suave); font-weight: 500; }
.wa-arquivadas small { color: var(--wa-suave); font-size: 12.5px; font-weight: 500; }
.wa-lista li > button { height: 72px; gap: 12px; border-radius: 12px; padding: 0 12px 0 10px; }
.wa-lista .wa-avatar { width: 49px !important; height: 49px !important; }
.wa-item { gap: 4px; border-bottom: 0; }
.wa-item-linha strong { font-size: 15.5px; font-weight: 500; }
.wa-item-linha time { font-size: 12px; }
.wa-item-previa > span:first-child { font-size: 13.5px; }
.wa-badge { min-width: 20px; height: 20px; line-height: 20px; border-radius: 10px; color: #0b0c0c; font-size: 11.5px; font-weight: 700; }

/* conversa */
.wa-conversa { background-size: 26px 26px; background-position: 0 0, 13px 13px; }
.wa-topo-conversa { min-height: 60px; padding: 8px 16px; background: color-mix(in srgb, var(--wa-painel) 92%, transparent); backdrop-filter: blur(10px); border-left: 0; border-bottom: 1px solid var(--wa-linha); }
.wa-quem { gap: 14px; }
.wa-quem strong { font-size: 15.5px; font-weight: 500; }
.wa-quem small { font-size: 12.5px; }
.wa-topo-conversa > .wa-icone, .wa-topo-conversa .wa-menu > .wa-icone { background: var(--wa-ativo); border-radius: 20px; width: 38px; height: 36px; color: var(--wa-texto); }
.wa-mensagens { padding: 14px 4% 10px; }
.wa-linha { margin: 2px 0; align-items: flex-end; }
.wa-balao { max-width: min(62%, 620px); padding: 6px 10px 8px; border-radius: 14px; box-shadow: none; }
.wa-com-ponta { margin-top: 10px; }
.wa-linha-entrada .wa-com-ponta, .wa-linha-saida .wa-com-ponta { border-radius: 14px; }
.wa-linha-entrada .wa-com-ponta::before, .wa-linha-saida .wa-com-ponta::before { display: none; }
.wa-balao p { font-size: 14.2px; line-height: 19px; }
.wa-balao p::after { width: 58px; }
.wa-autor { margin-bottom: 2px; font-size: 13px; font-weight: 600; }
.wa-hora { right: 9px; bottom: 5px; font-size: 11px; }
.wa-citacao { border-radius: 12px; border-left-width: 4px; padding: 8px 12px; background: rgba(0,0,0,.18); }
.wa-citacao strong { font-size: 13px; font-weight: 600; }
.wa-citacao span { font-size: 13px; color: var(--wa-texto); opacity: .85; }
.wa-reacoes { left: 10px; bottom: -16px; padding: 2px 8px; border-radius: 14px; background: var(--wa-entrada); border: 2px solid var(--wa-fundo); font-size: 13.5px; }
.wa-dia span, .wa-sistema span { border-radius: 8px; box-shadow: none; font-size: 12px; }
/* bolinha de quem escreveu no grupo, alinhada ao fim do bloco de mensagens */
.wa-remetente { flex: none; width: 32px; margin-right: 6px; align-self: flex-end; }
.wa-remetente-foto { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 700; }
.wa-linha-entrada .wa-remetente + .wa-balao { max-width: min(60%, 600px); }

/* campo de mensagem: + redondo, pílula com emoji à direita, microfone verde */
.wa-envio { padding: 6px 16px 10px; }
.wa-compositor { align-items: flex-end; gap: 10px; padding: 0; min-height: 0; border-radius: 0; background: transparent; box-shadow: none; }
.wa-compositor.nota { background: transparent; box-shadow: none; }
.wa-compositor .wa-anexar { width: 40px; height: 40px; background: var(--wa-ativo); color: var(--wa-texto); }
.wa-campo-pilula { flex: 1; min-width: 0; display: flex; align-items: flex-end; gap: 2px; min-height: 42px; padding: 0 4px 0 16px; border: 1px solid var(--wa-borda); border-radius: 21px; background: var(--wa-entrada); }
.wa-compositor.nota .wa-campo-pilula { background: var(--wa-nota); border-color: #e0b84c; }
.wa-campo-pilula textarea { padding: 10px 4px 10px 0; font-size: 14.5px; }
.wa-campo-pilula .wa-icone { width: 36px; height: 36px; color: var(--wa-suave); }
.wa-compositor > .wa-icone:last-child, .wa-enviar { width: 42px; height: 42px; border-radius: 50%; background: var(--wa-verde); color: #0b0c0c; }
.wa-compositor > .wa-icone:last-child:hover { background: var(--wa-verde); filter: brightness(1.08); }
.wa-compositor > .wa-icone.wa-gravando:last-child { background: var(--wa-perigo); color: #fff; }
.wa-popover { bottom: 66px; border-radius: 16px; }
.wa-envio-opcoes { margin: 4px 58px 0; }

/* Contraste dos balões no tema escuro: fundo quase preto, balões em cinza/verde com borda sutil. */
:root[data-theme="dark"] .wa-balao { box-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-balao { box-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 1px 2px rgba(0,0,0,.6); } }
:root[data-theme="dark"] .wa-campo-pilula { background: #2a2a2a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wa-campo-pilula { background: #2a2a2a; } }
.wa-conversa { background-size: 22px 22px; background-position: 0 0, 11px 11px; }

/* filtros da lista no trilho lateral */
.ca-trilho { overflow-y: auto; scrollbar-width: none; }
.ca-trilho button { flex: none; }
.ca-trilho-secao { flex: none; }
.ca-trilho-sep { flex: none; width: auto; margin: 6px 12px; background: var(--wa-linha); }
.ca-trilho-badge.forte { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--wa-verde); color: #0b0c0c; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; }
.wa-filtro-ativo { display: flex; align-items: center; gap: 6px; margin: 0 14px 6px; padding: 4px 8px 4px 12px; border-radius: 16px; background: var(--wa-chip-ativo); color: var(--wa-chip-ativo-texto); font-size: 13px; }
.wa-filtro-ativo strong { flex: 1; }
.wa-filtro-ativo button { border: 0; background: transparent; color: inherit; }
@media (max-width: 1180px) { .ca-trilho-secao { display: none; } .ca-trilho-sep { width: 32px; margin: 6px auto; } }
.ca-trilho button, .ca-trilho a, .ca-trilho-info, .ca-voce { line-height: 1.2; }
.ca-trilho button > *, .ca-trilho a > *, .ca-voce > * { align-self: center; }
img.wa-remetente-foto { object-fit: cover; background: var(--wa-ativo); }

/* =====================================================================
   Celular (fica por último para valer sobre o layout de computador):
   barra de baixo com Tudo / Não lidas / Minhas / Na fila / Mais; "Mais" abre
   uma folha com o restante. Com a conversa aberta, a barra some e a conversa
   ocupa a tela inteira (voltar no topo).
   ===================================================================== */
.ca-trilho .ca-botao-mais, .ca-mais-fundo { display: none; }
@media (max-width: 860px) {
  /* zoom travado na largura do celular: sem pinça, sem duplo toque e sem rolagem para o lado */
  html { touch-action: pan-x pan-y; overflow-x: hidden; -webkit-text-size-adjust: 100%; }
  body { font-size: 15px; overflow-x: hidden; touch-action: manipulation; }
  input, textarea, select { font-size: 16px !important; } /* abaixo de 16 o iPhone dá zoom ao tocar no campo */
  .ca-casca { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; height: 100dvh; }
  .ca-casca > :not(.ca-trilho):not(.ca-mais-fundo) { grid-row: 1; grid-column: 1; min-height: 0; }
  .ca-pagina { height: 100%; }
  .ca-pagina > div { padding: 18px 14px calc(18px + env(safe-area-inset-bottom)); }
  .ca-tabela { display: block; overflow-x: auto; }

  /* barra de baixo */
  .ca-trilho { grid-row: 2; grid-column: 1; flex-direction: row; align-items: stretch; justify-content: space-around; gap: 0; overflow: visible;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--wa-linha); background: var(--wa-painel); }
  .ca-trilho > :not(.ca-principal) { display: none !important; }
  .ca-trilho .ca-principal { position: relative; flex: 1 1 0; flex-direction: column; justify-content: center; gap: 3px; width: auto; min-width: 0; height: 56px; padding: 0 2px;
    border-radius: 12px; background: transparent; color: var(--wa-suave); font-size: 11.5px; font-weight: 500; }
  .ca-trilho .ca-principal:hover { background: transparent; }
  .ca-trilho .ca-principal .ca-rotulo { display: block; flex: none; max-width: 100%; text-align: center; }
  .ca-trilho .ca-principal svg { width: 24px; height: 24px; padding: 2px 14px; box-sizing: content-box; border-radius: 14px; }
  .ca-trilho .ca-principal.ativo { background: transparent; color: var(--wa-texto); font-weight: 600; }
  .ca-trilho .ca-principal.ativo svg { background: var(--wa-chip-ativo); color: var(--wa-chip-ativo-texto); }
  .ca-trilho .ca-principal .ca-trilho-badge { position: absolute; top: 2px; left: calc(50% + 6px); right: auto; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
    background: var(--wa-verde); color: #0b0c0c; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
  .ca-trilho .ca-principal .ca-trilho-badge:not(.forte) { background: var(--wa-ativo); color: var(--wa-texto); }
  .ca-trilho .ca-botao-mais { display: flex; }
  .ca-com-conversa { grid-template-rows: minmax(0, 1fr); }
  .ca-com-conversa .ca-trilho { display: none; }

  /* folha "Mais" */
  .ca-mais-fundo { display: block; position: fixed; inset: 0; z-index: 55; border: 0; background: rgba(0,0,0,.45); }
  .ca-mais-aberto .ca-trilho { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; flex-direction: column; justify-content: flex-start; gap: 2px; max-height: 78dvh; overflow-y: auto;
    padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); border-radius: 20px 20px 0 0; border-top: 0; box-shadow: 0 -6px 24px rgba(0,0,0,.35); }
  .ca-mais-aberto .ca-trilho::before { content: ""; flex: none; align-self: center; width: 40px; height: 5px; margin: 0 0 8px; border-radius: 3px; background: var(--wa-borda); }
  .ca-mais-aberto .ca-trilho > :not(.ca-principal) { display: flex !important; }
  .ca-mais-aberto .ca-trilho > .ca-trilho-secao { display: block !important; padding: 12px 12px 4px; }
  .ca-mais-aberto .ca-trilho > .ca-trilho-sep { display: block !important; width: auto; height: 1px; margin: 6px 12px; }
  .ca-mais-aberto .ca-trilho > .ca-principal, .ca-mais-aberto .ca-trilho > .ca-botao-mais { display: none !important; }
  .ca-mais-aberto .ca-trilho-fim { flex-direction: column; align-items: stretch; margin: 0; }
  .ca-mais-aberto .ca-trilho-fim > .ca-trilho-secao { display: block; }
  .ca-mais-aberto .ca-trilho button, .ca-mais-aberto .ca-trilho a, .ca-mais-aberto .ca-voce { flex: none; flex-direction: row; justify-content: flex-start; width: 100%; height: 48px; padding: 0 12px; font-size: 16px; }
  .ca-mais-aberto .ca-rotulo, .ca-mais-aberto .ca-trilho-conta { display: block; }
  .ca-mais-aberto .ca-trilho-badge { position: static; background: transparent; color: var(--wa-suave); }
  .ca-mais-aberto .ca-trilho-badge.forte { background: var(--wa-verde); color: #0b0c0c; }
  .ca-mais-aberto .ca-eu { display: grid; }

  /* lista e conversa em tela cheia, uma de cada vez */
  .wa-app { grid-template-columns: minmax(0, 1fr); height: 100%; min-height: 0; }
  .wa-lado { min-width: 0; border-right: 0; }
  .wa-app.wa-com-conversa .wa-lado { display: none; }
  .wa-app:not(.wa-com-conversa) .wa-boasvindas, .wa-app:not(.wa-com-conversa) .wa-conversa { display: none; }
  .wa-topo-lista { grid-template-columns: 40px 1fr 40px; padding: calc(8px + env(safe-area-inset-top)) 12px 4px; }
  .wa-topo-lista h1 { font-size: 17px; }
  .wa-nova-conversa { width: 40px; height: 40px; }
  .wa-pesquisa { margin: 6px 12px 8px; }
  .wa-pesquisa input { height: 40px; font-size: 16px; }
  .wa-filtro-ativo { margin: 0 12px 6px; }
  .wa-lista li > button { height: 74px; gap: 12px; padding: 0 10px; border-radius: 0; }
  .wa-lista .wa-avatar { width: 50px !important; height: 50px !important; }
  .wa-item-linha strong { font-size: 16px; }
  .wa-item-previa > span:first-child { font-size: 14.5px; }
  .wa-arquivadas { padding: 12px 16px 12px 26px; }

  .wa-voltar { display: grid; }
  .wa-topo-conversa { min-height: 0; padding: calc(6px + env(safe-area-inset-top)) 6px 6px; gap: 4px; }
  .wa-quem { gap: 10px; min-width: 0; }
  .wa-quem strong { font-size: 16px; }
  .wa-quem small { font-size: 12.5px; }
  .wa-topo-conversa > .wa-icone, .wa-topo-conversa .wa-menu > .wa-icone { width: 38px; height: 38px; border-radius: 50%; }
  .wa-topo-conversa > .wa-icone.wa-voltar { background: transparent; }
  .wa-chamado .wa-rotulo-longo, .wa-selo-chamado .wa-rotulo-longo { display: none; }
  .wa-selo-chamado { max-width: 110px; }
  .wa-mensagens { padding: 10px 10px 8px; }
  .wa-balao { max-width: 84%; padding: 7px 11px 8px; border-radius: 16px; }
  .wa-linha-entrada .wa-remetente + .wa-balao { max-width: calc(84% - 36px); }
  .wa-remetente { width: 30px; margin-right: 6px; }
  .wa-remetente-foto { width: 28px; height: 28px; font-size: 11px; }
  .wa-balao p { font-size: 15px; line-height: 20px; }
  .wa-autor { font-size: 13.5px; }

  .wa-envio { padding: 6px 8px calc(8px + env(safe-area-inset-bottom)); }
  .wa-compositor { gap: 6px; }
  .wa-compositor .wa-anexar { width: 40px; height: 40px; }
  .wa-campo-pilula { min-height: 42px; padding: 0 4px 0 14px; border-radius: 21px; }
  .wa-campo-pilula textarea { padding: 10px 4px 10px 0; font-size: 16px; }
  .wa-campo-pilula .wa-icone { width: 38px; height: 38px; }
  .wa-compositor > .wa-icone:last-child, .wa-enviar { width: 42px; height: 42px; }
  .wa-envio-opcoes { margin: 6px 8px 0; flex-wrap: wrap; }
  .wa-popover { left: 8px; right: 8px; bottom: 64px; max-width: none; }

  .wa-painel { position: fixed; inset: 0; z-index: 40; width: auto; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
}

/* Pilar entre a lista e a conversa: arrastar muda a largura da lista (só no computador). */
@media (min-width: 861px) {
  .wa-app { grid-template-columns: var(--wa-lista, minmax(360px, 32%)) minmax(0, 1fr); }
  .wa-lado { position: relative; }
  .wa-divisor { position: absolute; top: 0; right: -4px; bottom: 0; z-index: 5; width: 8px; padding: 0; border: 0; background: transparent; cursor: col-resize; touch-action: none; }
  .wa-divisor::after { content: ""; position: absolute; top: 0; bottom: 0; left: 3px; width: 2px; background: transparent; transition: background .15s; }
  .wa-divisor:hover::after, .wa-divisor:focus-visible::after, .wa-arrastando .wa-divisor::after { background: var(--wa-verde); }
  .wa-divisor:focus-visible { outline: none; }
  .wa-arrastando { cursor: col-resize; user-select: none; }
  .wa-arrastando iframe, .wa-arrastando img, .wa-arrastando video { pointer-events: none; }
}
@media (max-width: 860px) { .wa-divisor { display: none; } }

/* Financeiro do contato (Boleto Flow, só leitura) */
.wa-fin-erro { color: #e5484d; font-size: 13.5px; }
.wa-link { border: 0; background: none; padding: 0; color: var(--wa-verde-texto); cursor: pointer; font: inherit; }
.wa-link:disabled { opacity: .5; cursor: default; }
