* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #f5f5f5;
  min-height: 100vh;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.5rem 0;
  flex-shrink: 0;
}

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

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

.msg {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  max-width: 95%;
  white-space: pre-wrap;
  word-break: break-word;
}

.msg.user {
  align-self: flex-end;
  background: #1a1a1a;
  color: #fff;
}

.msg.assistant {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e0e0e0;
}

.msg.thinking {
  align-self: flex-start;
  background: #f0f0f0;
  border: 1px solid #e0e0e0;
  color: #666;
  font-style: italic;
}

.input-area {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  padding: 0.5rem 0;
  flex-shrink: 0;
  background: #f5f5f5;
}

#input {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 160px;
  padding: 0.6rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font: inherit;
  line-height: 1.4;
}

#input:focus {
  outline: none;
  border-color: #1a1a1a;
}

.btn {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: #1a1a1a;
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #333;
}

.btn-secondary {
  background: #e0e0e0;
  color: #1a1a1a;
}

.btn-secondary:hover:not(:disabled) {
  background: #d0d0d0;
}
