:root {
  --bg: #fafafa;
  --panel: #ffffff;
  --text: #1a1a1a;
  --muted: #5a5a5a;
  --faint: #9a9a9a;
  --accent: #4a3aff;
  --accent-soft: #ecebfb;
  --border: #e2e2e2;
  --ink: #1f1d3d;
  --good: #1e8449;
  --bad: #c0392b;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6; font-size: 17px;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

header.site-header {
  background: var(--ink); color: #fff;
  padding: 14px 24px; border-bottom: 1px solid #15132a;
}
header.site-header .nav-inner {
  max-width: 900px; margin: 0 auto;
  display: flex; gap: 18px; align-items: center; flex-wrap: wrap;
}
header.site-header .brand { font-weight: 600; font-size: 1.1rem; color: #fff; }
header.site-header nav { display: flex; flex-wrap: wrap; gap: 0 18px; align-items: center; }
header.site-header nav a { color: #fff; opacity: 0.85; font-size: 0.95rem; }
header.site-header nav a:hover { opacity: 1; }
header.site-header .menu { position: relative; }
header.site-header .menu-label {
  color: #fff; opacity: 0.85; font-size: 0.95rem; cursor: pointer; user-select: none;
}
header.site-header .menu-label::after { content: " \25BE"; font-size: 0.75em; opacity: 0.8; }
header.site-header .menu:hover .menu-label,
header.site-header .menu:focus-within .menu-label { opacity: 1; }
header.site-header .drop {
  display: none; position: absolute; top: 100%; left: 0; padding-top: 10px;
  z-index: 20;
}
header.site-header .drop-panel {
  background: var(--ink); border: 1px solid rgba(255,255,255,0.15); border-radius: 6px;
  padding: 6px 0; min-width: 150px; box-shadow: 0 8px 20px rgba(0,0,0,0.25);
}
header.site-header .menu:hover .drop,
header.site-header .menu:focus-within .drop { display: block; }
header.site-header .drop a { display: block; padding: 7px 16px; white-space: nowrap; font-size: 0.95rem; }
header.site-header .drop a:hover { background: rgba(255,255,255,0.08); }

main { max-width: 900px; margin: 32px auto; padding: 0 24px 60px; }
h1 { font-size: 2.1rem; margin: 0 0 4px; line-height: 1.2; }
.subtitle { color: var(--muted); font-size: 1.12rem; margin: 0 0 24px; }
h2 {
  font-size: 1.3rem; margin: 2.2em 0 0.6em;
  border-bottom: 1px solid var(--border); padding-bottom: 4px;
}
h3 { font-size: 1.05rem; margin: 1.6em 0 0.4em; color: var(--ink); }
p { margin: 0.8em 0; }
.lead { font-size: 1.07rem; }
ul { padding-left: 1.3em; }
li { margin-bottom: 8px; }
.muted { color: var(--muted); }
code {
  background: #f3f3f7; padding: 1px 5px;
  border-radius: 3px; font-size: 0.92em;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
}
blockquote {
  margin: 18px 0; padding: 10px 18px;
  border-left: 3px solid #ddd; color: var(--muted);
}
.equation-card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 8px; padding: 14px 18px; margin: 18px 0;
  text-align: center; overflow-x: auto;
}

/* scoreboard */
.scoreboard {
  display: flex; gap: 14px; flex-wrap: wrap;
  margin: 22px 0 28px;
}
.stat {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 20px; flex: 1; min-width: 150px;
}
.stat .n { font-size: 2rem; font-weight: 700; color: var(--ink); line-height: 1; }
.stat .n.zero { color: var(--bad); }
.stat .label { color: var(--muted); font-size: 0.85rem; margin-top: 4px; }

/* case cards (dismissal -> application) */
.case {
  background: var(--panel); border: 1px solid var(--border); border-radius: 10px;
  padding: 18px 22px; margin: 16px 0;
}
.case .field-tag {
  display: inline-block; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--muted); font-weight: 600;
  background: #f3f3f7; border-radius: 4px; padding: 2px 8px; margin-bottom: 8px;
}
.case h3 { margin-top: 0; }
.dismissal {
  border-left: 3px solid var(--bad); padding: 4px 14px; margin: 10px 0; color: var(--muted);
}
.dismissal .who { color: var(--text); font-weight: 600; }
.application {
  border-left: 3px solid var(--good); padding: 4px 14px; margin: 10px 0;
}
.gap-badge {
  display: inline-block; font-size: 0.82rem; color: #fff; background: var(--ink);
  border-radius: 12px; padding: 2px 11px; margin: 6px 0;
}
.verdict { font-style: italic; color: var(--ink); margin-top: 10px; }
.confidence { font-size: 0.78rem; color: var(--faint); }

/* table */
.table-wrap { overflow-x: auto; margin: 18px 0; }
table.impl { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.impl th, table.impl td {
  text-align: left; padding: 11px 14px;
  border-bottom: 1px solid var(--border); vertical-align: top;
}
table.impl thead th {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--muted); font-weight: 600; border-bottom: 2px solid var(--border);
}
table.impl tbody td:first-child { font-weight: 600; white-space: nowrap; }
table.impl tr:last-child td { border-bottom: none; }
table.impl .mode { color: var(--muted); font-size: 0.9rem; }

/* bibliography */
.bib h3 { font-size: 1.02rem; margin-top: 1.4em; color: var(--ink); }
.bib ul { list-style: none; padding-left: 0; }
.bib li { margin-bottom: 12px; padding-left: 1.2em; text-indent: -1.2em; }

.pagenav { margin: 0 0 22px; font-size: 0.95rem; }
.next-steps {
  background: var(--accent-soft); border-radius: 8px;
  padding: 4px 20px; margin: 24px 0;
}

footer {
  max-width: 900px; margin: 40px auto 24px; padding: 16px 24px;
  font-size: 0.85rem; color: var(--muted); border-top: 1px solid var(--border);
}
