:root {
  --bg: #fdf6ee;
  --surface: #ffffff;
  --border: #ecdfce;
  --text: #2c241b;
  --text-muted: #8a7c6a;
  --accent: #c8763a;
  --accent-dark: #a85f2b;
  --assistant-bubble: #f3e9dc;
  --user-bubble: #c8763a;
  --user-bubble-text: #ffffff;
  --radius: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 640px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.app-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-header-emoji {
  font-size: 1.4rem;
}

.app-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.app-header-subtitle {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

.message {
  display: flex;
  max-width: 85%;
}

.message.user {
  align-self: flex-end;
}

.message.assistant {
  align-self: flex-start;
}

.bubble {
  padding: 10px 14px;
  border-radius: var(--radius);
  line-height: 1.45;
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.message.assistant .bubble {
  background: var(--assistant-bubble);
  border-bottom-left-radius: 4px;
}

.message.user .bubble {
  background: var(--user-bubble);
  color: var(--user-bubble-text);
  border-bottom-right-radius: 4px;
}

.bubble ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.bubble.error {
  background: #fbe4e0;
  color: #7a2b1f;
}

.bubble.thinking {
  color: var(--text-muted);
  font-style: italic;
}

.composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.composer-input {
  flex: 1;
  resize: none;
  max-height: 120px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-family: inherit;
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
}

.composer-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.composer-send {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.composer-send:hover {
  background: var(--accent-dark);
}

.composer-send:disabled {
  opacity: 0.5;
  cursor: default;
}

.disclaimer {
  margin: 0;
  padding: 6px 16px 12px;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  background: var(--surface);
}
