/* Widget de chat — cores vêm da página: --chat-cor, --chat-cor-texto, --chat-fundo, --chat-linha, --chat-bot */
.chatw { min-width: 0; max-width: 100%; --cc: var(--chat-cor, #1F5C55); --cct: var(--chat-cor-texto, #fff); --cf: var(--chat-fundo, #fff); --cl: var(--chat-linha, #DDE5E3); --cb: var(--chat-bot, #EEF3F2);
  display: flex; flex-direction: column; background: var(--cf); border: 1px solid var(--cl); border-radius: 20px; overflow: hidden; height: 100%; min-height: 0; font-size: 15px; line-height: 1.5; }
.chatw-topo { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--cl); }
.chatw-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--cc); color: var(--cct); display: grid; place-items: center; font-weight: 700; flex-shrink: 0; position: relative; }
.chatw-avatar::after { content: ''; position: absolute; right: 0; bottom: 0; width: 10px; height: 10px; border-radius: 50%; background: #2FB26A; border: 2px solid var(--cf); }
.chatw-quem { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chatw-quem strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chatw-quem small { opacity: .65; font-size: 12.5px; }
.chatw-novo { font: inherit; font-size: 12.5px; background: none; border: 1px solid var(--cl); border-radius: 99px; padding: 5px 11px; cursor: pointer; color: inherit; opacity: .8; }
.chatw-novo:hover { opacity: 1; border-color: var(--cc); }

.chatw-msgs { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 0; scroll-behavior: smooth; }
.chatw-msg { max-width: 86%; padding: 9px 13px; border-radius: 16px; word-wrap: break-word; animation: chatw-entra .18s ease-out; }
.chatw-msg p { margin: 0 0 6px; } .chatw-msg p:last-child { margin: 0; }
.chatw-msg ul { margin: 4px 0 6px; padding-left: 18px; } .chatw-msg li { margin: 2px 0; }
.chatw-msg.bot { background: var(--cb); align-self: flex-start; border-bottom-left-radius: 5px; }
.chatw-msg.eu { background: var(--cc); color: var(--cct); align-self: flex-end; border-bottom-right-radius: 5px; }
.chatw-msg.humano { border: 1px solid var(--cc); background: var(--cf); }
.chatw-msg.erro { background: #FDECEC; color: #8A2323; }
.chatw-rotulo { display: block; font-size: 11.5px; font-weight: 700; color: var(--cc); margin-bottom: 2px; }
.chatw-digitando { display: flex; gap: 4px; padding: 13px 15px; }
.chatw-digitando span { width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .35; animation: chatw-pula 1.1s infinite; }
.chatw-digitando span:nth-child(2) { animation-delay: .15s; } .chatw-digitando span:nth-child(3) { animation-delay: .3s; }

.chatw-cartoes { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 8px; margin: 0 -4px; scroll-snap-type: x mandatory; flex-shrink: 0; }
.chatw-cartao { flex: 0 0 236px; scroll-snap-align: start; background: var(--cf); border: 1px solid var(--cl); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; animation: chatw-entra .25s ease-out; }
.chatw-link { margin-top: 10px; align-self: stretch; text-align: center; font-weight: 700; font-size: 14px; background: var(--cc); color: var(--cct); border-radius: 99px; padding: 8px 12px; text-decoration: none; }
.chatw-link:hover { filter: brightness(1.1); }
.chatw-link:focus-visible { outline: 3px solid var(--cc); outline-offset: 2px; }
.chatw-cartao.sem-foto { flex-basis: min(300px, 100%); border-top: 4px solid var(--cc); }
.chatw-cartao ul { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; }
.chatw-cartao li { padding: 3px 0; border-top: 1px dashed var(--cl); }
.chatw-cartao li:first-child { border-top: 0; }
.chatw-cartao img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--cb); }
.chatw-cartao-corpo { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.chatw-cartao h4 { margin: 0; font-size: 14.5px; line-height: 1.3; }
.chatw-cartao p { margin: 0; font-size: 13.5px; opacity: .75; }
.chatw-cartao small { font-size: 12.5px; opacity: .7; }
.chatw-cartao-destaque { color: var(--cc); font-size: 16px; font-variant-numeric: tabular-nums; }
.chatw-cartao button { margin-top: auto; align-self: flex-start; font: inherit; font-size: 13px; font-weight: 600; background: none; color: var(--cc); border: 1px solid var(--cc); border-radius: 99px; padding: 5px 12px; cursor: pointer; }
.chatw-cartao-corpo > button { margin-top: 8px; }
.chatw-cartao button:hover { background: var(--cc); color: var(--cct); }
.chatw-cartao button:focus-visible { outline: 3px solid var(--cc); outline-offset: 2px; }
.chatw-sugestoes { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }
.chatw-sugestoes:empty { display: none; }
.chatw-sugestoes button { font: inherit; font-size: 13.5px; background: var(--cf); color: var(--cc); border: 1px solid var(--cc); border-radius: 99px; padding: 6px 12px; cursor: pointer; }
.chatw-sugestoes button:hover { background: var(--cc); color: var(--cct); }

.chatw-form { display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--cl); }
.chatw-clipe { width: 40px; height: 44px; display: grid; place-items: center; cursor: pointer; color: var(--cc); border-radius: 12px; flex-shrink: 0; }
.chatw-clipe[hidden] { display: none; }
.chatw-clipe:hover { background: var(--cb); }
.chatw-clipe:focus-within { outline: 3px solid var(--cc); outline-offset: 1px; }
.chatw-previa { display: block; max-width: 180px; max-height: 220px; border-radius: 10px; margin-bottom: 6px; }
.chatw-pdf { display: inline-block; font-size: 12px; font-weight: 800; background: var(--cct); color: var(--cc); border-radius: 6px; padding: 2px 8px; margin-bottom: 6px; }
.chatw-form textarea { flex: 1; font: inherit; resize: none; border: 1px solid var(--cl); border-radius: 14px; padding: 10px 13px; max-height: 120px; background: var(--cf); color: inherit; }
.chatw-form textarea:focus { outline: 2px solid var(--cc); outline-offset: -1px; border-color: transparent; }
.chatw-form button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--cc); color: var(--cct); cursor: pointer; display: grid; place-items: center; flex-shrink: 0; }
.chatw-form button:focus-visible, .chatw-novo:focus-visible, .chatw-sugestoes button:focus-visible { outline: 3px solid var(--cc); outline-offset: 2px; }
.chatw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

@keyframes chatw-entra { from { opacity: 0; transform: translateY(6px); } }
@keyframes chatw-pula { 0%, 60%, 100% { transform: none; opacity: .35; } 30% { transform: translateY(-4px); opacity: .8; } }
@media (prefers-reduced-motion: reduce) { .chatw-msg, .chatw-digitando span { animation: none; } .chatw-msgs { scroll-behavior: auto; } }

/* Falar com um consultor */
.chatw-consultor { padding: 0 12px 8px; display: flex; flex-direction: column; gap: 6px; }
.chatw-consultor[hidden], .chatw-escolha[hidden] { display: none !important; }
.chatw-btn-consultor { font: inherit; font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 7px; align-self: center; background: var(--cf); color: var(--cc); border: 1px dashed var(--cc); border-radius: 99px; padding: 6px 14px; cursor: pointer; }
.chatw-btn-consultor:hover { background: var(--cb); border-style: solid; }
.chatw-escolha { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; font-size: 13px; }
.chatw-escolha span { width: 100%; text-align: center; opacity: .75; }
.chatw-escolha button { font: inherit; font-size: 13.5px; font-weight: 600; background: var(--cc); color: var(--cct); border: 0; border-radius: 99px; padding: 7px 14px; cursor: pointer; }
.chatw-escolha button:hover { filter: brightness(1.1); }
.chatw-btn-consultor:focus-visible, .chatw-escolha button:focus-visible { outline: 3px solid var(--cc); outline-offset: 2px; }

.chatw-nota { align-self: center; font-size: 12.5px; opacity: .7; text-align: center; padding: 2px 10px; }
