:root {
  --bg: #12161c;
  --panel: #1b212b;
  --ink: #e8edf4;
  --muted: #9aa6b2;
  --line: #2a3340;
  --accent: #c4a35a;
  --review: #d4a017;
  --anomalous: #d4652f;
  --material: #c43c3c;
  --ok: #6aa84f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.45;
}
header, section, .toolbar { padding: 1rem 1.4rem; }
header {
  display: flex;
  gap: 2rem;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #0e1217;
}
h1 { margin: 0.15rem 0 0; font-size: 1.6rem; font-weight: 650; }
h2 { margin: 0 0 0.35rem; font-size: 1.1rem; }
.kicker { margin: 0; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; color: var(--accent); }
.disclaimer { max-width: 36rem; color: var(--muted); font-size: 0.9rem; }
.toolbar { display: flex; gap: 1rem; align-items: center; }
label { color: var(--muted); font-size: 0.85rem; }
select, button {
  background: var(--panel);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
}
button { cursor: pointer; }
.status { color: var(--muted); font-size: 0.85rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0.7rem; }
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.7rem 0.8rem;
}
.card .label { color: var(--muted); font-size: 0.75rem; }
.card .value { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; }
.table-wrap { overflow: auto; max-height: 22rem; border: 1px solid var(--line); border-radius: 6px; }
table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
th, td { padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--line); text-align: left; }
th { color: var(--muted); font-weight: 600; position: sticky; top: 0; background: var(--panel); }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.active { background: #243040; }
.hint { color: var(--muted); font-size: 0.78rem; margin-top: 0; }
.detail {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
}
.detail .block {
  margin: 0 0 0.8rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--line);
}
.detail .block:last-of-type {
  border-bottom: 0;
  margin-bottom: 0.4rem;
  padding-bottom: 0;
}
.detail .block h3 {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.detail .block p {
  margin: 0.22rem 0 0;
}
.raw-metrics {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.55rem 0 0.35rem;
}
.full-explanation {
  margin-top: 0.45rem;
}
.full-explanation summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.75rem;
}
.full-explanation p {
  margin-top: 0.4rem;
}
.sev-MATERIAL, .sev-CONFIRMED_DISCREPANCY { color: var(--material); font-weight: 700; }
.sev-ANOMALOUS, .sev-CORROBORATED { color: var(--anomalous); font-weight: 700; }
.sev-REVIEW { color: var(--review); font-weight: 600; }
.sev-OBSERVATIONAL, .sev-INSUFFICIENT_SAMPLE { color: var(--muted); }
.user-bar {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: flex-end;
  font-size: 0.85rem;
  color: var(--muted);
}
.user-bar a { color: var(--accent); }
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-card, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.2rem 1.3rem;
  max-width: 28rem;
}
.auth-card { width: min(28rem, 92vw); }
.auth-card label, .panel label, .inline-form label {
  display: block;
  margin: 0.7rem 0;
}
input[type="text"], input[type="email"], input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  background: #0e1217;
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.4rem 0.55rem;
  border-radius: 4px;
}
.auth-error { color: var(--material); font-size: 0.85rem; }
.break { word-break: break-all; }
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1rem;
}
.admin-grid .panel, #invite-panel { max-width: none; }
.inline-form { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; }
.inline-form label { margin: 0; }
@media (max-width: 980px) {
  header, .grid { display: block; }
}
