* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
  height: 100vh;
}

/* Login */
.login-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
  gap: 16px;
}
.login-container h1 {
  font-size: 2rem;
  color: #fff;
}
.login-container form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 300px;
}
.login-container input {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
}
.login-container button {
  padding: 12px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.login-container button[type="submit"] {
  background: #2563eb;
  color: #fff;
}
.login-container button[type="button"] {
  background: #333;
  color: #ccc;
}
.error {
  color: #ef4444;
  font-size: 13px;
}

/* App layout */
.app {
  display: flex;
  height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #111;
  border-right: 1px solid #222;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 8px;
}
.new-chat {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: transparent;
  color: #ccc;
  cursor: pointer;
  font-size: 14px;
}
.new-chat:hover {
  background: #1a1a1a;
}
.conv-item {
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv-item:hover {
  background: #1a1a1a;
}
.conv-item.active {
  background: #1a1a1a;
  color: #fff;
}
.logout {
  margin-top: auto;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #333;
  background: transparent;
  color: #999;
  cursor: pointer;
  font-size: 13px;
}

/* Chat */
.chat {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.message {
  max-width: 720px;
  padding: 12px 16px;
  border-radius: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.message.user {
  align-self: flex-end;
  background: #2563eb;
  color: #fff;
}
.message.assistant {
  align-self: flex-start;
  background: #1a1a1a;
  color: #e0e0e0;
}
.message.error {
  border: 1px solid #ef4444;
}
.input-area {
  padding: 16px 24px;
  border-top: 1px solid #222;
  display: flex;
  gap: 12px;
}
.input-area textarea {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #333;
  background: #1a1a1a;
  color: #fff;
  font-size: 14px;
  resize: none;
  font-family: inherit;
}
.input-area button {
  padding: 12px 24px;
  border-radius: 8px;
  border: none;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
