:root {
  --pa-chat-teal: #00d4c4;
  --pa-chat-cyan: #22d3ee;
  --pa-chat-blue: #2f80ed;
  --pa-chat-navy: #071426;
  --pa-chat-text: #172033;
}

.pa-chatbot, .pa-chatbot * { box-sizing: border-box; }
.pa-chatbot { position: fixed; right: 22px; bottom: 22px; z-index: 9999; font-family: Inter, "Segoe UI", Arial, sans-serif; }
.pa-chatbot button, .pa-chatbot input { font: inherit; }
.pa-chatbot button { -webkit-tap-highlight-color: transparent; }

.pa-chat-launcher {
  position: relative; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px;
  padding: 0; border: 1px solid rgba(255,255,255,.35); border-radius: 22px; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, var(--pa-chat-teal), var(--pa-chat-blue) 70%, #2563eb);
  box-shadow: 0 18px 44px rgba(21,103,190,.38), 0 0 0 7px rgba(0,212,196,.1);
  transition: transform .22s ease, box-shadow .22s ease, border-radius .22s ease;
}
.pa-chat-launcher:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 22px 52px rgba(21,103,190,.46), 0 0 0 8px rgba(0,212,196,.13); }
.pa-chat-launcher:focus-visible, .pa-minimize:focus-visible, .pa-chat-form button:focus-visible, .pa-quick-actions button:focus-visible, .pa-cta:focus-visible { outline: 3px solid #67e8f9; outline-offset: 3px; }
.pa-launcher-pulse { position: absolute; inset: -1px; border: 1px solid rgba(34,211,238,.75); border-radius: inherit; animation: pa-launcher-pulse 2.4s ease-out infinite; pointer-events: none; }
@keyframes pa-launcher-pulse { 0% { transform: scale(1); opacity: .65; } 75%,100% { transform: scale(1.36); opacity: 0; } }
.pa-chat-icon, .pa-close-icon { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: opacity .18s ease, transform .18s ease; }
.pa-close-icon { position: absolute; opacity: 0; transform: rotate(-60deg) scale(.7); }
.pa-launcher-label { position: absolute; right: 76px; padding: 9px 13px; border: 1px solid rgba(255,255,255,.12); border-radius: 11px; background: var(--pa-chat-navy); color: #fff; box-shadow: 0 10px 28px rgba(7,20,38,.25); font-size: 12px; font-weight: 700; white-space: nowrap; pointer-events: none; transition: opacity .2s ease, transform .2s ease; }
.pa-launcher-label::after { content: ""; position: absolute; right: -5px; top: 50%; width: 9px; height: 9px; background: var(--pa-chat-navy); transform: translateY(-50%) rotate(45deg); }

.pa-chat-window {
  position: absolute; right: 0; bottom: 78px; display: flex; flex-direction: column; width: min(390px, calc(100vw - 32px)); height: min(620px, calc(100vh - 118px));
  overflow: hidden; border: 1px solid rgba(30,152,195,.24); border-radius: 24px; background: #f7fafc;
  box-shadow: 0 28px 80px rgba(4,19,39,.28), 0 0 0 1px rgba(255,255,255,.75) inset;
  opacity: 0; visibility: hidden; transform: translateY(18px) scale(.96); transform-origin: bottom right; transition: opacity .2s ease, transform .24s ease, visibility .2s;
}
.pa-chatbot.is-open .pa-chat-window { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.pa-chatbot.is-open .pa-chat-icon { opacity: 0; transform: rotate(60deg) scale(.7); }
.pa-chatbot.is-open .pa-close-icon { opacity: 1; transform: rotate(0) scale(1); }
.pa-chatbot.is-open .pa-launcher-label { opacity: 0; transform: translateX(8px); }

.pa-chat-header { min-height: 82px; display: flex; align-items: center; gap: 12px; padding: 15px 16px; color: #fff; background: radial-gradient(circle at 20% 0, rgba(34,211,238,.32), transparent 42%), linear-gradient(130deg, #087f88, #1267b7 72%, #173f83); }
.pa-brand-mark { width: 47px; height: 47px; flex: 0 0 47px; display: grid; place-items: center; overflow: hidden; border: 1px solid rgba(255,255,255,.35); border-radius: 14px; background: #fff; box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.pa-brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.pa-brand-mark span { color: #087f88; font-size: 22px; font-weight: 900; }
.pa-chat-heading { min-width: 0; display: flex; flex: 1; flex-direction: column; gap: 5px; }
.pa-chat-heading strong { font-size: 15px; line-height: 1.2; letter-spacing: -.1px; }
.pa-chat-heading span { display: flex; align-items: center; gap: 6px; color: #d9fbff; font-size: 11px; }
.pa-chat-heading i { width: 7px; height: 7px; border-radius: 50%; background: #5eead4; box-shadow: 0 0 0 3px rgba(94,234,212,.16); }
.pa-minimize { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 11px; color: #fff; background: rgba(255,255,255,.1); cursor: pointer; }
.pa-minimize:hover { background: rgba(255,255,255,.18); }
.pa-minimize svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.pa-chat-messages { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 20px 16px 12px; scroll-behavior: smooth; scrollbar-width: thin; scrollbar-color: #b8d9df transparent; background: radial-gradient(circle at 100% 0, rgba(34,211,238,.08), transparent 34%), #f7fafc; }
.pa-message-row { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 14px; animation: pa-message-in .22s ease both; }
@keyframes pa-message-in { from { opacity: 0; transform: translateY(7px); } }
.pa-message-user { justify-content: flex-end; }
.pa-message-avatar { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border-radius: 9px; color: #fff; background: linear-gradient(135deg, #079a96, #2f80ed); box-shadow: 0 5px 13px rgba(47,128,237,.2); font-size: 11px; font-weight: 800; }
.pa-message-content { max-width: 82%; }
.pa-message-bubble { padding: 11px 13px; border-radius: 6px 17px 17px 17px; color: #27364b; background: #fff; border: 1px solid #dfebef; box-shadow: 0 6px 18px rgba(34,74,103,.07); font-size: 13px; line-height: 1.55; white-space: pre-wrap; }
.pa-message-user .pa-message-bubble { border: 0; border-radius: 17px 17px 6px 17px; color: #fff; background: linear-gradient(135deg, #087f88, #2475ca); box-shadow: 0 7px 20px rgba(30,106,175,.18); }
.pa-message-ctas { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.pa-cta { display: flex; align-items: center; justify-content: center; min-height: 36px; padding: 7px 8px; border-radius: 10px; font-size: 11px; font-weight: 800; text-decoration: none !important; transition: transform .18s ease, box-shadow .18s ease; }
.pa-cta:hover { transform: translateY(-1px); }
.pa-cta-call { color: #0a5e67 !important; border: 1px solid #9be8e1; background: #e7fffc; }
.pa-cta-whatsapp { color: #fff !important; background: #18a85b; box-shadow: 0 6px 14px rgba(24,168,91,.18); }
.pa-typing { display: flex; gap: 4px; padding: 13px 15px; border: 1px solid #dfebef; border-radius: 6px 17px 17px 17px; background: #fff; }
.pa-typing i { width: 6px; height: 6px; border-radius: 50%; background: #55aeba; animation: pa-typing 1s ease-in-out infinite; }
.pa-typing i:nth-child(2) { animation-delay: .15s; }.pa-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes pa-typing { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }

.pa-quick-actions { display: flex; gap: 7px; overflow-x: auto; padding: 9px 14px; background: #fff; border-top: 1px solid #e7eef1; scrollbar-width: none; }
.pa-quick-actions::-webkit-scrollbar { display: none; }
.pa-quick-actions button { flex: 0 0 auto; padding: 7px 10px; border: 1px solid #b9e4e6; border-radius: 999px; color: #096c76; background: #effcfc; cursor: pointer; font-size: 10px; font-weight: 750; }
.pa-quick-actions button:hover { border-color: #36cfc9; background: #e1fbf8; }
.pa-chat-form { display: flex; align-items: center; gap: 8px; padding: 10px 12px 9px; border-top: 1px solid #e1eaee; background: #fff; }
.pa-chat-form input { min-width: 0; height: 44px; flex: 1; padding: 0 14px; border: 1px solid #d4e3e8; border-radius: 13px; outline: none; color: var(--pa-chat-text); background: #f8fbfc; font-size: 13px; }
.pa-chat-form input::placeholder { color: #8294a7; }
.pa-chat-form input:focus { border-color: #3fc9cd; box-shadow: 0 0 0 3px rgba(34,211,238,.13); background: #fff; }
.pa-chat-form button { width: 44px; height: 44px; flex: 0 0 44px; display: grid; place-items: center; border: 0; border-radius: 13px; color: #fff; background: linear-gradient(135deg, #08a99e, #2f80ed); box-shadow: 0 8px 18px rgba(47,128,237,.22); cursor: pointer; }
.pa-chat-form button:hover { filter: brightness(1.05); transform: translateY(-1px); }
.pa-chat-form button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pa-chat-footer { padding: 0 12px 9px; color: #8493a3; background: #fff; font-size: 9px; font-weight: 650; letter-spacing: .35px; text-align: center; }
.pa-chatbot .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; }

@media (max-width: 600px) {
  .pa-chatbot { right: 12px; bottom: 12px; }
  .pa-chat-launcher { width: 58px; height: 58px; border-radius: 19px; }
  .pa-launcher-label { display: none; }
  .pa-chat-window { position: fixed; inset: 10px 10px 82px; width: auto; height: auto; max-height: none; border-radius: 20px; transform-origin: bottom center; }
  .pa-chat-header { min-height: 74px; padding: 12px 14px; }
  .pa-message-content { max-width: 86%; }
}

@media (prefers-reduced-motion: reduce) {
  .pa-chatbot *, .pa-chatbot *::before, .pa-chatbot *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
