#rangura-ai-assistant-root, #rangura-ai-assistant-root * {
  box-sizing: border-box;
  font-family: -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}

/* Defensive resets + scoping: this widget is injected into someone else's
   theme, so theme-wide rules for plain `button`/`svg`/`img`/`a` elements
   (icon toggles, "responsive images" resets, link underlines, desktop-only
   nav styles, etc.) can otherwise leak in and make a button look washed
   out/colorless, or an image render far bigger than intended. Every
   selector below is written as a descendant of #rangura-ai-assistant-root
   (an ID), which puts it at higher CSS specificity than almost any
   ordinary theme selector without an ID of its own — that's what keeps
   our colors and sizes showing correctly regardless of which theme this
   runs on. The handful of properties theme resets most commonly fight
   over (background/color on buttons and bubbles, width/max-width on
   images) also carry !important as a second layer of defense. */
#rangura-ai-assistant-root button {
  margin: 0;
  outline: none;
  box-shadow: none;
  line-height: 1;
  -webkit-appearance: none;
  appearance: none;
}

#rangura-ai-assistant-root svg {
  display: block;
  flex-shrink: 0;
  overflow: visible;
  max-width: none;
}

#rangura-ai-assistant-root .raa-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  background: #1558C4 !important;
  color: #fff !important;
  border: none;
  border-radius: 28px;
  padding: 12px 18px 12px 14px;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  animation: raa-pop 0.35s ease-out;
}

#rangura-ai-assistant-root .raa-fab:hover { background: #103f96 !important; }

#rangura-ai-assistant-root .raa-fab-icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#rangura-ai-assistant-root .raa-fab-icon svg { width: 18px !important; height: 18px !important; color: #fff; }

#rangura-ai-assistant-root .raa-online-dot {
  position: absolute;
  top: -3px;
  right: -4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2ECC71 !important;
  border: 1.5px solid #1558C4;
}

#rangura-ai-assistant-root .raa-nudge {
  position: fixed;
  right: 20px;
  bottom: 82px;
  z-index: 999998;
  max-width: 240px;
  background: #fff !important;
  color: #1A1A1A !important;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.4;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.22);
  display: none;
  cursor: pointer;
  animation: raa-pop 0.35s ease-out;
}

#rangura-ai-assistant-root .raa-nudge.raa-show { display: block; }

#rangura-ai-assistant-root .raa-nudge-close {
  position: absolute;
  top: 2px;
  right: 6px;
  background: none;
  border: none;
  font-size: 14px;
  color: #6B7280;
  cursor: pointer;
}

@keyframes raa-pop {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#rangura-ai-assistant-root .raa-panel {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  width: 360px;
  max-width: calc(100vw - 24px);
  height: 520px;
  max-height: calc(100vh - 40px);
  background: #fff !important;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

#rangura-ai-assistant-root .raa-panel.raa-open { display: flex; }

#rangura-ai-assistant-root .raa-header {
  background: #1E7AFD !important;
  color: #fff !important;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

#rangura-ai-assistant-root .raa-header-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

#rangura-ai-assistant-root .raa-header-icon svg { width: 16px !important; height: 16px !important; color: #fff; }

#rangura-ai-assistant-root .raa-header-text { flex: 1; }

#rangura-ai-assistant-root .raa-header-title { font-size: 15px; font-weight: 700; color: #fff !important; }
#rangura-ai-assistant-root .raa-header-subtitle { font-size: 11px; color: #E4EEFF !important; margin-top: 2px; }
#rangura-ai-assistant-root .raa-close { background: none; border: none; color: #fff !important; font-size: 20px; cursor: pointer; line-height: 1; }

#rangura-ai-assistant-root .raa-speak-toggle {
  background: rgba(255, 255, 255, 0.15) !important;
  border: none;
  color: #fff !important;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#rangura-ai-assistant-root .raa-speak-toggle svg { width: 16px !important; height: 16px !important; color: #fff; }
#rangura-ai-assistant-root .raa-speak-toggle.raa-speak-on { background: rgba(255, 255, 255, 0.35) !important; }

#rangura-ai-assistant-root .raa-quick-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #E5E7EB;
  flex-wrap: wrap;
}

#rangura-ai-assistant-root .raa-quick-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 18px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff !important;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

/* widget.js also forces this same blue inline with "!important" priority
   — see the note on .raa-icon-btn above for why that extra layer exists. */
#rangura-ai-assistant-root .raa-quick-btn.raa-lead-btn { background: #4899FF !important; border: none; }

/* Icon-only WhatsApp button — round, fixed-size, doesn't grow like the
   text button next to it. */
#rangura-ai-assistant-root .raa-quick-icon-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25D366 !important;
  color: #fff !important;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

#rangura-ai-assistant-root .raa-quick-icon-btn.raa-whatsapp:hover { background: #1fb958 !important; }
#rangura-ai-assistant-root .raa-quick-icon-btn svg { width: 20px !important; height: 20px !important; }

#rangura-ai-assistant-root .raa-lead-form {
  padding: 10px 14px;
  border-bottom: 1px solid #E5E7EB;
  background: #F0F7FF !important;
}

#rangura-ai-assistant-root .raa-lead-intro { font-size: 12px; color: #1B4C8C !important; margin-bottom: 8px; line-height: 1.4; }

/* font-size is 16px on purpose, on every breakpoint (see the mobile
   override further down too): iOS/Android browsers auto-zoom the whole
   page when a tapped text input's font is smaller than 16px, which is
   the "page zooms in when you tap a field" behavior — 16px is the
   threshold that keeps that from happening at all, on any input in this
   widget. */
#rangura-ai-assistant-root .raa-lead-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 16px;
  margin-bottom: 6px;
  background: #fff !important;
  color: #1A1A1A !important;
}

#rangura-ai-assistant-root .raa-lead-row { display: flex; gap: 8px; }

#rangura-ai-assistant-root .raa-lead-send {
  background: #4899FF !important;
  color: #fff !important;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

#rangura-ai-assistant-root .raa-lead-cancel {
  background: none;
  border: none;
  color: #6B7280 !important;
  font-size: 12.5px;
  cursor: pointer;
}

#rangura-ai-assistant-root .raa-lead-error { font-size: 12px; color: #DC2626 !important; margin-bottom: 6px; }

#rangura-ai-assistant-root .raa-messages-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

#rangura-ai-assistant-root .raa-messages {
  height: 100%;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff !important;
}

/* Appears when a customer has scrolled up from the bottom (e.g. to reread
   something) while a new message arrives, instead of yanking their scroll
   position back down automatically. */
#rangura-ai-assistant-root .raa-jump-latest {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: #1E7AFD !important;
  color: #fff !important;
  border: none;
  border-radius: 14px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.25);
  z-index: 2;
}

/* --- Product cards (rendered under an assistant message that includes
   real, in-stock catalog matches) ------------------------------------- */
#rangura-ai-assistant-root .raa-product-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 82%;
  align-self: flex-start;
}

#rangura-ai-assistant-root .raa-product-card {
  border: 1px solid #E5E7EB;
  border-radius: 12px;
  overflow: hidden;
  background: #fff !important;
  display: flex;
  flex-direction: column;
}

#rangura-ai-assistant-root .raa-product-card-img {
  display: block;
  width: 100%;
  height: 110px;
  overflow: hidden;
  background: #F6F7F5 !important;
}

#rangura-ai-assistant-root .raa-product-card-img img {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}

#rangura-ai-assistant-root .raa-product-card-body {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#rangura-ai-assistant-root .raa-product-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #1A1A1A !important;
  text-decoration: none;
  line-height: 1.3;
}

#rangura-ai-assistant-root .raa-product-card-price-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

#rangura-ai-assistant-root .raa-product-card-price {
  font-size: 13px;
  font-weight: 700;
  color: #1558C4 !important;
}

#rangura-ai-assistant-root .raa-product-card-tag {
  font-size: 10.5px;
  color: #6B7280 !important;
  background: #F0F2F5 !important;
  border-radius: 8px;
  padding: 2px 7px;
}

#rangura-ai-assistant-root .raa-product-card-oos {
  font-size: 11px;
  font-weight: 700;
  color: #DC2626 !important;
}

#rangura-ai-assistant-root .raa-product-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
  align-items: center;
}

#rangura-ai-assistant-root .raa-product-card-btn {
  border: none;
  border-radius: 14px;
  padding: 6px 11px;
  font-size: 11.5px;
  font-weight: 700;
  color: #fff !important;
  cursor: pointer;
}

#rangura-ai-assistant-root .raa-product-card-btn:disabled { opacity: 0.7; cursor: default; }

#rangura-ai-assistant-root .raa-offer-btn { background: #6B21A8 !important; }
#rangura-ai-assistant-root .raa-cart-btn { background: #FF740F !important; }

#rangura-ai-assistant-root .raa-product-card-cart-link {
  font-size: 11.5px;
  font-weight: 700;
  color: #1558C4 !important;
  text-decoration: none;
}

/* Offer-amount input — only shown when the lead form was opened via
   "Make Offer" on a product card; same 16px rule as the other inputs so
   it doesn't trigger mobile zoom-on-focus either. */
#rangura-ai-assistant-root .raa-offer-input { font-size: 16px; }

#rangura-ai-assistant-root .raa-bubble {
  max-width: 82%;
  padding: 9px 13px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.4;
  white-space: pre-wrap;
}

#rangura-ai-assistant-root .raa-bubble.raa-assistant { background: #F6F7F5 !important; color: #1A1A1A !important; align-self: flex-start; }
#rangura-ai-assistant-root .raa-bubble.raa-user { background: #1E7AFD !important; color: #fff !important; align-self: flex-end; }

#rangura-ai-assistant-root .raa-typing { font-size: 12px; color: #6B7280; padding: 0 14px 6px; }

#rangura-ai-assistant-root .raa-input-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px;
  border-top: 1px solid #E5E7EB;
}

/* This is the mic button's only remaining icon button (the camera button
   was removed), so it gets a real, unmistakable color of its own instead
   of a neutral gray — and a clearly different color (red, see below)
   while actively recording. Note: widget.js also forces these same colors
   inline with "!important" priority on top of this CSS, since a theme's
   own !important rule can otherwise still beat a plain CSS file no matter
   how specific its selector is — the inline version is what finally wins
   on every page. */
#rangura-ai-assistant-root .raa-icon-btn {
  background: #FF740F !important;
  border: none;
  color: #fff !important;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#rangura-ai-assistant-root .raa-icon-btn svg { width: 17px !important; height: 17px !important; }
#rangura-ai-assistant-root .raa-icon-btn:hover { background: #e0680d !important; }

#rangura-ai-assistant-root .raa-mic-btn.raa-mic-active {
  background: #DC2626 !important;
  color: #fff !important;
  animation: raa-pulse 1.2s infinite;
}

@keyframes raa-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}

#rangura-ai-assistant-root .raa-input {
  flex: 1;
  border: 1px solid #E5E7EB;
  background: #F6F7F5 !important;
  color: #1A1A1A !important;
  border-radius: 18px;
  padding: 9px 14px;
  font-size: 16px; /* keeps phones from auto-zooming on tap — see note above */
  outline: none;
}

#rangura-ai-assistant-root .raa-send {
  background: #1E7AFD !important;
  color: #fff !important;
  border: none;
  border-radius: 18px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 15px;
}

#rangura-ai-assistant-root .raa-send:disabled { opacity: 0.6; cursor: default; }

/* Phone screens: everything below is noticeably smaller/tighter than the
   desktop sizes above, so the widget stays a small helper in the corner
   instead of dominating a small screen. */
@media (max-width: 480px) {
  #rangura-ai-assistant-root .raa-fab {
    right: 12px;
    bottom: 12px;
    padding: 9px 14px 9px 10px;
    font-size: 12.5px;
    gap: 6px;
    border-radius: 24px;
  }

  #rangura-ai-assistant-root .raa-fab-icon { width: 18px; height: 18px; }
  #rangura-ai-assistant-root .raa-fab-icon svg { width: 15px !important; height: 15px !important; }
  #rangura-ai-assistant-root .raa-online-dot { width: 7px; height: 7px; }

  #rangura-ai-assistant-root .raa-nudge {
    right: 12px;
    bottom: 64px;
    max-width: 190px;
    font-size: 12px;
    padding: 10px 12px;
  }

  #rangura-ai-assistant-root .raa-panel {
    right: 8px;
    left: 8px;
    bottom: 8px;
    width: auto;
    height: 72vh;
    max-height: calc(100vh - 24px);
    border-radius: 14px;
  }

  #rangura-ai-assistant-root .raa-header {
    padding: 10px 12px;
    gap: 8px;
  }

  #rangura-ai-assistant-root .raa-header-icon { width: 26px; height: 26px; }
  #rangura-ai-assistant-root .raa-header-icon svg { width: 14px !important; height: 14px !important; }
  #rangura-ai-assistant-root .raa-header-title { font-size: 13.5px; }
  #rangura-ai-assistant-root .raa-header-subtitle { font-size: 10px; margin-top: 1px; }
  #rangura-ai-assistant-root .raa-close { font-size: 18px; }

  #rangura-ai-assistant-root .raa-speak-toggle { width: 26px; height: 26px; }
  #rangura-ai-assistant-root .raa-speak-toggle svg { width: 14px !important; height: 14px !important; }

  #rangura-ai-assistant-root .raa-quick-actions {
    padding: 8px 10px;
    gap: 6px;
  }

  #rangura-ai-assistant-root .raa-quick-btn {
    font-size: 11px;
    padding: 7px 6px;
    gap: 4px;
    border-radius: 14px;
  }

  #rangura-ai-assistant-root .raa-quick-icon-btn { width: 34px; height: 34px; }
  #rangura-ai-assistant-root .raa-quick-icon-btn svg { width: 17px !important; height: 17px !important; }

  #rangura-ai-assistant-root .raa-lead-form { padding: 8px 10px; }
  #rangura-ai-assistant-root .raa-lead-intro { font-size: 11.5px; margin-bottom: 6px; }
  /* font-size stays 16px here on purpose — see the note on .raa-lead-input
     above; only padding shrinks for the smaller screen. */
  #rangura-ai-assistant-root .raa-lead-input { padding: 7px 9px; margin-bottom: 5px; }
  #rangura-ai-assistant-root .raa-lead-send, #rangura-ai-assistant-root .raa-lead-cancel { font-size: 12px; }

  #rangura-ai-assistant-root .raa-messages { padding: 10px; gap: 6px; }
  #rangura-ai-assistant-root .raa-bubble { font-size: 13px; padding: 8px 11px; max-width: 88%; }
  #rangura-ai-assistant-root .raa-typing { padding: 0 10px 5px; }

  #rangura-ai-assistant-root .raa-product-cards { max-width: 88%; }
  #rangura-ai-assistant-root .raa-product-card-img { height: 90px; }
  #rangura-ai-assistant-root .raa-product-card-name,
  #rangura-ai-assistant-root .raa-product-card-price { font-size: 12px; }
  #rangura-ai-assistant-root .raa-product-card-btn { font-size: 11px; padding: 5px 9px; }
  #rangura-ai-assistant-root .raa-jump-latest { font-size: 11px; padding: 5px 11px; bottom: 8px; }

  #rangura-ai-assistant-root .raa-input-row { padding: 8px; gap: 5px; }
  #rangura-ai-assistant-root .raa-icon-btn { width: 32px; height: 32px; }
  #rangura-ai-assistant-root .raa-icon-btn svg { width: 15px !important; height: 15px !important; }
  /* font-size stays 16px here on purpose — see the note on .raa-input
     above; only padding shrinks for the smaller screen. */
  #rangura-ai-assistant-root .raa-input { padding: 8px 12px; }
  #rangura-ai-assistant-root .raa-send { width: 34px; height: 34px; font-size: 13px; }
}

/* Very small phones (older/small Android devices, small iPhones in some
   layouts) — shrink the quick-action row further so three buttons never
   need to wrap onto a second line. */
@media (max-width: 340px) {
  #rangura-ai-assistant-root .raa-quick-btn { font-size: 10px; padding: 6px 4px; }
  #rangura-ai-assistant-root .raa-header-title { font-size: 13px; }
  #rangura-ai-assistant-root .raa-header-subtitle { display: none; }
}
