:root {
  color-scheme: dark;
  --bg: #0f1117;
  --panel: #171a23;
  --border: #2a2e3a;
  --text: #e6e8ee;
  --muted: #8b90a0;
  --accent: #5b8cff;
  --user-bubble: #5b8cff;
  --assistant-bubble: #1f2330;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  height: 100vh;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0;
  font-size: 1.3rem;
}

.subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.message.assistant {
  justify-content: flex-start;
}

.bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  line-height: 1.45;
  white-space: normal;
  word-wrap: break-word;
}

.message.user .bubble {
  background: var(--user-bubble);
  color: white;
  border-bottom-right-radius: 2px;
}

.message.assistant .bubble {
  background: var(--assistant-bubble);
  border: 1px solid var(--border);
  border-bottom-left-radius: 2px;
}

.code-block {
  background: #0b0d12;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  margin: 8px 0;
  font-size: 0.85rem;
}

.code-block code {
  font-family: "Cascadia Code", "Fira Code", Consolas, monospace;
}

.composer {
  display: flex;
  gap: 8px;
  padding: 12px 16px 20px;
  border-top: 1px solid var(--border);
}

.composer textarea {
  flex: 1;
  resize: none;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.95rem;
}

.composer textarea:focus {
  outline: 2px solid var(--accent);
}

.composer button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 0 20px;
  font-size: 0.95rem;
  cursor: pointer;
}

.composer button:disabled {
  opacity: 0.6;
  cursor: default;
}
