* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #222;
  height: 100dvh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.container {
  width: 100%;
  max-width: 600px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #fff;
}

/* Login */
#login-view {
  justify-content: center;
  align-items: center;
  gap: 24px;
  padding: 32px;
}

#login-view h1 {
  font-size: 2rem;
}

#login-form {
  width: 100%;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

input {
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
}

button {
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  cursor: pointer;
  background: #222;
  color: #fff;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  color: #c00;
  font-size: 0.875rem;
  text-align: center;
}

/* Chat */
#chat-view header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
}

#chat-view header h1 {
  font-size: 1.25rem;
}

#logout-btn {
  background: transparent;
  color: #666;
  font-size: 0.875rem;
  padding: 6px 12px;
}

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.msg.assistant {
  align-self: flex-start;
  background: #eee;
}

#chat-form {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid #eee;
}

#chat-input {
  flex: 1;
}

#chat-form button {
  flex-shrink: 0;
  padding: 12px 20px;
}
