:root {
  --ink: #18212b;
  --muted: #5d6873;
  --paper: #f7f8f8;
  --white: #fff;
  --navy: #173a5e;
  --blue: #246b91;
  --green: #217a54;
  --amber: #b36a00;
  --red: #a23b36;
  --line: #d7dde2;
  --focus: #ffd166;
  --sidebar: 278px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
  letter-spacing: 0;
}
button,
a {
  font: inherit;
}
a {
  color: #155f89;
}
.shell {
  display: grid;
  grid-template-columns: var(--sidebar) 1fr;
  min-height: 100vh;
}
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: #102a43;
  color: #fff;
  padding: 24px 18px;
  overflow: auto;
}
.brand {
  font-weight: 800;
  font-size: 24px;
}
.brand small {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #b9c9d8;
  margin-top: 4px;
}
.progress {
  height: 5px;
  background: #34536f;
  margin: 20px 0;
}
.progress span {
  display: block;
  height: 100%;
  background: #5fc18c;
  width: 12%;
}
.sidebar nav a {
  display: block;
  color: #dce7f0;
  text-decoration: none;
  padding: 9px 10px;
  border-left: 3px solid transparent;
  font-size: 14px;
}
.sidebar nav a:hover,
.sidebar nav a.active {
  background: #173d5f;
  border-color: #65c58f;
  color: #fff;
}
.main {
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 10px 28px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
}
.mode-switch {
  display: flex;
  border: 1px solid #aebbc6;
}
.language-switch {
  display: flex;
  border: 1px solid #aebbc6;
}
.language-switch button {
  min-width: 42px;
  border: 0;
  background: #fff;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 800;
}
.language-switch button.active {
  background: #176b5b;
  color: #fff;
}
.language-switch button:disabled {
  cursor: not-allowed;
  color: #71808b;
  background: #eef2f4;
}
.mode-switch button {
  border: 0;
  background: #fff;
  padding: 8px 12px;
  cursor: pointer;
}
.mode-switch button.active {
  background: var(--navy);
  color: #fff;
}
.classification {
  font-size: 12px;
  font-weight: 700;
  color: var(--red);
}
.mode-status {
  flex: 1;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.mode-status strong { color: var(--navy); }
.verification .mode-status {
  color: #185236;
  font-weight: 700;
}
.verification .mode-switch { border-color: var(--green); }
.verification .mode-switch button.active { background: var(--green); }
.verification .integrity { border-left: 4px solid var(--green); }
.verification .proof-stage { border-color: #5f9f77; }
.verification-guide {
  border: 1px solid #5f9f77;
  border-left: 5px solid var(--green);
  background: #edf8f0;
  padding: 16px;
  margin: 20px 0;
}
.verification-guide button {
  display: block;
  margin-top: 12px;
  background: var(--green);
  border: 0;
  color: #fff;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 700;
}
main {
  max-width: 1050px;
  margin: auto;
  background: var(--white);
  min-height: 100vh;
}
.chapter {
  padding: 58px 64px;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 64px;
}
.chapter h1 {
  font-size: 42px;
  line-height: 1.08;
  margin: 12px 0 20px;
  color: #102a43;
}
.chapter h2 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 18px;
  color: #173a5e;
}
.chapter h3 {
  font-size: 19px;
  margin: 28px 0 10px;
}
.eyebrow {
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
}
.lead {
  font-size: 20px;
  max-width: 780px;
}
.meta-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: 30px;
}
.meta-strip div {
  background: #fff;
  padding: 16px;
}
.meta-strip strong {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.conclusion-callout {
  border-left: 6px solid var(--green);
  background: #edf7f2;
  padding: 20px 24px;
  margin: 25px 0;
}
.warning {
  border-left: 5px solid var(--amber);
  background: #fff6e8;
  padding: 16px 20px;
}
.scope {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.scope > div {
  border-top: 4px solid var(--green);
  padding: 18px;
  background: #f4f8f6;
}
.scope .no {
  border-color: var(--red);
  background: #fbf3f2;
}
.finding-atlas {
  margin: 28px 0;
  border-top: 5px solid var(--navy);
  background: #f7fafb;
  padding: 22px;
}
.finding-atlas > p { max-width: 75ch; }
.finding-atlas-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.finding-atlas-card {
  appearance: none;
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid #b9cad4;
  border-left: 5px solid var(--blue);
  background: #fff;
  padding: 16px;
  color: var(--ink);
}
.finding-atlas-card:hover, .finding-atlas-card.active { background: #e9f2f5; border-color: var(--navy); }
.finding-atlas-card small, .finding-atlas-card strong, .finding-atlas-card span { display: block; }
.finding-atlas-card small { color: var(--muted); font-weight: 700; }
.finding-atlas-card strong { color: var(--navy); font-size: 18px; margin: 5px 0; }
.finding-atlas-card span { line-height: 1.45; }
.finding-atlas-response {
  min-height: 86px;
  margin-top: 14px;
  border-left: 5px solid var(--green);
  background: #edf7f2;
  padding: 14px 17px;
}
.finding-atlas-response h3 { margin: 0 0 5px; }
.finding-atlas-response p { margin: 0; }
.timeline {
  position: relative;
  margin: 28px 0;
}
.timeline:before {
  content: "";
  position: absolute;
  left: 18px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #9fb3c5;
}
.step {
  position: relative;
  padding: 0 0 25px 55px;
}
.step:before {
  content: "";
  position: absolute;
  left: 9px;
  top: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--blue);
  border: 4px solid #e5eef5;
}
.step strong {
  color: var(--navy);
}
.flow {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 24px 0;
}
.flow div {
  padding: 16px 10px;
  text-align: center;
  border: 1px solid var(--line);
  background: #f8fafb;
  font-weight: 700;
  font-size: 13px;
}
.flow div + div:before {
  content: "→";
  float: left;
  margin-left: -18px;
  color: var(--blue);
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 22px 0;
}
.metric {
  padding: 18px;
  border-top: 4px solid var(--blue);
  background: #f2f6f9;
}
.metric b {
  display: block;
  font-size: 32px;
  color: var(--navy);
}
.strength {
  display: flex;
  height: 26px;
  margin: 16px 0;
  border: 1px solid var(--line);
}
.strength .a {
  width: 42.857%;
  background: #23875f;
}
.strength .b {
  width: 57.143%;
  background: #d48a20;
}
.strength-labels {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}
.case-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.case {
  border: 1px solid var(--line);
  padding: 18px;
  background: #fff;
}
.case[data-level="A"] {
  border-left: 5px solid var(--green);
}
.case[data-level="B"] {
  border-left: 5px solid var(--amber);
}
.case h3 {
  margin: 0 0 8px;
}
.pill {
  display: inline-block;
  padding: 3px 7px;
  font-size: 11px;
  font-weight: 800;
  background: #e8eef3;
  color: #29475e;
}
.pill.a {
  background: #dcefe6;
  color: #12603c;
}
.pill.b {
  background: #fff0d3;
  color: #805000;
}
.case table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  margin-top: 10px;
}
.case td {
  padding: 5px;
  border-bottom: 1px solid #edf0f2;
}
.case td:first-child {
  color: var(--muted);
  width: 38%;
}
.proof-stage {
  border: 1px solid var(--line);
  margin: 28px 0;
}
.proof-tabs {
  display: flex;
  background: #eef3f6;
  border-bottom: 1px solid var(--line);
}
.proof-tabs button {
  border: 0;
  border-right: 1px solid var(--line);
  padding: 12px 14px;
  background: transparent;
  cursor: pointer;
}
.proof-tabs button.active {
  background: #fff;
  color: var(--navy);
  font-weight: 800;
}
.proof-panel {
  display: none;
  padding: 24px;
}
.proof-panel.active {
  display: block;
}
.proof-panel img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: #f1f3f4;
}
.six {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.six article {
  border-top: 4px solid var(--blue);
  background: #f5f7f9;
  padding: 16px;
}
.six h3 {
  margin: 0 0 7px;
  font-size: 15px;
}
.request-list li {
  margin-bottom: 10px;
}
.sources details {
  border: 1px solid var(--line);
  margin: 10px 0;
  background: #fff;
}
.sources summary {
  cursor: pointer;
  padding: 14px;
  font-weight: 700;
}
.sources .inside {
  padding: 0 16px 16px;
}
.verify-only {
  display: none;
}
.verification .verify-only {
  display: block;
}
.verification .reading-only {
  display: none;
}
.chapter-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 34px;
}
.chapter-nav button {
  border: 1px solid #8ba0b2;
  background: #fff;
  padding: 10px 15px;
  cursor: pointer;
}
.chapter-nav .next {
  background: var(--navy);
  color: #fff;
}
.integrity {
  font-family: Consolas, monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
  background: #f1f3f4;
  padding: 12px;
}
.footer {
  padding: 35px 64px;
  background: #102a43;
  color: #dce7f0;
}
.print-note {
  font-size: 12px;
  color: var(--muted);
}
.lab-station {
  margin: 30px 0;
  padding: 24px;
  border: 2px solid #8faabd;
  background: #fbfcfd;
}
.station-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}
.station-head h3 { margin: 6px 0; }
.station-number {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--blue);
}
.station-meter {
  flex: 0 0 120px;
  text-align: center;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
}
.station-meter span {
  display: block;
  font-size: 24px;
  font-weight: 800;
  color: var(--navy);
}
.station-meter small { color: var(--muted); }
.prediction {
  margin: 20px 0;
  border: 1px solid var(--line);
  background: #fff;
  padding: 16px;
}
.prediction legend { font-weight: 700; padding: 0 6px; }
.prediction label { display: block; padding: 5px 0; }
.layer-controls, .case-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.layer-controls button, .case-selector button, .reveal-limit {
  border: 1px solid #8198aa;
  background: #fff;
  padding: 10px 13px;
  cursor: pointer;
}
.layer-controls button.active, .case-selector button.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
.evidence-chain {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 14px 0;
}
.evidence-chain div {
  min-height: 88px;
  border: 2px dashed #b8c4cd;
  background: #f3f5f6;
  padding: 13px;
  opacity: .48;
}
.evidence-chain div.active {
  border-style: solid;
  border-color: var(--green);
  background: #eef8f3;
  opacity: 1;
}
.evidence-chain strong, .evidence-chain span { display: block; }
.evidence-chain span { font-size: 12px; color: var(--muted); margin-top: 5px; }
.station-prompt { font-weight: 700; margin: 20px 0 8px; }
.case-selector button[data-grade="A"].active { background: var(--green); border-color: var(--green); }
.case-selector button[data-grade="B"].active { background: var(--amber); border-color: var(--amber); }
.reaction {
  margin: 18px 0;
  padding: 16px 18px;
  border-left: 5px solid var(--blue);
  background: #eef4f7;
}
.reaction p { margin: 5px 0 0; }
.reveal-limit:disabled { cursor: not-allowed; opacity: .45; }
.reveal-limit:not(:disabled) { background: var(--navy); color: #fff; }
.limit-reveal { margin-top: 16px; }
.prediction-feedback {
  font-weight: 700;
  border-left: 4px solid var(--amber);
  padding: 10px 14px;
  background: #fff7e9;
}
.discovery-toggle { margin: 22px 0; }
.discovery-toggle button {
  border: 1px solid #8198aa;
  background: #fff;
  color: var(--navy);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}
.discovery-panel {
  border-left: 5px solid var(--blue);
  background: #eef4f7;
  margin-top: 10px;
  padding: 18px 20px;
}
.discovery-panel h3 { margin-top: 0; color: var(--navy); }
.discovery-panel li { margin: 9px 0; }
.census-station {
  margin: 28px 0;
  padding: 24px;
  border: 2px solid #8faabd;
  background: #fbfcfd;
}
.census-context { margin: 26px 0; padding: 22px 24px; border-left: 6px solid var(--amber); background: #fff9ed; }
.census-context h3 { margin: 8px 0 12px; color: var(--navy); }
.census-context p { max-width: 900px; }
.finding-context { margin: 24px 0; padding: 22px 24px; border-left: 6px solid var(--blue); background: #edf5f8; }
.finding-context h3 { margin: 8px 0 12px; color: var(--navy); }
.hni-entry { margin: 18px 0; padding: 14px 16px; border-left: 4px solid #ba7b13; background: #fff8e6; color: #34250b; }
.hni-entry strong { display: block; margin-bottom: 5px; }
.hni-entry a { display: inline-block; margin-top: 7px; font-weight: 700; color: var(--navy); }
.finding-context p { max-width: 900px; }
.document-entry { margin-top: 1.5rem; }
.button-link { display: inline-flex; align-items: center; min-height: 2.6rem; margin-top: .4rem; padding: .55rem .9rem; color: #fff; background: #0b4f6c; border: 1px solid #0b4f6c; border-radius: 4px; font-weight: 700; text-decoration: none; }
.button-link:hover, .button-link:focus-visible { color: #0b4f6c; background: #fff; }
.census-route { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; list-style: none; margin: 18px 0 0; padding: 0; counter-reset: none; }
.census-route li { padding: 12px; background: #fff; border-top: 3px solid var(--amber); font-size: 14px; line-height: 1.35; }
.census-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 20px 0;
}
.census-controls button,
.counting-choice button {
  cursor: pointer;
  background: #fff;
  border: 1px solid #8198aa;
  color: var(--ink);
  padding: 13px;
}
.census-controls button { text-align: left; min-height: 90px; }
.census-controls button strong { display: block; font-size: 28px; color: var(--navy); }
.census-controls button span { display: block; font-size: 13px; line-height: 1.25; }
.census-controls button.active { background: #e7f1f6; border: 2px solid var(--blue); }
  .counting-choice { display: flex; gap: 8px; margin: 14px 0; }
  .counting-choice button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
  .version-stage { margin: 18px 0; min-height: 220px; border: 1px solid #b7c8d3; background: #fff; }
  .e13-stage { margin: 18px 0; min-height: 320px; border: 1px solid #b7c8d3; background: #fff; display: grid; place-items: center; }
  .e13-stage figure { margin: 0; padding: 18px; text-align: center; }
  .e13-stage img { display: block; max-width: 100%; max-height: 620px; margin: 0 auto; border: 1px solid #b7c8d3; }
  .e13-stage figcaption { margin-top: 10px; font-weight: 700; color: var(--navy); }
  .mms-stage { margin: 18px 0; min-height: 240px; border: 1px solid #b7c8d3; background: #fff; padding: 18px; }
  .mms-family-stage { margin: 18px 0; min-height: 260px; border: 1px solid #b7c8d3; background: #fff; padding: 18px; }
  .family-diagram { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; align-items:stretch; margin:12px 0; }
  .family-diagram article { padding:16px; border:1px solid #cbd7de; background:#f7fafb; }
  .family-diagram article.active { border-color:#16755f; background:#edf8f3; box-shadow:inset 0 0 0 2px #bce1d1; }
  .family-diagram .shared { grid-column:1 / -1; border-left:6px solid #1f698a; background:#eef4f7; }
  .family-diagram strong, .family-diagram span { display:block; }
  .family-diagram strong { font-size:1.55rem; color:var(--navy); margin:6px 0; }
  .family-bars { display:grid; gap:10px; margin-top:14px; }
  .family-bar-row { display:grid; grid-template-columns:minmax(120px,180px) 1fr 70px; align-items:center; gap:10px; }
  .family-bar { height:26px; background:#d9e5eb; overflow:hidden; }
  .family-bar > span { display:block; height:100%; background:#1f698a; transition:width .28s ease; }
  .family-bar-row strong { font-size:.9rem; color:#243c4c; }
  @media (max-width:720px) { .family-diagram { grid-template-columns:1fr; } .family-diagram .shared { grid-column:auto; } .family-bar-row { grid-template-columns:1fr; gap:4px; } }
  .mms-card { max-width: 960px; margin: 0 auto; }
  .mms-values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
  .mms-values > div { border: 1px solid #cbd7de; padding: 13px; background: #f7fafb; }
  .mms-values span { display: block; color: #405463; font-size: .86rem; font-weight: 700; }
  .mms-values strong { display: block; margin-top: 5px; color: var(--navy); font-size: 1.45rem; }
  .mms-values mark, .mms-result mark { background: #fff0bb; color: #7c4c00; padding: 0 3px; }
  .mms-result { margin-top: 14px; border-left: 4px solid #16755f; background: #edf8f3; padding: 14px; }
  .number-operation { margin: 18px 0; padding: 16px; border: 1px solid #b7c8d3; background: #fbfdfe; }
  .number-operation h4 { margin: 0 0 10px; color: var(--navy); }
  .digit-line { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; margin: 12px 0; font-size: 1.55rem; font-weight: 800; color: var(--navy); }
  .digit-chip { min-width: 36px; text-align: center; padding: 6px 9px; border: 1px solid #9fb3c0; background: #fff; border-radius: 4px; }
  .digit-chip.changed { background: #fff0bb; border-color: #c78400; color: #7c4c00; box-shadow: inset 0 -3px 0 #e3a321; }
  .digit-chip.removed { opacity: .35; text-decoration: line-through; }
  .number-arrow { font-size: 1.4rem; color: var(--blue); margin: 0 4px; }
  .numeric-example-grid { display: grid; grid-template-columns: repeat(5, minmax(130px, 1fr)); gap: 10px; margin: 16px 0; }
  .numeric-example-grid button { min-height: 104px; text-align: left; cursor: pointer; background: #fff; border: 1px solid #9fb3c0; color: var(--ink); padding: 12px; border-radius: 4px; }
  .numeric-example-grid button:hover, .numeric-example-grid button.active { border: 2px solid var(--blue); background: #eaf4f8; }
  .numeric-example-grid strong, .numeric-example-grid span { display: block; }
  .numeric-example-grid span { margin-top: 6px; font-size: .86rem; }
  @media (max-width: 820px) { .numeric-example-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (max-width: 720px) { .mms-values { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .version-placeholder { padding: 32px; color: var(--muted); }
  .version-view { display: grid; grid-template-columns: minmax(250px, .8fr) minmax(340px, 1.2fr); min-height: 480px; }
  .version-meta { padding: 20px; background: #f2f6f8; border-right: 1px solid #b7c8d3; }
  .version-meta dl { margin: 16px 0; }
  .version-meta dl div { padding: 10px 0; border-bottom: 1px solid #d7e0e5; }
  .version-meta dt { font-size: 12px; font-weight: 800; text-transform: uppercase; color: var(--muted); }
  .version-meta dd { margin: 4px 0 0; font-size: 14px; line-height: 1.45; }
  .hash-value, .version-comparison code { font-size: 11px; overflow-wrap: anywhere; color: #143e59; }
  .source-link { display: inline-block; margin-top: 8px; font-weight: 800; }
  .pdf-preview { width: 100%; min-height: 480px; border: 0; background: #e9eef1; }
  .version-comparison { padding: 20px; }
  .comparison-callout, .comparison-result { padding: 14px 16px; background: #fff4dc; border-left: 5px solid var(--amber); line-height: 1.45; }
  .continuity-proof { display: grid; grid-template-columns: minmax(150px, .42fr) 1fr; gap: 20px; align-items: stretch; padding: 18px; border: 1px solid #b7c8d3; background: #fff; }
  .continuity-proof h4 { margin: 0 0 8px; color: var(--ink); font-size: 1.08rem; }
  .continuity-proof p { margin: 0 0 14px; line-height: 1.55; }
  .continuity-metric { display: flex; flex-direction: column; justify-content: center; min-height: 132px; padding: 18px; background: #e9f2f5; border-left: 6px solid var(--teal); }
  .continuity-metric strong { font-size: 2.1rem; color: var(--ink); }
  .continuity-metric span { margin-top: 7px; line-height: 1.35; }
  .related-compare { display: grid; grid-template-columns: minmax(0, 1fr) 38px minmax(0, 1fr); gap: 10px; align-items: stretch; margin-top: 12px; }
  .related-compare > div { display: flex; flex-direction: column; justify-content: center; padding: 13px; background: #f3f7f8; border: 1px solid #c9d5da; }
  .related-compare > div:nth-child(2) { align-items: center; padding: 0; border: 0; background: transparent; color: var(--teal); font-size: 1.55rem; }
  .related-compare span { color: #48616d; font-size: .82rem; font-weight: 700; text-transform: uppercase; }
  .related-compare strong { margin-top: 7px; line-height: 1.4; }
  @media (max-width: 680px) { .continuity-proof { grid-template-columns: 1fr; } .related-compare { grid-template-columns: 1fr; } .related-compare > div:nth-child(2) { min-height: 30px; transform: rotate(90deg); } }
  .comparison-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 16px 0; }
  .comparison-grid article { padding: 16px; border: 1px solid #b7c8d3; background: #f8fafb; }
  .comparison-grid h4 { margin: 0 0 10px; color: var(--navy); }
  .version-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
  .version-summary div { padding: 14px; border-top: 4px solid var(--blue); background: #eef4f7; }
  .version-summary strong, .version-summary span { display: block; }
.version-summary strong { font-size: 28px; color: var(--navy); }
.page-delta { display: grid; grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr); gap: 16px; align-items: center; margin: 18px 0; }
.page-delta article { padding: 16px; border: 1px solid #b7c8d3; background: #f8fafb; }
.page-delta h4 { margin: 0 0 10px; color: var(--navy); }
.page-stack { display: grid; gap: 7px; margin: 12px 0; }
.page-stack span { display: block; padding: 10px 12px; border: 1px solid #91a8b8; background: #fff; color: #29475e; font-weight: 700; }
.page-stack .missing-page { border-style: dashed; background: #fff4e5; color: #8a4a08; }
.delta-arrow { display: grid; gap: 6px; place-items: center; color: var(--blue); font-size: 38px; font-weight: 700; }
.delta-arrow small { color: #466276; font-size: 12px; text-align: center; font-weight: 700; }
.universe-bar { display: flex; min-height: 118px; margin: 18px 0 8px; overflow: hidden; border: 1px solid #9db5c7; background: #f7fbfd; }
.universe-bar > div { display: grid; place-content: center; padding: 14px; text-align: center; transition: filter .25s ease, opacity .25s ease, transform .25s ease; }
.universe-bar strong, .universe-bar span { display: block; }
.universe-bar strong { color: var(--navy); font-size: 29px; }
.universe-bar span { margin-top: 4px; color: #29475e; font-size: 13px; }
.base-segment { flex: 684; background: #d7eaf2; }
.days-segment { flex: 303; background: #f9d99b; }
.days-segment.muted { opacity: .42; filter: grayscale(1); }
.universe-bar.split .days-segment { box-shadow: inset 5px 0 0 #c17a22; }
.equation-strip { display: flex; justify-content: center; align-items: baseline; gap: 10px; padding: 12px; color: #29475e; font-size: 18px; }
.equation-strip strong { color: var(--navy); font-size: 26px; }
.visual-caption { margin: 8px 0 0; color: #466276; font-size: 14px; }
.scale-callout { margin: 18px 0; padding: 18px; border: 1px solid #7aa080; border-left: 6px solid #185236; background: #f1faf3; line-height: 1.5; }
.scale-callout.census-impact { border-color: #b04b32; border-left-color: #a12818; background: #fff3ee; color: #4d2018; }
.scale-callout.census-impact::before { content: "ALERTA DE RECONSTRUCCIÓN DEL CÁLCULO"; display: block; margin-bottom: 7px; color: #a12818; font-size: .78rem; font-weight: 800; letter-spacing: .055em; }
.glossary-index-list { display: grid; gap: 9px; max-height: min(58vh, 610px); overflow: auto; padding-right: 4px; }
.glossary-index-item { display: grid; gap: 4px; width: 100%; padding: 12px 14px; border: 1px solid #c7d6df; border-left: 4px solid var(--blue); background: #f8fbfc; color: var(--ink); text-align: left; cursor: pointer; font: inherit; }
.glossary-index-item:hover, .glossary-index-item:focus-visible { border-color: var(--blue); background: #eaf4f8; outline: none; }
.glossary-index-item strong { color: var(--navy); }
.glossary-index-item span { font-size: .91rem; line-height: 1.38; }
.glossary-figure { margin: 18px 0; padding: 10px; border: 1px solid #cad6dc; background: #fff; }
.glossary-figure img { display: block; width: 100%; max-height: 48vh; object-fit: contain; }
.glossary-figure figcaption { margin-top: 8px; color: #516a79; font-size: .82rem; line-height: 1.35; }
.scope-choice { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 14px 0 20px; padding: 12px; background: #edf4f7; border-left: 4px solid var(--blue); }
.scope-choice span { font-weight: 700; color: var(--navy); }
.scope-choice button { cursor: pointer; border: 1px solid #8198aa; background: #fff; color: var(--ink); padding: 8px 11px; }
.scope-choice button.active { background: #174a70; color: #fff; border-color: #174a70; }
.census-visual { position: relative; min-height: 320px; margin: 24px 0 18px; }
.census-band {
  position: absolute;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--navy);
  border: 2px solid var(--blue);
  opacity: .22;
  transition: opacity .2s ease, box-shadow .2s ease;
}
.census-band.active { opacity: 1; box-shadow: inset 0 0 0 2px rgba(255,255,255,.65); }
.census-band strong { font-size: 28px; }
.census-band span { max-width: 180px; font-size: 13px; line-height: 1.25; }
.band-90 { inset: 0; padding: 22px; background: #d9ecf4; }
.band-95 { inset: 48px 10% 48px 10%; padding: 18px; background: #c7dff0; }
.band-100 { inset: 96px 21% 96px 21%; padding: 15px; background: #a8cce2; }
.census-reaction { border-left: 5px solid var(--amber); padding: 14px 16px; background: #fff7e9; font-weight: 700; }
.census-breakdown { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.census-breakdown div { background: #f2f5f7; border-top: 4px solid var(--blue); padding: 13px; }
.census-breakdown strong, .census-breakdown span { display: block; }
.census-breakdown span { font-size: 13px; }
.census-exclusion { margin-top: 16px; padding: 16px 18px; border: 1px solid #c17a22; background: #fff8e7; color: #4a3515; }
.census-exclusion p { margin: 7px 0 0; }
.census-conclusion { margin-top: 18px; padding: 20px; border: 1px solid #7aa080; background: #f1faf3; }
.census-conclusion h3 { color: #185236; margin: 0 0 8px; }
.universe-lab { margin-top: 28px; }
.universe-figures,
.universe-targets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.universe-figures button,
.universe-targets button { min-height: 74px; border: 1px solid #9fb0bd; background: #fff; color: #17324a; padding: 12px; cursor: pointer; }
.universe-figures button strong { display: block; font-size: 1.4rem; }
.universe-figures button span { display: block; margin-top: 4px; }
.universe-figures button.active { border-color: #0b6f78; box-shadow: inset 0 0 0 2px #0b6f78; background: #edf9f8; }
.universe-ledger { display: grid; gap: 8px; margin: 16px 0; }
.universe-ledger > div { display: grid; grid-template-columns: 130px 1fr; gap: 12px; padding: 12px; border-left: 5px solid #9aa6af; background: #f5f7f8; }
.universe-ledger > div.verified { border-left-color: #27834a; background: #eff9f1; }
.universe-ledger > div.needs-review { border-left-color: #c33b2f; background: #fff2f0; }
@media (max-width: 720px) {
  .universe-figures,
  .universe-targets { grid-template-columns: 1fr; }
  .universe-ledger > div { grid-template-columns: 1fr; }
}
.round-stage { margin: 22px 0 12px; min-height: 220px; padding: 24px; border: 1px solid #9db5c7; background: #f7fbfd; }
.round-place { margin: 0 0 18px; color: #29475e; font-weight: 700; }
.round-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.round-values div { padding: 16px; border: 1px solid #b7c8d3; background: #fff; }
.round-values span { display: block; color: #466276; font-size: 13px; }
.round-values strong { display: block; margin-top: 6px; color: #102f4a; font-size: 26px; }
.round-values .positive strong { color: #185236; }
.blocks-stage { margin: 22px 0 12px; min-height: 300px; padding: 24px; border: 1px solid #9db5c7; background: #f7fbfd; }
.decile-chart { display: grid; grid-template-columns: repeat(10, minmax(42px, 1fr)); gap: 8px; align-items: end; min-height: 235px; }
.decile-column { display: grid; grid-template-rows: 38px 160px 24px; gap: 5px; text-align: center; }
.decile-value { align-self: end; color: #29475e; font-size: 12px; }
.decile-track { position: relative; height: 160px; border-bottom: 1px solid #718b9e; background: repeating-linear-gradient(to top, transparent 0, transparent 39px, #dbe6ed 40px); }
.decile-bar { position: absolute; right: 12%; bottom: 0; left: 12%; background: #2a718f; transition: height 280ms ease; }
.decile-label { color: #466276; font-weight: 700; }
.blocks-delta { display: flex; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid #b7c8d3; }
.blocks-delta span { color: #466276; }
.blocks-delta strong { color: #102f4a; }
.permutation-axis { padding: 48px 10px 10px; }
.axis-line { position: relative; height: 8px; margin: 70px 8% 80px; background: #9db5c7; }
.axis-zero, .axis-null, .axis-observed { position: absolute; transform: translateX(-50%); text-align: center; color: #29475e; }
.axis-zero { top: 18px; left: 50%; }
.axis-null { bottom: 20px; }
.axis-observed { bottom: 20px; color: #185236; }
.axis-null:after, .axis-observed:after { content: ""; position: absolute; top: 44px; left: 50%; width: 14px; height: 14px; transform: translate(-50%, -50%); border-radius: 50%; background: currentColor; }
  @media (max-width: 850px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    height: auto;
  }
  .sidebar nav {
    display: none;
  }
  .topbar {
    top: 0;
    padding: 9px 12px;
  }
  .mode-status { display: none; }
  .chapter {
    padding: 38px 22px;
  }
  .chapter h1 {
    font-size: 34px;
  }
  .scope,
  .finding-atlas-grid,
  .case-grid,
  .six,
  .evidence-chain {
    grid-template-columns: 1fr;
  }
  .census-controls,
  .census-breakdown,
  .census-route,
  .round-values { grid-template-columns: 1fr; }
  .decile-chart { grid-template-columns: repeat(5, minmax(44px, 1fr)); row-gap: 18px; }
  .blocks-delta { display: grid; }
  .scope-choice { align-items: stretch; }
  .census-visual { min-height: 390px; }
  .band-95 { inset: 55px 7% 55px 7%; }
  .band-100 { inset: 115px 14% 115px 14%; }
    .station-head { display: block; }
    .version-view, .comparison-grid, .version-summary { grid-template-columns: 1fr; }
    .page-delta { grid-template-columns: 1fr; }
    .delta-arrow { transform: rotate(90deg); min-height: 52px; }
    .version-meta { border-right: 0; border-bottom: 1px solid #b7c8d3; }
    .pdf-preview { min-height: 380px; }
  .station-meter { margin-top: 12px; }
  .flow {
    grid-template-columns: 1fr;
  }
  .flow div + div:before {
    content: "↓";
    float: none;
    margin: 0;
    display: block;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .meta-strip {
    grid-template-columns: 1fr;
  }
}
@media print {
  .sidebar,
  .topbar,
  .chapter-nav {
    display: none;
  }
  .shell {
    display: block;
  }
  main {
    max-width: none;
  }
  .chapter {
    break-inside: avoid;
    padding: 30px;
  }
  .verify-only {
    display: block;
  }
  .proof-panel {
    display: block;
  }
  .footer {
    background: #fff;
    color: #111;
  }
}
.attribution-card {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  border-left: 4px solid #176b5b;
  background: #f2f8f6;
}
.attribution-card p { margin: .35rem 0 0; }
.handle { font-weight: 800; color: #114d66; }
.tunja-stage { min-height: 220px; padding: 1.1rem; border: 1px solid #cdd8df; background: #fbfcfd; }
.tunja-stage h4 { margin-top: 0; font-size: 1.1rem; }
.tunja-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; margin: 1rem 0; }
.tunja-metrics div { min-height: 88px; padding: .8rem; border-top: 4px solid #176b5b; background: #fff; box-shadow: 0 2px 8px rgba(20, 45, 60, .08); }
.tunja-metrics strong { display: block; font-size: 1.55rem; }
.tunja-metrics span { display: block; margin-top: .25rem; color: #4b5d68; }
@media (max-width: 760px) { .tunja-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.territorial-controls { padding: 1rem; background: #f4f7f8; border: 1px solid #cad6dc; }
.territorial-controls label { display: block; margin-bottom: .65rem; }
.territorial-controls input[type="range"] { width: 100%; accent-color: #176b5b; }
.territorial-stage { min-height: 210px; padding: 1.1rem; border: 1px solid #cad6dc; background: #fbfcfd; }
.territorial-line { position: relative; height: 10px; margin: 1rem 0 1.4rem; border-radius: 2px; background: #dbe3e7; overflow: hidden; }
.territorial-line span { display: block; width: var(--progress); height: 100%; background: #176b5b; transition: width .18s ease; }
.territorial-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .7rem; }
.territorial-metrics div { min-height: 96px; padding: .8rem; border-top: 4px solid #176b5b; background: #fff; box-shadow: 0 2px 8px rgba(20,45,60,.08); }
.territorial-metrics strong { display: block; font-size: 1.35rem; overflow-wrap: anywhere; }
.territorial-metrics span { display: block; margin-top: .3rem; color: #4b5d68; }
@media (max-width: 760px) { .territorial-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.prologue-panel { margin: 1.4rem 0; padding: 1.35rem; border: 1px solid #b7ced4; border-left: 6px solid #176b5b; background: #f5faf8; }
.prologue-panel h2 { margin-top: .2rem; }
.prologue-panel p { max-width: 78ch; }
.prologue-close { font-weight: 700; color: #114d66; }
.legal-foundation { margin: 1.2rem 0; padding: 1.1rem; background: #f6f8fb; border: 1px solid #cad6dc; }
.legal-foundation h3 { margin-top: 0; }
.glossary-trigger { border: 1px solid #63808c; background: #fff; color: #143b4a; padding: .45rem .7rem; font: inherit; font-weight: 700; cursor: pointer; }
.principal-trigger { display: inline-flex; align-items: center; border: 1px solid #aebbc6; background: #fff; color: var(--navy); padding: .45rem .7rem; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.principal-trigger:hover, .principal-trigger:focus-visible { background: #edf3f7; color: var(--navy); }
.manual-return { display: flex; flex-wrap: wrap; gap: .55rem; margin: 0 0 1.2rem; }
.flow-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .65rem; margin: 1.4rem 0; padding: 1rem; border: 1px solid #b9ccd4; background: #f5f9fa; }
.flow-row span { min-width: 105px; padding: .7rem .8rem; border-top: 4px solid #176b5b; background: #fff; text-align: center; font-weight: 800; }
.flow-row strong { color: #176b5b; font-size: 1.25rem; }
.dual-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 1.2rem 0; }
.dual-panel article { padding: 1rem 1.1rem; border: 1px solid #bfd0d7; border-top: 5px solid #176b5b; background: #f8fbfb; }
.book dl { display: grid; grid-template-columns: minmax(150px, .3fr) 1fr; margin: 1.2rem 0; border-top: 1px solid #c8d5da; }
.book dt, .book dd { margin: 0; padding: .75rem .85rem; border-bottom: 1px solid #c8d5da; }
.book dt { color: #123e4d; background: #eef4f6; font-weight: 850; }
.book dd { background: #fff; }
.book table { max-width: 100%; }
@media (max-width: 700px) {
  .dual-panel { grid-template-columns: 1fr; }
  .book dl { grid-template-columns: 1fr; }
  .book dt { border-bottom: 0; }
  .flow-row { align-items: stretch; flex-direction: column; }
  .flow-row strong { transform: rotate(90deg); text-align: center; }
  .book table { display: block; overflow-x: auto; }
}
.chapter-evidence-links { display: flex; flex-wrap: wrap; gap: .55rem; margin: .8rem 0 1.15rem; }
.chapter-evidence-links button { border: 1px solid #8aa3b1; background: #fff; color: #143b4a; padding: .4rem .65rem; cursor: pointer; font-weight: 700; }
.chapter-evidence-links button:hover { background: #edf3f7; }
.term-help { color: #075f78; font-weight: 700; text-decoration: underline dotted 2px; text-underline-offset: 3px; cursor: help; background: transparent; border: 0; padding: 0; font: inherit; }
.term-help:focus, .glossary-trigger:focus { outline: 3px solid #f0b429; outline-offset: 2px; }
.fite-glossary-dialog { width: min(680px, calc(100vw - 2rem)); border: 0; padding: 0; box-shadow: 0 16px 50px rgba(16, 44, 58, .3); }
.fite-glossary-dialog::backdrop { background: rgba(15, 36, 47, .56); }
.glossary-card { padding: 1.35rem; border-top: 6px solid #176b5b; }
.glossary-card h2 { margin: 0 2.5rem .65rem 0; color: #113b4b; }
.glossary-card p { max-width: 64ch; line-height: 1.55; }
.glossary-example { padding: .8rem; background: #f1f7f5; border-left: 4px solid #176b5b; }
.glossary-close { position: absolute; top: .75rem; right: .75rem; width: 36px; height: 36px; border: 1px solid #78909a; background: #fff; color: #143b4a; font-size: 1.2rem; cursor: pointer; }
.compact-context { margin-top: 1rem; }
.hni-action-row { margin: 1rem 0; }
.primary-action { border: 0; background: #176b5b; color: #fff; padding: .7rem 1rem; font: inherit; font-weight: 800; cursor: pointer; }
.primary-action:disabled { cursor: not-allowed; opacity: .55; }
.hni-flow, .hni-comparison, .hni-scale { display: grid; gap: .75rem; }
.hni-flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hni-flow > div, .hni-card, .hni-scale > div { padding: .85rem; border: 1px solid #c8d5da; background: #fff; }
.hni-flow span, .hni-card span, .hni-scale span { display: block; color: #4b5d68; font-size: .88rem; }
.hni-flow strong, .hni-card strong, .hni-scale strong { display: block; margin-top: .35rem; color: #113b4b; }
.hni-comparison { grid-template-columns: 1fr auto 1fr; align-items: center; }
.hni-arrow { font-size: 2rem; font-weight: 900; color: #a43822; }
.hni-scale { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 1rem; }
.hni-scale strong { font-size: 1.55rem; color: #176b5b; }
@media (max-width: 760px) { .hni-flow, .hni-scale { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hni-comparison { grid-template-columns: 1fr; } .hni-arrow { text-align: center; transform: rotate(90deg); } }
.attribution-controls { display: flex; flex-wrap: wrap; gap: .55rem; margin: 1rem 0; }
.attribution-controls button { border: 1px solid #78909a; background: #fff; color: #143b4a; padding: .58rem .75rem; font: inherit; font-weight: 750; cursor: pointer; }
.attribution-controls button.active { background: #176b5b; border-color: #176b5b; color: #fff; }
.temis-chain { display: flex; align-items: stretch; gap: .35rem; overflow-x: auto; padding: 1rem 0; }
.temis-chain > div { flex: 1 0 145px; min-height: 92px; padding: .75rem; border: 1px solid #c8d5da; background: #eef2f3; opacity: .42; transition: opacity .2s ease, border-color .2s ease, background .2s ease; }
.temis-chain > div.active { opacity: 1; border-color: #176b5b; background: #f1faf6; }
.temis-chain > i { align-self: center; color: #9aa8ae; font-style: normal; font-size: 1.35rem; font-weight: 900; }
.temis-chain > i.active { color: #176b5b; }
.temis-chain strong, .temis-chain span { display: block; }
.temis-chain span { margin-top: .35rem; color: #4b5d68; font-size: .83rem; }
.attribution-explanation { max-width: 72ch; }
.attribution-explanation > span { color: #176b5b; font-weight: 800; }
.attribution-explanation h4 { margin: .35rem 0; font-size: 1.2rem; }
.discovery-story { margin: 1rem 0; border: 1px solid #b7c8d3; background: #f7fbfd; }
.discovery-story summary { padding: .85rem 1rem; color: #113b4b; font-weight: 850; cursor: pointer; }
.discovery-story ol { margin: 0; padding: 0 1.25rem 1rem 2.4rem; }
.discovery-story li { margin: .65rem 0; line-height: 1.5; }
.infra-role-box { margin: 1.15rem 0; padding: 1rem; border: 1px solid #c8d5da; background: #f7f9fa; }
.infra-role-box h4 { margin: 0 0 .4rem; }
.compact-stage { min-height: 135px; }
.pattern-box { margin: 1.15rem 0; padding: 1rem; border: 1px solid #91aeb8; background: #f3f8f9; }
.pattern-box h4 { margin: 0 0 .4rem; }
@media (max-width: 760px) { .temis-chain { display: grid; grid-template-columns: 1fr; } .temis-chain > i { transform: rotate(90deg); text-align: center; } }
