:root {
  --bg: #0f1115;
  --panel: #171a21;
  --border: #262b35;
  --text: #e8e9ec;
  --text-dim: #9aa0ab;
  --accent: #4f7cff;
  --user-bubble: #2a3140;
  --assistant-bubble: #1b1e26;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}

.brand {
  font-weight: 600;
  font-size: 16px;
}

.new-chat-btn {
  background: var(--accent);
  border: none;
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.new-chat-btn:hover { opacity: 0.9; }

.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.empty-state {
  margin: auto;
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
}

.msg {
  display: flex;
  gap: 12px;
  max-width: 100%;
}

.msg .bubble {
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 15px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg.user {
  justify-content: flex-end;
}
.msg.user .bubble {
  background: var(--user-bubble);
  border-bottom-right-radius: 4px;
  max-width: 80%;
}

.msg.assistant .bubble {
  background: var(--assistant-bubble);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  max-width: 85%;
}

.composer {
  display: flex;
  gap: 10px;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel);
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

textarea#messageInput {
  flex: 1;
  resize: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  max-height: 160px;
}
textarea#messageInput:focus {
  outline: none;
  border-color: var(--accent);
}

#sendBtn {
  background: var(--accent);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#sendBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#sendBtn:hover:not(:disabled) { opacity: 0.9; }
