* { box-sizing: border-box; }

:root {
  --bg: #0b0c0f;
  --surface: #16171c;
  --border: #26272e;
  --text: #e8e8ea;
  --muted: #8a8b93;
  --accent: #5b8cff;
}

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

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

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

.brand {
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

#model-select {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  max-width: 220px;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.45;
  font-size: 14.5px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.msg.assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.msg.assistant.pending::after {
  content: "▍";
  animation: blink 1s step-start infinite;
  color: var(--muted);
}

@keyframes blink { 50% { opacity: 0; } }

.composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid var(--border);
}

#input {
  flex: 1;
  resize: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 14.5px;
  font-family: inherit;
  max-height: 160px;
}

#input:focus {
  outline: none;
  border-color: var(--accent);
}

#send {
  background: var(--accent);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

#send:disabled {
  opacity: 0.5;
  cursor: default;
}

#send:not(:disabled):hover {
  filter: brightness(1.1);
}
