:root {
  --sw-primary: #ed1c24;
  --sw-primary-dark: #c4161d;
  --sw-primary-light: #fde8e9;
  --sw-bg: #ffffff;
  --sw-surface: #f8fafc;
  --sw-border: #e2e8f0;
  --sw-text: #1e293b;
  --sw-text-secondary: #64748b;
  --sw-user-bubble: #ed1c24;
  --sw-user-text: #ffffff;
  --sw-assistant-bubble: #f1f5f9;
  --sw-assistant-text: #1e293b;
  --sw-font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--sw-font);
  background: var(--sw-bg);
  color: var(--sw-text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.widget-header {
  background: var(--sw-primary);
  color: white;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.widget-header .logo {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}

.widget-header .title { font-size: 15px; font-weight: 600; }
.widget-header .subtitle { font-size: 11px; opacity: .85; }

.clear-btn {
  margin-left: auto;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 6px 8px;
  font-size: 11px;
  cursor: pointer;
}

.messages-container {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 12px;
  background: var(--sw-surface);
}

.message { display: flex; gap: 8px; max-width: 90%; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.assistant { align-self: flex-start; }

.message .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.message.user .avatar { background: var(--sw-primary); color: #fff; }
.message.assistant .avatar { background: var(--sw-primary-light); color: var(--sw-primary); }

.message .bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 14px; line-height: 1.55; word-break: break-word;
}
.message.user .bubble { background: var(--sw-user-bubble); color: var(--sw-user-text); border-bottom-right-radius: 4px; }
.message.assistant .bubble { background: var(--sw-assistant-bubble); color: var(--sw-assistant-text); border-bottom-left-radius: 4px; }
.message .bubble p { margin: 0 0 8px; }
.message .bubble p:last-child { margin-bottom: 0; }
.message .privacy { font-size: 12px; color: var(--sw-text-secondary); }

.typing-indicator { display: flex; gap: 4px; padding: 10px 14px; }
.typing-indicator .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--sw-text-secondary);
  animation: bounce 1.4s infinite;
}
.typing-indicator .dot:nth-child(2) { animation-delay: .2s; }
.typing-indicator .dot:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.input-container {
  padding: 12px 16px;
  border-top: 1px solid var(--sw-border);
  background: var(--sw-bg);
}
.input-wrapper {
  display: flex; gap: 8px; align-items: center;
  background: var(--sw-surface);
  border: 1px solid var(--sw-border);
  border-radius: 24px;
  padding: 4px 4px 4px 16px;
}
.input-wrapper textarea {
  flex: 1; border: none; background: none; font-size: 14px;
  font-family: var(--sw-font); resize: none; outline: none;
  max-height: 100px; padding: 8px 0;
}
.send-btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--sw-primary); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.send-btn:disabled { background: #cbd5e1; cursor: not-allowed; }
.send-btn svg { width: 18px; height: 18px; }

.suggested-questions {
  padding: 8px 16px 12px; display: flex; flex-wrap: wrap; gap: 6px;
  border-top: 1px solid var(--sw-border); background: var(--sw-bg);
}
.suggested-question {
  font-size: 12px; padding: 6px 12px; border-radius: 14px;
  background: var(--sw-surface); border: 1px solid var(--sw-border);
  color: var(--sw-text-secondary); cursor: pointer;
}

.feedback-btns { display: flex; gap: 8px; margin-top: 6px; }
.feedback-btn {
  background: none; border: 1px solid var(--sw-border); border-radius: 50%;
  width: 28px; height: 28px; cursor: pointer;
}
.feedback-btn.active { background: var(--sw-primary); border-color: var(--sw-primary); color: #fff; }

.message.error .bubble { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
