:root {
  --chatbot-primary: #0d9488;
  --chatbot-primary-dark: #0f766e;
  --chatbot-bg: #ffffff;
  --chatbot-soft: #f0fdfa;
  --chatbot-text: #111827;
  --chatbot-muted: #6b7280;
  --chatbot-border: #e5e7eb;
  --chatbot-shadow: 0 20px 40px rgba(2, 6, 23, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif;
  background: linear-gradient(150deg, #f8fafc, #ecfeff 65%, #f8fafc);
  color: var(--chatbot-text);
}

.demo-page {
  max-width: 720px;
  margin: 48px auto;
  padding: 0 20px;
}

.chatbot-launcher {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: #000000 !important;
  color: #fff;
  box-shadow: var(--chatbot-shadow);
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chatbot-launcher:hover {
  background: #000000 !important;
  transform: translateY(-1px);
  box-shadow: 0 24px 42px rgba(2, 6, 23, 0.25);
}

.chatbot-launcher-icon {
  font-size: 18px;
}

.chatbot-launcher-label {
  font-size: 14px;
  font-weight: 600;
}

.chatbot-panel {
  position: fixed;
  right: 20px;
  bottom: 82px;
  width: min(320px, calc(100vw - 24px));
  height: min(500px, calc(100vh - 108px));
  background: var(--chatbot-bg);
  border: 1px solid var(--chatbot-border);
  border-radius: 18px;
  box-shadow: var(--chatbot-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.chatbot-panel.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chatbot-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 16px 14px;
  background: var(--chatbot-soft);
  border-bottom: 1px solid var(--chatbot-border);
}

.chatbot-header h2 {
  margin: 0;
  font-size: 16px;
}

.chatbot-header p {
  margin: 4px 0 0;
  color: var(--chatbot-muted);
  font-size: 12px;
}

.chatbot-close {
  border: 0;
  background: transparent;
  color: var(--chatbot-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fbfdff;
}

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

.chatbot-bubble.bot {
  align-self: flex-start;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
}

.chatbot-bubble.user {
  align-self: flex-end;
  background: #ccfbf1;
  border: 1px solid #99f6e4;
}

.chatbot-footer {
  border-top: 1px solid var(--chatbot-border);
  padding: 12px;
  background: #fff;
}

.chatbot-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chatbot-option-btn {
  border: 1px solid #94a3b8;
  background: #f8fafc;
  color: #0f172a !important;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.chatbot-option-btn:hover {
  border-color: var(--chatbot-primary-dark);
  background: #ccfbf1;
  color: #0f172a !important;
}

.chatbot-input {
  margin-top: 10px;
  display: flex;
  gap: 8px;
}

.chatbot-input input {
  flex: 1;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
}

.chatbot-input button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--chatbot-primary-dark);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.chatbot-whatsapp-btn {
  margin-top: 10px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 5px 10px;
  min-height: 30px;
  line-height: 1.1;
  font-size: 12px;
  font-weight: 600;
  background: #22c55e;
  color: #fff;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

@media (max-width: 640px) {
  .chatbot-launcher {
    right: 12px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    padding: 10px 14px;
    min-height: 42px;
  }

  .chatbot-launcher-label {
    display: inline;
    font-size: 12px;
  }

  .chatbot-panel {
    right: 12px;
    left: 12px;
    bottom: calc(62px + env(safe-area-inset-bottom));
    width: auto;
    height: min(68vh, 520px);
    border-radius: 14px;
  }
}
