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

:root {
  --bg: #0f1117;
  --bg-card: #1a1d27;
  --border: #2a2d3a;
  --text: #e8eaf0;
  --text-muted: #7a7f9a;
  --accent: #4f8ef7;
  --font: system-ui, -apple-system, sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  min-height: 100dvh;
}

/* Navbar */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent);
  text-decoration: none;
}
.nav-links { display: flex; gap: 1rem; align-items: center; }
.nav-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9rem; }
.nav-links a:hover { color: var(--text); }
.nav-user { font-size: 0.85rem; color: var(--text-muted); }

/* Main */
.main { padding: 1.5rem 1.25rem; max-width: 960px; margin: 0 auto; }

/* Home */
.home h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }

/* Login */
.login-wrap { max-width: 360px; margin: 3rem auto; }
.login-wrap h1 { margin-bottom: 1.25rem; }
.login-wrap p { margin-bottom: 0.5rem; }
.login-wrap input {
  width: 100%; padding: 0.6rem 0.75rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 0.95rem;
  font-family: var(--font);
}
.login-wrap input:focus { outline: none; border-color: var(--accent); }
button[type="submit"] {
  margin-top: 1rem; width: 100%; padding: 0.65rem;
  background: var(--accent); color: #fff; border: none;
  border-radius: 6px; font-size: 1rem; cursor: pointer;
}
button[type="submit"]:hover { opacity: 0.9; }

/* Chat */
.chat-wrap {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 120px);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 1rem;
}
.bubble {
  max-width: 78%;
  padding: 8px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  white-space: pre-wrap;
}
.bubble-user {
  align-self: flex-end;
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.bubble-assistant {
  align-self: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-form {
  display: flex;
  gap: 8px;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.chat-form input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--font);
  outline: none;
}
.chat-form input:focus { border-color: var(--accent); }
.chat-form button {
  padding: 0 1.2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 0.9rem;
  cursor: pointer;
  width: auto;
  margin-top: 0;
}
.chat-form button:hover { opacity: 0.9; }
.chat-form button:disabled { opacity: 0.5; cursor: default; }
