/* Hypothesis Hit-Rate — operator-only calibration page.
   Hand-written dark theme, no CDN / no external fonts (CSP-safe). */

:root {
  --bg: #0a0e14;
  --bg-panel: #131a24;
  --bg-panel-2: #1a232f;
  --fg: #e6edf3;
  --muted: #8b98a8;
  --border: #232e3c;
  --accent: #4c9aff;
  --hit: #2ecc71;
  --miss: #e05c5c;
  --warn: #e0a458;
  --burn: #d64545;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Header ── */
.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  position: sticky;
  top: 0;
  z-index: 10;
}
.hdr h1 { font-size: 16px; font-weight: 600; margin: 0; letter-spacing: 0.2px; }
.hdr .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tag {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  vertical-align: middle;
  margin-left: 8px;
}
.hdr-right { display: flex; align-items: center; gap: 14px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); display: inline-block; }
.dot.live { background: var(--hit); }
.dot.err { background: var(--burn); }

/* ── Main ── */
main { flex: 1; padding: 26px 22px; max-width: 860px; width: 100%; margin: 0 auto; }

.hidden { display: none !important; }

/* ── Gate / empty / error cards ── */
.card-center {
  max-width: 460px;
  margin: 60px auto;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 28px;
  text-align: center;
}
.card-center h2 { font-size: 18px; margin: 0 0 10px; }
.card-center p { color: var(--muted); margin: 6px 0 18px; font-size: 14px; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: #051020;
  font-weight: 600;
  text-decoration: none;
  padding: 9px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}
.btn:hover { filter: brightness(1.08); }

/* ── Headline ── */
.headline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.metric {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
}
.metric .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.metric .value { font-size: 34px; font-weight: 700; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.metric .hint { color: var(--muted); font-size: 12px; }
.metric .ci { color: var(--accent); font-size: 13px; font-variant-numeric: tabular-nums; }

/* ── Calibration table ── */
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); margin: 8px 0 10px; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; min-width: 520px; }
thead th {
  text-align: right;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 600;
  padding: 11px 14px;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--border);
}
thead th:first-child, tbody td:first-child { text-align: left; }
tbody td { padding: 11px 14px; text-align: right; border-bottom: 1px solid var(--border); font-size: 14px; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.015); }
tbody td.na { color: var(--muted); }
tr.miscal td { background: rgba(224, 164, 88, 0.08); }
tr.miscal td:last-child { color: var(--warn); font-weight: 600; }

/* ── Footer meta ── */
.meta {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}
.meta b { color: var(--fg); font-weight: 600; }
.disclaimer {
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 560px) {
  main { padding: 20px 14px; }
  .metric .value { font-size: 28px; }
  .hdr { padding: 12px 14px; }
}
