body #abre-chat { right: 23px; bottom: max(24px, env(safe-area-inset-bottom)); width: 58px; height: 58px; border-radius: 50%; background: #22c76e; color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .12); transition: background-color 180ms ease; }
body #abre-chat:hover { background: #19ad5e; }
body #abre-chat svg { width: 24px; height: 24px; }
.chat-invite { position: fixed; z-index: 40; right: 93px; bottom: max(28px, calc(env(safe-area-inset-bottom) + 4px)); display: flex; align-items: center; gap: .5rem; max-width: min(360px, calc(100vw - 110px)); padding: 12px 16px; border: 1px solid #e2e8f0; border-radius: 12px; background: #fff; color: #0f172a; font: 400 .875rem/1.4 var(--font-body); box-shadow: 0 4px 16px rgba(15, 23, 42, .1); opacity: 0; transform: translateX(8px); transition: opacity 250ms ease-out, transform 250ms ease-out; pointer-events: none; }
.chat-invite[hidden] { display: none; }
.chat-invite.is-visible { opacity: 1; transform: translateX(0); pointer-events: auto; }
.chat-invite__open { padding: 0; border: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.chat-invite__close { display: inline-flex; flex: none; width: 32px; height: 32px; align-items: center; justify-content: center; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #475569; font-size: 1.25rem; cursor: pointer; }
.chat-invite :is(button):focus-visible { outline: 2px solid #008b63; outline-offset: 3px; }
@media (max-width: 639px) { .chat-invite { right: 25px; bottom: max(94px, calc(env(safe-area-inset-bottom) + 74px)); max-width: min(260px, calc(100vw - 50px)); } }
@media (prefers-reduced-motion: reduce) { .chat-invite { transition: none; transform: none; } }
@media (max-width: 639px) { body #abre-chat { right: 25px; bottom: max(28px, calc(env(safe-area-inset-bottom) + 4px)); width: 54px; height: 54px; } }
#chat-panel { inset: auto 1.5rem 6rem auto; width: min(420px, calc(100vw - 3rem)); height: min(680px, 85vh); height: min(680px, 85dvh); max-height: calc(100vh - 7rem); max-height: calc(100dvh - 7rem); border-radius: 1rem; overflow: hidden; }
#chat-panel.chat-expanded { width: min(900px, 92vw); height: 90vh; height: 90dvh; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); bottom: 1rem; }
body.public-theme #chat-panel > header, body.panel-theme #chat-panel > header { background: #008b63; }
.chat-heading { display: flex; min-width: 0; align-items: flex-start; gap: .5rem; }
.chat-heading__icon { flex: none; width: 1.25rem; height: 1.25rem; margin-top: .15rem; color: #fff; }
#chat-panel #chat-titulo { color: #fff; font-size: 1rem; font-weight: 600; }
#chat-panel #chat-status { color: #cbd5e1; font-size: .75rem; line-height: 1.35; }
.chat-controls { display: flex; flex: none; align-items: center; gap: .125rem; }
.chat-controls button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: .5rem; color: rgba(255, 255, 255, .85); transition: background-color 180ms ease; }
.chat-controls button:hover { background: rgba(255, 255, 255, .12); }
.chat-controls button:focus-visible { outline: 2px solid #fff; outline-offset: -3px; }
.chat-controls svg, #chat-enviar svg, .chat-minimized svg { width: 20px; height: 20px; }
.chat-icon-restore, .chat-expanded .chat-icon-maximize { display: none; }
.chat-expanded .chat-icon-restore { display: block; }
.chat-composer { display: flex; align-items: flex-end; gap: .5rem; }
body.public-theme #chat-pergunta, body.panel-theme #chat-pergunta { flex: 1; min-width: 0; min-height: 48px; height: 48px; max-height: 120px; resize: none; overflow-y: hidden; padding: .75rem; }
body.public-theme #chat-pergunta:focus-visible, body.panel-theme #chat-pergunta:focus-visible { outline: 2px solid #008b63; outline-offset: 1px; box-shadow: none; }
#chat-panel #chat-form label { color: #596579; font-weight: 600; letter-spacing: .025em; }
#chat-panel #chat-contador { color: #596579; }
#chat-panel #chat-rolagem { background: #fff; }
#chat-panel.chat-expanded :is(#chat-atalhos, #chat-mensagens, #chat-fallback) { width: 100%; max-width: 720px; margin-inline: auto; }
body #chat-enviar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 48px; height: 48px; min-height: 48px; border-radius: .75rem; background: #008b63; color: #fff; }
body #chat-enviar:hover:not(:disabled) { background: #007a57; }
body.panel-theme #chat-enviar:not(:disabled) { background: #008b63; }
body.panel-theme #chat-enviar:hover:not(:disabled) { background: #007a57; }
body #chat-enviar:focus-visible { outline: 2px solid #008b63; outline-offset: 3px; }
body #chat-enviar:disabled { background: #e2e8e4; color: #596579; cursor: not-allowed; }
body #chat-enviar[aria-busy="true"] svg { opacity: .55; }
.chat-legal { padding: .375rem 1rem max(.5rem, env(safe-area-inset-bottom)); background: #fff; color: #64748b; font-size: .8125rem; line-height: 1.4; }
.chat-legal__line { display: inline-flex; align-items: center; gap: .375rem; }
.chat-legal__line svg { flex: none; width: 1rem; height: 1rem; color: #008b63; }
.chat-legal__details { margin: 0; }
.chat-legal__details summary { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: .75rem; cursor: pointer; list-style: none; }
.chat-legal__more { flex: none; color: #006b51; font-weight: 600; text-decoration: underline; text-underline-offset: .15em; }
.chat-legal__details summary::-webkit-details-marker { display: none; }
.chat-legal__details summary:focus-visible { outline: 2px solid #008b63; outline-offset: 2px; }
.chat-legal__details p { margin: .375rem 0 0; }
#chat-panel .chat-user-bubble { max-width: 85%; padding: .75rem 1rem; border-radius: 1rem; background: #e8f4ee; color: #17212b; box-shadow: none; }
#chat-panel .chat-assistant-bubble { width: fit-content; max-width: min(100%, 720px); margin-right: 0; padding: .25rem 0; border: 0; border-radius: 0; background: #fff; color: #17212b; box-shadow: none; line-height: 1.6; }
#chat-panel .chat-assistant-bubble p + p { margin-top: .75rem; }
#chat-panel .chat-assistant-bubble :is(ul, ol) { margin-block: .75rem; padding-left: 1.5rem; }
#chat-panel .chat-assistant-bubble a:not(.chat-whatsapp-action) { color: #006b51; text-decoration: underline; text-underline-offset: .2em; }
#chat-panel .chat-unavailable, #chat-panel .chat-message-error { max-width: 720px; padding: 1rem; border: 1px solid #e2e8f0; border-radius: .75rem; background: #f8fafc; color: #17212b; font-size: .875rem; line-height: 1.55; }
#chat-panel .chat-unavailable__heading { display: flex; align-items: flex-start; gap: .5rem; }
#chat-panel .chat-unavailable__heading svg { flex: none; width: 1.25rem; height: 1.25rem; color: #596579; }
#chat-panel .chat-unavailable h3 { color: #0f172a; font-size: 1rem; line-height: 1.35; font-weight: 600; }
#chat-panel .chat-unavailable p { margin-top: .5rem; color: #475569; }
#chat-panel .chat-unavailable__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
#chat-panel .chat-whatsapp-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: .75rem; padding: .5rem .875rem; border-radius: .75rem; background: #216447; color: #fff; font-weight: 600; text-align: center; text-decoration: none; }
#chat-panel .chat-unavailable__actions .chat-whatsapp-action { margin-top: 0; }
#chat-panel .chat-whatsapp-action:hover { background: #194c36; color: #fff; }
#chat-panel .chat-whatsapp-action:focus-visible { outline: 2px solid #008b63; outline-offset: 2px; }
.chat-minimized:not([hidden]) { position: fixed; z-index: 50; right: 1.5rem; bottom: max(1.5rem, env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 1rem; min-height: 48px; padding: .75rem 1rem; border-radius: .75rem; background: #171d25; color: #fff; font-weight: 600; box-shadow: 0 4px 16px rgba(0, 0, 0, .16); }
.chat-minimized:focus-visible { outline: 2px solid #008b63; outline-offset: 3px; }
/* Estado inicial e controles compactos da conversa. */
body.public-theme #chat-panel > header, body.panel-theme #chat-panel > header { align-items: center; min-height: 64px; padding: .625rem 1rem; }
#chat-panel #chat-status { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
#chat-panel #chat-titulo { font-size: 1rem; white-space: nowrap; }
#chat-panel.chat-expanded > header { min-height: 64px; }
#chat-panel #chat-rolagem { padding: 1.25rem; }
#chat-atalhos { width: 100%; text-align: center; }
.chat-welcome__icon { display: inline-grid; width: 3rem; height: 3rem; place-items: center; border-radius: 50%; background: #e8f4ee; color: #008b63; }
.chat-welcome__icon svg { width: 1.5rem; height: 1.5rem; }
#chat-panel .chat-welcome__title { margin-top: .75rem; color: #0f172a; font-size: 1.125rem; line-height: 1.35; font-weight: 600; }
#chat-panel .chat-welcome__description { margin-top: .375rem; color: #596579; font-size: .875rem; line-height: 1.5; }
.chat-suggestions { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; width: 100%; max-width: 420px; margin: 1.25rem auto 0; }
.chat-suggestions button { min-height: 44px; max-width: 100%; padding: .625rem .875rem; border: 1px solid #e2e8f0; border-radius: .75rem; background: #f8fafc; color: #0f172a; font-size: .875rem; font-weight: 600; text-align: left; }
.chat-suggestions button:hover { background: #e8f4ee; }
.chat-suggestions button:focus-visible { outline: 2px solid #008b63; outline-offset: -2px; }
#chat-panel .chat-counter { color: #596579; font-size: .75rem; line-height: 1.25; text-align: right; }
@media (min-width: 640px) and (max-width: 1023px) {
    #chat-panel.chat-expanded #chat-rolagem { padding-left: 4rem; }
}
@media (max-width: 639px) {
    #chat-panel { inset: auto 0 0; width: 100%; height: min(680px, 85vh); height: min(680px, 85dvh); max-height: none; border-radius: 1rem 1rem 0 0; }
    #chat-panel.chat-expanded { inset: 0; width: 100%; height: 100vh; height: 100dvh; max-height: none; border-radius: 0; padding-top: env(safe-area-inset-top); }
    #chat-panel #chat-rolagem { padding-left: 4rem; }
    .chat-minimized:not([hidden]) { right: 1.5rem; bottom: max(1.5rem, env(safe-area-inset-bottom)); }
}
