/* Shared by every dashboard page (index.html, criteria.html): palette and base. */
:root {
  color-scheme: dark;
  --page: #0b1120;
  --surface-1: #111827;
  --surface-2: #1a2333;
  --surface-3: #243045;
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-primary: #f1f5f9;
  --text-secondary: #b6c0cf;
  --text-muted: #7c8799;
  --grid: #1f2937;
  --accent: #3987e5;
  --accent-soft: rgba(57, 135, 229, 0.16);
  /* Evidence datatypes: categorical slots in fixed order, validated on --surface-1. */
  --dt-1: #3987e5;
  --dt-2: #d95926;
  --dt-3: #199e70;
  --dt-4: #c98500;
  --dt-5: #d55181;
  --dt-6: #008300;
  --dt-7: #9085e9;
  --dt-8: #e66767;
  /* Sequential (utility) ramp, blue: low -> high. */
  --seq-0: #184f95;
  --seq-1: #256abf;
  --seq-2: #3987e5;
  --seq-3: #6da7ec;
  --seq-4: #b7d3f6;
  /* TI2G (direction of target reduction): semantic, not categorical slots. */
  --ti2g-beneficial: #199e70;
  --ti2g-mixed: #c98500;
  --ti2g-harmful: #e66767;
  --ti2g-unknown: #7c8799;
  /* Criteria reference: gate outcomes, gates, LLM steps. Semantic, not categorical slots. */
  --pass: #2fbf8a;
  --fail: #ee7a66;
  --gate: #e0a52e;
  --gate-soft: rgba(201, 133, 0, 0.18);
  --llm: #a597f0;
  --llm-soft: rgba(144, 133, 233, 0.18);
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--page);
  color: var(--text-primary);
  font-size: 14px;
}

/* Page switcher in each page's header. */
nav.pages { display: flex; gap: 0.25rem; }
nav.pages a { color: var(--text-secondary); padding: 0.3rem 0.65rem; border-radius: 6px; font-size: 13px; text-decoration: none; }
nav.pages a:hover { background: var(--surface-2); }
nav.pages a[aria-current="page"] { background: var(--accent-soft); color: var(--text-primary); }

/* Components shared by the pages: utility badges, criteria profile rows, tooltip. */
.dots { display: flex; gap: 3px; }
.dot { width: 22px; height: 18px; border-radius: 4px; font-size: 9px; display: grid; place-items: center; color: #fff; font-weight: 600; }
.dot.none { background: transparent; border: 1px dashed var(--border-strong); color: var(--text-muted); }
.crit { display: grid; grid-template-columns: 2.6rem 1fr auto; gap: 0.5rem; align-items: center; padding: 0.4rem 0; border-bottom: 1px solid var(--grid); font-size: 13px; }
.crit code { color: var(--text-secondary); font-size: 12px; }
#tooltip {
  position: fixed; pointer-events: none; z-index: 30; background: var(--surface-3); border: 1px solid var(--border-strong);
  border-radius: 6px; padding: 0.4rem 0.6rem; font-size: 12px; color: var(--text-primary); max-width: 280px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4); display: none;
}
#tooltip .row { display: flex; justify-content: space-between; gap: 1rem; }
#tooltip .row span:first-child { color: var(--text-secondary); }
a.crit-id { color: var(--accent); font-weight: 600; text-decoration: none; }
a.crit-id:hover { text-decoration: underline; }
.crit.missing { opacity: 0.55; }
.crit .crit-name { color: var(--text-primary); }
.crit .why summary { cursor: pointer; color: var(--text-muted); font-size: 11px; }
.crit .why div { color: var(--text-secondary); font-size: 12px; line-height: 1.45; margin-top: 0.25rem; }
.profile-level + .profile-level { margin-top: 0.9rem; }
.profile-head { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); font-weight: 600; }
.profile-head .muted { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 0.3rem; }
.gates { display: inline-flex; gap: 0.25rem; margin-left: 0.4rem; vertical-align: 1px; }
.gate-chip { font-size: 10px; border-radius: 3px; padding: 0 0.3rem; border: 1px solid currentColor; }
.gate-chip.pass { color: var(--pass); }
.gate-chip.fail { color: var(--fail); }
