:root {
  --ink: #1c2430; --paper: #f5f1e8; --panel: #fffdf7; --line: #d8d2c2;
  --accent: #c8501e; --accent2: #1e6f8e; --good: #2e7d32; --warn: #a15c00;
  --bad: #b3261e; --muted: #5c6656;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Georgia, 'Times New Roman', serif;
  background: var(--paper); color: var(--ink); line-height: 1.45; }
header { padding: 28px 32px 8px; max-width: 1400px; margin: 0 auto; }
h1 { font-size: 2rem; margin: 0 0 6px; }
.tagline { font-size: 1.08rem; max-width: 62em; }
.fidelity { border-left: 4px solid var(--accent); padding: 8px 14px;
  background: #fdf6ec; max-width: 72em; }
main { display: grid; grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px; padding: 16px 32px; max-width: 1400px; margin: 0 auto; }
#stage-section { grid-column: 1; }
#side { grid-column: 2; display: flex; flex-direction: column; gap: 16px; }
#chart-section, #city-section, #analysis-section, #claims-section,
#assumptions-section, #book-section { grid-column: 1 / -1; }
.panel { background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 14px 18px; }
.panel h3 { margin-top: 2px; }
#stage-wrap { position: relative; background: #0b1220; border-radius: 8px;
  overflow: hidden; }
#gl { display: block; width: 100%; height: auto; }
#clock-chip { position: absolute; top: 10px; left: 10px; background: rgba(10,14,22,.78);
  color: #ffe9c9; padding: 6px 12px; border-radius: 16px; font-size: .92rem;
  font-family: ui-monospace, Menlo, monospace; }
#part-labels { position: absolute; inset: 0; pointer-events: none; }
.part-label { position: absolute; transform: translate(-50%, -130%);
  background: rgba(10,14,22,.72); color: #fff; font-size: .72rem;
  padding: 2px 7px; border-radius: 9px; white-space: nowrap;
  font-family: ui-monospace, Menlo, monospace; }
#caption-bar { position: absolute; left: 0; right: 0; bottom: 0;
  background: rgba(5,8,14,.85); color: #fff; font-size: 1.25rem;
  text-align: center; padding: 12px 22px; line-height: 1.35; }
#caption-fixed { position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 18px; width: min(920px, 92vw); z-index: 30;
  background: rgba(5,8,14,.88); color: #fff; font-size: 1.22rem;
  text-align: center; padding: 12px 22px; border-radius: 10px; line-height: 1.35; }
#caption-fixed[hidden] { display: none; }
#titlecard { position: fixed; inset: 0; background: #0b1220; z-index: 40;
  display: flex; align-items: center; justify-content: center; }
#titlecard[hidden] { display: none; }
.titlecard-inner { text-align: center; color: #f5f1e8; padding: 20px; }
.tc-kicker { letter-spacing: .25em; text-transform: uppercase; color: #e8a37c;
  font-size: .9rem; }
.tc-title { font-size: 3.4rem; margin: 10px 0 0; }
.tc-sub { font-size: 1.7rem; color: #9fd3e8; margin-bottom: 14px; }
.tc-line { max-width: 34em; margin: 0 auto; font-size: 1.1rem; }
#stage-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin: 10px 0; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 14px;
  padding: 5px 12px; cursor: pointer; font-family: inherit; }
.chip.active { background: var(--accent); color: #fff; border-color: var(--accent); }
button { font-family: inherit; cursor: pointer; border: 1px solid var(--line);
  background: #fff; border-radius: 6px; padding: 6px 12px; }
button:hover { border-color: var(--accent); }
input, select { font-family: inherit; padding: 5px 7px; border: 1px solid var(--line);
  border-radius: 5px; background: #fff; }
input[type=range] { width: 100%; }
.row { display: flex; gap: 10px; align-items: center; margin: 8px 0; }
.row.wrap { flex-wrap: wrap; }
.block { display: block; margin: 10px 0; }
.inline { display: inline-flex; gap: 8px; align-items: center; }
.note { color: var(--muted); font-size: .88rem; }
.provenance { font-size: .9rem; background: #eef5e9; border: 1px solid #cfdcc4;
  padding: 8px 12px; border-radius: 6px; }
.numbers { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px;
  font-size: .95rem; }
.numbers dt { color: var(--muted); }
.numbers dd { margin: 0; font-family: ui-monospace, Menlo, monospace; text-align: right; }
#phases details { border-top: 1px solid var(--line); padding: 6px 0; }
#phases summary { cursor: pointer; display: flex; justify-content: space-between;
  gap: 8px; }
#phases .pname { font-weight: bold; }
#phases .pvals { font-family: ui-monospace, Menlo, monospace; font-size: .88rem;
  text-align: right; }
#phases .peq { font-size: .88rem; color: #37404d; padding: 6px 2px 2px; }
.eq { font-family: ui-monospace, Menlo, monospace; background: #f0ead9;
  padding: 2px 6px; border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-size: .92rem; }
th, td { border: 1px solid var(--line); padding: 6px 9px; text-align: left;
  vertical-align: top; }
th { background: #f0ead9; }
.verdict-AGREE { color: var(--good); font-weight: bold; }
.verdict-PARTIAL { color: var(--warn); font-weight: bold; }
.verdict-DISAGREE { color: var(--bad); font-weight: bold; }
.verdict-UNTESTABLE { color: var(--muted); font-weight: bold; }
progress { width: 320px; height: 18px; }
.book-flex { display: flex; gap: 20px; align-items: flex-start; }
#book-cover { border: 1px solid var(--line); border-radius: 4px; }
canvas#power-chart, canvas#heatmap { width: 100%; height: auto; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; }
footer { max-width: 1400px; margin: 0 auto; padding: 10px 32px 40px;
  color: var(--muted); font-size: .92rem; }
@media (max-width: 980px) {
  main { grid-template-columns: 1fr; }
  #side { grid-column: 1; }
}
