* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: #f3f4f6;
  height: 100vh;
}

.chat {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
}

.chat-header {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem 0;
}

.chat-header button {
  padding: 0.35rem 0.75rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  background: #fff;
  color: #374151;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.chat-header button:hover {
  background: #f3f4f6;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.message {
  max-width: 75%;
  padding: 0.6rem 0.9rem;
  border-radius: 0.75rem;
  white-space: pre-wrap;
  line-height: 1.4;
}

.message-user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
}

.message-assistant {
  align-self: flex-start;
  background: #f1f5f9;
  color: #111827;
}

.message-loading {
  opacity: 0.5;
}

.chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  border-top: 1px solid #e5e7eb;
}

.chat-form textarea {
  flex: 1;
  resize: none;
  padding: 0.6rem;
  border: 1px solid #d1d5db;
  border-radius: 0.5rem;
  font: inherit;
  min-height: 2.5rem;
}

.chat-form button {
  padding: 0 1.25rem;
  border: none;
  border-radius: 0.5rem;
  background: #111827;
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.chat-form button:hover {
  background: #1f2937;
}
