* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f1117;
  color: #e1e4e8;
  height: 100vh;
  overflow: hidden;
}

.screen { height: 100vh; }

/* Login */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: #1c1f26;
  border: 1px solid #2d3139;
  border-radius: 12px;
  padding: 48px 40px;
  width: 380px;
  text-align: center;
}

.login-card h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 4px;
}

.subtitle {
  color: #8b949e;
  margin-bottom: 32px;
  font-size: 14px;
}

#login-form input {
  display: block;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: #0f1117;
  border: 1px solid #2d3139;
  border-radius: 8px;
  color: #e1e4e8;
  font-size: 14px;
  outline: none;
}

#login-form input:focus { border-color: #58a6ff; }

#login-form button {
  width: 100%;
  padding: 12px;
  background: #238636;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

#login-form button:hover { background: #2ea043; }
#login-form button:disabled { opacity: 0.6; cursor: not-allowed; }

.error { color: #f85149; font-size: 13px; margin-top: 12px; }

/* Chat */
#chat-screen {
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid #2d3139;
  background: #1c1f26;
}

.header-left { display: flex; align-items: center; gap: 16px; }
header h1 { font-size: 18px; font-weight: 600; }
#user-info { color: #8b949e; font-size: 13px; }

#logout-btn {
  background: transparent;
  border: 1px solid #2d3139;
  color: #8b949e;
  padding: 6px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
}

#logout-btn:hover { border-color: #8b949e; color: #e1e4e8; }

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

.msg {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.msg.user {
  align-self: flex-end;
  background: #1f6feb;
  border-bottom-right-radius: 4px;
}

.msg.assistant {
  align-self: flex-start;
  background: #1c1f26;
  border: 1px solid #2d3139;
  border-bottom-left-radius: 4px;
}

.msg .tool-tag {
  display: inline-block;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 8px;
}

.msg.assistant.streaming { border-color: #58a6ff; }

#chat-form {
  display: flex;
  padding: 16px 24px;
  gap: 12px;
  border-top: 1px solid #2d3139;
  background: #1c1f26;
}

#chat-input {
  flex: 1;
  padding: 12px 16px;
  background: #0f1117;
  border: 1px solid #2d3139;
  border-radius: 8px;
  color: #e1e4e8;
  font-size: 14px;
  outline: none;
}

#chat-input:focus { border-color: #58a6ff; }

#send-btn {
  padding: 12px 24px;
  background: #238636;
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#send-btn:hover { background: #2ea043; }
#send-btn:disabled { opacity: 0.6; cursor: not-allowed; }
