
/* ══════════════════════════════════════════════════
   SŨPHIE CHATBOT — Supen Spa Widget Styles
   Scoped with !important to override main site CSS
   ══════════════════════════════════════════════════ */

/* DESIGN TOKENS */
:root {
  --brand-dark-royal:     #160514;
  --brand-midnight:       #2A0A1F;
  --brand-royal-purple:   #3D0D2B;
  --brand-deep-indigo:    #5C1040;
  --brand-maroon:         #8B0035;
  --brand-magenta:        #C2185B;
  --brand-gold:           #FFD700;
  --brand-gold-light:     #FFDF40;
  --brand-lavender:       #D4A0C0;
  --brand-text-body:      #E8C8D8;
  --brand-text-light:     #B88FA0;
  --brand-shadow-lg:      0 24px 60px rgba(0,0,0,0.70);
  --brand-glow-gold:      0 0 20px rgba(255,215,0,0.45), 0 0 40px rgba(255,215,0,0.20);
  --brand-glow-magenta:   0 0 20px rgba(194,24,91,0.50);
  --bot-font-heading:     'Outfit', sans-serif;
  --bot-font-body:        'Poppins', sans-serif;
  --bot-radius-lg:        24px;
  --bot-radius-md:        16px;
  --bot-radius-sm:        12px;
}

/* RESET — Override main site's global user-select:none and pointer-events:none inside chatbot */
#chatbot-container,
#chatbot-container *,
#chatbot-container *::before,
#chatbot-container *::after {
  box-sizing: border-box !important;
  font-family: var(--bot-font-body) !important;
  -webkit-user-select: auto !important;
  -moz-user-select: auto !important;
  user-select: auto !important;
  -webkit-user-drag: auto !important;
  pointer-events: auto !important;
}
#chatbot-container img {
  pointer-events: auto !important;
  -webkit-user-drag: none !important;
}

/* ── TRIGGER BUTTON (bottom-right) ── */
  #bot-trigger-wrapper {
    position: fixed !important;
    bottom: 0px !important;
    right: 32px !important;
    z-index: 10000 !important;
    display: flex !important;
    flex-direction: row-reverse !important; /* Tooltip on LEFT, icon anchored to RIGHT */
    align-items: center !important;
    justify-content: flex-end !important;
    animation: botFloatUpDown 2.5s ease-in-out infinite !important;
  }

  #bot-trigger-avatar-container {
    position: relative !important;
    display: inline-block !important;
    width: 80px !important;
    height: 80px !important;
    flex-shrink: 0 !important;
    overflow: visible !important;
  }

  #bot-trigger-avatar {
    cursor: pointer !important;
    margin-bottom: 0 !important; /* 0px margin below the icon */
  }
  
  #bot-trigger-avatar .bot-trigger-img {
    width: 80px !important; /* Scaled to 80px for balanced look */
    height: 80px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 2px solid transparent !important;
    background: linear-gradient(#220719, #220719) padding-box, 
                linear-gradient(135deg, var(--brand-gold), #e066ff, var(--brand-gold)) border-box !important;
    background-size: 200% auto !important;
    animation: vivid-border-anim 4s linear infinite !important;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3) !important;
    transition: transform 0.3s ease !important;
  }
  
  #bot-trigger-avatar:hover .bot-trigger-img {
    transform: scale(1.08) !important;
  }

  .suphie-close-trigger-btn {
    position: absolute !important;
    top: -4px !important;   /* Positioned perfectly on the avatar's outer ring/border */
    right: -4px !important; /* Slightly overflows the container, kept visible by overflow:visible */
    width: 24px !important;  /* Increased size for better tap target and visibility */
    height: 24px !important;
    border-radius: 50% !important;
    background: transparent !important;
    border: none !important; /* Removed border as requested */
    color: #e60000 !important; /* Red close icon */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    z-index: 10002 !important;
    box-shadow: none !important; /* Removed shadow for clean floating look */
    padding: 0 !important;
    transition: all 0.2s !important;
  }
  .suphie-close-trigger-btn:hover {
    color: #ff4d4d !important;
  }

  #bot-tooltip-msg {
    position: relative !important;
    padding: 14px 16px !important;
    border-radius: 16px !important;
    color: #fff !important;
    font-family: var(--bot-font-heading) !important;
    display: flex !important;
    align-items: flex-start !important;
    margin-bottom: 0 !important; /* Reset vertical margin */
    margin-right: 18px !important; /* Space between tooltip (left) and icon (right) */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4), 0 0 15px rgba(255, 215, 0, 0.12) !important;
    cursor: pointer !important;
    width: 360px !important;        /* Compact, no empty space on the right, fits content snugly */
    max-width: calc(100vw - 100px) !important; /* Never go off-screen */
    
    /* Gradient Border with color loop animation */
    border: 1px solid transparent !important;
    background: linear-gradient(#080312, #080312) padding-box, 
                linear-gradient(135deg, var(--brand-gold), #e066ff, var(--brand-gold)) border-box !important;
    background-size: 200% auto !important;
    animation: vivid-border-anim 4s linear infinite !important;
  }

  /* Desktop/Mobile visibility toggling */
  .tooltip-desktop-only {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 8px !important;
  }
  
  .tooltip-mobile-only {
    display: none !important;
  }

  /* Header area with bot info + close button */
  .tooltip-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
  }
  
  .tooltip-avatar-info {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    flex-wrap: nowrap !important; /* Keep name+dot+pill on one line */
    overflow: visible !important;
  }
  
  .tooltip-avatar-img {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    border: 1.5px solid var(--brand-gold) !important;
    object-fit: cover !important;
  }
  
  .tooltip-bot-name {
    font-weight: 700 !important;
    font-size: 17.5px !important;
    letter-spacing: 0.5px !important;
    background: linear-gradient(to right, #ffe082, #ffb300, #e65100, #ffb300, #ffe082) !important;
    background-size: 200% 100% !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    display: inline-block !important;
    animation: shinyGoldText 3s linear infinite !important;
  }

  @keyframes shinyGoldText {
    0% { background-position: 0% 0%; }
    100% { background-position: -200% 0%; }
  }

  @keyframes dotBlink {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
  }

  .tooltip-body {
    font-size: 14px !important;
    line-height: 1.5 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-align: left !important;
  }
  
  .tooltip-line {
    white-space: nowrap !important;
  }

  .tooltip-status {
    display: flex !important;
    align-items: center !important;
    margin-top: 2px !important;
  }
  
  .tooltip-status-pill {
    font-size: 11.5px !important;
    font-weight: 500 !important;
    color: rgba(255, 255, 255, 0.5) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    padding: 3px 8px !important;
    border-radius: 6px !important;
    display: inline-block !important;
  }

  #bot-tooltip-msg .tooltip-arrow-outer {
    position: absolute !important;
    top: 50% !important;
    bottom: auto !important;
    right: -6px !important; /* Arrow on RIGHT edge, pointing toward icon on the right */
    left: auto !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-top: 6px solid transparent !important;
    border-bottom: 6px solid transparent !important;
    border-left: 6px solid var(--brand-gold) !important;
    border-right: none !important;
  }

  #bot-tooltip-msg .tooltip-arrow-inner {
    position: absolute !important;
    top: 50% !important;
    bottom: auto !important;
    right: -4px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    width: 0 !important;
    height: 0 !important;
    border-top: 5px solid transparent !important;
    border-bottom: 5px solid transparent !important;
    border-left: 5px solid rgba(8, 3, 18, 0.95) !important;
    border-right: none !important;
  }

  #bot-tooltip-msg .tooltip-close-btn {
    background: none !important;
    border: none !important;
    color: rgba(255, 255, 255, 0.5) !important;
    cursor: pointer !important;
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: color 0.2s !important;
  }
  
  #bot-tooltip-msg .tooltip-close-btn:hover {
    color: #fff !important;
  }

  @keyframes botFloatUpDown {
    0%   { transform: translateY(0); }
    50%  { transform: translateY(-15px); }
    100% { transform: translateY(0); }
  }
@keyframes botPulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

#bot-window {
  position: fixed !important;
  bottom: 0 !important;
  right: 25px !important;
  left: auto !important;
  width: calc(100vw - 40px) !important;
  max-width: 460px !important;
  height: 88vh !important;
  max-height: 800px !important;
  border-radius: var(--bot-radius-lg) var(--bot-radius-lg) 0 0 !important;
  background: rgba(42, 10, 31, 0.92) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border: 1px solid rgba(139,0,53,0.45) !important;
  border-bottom: none !important;
  box-shadow: var(--brand-shadow-lg) !important;
  display: none;
  flex-direction: column !important;
  z-index: 10001 !important;
  overflow: hidden !important;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 0 !important;
}
#bot-window.bot-window-open {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

/* ── HEADER ── */
.bot-header {
  padding: 16px 20px !important;
  background: linear-gradient(135deg, rgba(22,5,20,0.97) 0%, rgba(42,10,31,0.96) 50%, rgba(61,13,43,0.97) 100%) !important;
  border-bottom: 1px solid rgba(139,0,53,0.45) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  margin: 0 !important;
  min-height: 0 !important;
}
.bot-header-left {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
}
.bot-avatar-ring {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  border-radius: 50% !important;
  padding: 2px !important;
  background: linear-gradient(135deg, var(--brand-gold), var(--brand-magenta)) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.bot-avatar {
  border-radius: 50% !important;
  overflow: hidden !important;
  background: var(--brand-dark-royal) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}
.bot-avatar.lg { width: 40px !important; height: 40px !important; }
.bot-avatar.sm { width: 32px !important; height: 32px !important; flex-shrink: 0 !important; margin-top: 5px !important; }
.bot-avatar img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  border-radius: 50% !important;
}
.bot-avatar-letter {
  color: var(--brand-gold) !important;
  -webkit-text-fill-color: var(--brand-gold) !important;
  font-family: var(--bot-font-heading) !important;
  font-size: 18px !important;
  font-weight: 700 !important;
}
.bot-info {
  display: flex !important;
  flex-direction: column !important;
}
h2.bot-name,
.bot-name {
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-family: var(--bot-font-heading) !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
  background-clip: unset !important;
  -webkit-background-clip: unset !important;
  line-height: 1.3 !important;
}
.bot-status {
  color: var(--brand-text-light) !important;
  -webkit-text-fill-color: var(--brand-text-light) !important;
  font-size: 12px !important;
  display: flex !important;
  align-items: center !important;
  gap: 5px !important;
}
.status-dot {
  width: 6px !important;
  height: 6px !important;
  background-color: #22c55e !important;
  border-radius: 50% !important;
  flex-shrink: 0 !important;
}
.bot-close {
  background: transparent !important;
  border: none !important;
  color: var(--brand-text-light) !important;
  cursor: pointer !important;
  padding: 5px !important;
  transition: color 0.2s !important;
}
.bot-close:hover {
  color: #fff !important;
}

/* ── MESSAGES AREA ── */
#bot-messages,
.bot-messages {
  flex: 1 !important;
  padding: 20px !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
  background: transparent !important;
  min-height: 0 !important;
}
.bot-messages::-webkit-scrollbar { width: 6px !important; }
.bot-messages::-webkit-scrollbar-track { background: transparent !important; }
.bot-messages::-webkit-scrollbar-thumb {
  background: rgba(139,0,53,0.5) !important;
  border-radius: 10px !important;
}

.msg-wrap {
  display: flex !important;
  align-items: flex-start !important;
  gap: 10px !important;
  animation: botFadeUp 0.3s ease forwards !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: none !important;
}
@keyframes botFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.msg-user {
  flex-direction: row-reverse !important;
}
.msg-bubble {
  max-width: 80% !important;
  padding: 12px 16px !important;
  font-size: 15.5px !important;
  line-height: 1.5 !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
}
.bot-bubble {
  background: rgba(61,13,43,0.8) !important;
  border: 1px solid rgba(139,0,53,0.3) !important;
  border-radius: 0 var(--bot-radius-md) var(--bot-radius-md) var(--bot-radius-md) !important;
  color: var(--brand-text-body) !important;
  -webkit-text-fill-color: var(--brand-text-body) !important;
}
.user-bubble {
  background: linear-gradient(135deg, var(--brand-maroon) 0%, var(--brand-magenta) 100%) !important;
  border-radius: var(--bot-radius-md) 0 var(--bot-radius-md) var(--bot-radius-md) !important;
  box-shadow: var(--brand-glow-magenta) !important;
  border: none !important;
}

/* ── QUICK REPLY CHIPS ── */
#bot-chips,
.bot-chips {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  margin-top: 10px !important;
  margin-left: 42px !important;
  padding: 0 !important;
}
.bot-chip {
  background: transparent !important;
  border: 1px solid var(--brand-gold) !important;
  color: var(--brand-gold) !important;
  -webkit-text-fill-color: var(--brand-gold) !important;
  padding: 6px 12px !important;
  border-radius: 50px !important;
  font-size: 13.5px !important;
  cursor: pointer !important;
  transition: all 0.2s !important;
  font-family: var(--bot-font-body) !important;
}
.bot-chip:hover {
  background: var(--brand-gold) !important;
  color: #111 !important;
  -webkit-text-fill-color: #111 !important;
  box-shadow: var(--brand-glow-gold) !important;
}

/* ── TYPING INDICATOR ── */
.typing-bubble {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  padding: 16px !important;
}
.typing-dot {
  width: 6px !important;
  height: 6px !important;
  background: var(--brand-lavender) !important;
  border-radius: 50% !important;
  animation: botTypingBounce 1.4s infinite ease-in-out both !important;
}
.typing-dot:nth-child(1) { animation-delay: -0.32s !important; }
.typing-dot:nth-child(2) { animation-delay: -0.16s !important; }
@keyframes botTypingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* ── INPUT AREA ── */
.bot-input-area {
  padding: 15px 20px !important;
  background: rgba(22,5,20,0.97) !important;
  border-top: 1px solid rgba(139,0,53,0.45) !important;
  margin: 0 !important;
  min-height: 0 !important;
}
.input-wrapper {
  display: flex !important;
  align-items: flex-end !important;
  gap: 10px !important;
  background: rgba(61,13,43,0.6) !important;
  border: 1px solid rgba(139,0,53,0.6) !important;
  border-radius: var(--bot-radius-md) !important;
  padding: 8px 12px !important;
  transition: border-color 0.2s !important;
}
.input-wrapper:focus-within {
  border-color: var(--brand-gold) !important;
}
#bot-input {
  flex: 1 !important;
  background: transparent !important;
  border: none !important;
  color: #fff !important;
  -webkit-text-fill-color: #fff !important;
  font-size: 15.5px !important;
  min-height: 24px !important;
  max-height: 110px !important;
  resize: none !important;
  font-family: var(--bot-font-body) !important;
  padding: 2px 0 !important;
  outline: none !important;
  width: auto !important;
  overflow: hidden !important;
}
#bot-input::placeholder {
  color: var(--brand-text-light) !important;
  -webkit-text-fill-color: var(--brand-text-light) !important;
}
#bot-trigger-btn {
  background: transparent !important;
  border: none !important;
  color: var(--brand-gold) !important;
  cursor: pointer !important;
  padding: 4px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  transition: transform 0.2s !important;
  width: auto !important;
  height: auto !important;
}
#bot-trigger-btn:hover {
  transform: scale(1.1) !important;
}

/* ── MEMBERSHIP OFFERS CARD ── */
.bot-custom-html-container {
  flex: 1 1 0% !important;   /* Grow to fill remaining space after avatar */
  min-width: 0 !important;   /* CRITICAL: allows flex child to shrink below content size */
  box-sizing: border-box !important;
  margin-top: 5px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
}
.membership-title-label {
  font-family: var(--bot-font-heading) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  color: var(--brand-gold) !important;
  margin-bottom: 6px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}
.membership-cards-container {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
}
.membership-card {
  background: linear-gradient(135deg, rgba(61, 13, 43, 0.45) 0%, rgba(22, 5, 20, 0.75) 100%) !important;
  border: 1px solid rgba(139, 0, 53, 0.4) !important;
  border-radius: var(--bot-radius-md) !important;
  padding: 16px 18px 16px 22px !important; /* Extra left-padding for the 4px strip */
  position: relative !important;
  overflow: hidden !important;  /* Needed for border-radius corner clipping */
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2) !important;
  transition: all 0.3s ease !important;
}
.membership-card::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 4px !important;
  height: 100% !important;
  background: var(--brand-gold) !important;
}
.membership-card.happy-hours-card::before {
  background: var(--brand-magenta) !important;
}
.membership-card:hover {
  border-color: var(--brand-gold) !important;
  background: linear-gradient(135deg, rgba(61, 13, 43, 0.6) 0%, rgba(22, 5, 20, 0.85) 100%) !important;
  transform: translateY(-2px) !important;
}
.card-badge {
  position: absolute !important;
  top: 0 !important;
  right: 0 !important;
  background: var(--brand-gold) !important;
  color: #111 !important;
  font-size: 9px !important;
  font-weight: 700 !important;
  padding: 3px 10px !important;
  border-radius: 0 0 0 8px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}
.card-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  margin-bottom: 10px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  padding-bottom: 6px !important;
}
.card-title {
  font-family: var(--bot-font-heading) !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  color: #fff !important;
}
.card-price {
  font-family: var(--bot-font-heading) !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  color: var(--brand-gold) !important;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.3) !important;
}
.card-body {
  display: flex !important;
  justify-content: space-between !important;
  font-size: 11px !important;
  color: var(--brand-lavender) !important;
  margin-bottom: 4px !important;
}
.card-detail strong {
  color: #fff !important;
}
.card-footer {
  display: flex !important;
  justify-content: flex-end !important;
  margin-top: 10px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  padding-top: 10px !important;
}
.card-book-btn {
  background: #25D366 !important;
  color: #0E0620 !important;
  -webkit-text-fill-color: #0E0620 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  display: inline-flex !important;
  align-items: center !important;
  transition: all 0.25s ease !important;
  font-family: var(--bot-font-heading) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3) !important;
}
.card-book-btn svg {
  flex-shrink: 0 !important;
}
.card-book-btn:hover {
  transform: scale(1.05) !important;
  background: #20ba5a !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.45) !important;
}

/* ── FOOTER ── */
.bot-footer {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
  text-align: center !important;
  padding: 8px 10px !important;
  font-size: 12px !important;
  color: rgba(255,255,255,0.45) !important;
  -webkit-text-fill-color: initial !important;
  font-weight: 400 !important;
  letter-spacing: 0.3px !important;
  background: rgba(22,5,20,0.97) !important;
  margin: 0 !important;
  min-height: 0 !important;
  border: none !important;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
}

/* Animated gradient border for ViViD App Studio card chip */
@keyframes vivid-border-anim {
  0%   { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

@keyframes vivid-glow-pulse {
  0% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
  33% { box-shadow: 0 0 15px rgba(255, 107, 0, 0.7); }
  66% { box-shadow: 0 0 15px rgba(194, 24, 91, 0.7); }
  100% { box-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
}

/* Mobile & Tablet (max 768px) — full-screen immersive */
@media (max-width: 768px) {
  body.chatbot-open, html.chatbot-open {
    overflow: hidden !important;
  }
  #bot-window {
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    min-width: none !important;
    max-width: none !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    background: #220719 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  /* bot-trigger-wrapper mobile overrides are in the lower @media block */
  .bot-header {
    padding-top: calc(24px + env(safe-area-inset-top, 16px)) !important;
  }
  #bot-messages,
  .bot-messages {
    padding: 16px !important;
    gap: 12px !important;
  }
  .msg-bubble {
    font-size: 14px !important;
    max-width: 85% !important;
  }
  .bot-input-area {
    padding: 10px 14px !important;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px)) !important;
  }
  .bot-footer {
    font-size: 11px !important;
    padding-bottom: 0 !important;
  }
  .bot-chip {
    font-size: 11px !important;
    padding: 5px 10px !important;
  }
  #bot-chips,
  .bot-chips {
    margin-left: 38px !important;
    gap: 6px !important;
  }
  .bot-avatar-ring {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
  }
  .bot-avatar.lg { width: 34px !important; height: 34px !important; }
  h2.bot-name, .bot-name {
    font-size: 15px !important;
  }
}




/* Force highlight colors for mark tags (whether generated by regex or raw HTML from AI) */
.bot-messages mark {
    background-color: #FFD700 !important;
    color: #0E0620 !important;
    -webkit-text-fill-color: #0E0620 !important;
    padding: 0 4px !important;
    border-radius: 4px !important;
    font-weight: bold !important;
}

@media (max-width: 768px) {
  /* Tooltip visible on the left of avatar on mobile */
  #bot-tooltip-msg {
    display: flex !important;
    padding: 8px 10px !important;
    border-radius: 12px !important;
    margin-bottom: 0 !important;
    margin-right: 12px !important; /* Gap between tooltip and icon to its right */
    width: auto !important; /* Fit content dynamically */
    flex-grow: 1 !important; /* Fill remaining width */
    max-width: none !important;
    min-width: 0 !important;  /* CRITICAL: allow tooltip to shrink on mobile */
    overflow: visible !important; /* Allow the triangular arrow pointer to stick out */
  }

  /* Avatar (RIGHT) + Tooltip (LEFT) — tooltip extends leftward from bottom-right icon */
  #bot-trigger-wrapper {
    bottom: 0px !important;
    left: 0px !important;
    right: 0px !important;
    width: 100vw !important;
    margin: 0 !important;
    padding: 0 16px 10px 10px !important; /* Right padding for icon, left padding for tooltip edge */
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: row-reverse !important; /* Icon on RIGHT, tooltip extends LEFT */
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important; /* In row-reverse, flex-start = items pack to the RIGHT */
  }
  
  #bot-trigger-avatar-container {
    width: 60px !important; /* Force exact 60px width on mobile to prevent stretching */
    height: 60px !important;
    margin: 0 !important;
  }

  #bot-trigger-avatar {
    margin-bottom: 0 !important;
  }
  
  #bot-trigger-avatar .bot-trigger-img {
    width: 60px !important; /* Slightly smaller for mobile flow */
    height: 60px !important;
    border: 2px solid transparent !important;
    background: linear-gradient(#220719, #220719) padding-box, 
                linear-gradient(135deg, var(--brand-gold), #e066ff, var(--brand-gold)) border-box !important;
    background-size: 200% auto !important;
    animation: vivid-border-anim 4s linear infinite !important;
  }

  /* Display mobile only, hide desktop only inside media query */
  .tooltip-desktop-only {
    display: none !important;
  }

  .tooltip-mobile-only {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important; /* Center content horizontally inside mobile card */
    width: 100% !important; /* Fill tooltip container */
    min-width: 0 !important;
    gap: 5px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
  }

  .tooltip-mobile-name {
    font-size: 13px !important; /* Big font size */
    font-weight: 700 !important;
    flex-shrink: 0 !important;
  }

  .tooltip-mobile-name .name-gradient {
    background: linear-gradient(to right, #ffe082, #ffb300, #e65100) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
    display: inline-block !important;
  }

  .tooltip-mobile-role {
    font-size: 9.8px !important; /* Medium size */
    font-weight: 600 !important;
    color: #ffe082 !important; /* Gold text */
    flex-shrink: 0 !important;
  }

  .tooltip-mobile-status {
    font-size: 8.5px !important; /* Small size */
    font-weight: 500 !important;
    color: #25d366 !important; /* Status green */
    background: rgba(37, 211, 102, 0.08) !important;
    border: 1px solid rgba(37, 211, 102, 0.25) !important;
    padding: 1px 4px !important;
    border-radius: 4px !important;
    flex-shrink: 0 !important;
  }

  .tooltip-mobile-bullet {
    color: rgba(255, 255, 255, 0.3) !important;
    font-size: 10px !important;
    flex-shrink: 0 !important;
  }
  
  /* Arrow on RIGHT side of tooltip, pointing RIGHT toward icon */
  #bot-tooltip-msg .tooltip-arrow-outer {
    top: 50% !important;
    bottom: auto !important;
    right: -6px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    border-top: 6px solid transparent !important;
    border-bottom: 6px solid transparent !important;
    border-left: 6px solid var(--brand-gold) !important;
    border-right: none !important;
  }
  #bot-tooltip-msg .tooltip-arrow-inner {
    top: 50% !important;
    bottom: auto !important;
    right: -4px !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    border-top: 5px solid transparent !important;
    border-bottom: 5px solid transparent !important;
    border-left: 5px solid rgba(8, 3, 18, 0.95) !important;
    border-right: none !important;
  }
}
