/* Central de atendimento · complementa o app.css do painel de gestão (mesma paleta e fontes) */
.main.cheia { padding: 0; height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.main.cheia > .topo-cx { padding: 16px 22px 10px; }
.topo-cx { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.topo-cx .sub { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.topo-cx .sub b { background: var(--red-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topo-cx h1 { font-size: 19px; }
.topo-cx .acoes-topo { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Centrais na barra lateral */
.centrais button .qt { margin-left: auto; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 18px; height: 18px; display: grid; place-items: center; padding: 0 5px; }

/* Três painéis: lista | conversa | ficha */
.cx { flex: 1; min-height: 0; display: grid; grid-template-columns: 340px minmax(0, 1fr) 330px; border-top: 1px solid var(--line); }
.cx > section { min-height: 0; display: flex; flex-direction: column; }
.pn-lista { border-right: 1px solid var(--line); background: var(--side-bg); }
.pn-ficha { border-left: 1px solid var(--line); background: var(--side-bg); overflow: auto; padding: 16px; }
.pn-lista .ferr { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.pn-lista .ferr .chips { gap: 4px; }
.pn-lista .ferr .chip { padding: 4px 10px; font-size: 12px; }
.lista-conv { overflow: auto; flex: 1; }
.conv { display: grid; grid-template-columns: 42px 1fr auto; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.conv:hover { background: var(--hover); }
.conv.on { background: var(--surface-2); box-shadow: inset 3px 0 0 var(--cor, var(--red)); }
.conv .av { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; font: 700 14px Montserrat, sans-serif; color: #fff; background: var(--cor, #7C8BA5); }
.conv .meio { min-width: 0; }
.conv .nm { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .ult { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv .lado { display: grid; justify-items: end; gap: 4px; font-size: 11px; color: var(--ink-3); }
.conv .nl { background: var(--good); color: #fff; font-size: 10.5px; font-weight: 700; border-radius: 999px; min-width: 19px; height: 19px; display: grid; place-items: center; padding: 0 5px; }
.conv.nova .nm { color: var(--ink); }
.etq { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 600; border-radius: 6px; padding: 1px 6px; border: 1px solid currentColor; white-space: nowrap; }
.mini-linha { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 4px; align-items: center; }
.dono { font-size: 11px; color: var(--ink-2); }

/* Conversa */
.pn-chat { background: transparent; }
.chat-topo { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); flex-wrap: wrap; background: var(--side-bg); }
.chat-topo .quem { min-width: 0; flex: 1 1 220px; }
.chat-topo .quem b { font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-topo .sel { min-height: 32px; padding: 4px 10px; font-size: 12.5px; }
.msgs { flex: 1; overflow: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 6px; }
.dia { align-self: center; font-size: 11px; color: var(--ink-3); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; margin: 8px 0; }
.bolha { max-width: min(72%, 560px); padding: 8px 12px 6px; border-radius: 16px; white-space: pre-wrap; word-wrap: break-word; line-height: 1.45; position: relative; }
.bolha.in { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bolha.out { align-self: flex-end; background: color-mix(in srgb, var(--cor, #C2187A) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--cor, #C2187A) 35%, transparent); border-bottom-right-radius: 5px; }
.bolha.nota { align-self: center; max-width: 80%; background: rgba(232, 184, 74, .10); border: 1px dashed rgba(232, 184, 74, .55); font-size: 13px; }
.bolha .rod { display: flex; justify-content: flex-end; gap: 6px; font-size: 10.5px; color: var(--ink-3); margin-top: 3px; white-space: nowrap; }
.bolha .rod .lido { color: #4FB6FF; }
.bolha .rod .entregue { color: var(--ink-3); }
.bolha .rod .falhou { color: var(--bad); }
.bolha .autor { font-size: 11px; font-weight: 600; color: var(--ink-2); margin-bottom: 2px; }
.bolha img.midia { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin-bottom: 4px; }
.bolha audio, .bolha video { max-width: 100%; display: block; margin-bottom: 4px; }
.bolha .erro-env { color: var(--bad); font-size: 11.5px; }
.janela { margin: 0 16px 8px; padding: 9px 12px; border-radius: 12px; font-size: 12.5px; background: rgba(255, 90, 110, .08); border: 1px solid rgba(255, 90, 110, .35); }
.compor { border-top: 1px solid var(--line); padding: 10px 14px 12px; display: grid; gap: 8px; position: relative; background: var(--side-bg); }
.compor.nota textarea { border-color: rgba(232, 184, 74, .7); background: rgba(232, 184, 74, .06); }
.compor .linha { display: flex; gap: 8px; align-items: flex-end; }
.compor textarea { flex: 1; resize: none; min-height: 44px; max-height: 160px; border-radius: 14px; padding: 11px 14px; background: var(--surface); border: 1px solid var(--line-2); outline: none; line-height: 1.4; }
.compor textarea:focus { border-color: rgba(240, 16, 46, .7); box-shadow: 0 0 0 3px rgba(240, 16, 46, .15); }
.compor .opc { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--ink-3); flex-wrap: wrap; }
.compor .opc label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.atalhos { position: absolute; bottom: calc(100% - 4px); left: 14px; right: 14px; max-height: 260px; overflow: auto; background: var(--tip-bg); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); z-index: 5; }
.atalhos button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 12px; cursor: pointer; }
.atalhos button:hover, .atalhos button.on { background: var(--surface-2); }
.atalhos b { color: var(--red); margin-right: 6px; }
.atalhos span { color: var(--ink-2); font-size: 12.5px; }
.vazio-chat { flex: 1; display: grid; place-items: center; text-align: center; color: var(--ink-3); padding: 30px; }
.vazio-chat .grande { font: 300 24px Montserrat, sans-serif; color: var(--ink-2); margin-bottom: 6px; }

/* Ficha */
.pn-ficha h3 { font: 600 11px Inter, sans-serif; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); margin: 18px 0 8px; }
.pn-ficha h3:first-child { margin-top: 0; }
.ficha-cli { display: flex; gap: 12px; align-items: center; }
.ficha-cli .avatar { width: 46px; height: 46px; font-size: 16px; color: #fff; }
.ficha-num { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.ficha-num div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 9px 10px; }
.ficha-num span { display: block; font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .07em; }
.ficha-num b { font: 700 16px Montserrat, sans-serif; font-variant-numeric: tabular-nums; }
.compra { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.compra:last-child { border: 0; }
.compra .t { display: flex; justify-content: space-between; gap: 8px; }
.campo { display: grid; gap: 4px; font-size: 11.5px; color: var(--ink-3); margin-bottom: 9px; }
.campo .inp, .campo textarea { width: 100%; min-height: 34px; padding: 6px 10px; font-size: 13px; }
.campo textarea { background: var(--surface); border: 1px solid var(--line-2); border-radius: 12px; resize: vertical; outline: none; }
.nao-cliente { padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); font-size: 13px; }

/* Kanban */
.kb-wrap { flex: 1; min-height: 0; overflow: auto; padding: 4px 22px 22px; }
.kb { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; min-height: 100%; }
.kb-col { background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 10px; display: flex; flex-direction: column; min-height: 200px; }
.kb-col.alvo { outline: 2px dashed var(--red); outline-offset: -4px; }
.kb-col header { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; }
.kb-col header b { font: 600 12.5px Inter, sans-serif; }
.kb-col header .peq { margin-left: auto; }
.kb-cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-content: start; flex: 1; }
.kb-card { min-width: 0; touch-action: pan-y; user-select: none; background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--cor, #7C8BA5); border-radius: 12px; padding: 10px; cursor: grab; font-size: 13px; }
.kb-card:hover { border-color: var(--line-2); }
.kb-card.arrastando { opacity: .45; }
.kb-card .nm { font-weight: 600; display: flex; justify-content: space-between; gap: 6px; }
.kb-card .ult { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 3px 0 6px; }

/* Páginas simples (respostas, configurações) */
.pag { flex: 1; overflow: auto; padding: 4px 22px 40px; }
.lista-resp { display: grid; gap: 8px; }
.resp { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: start; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.resp b { color: var(--red); }
.resp .tx { white-space: pre-wrap; color: var(--ink-2); font-size: 13px; }
.passos li { margin-bottom: 6px; }
.ok-c { color: var(--good); font-weight: 600; } .no-c { color: var(--bad); font-weight: 600; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: 12.5px; word-break: break-all; }
.demo-faixa { background: repeating-linear-gradient(45deg, rgba(232, 184, 74, .14) 0 12px, transparent 12px 24px); border-bottom: 1px solid rgba(232, 184, 74, .4); font-size: 12px; padding: 5px 22px; color: var(--ink-2); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* Celular: um painel por vez */
.voltar { display: none; }
@media (max-width: 1180px) { .cx { grid-template-columns: 300px minmax(0, 1fr); } .cx > .pn-ficha { display: none; } .cx.com-ficha > .pn-ficha { display: block; position: fixed; inset: 0 0 0 auto; width: min(360px, 92vw); z-index: 35; box-shadow: -10px 0 40px rgba(0, 0, 0, .35); } .so-estreito { display: inline-flex !important; } }
.so-estreito { display: none !important; }
@media (max-width: 860px) {
  .main.cheia { height: calc(100vh - 64px); height: calc(100dvh - 64px - env(safe-area-inset-bottom)); }
  .main.cheia > .topo-cx { padding: 12px 14px 8px; }
  .cx { grid-template-columns: minmax(0, 1fr); }
  .cx > * { min-width: 0; }
  .cx .pn-chat { display: none; }
  .cx.aberta .pn-lista { display: none; }
  .cx.aberta .pn-chat { display: flex; }
  .voltar { display: inline-flex; }
  .bolha { max-width: 86%; }
  .msgs { padding: 14px 12px; }
  .kb-wrap, .pag { padding: 4px 14px 22px; }
  .resp { grid-template-columns: 1fr; }
  .tabbar { grid-template-columns: repeat(4, 1fr); }
}
/* Celular com conversa aberta: esconde o topo para sobrar espaço para as mensagens */
@media (max-width: 860px) {
  .main.cheia:has(.cx.aberta) > .topo-cx, .main.cheia:has(.cx.aberta) > .faixa-negocio, .main.cheia:has(.cx.aberta) > .demo-faixa { display: none; }
  .chat-topo { gap: 6px; padding: 8px 10px; }
  .chat-topo .quem { flex: 1 1 55%; }
  .chat-topo .sel { flex: 1 1 40%; min-width: 0; }
  .compor .opc { font-size: 11.5px; }
}

/* Aparelhos por QR code */
.aparelhos { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ap { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line-2); border-left: 4px solid var(--cor); flex-wrap: wrap; }
.ap-info { min-width: 0; flex: 1 1 160px; }
.ap-qr { display: grid; justify-items: center; gap: 6px; }
.ap-qr img { width: 210px; height: 210px; background: #fff; padding: 8px; border-radius: 12px; image-rendering: pixelated; }

/* Tema dia: logo próprio (letras escuras e X vermelho), sem o filtro de inversão do painel */
:root[data-theme="light"] .side .logo img, :root[data-theme="light"] .login img { filter: none; }

/* Etiquetas coloridas, departamentos, anotações e "falando agora" */
.etq-cor { color: var(--c); border-color: color-mix(in srgb, var(--c) 55%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
button.etq-x { cursor: pointer; font: 600 10.5px Inter, sans-serif; }
.amostra { display: inline-block; width: 46px; height: 18px; border-radius: 6px; border: 1px solid var(--line-2); }
.filtro-duplo { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.filtro-duplo .sel { min-height: 32px; padding: 4px 8px; font-size: 12px; min-width: 0; }
.vivo { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #2FBF71; margin-right: 6px; vertical-align: middle; box-shadow: 0 0 0 0 rgba(47, 191, 113, .6); animation: vivo 1.6s infinite; }
@keyframes vivo { 70% { box-shadow: 0 0 0 8px rgba(47, 191, 113, 0); } 100% { box-shadow: 0 0 0 0 rgba(47, 191, 113, 0); } }
@media (prefers-reduced-motion: reduce) { .vivo { animation: none; } }
.vivo-cont { font-size: 12.5px; display: inline-flex; align-items: center; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); }
.vivo-cont b { margin-right: 4px; color: var(--good); }
.anot-nova { display: grid; gap: 6px; }
.anot-nova textarea { min-height: 54px; resize: vertical; font-size: 13px; }
.anot-nova .btn { justify-self: start; }
.anot { padding: 9px 10px; margin-top: 8px; border-radius: 12px; background: rgba(232, 184, 74, .08); border: 1px solid rgba(232, 184, 74, .35); font-size: 13px; }
.anot .tx { white-space: pre-wrap; margin-bottom: 4px; }
.link-mini { background: none; border: 0; padding: 0; color: var(--ink-2); text-decoration: underline; cursor: pointer; font-size: 11.5px; }

/* Aviso de pedido do site dentro da conversa */
.bolha.pedido { align-self: center; max-width: 86%; background: rgba(47, 191, 113, .10); border: 1px solid rgba(47, 191, 113, .5); font-size: 13px; }
.bolha.pedido .autor { color: var(--good); }

/* Minha equipe */
.deps-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; }
.dep-op { display: flex; gap: 8px; align-items: center; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 13px; color: var(--ink); cursor: pointer; }

/* ===== Estética da lista: pílulas preenchidas, avatar redondo neutro, mais respiro ===== */
.conv { grid-template-columns: 46px 1fr auto; gap: 12px; padding: 14px 16px; border-bottom: 0; }
.conv + .conv { box-shadow: inset 0 1px 0 var(--line); }
.conv .av { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); color: var(--ink-2); font-size: 12.5px; border: 1px solid var(--line-2); }
.conv .nm { font-size: 14.5px; font-weight: 700; }
.conv .ult { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.conv.on { background: color-mix(in srgb, var(--surface-2) 85%, transparent); box-shadow: inset 3px 0 0 var(--cor, var(--red)); }
.conv .mini-linha { gap: 6px; margin-top: 7px; }
.etq { border: 0; border-radius: 999px; padding: 3px 10px; font-size: 10.5px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; background: color-mix(in srgb, currentColor 15%, transparent); line-height: 1.5; }
.etq-cor { color: var(--c); background: color-mix(in srgb, var(--c) 17%, transparent); border: 0; }
button.etq-x { border: 0; }
.chip-esc { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); white-space: nowrap; line-height: 1.5; }
.chip-esc svg { flex: none; opacity: .85; }
.chip-zap { color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface-2)); border-color: color-mix(in srgb, var(--c) 30%, transparent); }
.chip-pessoa { color: #F5A524; background: rgba(245, 165, 36, .10); border-color: rgba(245, 165, 36, .28); }
.chip-pessoa.vazio-at { color: var(--ink-3); background: transparent; border-style: dashed; }
:root[data-theme="light"] .chip-pessoa { color: #A86B00; }
.dono { display: none; }
.kb-card .etq, .pn-ficha .etq { text-transform: uppercase; }

/* Consultor da ficha */
.selos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.selo { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }
.selo.vip { background: rgba(232, 184, 74, .16); color: var(--gold); }
.selo.rec { background: rgba(139, 77, 255, .16); color: #B693FF; }
.selo.risco { background: rgba(255, 90, 110, .14); color: var(--bad); }
.selo.quente { background: rgba(47, 191, 113, .14); color: var(--good); }
.selo.novo { background: rgba(143, 211, 255, .14); color: #8FD3FF; }
:root[data-theme="light"] .selo.rec { color: #6A35D6; } :root[data-theme="light"] .selo.novo { color: #1F7FB8; }
.compra.extra { display: none; }
.sugs { display: grid; gap: 6px; }
.sug-c { padding: 9px 10px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; }
.sug-c .t { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 3px; font-size: 13px; }
.sug-c.on { border-color: var(--red); box-shadow: 0 0 0 3px rgba(240, 16, 46, .12); }
.abordagem { width: 100%; min-height: 150px; font-size: 13px; line-height: 1.45; resize: vertical; }
/* Kanban no mesmo estilo da lista */
.kb-col { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
.kb-card { border-radius: 14px; padding: 12px; border-left-width: 3px; }
.kb-card .nm { font-size: 13.5px; font-weight: 700; }
.kb-card .mini-linha { gap: 5px; margin-top: 6px; }

/* Conversa no estilo WhatsApp: foto, cabeçalho, "Enviado por", formatação */
.foto-av { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block; }
.conv .av, .av-topo, .ficha-cli .avatar { overflow: hidden; }
.av-topo { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; font: 700 13px Montserrat, sans-serif; color: var(--ink-2); flex: none; }
.chat-topo .linha-nome { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-topo .linha-nome b { font-size: 16px; }
.chat-topo .quem .peq { display: inline-flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 3px; font-size: 13px; color: var(--ink-2); }
.ficha-cli .avatar { border-radius: 50%; }
.msgs { gap: 4px; }
.bolha { font-size: 14px; }
.bolha.out { background: color-mix(in srgb, var(--cor, #C2187A) 30%, var(--surface)); border-color: color-mix(in srgb, var(--cor, #C2187A) 45%, transparent); }
.bolha.out + .por { margin-bottom: 6px; }
.por { align-self: flex-end; font-size: 10.5px; font-style: italic; color: var(--ink-3); margin: 1px 4px 0; }
.bolha code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; background: rgba(0, 0, 0, .18); padding: 1px 5px; border-radius: 5px; }

/* Menu ⋮ da conversa */
.menu-wrap { position: relative; }
.menu-conv { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 250px; padding: 6px; border-radius: 14px; background: var(--tip-bg); border: 1px solid var(--line-2); box-shadow: 0 14px 40px rgba(0, 0, 0, .35); }
.menu-conv button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; padding: 9px 12px; border-radius: 10px; cursor: pointer; font: 500 14px Inter, sans-serif; color: var(--ink); }
.menu-conv button:hover { background: var(--surface-2); }
.menu-conv svg { color: var(--good); flex: none; }
.pn-ficha.pisca { box-shadow: inset 0 0 0 2px var(--red); transition: box-shadow .3s; }
.etq-escolha { display: flex; flex-wrap: wrap; gap: 8px; max-height: 50vh; overflow: auto; }
.etq-escolha label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

/* Contatos */
.segs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.segs .chip b { font-variant-numeric: tabular-nums; margin-left: 4px; opacity: .8; }
.filtros-ct { display: grid; grid-template-columns: 2fr repeat(4, 1fr); gap: 8px; }
.filtros-ct .inp, .filtros-ct .sel { min-width: 0; width: 100%; }
.tab-ct td { vertical-align: middle; }
.ct-nome { display: flex; gap: 10px; align-items: center; min-width: 200px; }
.ct-nome .av { width: 38px; height: 38px; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; font: 700 12px Montserrat, sans-serif; color: var(--ink-2); overflow: hidden; flex: none; }
.menu-conv.ct { right: 0; min-width: 210px; }
@media (max-width: 1100px) { .filtros-ct { grid-template-columns: 1fr 1fr; } .filtros-ct .inp { grid-column: 1 / -1; } }

/* Busca na base de clientes, dentro da caixa de entrada */
.sep-base { padding: 10px 16px 4px; font: 600 11px Inter, sans-serif; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3); border-top: 1px solid var(--line); }
.conv.base .ult { color: var(--ink-2); }

/* Cartão da conversa em 2 linhas fixas: etiquetas lado a lado; número + departamento + etapa + atendente lado a lado */
.conv .mini-linha { flex-wrap: nowrap; overflow: hidden; gap: 5px; margin-top: 6px;
  -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.conv .mini-linha > * { flex: none; }
.conv .etq, .conv .chip-esc { font-size: 10px; padding: 2px 8px; }
.conv .chip-esc svg { width: 11px; height: 11px; }
.conv .selo { font-size: 10px; padding: 2px 8px; }
@media (min-width: 1281px) { .cx { grid-template-columns: 380px minmax(0, 1fr) 330px; } }

/* Buscar ou filtrar + Nova conversa */
.barra-cx { display: flex; gap: 8px; justify-content: space-between; }
.barra-cx .btn { flex: 1; justify-content: center; gap: 6px; }
.qt-f { background: var(--red); color: #fff; border-radius: 999px; font-size: 10px; min-width: 17px; height: 17px; display: inline-grid; place-items: center; padding: 0 4px; }
.seg-bt { display: inline-flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg-bt label { display: flex; cursor: pointer; }
.seg-bt input { display: none; }
.seg-bt span { padding: 7px 14px; font: 600 12px Inter, sans-serif; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.seg-bt input:checked + span { background: rgba(240, 16, 46, .14); color: var(--red); }
.duas-datas { display: flex; gap: 8px; align-items: center; }
.duas-datas .inp { flex: 1; }
.nc-res { margin-top: 6px; max-height: 240px; overflow: auto; display: grid; gap: 4px; }
.nc-res button { text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; cursor: pointer; color: var(--ink); }
.nc-res button.on { border-color: var(--red); box-shadow: 0 0 0 3px rgba(240, 16, 46, .12); }

/* Menu ⋮ no canto de cima da conversa, bem visível */
.chat-topo { position: relative; padding-right: 64px; }
.chat-topo > .menu-wrap { position: absolute; top: 10px; right: 14px; }
.btn-menu-redondo { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink); font: 700 20px/1 Inter, sans-serif; cursor: pointer; display: grid; place-items: center; }
.btn-menu-redondo:hover { border-color: var(--red); box-shadow: 0 0 0 3px rgba(240, 16, 46, .12); }
.chat-topo .menu-conv { min-width: 300px; }
.barra-cx .btn { white-space: nowrap; font-size: 12px; padding: 5px 8px; }

/* Anexos, gravação de áudio e biblioteca */
.anexos { display: flex; gap: 4px; align-self: flex-end; padding-bottom: 6px; }
.ic-bt { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.ic-bt:hover { background: var(--surface-2); color: var(--ink); }
.opcoes-anexo { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 10px; }
.gravando { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 22px; border-radius: 16px; background: var(--surface-2); font-size: 20px; }
.ponto-rec { width: 14px; height: 14px; border-radius: 50%; background: var(--bad); animation: pulso 1.2s infinite; }
.doc-link { display: inline-flex; gap: 6px; align-items: center; padding: 8px 10px; margin-bottom: 4px; border-radius: 10px; background: rgba(0, 0, 0, .15); text-decoration: none; font-size: 13px; word-break: break-all; }
.grade-bib { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.grade-bib.mini-g { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); max-height: 55vh; overflow: auto; margin-top: 10px; }
.item-bib { padding: 10px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: grid; gap: 6px; align-content: start; }
.item-bib img, .item-bib video { width: 100%; height: 120px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.item-bib audio { width: 100%; }
.item-bib .doc-ic { height: 80px; display: grid; place-items: center; font-size: 34px; background: var(--surface-2); border-radius: 10px; }
.item-bib .nm { font-weight: 600; font-size: 13px; word-break: break-word; }

/* Áudio com velocidade */
.audio-vel { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.audio-vel audio { flex: 1; min-width: 220px; height: 36px; }
.vel { flex: none; min-width: 44px; height: 28px; border-radius: 999px; border: 0; background: rgba(0, 0, 0, .22); color: var(--ink); font: 700 12px Inter, sans-serif; cursor: pointer; }
.vel:hover { background: rgba(0, 0, 0, .35); }

/* Gravador: apertar para gravar, pausar, parar, ouvir e enviar */
.grav { padding: 18px; border-radius: 16px; background: var(--surface-2); display: grid; gap: 14px; justify-items: center; }
.grav-tempo { display: flex; align-items: center; gap: 10px; font-size: 22px; }
.grav-bts { display: flex; gap: 12px; }
.grav-bt { display: grid; justify-items: center; gap: 4px; padding: 10px 16px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; font: 600 12px Inter, sans-serif; }
.grav-bt svg { width: 22px; height: 22px; }
.grav-bt.grande { width: 76px; height: 76px; border-radius: 50%; padding: 0; place-items: center; background: var(--red-grad); color: #fff; border: 0; box-shadow: 0 8px 26px rgba(194, 24, 122, .35); }
.grav-bt.grande svg { width: 32px; height: 32px; }
.grav-bt.parar { color: var(--bad); }
#g-previa { width: 100%; }

/* tudo que está marcado como escondido fica escondido de verdade */
[hidden] { display: none !important; }

/* Responder e apagar */
.bolha { position: relative; }
/* responder/apagar: escondidos; aparecem ao passar o mouse (ou tocar, no celular), ao lado do horário */
.bolha .rod { align-items: center; }
.acoes-msg { display: inline-flex; gap: 1px; margin-right: auto; opacity: 0; visibility: hidden; transition: opacity .15s; }
.bolha:hover .acoes-msg, .bolha.mostrar .acoes-msg, .acoes-msg:focus-within { opacity: 1; visibility: visible; }
.acoes-msg button { width: 24px; height: 24px; border-radius: 50%; border: 0; background: none; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.acoes-msg button:hover { background: var(--surface-2); color: var(--ink); }
.acoes-msg svg { width: 14px; height: 14px; }
.citada { display: grid; gap: 1px; padding: 6px 9px; margin-bottom: 5px; border-radius: 8px; background: rgba(0, 0, 0, .16); border-left: 3px solid var(--red); font-size: 12.5px; color: var(--ink-2); white-space: normal; max-height: 70px; overflow: hidden; }
.citada.dele { border-left-color: var(--good); }
.citada b { color: var(--ink); font-size: 12px; }
.resp-bar { display: flex; align-items: center; gap: 8px; }
.resp-bar .citada { flex: 1; margin: 0; background: var(--surface-2); }
.bolha.apagada { opacity: .7; }
.aviso-ap { font-size: 11px; color: var(--bad); margin-top: 3px; }
.opcoes-apagar { display: grid; gap: 8px; margin: 8px 0 10px; }
.opcoes-apagar .btn { justify-content: center; }

/* Meus aparelhos (chips) */
.tab-chips td { vertical-align: middle; }
.pill-tipo { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: rgba(79, 182, 255, .14); color: #4FB6FF; white-space: nowrap; }
.pill-st { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.pill-st.ok { background: rgba(47, 191, 113, .15); color: var(--good); }
.pill-st.off { background: rgba(255, 90, 110, .15); color: var(--bad); }
.pill-st.esp { background: rgba(232, 184, 74, .16); color: var(--gold); }
.qr-card { margin-top: 14px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.qr-card img { width: 230px; height: 230px; background: #fff; padding: 8px; border-radius: 14px; }

/* ===== Enquadramento de app (iPhone, Android e computador instalado) ===== */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; height: 100%; }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; min-height: 100dvh; }
/* bordas do aparelho: entalhe/câmera em cima, barra de gestos embaixo, laterais no modo deitado */
body { padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left); }
.side { height: 100dvh; height: calc(100dvh - env(safe-area-inset-top)); top: env(safe-area-inset-top); }
.main.cheia { height: 100dvh; height: calc(100dvh - env(safe-area-inset-top)); }
.modal { padding: calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left)); }
.modal > * { max-height: 100%; overflow: auto; }
.toast { bottom: calc(22px + env(safe-area-inset-bottom)); max-width: calc(100vw - 32px); }
@media (max-width: 860px) {
  /* a área útil = tela − barra de status − barra de abas (58 px + barra de gestos) */
  .main.cheia { height: calc(100dvh - env(safe-area-inset-top) - 58px - env(safe-area-inset-bottom)); }
  .tabbar { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .cx.com-ficha > .pn-ficha { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  /* iPhone dá zoom sozinho em campo com letra menor que 16 px e a tela sai do enquadramento */
  input, select, textarea, .inp, .sel, .campo .inp, .campo textarea, .compor textarea, .anot-nova textarea { font-size: 16px !important; }
  .modal { place-items: end center; padding-left: 0; padding-right: 0; padding-bottom: 0; }
  .modal > * { width: 100% !important; max-width: 100% !important; border-radius: 20px 20px 0 0 !important; padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important; }
}
/* computador com tela baixa (notebook): o menu lateral rola por dentro, a página não sobra */
.side { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.side .rodape { margin-top: auto; }

/* ===== Celular com experiência de WhatsApp ===== */
.so-zap, .so-zap-flex { display: none !important; }
.busca-linha { display: flex; gap: 6px; align-items: center; }
.busca-linha .inp { flex: 1; min-width: 0; }
.ctrl-conv { display: contents; }
@media (max-width: 860px) {
  .so-zap { display: inline-grid !important; }
  .so-zap-flex { display: flex !important; }

  /* --- lista de conversas --- */
  .main.cheia:not(:has(.cx.aberta)) > .topo-cx { padding: 10px 16px 4px; }
  .main.cheia > .topo-cx .sub, .main.cheia > .topo-cx .vivo-cont { display: none; }
  .main.cheia > .topo-cx h1 { font-size: 24px; font-weight: 800; }
  .pn-lista { background: var(--bg); border: 0; position: relative; }
  .pn-lista .ferr { border: 0; padding: 4px 14px 8px; gap: 10px; }
  .pn-lista .barra-cx { display: none; }
  .busca-linha .inp { border-radius: 999px; background: var(--surface-2); border-color: transparent; padding: 10px 16px; min-height: 42px; }
  .busca-linha .ic-bt { position: relative; }
  .busca-linha .qt-f { position: absolute; top: 0; right: 0; }
  .pn-lista .ferr .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; gap: 8px; }
  .pn-lista .ferr .chips::-webkit-scrollbar { display: none; }
  .pn-lista .ferr .chip { border-radius: 999px; padding: 6px 14px; font-size: 13.5px; white-space: nowrap; background: var(--surface-2); border-color: transparent; }
  .pn-lista .ferr .chip.on { background: color-mix(in srgb, var(--good) 22%, transparent); color: var(--good); border-color: transparent; }
  .conv { grid-template-columns: 50px 1fr auto; padding: 10px 16px; gap: 14px; align-items: center; }
  .conv + .conv { box-shadow: none; }
  .conv .meio { border-bottom: 1px solid var(--line); padding-bottom: 10px; margin-bottom: -10px; }
  .conv .av { width: 50px; height: 50px; }
  .conv .nm { font-size: 16px; font-weight: 600; }
  .conv .ult { font-size: 14px; color: var(--ink-3); }
  .conv .mini-linha { display: none; }
  .conv .mini-linha:last-child { display: flex; }
  .conv .mini-linha:last-child > :not(.chip-zap) { display: none; }
  .conv .mini-linha:last-child .chip-zap { font-size: 10.5px; padding: 1px 7px; margin-top: 2px; }
  .conv .lado { align-self: start; padding-top: 4px; font-size: 12px; }
  .conv.nova .lado > span:first-child { color: var(--good); font-weight: 600; }
  .conv .nl { min-width: 21px; height: 21px; font-size: 11.5px; }
  .conv.on { box-shadow: none; }
  .fab { position: absolute; right: 16px; bottom: 16px; width: 56px; height: 56px; border-radius: 16px; border: 0; background: var(--good); color: #fff; place-items: center; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); z-index: 5; cursor: pointer; }
  .fab svg { width: 26px; height: 26px; }

  /* --- conversa aberta --- */
  .chat-topo { flex-wrap: nowrap; padding: 6px 8px; gap: 4px; min-height: 58px; }
  .chat-topo .voltar { background: none; border: 0; font-size: 22px; padding: 4px 6px; min-width: 0; }
  .chat-topo .av-topo { width: 40px; height: 40px; flex: none; }
  .chat-topo .quem { flex: 1 1 auto; min-width: 0; cursor: pointer; padding-left: 4px; }
  .chat-topo .quem b { font-size: 16.5px; }
  .chat-topo .quem .linha-nome .etq, .chat-topo .quem .linha-nome .chip-esc { display: none; }
  .chat-topo .quem .peq { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
  .chat-topo .quem .peq .chip-zap { font-size: 10.5px; padding: 0 6px; }
  .chat-topo #ver-ficha { display: none !important; }
  .chat-topo #btn-venda { background: none; border: 0; font-size: 0; padding: 6px; }
  .chat-topo #btn-venda::before { content: "💰"; font-size: 21px; }
  .chat-topo .btn-menu-redondo { background: none; border: 0; font-size: 22px; }
  .ctrl-conv { display: none; }
  .ctrl-conv.aberto { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: absolute; left: 0; right: 0; top: 58px; z-index: 12; padding: 12px; background: var(--side-bg); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0, 0, 0, .3); }
  .ctrl-conv.aberto .sel { min-width: 0; width: 100%; }
  .ctrl-conv.aberto #resolver { grid-column: 1 / -1; min-height: 42px; }
  .pn-chat { position: relative; }
  .menu-conv { max-height: 70dvh; overflow: auto; }

  /* fundo de papel de parede e balões no formato do WhatsApp */
  .msgs { padding: 10px 10px 14px; gap: 3px; background-color: var(--bg);
    background-image: radial-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1.4px), radial-gradient(color-mix(in srgb, var(--ink) 5%, transparent) 1px, transparent 1.4px);
    background-size: 26px 26px, 26px 26px; background-position: 0 0, 13px 13px; }
  .bolha { max-width: 84%; padding: 6px 9px 4px; border-radius: 10px; font-size: 15px; line-height: 1.38; box-shadow: 0 1px 1px rgba(0, 0, 0, .18); border: 0; }
  .bolha.in { border-top-left-radius: 3px; }
  .bolha.out { border-top-right-radius: 3px; border-bottom-right-radius: 10px; background: color-mix(in srgb, var(--cor, #C2187A) 30%, var(--surface)); }
  .bolha.in { border-bottom-left-radius: 10px; }
  .bolha .rod { font-size: 11px; margin-top: 1px; }
  .bolha .rod .lido { color: #53BDEB; }
  .bolha.nota, .bolha.pedido { border-radius: 10px; }

  /* caixa de escrever: barra arredondada + botão redondo de microfone/enviar */
  .compor { border: 0; background: transparent; padding: 6px 6px calc(6px + env(safe-area-inset-bottom) * 0); gap: 4px; }
  .pn-chat .compor { background: var(--bg); }
  .compor .opc { display: none; }
  .compor .linha { position: relative; align-items: flex-end; gap: 6px; }
  .compor .anexos { display: contents; }
  .compor textarea { order: 1; border-radius: 24px; min-height: 48px; padding: 13px 16px 13px 112px; background: var(--surface); border: 0; box-shadow: 0 1px 1px rgba(0, 0, 0, .18); }
  .compor textarea:focus { box-shadow: 0 1px 1px rgba(0, 0, 0, .18); }
  .compor .ic-bt { width: 36px; height: 42px; }
  .compor .ic-bt.on { color: var(--gold, #E8B84A); }
  /* atalhos dentro da barra, à esquerda: arquivo, respostas rápidas, nota */
  .compor #bt-clipe, .compor #bt-raio, .compor #bt-nota { position: absolute; bottom: 3px; z-index: 2; }
  .compor #bt-raio { left: 4px; } .compor #bt-clipe { left: 40px; } .compor #bt-nota { left: 76px; }
  #enviar, .compor #bt-mic { order: 2; width: 48px; height: 48px; min-width: 48px; border-radius: 50%; padding: 0; display: grid; place-items: center; background: var(--good); color: #fff; border: 0; flex: none; }
  /* sem texto: o botão redondo é o microfone; com texto, vira enviar (como no WhatsApp) */
  .compor:not(.tem-texto) #enviar { display: none; }
  .compor.tem-texto #bt-mic { display: none; }
  .compor.nota textarea { background: color-mix(in srgb, #E8B84A 14%, var(--surface)); }
}
@media (max-width: 860px) {
  .main.cheia > .topo-cx { flex-wrap: nowrap; }
  .main.cheia > .topo-cx > div:first-child { flex: 1; min-width: 0; }
  .main.cheia > .topo-cx .acoes-topo { flex-wrap: nowrap; gap: 2px; }
  .main.cheia > .topo-cx .acoes-topo #btn-avisos, .main.cheia > .topo-cx .acoes-topo .btn-tema { background: none; border: 0; padding: 6px 7px; font-size: 18px; }
  .main.cheia > .topo-cx .acoes-topo .btn-instalar { font-size: 12px; border: 1px solid var(--line-2); border-radius: 999px; padding: 5px 10px; }
}
@media (max-width: 860px) {
  /* conversa aberta ocupa a tela toda, sem a barra de abas (igual ao WhatsApp) */
  body:has(.cx.aberta) .tabbar { display: none; }
  .main.cheia:has(.cx.aberta) { height: calc(100dvh - env(safe-area-inset-top)); }
  .pn-chat .compor { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
}
@media (max-width: 860px) {
  .chat-topo > .menu-wrap { position: relative !important; inset: auto !important; flex: none; margin: 0; }
  .chat-topo #btn-venda { flex: none; width: 40px; justify-content: center; }
  .chat-topo .menu-conv { right: 0; left: auto; }
}
@media (max-width: 860px) {
  /* voltar: grande e destacado, fácil de acertar com o dedo */
  .chat-topo .voltar { display: grid !important; place-items: center; width: 42px; height: 42px; min-width: 42px; padding: 0; border-radius: 50%; flex: none;
    background: color-mix(in srgb, var(--red) 16%, var(--surface-2)); border: 1px solid color-mix(in srgb, var(--red) 45%, transparent); color: var(--ink); margin-right: 4px; }
  .chat-topo .voltar svg { width: 22px; height: 22px; stroke-width: 2.6; }
  .chat-topo .voltar:active { transform: scale(.92); }
  /* microfone/enviar longe da borda do celular */
  .compor .linha { padding-right: calc(4px + env(safe-area-inset-right)); padding-left: env(safe-area-inset-left); }
  .pn-chat .compor { padding-left: 8px; padding-right: 8px; }
  .compor textarea { min-width: 0; }
}
.compor { grid-template-columns: minmax(0, 1fr); }
.compor > * { min-width: 0; }

/* toque rápido na lista (sem atraso de duplo toque) e retorno visual imediato */
.conv { touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.conv:active { background: var(--surface-2); }
@media (hover: none) { .conv:hover { background: transparent; } .conv:active { background: var(--surface-2); } }
.carregando-conv { margin: auto; display: flex; gap: 6px; }
.carregando-conv span { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-3); animation: pisca-conv 1s infinite ease-in-out; }
.carregando-conv span:nth-child(2) { animation-delay: .15s; } .carregando-conv span:nth-child(3) { animation-delay: .3s; }
@keyframes pisca-conv { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* ===== Ajustes finos para iOS e Android atuais ===== */
/* toques: sem menu de copiar em botões, sem atraso de duplo toque */
button, .btn, .chip, .tabbar a, .ic-bt, .fab, .menu-conv button { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
/* rolagem suave e sem "puxar" a página inteira junto */
.lista-conv, .msgs, .pn-ficha, .menu-conv, .modal > * { overscroll-behavior: contain; }
/* barra de rolagem fininha no Android/computador */
.lista-conv, .msgs { scrollbar-width: thin; }
@media (max-width: 860px) {
  /* teclado aberto: a conversa ocupa só a área visível, a caixa de escrever fica colada no teclado */
  body.teclado .main.cheia:has(.cx.aberta) { height: calc(var(--vv-h, 100dvh) - env(safe-area-inset-top)); }
  body.teclado .pn-chat .compor { padding-bottom: 6px; }
  body.teclado .tabbar { display: none; }
}
/* quem pediu menos animação no celular */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
/* contraste alto (acessibilidade do iOS/Android) */
@media (prefers-contrast: more) { .conv .ult, .peq, .bolha .rod { color: var(--ink-2); } }
/* botão de enviar verde (mesmo verde do ícone do app) e no alinhamento da caixa de escrever */
#enviar, .compor #bt-mic { background: linear-gradient(160deg, #139A4B, #0B7A3A) !important; color: #fff; box-shadow: 0 4px 14px rgba(11, 122, 58, .35); }
#enviar:hover { filter: brightness(1.08); }
@media (min-width: 861px) {
  .compor .linha { align-items: flex-end; }
  #enviar { width: 44px; height: 44px; min-width: 44px; padding: 0; border-radius: 14px; display: grid; place-items: center; align-self: flex-end; margin: 0; }
  .compor #bt-mic { background: none !important; color: inherit; box-shadow: none; }
}

/* aparelhos de uma empresa, recuados embaixo dela */
.negocios .arvore button.sub-ap { padding-left: 34px; font-size: 12.5px; opacity: .9; }

/* ===== Tema dia: colunas em cinza-claro, conversa branca com pontinhos ===== */
:root[data-theme="light"] { --cinza-sec: #F3F3F6; --cinza-sec-2: #ECECF1; --linha-sec: #E2E2E9; }
:root[data-theme="light"] .msgs {
  background-color: #FFFFFF;
  background-image: radial-gradient(rgba(26, 19, 38, .08) 1px, transparent 1.4px), radial-gradient(rgba(26, 19, 38, .05) 1px, transparent 1.4px);
  background-size: 26px 26px, 26px 26px; background-position: 0 0, 13px 13px;
}
:root[data-theme="light"] .pn-chat { background: #FFFFFF; }
:root[data-theme="light"] .bolha.in { background: var(--cinza-sec); border: 1px solid var(--linha-sec); box-shadow: 0 1px 1px rgba(26, 19, 38, .06); }
:root[data-theme="light"] .bolha.out { box-shadow: 0 1px 1px rgba(26, 19, 38, .08); }
:root[data-theme="light"] .dia { background: var(--cinza-sec); }
@media (min-width: 861px) {
  :root[data-theme="light"] .side { background: var(--cinza-sec-2); border-right-color: var(--linha-sec); backdrop-filter: none; }
  :root[data-theme="light"] .main.cheia { background: var(--cinza-sec); }
  :root[data-theme="light"] .main.cheia > .topo-cx { background: var(--cinza-sec); border-bottom: 1px solid var(--linha-sec); }
  :root[data-theme="light"] .pn-lista { background: var(--cinza-sec); border-right-color: var(--linha-sec); }
  :root[data-theme="light"] .pn-lista .ferr { border-bottom-color: var(--linha-sec); }
  :root[data-theme="light"] .pn-ficha { background: var(--cinza-sec); border-left-color: var(--linha-sec); }
  :root[data-theme="light"] .chat-topo, :root[data-theme="light"] .compor { background: var(--cinza-sec); border-color: var(--linha-sec); }
  :root[data-theme="light"] .conv:hover { background: var(--cinza-sec-2); }
  :root[data-theme="light"] .conv.on { background: #FFFFFF; }
  :root[data-theme="light"] .conv + .conv { box-shadow: inset 0 1px 0 var(--linha-sec); }
  :root[data-theme="light"] .pn-lista .chip:not(.on), :root[data-theme="light"] .pn-lista .btn.sec { background: #FFFFFF; }
  :root[data-theme="light"] .vazio-chat { background: transparent; }
}
/* celular no tema dia: lista branca como no WhatsApp, topo e barra de escrever em cinza-claro */
@media (max-width: 860px) {
  :root[data-theme="light"] .pn-lista, :root[data-theme="light"] .main.cheia { background: #FFFFFF; }
  :root[data-theme="light"] .chat-topo { background: var(--cinza-sec); }
  :root[data-theme="light"] .pn-chat .compor { background: #FFFFFF; }
  :root[data-theme="light"] .compor textarea { background: var(--cinza-sec); }
}

/* Meu perfil */
.perfil-pag { display: grid; gap: 14px; max-width: 900px; }
.perfil-quem .sel { margin-top: 4px; max-width: 360px; }
.perfil-foto-linha { display: flex; gap: 22px; align-items: center; margin: 10px 0 18px; flex-wrap: wrap; }
.perfil-foto { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font: 700 34px Montserrat, sans-serif; color: var(--ink-2); flex: none; }
.perfil-foto img, .eu-foto img { width: 100%; height: 100%; object-fit: cover; }
.acoes-foto { display: flex; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.btn.perigo { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 55%, transparent); }
.eu-perfil { display: flex; gap: 10px; align-items: center; text-decoration: none; margin-top: 10px; padding: 6px; border-radius: 12px; }
.eu-perfil:hover { background: var(--hover); }
.eu-perfil b { display: block; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.eu-perfil small { font-size: 11px; color: var(--ink-3); }
.eu-foto { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-2); font: 700 12px Montserrat, sans-serif; color: var(--ink-2); flex: none; }

/* cartão da pessoa logada, abaixo da marca */
.side .logo { padding-bottom: 10px; }
.eu-cartao { display: flex; gap: 10px; align-items: center; margin: 0 4px 16px; padding: 8px 10px; border-radius: 14px; text-decoration: none; background: var(--surface-2); border: 1px solid var(--line); }
.eu-cartao:hover { border-color: var(--line-2); }
.eu-cartao .eu-foto { width: 40px; height: 40px; }
.eu-txt { min-width: 0; display: grid; }
.eu-txt b { font-size: 13.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eu-txt small { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:root[data-theme="light"] .eu-cartao { background: #FFFFFF; }
.eu-txt b { white-space: normal; line-height: 1.25; overflow-wrap: anywhere; }
.eu-txt small { white-space: normal; line-height: 1.3; }

/* Emojis */
.emoji-pop { position: absolute; left: 10px; bottom: calc(100% + 6px); z-index: 30; border-radius: 16px; overflow: hidden; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); border: 1px solid var(--line-2); background: var(--surface); }
.emoji-pop[hidden] { display: none; }
.emoji-pop emoji-picker { width: 380px; height: 400px; --border-size: 0; --emoji-size: 1.55rem; --num-columns: 9; --indicator-color: #139A4B; --outline-color: #139A4B; }
.emoji-pop emoji-picker.dark { --background: #1B1426; --border-color: rgba(255,255,255,.08); --button-hover-background: rgba(255,255,255,.08); --input-border-color: rgba(255,255,255,.14); --input-font-color: #EEE; }
.ic-bt.on { color: #139A4B; }
@media (max-width: 860px) {
  .emoji-pop { position: fixed; left: 0; right: 0; bottom: calc(64px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; }
  .emoji-pop emoji-picker { width: 100%; height: min(46dvh, 360px); --num-columns: 8; --emoji-size: 1.7rem; }
  body.teclado .emoji-pop { bottom: 64px; }
  /* barra arredondada: emoji e respostas rápidas à esquerda; arquivo e nota à direita */
  .compor #bt-emoji { position: absolute; bottom: 3px; left: 4px; z-index: 2; }
  .compor #bt-raio { left: 38px; }
  .compor #bt-clipe { left: auto; right: calc(54px + 38px + env(safe-area-inset-right)); }
  .compor #bt-nota { left: auto; right: calc(54px + 4px + env(safe-area-inset-right)); }
  .compor textarea { padding-left: 76px; padding-right: 76px; }
  .compor.tem-texto textarea { padding-left: 76px; }
}

/* Contatos: régua de valor gasto e histórico do cliente */
.regua { margin: 10px 0 8px; padding: 12px 14px; display: grid; gap: 10px; }
.regua-topo { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.regua-val { font-size: 13px; color: #139A4B; font-weight: 700; }
.regua-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.regua input[type=range] { width: 100%; accent-color: #139A4B; height: 22px; }
.regua-campos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.regua-campos label { display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); }
.ct-resumo { display: flex; gap: 6px 18px; flex-wrap: wrap; margin: 6px 2px 10px; font-size: 13px; color: var(--ink-2); }
.ct-resumo b { color: var(--ink); }
.ct-linha { cursor: pointer; }
.ct-linha:hover td { background: var(--hover); }
.caixa.caixa-larga { width: min(860px, 96vw); max-width: 860px; }
.hist-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.hist-kpis > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; display: grid; gap: 2px; }
.hist-kpis span { font-size: 11px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.hist-kpis b { font-size: 15px; }
.hist-t { font-size: 13px; margin: 14px 0 6px; }
.hist-tab { max-height: 320px; overflow: auto; margin: 0; padding: 0; }
@media (max-width: 860px) { .regua-campos { grid-template-columns: 1fr 1fr; } .regua-campos label:last-child { grid-column: 1 / -1; } .hist-kpis { grid-template-columns: 1fr 1fr; } }

/* linha fixa com os 10 emojis usados por último */
.emoji-recentes { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); background: var(--surface); overflow-x: auto; scrollbar-width: none; }
.emoji-recentes .peq { margin-right: 6px; white-space: nowrap; font-size: 11px; }
.emoji-recentes button { flex: none; width: 34px; height: 34px; border: 0; background: none; border-radius: 8px; font-size: 1.45rem; line-height: 1; cursor: pointer; padding: 0; }
.emoji-recentes button:hover { background: var(--surface-2); }
:root:not([data-theme="light"]) .emoji-recentes { background: #1B1426; border-color: rgba(255,255,255,.08); }

/* Menu lateral: caixa branca com linha neon fina ao passar o mouse */
.nav a { position: relative; border: 1px solid transparent; transition: background .15s, box-shadow .2s; }
.nav a::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none; opacity: 0; transition: opacity .2s;
  background: linear-gradient(120deg, var(--red), #C2187A 45%, #8B4DFF);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.nav a:hover::after { opacity: 1; }
.nav a:hover { box-shadow: 0 0 10px rgba(240, 16, 46, .28), 0 0 18px rgba(139, 77, 255, .22); }
.nav a.on::after { opacity: .55; }
:root[data-theme="light"] .nav a:hover, :root[data-theme="light"] .nav a.on { background: #FFFFFF; }
:root[data-theme="light"] .nav a:hover { box-shadow: 0 0 8px rgba(240, 16, 46, .22), 0 0 16px rgba(139, 77, 255, .18); }
@media (prefers-reduced-motion: reduce) { .nav a, .nav a::after { transition: none; } }

/* ===== Online ao vivo ===== */
/* seu cartão: linha neon em volta, ponto verde na foto */
.eu-cartao { position: relative; margin-bottom: 6px; }
.eu-cartao::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(120deg, var(--red), #C2187A 45%, #8B4DFF); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.eu-cartao { box-shadow: 0 0 10px rgba(240, 16, 46, .18), 0 0 18px rgba(139, 77, 255, .14); border-color: transparent; }
.foto-viva { position: relative; flex: none; display: inline-grid; border-radius: 50%; }
.foto-viva .pt-on { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #9A95A8; border: 2px solid var(--side-bg, #fff); }
.eu-cartao .pt-on, .pessoa-viva.on .pt-on { background: #2FBF71; }
.ao-vivo { display: flex; align-items: center; gap: 7px; margin: 0 8px 14px; font: 700 11px Inter, sans-serif; letter-spacing: .14em; color: #2FBF71; }
.ao-vivo i { width: 8px; height: 8px; border-radius: 50%; background: #2FBF71; box-shadow: 0 0 0 0 rgba(47, 191, 113, .6); animation: vivo 1.6s infinite; }
/* equipe agora: anel girando na foto de quem está online (mais forte em quem está atendendo) */
.equipe-viva { margin: 0 4px 14px; display: grid; gap: 4px; }
.equipe-viva .t { display: flex; justify-content: space-between; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); padding: 0 6px 2px; }
.equipe-viva .t span { color: #2FBF71; letter-spacing: .06em; text-transform: none; font-weight: 600; }
.pessoa-viva { display: flex; gap: 9px; align-items: center; padding: 5px 6px; border-radius: 10px; opacity: .6; }
.pessoa-viva.on { opacity: 1; }
.pessoa-viva .eu-foto { width: 30px; height: 30px; font-size: 10.5px; }
.pessoa-viva .eu-txt b { font-size: 12.5px; }
.pessoa-viva .eu-txt small { font-size: 11px; }
.pessoa-viva.atendendo .eu-txt small { color: #2FBF71; font-weight: 600; }
.pessoa-viva.on .foto-viva::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; padding: 2px;
  background: conic-gradient(from 0deg, #2FBF71, transparent 40%, #2FBF71 60%, transparent 90%, #2FBF71);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: girar-anel 2.4s linear infinite; }
.pessoa-viva.atendendo .foto-viva::before { background: conic-gradient(from 0deg, var(--red), #8B4DFF, #2FBF71, var(--red)); animation-duration: 1.4s; }
.eu-cartao .foto-viva::before { content: ""; position: absolute; inset: -3px; border-radius: 50%; padding: 2px;
  background: conic-gradient(from 0deg, #2FBF71, transparent 40%, #2FBF71 60%, transparent 90%, #2FBF71);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: girar-anel 2.4s linear infinite; }
@keyframes girar-anel { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .foto-viva::before, .ao-vivo i { animation: none !important; } }

/* ===== Chatbots de IA ===== */
.bot-ia { display: grid; gap: 8px; margin-bottom: 12px; padding: 14px; }
.bot-chave { display: flex; gap: 8px; flex-wrap: wrap; }
.bot-chave .inp { flex: 1 1 260px; }
.interruptor { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.interruptor input { position: absolute; opacity: 0; pointer-events: none; }
.interruptor > span { width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; flex: none; transition: background .2s; }
.interruptor > span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.interruptor input:checked + span { background: #139A4B; }
.interruptor input:checked + span::after { transform: translateX(16px); }
.interruptor input:focus-visible + span { outline: 2px solid #139A4B; outline-offset: 2px; }
.bot-form .bot-sec { font-size: 15px; margin: 14px 0 0; padding-top: 12px; border-top: 1px solid var(--line); }
.bot-form .bot-sec small { font-weight: 400; color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.bot-form .rot { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 6px; }
.bot-form .pers { display: flex; flex-wrap: wrap; gap: 6px; }
.bot-form .pers .chip.on { background: #139A4B; border-color: #139A4B; color: #fff; }
.bot-form textarea[name=contexto] { min-height: 220px; resize: vertical; font-size: 13.5px; line-height: 1.5; }
.exemplos { background: color-mix(in srgb, #139A4B 12%, transparent); border: 1px solid color-mix(in srgb, #139A4B 40%, transparent); border-radius: 12px; padding: 10px 12px; }
.exemplos summary { cursor: pointer; font-weight: 600; color: #139A4B; }
.exemplos .ex { display: block; width: 100%; text-align: left; margin-top: 6px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; font-size: 13px; }
.exemplos .ex:hover { border-color: #139A4B; }
.aviso-ctx { background: rgba(232, 140, 30, .14); border: 1px solid rgba(232, 140, 30, .5); border-radius: 12px; padding: 10px 12px; font-size: 13px; }
.bot-aps { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.bot-aps .chk { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; }
.fluxo-l { display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--surface-2); }
.fl-cab, .fl-acao { display: flex; gap: 6px; align-items: center; }
.fl-cab .inp, .fl-acao .sel, .fl-acao .inp { flex: 1; min-width: 0; }
.temp { display: flex; gap: 12px; align-items: center; margin-top: 6px; }
.temp input { flex: 1; accent-color: #139A4B; }
.temp b { min-width: 34px; text-align: center; background: #139A4B; color: #fff; border-radius: 8px; padding: 2px 6px; font-size: 12px; }
.teste-chat { height: min(52dvh, 420px); border: 1px solid var(--line); border-radius: 14px; margin: 10px 0; }
.teste-linha { display: flex; gap: 8px; }
.teste-linha .inp { flex: 1; }
.bolha.digitando { opacity: .6; font-style: italic; }
.robo-faixa { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 14px; font-size: 13px; border-bottom: 1px solid var(--line); }
.robo-faixa[hidden] { display: none; }
.robo-faixa.robo { background: color-mix(in srgb, #139A4B 14%, var(--surface)); }
.robo-faixa.humano { background: color-mix(in srgb, #8B4DFF 10%, var(--surface)); }
.robo-faixa.pausado { background: color-mix(in srgb, #E8B84A 14%, var(--surface)); }
.rb-bts { display: flex; gap: 6px; }
@media (max-width: 860px) { .robo-faixa { padding: 6px 10px; font-size: 12.5px; } .fl-cab, .fl-acao { flex-wrap: wrap; } }

/* Dentro do painel de gestão: a central vira uma tela do painel (sem segunda marca nem segundo cartão) */
.embutido .side .logo, .embutido .side .eu-cartao, .embutido .side .ao-vivo, .embutido .btn-instalar, .embutido .so-cel .btn-instalar { display: none !important; }
.embutido .side::before { display: none; }

/* ===== Desempenho da conversa (iOS e Android) ===== */
.msgs .mi { display: contents; }
/* bolhas antigas fora da tela não são desenhadas até chegar nelas (rolagem leve em conversas longas) */
.msgs > .mi:nth-last-child(n+16) > .bolha { content-visibility: auto; contain-intrinsic-size: auto 72px; }
.msgs { contain: content; overflow-anchor: auto; will-change: scroll-position; -webkit-overflow-scrolling: touch; }
.lista-conv { contain: content; }
.lista-conv > .conv { content-visibility: auto; contain-intrinsic-size: auto 78px; }
.bolha img.midia { aspect-ratio: auto 4 / 3; background: var(--surface-2); }
.bolha audio { width: min(260px, 100%); height: 40px; }
/* dentro do painel (iframe): a central ocupa exatamente a área que o painel dá */
.embutido, .embutido body { height: 100%; }
.embutido .main.cheia { height: 100dvh; }
@media (max-width: 860px) {
  .embutido body { padding-top: 0; }
  .embutido .main.cheia { height: calc(100dvh - 58px); }
  .embutido .main.cheia:has(.cx.aberta) { height: 100dvh; }
  .embutido body.teclado .main.cheia:has(.cx.aberta) { height: var(--vv-h, 100dvh); }
}

/* ===== Meus aparelhos: cartões ===== */
.chips-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 14px; }
.chip-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 18px; display: grid; gap: 14px; min-width: 0; }
.chip-card.st-conectado { border-color: rgba(47, 191, 113, .5); box-shadow: 0 0 0 1px rgba(47, 191, 113, .12), 0 10px 30px rgba(47, 191, 113, .07); }
.chip-card.st-aguardando_qr, .chip-card.st-conectando { border-color: rgba(232, 184, 74, .55); }
.chip-card header { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chip-ic { width: 44px; height: 44px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; color: var(--red); flex: none; border: 1px solid var(--line); }
:root[data-theme="light"] .chip-ic { color: var(--red); }
.chip-ic svg { width: 22px; height: 22px; }
.chip-nome { min-width: 0; flex: 1; display: grid; gap: 2px; }
.chip-nome b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-nome small { color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-st { font-size: 12.5px; padding: 6px 12px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none; }
.chip-st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-conectado .chip-st i { animation: chip-pulso 1.8s ease-in-out infinite; }
@keyframes chip-pulso { 50% { box-shadow: 0 0 0 5px rgba(47, 191, 113, .2); } }
.chip-dados { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.chip-dados div { background: var(--surface-2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.chip-dados dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.chip-dados dd { margin: 4px 0 0; font-weight: 600; }
.chip-qr { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; background: var(--surface-2); border-radius: 14px; padding: 14px; }
.chip-qr img { width: 230px; height: 230px; background: #fff; padding: 10px; border-radius: 12px; image-rendering: pixelated; }
.chip-qr ol { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; }
.chip-qr .peq { grid-column: 1 / -1; margin: 0; }
.chip-card footer { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-card footer .btn { min-height: 40px; }
.chip-card .perigo { color: var(--bad) !important; border-color: color-mix(in srgb, var(--bad) 60%, transparent) !important; }
.chip-vazio { grid-column: 1 / -1; padding: 40px 16px; }
@media (max-width: 640px) { .chip-qr { grid-template-columns: 1fr; justify-items: center; } .chip-qr img { width: min(260px, 70vw); height: auto; aspect-ratio: 1; } .chip-card footer .btn { flex: 1 1 auto; } }
.chips-grid { align-items: start; }
.chip-card { align-content: start; }
.chip-card footer .btn:not(.sec) { background: linear-gradient(160deg, var(--red), #C40A1C) !important; color: #fff; border: 0; box-shadow: 0 6px 18px color-mix(in srgb, var(--red) 28%, transparent); }

/* celular: barra de baixo com 4 telas + Menu (abre todas as telas) */
@media (max-width: 860px) {
  .tabbar { grid-template-columns: repeat(5, 1fr) !important; }
  .topo-cx h1 { font-size: 21px; line-height: 1.15; }
  .acoes-topo .btn:not(.sec):not(.btn-instalar) { white-space: nowrap; }
}
.menu-cel { display: grid; gap: 4px; }
.menu-cel a { display: flex; align-items: center; gap: 12px; padding: 12px 10px; border-radius: 12px; text-decoration: none; color: var(--ink); font-weight: 500; }
.menu-cel a svg { width: 20px; height: 20px; color: var(--ink-2); }
.menu-cel a.on, .menu-cel a:active { background: var(--surface-2); }
@media (max-width: 860px) {
  .main.cheia > .topo-cx { flex-wrap: wrap !important; row-gap: 6px; }
  .main.cheia > .topo-cx > div:first-child { flex: 1 1 190px !important; }
  .main.cheia > .topo-cx .acoes-topo { flex-wrap: wrap !important; justify-content: flex-end; margin-left: auto; }
}

/* Apagar cliente (só dono) */
.menu-conv .perigo-menu { color: var(--bad); border-top: 1px solid var(--line); margin-top: 4px; padding-top: 10px; }
.menu-conv .perigo-menu svg { color: var(--bad); }
.btn.perigo-cheio { background: linear-gradient(160deg, var(--red), #B8001A) !important; color: #fff; border: 0; }
.btn.perigo-cheio:disabled { opacity: .45; cursor: not-allowed; }
.apagar-aviso { background: color-mix(in srgb, var(--bad) 10%, var(--surface)); border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent); border-radius: 12px; padding: 12px 14px; margin: 8px 0 12px; font-size: 13.5px; }
.apagar-aviso ul { margin: 6px 0; padding-left: 18px; }

/* ===== Celular: botão de áudio/enviar sempre dentro da margem (iOS e Android) ===== */
@media (max-width: 860px) {
  html, body { overflow-x: clip; max-width: 100%; }
  .pn-chat, .cx { overflow-x: clip; }
  .msgs { touch-action: pan-y; }
  /* sem brilho que "vaza" até a borda da tela; tamanho 46 px e margem garantida à direita */
  #enviar, .compor #bt-mic { box-shadow: none !important; width: 46px !important; height: 46px !important; min-width: 46px !important; }
  .pn-chat .compor { padding-right: max(12px, calc(env(safe-area-inset-right) + 8px)) !important; padding-left: max(8px, env(safe-area-inset-left)) !important; }
  .compor .linha { padding-right: 0 !important; gap: 8px; }
  .compor #bt-clipe { right: calc(54px + 38px) !important; }
  .compor #bt-nota { right: calc(54px + 2px) !important; }
  .chat-topo .quem .peq { overflow: hidden; }
}

/* ===== Celular: janelas (gravar áudio, nova conversa, filtros…) flutuando dentro da tela ===== */
@media (max-width: 860px) {
  .modal { place-items: end center !important; padding: calc(12px + env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) calc(8px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left)) !important; }
  .modal > * { width: 100% !important; max-width: 560px !important; border-radius: 22px !important; padding-bottom: 18px !important; max-height: calc(100dvh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important; overflow: auto; }
  .grav { padding: 16px 12px; }
  .grav-bts { flex-wrap: wrap; justify-content: center; }
  .grav .audio-vel { max-width: 100%; }
  .grav audio { max-width: calc(100% - 48px); }
  .modal .acoes { flex-wrap: wrap; }
}

/* ===== Tema dia: branco suave com tons de cinza + destaque com textura ao passar o mouse ===== */
:root[data-theme="light"] {
  --bg: #F2F2F6;
  --surface: #FBFBFD;
  --surface-2: #F0F0F4;
  --cinza-sec: #EEEEF3;
  --cinza-sec-2: #E7E7EE;
  --linha-sec: #DEDEE6;
  --hover: rgba(40, 32, 70, .045);
  /* textura fina (listras diagonais quase invisíveis) usada nos destaques */
  --textura: repeating-linear-gradient(135deg, rgba(40, 32, 70, .028) 0 1px, transparent 1px 7px);
}
:root[data-theme="light"] body { background: var(--bg); }
/* conversa: fundo cinza bem claro com pontinhos, bolhas que chegam em branco suave */
:root[data-theme="light"] .pn-chat, :root[data-theme="light"] .msgs { background-color: #F7F7FA !important; }
:root[data-theme="light"] .bolha.in { background: #FFFFFF; border-color: #E6E6EC; }
:root[data-theme="light"] .card, :root[data-theme="light"] .chip-card, :root[data-theme="light"] .caixa { background: var(--surface); }
:root[data-theme="light"] .inp, :root[data-theme="light"] .sel, :root[data-theme="light"] .compor textarea { background: #FAFAFC; border-color: var(--linha-sec); }
:root[data-theme="light"] .inp:focus, :root[data-theme="light"] .sel:focus, :root[data-theme="light"] .compor textarea:focus { background: #FFFFFF; }
:root[data-theme="light"] .btn.sec { background: #F6F6F9; border-color: var(--linha-sec); }

/* transição suave em tudo que reage ao mouse */
.conv, .nav a, .chip, .btn, .tab-ct tbody tr, .menu-conv button, .pessoa-viva, .eu-cartao, .chip-card, .dados > div, .hist-kpis > div, #lista-centrais button, .fluxo-l, .menu-cel a {
  transition: background-color .18s ease, background-image .18s ease, box-shadow .2s ease, border-color .18s ease, transform .18s ease;
}
/* destaque ao passar o mouse: tom de cinza + textura fina */
:root[data-theme="light"] .conv:hover,
:root[data-theme="light"] .tab-ct tbody tr:hover td,
:root[data-theme="light"] .menu-conv button:hover,
:root[data-theme="light"] #lista-centrais button:hover,
:root[data-theme="light"] .pessoa-viva:hover,
:root[data-theme="light"] .menu-cel a:hover {
  background-color: #E9E9EF !important; background-image: var(--textura) !important;
}
:root[data-theme="light"] .btn.sec:hover, :root[data-theme="light"] .chip:not(.on):hover { background-color: #ECECF1; background-image: var(--textura); }
:root[data-theme="light"] .chip-card:hover { box-shadow: 0 6px 22px rgba(40, 32, 70, .07); border-color: #D6D6DF; }
/* item selecionado: cartão claro levemente elevado, com faixa da cor do número */
:root[data-theme="light"] .conv.on { background: #FFFFFF !important; background-image: none !important; box-shadow: inset 3px 0 0 var(--cor, var(--red)), 0 2px 10px rgba(40, 32, 70, .06); }
:root[data-theme="light"] #lista-centrais button.on { background-color: #FFFFFF; box-shadow: 0 2px 8px rgba(40, 32, 70, .06); }
/* escuro também ganha a textura no destaque (bem sutil) */
:root:not([data-theme="light"]) .conv:hover, :root:not([data-theme="light"]) .tab-ct tbody tr:hover td, :root:not([data-theme="light"]) .menu-conv button:hover {
  background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 7px);
}
@media (prefers-reduced-motion: reduce) { .conv, .nav a, .chip, .btn, .tab-ct tbody tr, .menu-conv button { transition: none; } }

/* ===== Papel de parede da conversa (estampa original em traço fino, dia e noite) ===== */
:root { --papel-cor: #0F0A17; --papel-img: url("/assets/papel-noite.svg?v=1"); }
:root[data-theme="light"] { --papel-cor: #EFEAE2; --papel-img: url("/assets/papel-dia.svg?v=1"); }
#msgs.msgs, .pn-chat .msgs, :root[data-theme="light"] #msgs.msgs {
  background-color: var(--papel-cor) !important;
  background-image: var(--papel-img) !important;
  background-size: 420px 420px !important;
  background-repeat: repeat !important;
  background-position: 0 0 !important;
  background-attachment: local !important;
}
:root[data-theme="light"] .pn-chat { background-color: var(--papel-cor) !important; }
/* bolhas com leve sombra para "descolar" da estampa */
:root[data-theme="light"] .bolha.in { background: #FFFFFF; border-color: #E4DED4; box-shadow: 0 1px 1.5px rgba(60, 45, 20, .10); }
:root[data-theme="light"] .bolha.out { box-shadow: 0 1px 1.5px rgba(60, 45, 20, .10); }
:root[data-theme="light"] .dia { background: rgba(255, 255, 255, .85); border-color: #E4DED4; }
@media (max-width: 860px) { #msgs.msgs, .pn-chat .msgs { background-size: 340px 340px !important; } }

/* Gravação de áudio: barra de voz ao vivo, aviso de microfone mudo e escolha do microfone */
.nivel-mic { width: 100%; max-width: 260px; height: 6px; border-radius: 6px; background: var(--line-2); overflow: hidden; }
.nivel-mic i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--red), #C2187A, #8B4DFF); border-radius: 6px; transition: width .08s linear; }
.aviso-mic { width: 100%; font-size: 13px; line-height: 1.4; color: var(--bad); background: rgba(255, 90, 110, .08); border: 1px solid rgba(255, 90, 110, .35); border-radius: 10px; padding: 8px 10px; text-align: center; }
.sel-mic { width: 100%; display: grid; gap: 4px; font-size: 12px; color: var(--ink-3); }
.sel-mic .sel { width: 100%; min-width: 0; }

/* Colar print / arrastar arquivo na conversa */
.previa-colar { display: grid; place-items: center; background: var(--line-2); border-radius: 12px; padding: 8px; margin: 6px 0 4px; }
.previa-colar img { max-width: 100%; max-height: 55vh; border-radius: 8px; object-fit: contain; }
.previa-doc { font-size: 15px; padding: 14px; border: 1px dashed var(--line-2); border-radius: 12px; text-align: center; }
.soltar-aqui { outline: 2px dashed #25D366; outline-offset: -8px; }

/* Balão das mensagens enviadas no verde do WhatsApp (não usa mais a cor do chip) */
.msgs .bolha.out { background: #005C4B; border-color: #0A6B58; color: #E9EDEF; }
.msgs .bolha.out .rod, .msgs .bolha.out .peq { color: rgba(233, 237, 239, .7); }
:root[data-theme="light"] .msgs .bolha.out { background: #D9FDD3; border-color: #C3EFBC; color: #111B21; }
:root[data-theme="light"] .msgs .bolha.out .rod, :root[data-theme="light"] .msgs .bolha.out .peq { color: #667781; }
:root[data-theme="light"] .msgs .bolha.out .citada { background: rgba(0, 0, 0, .05); color: #3B4A54; }
:root[data-theme="light"] .msgs .bolha.out .citada b { color: #111B21; }

/* Vendas deste cliente (lateral da conversa) */
.vl-form { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2, var(--surface)); }
.vl-form .campo { margin: 0; }
.vl-item { display: grid; grid-template-columns: minmax(0, 1fr) 58px 76px 24px; gap: 5px; margin-bottom: 5px; align-items: center; }
.vl-item .inp { min-width: 0; padding-left: 8px; padding-right: 8px; }
.vl-tira { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 13px; padding: 0; }
.vl-tira:hover { color: var(--bad); }
.vl-dupla { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vl-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--ink-2); padding: 4px 2px; }
.vl-total b { font-size: 16px; color: var(--ink); }
.vl-hist { margin-top: 10px; }
#vl-lancar { width: 100%; }

/* Tablet deitado / janela média: mantém lista + conversa + lateral do cliente quando a área da conversa tem ≥ 880 px
   (mede o contêiner, então vale sozinha e dentro do painel). Abaixo disso, o botão "ⓘ Cliente" abre a lateral por cima. */
.main.cheia { container-type: inline-size; container-name: area; }
@container area (min-width: 880px) and (max-width: 1240px) {
  .cx { grid-template-columns: 264px minmax(0, 1fr) 284px; }
  .cx > .pn-ficha, .cx.com-ficha > .pn-ficha { display: block; position: static; width: auto; box-shadow: none; z-index: auto; padding: 12px; }
  .cx #ver-ficha { display: none !important; }
  .cx .conv { padding-left: 10px; padding-right: 10px; }
  .cx .vl-item { grid-template-columns: minmax(0, 1fr) 50px 66px 20px; gap: 4px; }
}
/* área estreita demais para 3 colunas (fora do celular): mostra o botão "ⓘ Cliente", que abre a lateral pela direita */
@media (min-width: 861px) { @container area (max-width: 879px) { .cx #ver-ficha { display: inline-flex !important; } } }

/* Conversa em coluna estreita (tablet deitado menor, ex.: Tab S11): topo compacto de uma linha.
   Atendente, departamento, etapa, Assumir e Fechar vão para o ⋮ ("Atendente, etapa e departamento"), como no celular. */
.pn-chat { container-type: inline-size; container-name: chat; }
@media (min-width: 861px) { @container chat (max-width: 680px) {
  .chat-topo { flex-wrap: nowrap; gap: 8px; padding: 8px 60px 8px 12px; min-height: 60px; }
  .chat-topo .quem { flex: 1 1 auto; min-width: 0; }
  .chat-topo .quem .linha-nome { flex-wrap: nowrap; min-width: 0; }
  .chat-topo .quem .linha-nome b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .chat-topo .quem .linha-nome .etq, .chat-topo .quem .linha-nome .chip-esc { flex: none; font-size: 11px; padding: 1px 7px; }
  .chat-topo .quem .peq { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
  .chat-topo .quem .peq .chip-zap { font-size: 10.5px; padding: 0 6px; }
  .chat-topo > .menu-wrap { top: calc(50% - 19px); right: 10px; }
  .chat-topo #btn-venda { flex: none; padding: 6px 10px; }
  .ctrl-conv { display: none; }
  .ctrl-conv.aberto { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; position: absolute; left: 0; right: 0; top: 100%; z-index: 12; padding: 12px; background: var(--side-bg); border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px rgba(0, 0, 0, .25); }
  .ctrl-conv.aberto .sel, .ctrl-conv.aberto .btn { width: 100%; min-width: 0; justify-content: center; }
  .menu-conv .so-zap-flex { display: flex !important; }
} }
/* barra da lista (Buscar / Nova conversa) não corta em coluna estreita */
@container area (max-width: 1240px) {
  .pn-lista .barra-cx { gap: 6px; }
  .pn-lista .barra-cx .btn { flex: 1 1 0; min-width: 0; padding: 6px 6px; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
  .pn-lista .barra-cx .btn svg { width: 14px; height: 14px; flex: none; }
}

/* Caixa de digitar: sem frase, arredondada com contorno verde (acompanha o botão de enviar, separados) */
.compor textarea, :root[data-theme="light"] .compor textarea { border-radius: 24px; border: 1.5px solid #25D366 !important; box-shadow: none; }
.compor textarea:focus, :root[data-theme="light"] .compor textarea:focus { border-color: #1DAA55 !important; box-shadow: 0 0 0 3px rgba(37, 211, 102, .18) !important; }
.compor.nota textarea { border-color: rgba(232, 184, 74, .8) !important; }
@media (min-width: 861px) { #enviar { border-radius: 50% !important; } }

/* Entregas do serviço (acompanhamento de crescimento) */
.ent { border: 1px solid var(--line-2); border-radius: 12px; padding: 10px; margin-bottom: 8px; background: var(--surface); display: grid; gap: 7px; }
.ent.fim { opacity: .85; }
.ent-cab { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.ent-cab b { font-size: 13.5px; }
.ent-chave { display: inline-flex; flex: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px; background: var(--bg); }
.ent-chave button { border: 0; background: none; color: var(--ink-3); font-size: 11px; padding: 4px 8px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.ent-chave button.on[data-st="andamento"] { background: #F5A524; color: #1A1200; font-weight: 600; }
.ent-chave button.on[data-st="finalizado"] { background: #25D366; color: #052E16; font-weight: 600; }
.ent-num { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ent-num div { background: var(--bg); border-radius: 8px; padding: 5px 7px; display: grid; }
.ent-num span { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.ent-num b { font-size: 14px; }
.ent-barra { height: 8px; border-radius: 8px; background: var(--line-2); overflow: hidden; }
.ent-barra i { display: block; height: 100%; background: linear-gradient(90deg, #25D366, #128C7E); border-radius: 8px; transition: width .3s; }
.ent-reg { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.ent-hist { display: grid; gap: 3px; font-size: 12px; border-top: 1px dashed var(--line-2); padding-top: 6px; }
.ent-hist div { display: grid; grid-template-columns: 96px 70px minmax(0, 1fr); gap: 6px; align-items: baseline; }
.ent-hist span:first-child { color: var(--ink-3); }
.ent-hist .peq { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ent-nova summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); padding: 4px 0; }
.ent-form { display: grid; gap: 8px; margin-top: 6px; }
.ent-form .campo { margin: 0; }
.ent-cab { flex-direction: column; align-items: stretch; }
.ent-chave { display: grid; grid-template-columns: 1fr 1fr; }
.ent-chave button { padding: 5px 6px; font-size: 12px; }
.ent-hist div { grid-template-columns: 78px 58px minmax(0, 1fr); }

/* o topo da conversa (com o menu ⋮ e o quadro de atendente/etapa) fica sempre acima das mensagens */
.chat-topo { z-index: 6; }
.chat-topo .menu-conv { z-index: 40; }

/* Bolinha de presença do cliente (verde online / vermelho offline / sem bolinha = não dá para saber) */
.av-caixa { position: relative; flex: none; align-self: start; }
.chat-topo .av-caixa { align-self: center; }
.pres { position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--side-bg); display: none; }
.pres.p-on { display: block; background: #25D366; }
.pres.p-off { display: block; background: #E5484D; }
.digitando { color: #25D366; font-size: 12px; font-weight: 600; }
.digitando { margin-right: 6px; }

/* Pontos de atenção (faixa no topo da lateral) */
.aten { border-radius: 12px; margin-bottom: 12px; border: 1px solid; overflow: hidden; }
.aten summary { cursor: pointer; padding: 8px 12px; font-weight: 700; font-size: 13px; list-style: none; }
.aten summary::-webkit-details-marker { display: none; }
.aten-urg { border-color: rgba(229, 72, 77, .5); background: rgba(229, 72, 77, .08); }
.aten-urg > summary { color: #E5484D; }
.aten-ate { border-color: rgba(245, 165, 36, .55); background: rgba(245, 165, 36, .08); }
.aten-ate > summary { color: #C98200; }
.aten-opo { border-color: rgba(37, 211, 102, .5); background: rgba(37, 211, 102, .07); }
.aten-opo > summary { color: #17924A; }
.aten-it { padding: 8px 12px; border-top: 1px solid var(--line); background: var(--surface); display: grid; gap: 3px; }
.aten-it .t { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; font-size: 13px; }
.aten-nv { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 6px; color: #fff; }
.aten-it.aten-urg .aten-nv { background: #E5484D; } .aten-it.aten-ate .aten-nv { background: #F5A524; color: #1A1200; } .aten-it.aten-opo .aten-nv { background: #25D366; color: #052E16; }
.aten-it.aten-urg, .aten-it.aten-ate, .aten-it.aten-opo { border-color: var(--line); background: var(--surface); }
.aten-sug { font-size: 12.5px; color: var(--ink-2); }

/* Saldo do cliente */
.sld { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: rgba(37, 211, 102, .10); border: 1px solid rgba(37, 211, 102, .45); }
.sld span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.sld b { font-size: 22px; color: #17924A; }
.sld small { font-size: 11.5px; color: var(--ink-3); }
.sld.baixo { background: rgba(245, 165, 36, .10); border-color: rgba(245, 165, 36, .55); }
.sld.baixo b { color: #C98200; }
.sld-bts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 8px; }
.sld-form { display: grid; gap: 8px; margin-top: 8px; padding: 10px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); }
.sld-form .campo { margin: 0; }
.sld-hist { display: grid; gap: 4px; margin-top: 8px; font-size: 12px; }
.sld-hist > div { display: grid; grid-template-columns: 64px 74px minmax(0, 1fr) auto; gap: 2px 6px; align-items: baseline; padding: 4px 0; border-bottom: 1px dashed var(--line-2); }
.sld-hist .cred { color: #17924A; font-weight: 700; } .sld-hist .deb { color: #E5484D; font-weight: 700; }
.sld-hist .estornado { opacity: .55; text-decoration: line-through; }
.sld-hist .peq { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sld-bts .btn { white-space: nowrap; font-size: 12px; padding: 7px 6px; justify-content: center; }
/* lateral aberta por cima (celular, tablet em pé): fundo sólido no tema noite */
:root:not([data-theme="light"]) .cx.com-ficha > .pn-ficha { background: #0F0A17; }

/* Respostas rápidas compactas: painel baixo, 1 linha por resposta, rolagem interna; barra de baixo fina */
.atalhos { max-height: min(28vh, 200px); overscroll-behavior: contain; border-radius: 12px; }
.atalhos button { display: flex; align-items: baseline; gap: 8px; padding: 7px 12px; white-space: nowrap; min-height: 34px; }
.atalhos b { flex: none; margin-right: 0; font-size: 12.5px; }
.atalhos span { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: 12.5px; }
.compor .opc { gap: 6px; row-gap: 2px; margin-top: 2px; }
.compor .opc label { font-size: 11.5px; }
.compor .opc .chip { min-height: 28px; height: 28px; padding: 0 10px; font-size: 11.5px; display: inline-flex; align-items: center; }

/* Menu lateral recolhível: seta na borda; recolhido = faixa de ícones de 64 px (tablet e computador) */
.recolher-menu { display: none; }
@media (min-width: 861px) {
  .side { position: sticky; }
  .recolher-menu { display: grid; place-items: center; position: absolute; top: 12px; right: 8px; z-index: 30; width: 32px; height: 44px; border-radius: 10px;
    border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0, 0, 0, .18); }
  .recolher-menu:hover { background: var(--surface-2); }
  .layout { transition: grid-template-columns .22s ease; }
  .menu-recolhido { --sidebar: 64px; }
  .menu-recolhido .side { padding: 64px 8px 14px; overflow-x: hidden; }
  .menu-recolhido .side .logo, .menu-recolhido .side .eu-txt, .menu-recolhido .side .ao-vivo, .menu-recolhido .side .equipe-viva,
  .menu-recolhido .side .centrais .t, .menu-recolhido .side .rodape { display: none !important; }
  .menu-recolhido .side .eu-cartao { justify-content: center; padding: 6px 0; background: none; border: 0; box-shadow: none; }
  .menu-recolhido .side .nav a { justify-content: center; padding: 10px 0; font-size: 0; gap: 0; }
  .menu-recolhido .side .nav a svg { width: 20px; height: 20px; }
  .menu-recolhido .side .arvore { display: grid; gap: 4px; justify-items: center; }
  .menu-recolhido .side .arvore button { font-size: 0; width: 40px; height: 32px; padding: 0; justify-content: center; position: relative; margin: 0; }
  .menu-recolhido .side .arvore button.sub-ap { margin-left: 0; }
  .menu-recolhido .side .arvore .dot { width: 12px; height: 12px; margin: 0; }
  .menu-recolhido .side .arvore .qt { position: absolute; top: 3px; right: 6px; width: 9px; height: 9px; min-width: 0; padding: 0; font-size: 0; border-radius: 50%; background: #E5484D; }
  .menu-recolhido .side .arvore::before, .menu-recolhido .side .arvore button::before { display: none; }
}
@media (prefers-reduced-motion: reduce) { .layout { transition: none; } }
/* com o menu recolhido a conversa ganha espaço: as 3 colunas aparecem mais cedo */

/* Busca de serviço do site na venda */
.vl-item { position: relative; }
.cat-sug { position: absolute; top: calc(100% + 2px); left: 0; right: 0; z-index: 25; max-height: 240px; overflow: auto; overscroll-behavior: contain;
  background: var(--tip-bg, var(--surface)); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 12px 28px rgba(0, 0, 0, .28); }
.cat-sug button { display: flex; justify-content: space-between; gap: 8px; width: 100%; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: none; color: var(--ink); text-align: left; font-size: 12.5px; cursor: pointer; }
.cat-sug button span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-sug button .num { flex: none; color: #17924A; font-weight: 700; }
.cat-sug button:hover, .cat-sug button.on { background: var(--surface-2); }
.vl-cat { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.vl-cat .peq { font-size: 11px; }

/* Aparelhos no topo da tela de conversas */
.aps-topo { display: inline-flex; gap: 6px; align-items: center; margin-right: 10px; }
.ap-ic { position: relative; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; text-decoration: none; }
.ap-ic svg { width: 18px; height: 18px; }
.ap-ic i { position: absolute; right: 2px; bottom: 3px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--bg); }
.ap-ic.ok { color: #25D366; background: rgba(37, 211, 102, .12); } .ap-ic.ok i { background: #25D366; }
.ap-ic.off { color: #E5484D; background: rgba(229, 72, 77, .12); } .ap-ic.off i { background: #E5484D; }

/* textos longos (links) não passam da caixa na lateral */
.anot .tx, .pn-ficha .peq, .pn-ficha .compra, .ent .peq, .aten-it, .pn-ficha p { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.anot { min-width: 0; max-width: 100%; overflow: hidden; }
.anot .tx { white-space: pre-wrap; }

/* Figurinha: pequena e sem balão, como no WhatsApp */
.bolha.figura, .msgs .bolha.out.figura { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 2px 2px 0; }
.figurinha { display: block; width: 150px; height: 150px; object-fit: contain; }
.bolha.figura .rod { background: rgba(0, 0, 0, .35); color: #fff; border-radius: 8px; padding: 1px 6px; width: fit-content; margin-left: auto; }

/* Oportunidade agora (mini BI na lateral) */
.opp { border: 1px solid var(--line-2); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; display: grid; gap: 8px; background: linear-gradient(160deg, rgba(37, 211, 102, .07), transparent 60%), var(--surface); }
.opp-cab { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.opp-chance { font: 800 15px Montserrat, sans-serif; padding: 2px 10px; border-radius: 999px; }
.opp-chance.alta { background: rgba(37, 211, 102, .16); color: #17924A; }
.opp-chance.media { background: rgba(245, 165, 36, .16); color: #C98200; }
.opp-chance.baixa { background: rgba(229, 72, 77, .12); color: #E5484D; }
.opp-mom { font-size: 12.5px; font-weight: 600; padding: 6px 9px; border-radius: 9px; border: 1px solid; }
.opp-kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.opp-kpi div { background: var(--bg); border-radius: 8px; padding: 5px 7px; display: grid; min-width: 0; }
.opp-kpi span { font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.opp-kpi b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp-graf { width: 100%; height: 58px; }
.opp-graf .b-on { fill: #25D366; } .opp-graf .b-off { fill: var(--line-2); }
.opp-graf text { font-size: 8px; fill: var(--ink-3); }
.opp-item { display: grid; gap: 1px; padding: 7px 9px; border-radius: 9px; background: var(--bg); font-size: 12.5px; }
.opp-item span { font-size: 10.5px; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.opp-item em { font-style: normal; font-weight: 800; color: #17924A; }
.opp-item small { color: var(--ink-3); font-size: 11.5px; overflow-wrap: anywhere; }

/* Selo VIP recorrente e termômetro do cliente */
.vip-tag { display: inline-flex; align-items: center; flex: none; font-size: 10.5px; font-weight: 800; padding: 1px 7px; border-radius: 999px; margin-left: 6px;
  background: linear-gradient(90deg, #F5C542, #E8A317); color: #3A2600; letter-spacing: .02em; white-space: nowrap; }
.term { display: inline-grid; place-items: center; flex: none; margin-left: 5px; font-size: 13px; line-height: 1; }
.term-largo { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 6px; white-space: nowrap; }
.term-largo:empty { display: none; }
.term-largo.t-quente { background: rgba(229, 72, 77, .14); color: #E5484D; }
.term-largo.t-morno { background: rgba(245, 165, 36, .16); color: #C98200; }
.term-largo.t-frio { background: rgba(70, 150, 230, .14); color: #3B82C4; }
.conv .nm { display: flex; align-items: center; min-width: 0; }
.conv .nm .nm-t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.termo { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-size: 12px; }
.termo span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.termo-barra { position: relative; height: 8px; border-radius: 8px; background: linear-gradient(90deg, #4696E6, #F5A524 45%, #E5484D); }
.termo-barra i { position: absolute; top: -3px; width: 4px; height: 14px; margin-left: -2px; border-radius: 3px; background: var(--ink); box-shadow: 0 0 0 2px var(--surface); }
.termo b { font-size: 12px; white-space: nowrap; }
.termo .t-quente { color: #E5484D; } .termo .t-morno { color: #C98200; } .termo .t-frio { color: #3B82C4; }
/* celular e tablet: selo e termômetro compactos, sem empurrar o nome */
@media (max-width: 860px) {
  .vip-tag { font-size: 9.5px; padding: 1px 5px; margin-left: 4px; }
  .chat-topo .quem .linha-nome .vip-tag, .chat-topo .quem .linha-nome .term-largo { display: inline-flex !important; }
  .term-largo { font-size: 10px; padding: 1px 6px; }
  .filtros-ct { grid-template-columns: 1fr 1fr; }
  .filtros-ct #ct-q, .filtros-ct #ct-serv { grid-column: 1 / -1; }
}
.filtros-ct { grid-template-columns: 1.6fr 1fr 1fr 1.4fr 1fr 1fr; }
@media (max-width: 1100px) { .filtros-ct { grid-template-columns: 1fr 1fr; } .filtros-ct .inp { grid-column: 1 / -1; } }

/* Selos de perfil: VIP recorrente (dourado), VIP (amarelo), Recorrente (azul) */
.vip-tag.p-viprec { background: linear-gradient(90deg, #F5C542, #E8A317); color: #3A2600; }
.vip-tag.p-vip { background: rgba(245, 197, 66, .22); color: #A27200; border: 1px solid rgba(232, 163, 23, .45); }
.vip-tag.p-rec { background: rgba(70, 150, 230, .16); color: #2F74B8; border: 1px solid rgba(70, 150, 230, .4); }
.kb-card .nm { display: flex; align-items: center; gap: 2px; min-width: 0; }
.kb-card .nm > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* termômetro ao vivo com o porquê */
.termo { grid-template-columns: auto 1fr auto; }
.termo small { font-weight: 600; opacity: .7; }
.termo-pq { grid-column: 1 / -1; margin: 0; font-size: 11.5px; color: var(--ink-2); }
.termo-pq::first-letter { text-transform: uppercase; }
/* gaveta de filtros: no computador fica sempre aberta e sem título; no celular vira "Filtros" */
.gaveta-filtros > summary { display: none; }
@media (max-width: 860px) {
  .gaveta-filtros { border: 1px solid var(--line-2); border-radius: 12px; padding: 6px 10px; margin-bottom: 8px; }
  .gaveta-filtros > summary { display: list-item; cursor: pointer; font-weight: 700; font-size: 13px; padding: 4px 0; }
  .gaveta-filtros:not([open]) { padding-bottom: 6px; }
  .chat-topo .quem .linha-nome { flex-wrap: nowrap; overflow: hidden; }
  .chat-topo .quem .linha-nome .vip-tag { max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
}
.filtros-ct { grid-template-columns: 1.6fr repeat(7, minmax(0, 1fr)); }
@media (max-width: 1400px) { .filtros-ct { grid-template-columns: repeat(4, minmax(0, 1fr)); } .filtros-ct #ct-q, .filtros-ct #ct-serv { grid-column: span 2; } }
@media (max-width: 1100px) { .filtros-ct { grid-template-columns: 1fr 1fr; } .filtros-ct #ct-q, .filtros-ct #ct-serv { grid-column: 1 / -1; } }

/* Varredura de celular (24/11): campos da régua sem passar da tela, alvos de toque maiores, textos longos com reticências */
.regua-campos { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.regua-campos label { min-width: 0; }
.regua-campos .inp, .regua-campos .sel { width: 100%; min-width: 0; }
@media (max-width: 860px) {
  .regua-campos { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .regua-campos label:last-child { grid-column: auto !important; }
  .etq-x, .mini-linha .etq-x { min-height: 30px; padding: 4px 10px; }
  .btn, button.chip, .chip { white-space: nowrap; }
  .btn.mini { min-height: 34px; }
  .chip, .etq, .chip-esc, .vip-tag, .tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .sel { min-width: 0; text-overflow: ellipsis; }
  .card, .form label { min-width: 0; }
}
@media (max-width: 860px) { .vl-tira { min-width: 30px; min-height: 32px; } .vl-item { grid-template-columns: minmax(0, 1fr) 56px 72px 30px; } }

@media (max-width: 640px) {
  .so-largo { display: none; }
  /* cartão do aparelho: nome inteiro em cima, situação embaixo */
  .chip-card header { flex-wrap: wrap; }
  .chip-card .chip-nome { flex: 1 1 calc(100% - 60px); min-width: 0; }
  .chip-card .chip-st { margin-left: 52px; }
  .chip-card footer .btn { flex: 1 1 calc(50% - 8px); }
}

/* Contadores das abas e da seção filtrada */
.qt-aba { margin-left: 5px; font-size: 11px; font-weight: 800; opacity: .75; }
.qt-aba:empty { display: none; }
.chip.on .qt-aba { opacity: 1; }
.total-filtro { font-size: 12px; color: var(--ink-3); padding: 2px 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.total-filtro b { color: var(--ink); font-size: 13px; }
.total-filtro span { color: var(--ink-2); font-weight: 600; }

/* Copiloto de vendas */
.cop { border: 1px solid rgba(139, 77, 255, .45); border-radius: 14px; padding: 10px 12px; margin-bottom: 12px; display: grid; gap: 8px; background: linear-gradient(160deg, rgba(139, 77, 255, .09), transparent 55%), var(--surface); }
.cop-cab { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.cop-auto { display: inline-flex; gap: 5px; align-items: center; font-size: 11.5px; color: var(--ink-3); cursor: pointer; }
.cop-topo { display: flex; justify-content: space-between; align-items: center; }
.cop-est { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 999px; background: rgba(139, 77, 255, .16); color: #8B4DFF; }
.cop-resumo { margin: 0; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.cop-sinal { font-size: 11px; padding: 2px 7px; border-radius: 999px; background: var(--bg); color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cop-sec { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-top: 2px; }
.cop-obj { display: grid; gap: 3px; padding: 7px 9px; border-radius: 9px; background: var(--bg); font-size: 12.5px; }
.cop-obj small { color: var(--ink-2); font-size: 12px; }
.cop-msg { font-size: 12.5px; line-height: 1.45; padding: 7px 9px; border-radius: 9px; border-left: 3px solid #25D366; background: rgba(37, 211, 102, .08); white-space: pre-wrap; overflow-wrap: anywhere; }
.cop-msg.forte { border-left-color: #8B4DFF; background: rgba(139, 77, 255, .08); }
.cop-gat { margin: 0; padding-left: 16px; font-size: 12px; display: grid; gap: 2px; }
.cop-of { font-size: 12.5px; padding: 6px 9px; border-radius: 9px; background: var(--bg); }
.cop-of em { font-style: normal; font-weight: 800; color: #17924A; }
.cop-rod { margin: 0; font-size: 10.5px; }
.cop-load { display: flex; gap: 5px; justify-content: center; padding: 10px; }
.cop-load span { width: 7px; height: 7px; border-radius: 50%; background: #8B4DFF; animation: copPulse 1s infinite ease-in-out; }
.cop-load span:nth-child(2) { animation-delay: .15s; } .cop-load span:nth-child(3) { animation-delay: .3s; }
@keyframes copPulse { 0%, 100% { opacity: .25; transform: scale(.8); } 50% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .cop-load span { animation: none; } }
.transcr { font-size: 12.5px; line-height: 1.4; margin-top: 4px; padding: 5px 8px; border-radius: 8px; background: rgba(0,0,0,.06); color: var(--ink-2); font-style: italic; overflow-wrap: anywhere; }

/* Copiloto: instrução falada ou escrita da equipe */
.cop-instr { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.cop-mic { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; font-size: 17px; background: linear-gradient(160deg, #8B4DFF, #C2187A); color: #fff; display: grid; place-items: center; }
.cop-mic.gravando { background: #E5484D; animation: copPulse 1s infinite ease-in-out; }
.cop-instr .inp { min-width: 0; font-size: 12.5px; }

/* Foguinho ao vivo colado embaixo da foto: cliente quente */
.fogo-foto { display: none; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); font-size: 15px; line-height: 1; font-style: normal;
  filter: drop-shadow(0 0 4px rgba(255, 120, 0, .75)); pointer-events: auto; z-index: 2; }
.fogo-foto.on { display: block; animation: fogoVivo 1.1s ease-in-out infinite; transform-origin: 50% 100%; }
.chat-topo .fogo-foto { font-size: 14px; bottom: -7px; }
@keyframes fogoVivo {
  0%, 100% { transform: translateX(-50%) scale(1) rotate(-4deg); filter: drop-shadow(0 0 3px rgba(255, 120, 0, .6)); }
  50% { transform: translateX(-50%) scale(1.18) rotate(4deg); filter: drop-shadow(0 0 7px rgba(255, 70, 0, .95)); }
}
.av-caixa:has(.fogo-foto.on) .av { box-shadow: 0 0 0 2px rgba(255, 110, 0, .85), 0 0 10px rgba(255, 90, 0, .45); }
@media (prefers-reduced-motion: reduce) { .fogo-foto.on { animation: none; } }

/* Copiloto: layout organizado, nada passando da lateral (24/11) */
.pn-ficha { overflow-x: hidden; }
.cop { min-width: 0; max-width: 100%; overflow: hidden; gap: 10px; padding: 12px; }
.cop * { min-width: 0; box-sizing: border-box; }
.cop p, .cop small, .cop b, .cop li, .cop .cop-msg, .cop .cop-resumo { overflow-wrap: anywhere; word-break: normal; }
.cop-cab b { font-size: 14px; }
#cop-corpo { display: grid; gap: 8px; }
.cop-topo { gap: 8px; }
.cop-resumo { font-size: 13px; color: var(--ink); }
.cop-sec { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--line-2); font-size: 11px; }
.cop-obj { gap: 5px; padding: 9px 10px; border: 1px solid var(--line-2); }
.cop-obj b { font-size: 13px; }
.cop-obj .link-mini { justify-self: start; }
.cop-gat { list-style: none; padding: 0; margin: 0; display: grid; gap: 5px; }
.cop-gat li { font-size: 12.5px; padding: 6px 9px; border-radius: 8px; background: var(--bg); line-height: 1.35; }
.cop-of { display: grid; gap: 2px; font-size: 13px; padding: 8px 10px; border: 1px solid rgba(37, 211, 102, .35); background: rgba(37, 211, 102, .07); }
.cop-of em { font-size: 13.5px; }
.cop-msg { font-size: 13px; line-height: 1.5; padding: 9px 11px; }
.cop .mini-linha { display: grid; grid-template-columns: 1fr auto; gap: 6px; }
.cop .mini-linha .btn { justify-content: center; white-space: nowrap; }
.cop-rod { text-align: right; opacity: .8; }
/* instrução: microfone + campo numa linha, "Gerar" embaixo ocupando a largura */
.cop-instr { grid-template-columns: 38px minmax(0, 1fr); }
.cop-instr #cop-gerar { grid-column: 1 / -1; width: 100%; justify-content: center; }
.cop-mic { width: 38px; height: 38px; }
.cop-instr .inp { height: 38px; padding: 6px 10px; text-overflow: ellipsis; }
#cop-analisar { justify-content: center; }
.cop .mini-linha:has(.cop-sinal) { display: flex; flex-wrap: wrap; gap: 5px; }
.cop-sinal { white-space: normal; line-height: 1.3; }
/* Copiloto: não deixar a lateral espremer o card (overflow hidden + flex encolhia a altura) */
.cop { flex-shrink: 0; overflow: visible; overflow-x: clip; min-height: min-content; }

/* Selo de cliente vindo da loja de agências parceiras */
.vip-tag.parceira { background: rgba(14, 165, 233, .14); color: #0284C7; border: 1px solid rgba(14, 165, 233, .45); }
:root[data-theme="dark"] .vip-tag.parceira { color: #7DD3FC; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .vip-tag.parceira { color: #7DD3FC; } }

/* Microfone do copiloto: verde do WhatsApp, ícone branco, pulsando devagar */
.cop-mic { width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; color: #fff; display: grid; place-items: center; padding: 0;
  background: linear-gradient(150deg, #2BE07A 0%, #25D366 45%, #128C7E 100%);
  box-shadow: 0 2px 8px rgba(18, 140, 126, .35), 0 0 0 0 rgba(37, 211, 102, .55);
  animation: micZap 2.6s ease-in-out infinite; transition: transform .15s ease, filter .15s ease; }
.cop-mic svg { display: block; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18)); }
.cop-mic:hover { transform: scale(1.06); filter: brightness(1.06); }
.cop-mic:active { transform: scale(.94); }
.cop-mic:focus-visible { outline: 2px solid #25D366; outline-offset: 3px; }
@keyframes micZap {
  0%, 100% { box-shadow: 0 2px 8px rgba(18, 140, 126, .35), 0 0 0 0 rgba(37, 211, 102, .5); }
  50% { box-shadow: 0 2px 10px rgba(18, 140, 126, .45), 0 0 0 8px rgba(37, 211, 102, 0); }
}
.cop-mic.gravando { background: linear-gradient(150deg, #FF6B6F, #E5484D); animation: micRec 1.1s ease-in-out infinite; }
@keyframes micRec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, .55); }
  50% { box-shadow: 0 0 0 9px rgba(229, 72, 77, 0); }
}
.cop-mic.ouvindo { animation: none; cursor: wait; }
.cop-mic .gira { animation: girar-anel .9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .cop-mic, .cop-mic.gravando, .cop-mic .gira { animation: none; } }

/* Sugestão de reativação (painel) na lateral da conversa */
.reat { border-radius: 12px; margin-bottom: 12px; border: 1px solid var(--line-2); background: var(--bg-2, var(--bg)); overflow: hidden; min-width: 0; }
.reat > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-weight: 700; font-size: 13px; }
.reat > summary::-webkit-details-marker { display: none; }
.reat > summary::after { content: '▾'; margin-left: auto; opacity: .6; transition: transform .2s; }
.reat:not([open]) > summary::after { transform: rotate(-90deg); }
.reat-ico { font-size: 16px; flex: none; }
.reat-tit { min-width: 0; overflow-wrap: anywhere; }
.reat-corpo { display: grid; gap: 8px; padding: 0 12px 12px; min-width: 0; }
.reat-l { display: grid; gap: 1px; font-size: 12.5px; min-width: 0; }
.reat-l span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; opacity: .7; }
.reat-l b { font-weight: 600; overflow-wrap: anywhere; }
.reat-l em { font-style: normal; font-weight: 500; opacity: .8; }
.reat-pq { margin: 0; padding-left: 16px; font-size: 12px; display: grid; gap: 2px; opacity: .9; }
.reat-msg { font-size: 13px; line-height: 1.5; padding: 9px 11px; border-radius: 10px; background: rgba(37, 211, 102, .08); border: 1px solid rgba(37, 211, 102, .3); white-space: pre-wrap; overflow-wrap: anywhere; }
.reat-pix { border-color: rgba(245, 165, 36, .55); } .reat-pix > summary { color: #C98200; }
.reat-saldo { border-color: rgba(139, 77, 255, .5); }
.reat-quente { border-color: rgba(255, 110, 0, .55); } .reat-quente > summary { color: #E8590C; }
.reat-ok { border-color: rgba(37, 211, 102, .45); }
.reat-morno { border-color: rgba(245, 165, 36, .45); }
.reat-frio { border-color: rgba(56, 152, 236, .5); } .reat-frio > summary { color: #2F7FD1; }
.reat-novo { border-color: var(--line-2); }
.reat { flex-shrink: 0; overflow: visible; overflow-x: clip; min-height: min-content; } /* a lateral é flex: sem isso o cartão é espremido na altura */

/* Cliente digitando: 3 pontinhos pulando em onda (cobrinha) */
.cli-dig { display: flex; animation: digEntra .25s ease-out; }
.dig-bolha { display: inline-flex; align-items: center; gap: 4px; padding: 11px 14px !important; min-height: 0; }
.dig-bolha span { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3, #8a8f8c); animation: digPula 1.2s infinite ease-in-out; }
.dig-bolha span:nth-of-type(2) { animation-delay: .15s; }
.dig-bolha span:nth-of-type(3) { animation-delay: .3s; }
.dig-mic { font-style: normal; font-size: 12px; margin-right: 3px; }
@keyframes digPula { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-5px); opacity: 1; } }
@keyframes digEntra { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .dig-bolha span { animation: none; opacity: .7; } }

/* Respostas rápidas: busca + filtro por central */
.filtro-resp { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 12px; position: sticky; top: 0; z-index: 2; background: var(--bg, #f4f5f7); padding: 8px 0; }
.filtro-resp .busca { flex: 1 1 320px; max-width: 520px; }
.filtro-resp .sel { flex: 0 1 240px; }
.resp[hidden] { display: none !important; }

/* ===== Celular iOS/Android (29/11): toque de 44 px, cabeçalho em uma faixa, texto sem vazar ===== */
.layout, .login { min-height: 100dvh; }
.side { height: 100dvh; }
.conv .nome, .conv .ult, .bolha, .chat-topo .quem, .chip-card, .card, .linha-nome { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 860px) {
  body { overflow-x: clip; }
  .btn, .btn.sec, .btn.mini { min-height: 44px; }
  .btn.mini { min-width: 44px; }
  /* alvo de toque maior sem mudar o desenho dos botões pequenos */
  .chip, .ic-bt, .ap-ic { position: relative; }
  .chip::after, .ic-bt::after, .ap-ic::after { content: ""; position: absolute; inset: -6px -3px; }
  .ap-ic::after { inset: -9px; }
  /* cabeçalho: título numa linha, ações numa faixa que rola de lado (nada quebra em 3 linhas) */
  .main.cheia > .topo-cx, .topo-cx { flex-wrap: wrap !important; row-gap: 6px; padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right)); }
  .topo-cx > div:first-child { flex: 1 1 100%; min-width: 0; }
  .topo-cx h1, .main.cheia > .topo-cx h1 { font-size: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topo-cx .acoes-topo, .main.cheia > .topo-cx .acoes-topo { width: 100%; flex-wrap: nowrap !important; overflow-x: auto; gap: 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  .topo-cx .acoes-topo::-webkit-scrollbar { display: none; }
  .topo-cx .acoes-topo > * { flex: none; }
  .topo-cx .acoes-topo, .main.cheia > .topo-cx .acoes-topo { justify-content: flex-start !important; margin-left: 0 !important; }
  .main.cheia > .topo-cx .acoes-topo .btn-tema, .topo-cx .acoes-topo .btn-tema { font-size: 14px; }
  .pn-lista .ferr { scrollbar-width: none; }
  .pn-lista .ferr .chips > .chip { flex: none; }
  .pn-lista .ferr .chips { padding-block: 6px; margin-block: -6px; }
}

/* ===== Convite para instalar (10 s depois de entrar; só fora do painel) ===== */
.convite-app { position: fixed; z-index: 80; right: 20px; top: 20px; width: min(380px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line-2); border-radius: 16px; box-shadow: 0 14px 36px rgba(0, 0, 0, .28); padding: 14px; display: grid; grid-template-columns: 46px minmax(0, 1fr); gap: 10px 12px; animation: convite-in .35s ease; }
.convite-app.saindo { opacity: 0; transform: translateY(-10px); transition: .25s; }
.convite-ic { width: 46px; height: 46px; border-radius: 12px; }
.convite-tx { min-width: 0; overflow-wrap: anywhere; } .convite-tx > b { display: block; font-size: 14.5px; line-height: 1.3; margin-bottom: 3px; } .convite-tx span { font-size: 13px; color: var(--ink-2); line-height: 1.45; }
.convite-tx b.inline { display: inline; font-size: inherit; color: var(--ink); }
.ic-comp { display: inline-flex; width: 18px; height: 18px; vertical-align: -4px; color: #0A84FF; margin: 0 2px; } .ic-comp svg { width: 100%; height: 100%; }
.convite-bts { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
@keyframes convite-in { from { opacity: 0; transform: translateY(-12px); } }
/* no celular fica no alto (longe do campo de digitar e da barra de baixo), dentro das margens seguras */
@media (max-width: 860px) {
  .convite-app { left: calc(12px + env(safe-area-inset-left)); right: calc(12px + env(safe-area-inset-right)); width: auto; top: calc(8px + env(safe-area-inset-top)); }
  .convite-bts .btn { flex: 1; min-height: 44px; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) { .convite-app { animation: none; } }

/* ===== Trava do teste grátis na central ===== */
.trava-central { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; background: rgba(5, 10, 25, .72); padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.trava-central-caixa { width: min(440px, 100%); background: var(--surface); color: var(--ink); border-radius: 20px; padding: 24px 20px; text-align: center; box-shadow: 0 24px 60px rgba(0, 0, 0, .4); }
.trava-central-caixa h2 { margin: 0 0 8px; font-size: 22px; }
.trava-central-caixa p { color: var(--ink-2); margin: 0 0 16px; line-height: 1.5; overflow-wrap: anywhere; }
.trava-central-caixa .btn { min-height: 48px; justify-content: center; width: 100%; text-decoration: none; }

/* caixinhas de marcar maiores no celular (ligar/desligar do robô, fluxo, remarketing, VIP) */
@media (max-width: 860px) {
  input[type="checkbox"], input[type="radio"] { width: 22px; height: 22px; flex: none; }
}
