:root {
  color-scheme: dark;
  --bg: #12141a;
  --panel: #1c2028;
  --text: #e8eaed;
  --muted: #9aa3b2;
  --accent: #6ea8fe;
  --err: #ff8a8a;
  --side: 280px;
  font-family: system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
.hidden { display: none !important; }
.login-panel { max-width: 420px; margin: 48px auto; }
.panel { background: var(--panel); border-radius: 12px; padding: 16px; margin-bottom: 12px; }
.topbar, .account-bar { max-width: none; margin: 0 0 12px; padding: 12px 16px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.app-shell { padding: 12px 16px 32px; }
.muted { color: var(--muted); }
.error { color: var(--err); }
.grid { display: grid; gap: 10px; }
label { display: grid; gap: 4px; font-size: 14px; }
input, textarea { padding: 8px; border-radius: 8px; border: 1px solid #333; background: #0f1115; color: inherit; font: inherit; width: 100%; }
button { padding: 8px 12px; border: 0; border-radius: 8px; background: var(--accent); color: #111; cursor: pointer; }
button.secondary { background: #3a4150; color: var(--text); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.space { justify-content: space-between; align-items: flex-start; }
.check { display: flex; gap: 8px; align-items: center; }
.card { border: 1px solid #2a3140; border-radius: 10px; padding: 12px; margin: 8px 0; }
.card.disabled { opacity: 0.6; }
.pill { font-size: 12px; padding: 4px 8px; border-radius: 999px; background: #2a3140; white-space: nowrap; }
.toast { position: fixed; bottom: 16px; right: 16px; background: #2a3140; padding: 10px 14px; border-radius: 8px; z-index: 20; }
.log-line { font-size: 13px; color: var(--muted); white-space: pre-wrap; border-bottom: 1px solid #2a3140; padding: 8px 0; }
.workspace { display: grid; grid-template-columns: var(--side) 1fr; gap: 16px; align-items: start; }
.sidebar { background: var(--panel); border-radius: 12px; padding: 16px; position: sticky; top: 12px; }
.topic-item {
  display: block; width: 100%; text-align: left; margin: 6px 0;
  background: #15181f; color: var(--text); border: 1px solid #2a3140;
}
.topic-item.active { border-color: var(--accent); background: #243044; }
.topic-item-title { font-weight: 600; }
.topic-item-meta { font-size: 12px; color: var(--muted); }
@media (max-width: 800px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}
