:root {
  color-scheme: light;
  --bg: #f4f2f7;
  --panel: #ffffff;
  --line: #e9e7ef;
  --text: #1c1530;
  --muted: #6b7280;
  --primary: #633479;
  --primary-2: #4a2659;
  --primary-soft: #f5f0f8;
  --accent: #ffc05a;
  --danger: #c0392b;
  --shadow-soft: 0 4px 18px rgba(74, 38, 89, 0.06);
  font-family: Alexandria, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#embed {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.chatbot {
  width: 100%;
  height: 100%;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(700px 280px at 100% 0%, rgba(255, 192, 90, 0.12), transparent 55%),
    radial-gradient(640px 300px at 0% 0%, rgba(99, 52, 121, 0.10), transparent 50%),
    var(--bg);
}

.chatbot-header {
  position: relative;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.chatbot-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
}

.chatbot-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.chatbot-avatar {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: block;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: var(--shadow-soft);
}

.chat-status {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.chat-status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 50%;
  background: #22a06b;
}

.chat-status.is-typing::before {
  background: var(--accent);
}

.chatbot-header h1 {
  margin: 0;
  font-size: 15px;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.reset-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  background: var(--primary-soft);
  color: var(--text);
  font-weight: 600;
}

.reset-button:hover {
  border-color: rgba(99, 52, 121, 0.35);
  background: #ebe1f0;
}

.chat-log {
  flex: 1;
  overflow: auto;
  padding: 14px;
}

.bubble {
  width: fit-content;
  max-width: 86%;
  margin-bottom: 9px;
  padding: 10px 12px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 14px;
}

.bubble.bot {
  background: var(--panel);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-soft);
}

.bubble.user {
  margin-left: auto;
  color: #fff;
  background: var(--primary);
  border-bottom-right-radius: 4px;
}

.bubble.system {
  max-width: 100%;
  color: var(--muted);
  background: transparent;
  text-align: center;
  font-size: 12px;
}

.chat-actions {
  display: grid;
  gap: 8px;
  padding: 10px 12px 0;
  background: var(--panel);
  max-height: 38%;
  overflow: auto;
}

.chat-hint {
  margin: 0;
  padding: 4px 2px 8px;
  color: var(--muted);
  font-size: 12px;
}

.hint-chip {
  display: inline-flex;
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(99, 52, 121, 0.18);
  background: var(--primary-soft);
  color: var(--primary-2);
  font-size: 11px;
  font-weight: 700;
}

.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 4px;
}

.quick-replies button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--primary-soft);
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
}

.chat-composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px 12px 12px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}

.chat-composer input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  background: #fff;
  color: var(--text);
}

.chat-composer input:focus {
  outline: 3px solid rgba(99, 52, 121, 0.16);
  border-color: var(--primary);
}

.chat-composer button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
}

.chat-composer input:disabled,
.chat-composer button:disabled {
  opacity: 0.55;
}

.typing-bubble {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  min-width: 52px;
  padding: 12px 14px !important;
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  opacity: 0.35;
  animation: typing-bounce 1.2s infinite ease-in-out;
}

.typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.typing-bubble span:nth-child(3) { animation-delay: 0.3s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.35; }
  40% { transform: translateY(-3px); opacity: 1; }
}

.color-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.color-swatch {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
}

.color-swatch:hover {
  border-color: rgba(99, 52, 121, 0.35);
}

.color-swatch-disk {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--swatch, #ccc);
  border: 2px solid rgba(28, 21, 48, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.color-swatch-meta {
  display: grid;
  gap: 2px;
  text-align: center;
  width: 100%;
  min-width: 0;
}

.color-swatch-meta strong {
  font-size: 12px;
  font-weight: 700;
}

.color-swatch-meta small {
  font-size: 10px;
  color: var(--muted);
}

.result-cards {
  display: grid;
  gap: 8px;
}

.result-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
}

.result-card:hover {
  border-color: rgba(99, 52, 121, 0.35);
}

.result-card-media {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  background:
    center / cover no-repeat,
    linear-gradient(145deg, rgba(99, 52, 121, 0.16), rgba(255, 192, 90, 0.28));
}

.result-card-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.result-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.result-card-specialty {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-card-price {
  font-size: 12px;
  font-weight: 800;
  color: var(--primary);
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.input-row input {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 11px;
  color: var(--text);
  background: #fff;
}

.input-row input:focus {
  outline: 3px solid rgba(99, 52, 121, 0.18);
  border-color: var(--primary);
}

.input-row button {
  min-height: 42px;
  border: 0;
  border-radius: 10px;
  padding: 0 14px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.input-row button:hover {
  background: var(--primary-2);
}

.error {
  margin: auto;
  max-width: 360px;
  padding: 18px;
  color: var(--danger);
  text-align: center;
}
