:root {
  color-scheme: dark;
  --bg: #0a0a0a;
  --fg: #e4e4e7;
  --muted: #a1a1aa;
  --panel: #18181b;
  --border: #27272a;
  --accent: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
}
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  border-bottom: 1px solid var(--border);
}
header h1 { margin: 0; font-size: 1.5rem; font-weight: 600; }
.status { color: var(--muted); font-size: 0.875rem; display: flex; align-items: center; gap: 0.75rem; }
button {
  background: var(--panel);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 0.375rem;
  padding: 0.375rem 0.75rem;
  cursor: pointer;
  font: inherit;
}
button:hover { border-color: var(--muted); }
main { max-width: 64rem; margin: 0 auto; padding: 2rem; }
section { margin-bottom: 2.5rem; }
h2 { font-size: 1.125rem; font-weight: 600; margin: 0 0 0.75rem; }
code {
  background: var(--panel);
  padding: 0.1rem 0.35rem;
  border-radius: 0.25rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.hint { color: var(--muted); font-size: 0.875rem; margin-bottom: 1rem; }
.error { color: var(--danger); font-size: 0.875rem; }

#auth-gate { max-width: 28rem; }
#token-form { display: flex; gap: 0.5rem; }
#token-form input {
  flex: 1; background: var(--panel); color: var(--fg);
  border: 1px solid var(--border); border-radius: 0.375rem;
  padding: 0.5rem 0.75rem; font: inherit;
}
#token-form input:focus { border-color: var(--accent); outline: none; }

#stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin-bottom: 2.5rem;
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  display: flex; flex-direction: column;
}
.stat-label { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-val { font-size: 1.5rem; font-weight: 600; margin-top: 0.25rem; }

#plot-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 0.5rem; padding: 1rem; }
#plot-wrap svg { display: block; width: 100%; height: auto; }

.feed { list-style: none; padding: 0; margin: 0; border: 1px solid var(--border); border-radius: 0.5rem; overflow: hidden; }
.feed li {
  padding: 0.625rem 1rem;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 6rem 4rem 1fr 6rem;
  gap: 0.75rem;
  align-items: baseline;
  font-size: 0.875rem;
}
.feed li:last-child { border-bottom: none; }
.feed li.empty {
  display: block;
  color: var(--muted);
  text-align: center;
  padding: 1.5rem 1rem;
}
.outcome-held { color: var(--accent); font-weight: 600; }
.outcome-refuted { color: var(--danger); font-weight: 600; }
.outcome-indeterminate { color: var(--warn); font-weight: 600; }
.timestamp { color: var(--muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.75rem; }
.predicate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 640px) {
  #stats { grid-template-columns: repeat(2, 1fr); }
  .feed li { grid-template-columns: 4rem 1fr; }
  .feed li > .verifier, .feed li > .timestamp { display: none; }
}
