:root {
  --bg: #0f1720; --panel: #172230; --line: #26364a; --fg: #e6edf3; --muted: #8ba0b6;
  --accent: #4f9cf9; --accent-fg: #04203f;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg); color: var(--fg); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--fg);
  border-radius: 6px; padding: 6px 12px; }
button.small { padding: 3px 8px; font-size: 12px; }
button:hover { border-color: var(--accent); }
.link { background: none; border: none; color: var(--accent); padding: 0 6px; }
input, textarea, select { background: var(--bg); color: var(--fg); border: 1px solid var(--line);
  border-radius: 6px; padding: 8px; font: inherit; }

.topbar { display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  border-bottom: 1px solid var(--line); background: var(--panel); }
.spacer { flex: 1; }

.layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 49px); }
.sidebar { border-right: 1px solid var(--line); padding: 12px; }
.detail { padding: 20px; }
.row { display: flex; align-items: center; gap: 8px; }
.row h2 { flex: 1; margin: 0; font-size: 16px; }

.list { list-style: none; margin: 8px 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.proj { cursor: pointer; justify-content: space-between; }
.proj.active { color: var(--accent); }
.badge { font-size: 11px; border: 1px solid var(--line); border-radius: 10px; padding: 0 8px; color: var(--muted); }

.tabbar { display: flex; gap: 6px; margin: 12px 0; border-bottom: 1px solid var(--line); }
.tabbtn { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: none; }
.tabbtn.active { border-bottom-color: var(--accent); color: var(--accent); }
.tab { padding-top: 12px; }
.tab h3 { margin: 14px 0 4px; font-size: 13px; text-transform: uppercase; color: var(--muted); }

.chatlog { max-height: 55vh; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px; margin-bottom: 10px; background: var(--bg); }
.msg { padding: 8px 10px; border-radius: 8px; margin: 6px 0; white-space: pre-wrap; }
.msg.user { background: var(--panel); }
.msg.assistant { background: #10233c; }

.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(6, 12, 20, 0.9); z-index: 100; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 28px; width: 340px; }
.auth-card h1 { margin: 0 0 4px; }
.auth-card .sub { color: var(--muted); margin-top: 0; }
.auth-card input[type=email], .auth-card input[type=text] { width: 100%; margin: 6px 0; }
.auth-card button { width: 100%; background: var(--accent); color: var(--accent-fg); border: none; margin-top: 6px; }
.trust { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin: 6px 0; }
.auth-msg { min-height: 18px; font-size: 13px; color: var(--muted); }
.auth-msg.err { color: #ff8080; }
