:root {
  --bg: #111114;
  --panel: #1a1a20;
  --line: #2c2c34;
  --text: #ececf1;
  --muted: #8b8b98;
  --accent: #c9a46c;
  --danger: #d96a6a;
  --ok: #6fbf8a;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: "Segoe UI", "PingFang SC", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button {
  background: var(--accent);
  color: #16140f;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button.secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}
button:disabled { opacity: 0.45; cursor: default; }
label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
textarea, select, input[type="text"], input[type="password"] {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font: inherit;
}
textarea { min-height: 88px; resize: vertical; }
.err { color: var(--danger); font-size: 13px; min-height: 1.2em; }
.ok { color: var(--ok); font-size: 13px; min-height: 1.2em; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row > .field { flex: 1; }
[hidden] { display: none !important; }

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.brand {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}
.brand:hover { text-decoration: none; color: var(--accent); }
#nav {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
#nav a {
  color: var(--muted);
  font-size: 13px;
}
#nav a.on {
  color: var(--text);
  font-weight: 600;
}
#nav .who {
  color: var(--muted);
  font-size: 13px;
}
#nav .who b { color: var(--text); font-weight: 600; }

.page {
  width: min(820px, 100%);
  margin: 0 auto;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.page h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}
.page .lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

body.auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.card {
  width: min(420px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card h1 {
  margin: 0;
  font-size: 22px;
  font-weight: 600;
}
.card .lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card .actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}
.card .switch {
  font-size: 13px;
  color: var(--muted);
}

.meter {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.meter > span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ok);
}
.status { font-size: 13px; color: var(--muted); }
.status b { color: var(--text); font-weight: 600; }
.log {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 180px;
  max-height: 300px;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log .empty { color: var(--muted); font-size: 13px; }
.bubble { font-size: 14px; line-height: 1.45; }
.bubble .who { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.people { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--muted);
}
.pill.on { border-color: var(--ok); color: var(--ok); }
.pill.ai { border-color: var(--accent); color: var(--accent); }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
