.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.chat-widget { position: fixed; right: 24px; bottom: 24px; z-index: 35; width: 64px; height: 64px; }
.chat-launcher { position: absolute; right: 0; bottom: 0; width: 62px; height: 62px; display: grid; place-items: center; padding: 0; color: var(--white); border: 1px solid rgba(255,255,255,.6); border-radius: 50%; background: var(--blue); box-shadow: 0 14px 30px rgba(8,21,36,.28); cursor: pointer; transition: transform .2s ease, background .2s ease; }
.chat-launcher:hover, .chat-launcher:focus-visible { background: #075aa9; transform: translateY(-3px); outline: none; }
.chat-launcher svg { width: 29px; height: 29px; }
.chat-launcher::after { content: "Fale com a Bia"; position: absolute; right: 72px; bottom: 17px; padding: 7px 10px; color: var(--white); border-radius: 4px; background: var(--navy); font: 700 .72rem "DM Sans", sans-serif; white-space: nowrap; opacity: 0; pointer-events: none; transform: translateX(5px); transition: opacity .2s ease, transform .2s ease; }
.chat-launcher:hover::after, .chat-launcher:focus-visible::after { opacity: 1; transform: translateX(0); }
.chat-panel { position: absolute; right: 0; bottom: 76px; width: min(380px, calc(100vw - 28px)); height: min(590px, calc(100vh - 110px)); min-height: 420px; display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; border: 1px solid rgba(8,21,36,.18); background: var(--white); box-shadow: 0 24px 70px rgba(8,21,36,.28); opacity: 0; pointer-events: none; visibility: hidden; transform: translateY(12px) scale(.98); transform-origin: bottom right; transition: opacity .2s ease, transform .2s ease, visibility .2s ease; }
.chat-widget.open .chat-panel, .chat-widget:focus-within .chat-panel { opacity: 1; pointer-events: auto; visibility: visible; transform: translateY(0) scale(1); }
.chat-widget.chat-closed-by-user .chat-panel { opacity: 0; pointer-events: none; visibility: hidden; transform: translateY(12px) scale(.98); }
.chat-header { display: flex; align-items: center; gap: 12px; padding: 17px 18px; color: var(--white); background: var(--navy); }
.chat-avatar { width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 auto; color: var(--navy); border-radius: 50%; background: #65b9f2; font: 700 1.1rem "Space Grotesk", sans-serif; }
.chat-header strong, .chat-header span { display: block; }
.chat-header strong { font: 700 1rem "Space Grotesk", sans-serif; }
.chat-header span { margin-top: 2px; color: #aec0d1; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; }
.chat-close { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; margin-left: auto; color: #aec0d1; border: 1px solid rgba(255,255,255,.2); background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.chat-close:hover, .chat-close:focus-visible { color: var(--white); border-color: rgba(255,255,255,.6); outline: none; }
.chat-messages { display: flex; flex-direction: column; gap: 12px; overflow-y: auto; padding: 18px 15px; background: #f4f8fb; }
.chat-message { max-width: 88%; display: flex; flex-direction: column; gap: 7px; }
.chat-message.user { align-self: flex-end; align-items: flex-end; }
.chat-message.assistant { align-self: flex-start; }
.chat-bubble { padding: 11px 13px; color: var(--ink); border: 1px solid var(--line); border-radius: 3px 14px 14px 14px; background: var(--white); font-size: .86rem; line-height: 1.55; white-space: pre-wrap; }
.chat-message.user .chat-bubble { color: var(--white); border-color: var(--blue); border-radius: 14px 3px 14px 14px; background: var(--blue); }
.chat-whatsapp { display: inline-flex; width: max-content; max-width: 100%; padding: 8px 10px; color: #fff; border-radius: 3px; background: #168c55; font-size: .75rem; font-weight: 700; }
.chat-whatsapp:hover, .chat-whatsapp:focus-visible { background: #117043; outline: none; }
.chat-typing .chat-bubble { display: inline-flex; gap: 4px; padding-block: 14px; }
.chat-typing .chat-bubble span { width: 5px; height: 5px; border-radius: 50%; background: #7c8c9c; animation: chat-dot 1s infinite ease-in-out; }
.chat-typing .chat-bubble span:nth-child(2) { animation-delay: .15s; }
.chat-typing .chat-bubble span:nth-child(3) { animation-delay: .3s; }
@keyframes chat-dot { 0%, 60%, 100% { opacity: .35; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-3px); } }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 9px; padding: 13px; border-top: 1px solid var(--line); background: var(--white); }
.chat-form textarea { min-height: 44px; max-height: 115px; padding: 11px 12px; color: var(--ink); border: 1px solid #c8d5df; outline: none; background: #f9fbfc; font: 400 .85rem "DM Sans", sans-serif; resize: vertical; }
.chat-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(9,104,199,.1); }
.chat-send { align-self: end; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; color: var(--white); border: 0; background: var(--blue); font: 700 .78rem "DM Sans", sans-serif; cursor: pointer; }
.chat-send:hover, .chat-send:focus-visible { background: #075aa9; outline: none; }
.chat-send:disabled { opacity: .55; cursor: wait; }

@media (max-width: 640px) {
  .chat-widget { right: 14px; bottom: 14px; }
  .chat-panel { right: -2px; bottom: 74px; width: min(380px, calc(100vw - 28px)); height: min(590px, calc(100vh - 95px)); }
  .chat-launcher::after { display: none; }
}
