:root {
  --verde: #00a884; --verde-esc: #008069; --fundo: #f0f2f5; --painel: #ffffff; --linha: #e9edef;
  --texto: #111b21; --suave: #667781; --bolha-eu: #d9fdd3; --bolha-eles: #ffffff; --chat: #efeae2;
  --alerta: #d93025; --aviso: #b26a00; --azul: #1a73e8;
}
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.4 -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--texto); background: var(--fundo); }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; }
.btn { border: 1px solid var(--linha); background: #fff; border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.btn:hover { background: #f5f6f6; }
.btn.primario { background: var(--verde); border-color: var(--verde); color: #fff; }
.btn.primario:hover { background: var(--verde-esc); }
.btn.perigo { color: var(--alerta); }
.btn.leve { border-color: transparent; background: transparent; }
.btn.mini { padding: 2px 8px; font-size: 12px; }
input, select, textarea { border: 1px solid #d1d7db; border-radius: 8px; padding: 6px 8px; background: #fff; }
textarea { width: 100%; resize: vertical; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--suave); }
.erro { color: var(--alerta); min-height: 1em; }

.login { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-card { background: #fff; padding: 32px; border-radius: 12px; width: 340px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.marca { font-weight: 700; color: var(--verde-esc); font-size: 17px; white-space: nowrap; }
.marca span { font-weight: 400; color: var(--suave); }

.topo { display: flex; align-items: center; gap: 16px; padding: 0 16px; height: 54px; background: #fff; border-bottom: 1px solid var(--linha); }
#abas { display: flex; gap: 2px; flex: 1; overflow-x: auto; }
#abas a { padding: 16px 12px; color: var(--suave); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; }
#abas a.ativa { color: var(--verde-esc); border-bottom-color: var(--verde); font-weight: 600; }
.topo-dir { display: flex; align-items: center; gap: 10px; }
#quem { color: var(--suave); font-size: 12px; white-space: nowrap; }
main { height: calc(100vh - 54px); overflow: auto; }

/* conversas */
.conv { display: grid; grid-template-columns: 340px 1fr 320px; height: 100%; }
.conv.sem-lead { grid-template-columns: 340px 1fr; }
.lista { background: #fff; border-right: 1px solid var(--linha); display: flex; flex-direction: column; min-height: 0; }
.lista-topo { padding: 8px; display: flex; gap: 6px; align-items: center; border-bottom: 1px solid var(--linha); }
.lista-topo input { flex: 1; }
.lista-itens { overflow-y: auto; flex: 1; }
.item { padding: 10px 14px; border-bottom: 1px solid var(--linha); cursor: pointer; }
.item:hover { background: #f5f6f6; }
.item.ativo { background: #f0f2f5; }
.item .l1 { display: flex; justify-content: space-between; gap: 8px; }
.item .nome { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .hora { color: var(--suave); font-size: 11px; white-space: nowrap; }
.item .prev { color: var(--suave); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 10px; background: #e7f8f3; color: var(--verde-esc); margin-right: 4px; }
.tag.cinza { background: #eef0f1; color: var(--suave); }
.tag.laranja { background: #fff2dc; color: var(--aviso); }
.tag.vermelho { background: #fde7e7; color: var(--alerta); }
.tag.azul { background: #e8f0fe; color: var(--azul); }

.chat { display: flex; flex-direction: column; background: var(--chat); min-height: 0; }
.chat-topo { background: #f0f2f5; padding: 10px 16px; border-bottom: 1px solid var(--linha); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 16px 6%; display: flex; flex-direction: column; gap: 4px; }
.bolha { max-width: 65%; padding: 6px 9px 4px; border-radius: 8px; background: var(--bolha-eles); box-shadow: 0 1px .5px rgba(0,0,0,.13); white-space: pre-wrap; word-wrap: break-word; }
.bolha.eu { align-self: flex-end; background: var(--bolha-eu); }
.bolha .rem { font-size: 12px; font-weight: 600; color: #a5517d; }
.bolha .meta { font-size: 11px; color: var(--suave); text-align: right; margin-top: 2px; }
.bolha .midia { font-size: 12px; color: var(--suave); font-style: italic; }
.dia { align-self: center; background: #fff; color: var(--suave); font-size: 12px; padding: 3px 10px; border-radius: 8px; margin: 8px 0; }
.compor { background: #f0f2f5; padding: 8px 12px; display: flex; gap: 8px; align-items: flex-end; }
.compor textarea { min-height: 40px; max-height: 160px; }
.vazio { margin: auto; color: var(--suave); text-align: center; padding: 40px; }

.painel-lead { background: #fff; border-left: 1px solid var(--linha); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.painel-lead h3 { margin: 0; font-size: 15px; }
.campo { font-size: 12px; color: var(--suave); }
.campo b { color: var(--texto); font-weight: 500; }
.caixa { border: 1px solid var(--linha); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.caixa h4 { margin: 0; font-size: 13px; }
.prox { font-size: 12px; background: #f7f8fa; border-radius: 8px; padding: 6px 8px; white-space: pre-wrap; max-height: 90px; overflow: hidden; }

/* páginas */
.pagina { padding: 18px 22px; max-width: 1400px; }
.pagina h2 { margin: 0 0 4px; font-size: 20px; }
.sub { color: var(--suave); margin: 0 0 14px; }
.filtros { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--linha); text-align: left; vertical-align: top; font-size: 13px; }
th { background: #f7f8fa; color: var(--suave); font-weight: 500; font-size: 12px; position: sticky; top: 0; }
tr:hover td { background: #fafbfb; }
.cartoes { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.cartao { background: #fff; border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 8px; border: 1px solid var(--linha); }
.cartao .topo-c { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.cartao textarea { min-height: 110px; }
.acoes { display: flex; gap: 6px; flex-wrap: wrap; }
.passo { border: 1px dashed #c9d1d6; border-radius: 10px; padding: 10px; display: grid; grid-template-columns: 90px 90px 1fr; gap: 8px; align-items: start; }
.passo textarea { grid-column: 1 / -1; min-height: 90px; }
.passo .linha-baixo { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12px; }
.grid2 { display: grid; grid-template-columns: 300px 1fr; gap: 16px; }
.lista-fluxos .item { border-radius: 8px; }
.num { font-size: 26px; font-weight: 600; }

.modal { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 10; }
.modal-card { background: #fff; border-radius: 12px; padding: 20px; width: min(560px, 92vw); max-height: 88vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #111b21; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 20; max-width: 80vw; }

@media (max-width: 900px) {
  .conv, .conv.sem-lead { grid-template-columns: 1fr; }
  .painel-lead { display: none; }
  .grid2 { grid-template-columns: 1fr; }
  .topo { flex-wrap: wrap; height: auto; padding: 8px 16px; }
  main { height: auto; }
}

/* modo da conversa: fluxo automático x manual */
.tag.modo-ia { background: #e3f6ff; color: #0b6a9a; }
.tag.etq { background: #f4eefc; color: #6b3fa0; }
.faixa-modo { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 16px; border-bottom: 1px solid var(--linha); font-size: 13px; }
.faixa-modo.ia { background: #e3f6ff; }
.faixa-modo.manual { background: #fff2dc; }
.faixa-modo .acoes { display: flex; gap: 6px; flex-shrink: 0; }
#filtro { max-width: 150px; }

/* mídias no chat */
.bolha .m-img { display: block; max-width: 280px; max-height: 320px; width: auto; border-radius: 6px; margin: 2px 0 4px; cursor: zoom-in; background: #0001; }
.bolha .m-img.m-fig { max-width: 140px; background: none; }
.bolha .m-audio { width: 260px; max-width: 100%; height: 40px; margin: 2px 0; display: block; }
.bolha .m-video { display: block; max-width: 300px; max-height: 320px; border-radius: 6px; margin: 2px 0 4px; background: #000; }
.bolha .m-doc { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 2px 0 4px; border-radius: 6px; background: #0000000d; color: var(--texto); text-decoration: none; max-width: 260px; }
.bolha .m-doc span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bolha .txt { white-space: pre-wrap; }

/* ===== visual WhatsApp ===== */
.avatar { width: 49px; height: 49px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 500; font-size: 17px; letter-spacing: .5px; }
.chat-topo .avatar { width: 40px; height: 40px; font-size: 15px; }
.lista { background: #fff; }
.lista-topo { padding: 7px 12px; border-bottom: none; }
.lista-topo input { background: #f0f2f5; border: none; border-radius: 8px; padding: 8px 12px; }
.lista-topo select { background: #f0f2f5; border: none; }
.item { display: flex; gap: 13px; align-items: center; padding: 0 0 0 13px; border-bottom: none; height: auto; }
.item .corpo { flex: 1; min-width: 0; padding: 12px 15px 12px 0; border-bottom: 1px solid #e9edef; }
.item .nome { font-size: 16px; font-weight: 400; color: #111b21; }
.item .hora { font-size: 12px; color: #667781; }
.item .prev { display: flex; align-items: center; gap: 3px; font-size: 14px; color: #667781; margin-top: 2px; }
.item .prev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .prev .tique { color: #8696a0; flex-shrink: 0; }
.item .selos { margin-top: 4px; }
.item.ativo { background: #f0f2f5; }
.item:hover { background: #f5f6f6; }

.chat { background-color: #efeae2; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23d9d2c5' stroke-width='1.2' opacity='.55'%3E%3Ccircle cx='18' cy='20' r='6'/%3E%3Cpath d='M70 14l8 8m0-8l-8 8'/%3E%3Crect x='96' y='52' width='12' height='12' rx='3'/%3E%3Cpath d='M30 78q8-10 16 0t16 0'/%3E%3Ccircle cx='88' cy='100' r='4'/%3E%3Cpath d='M10 104l6-10 6 10z'/%3E%3C/g%3E%3C/svg%3E"); }
.chat-topo { background: #f0f2f5; padding: 10px 16px; border-bottom: 1px solid #d1d7db; justify-content: flex-start; gap: 13px; min-height: 59px; }
.chat-topo .quem { display: flex; flex-direction: column; line-height: 1.25; }
.chat-topo .quem b { font-weight: 400; font-size: 16px; color: #111b21; }
.chat-topo .quem span { font-size: 13px; color: #667781; }
.chat-msgs { padding: 12px 7% 8px; gap: 2px; }
.dia { background: #fff; color: #54656f; font-size: 12.5px; padding: 5px 12px 6px; border-radius: 7.5px; margin: 10px 0 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); text-transform: uppercase; }

.bolha { position: relative; max-width: 65%; padding: 6px 7px 8px 9px; border-radius: 7.5px; font-size: 14.2px; line-height: 19px; color: #111b21; box-shadow: 0 1px .5px rgba(11,20,26,.13); margin-top: 10px; white-space: normal; }
.bolha.cont { margin-top: 2px; }
.bolha:not(.cont)::before { content: ''; position: absolute; top: 0; width: 8px; height: 13px; }
.bolha:not(.eu):not(.cont) { border-top-left-radius: 0; }
.bolha:not(.eu):not(.cont)::before { left: -8px; background: var(--bolha-eles); clip-path: polygon(0 0, 100% 0, 100% 100%); }
.bolha.eu:not(.cont) { border-top-right-radius: 0; }
.bolha.eu:not(.cont)::before { right: -8px; background: var(--bolha-eu); clip-path: polygon(0 0, 100% 0, 0 100%); }
.bolha .rem { font-size: 12.8px; font-weight: 500; line-height: 22px; }
.bolha .txt { white-space: pre-wrap; word-wrap: break-word; }
.bolha .meta { float: right; display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #667781; margin: 8px 0 -6px 10px; position: relative; top: 2px; white-space: nowrap; }
.bolha .meta .tique { color: #53bdeb; }
.bolha.so-midia { padding: 3px 3px 3px; }
.bolha.so-midia > .meta { position: absolute; right: 9px; bottom: 7px; color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,.4); margin: 0; }
.bolha.so-midia > .meta .tique { color: #fff; }
.bolha.fig { background: transparent; box-shadow: none; }
.bolha.fig::before { display: none; }
.bolha .m-img { max-width: 330px; max-height: 330px; border-radius: 6px; margin: 0; }
.bolha .m-video { max-width: 330px; border-radius: 6px; margin: 0; }
.bolha .midia { font-style: normal; color: #667781; font-size: 13.5px; }

.wa-audio { display: flex; align-items: center; gap: 8px; width: 300px; max-width: 100%; padding: 4px 2px 0; }
.wa-play { border: none; background: none; color: #54656f; cursor: pointer; padding: 0; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.wa-trilha { flex: 1; position: relative; display: flex; flex-direction: column; }
.wa-barra { -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 2px; border: none; padding: 0; margin: 10px 0 6px; cursor: pointer;
  background: linear-gradient(to right, #00a884 var(--p, 0%), #c6ccd0 var(--p, 0%)); }
.bolha.eu .wa-barra { background: linear-gradient(to right, #53bdeb var(--p, 0%), #b6d4b1 var(--p, 0%)); }
.wa-barra::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #00a884; border: none; }
.bolha.eu .wa-barra::-webkit-slider-thumb { background: #53bdeb; }
.wa-barra::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: #00a884; border: none; }
.wa-tempo { font-size: 11px; color: #667781; position: absolute; left: 0; bottom: -12px; }
.wa-vel { border: none; background: #8696a0; color: #fff; font-size: 12px; font-weight: 600; border-radius: 12px; padding: 2px 8px; cursor: pointer; flex-shrink: 0; min-width: 40px; }
.wa-audio.tocando .wa-vel { background: #54656f; }
.wa-audio + .meta { margin-top: 4px; }

.compor { background: #f0f2f5; padding: 5px 16px 5px 10px; gap: 8px; align-items: center; min-height: 62px; }
.compor .ico { color: #54656f; cursor: pointer; padding: 8px; display: flex; flex-direction: row; }
.compor .caixa-texto { flex: 1; background: #fff; border-radius: 8px; padding: 9px 12px; display: flex; flex-direction: column; gap: 4px; }
.compor .caixa-texto textarea { border: none; padding: 0; min-height: 22px; max-height: 140px; resize: none; outline: none; font-size: 15px; line-height: 20px; }
#anexo-nome { font-size: 12.5px; color: #008069; }
.compor .enviar { border: none; background: none; color: #54656f; cursor: pointer; padding: 8px; display: flex; }
.compor .enviar:hover { color: #00a884; }
.faixa-modo { border-bottom: none; box-shadow: 0 1px 2px rgba(11,20,26,.08); }
.bolha.so-midia { width: fit-content; }
.bolha.so-midia > a { display: block; line-height: 0; }

/* ===== fotos, tiques, filtros, menus ===== */
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tique { color: #8696a0; flex-shrink: 0; }
.tique.lida, .bolha .meta .tique.lida { color: #53bdeb; }
.bolha .meta .tique { color: #8696a0; }
.lista-topo { flex-direction: column; align-items: stretch; gap: 8px; padding: 8px 12px 6px; }
.busca-caixa { display: flex; align-items: center; gap: 10px; background: #f0f2f5; border-radius: 8px; padding: 0 12px; color: #54656f; }
.busca-caixa input { background: transparent !important; flex: 1; padding: 8px 0 !important; outline: none; }
.pilulas { display: flex; gap: 6px; flex-wrap: wrap; }
.pilula { border: none; background: #f0f2f5; color: #54656f; border-radius: 16px; padding: 5px 12px; font-size: 14px; cursor: pointer; }
.pilula.ativa { background: #d9fdd3; color: #008069; }
.bolha .mmenu { position: absolute; top: 3px; right: 3px; border: none; border-radius: 50%; width: 22px; height: 22px; padding: 2px; color: #8696a0; cursor: pointer; opacity: 0; background: inherit; box-shadow: -6px 0 8px 2px var(--fundo-bolha, #fff); transition: opacity .12s; z-index: 1; }
.bolha.eu .mmenu { --fundo-bolha: var(--bolha-eu); }
.bolha:hover .mmenu { opacity: 1; }
.bolha.com-reacao { margin-bottom: 14px; }
.reacao { position: absolute; bottom: -14px; left: 8px; background: #fff; border-radius: 12px; padding: 1px 5px; font-size: 14px; box-shadow: 0 1px 2px rgba(11,20,26,.2); }
.bolha.eu .reacao { left: auto; right: 8px; }
.menu-msg { position: fixed; z-index: 30; background: #fff; border-radius: 8px; box-shadow: 0 4px 18px rgba(11,20,26,.22); padding: 6px 0; min-width: 210px; display: flex; flex-direction: column; }
.menu-msg .reacoes { display: flex; gap: 2px; padding: 4px 8px 8px; border-bottom: 1px solid #e9edef; margin-bottom: 4px; }
.menu-msg .reacoes button { border: none; background: none; font-size: 22px; cursor: pointer; border-radius: 50%; width: 36px; height: 36px; }
.menu-msg .reacoes button:hover, .menu-msg .reacoes button.ativa { background: #f0f2f5; }
.menu-msg .item-menu { border: none; background: none; text-align: left; padding: 9px 18px; font-size: 14.5px; color: #3b4a54; cursor: pointer; }
.menu-msg .item-menu:hover { background: #f5f6f6; }
#resp-barra { display: flex; align-items: stretch; gap: 8px; background: #f0f2f5; border-radius: 7px; overflow: hidden; }
#resp-barra .citacao { flex: 1; border-left: 4px solid #06cf9c; padding: 6px 10px; display: flex; flex-direction: column; font-size: 13px; min-width: 0; }
#resp-barra .citacao span { color: #667781; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#resp-barra > button { border: none; background: none; color: #8696a0; cursor: pointer; padding: 0 10px; }
.compor .ico { border: none; background: none; }
.emojis { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 2px; padding: 8px 14px; max-height: 200px; overflow-y: auto; background: #f0f2f5; border-top: 1px solid #d1d7db; }
.emojis button { border: none; background: none; font-size: 24px; cursor: pointer; border-radius: 6px; padding: 4px; }
.emojis button:hover { background: #e2e5e8; }
.enc-lista { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; }
.enc-item { flex-direction: row !important; align-items: center; gap: 12px; padding: 8px 4px; cursor: pointer; color: var(--texto) !important; font-size: 15px !important; border-bottom: 1px solid #e9edef; }
.enc-item span { flex: 1; }
.enc-item .avatar { width: 40px; height: 40px; font-size: 14px; }
.bolha .m-doc { background: rgba(0,0,0,.05); padding: 10px 12px; gap: 10px; }
.doc-ico { background: #e53935; color: #fff; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 6px 4px; min-width: 32px; text-align: center; }
.doc-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== tema escuro (paleta do WhatsApp) ===== */
:root[data-tema="escuro"] { --fundo: #111b21; --painel: #111b21; --linha: #222d34; --texto: #e9edef; --suave: #8696a0; --bolha-eu: #005c4b; --bolha-eles: #202c33; --chat: #0b141a; color-scheme: dark; }
[data-tema="escuro"] body { background: #0c1317; color: #e9edef; }
[data-tema="escuro"] .topo, [data-tema="escuro"] .lista, [data-tema="escuro"] .painel-lead, [data-tema="escuro"] .cartao,
[data-tema="escuro"] .modal-card, [data-tema="escuro"] .login-card, [data-tema="escuro"] table { background: #111b21; color: #e9edef; border-color: #222d34; }
[data-tema="escuro"] .topo { border-bottom-color: #222d34; }
[data-tema="escuro"] #abas a { color: #8696a0; }
[data-tema="escuro"] #abas a.ativa { color: #00a884; }
[data-tema="escuro"] input, [data-tema="escuro"] select, [data-tema="escuro"] textarea { background: #2a3942; color: #e9edef; border-color: #2a3942; }
[data-tema="escuro"] .btn { background: #202c33; color: #e9edef; border-color: #2a3942; }
[data-tema="escuro"] .btn.primario { background: #00a884; color: #111b21; border-color: #00a884; }
[data-tema="escuro"] .btn.leve { background: transparent; border-color: transparent; }
[data-tema="escuro"] .busca-caixa, [data-tema="escuro"] .pilula { background: #202c33; color: #8696a0; }
[data-tema="escuro"] .pilula.ativa { background: #0a332c; color: #00a884; }
[data-tema="escuro"] .item:hover { background: #202c33; }
[data-tema="escuro"] .item.ativo { background: #2a3942; }
[data-tema="escuro"] .item .corpo { border-bottom-color: #222d34; }
[data-tema="escuro"] .item .nome, [data-tema="escuro"] .chat-topo .quem b { color: #e9edef; }
[data-tema="escuro"] .item .prev, [data-tema="escuro"] .item .hora, [data-tema="escuro"] .chat-topo .quem span { color: #8696a0; }
[data-tema="escuro"] .chat { background-color: #0b141a; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23202c33' stroke-width='1.2'%3E%3Ccircle cx='18' cy='20' r='6'/%3E%3Cpath d='M70 14l8 8m0-8l-8 8'/%3E%3Crect x='96' y='52' width='12' height='12' rx='3'/%3E%3Cpath d='M30 78q8-10 16 0t16 0'/%3E%3Ccircle cx='88' cy='100' r='4'/%3E%3Cpath d='M10 104l6-10 6 10z'/%3E%3C/g%3E%3C/svg%3E"); }
[data-tema="escuro"] .chat-topo, [data-tema="escuro"] .compor, [data-tema="escuro"] .emojis { background: #202c33; border-color: #222d34; }
[data-tema="escuro"] .compor .caixa-texto, [data-tema="escuro"] .compor .caixa-texto textarea { background: #2a3942; color: #e9edef; }
[data-tema="escuro"] .compor .ico, [data-tema="escuro"] .compor .enviar { color: #8696a0; }
[data-tema="escuro"] .bolha { color: #e9edef; }
[data-tema="escuro"] .bolha .meta { color: rgba(233,237,239,.6); }
[data-tema="escuro"] .bolha .txt a, [data-tema="escuro"] .bolha .m-doc { color: #e9edef; }
[data-tema="escuro"] .bolha .m-doc { background: rgba(0,0,0,.18); }
[data-tema="escuro"] .dia { background: #182229; color: #8696a0; }
[data-tema="escuro"] .wa-play { color: #aebac1; }
[data-tema="escuro"] .wa-tempo { color: #8696a0; }
[data-tema="escuro"] .wa-barra { background: linear-gradient(to right, #00a884 var(--p, 0%), #374248 var(--p, 0%)); }
[data-tema="escuro"] .bolha.eu .wa-barra { background: linear-gradient(to right, #53bdeb var(--p, 0%), #2b6e61 var(--p, 0%)); }
[data-tema="escuro"] .reacao { background: #202c33; }
[data-tema="escuro"] .menu-msg { background: #233138; }
[data-tema="escuro"] .menu-msg .item-menu { color: #d1d7db; }
[data-tema="escuro"] .menu-msg .item-menu:hover, [data-tema="escuro"] .menu-msg .reacoes button:hover { background: #182229; }
[data-tema="escuro"] .menu-msg .reacoes { border-color: #2f3b43; }
[data-tema="escuro"] #resp-barra { background: #1d282f; }
[data-tema="escuro"] .faixa-modo.ia { background: #0e2a35; color: #e9edef; }
[data-tema="escuro"] .faixa-modo.manual { background: #3a2a10; color: #e9edef; }
[data-tema="escuro"] .caixa, [data-tema="escuro"] .prox { border-color: #2a3942; background: #182229; }
[data-tema="escuro"] .campo b { color: #e9edef; }
[data-tema="escuro"] th { background: #202c33; color: #8696a0; }
[data-tema="escuro"] th, [data-tema="escuro"] td { border-color: #222d34; }
[data-tema="escuro"] tr:hover td { background: #182229; }
[data-tema="escuro"] .enc-item { border-color: #222d34; }
[data-tema="escuro"] .emojis button:hover { background: #2a3942; }
.pilulas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.pilula { white-space: nowrap; flex-shrink: 0; }

/* ===== gravação de áudio, reações recebidas, citações ===== */
.gravando { background: #f0f2f5; min-height: 62px; display: flex; align-items: center; justify-content: flex-end; gap: 14px; padding: 5px 16px; }
.gravando .ico { border: none; background: none; color: #54656f; cursor: pointer; padding: 8px; display: flex; }
.gravando .ponto { width: 10px; height: 10px; border-radius: 50%; background: #ea0038; animation: pisca 1s infinite; }
#grav-tempo { font-size: 15px; color: #3b4a54; min-width: 40px; font-variant-numeric: tabular-nums; }
.grav-onda { width: 160px; height: 20px; background: repeating-linear-gradient(90deg, #8696a0 0 2px, transparent 2px 5px); mask: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent); opacity: .6; }
.enviar-voz { border: none; border-radius: 50%; width: 46px; height: 46px; background: #00a884; color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; }
@keyframes pisca { 50% { opacity: .25; } }
.reacao small { font-size: 11px; color: #667781; margin-left: 2px; }
.citacao-msg { --cor: #06cf9c; background: rgba(0,0,0,.05); border-left: 4px solid var(--cor); border-radius: 6px; padding: 5px 8px; margin: 2px 0 5px; cursor: pointer; display: flex; flex-direction: column; font-size: 13px; max-width: 100%; }
.citacao-msg b { color: var(--cor); font-weight: 500; }
.citacao-msg span { color: #667781; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; white-space: pre-wrap; }
.bolha.piscar { animation: destaque 1.6s; }
@keyframes destaque { 0%, 60% { filter: brightness(.85); } }
[data-tema="escuro"] .gravando { background: #202c33; }
[data-tema="escuro"] #grav-tempo { color: #e9edef; }
[data-tema="escuro"] .citacao-msg { background: rgba(0,0,0,.2); }
[data-tema="escuro"] .citacao-msg span, [data-tema="escuro"] .reacao small { color: #aebac1; }

/* logo da Lyds (troca de versão conforme o tema) */
.marca { display: flex; align-items: center; gap: 10px; }
.marca .logo { height: 24px; width: auto; display: block; }
.login-card .marca .logo { height: 34px; }
.marca .logo-escuro { display: none; }
[data-tema="escuro"] .marca .logo-claro { display: none; }
[data-tema="escuro"] .marca .logo-escuro { display: block; }
.marca span { border-left: 1px solid var(--linha); padding-left: 10px; }

/* ================================================================ celular (até 760px)
   Conversas no estilo WhatsApp: lista em tela cheia; ao tocar, abre o chat com "voltar";
   o painel do lead abre como folha por baixo. No computador nada muda. */
.so-celular { display: none !important; }
@media (max-width: 760px) {
  body { font-size: 15px; }
  input, select, textarea { font-size: 16px !important; } /* sem zoom automático no iPhone */
  .so-celular { display: inline-flex !important; }
  .so-celular.hidden { display: none !important; }

  /* login */
  .login { padding: 16px; }
  .login-card { width: 100%; max-width: 380px; padding: 24px 18px; }

  /* topo compacto: marca pequena, abas roláveis numa linha própria */
  .topo { flex-wrap: wrap; height: auto; padding: 6px 10px; gap: 6px 10px; }
  .topo .marca span, #quem { display: none; }
  .topo .marca .logo { height: 22px; }
  .topo-dir { margin-left: auto; gap: 4px; }
  #sel-numero { max-width: 150px; }
  #abas { order: 3; flex: 1 0 100%; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  #abas::-webkit-scrollbar { display: none; }
  #abas a { padding: 10px 10px; }
  main { height: auto; min-height: calc(100dvh - 100px); overflow: visible; }

  /* conversas */
  .conv, .conv.sem-lead { display: block; height: calc(100dvh - 96px); position: relative; }
  .conv .lista { height: 100%; border-right: none; }
  .conv .chat { display: none; height: 100%; }
  .conv.com-chat .lista { display: none; }
  .conv.com-chat .chat { display: flex; }
  .conv .painel-lead { display: none; }
  .conv.com-lead .painel-lead:not(.hidden) {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 72dvh; z-index: 15;
    border-left: none; border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.25); padding-bottom: 24px; }
  .chat-topo { padding: 6px 8px; gap: 8px; min-height: 52px; }
  .chat-topo .quem { min-width: 0; flex: 1; }
  .chat-topo .quem b, .chat-topo .quem span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #btn-voltar { border: none; background: none; color: inherit; padding: 6px; cursor: pointer; }
  .chat-msgs { padding: 10px 3%; }
  .bolha { max-width: 86%; }
  .bolha .m-img, .bolha .m-video { max-width: 100%; height: auto; }
  .wa-audio { width: 240px; }
  .compor { padding: 4px 6px; gap: 4px; min-height: 56px; }
  .compor .ico, .compor .enviar { padding: 6px; }
  .faixa-modo { flex-wrap: wrap; padding: 6px 10px; }
  .pilulas { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .pilulas::-webkit-scrollbar { display: none; }
  .pilula { flex-shrink: 0; }
  .lista-topo { flex-direction: column; align-items: stretch; }
  #filtro { max-width: none; }
  .menu-msg { max-width: 92vw; }

  /* páginas: tabelas com rolagem lateral, cartões em uma coluna */
  .pagina { padding: 12px 10px; }
  .pagina h2 { font-size: 18px; }
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  td, th { white-space: normal; min-width: 90px; }
  .cartoes { grid-template-columns: 1fr; }
  .passo { grid-template-columns: 1fr 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .filtros > * { flex: 1 1 140px; }
  .modal-card { width: 96vw; max-height: 92dvh; padding: 16px 14px; }
  .btn { padding: 8px 12px; }
  .btn.mini { padding: 4px 9px; }
  .toast { bottom: 12px; max-width: 92vw; }
}

/* filtros da lista (Tudo, Leads, Grupos, Em fluxo, Manual): ocupam a linha inteira, sem corte */
#filtro.pilulas { max-width: none; flex: none; flex-wrap: wrap; }
@media (max-width: 760px) { #filtro.pilulas { flex-wrap: wrap; overflow: visible; gap: 6px; } #filtro.pilulas .pilula { padding: 5px 11px; } }