/* ═══════════════════════════════════════════════════════
   AI Chatbot Widget  ·  v2.2  ·  Premium Chat Experience
   
   Design language: "Soft Luxury"
   — Warm off-white message area with depth
   — Inky, refined header with shimmer overlay
   — iMessage-quality bubble grouping
   — Silky spring physics on every interaction
   — Frosted glass lead capture card
   
   Font: Geist (modern, warm, slightly rounded)
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&display=swap');

/* ─── ROOT TOKENS ─── */
#aicb {
  position: fixed;
  z-index: 2147483647;

  /* Physics */
  --spring:  cubic-bezier(.34, 1.56, .64, 1);
  --snappy:  cubic-bezier(.2,  0,    0,   1);
  --ease:    cubic-bezier(.4,  0,   .2,   1);

  /* Neutrals */
  --white:   #ffffff;
  --bg:      #f0f1f8;       /* message area: cool-warm blend */
  --surf:    #f7f8fc;
  --brd:     rgba(0,0,0,.07);
  --brd2:    rgba(0,0,0,.11);
  --ink:     #0e1017;
  --ink2:    #44495f;
  --ink3:    #9196b0;
  --ink4:    #bbbfd4;

  /* Shadows */
  --sh-fab:  0 8px 32px rgba(0,0,0,.26), 0 2px 8px rgba(0,0,0,.14);
  --sh-win:  0 32px 80px rgba(0,0,0,.22), 0 6px 24px rgba(0,0,0,.1);
  --sh-msg:  0 1px 2px rgba(0,0,0,.05), 0 2px 8px rgba(0,0,0,.04);
  --sh-card: 0 24px 60px rgba(0,0,0,.14), 0 4px 16px rgba(0,0,0,.06);
}

#aicb, #aicb * {
  box-sizing: border-box;
  margin: 0; padding: 0;
  font-family: 'Geist', 'Inter', system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
#aicb button { cursor: pointer; border: none; background: none; }
#aicb a      { text-decoration: none; }
#aicb img    { display: block; }

#aicb.aicb-pos-bottom-right { right: 24px; bottom: 24px; }
#aicb.aicb-pos-bottom-left  { left:  24px; bottom: 24px; }


/* ═══════════════════════════════════════════════════════
   FAB
═══════════════════════════════════════════════════════ */
#aicb-fab {
  position: relative;
  width: 60px; height: 60px;
  border-radius: 50%;
  box-shadow: var(--sh-fab);
  overflow: visible;
  transition:
    transform 300ms var(--spring),
    box-shadow 300ms var(--ease);
  animation: fabPulse 4s ease-in-out infinite;
}
#aicb-fab:hover  { transform: translateY(-3px) scale(1.08); box-shadow: 0 14px 40px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.16); }
#aicb-fab:active { transform: scale(.92); transition-duration: 100ms; }

#aicb-fab-inner {
  width: 100%; height: 100%; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.92);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 2px 6px rgba(0,0,0,.15);
}
#aicb-fab-inner img        { width: 100%; height: 100%; object-fit: cover; }
#aicb-fab-inner .aicb-fab-emoji { font-size: 24px; line-height: 1; }

/* Green online dot */
#aicb-fab-dot {
  position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #22c55e;
  border: 2.5px solid var(--white);
  animation: greenPulse 2.8s ease-in-out infinite;
  transition: background 400ms var(--ease);
}


/* ═══════════════════════════════════════════════════════
   SPEECH BUBBLE
═══════════════════════════════════════════════════════ */
#aicb-bubble {
  position: absolute; bottom: 72px;
  background: var(--white);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 34px 12px 15px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12), 0 1px 4px rgba(0,0,0,.06);
  border: 1px solid rgba(0,0,0,.07);
  min-width: 176px; max-width: 248px;
  cursor: pointer;
  opacity: 0;
  transform: scale(.76) translateY(10px);
  animation: bubblePop 420ms var(--spring) 1s both;
}
#aicb.aicb-pos-bottom-right #aicb-bubble { right: 0; }
#aicb.aicb-pos-bottom-left  #aicb-bubble { left: 0; border-radius: 18px 18px 18px 4px; }

/* Tail */
#aicb-bubble::after {
  content: ''; position: absolute; bottom: -8px;
  width: 14px; height: 9px; background: var(--white);
  clip-path: polygon(0 0, 100% 0, 56% 100%);
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.05));
}
#aicb.aicb-pos-bottom-right #aicb-bubble::after { right: 21px; }
#aicb.aicb-pos-bottom-left  #aicb-bubble::after { left: 21px; clip-path: polygon(0 0, 100% 0, 44% 100%); }

#aicb-bubble-msg {
  font-size: 13.5px; line-height: 1.5; font-weight: 500; color: var(--ink);
}
#aicb-bubble-x {
  position: absolute; top: 7px; right: 7px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,.07); color: var(--ink3);
  font-size: 14px; display: flex; align-items: center; justify-content: center;
  transition: background 150ms, color 150ms, transform 150ms;
}
#aicb-bubble-x:hover { background: rgba(0,0,0,.13); color: var(--ink); transform: scale(1.1); }


/* ═══════════════════════════════════════════════════════
   CHAT WINDOW
═══════════════════════════════════════════════════════ */
#aicb-win {
  position: absolute; bottom: 76px;
  width: 390px; max-width: calc(100vw - 18px);
  height: 580px; max-height: calc(100dvh - 110px);
  border-radius: 22px;
  background: var(--white);
  box-shadow: var(--sh-win);
  border: 1px solid rgba(0,0,0,.065);
  display: flex; flex-direction: column; overflow: hidden;

  transform-origin: bottom right;
  transition: transform 400ms var(--spring), opacity 220ms var(--ease);
}
#aicb.aicb-pos-bottom-right #aicb-win { right: 0; }
#aicb.aicb-pos-bottom-left  #aicb-win { left: 0; transform-origin: bottom left; }
#aicb-win.aicb-hidden { transform: scale(.82) translateY(20px); opacity: 0; pointer-events: none; }

/* Pre-hide before JS runs — eliminates flash on page load */
#aicb-win    { display: none; }
#aicb-bubble { display: none; }
#aicb.aicb-ready #aicb-win    { display: flex; }
#aicb.aicb-ready #aicb-bubble { display: block; }


/* ═══════════════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════════════ */
#aicb-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 13px 13px 15px;
  flex-shrink: 0; position: relative; overflow: hidden;
}

/* Layered glass sheen */
#aicb-hdr::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 120% 80% at 90% -10%, rgba(255,255,255,.2) 0%, transparent 55%),
    radial-gradient(ellipse 80%  60% at 5%  110%, rgba(0,0,0,.15)      0%, transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,.06) 0%, transparent 100%);
}
/* Bottom edge shimmer */
#aicb-hdr::after {
  content: ''; position: absolute; bottom: 0; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
}

/* Header avatar */
#aicb-hdr-ava { position: relative; flex-shrink: 0; z-index: 1; }
#aicb-hdr-ava-img {
  width: 42px; height: 42px; border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,.5);
  box-shadow: 0 2px 10px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.3);
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.18); font-size: 18px;
}
#aicb-hdr-ava-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

#aicb-hdr-online {
  position: absolute; bottom: 0px; right: 0px;
  width: 13px; height: 13px; border-radius: 50%;
  background: #4ade80;
  border: 2px solid rgba(255,255,255,.85);
  box-shadow: 0 0 8px rgba(74,222,128,.7);
  animation: onlinePop 500ms var(--spring) 1.4s both;
}

/* Header text */
#aicb-hdr-info { flex: 1; min-width: 0; z-index: 1; }
#aicb-hdr-name {
  font-size: 15px; font-weight: 800; letter-spacing: -.3px; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#aicb-hdr-brand {
  font-size: 11px; font-weight: 500; opacity: .6; margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#aicb-hdr-status {
  display: flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500; opacity: .78; margin-top: 3px;
}
.aicb-dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 5px rgba(74,222,128,.9);
  animation: liveBlink 2.6s ease-in-out infinite;
}

/* Minimize / Close buttons */
#aicb-minimize, #aicb-close-btn {
  z-index: 1; flex-shrink: 0;
  width: 29px; height: 29px; border-radius: 50%;
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  transition: background 150ms, transform 200ms var(--spring);
}
#aicb-minimize { font-size: 20px; font-weight: 300; padding-bottom: 1px; }
#aicb-minimize:hover, #aicb-close-btn:hover { background: rgba(255,255,255,.28); transform: scale(1.1); }
#aicb-minimize:active, #aicb-close-btn:active { transform: scale(.88); }


/* ═══════════════════════════════════════════════════════
   MESSAGE AREA
═══════════════════════════════════════════════════════ */
#aicb-msgs {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  padding: 14px 13px 8px;
  display: flex; flex-direction: column; gap: 2px;

  /* Deep, warm gradient — gives the chat depth */
  background:
    linear-gradient(180deg,
      #e9ecf7 0%,
      #eceef9 25%,
      #eef0f9 50%,
      #f1f3fb 75%,
      #f5f6fd 100%
    );

  /* Soft fade at top and bottom */
  -webkit-mask-image: linear-gradient(to bottom,
    transparent 0px, rgba(0,0,0,.6) 18px, black 36px,
    black calc(100% - 10px), transparent 100%
  );
  mask-image: linear-gradient(to bottom,
    transparent 0px, rgba(0,0,0,.6) 18px, black 36px,
    black calc(100% - 10px), transparent 100%
  );

  scroll-behavior: smooth;
}
#aicb-msgs::-webkit-scrollbar        { width: 3px; }
#aicb-msgs::-webkit-scrollbar-track  { background: transparent; }
#aicb-msgs::-webkit-scrollbar-thumb  { background: rgba(0,0,0,.1); border-radius: 3px; }

/* Date / session pill */
.aicb-date-pill {
  align-self: center;
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px;
  text-transform: uppercase; color: var(--ink3);
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.8);
  padding: 3px 12px; border-radius: 20px;
  margin: 10px 0 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

/* ─── Message Groups ─── */
/* Consecutive messages from same sender group together */
.aicb-group { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; }
.aicb-group-bot  { align-items: flex-start; }
.aicb-group-user { align-items: flex-end; }

/* Row = optional avatar + bubble */
.aicb-row       { display: flex; gap: 7px; align-items: flex-end; width: 100%; }
.aicb-row-user  { justify-content: flex-end; }

/* Mini avatar (bot side) */
.aicb-ava-sm {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; align-self: flex-end;
  background: rgba(0,0,0,.1);
  display: flex; align-items: center; justify-content: center; font-size: 11px;
  box-shadow: 0 1px 4px rgba(0,0,0,.14);
}
.aicb-ava-sm img { width: 100%; height: 100%; object-fit: cover; }
.aicb-ava-ghost  { width: 26px; flex-shrink: 0; } /* invisible spacer for grouped msgs */

/* ─── Bubbles ─── */
.aicb-bub {
  max-width: 78%; padding: 10px 13px;
  font-size: 14px; line-height: 1.62; word-break: break-word;
  animation: msgIn 280ms var(--spring) both;
}

/* BOT bubble */
.aicb-bub-bot {
  background: var(--white); color: var(--ink);
  border: 1px solid rgba(0,0,0,.065);
  border-radius: 4px 18px 18px 18px;
  box-shadow: var(--sh-msg);
}
/* Shape morphing for grouped bot messages */
.aicb-group-bot .aicb-row:only-child  .aicb-bub-bot { border-radius: 18px 18px 18px 4px; }
.aicb-group-bot .aicb-row:first-child .aicb-bub-bot { border-radius: 18px 18px 18px 4px; }
.aicb-group-bot .aicb-row:not(:first-child):not(:last-child) .aicb-bub-bot { border-radius: 4px 18px 18px 4px; }
.aicb-group-bot .aicb-row:last-child  .aicb-bub-bot { border-radius: 4px 18px 18px 18px; }

/* USER bubble */
.aicb-bub-user {
  border-radius: 18px 18px 4px 18px;
  box-shadow: 0 3px 12px rgba(0,0,0,.18);
}
/* Shape morphing for grouped user messages */
.aicb-group-user .aicb-row:only-child  .aicb-bub-user { border-radius: 18px 18px 4px 18px; }
.aicb-group-user .aicb-row:first-child .aicb-bub-user { border-radius: 18px 18px 4px 18px; }
.aicb-group-user .aicb-row:not(:first-child):not(:last-child) .aicb-bub-user { border-radius: 18px 4px 4px 18px; }
.aicb-group-user .aicb-row:last-child  .aicb-bub-user { border-radius: 18px 4px 18px 18px; }

/* ── Rich text inside bot bubbles ── */
.aicb-bub-bot strong { font-weight: 700; }
.aicb-bub-bot em     { font-style: italic; color: var(--ink2); }
.aicb-bub-bot p      { margin-bottom: 7px; }
.aicb-bub-bot p:last-child { margin-bottom: 0; }
.aicb-bub-bot ul, .aicb-bub-bot ol { padding-left: 18px; margin: 6px 0; }
.aicb-bub-bot li     { margin-bottom: 4px; line-height: 1.5; }
.aicb-bub-bot code   {
  font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
  font-size: 12px; background: rgba(0,0,0,.07);
  padding: 1px 5px; border-radius: 4px;
}

/* ── Timestamp + status ── */
.aicb-meta {
  display: flex; align-items: center; gap: 4px;
  padding: 0 4px; margin-top: 4px;
  font-size: 10px; font-weight: 500; color: var(--ink3);
}
.aicb-row-user .aicb-meta { justify-content: flex-end; }

/* Double-tick "delivered" (cosmetic) */
.aicb-ticks { font-size: 12px; letter-spacing: -3px; color: var(--ink4); transition: color 400ms; }
.aicb-ticks.aicb-read { color: #60a5fa; }


/* ═══════════════════════════════════════════════════════
   TYPING INDICATOR — premium wave
═══════════════════════════════════════════════════════ */
.aicb-typing-row {
  display: flex; gap: 7px; align-items: flex-end;
  animation: msgIn 280ms var(--spring) both;
  margin-bottom: 10px;
}
.aicb-typing-bub {
  background: var(--white);
  border: 1px solid rgba(0,0,0,.065);
  border-radius: 18px 18px 18px 4px;
  padding: 13px 17px;
  box-shadow: var(--sh-msg);
  display: flex; gap: 5px; align-items: center;
}
.aicb-typing-bub span {
  display: block;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--ink3);
  animation: typWave 1.25s ease-in-out infinite;
}
.aicb-typing-bub span:nth-child(2) { animation-delay: .13s; }
.aicb-typing-bub span:nth-child(3) { animation-delay: .26s; }


/* ═══════════════════════════════════════════════════════
   WHATSAPP BUTTON
═══════════════════════════════════════════════════════ */
.aicb-wa-wrap { margin-top: 10px; }
.aicb-wa {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 17px;
  background: linear-gradient(135deg, #25D366 0%, #1db954 100%);
  color: #fff; border-radius: 24px;
  font-size: 13px; font-weight: 700; letter-spacing: .1px;
  box-shadow: 0 4px 16px rgba(37,211,102,.38);
  transition: transform 200ms var(--spring), box-shadow 200ms, filter 150ms;
}
.aicb-wa:hover  { color: #fff; transform: translateY(-2px) scale(1.03); box-shadow: 0 7px 22px rgba(37,211,102,.5); filter: brightness(1.06); }
.aicb-wa:active { color: #fff; transform: scale(.96); }
.aicb-wa svg    { flex-shrink: 0; }


/* ═══════════════════════════════════════════════════════
   LEAD CAPTURE OVERLAY
═══════════════════════════════════════════════════════ */
#aicb-lead-overlay {
  position: absolute; inset: 0; z-index: 20;
  background: rgba(225,228,245,.82);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px 20px;
  animation: fadeUp 260ms var(--snappy) both;
}

#aicb-lead-card {
  width: 100%; max-width: 310px;
  background: var(--white);
  border-radius: 22px;
  padding: 28px 22px 20px;
  box-shadow: var(--sh-card);
  border: 1px solid rgba(0,0,0,.04);
  text-align: center;
  animation: cardBounce 420ms var(--spring) both;
}

/* Icon ring */
#aicb-lead-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(145deg, #eef2ff 0%, #dde4ff 100%);
  border: 1px solid rgba(99,102,241,.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; margin: 0 auto 14px;
  box-shadow: 0 4px 14px rgba(99,102,241,.15);
}
#aicb-lead-heading {
  font-size: 18px; font-weight: 800; letter-spacing: -.3px;
  color: var(--ink); margin-bottom: 7px;
}
#aicb-lead-sub {
  font-size: 13px; color: var(--ink2); line-height: 1.55; margin-bottom: 20px;
}

/* Input fields */
.aicb-field-wrap { position: relative; margin-bottom: 9px; }
.aicb-field-icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  font-size: 14px; pointer-events: none; line-height: 1;
}
#aicb-lead-card input {
  width: 100%; padding: 11px 12px 11px 37px;
  border: 1.5px solid rgba(0,0,0,.1);
  border-radius: 12px;
  font-size: 14px; color: var(--ink); background: var(--surf);
  font-family: 'Geist', 'Inter', system-ui, sans-serif;
  transition: border-color 150ms, box-shadow 150ms, background 150ms;
}
#aicb-lead-card input::placeholder { color: var(--ink3); }
#aicb-lead-card input:focus {
  outline: none; background: var(--white);
  border-color: #6366f1;
  box-shadow: 0 0 0 3.5px rgba(99,102,241,.12);
}

#aicb-lead-ok {
  width: 100%; padding: 12px 16px; margin-top: 6px; margin-bottom: 6px;
  border-radius: 13px;
  font-size: 14px; font-weight: 700; letter-spacing: .15px;
  font-family: 'Geist', 'Inter', system-ui, sans-serif;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  transition: transform 200ms var(--spring), box-shadow 200ms, filter 150ms, opacity 200ms;
}
#aicb-lead-ok:not(:disabled):hover  { transform: translateY(-2px); box-shadow: 0 7px 24px rgba(0,0,0,.22); filter: brightness(1.07); }
#aicb-lead-ok:not(:disabled):active { transform: scale(.97); }
#aicb-lead-ok:disabled {
  opacity: .38;
  cursor: not-allowed;
  box-shadow: none;
  transform: none !important;
  filter: none !important;
  pointer-events: auto;
}

#aicb-lead-note {
  font-size: 11.5px; color: var(--ink3);
  text-align: center; margin: 0;
  transition: opacity 200ms;
}

/* Validation shake */
@keyframes aicbShake {
  0%,100% { transform: translateX(0); }
  15%     { transform: translateX(-7px); }
  30%     { transform: translateX( 6px); }
  45%     { transform: translateX(-5px); }
  60%     { transform: translateX( 4px); }
  75%     { transform: translateX(-2px); }
  90%     { transform: translateX( 2px); }
}


/* ═══════════════════════════════════════════════════════
   INPUT FOOTER
═══════════════════════════════════════════════════════ */
#aicb-footer {
  display: flex; align-items: flex-end; gap: 8px;
  padding: 9px 11px 11px;
  background: var(--white);
  border-top: 1px solid rgba(0,0,0,.06);
  box-shadow: 0 -2px 12px rgba(0,0,0,.04);
  flex-shrink: 0;
}

#aicb-input-wrap {
  flex: 1;
  background: var(--surf);
  border: 1.5px solid transparent;
  border-radius: 22px;
  padding: 9px 13px;
  display: flex; align-items: flex-end; gap: 7px;
  transition: border-color 150ms, background 150ms, box-shadow 150ms;
}
#aicb-input-wrap:focus-within {
  background: var(--white);
  border-color: rgba(99,102,241,.4);
  box-shadow: 0 0 0 3px rgba(99,102,241,.08);
}

#aicb-inp {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; font-weight: 500; color: var(--ink);
  resize: none; max-height: 112px; line-height: 1.55;
  font-family: 'Geist', 'Inter', system-ui, sans-serif;
}
#aicb-inp::placeholder { color: var(--ink3); font-weight: 400; }

/* Send button */
#aicb-send {
  width: 41px; height: 41px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 12px rgba(0,0,0,.22);
  transition: transform 200ms var(--spring), box-shadow 200ms, opacity 150ms;
}
#aicb-send:hover  { transform: scale(1.1) rotate(-8deg); box-shadow: 0 6px 20px rgba(0,0,0,.28); }
#aicb-send:active { transform: scale(.9); }
#aicb-send:disabled { opacity: .35; pointer-events: none; transform: none; box-shadow: none; }

/* Powered by line */
#aicb-powered {
  text-align: center; font-size: 10px; color: var(--ink3);
  padding: 3px 0 0; opacity: .55; user-select: none;
}


/* ═══════════════════════════════════════════════════════
   KEYFRAMES
═══════════════════════════════════════════════════════ */
@keyframes fabPulse {
  0%,100% { box-shadow: var(--sh-fab), 0 0 0 0   rgba(99,102,241,.3); }
  55%     { box-shadow: var(--sh-fab), 0 0 0 12px rgba(99,102,241,0); }
}
@keyframes greenPulse {
  0%,100% { box-shadow: 0 0 0 0   rgba(34,197,94,.55); }
  50%     { box-shadow: 0 0 0 7px rgba(34,197,94,0);   }
}
@keyframes bubblePop {
  from { opacity:0; transform:scale(.76) translateY(10px); }
  to   { opacity:1; transform:scale(1)   translateY(0);    }
}
@keyframes onlinePop {
  from { transform:scale(0); opacity:0; }
  to   { transform:scale(1); opacity:1; }
}
@keyframes liveBlink {
  0%,100% { opacity:1;   }
  50%     { opacity:.35; }
}
@keyframes msgIn {
  from { opacity:0; transform:translateY(10px) scale(.96); }
  to   { opacity:1; transform:translateY(0)    scale(1);   }
}
@keyframes typWave {
  0%,60%,100% { transform:translateY(0);    opacity:.45; }
  30%          { transform:translateY(-7px); opacity:1;   }
}
@keyframes fadeUp {
  from { opacity:0; transform:translateY(12px); }
  to   { opacity:1; transform:translateY(0);    }
}
@keyframes cardBounce {
  from { opacity:0; transform:scale(.86) translateY(24px); }
  to   { opacity:1; transform:scale(1)   translateY(0);    }
}


/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  #aicb-win {
    width: 100vw; max-width: 100vw;
    height: calc(100dvh - 90px); max-height: none;
    border-radius: 22px 22px 0 0; bottom: 78px;
  }
  #aicb.aicb-pos-bottom-right #aicb-win { right: -24px; }
  #aicb.aicb-pos-bottom-left  #aicb-win { left:  -24px; }
  #aicb-bubble { max-width: 196px; }
  #aicb-fab    { width: 57px; height: 57px; }
  .aicb-bub   { max-width: 86%; }
}

@media (prefers-reduced-motion: reduce) {
  #aicb *, #aicb *::before, #aicb *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}


/* ═══════════════════════════════════════════════════════
   WHATSAPP BUTTON — inside chat header (top-right)
═══════════════════════════════════════════════════════ */
#aicb-hdr-wa {
  z-index: 1;
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(37,211,102,.22);
  border: 1.5px solid rgba(255,255,255,.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 160ms, transform 220ms cubic-bezier(.34,1.56,.64,1), box-shadow 160ms;
  position: relative;
  /* Subtle pulsing ring to draw attention */
  animation: hdrWaPulse 3s ease-in-out infinite;
}
#aicb-hdr-wa svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.2));
}
#aicb-hdr-wa:hover {
  background: rgba(37,211,102,.55);
  border-color: rgba(255,255,255,.6);
  transform: scale(1.14);
  box-shadow: 0 0 0 5px rgba(37,211,102,.2);
}
#aicb-hdr-wa:active {
  transform: scale(.9);
}

/* Tooltip on hover */
#aicb-hdr-wa::after {
  content: 'WhatsApp';
  position: absolute;
  bottom: -30px;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(0,0,0,.75);
  color: #fff;
  font-family: 'Geist','Inter',system-ui,sans-serif;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 160ms, transform 160ms;
  z-index: 100;
}
#aicb-hdr-wa:hover::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes hdrWaPulse {
  0%,100% { box-shadow: 0 0 0 0   rgba(37,211,102,.5); }
  55%     { box-shadow: 0 0 0 7px rgba(37,211,102,0);  }
}
