
:root {
  --fg: #1f2328;
  --muted: #57606a;
  --bg: #ffffff;
  --accent: #0a4d68;
  --accent-soft: #e6f2f6;
  --border: #d0d7de;
  --code-bg: #f6f8fa;
}
* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  margin: 0 auto;
  max-width: 920px;
  padding: 2.5rem 1.5rem 4rem;
  line-height: 1.6;
}
h1, h2, h3, h4 {
  color: var(--accent);
  line-height: 1.25;
  margin-top: 2.2rem;
  margin-bottom: 0.6rem;
}
h1 { font-size: 2rem; border-bottom: 2px solid var(--accent); padding-bottom: 0.4rem; }
h2 { font-size: 1.55rem; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.05rem; color: var(--fg); }
p { margin: 0.7rem 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { color: var(--fg); }
em { color: var(--muted); }
ul, ol { padding-left: 1.4rem; margin: 0.5rem 0 1rem; }
li { margin: 0.25rem 0; }
hr { border: 0; height: 1px; background: var(--border); margin: 2rem 0; }
blockquote {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  color: var(--fg);
  border-radius: 0 4px 4px 0;
}
blockquote p { margin: 0.3rem 0; }
code {
  font-family: "SF Mono", Menlo, Consolas, "Courier New", monospace;
  background: var(--code-bg);
  border-radius: 3px;
  padding: 0.1rem 0.3rem;
  font-size: 0.92em;
}
pre {
  background: var(--code-bg);
  border-radius: 6px;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  border: 1px solid var(--border);
}
pre code { background: none; padding: 0; font-size: 0.9em; }
table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.95em;
}
th, td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
}
th { background: var(--accent-soft); font-weight: 600; }
tr:nth-child(2n) td { background: #fafbfc; }

.footnote-ref { font-size: 0.8em; }
.footnotes { font-size: 0.92em; color: var(--muted); margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.footnotes ol { padding-left: 1.6rem; }

@media print {
  body { max-width: none; padding: 1rem; }
  a { color: var(--fg); text-decoration: none; }
  pre { white-space: pre-wrap; word-wrap: break-word; }
}

/* === Reference verification badges (injected by build/build.py) === */
.ref-badge {
  display: inline-block;
  margin-right: 0.4em;
  font-size: 0.9em;
  cursor: help;
}
.ref-badge.ref-verified  { color: #1a7f37; }
.ref-badge.ref-ambiguous { color: #b46500; }
.ref-badge.ref-bad       { color: #c0392b; }
.ref-badge.ref-manual    { color: #555;    }
.ref-badge.ref-deferred  { color: #888;    }

/* === Source row (top of every viva page) === */
.source-row {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 0.6rem 0.9rem;
  margin: 0.8rem 0 1.2rem;
  border-radius: 4px;
}
.source-row p { margin: 0.15rem 0; font-size: 0.95em; }
.source-row .source-pdf a { font-weight: 600; }

.depth-badge .depth-tier_1 {
  background: #1a7f37; color: white; padding: 0.1rem 0.55rem;
  border-radius: 12px; font-size: 0.85em;
}
.depth-badge .depth-summary {
  background: #6c7a89; color: white; padding: 0.1rem 0.55rem;
  border-radius: 12px; font-size: 0.85em;
}
.depth-badge .depth-progression {
  background: #1163a8; color: white; padding: 0.1rem 0.55rem;
  border-radius: 12px; font-size: 0.85em;
}

/* === Per-Q&A source attribution (Sources for this answer) === */
details.qa-sources {
  margin: 0.4rem 0 1rem 1.5rem;
  padding: 0.4rem 0.7rem;
  background: #f7f9fa;
  border-left: 3px solid #c5d4dd;
  border-radius: 3px;
  font-size: 0.92em;
}
details.qa-sources summary {
  cursor: pointer;
  color: var(--accent);
  font-weight: 600;
}
details.qa-sources ul { margin: 0.3rem 0 0 1rem; padding: 0; }
details.qa-sources.auto-derived summary::after {
  content: " — auto-derived";
  color: var(--muted);
  font-weight: normal;
}

/* === Embedded source data (PDF tables) === */
section#embedded-source-data,
.embedded-source-data {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  background: #fbfcfd;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.embedded-source-data .provenance {
  font-size: 0.85em; color: var(--muted); margin-top: 0.4rem;
}
