/* V36.7.36 — chatbot light/dark contrast and consistent message geometry. */
#ai-chat-modal.chat-modal {
  border-radius:24px !important;
  overflow:hidden !important;
  color:var(--text-main,#202b3b) !important;
}
#ai-chat-modal .chat-header,
#ai-chat-modal .chat-mode-bar,
#ai-chat-modal .chat-input-row {
  flex-shrink:0 !important;
}
#ai-chat-modal .chat-header {
  min-height:76px !important;
  padding:16px 20px !important;
  display:flex !important;
  align-items:center !important;
}
#ai-chat-modal .chat-header-title,
#ai-chat-modal .chat-header-title *,
#ai-chat-modal .chat-header strong {
  color:inherit !important;
  opacity:1 !important;
  text-shadow:none !important;
}
#ai-chat-modal .chat-messages {
  min-height:0 !important;
  color:inherit !important;
}
#ai-chat-modal .msg-bubble,
#ai-chat-modal .chat-message,
#ai-chat-modal .message-content {
  border-radius:18px !important;
  line-height:1.55 !important;
  overflow-wrap:anywhere !important;
  word-break:normal !important;
}
#ai-chat-modal .msg-bubble.user {
  border-bottom-right-radius:8px !important;
  color:#fff !important;
  background:linear-gradient(135deg,#ff963f,#ff7518) !important;
  border:1px solid rgba(255,255,255,.18) !important;
}
#ai-chat-modal .msg-bubble.bot {
  border-bottom-left-radius:8px !important;
}
#ai-chat-modal .msg-bubble.admin {
  border-bottom-left-radius:8px !important;
}
#ai-chat-modal .chat-input-text,
#ai-chat-modal input,
#ai-chat-modal textarea {
  border-radius:16px !important;
  line-height:1.4 !important;
}
#ai-chat-modal .btn-send-msg {
  border-radius:16px !important;
  min-width:76px !important;
}
#ai-chat-modal .chat-close-btn {
  display:grid !important;
  place-items:center !important;
  width:42px !important;height:42px !important;
  border-radius:13px !important;
}

/* Default/light appearance: replace the inherited dark glass panel with a
   genuinely light, readable surface. Explicit dark text avoids theme-variable
   leakage from seasonal and legacy stylesheets. */
body.light-mode #ai-chat-modal.chat-modal,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal.chat-modal {
  background:rgba(250,252,255,.98) !important;
  color:#263449 !important;
  border:1px solid #cbd6e4 !important;
  box-shadow:0 18px 48px rgba(35,55,85,.20) !important;
  -webkit-backdrop-filter:blur(16px) saturate(115%) !important;
  backdrop-filter:blur(16px) saturate(115%) !important;
}
body.light-mode #ai-chat-modal .chat-header,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal .chat-header {
  color:#24364d !important;
  background:rgba(237,244,252,.98) !important;
  border-bottom:1px solid #d5dfeb !important;
}
body.light-mode #ai-chat-modal .chat-header-title,
body.light-mode #ai-chat-modal .chat-header-title *,
body.light-mode #ai-chat-modal .chat-close-btn,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal .chat-header-title,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal .chat-header-title *,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal .chat-close-btn {
  color:#24364d !important;
  opacity:1 !important;
}
body.light-mode #ai-chat-modal .chat-messages,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal .chat-messages {
  background:#f4f7fb !important;
  color:#263449 !important;
}
body.light-mode #ai-chat-modal .msg-bubble.bot,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal .msg-bubble.bot {
  background:#fff !important;
  color:#263449 !important;
  border:1px solid #d6dfeb !important;
  box-shadow:0 3px 10px rgba(35,55,85,.06) !important;
}
body.light-mode #ai-chat-modal .msg-bubble.admin,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal .msg-bubble.admin {
  background:#f0eaff !important;
  color:#3d2867 !important;
  border:1px solid #d7c8fa !important;
}
body.light-mode #ai-chat-modal .chat-mode-bar,
body.light-mode #ai-chat-modal .chat-input-row,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal .chat-mode-bar,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal .chat-input-row {
  background:#edf3fa !important;
  border-color:#d5dfeb !important;
  color:#263449 !important;
}
body.light-mode #ai-chat-modal .chat-input-text,
body.light-mode #ai-chat-modal input,
body.light-mode #ai-chat-modal textarea,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal .chat-input-text,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal input,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal textarea {
  background:#fff !important;
  color:#263449 !important;
  border:1px solid #cbd6e4 !important;
}
body.light-mode #ai-chat-modal .chat-input-text::placeholder,
body.light-mode #ai-chat-modal input::placeholder,
body.light-mode #ai-chat-modal textarea::placeholder,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal input::placeholder,
body:not(.dark-mode):not(.theme-halloween):not(.theme-winter):not(.theme-ocean) #ai-chat-modal textarea::placeholder {
  color:#718096 !important;
  opacity:1 !important;
}

/* Dark appearance: keep the existing deep-glass identity but guarantee
   readable foregrounds and matching bubble radii. */
body.dark-mode #ai-chat-modal.chat-modal {
  background:rgba(24,22,43,.97) !important;
  color:#edf1ff !important;
  border-color:rgba(185,178,230,.30) !important;
}
body.dark-mode #ai-chat-modal .chat-header,
body.dark-mode #ai-chat-modal .chat-mode-bar,
body.dark-mode #ai-chat-modal .chat-input-row {
  background:rgba(25,21,48,.98) !important;
  color:#f1efff !important;
  border-color:rgba(185,178,230,.25) !important;
}
body.dark-mode #ai-chat-modal .chat-header-title,
body.dark-mode #ai-chat-modal .chat-header-title *,
body.dark-mode #ai-chat-modal .chat-close-btn {
  color:#f1efff !important;
  opacity:1 !important;
}
body.dark-mode #ai-chat-modal .chat-messages { background:rgba(14,17,35,.45) !important; }
body.dark-mode #ai-chat-modal .msg-bubble.bot {
  background:#242238 !important;color:#f0f1fb !important;
  border:1px solid #45405f !important;
}
body.dark-mode #ai-chat-modal .msg-bubble.admin {
  background:#302344 !important;color:#f4eaff !important;
  border:1px solid #70549b !important;
}
body.dark-mode #ai-chat-modal .chat-input-text,
body.dark-mode #ai-chat-modal input,
body.dark-mode #ai-chat-modal textarea {
  background:#111326 !important;color:#f2f3ff !important;
  border:1px solid #45405f !important;
}
body.dark-mode #ai-chat-modal input::placeholder,
body.dark-mode #ai-chat-modal textarea::placeholder { color:#aeb4c8 !important;opacity:1 !important; }

@media(max-width:600px) {
  #ai-chat-modal.chat-modal { border-radius:22px !important; }
  #ai-chat-modal .chat-header { min-height:70px !important;padding:13px 16px !important; }
  #ai-chat-modal .msg-bubble { max-width:92% !important;padding:12px 15px !important;font-size:15px !important; }
}
