/* Dynamic MBS AI Chat Widget */
#dmbs-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0284c7;
  color: #fff;
  border: none;
  box-shadow: 0 10px 30px rgba(2,132,199,0.4);
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, background 0.2s;
}
#dmbs-chat-launcher:hover { background: #0369a1; transform: scale(1.06); }
#dmbs-chat-launcher svg { width: 26px; height: 26px; }
#dmbs-chat-launcher .dmbs-badge {
  position: absolute;
  top: -3px; right: -3px;
  width: 14px; height: 14px;
  background: #22c55e;
  border-radius: 50%;
  border: 2px solid #fff;
}

#dmbs-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 370px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 140px);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(15,23,42,0.25);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  font-family: 'DM Sans', sans-serif;
}
#dmbs-chat-window.open { display: flex; }

#dmbs-chat-header {
  background: #0284c7;
  color: #fff;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#dmbs-chat-header .dmbs-title { display: flex; align-items: center; gap: 10px; }
#dmbs-chat-header .dmbs-title strong { font-family: 'Manrope', sans-serif; font-size: 15px; display: block; }
#dmbs-chat-header .dmbs-title span { font-size: 12px; opacity: 0.85; }
#dmbs-chat-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 20px; line-height: 1; opacity: 0.9; }
#dmbs-chat-close:hover { opacity: 1; }

#dmbs-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dmbs-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.55; }
.dmbs-msg.bot { align-self: flex-start; background: #ffffff; border: 1px solid #e2e8f0; color: #334155; border-bottom-left-radius: 3px; }
.dmbs-msg.user { align-self: flex-end; background: #0284c7; color: #fff; border-bottom-right-radius: 3px; }
.dmbs-msg.typing { align-self: flex-start; background: #ffffff; border: 1px solid #e2e8f0; padding: 12px 16px; }
.dmbs-typing-dots span {
  display: inline-block; width: 6px; height: 6px; margin: 0 1px;
  background: #94a3b8; border-radius: 50%; animation: dmbs-blink 1.2s infinite;
}
.dmbs-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.dmbs-typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dmbs-blink { 0%,80%,100% { opacity: 0.25; } 40% { opacity: 1; } }

#dmbs-chat-suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; background: #f8fafc; }
.dmbs-chip {
  font-size: 12px; padding: 6px 12px; border-radius: 999px;
  background: #e0f2fe; color: #0284c7; border: none; cursor: pointer; font-weight: 600;
}
.dmbs-chip:hover { background: #bae6fd; }

#dmbs-chat-input-row {
  display: flex; gap: 8px; padding: 12px;
  border-top: 1px solid #e2e8f0; background: #ffffff;
}
#dmbs-chat-input {
  flex: 1; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 10px 12px; font-size: 13.5px; font-family: inherit; resize: none; outline: none;
}
#dmbs-chat-input:focus { border-color: #0284c7; }
#dmbs-chat-send {
  background: #0284c7; color: #fff; border: none; border-radius: 8px;
  width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; cursor: pointer;
  flex-shrink: 0;
}
#dmbs-chat-send:hover { background: #0369a1; }
#dmbs-chat-send:disabled { opacity: 0.5; cursor: default; }

/* Lead capture inline form */
.dmbs-lead-card {
  align-self: stretch; background: #fff; border: 1px solid #bae6fd; border-radius: 10px;
  padding: 14px; font-size: 13px;
}
.dmbs-lead-card p { margin: 0 0 10px; font-weight: 700; color: #0f172a; }
.dmbs-lead-card input {
  width: 100%; padding: 9px 10px; margin-bottom: 8px; border: 1px solid #e2e8f0;
  border-radius: 6px; font-size: 13px; font-family: inherit; box-sizing: border-box;
}
.dmbs-lead-card button {
  width: 100%; padding: 10px; background: #0284c7; color: #fff; border: none;
  border-radius: 6px; font-weight: 700; cursor: pointer; font-size: 13px;
}
.dmbs-lead-card button:hover { background: #0369a1; }
.dmbs-lead-note { font-size: 11px; color: #94a3b8; margin-top: 6px; text-align: center; }

@media (max-width: 480px) {
  #dmbs-chat-window { right: 12px; left: 12px; width: auto; bottom: 84px; }
  #dmbs-chat-launcher { right: 16px; bottom: 16px; }
}
