.jbb-chatbot-root {
  --jbb-primary: #102342;
  --jbb-accent: #2dd4bf;
  --jbb-text: #0f172a;
  --jbb-muted: #64748b;
  --jbb-border: #e2e8f0;
  --jbb-bg: #ffffff;
  --jbb-surface: #f8fafc;
  font-family: Inter, Poppins, Arial, sans-serif;
  position: fixed;
  z-index: 999999;
}

.jbb-chatbot-root * { box-sizing: border-box; }
.jbb-chatbot-root.jbb-floating { bottom: 18px; }
.jbb-chatbot-root.jbb-right { right: 18px; }
.jbb-chatbot-root.jbb-left { left: 18px; }

.jbb-chatbot-toggle {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--jbb-primary), #1d4ed8);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .28);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}

.jbb-chatbot-toggle::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.28), transparent 45%);
}

.jbb-chatbot-toggle:hover { transform: translateY(-2px) scale(1.02); }
.jbb-chatbot-toggle-icon {
  position: relative;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  animation: jbbPulse 2.2s infinite ease-in-out;
}
.jbb-chatbot-toggle-icon svg { width: 30px; height: 30px; }
.jbb-chatbot-toggle-text { display: none; }

@keyframes jbbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.jbb-chatbot-window {
  width: 390px;
  max-width: calc(100vw - 24px);
  height: min(720px, calc(100vh - 100px));
  position: absolute;
  right: 0;
  bottom: 82px;
  background: #fff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .24);
  display: flex;
  flex-direction: column;
}

.jbb-chatbot-header {
  background: linear-gradient(135deg, var(--jbb-primary), #1e3a8a);
  color: #fff;
  padding: 18px 18px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.jbb-chatbot-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.jbb-chatbot-badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 6px rgba(52, 211, 153, .18);
}

.jbb-chatbot-header strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
  font-weight: 700;
}

.jbb-chatbot-subtitle {
  font-size: 13px;
  opacity: .92;
  margin-top: 6px;
  line-height: 1.45;
}

.jbb-chatbot-close {
  border: 0;
  background: rgba(255,255,255,.14);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.jbb-chatbot-quick-actions {
  display: flex;
  gap: 8px;
  padding: 12px 14px 0;
  overflow-x: auto;
  background: #fff;
}

.jbb-chatbot-chip {
  border: 1px solid var(--jbb-border);
  background: #fff;
  color: var(--jbb-text);
  border-radius: 999px;
  padding: 8px 12px;
  white-space: nowrap;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}

.jbb-chatbot-messages {
  flex: 1;
  padding: 14px;
  overflow-y: auto;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.jbb-message {
  max-width: 86%;
  padding: 13px 15px;
  border-radius: 18px;
  margin-bottom: 10px;
  white-space: pre-wrap;
  line-height: 1.58;
  font-size: 14px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.jbb-bot {
  background: #fff;
  color: var(--jbb-text);
  border: 1px solid var(--jbb-border);
  border-top-left-radius: 8px;
}

.jbb-user {
  margin-left: auto;
  background: linear-gradient(135deg, var(--jbb-primary), #1d4ed8);
  color: #fff;
  border-top-right-radius: 8px;
}

.jbb-typing {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.jbb-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  display: inline-block;
  animation: jbbTyping 1.2s infinite ease-in-out;
}
.jbb-typing span:nth-child(2) { animation-delay: .15s; }
.jbb-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes jbbTyping {
  0%, 100% { transform: translateY(0); opacity: .4; }
  50% { transform: translateY(-3px); opacity: 1; }
}

.jbb-chatbot-form {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px;
  background: #fff;
  border-top: 1px solid var(--jbb-border);
}

.jbb-chatbot-input-wrap { flex: 1; position: relative; }

.jbb-chatbot-input {
  width: 100%;
  min-height: 54px;
  max-height: 120px;
  border: 1px solid var(--jbb-border);
  border-radius: 16px;
  padding: 15px 16px;
  resize: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
  background: #fff;
}

.jbb-chatbot-input:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 4px rgba(59, 130, 246, .10);
}

.jbb-chatbot-send {
  min-width: 58px;
  height: 54px;
  border: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--jbb-primary), #1d4ed8);
  color: #fff;
  padding: 0 18px;
  font-weight: 700;
  cursor: pointer;
}

.jbb-chatbot-powered {
  padding: 0 16px 14px;
  font-size: 12px;
  color: var(--jbb-muted);
  background: #fff;
}
.jbb-chatbot-powered a {
  color: var(--jbb-primary);
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 640px) {
  .jbb-chatbot-root.jbb-floating { right: 12px; left: auto; bottom: 12px; }
  .jbb-chatbot-root.jbb-left { left: 12px; right: auto; }
  .jbb-chatbot-root.jbb-right { right: 12px; left: auto; }
  .jbb-chatbot-toggle { width: 60px; height: 60px; }
  .jbb-chatbot-window {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: min(78vh, 720px);
    right: 0;
    left: auto;
    bottom: 74px;
    border-radius: 24px;
  }
  .jbb-chatbot-header { padding: 16px 16px 14px; }
  .jbb-chatbot-header strong { font-size: 17px; }
  .jbb-chatbot-subtitle { font-size: 12px; }
  .jbb-message { max-width: 92%; }
  .jbb-chatbot-form { padding: 12px; }
  .jbb-chatbot-send { min-width: 54px; }
}
