:root {
  color-scheme: dark;
  --bg: #111318;
  --panel: #1a1d24;
  --border: #2a2e38;
  --text: #e8e9ec;
  --muted: #8a8f9c;
  --accent: #5b8def;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
}

#update-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: #e0a030;
  color: #1a1200;
  text-align: center;
  padding: 0.6rem;
  font-size: 0.9rem;
}

#update-banner button {
  background: #1a1200;
  color: white;
  margin-left: 0.5rem;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
}

#login-screen {
  margin: auto;
  text-align: center;
  padding: 2rem;
  max-width: 320px;
}

#login-screen h1, header h1 { font-size: 1.4rem; margin: 0; }

button {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  cursor: pointer;
}

button:disabled { opacity: 0.5; cursor: default; }

input, select {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 0.6rem;
  font-size: 1rem;
}

#verify-form { display: flex; gap: 0.5rem; margin-top: 1rem; }
#code-input { flex: 1; text-align: center; letter-spacing: 0.3em; }

#login-status { color: var(--muted); }

#chat-screen {
  width: 100%;
  display: flex;
  flex-direction: column;
  height: 100vh;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.controls { display: flex; gap: 0.5rem; align-items: center; }
.controls button, .controls select { padding: 0.4rem 0.6rem; font-size: 0.85rem; }
#mic-toggle.active, #speaker-toggle.active { background: #3ba55d; }

#messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.msg {
  max-width: 75%;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
}

.msg.user { align-self: flex-end; background: var(--accent); color: white; }
.msg.bot { align-self: flex-start; background: var(--panel); border: 1px solid var(--border); }
.msg.meta { align-self: center; color: var(--muted); font-size: 0.8rem; }

#chat-form {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border);
}

#chat-input { flex: 1; }

#voice-status {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  margin: 0 0 0.5rem;
  min-height: 1em;
}
