/* Assistente virtual de triagem — janela de conversa (usa as variáveis do style.css) */
.assist-painel {
    position: fixed; right: 24px; bottom: 96px; z-index: 1200;
    width: min(390px, calc(100vw - 32px)); height: min(600px, calc(100vh - 140px));
    display: none; flex-direction: column;
    background: var(--navy, #0f1f38); border: 1px solid var(--border, rgba(201,168,76,.25));
    border-radius: 10px; box-shadow: 0 18px 48px rgba(0,0,0,.45); overflow: hidden;
    font-family: var(--font-body, 'Lato', sans-serif);
}
.assist-painel.aberto { display: flex; }

.assist-topo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--navy-dark, #0a1628); border-bottom: 1px solid var(--border, rgba(201,168,76,.25)); }
.assist-titulo { margin: 0; font-family: var(--font-display, 'Playfair Display', serif); font-size: 17px; color: var(--gold-light, #e0c46a); }
.assist-sub { margin: 3px 0 0; font-size: 12px; line-height: 1.45; color: var(--text-muted, #a9b6c8); }
.assist-fechar { background: none; border: 0; color: var(--text, #d6dde8); font-size: 26px; line-height: 1; cursor: pointer; padding: 0 4px; }
.assist-fechar:hover, .assist-fechar:focus-visible { color: var(--gold-light, #e0c46a); }

.assist-lista { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.assist-msg { margin: 0; max-width: 86%; padding: 10px 13px; border-radius: 12px; font-size: 14.5px; line-height: 1.55; white-space: pre-wrap; word-wrap: break-word; }
.assist-msg-assistente { align-self: flex-start; background: rgba(255,255,255,.06); color: var(--text, #d6dde8); border-bottom-left-radius: 4px; }
.assist-msg-cliente { align-self: flex-end; background: rgba(201,168,76,.16); color: var(--off-white, #f4f1ea); border-bottom-right-radius: 4px; }
.assist-msg-sistema { align-self: center; max-width: 100%; background: none; color: var(--text-muted, #a9b6c8); font-size: 13px; font-style: italic; text-align: center; }

.assist-digitando { display: inline-flex; gap: 5px; align-items: center; }
.assist-digitando span { width: 7px; height: 7px; border-radius: 50%; background: var(--gold, #c9a84c); opacity: .35; animation: assistPulso 1.2s infinite; }
.assist-digitando span:nth-child(2) { animation-delay: .2s; }
.assist-digitando span:nth-child(3) { animation-delay: .4s; }
@keyframes assistPulso { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }

.assist-final { align-self: stretch; padding: 14px; border: 1px solid var(--gold, #c9a84c); border-radius: 10px; background: rgba(201,168,76,.07); }
.assist-final p { margin: 0 0 12px; font-size: 14px; line-height: 1.55; color: var(--text, #d6dde8); }
.assist-wa { display: block; text-align: center; padding: 12px 14px; border-radius: 6px; background: #25d366; color: #06301a; font-weight: 700; font-size: 14px; text-decoration: none; }
.assist-wa:hover, .assist-wa:focus-visible { background: #2fe375; }
.assist-nova { display: block; margin: 10px auto 0; background: none; border: 0; color: var(--gold-light, #e0c46a); font-size: 13px; text-decoration: underline; cursor: pointer; }

.assist-form { position: relative; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border-dim, rgba(255,255,255,.08)); }
.assist-hp, .assist-rotulo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.assist-campo { flex: 1; resize: none; min-height: 44px; max-height: 120px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border, rgba(201,168,76,.25)); background: rgba(255,255,255,.04); color: var(--off-white, #f4f1ea); font-size: 15px; line-height: 1.4; }
.assist-campo:focus { outline: 2px solid var(--gold, #c9a84c); outline-offset: 1px; }
.assist-enviar { flex: 0 0 44px; border: 0; border-radius: 8px; background: var(--gold, #c9a84c); color: var(--navy-dark, #0a1628); cursor: pointer; display: grid; place-items: center; }
.assist-enviar svg { width: 20px; height: 20px; }
.assist-enviar:disabled, .assist-campo:disabled { opacity: .5; cursor: not-allowed; }

.assist-rodape { padding: 4px 12px 12px; }
.assist-rodape p { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--text-muted, #a9b6c8); text-align: center; }
.assist-rodape a { color: var(--gold-light, #e0c46a); }
.assist-agora { display: block; width: 100%; padding: 9px 10px; border-radius: 6px; border: 1px solid var(--gold, #c9a84c); background: rgba(201,168,76,.10); color: var(--gold-light, #e0c46a); font-size: 13px; font-weight: 700; cursor: pointer; }
.assist-agora[hidden] { display: none; }
.assist-anexar { display: block; width: 100%; margin-bottom: 6px; padding: 9px 10px; border-radius: 6px; border: 1px dashed var(--gold, #c9a84c); background: transparent; color: var(--gold-light, #e0c46a); font-size: 13px; font-weight: 700; cursor: pointer; }
.assist-anexar::before { content: "📎 "; }
.assist-anexar[hidden], .assist-nota-anexo[hidden] { display: none; }
.assist-anexar:disabled { opacity: .5; cursor: not-allowed; }
.assist-rodape .assist-nota-anexo { margin: 0 0 8px; font-size: 11.5px; }
.assist-agora:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 600px) {
    .assist-painel { right: 0; bottom: 0; width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
    html.assist-ativo .whatsapp-float { display: none; }
    html.assist-ativo body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .assist-digitando span { animation: none; opacity: .7; } }
