.upc-chatbot * { box-sizing: border-box; font-family: inherit; }

.upc-chatbot {
  --upc-primary: #111827;
  --upc-primary-contrast: #ffffff;
  --upc-accent: #f8fafc;
  --upc-user-bubble: #111827;
  --upc-user-text: #ffffff;
  --upc-assistant-bubble: #ffffff;
  --upc-assistant-text: #111827;
  --upc-border: #d9dee5;
}

.upc-chatbot-shell {
  width: 360px;
  max-width: calc(100vw - 24px);
  background: #fff;
  border: 1px solid var(--upc-border);
  border-radius: 18px;
  box-shadow: 0 12px 40px rgba(17,24,39,.18);
  overflow: hidden;
}

.upc-chatbot-header {
  padding: 14px 16px;
  font-weight: 700;
  background: var(--upc-primary);
  color: var(--upc-primary-contrast);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upc-chatbot-header-brand {
  font-size: 12px;
  font-weight: 600;
  opacity: .9;
  white-space: nowrap;
}

.upc-chatbot-messages {
  height: 360px;
  overflow: auto;
  padding: 14px;
  background: var(--upc-accent);
}

.upc-chatbot-message {
  margin: 0 0 12px 0;
  display: flex;
}

.upc-chatbot-message.user {
  justify-content: flex-end;
}

.upc-chatbot-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  white-space: pre-wrap;
  line-height: 1.45;
  font-size: 14px;
}

.upc-chatbot-message.assistant .upc-chatbot-bubble {
  background: var(--upc-assistant-bubble);
  border: 1px solid #e5e7eb;
  color: var(--upc-assistant-text);
}

.upc-chatbot-message.user .upc-chatbot-bubble {
  background: var(--upc-user-bubble);
  color: var(--upc-user-text);
}

.upc-chatbot-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.upc-chatbot-form textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 110px;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 10px 12px;
}

.upc-chatbot-form button {
  border: 0;
  background: var(--upc-primary);
  color: var(--upc-primary-contrast);
  border-radius: 12px;
  padding: 0 14px;
  cursor: pointer;
}

.upc-floating {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
}

.upc-chatbot-toggle {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  background: var(--upc-primary);
  color: var(--upc-primary-contrast);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(17,24,39,.25);
}

.upc-chatbot-panel {
  display: none;
  margin-bottom: 12px;
}

.upc-chatbot-panel.open {
  display: block;
}

.upc-shortcode .upc-chatbot-shell {
  width: 100%;
  max-width: 760px;
}

.upc-typing {
  opacity: .7;
  font-style: italic;
}

.upc-chatbot-footer {
  padding: 8px 12px 12px;
  text-align: center;
  font-size: 12px;
  color: #6b7280;
  background: #fff;
}