.sc-chatbot-fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #111;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(0,0,0,.25);
  cursor: pointer;
  z-index: 9999;
}
.sc-chatbot-fab:hover { filter: brightness(0.95); }

.sc-chatbot-panel {
  position: fixed;
  right: 18px;
  bottom: 84px;
  width: 360px;
  max-height: 65vh;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  display: none;
  flex-direction: column;
  box-shadow: 0 12px 28px rgba(0,0,0,.25);
  z-index: 9999;
}
.sc-chatbot-header {
  padding: 10px 12px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sc-chatbot-body { padding: 10px; overflow-y: auto; height: 46vh; }
.sc-chatbot-input { display: flex; gap: 6px; padding: 10px; border-top: 1px solid #e5e7eb; }
.sc-chatbot-input input { flex: 1; padding: 8px 10px; border: 1px solid #cbd5e1; border-radius: 8px; font-size: 14px; }
.sc-chatbot-input button { background: var(--accent); color: #111; border: 0; border-radius: 8px; padding: 8px 12px; cursor: pointer; }
.sc-chatbot-input button:hover { filter: brightness(0.95); }
.sc-chatbot-input button:disabled { background: #94a3b8; cursor: not-allowed; }
.sc-chat-row { display: flex; margin: 8px 0; }
.sc-chat-row.user { justify-content: flex-end; }
.sc-chat-row.bot { justify-content: flex-start; }
.sc-bubble { max-width: 80%; padding: 8px 10px; border-radius: 12px; font-size: 14px; color: #111827; white-space: pre-wrap; line-height: 1.35; }
/* Alternating subtle greys for visual separation */
.sc-bubble.user { background: #f3f4f6; /* slate-100 */ }
.sc-bubble.bot { background: #e5e7eb; /* slate-200 */ }

/* Typing indicator (animated dots) */
.sc-typing { display: inline-flex; gap: 4px; align-items: center; }
.sc-typing .dot { width: 6px; height: 6px; background: #6b7280; border-radius: 50%; opacity: 0.35; animation: sc-bounce 1s infinite; }
.sc-typing .dot:nth-child(2) { animation-delay: .15s; }
.sc-typing .dot:nth-child(3) { animation-delay: .3s; }
@keyframes sc-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .35 } 40% { transform: translateY(-3px); opacity: .85 } }
.sc-chatbot-close { background: transparent; color: #fff; border: 0; font-size: 20px; cursor: pointer; }
.sc-chatbot-close svg { width: 18px; height: 18px; display: block; }
.sc-chatbot-fab svg { width: 24px; height: 24px; display: block; }

/* Full overlay modal for "Get Started" */
.sc-chatbot-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; z-index: 9998; }
.sc-chatbot-modal { width: min(900px, 92vw); height: min(720px, 90vh); background: #fff; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 40px rgba(0,0,0,.35); }
.sc-chatbot-modal .sc-chatbot-header { background: #111827; }
.sc-chatbot-modal .sc-chatbot-body { height: auto; flex: 1; }
.sc-chatbot-modal .sc-chatbot-input { }

/* Back-compat: style legacy message nodes as bubbles too */
.sc-chat-msg { margin: 8px 0; font-size: 14px; white-space: pre-wrap; max-width: 80%; display: inline-block; padding: 8px 10px; border-radius: 12px; color: #111827; }
.sc-chat-msg.user { background: #f3f4f6; float: right; clear: both; }
.sc-chat-msg.bot { background: #e5e7eb; float: left; clear: both; }

/* Mobile adjustments */
@media (max-width: 640px) {
  .sc-chatbot-fab {
    right: 12px;
    bottom: 12px;
    width: 52px;
    height: 52px;
  }
  .sc-chatbot-panel {
    right: 4vw;
    bottom: 80px;
    width: 92vw;
    max-height: 70vh;
  }
  .sc-chatbot-body {
    height: 50vh;
  }
}
