.jbb-chatbot-root {
  --jbb-primary: #1f2a44;
  --jbb-accent: #2c3650;
  --jbb-text: #111827;
  --jbb-muted: #6b7280;
  --jbb-border: #e5e7eb;
  --jbb-bg: #ffffff;
  font-family: Poppins, Arial, sans-serif;
}

.jbb-chatbot-root * {
  box-sizing: border-box;
}

.jbb-chatbot-root.jbb-floating {
  position: fixed;
  bottom: 20px;
  z-index: 999999;
}

.jbb-chatbot-root {
  position: fixed;
}

.jbb-chatbot-root.jbb-right {
  right: 20px;
}

.jbb-chatbot-root.jbb-left {
  left: 20px;
}

.jbb-chatbot-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: var(--jbb-primary);
  color: #fff;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(17, 24, 39, 0.22);
}

.jbb-chatbot-toggle:hover {
  transform: translateY(-1px);
}

.jbb-chatbot-window {
  width: 380px;
  max-width: calc(100vw - 24px);
  height: 620px;
  max-height: calc(100vh - 105px);
  position: absolute;
  right: 0;
  bottom: 72px;
  margin-top: 0;
  background: #fff;
  border: 1px solid var(--jbb-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 28px 70px rgba(17, 24, 39, 0.24);
  display: flex;
  flex-direction: column;
}

.jbb-chatbot-header {
  background: var(--jbb-primary);
  color: #fff;
  padding: 18px 18px 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.jbb-chatbot-header strong {
  display: block;
  font-size: 17px;
  line-height: 1.3;
}

.jbb-chatbot-subtitle {
  font-size: 12px;
  opacity: 0.88;
  margin-top: 4px;
}

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

.jbb-chatbot-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f8fafc;
}

.jbb-message {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  margin-bottom: 10px;
  white-space: pre-wrap;
  line-height: 1.55;
  font-size: 14px;
  box-shadow: 0 6px 16px rgba(17, 24, 39, 0.06);
}

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

.jbb-user {
  margin-left: auto;
  background: var(--jbb-primary);
  color: #fff;
  border-top-right-radius: 6px;
}

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

.jbb-chatbot-input {
  flex: 1;
  min-height: 52px;
  max-height: 120px;
  border: 1px solid var(--jbb-border);
  border-radius: 14px;
  padding: 13px 14px;
  resize: none;
  outline: none;
  font-family: inherit;
  font-size: 14px;
}

.jbb-chatbot-input:focus {
  border-color: var(--jbb-primary);
  box-shadow: 0 0 0 3px rgba(31, 42, 68, 0.10);
}

.jbb-chatbot-send {
  min-width: 86px;
  border: 0;
  border-radius: 14px;
  background: var(--jbb-primary);
  color: #fff;
  padding: 0 16px;
  font-weight: 600;
  cursor: pointer;
}

.jbb-chatbot-send:hover {
  opacity: 0.92;
}

.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: 600;
  text-decoration: none;
}

.jbb-inline .jbb-chatbot-window {
  position: absolute;
  right: 0;
  bottom: 72px;
}

@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-window {
    width: min(380px, calc(100vw - 24px));
    height: min(70vh, 620px);
    max-height: 70vh;
    right: 0;
    left: auto;
    bottom: 72px;
  }
}


.jbb-chatbot-header {
  position: relative;
  z-index: 5;
}

.jbb-chatbot-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 20;
  pointer-events: auto;
  touch-action: manipulation;
}

.jbb-chatbot-window[hidden] {
  display: none !important;
}
