:root {
  --brand: #a13d2f;
  --bg: #f5f6f8;
  --bubble-user: #a13d2f;
  --bubble-bot: #ffffff;
  --text-dark: #1a1a1a;
  --text-light: #ffffff;
  --border: #e1e4e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 16px;
}

.widget {
  width: 100%;
  max-width: 420px;
  height: 620px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.widget-header {
  background: var(--brand);
  color: var(--text-light);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.title {
  font-weight: 600;
  font-size: 15px;
}

.subtitle {
  font-size: 12px;
  opacity: 0.85;
}

.messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.msg.user {
  align-self: flex-end;
  background: var(--bubble-user);
  color: var(--text-light);
  border-bottom-right-radius: 4px;
}

.msg.bot {
  align-self: flex-start;
  background: var(--bubble-bot);
  border: 1px solid var(--border);
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
}

.msg.typing {
  color: #888;
  font-style: italic;
}

.composer {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

#chat-input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  font-size: 14px;
  outline: none;
}

#chat-input:focus {
  border-color: var(--brand);
}

#send-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#send-btn:disabled {
  opacity: 0.6;
  cursor: default;
}
