.history-page main {
  width: min(65rem, calc(100% - 2.5rem));
}

.history-intro {
  padding: clamp(1.7rem, 4vw, 3rem) 0 1.4rem;
}
.history-intro h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}
.history-page .history-intro p {
  max-width: 61ch;
  margin: .9rem 0 1.2rem;
  font-size: clamp(1.06rem, 1.8vw, 1.15rem);
  line-height: 1.65;
}
.history-page .study-nav {
  gap: .45rem 1.05rem;
}
.history-page .study-nav a {
  color: var(--muted);
}
.history-page .study-nav a:hover {
  color: var(--accent);
}

.history-page .history-section {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: clamp(1.35rem, 3vw, 2.1rem) 0;
}
.history-section h2 {
  margin: 0 0 .75rem;
  font-size: clamp(1.3rem, 2.7vw, 1.85rem);
}
.history-section .comparison {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem clamp(1.5rem, 4vw, 3.8rem);
  margin: .95rem 0 1.05rem;
}
.comparison h3 {
  margin: 0;
  font: 600 .87rem/1.4 var(--mono);
  color: var(--muted);
}
.history-page p {
  margin: .55rem 0;
}
.history-page .sources {
  color: var(--muted);
  font-size: .88rem;
}
.history-page .comparison .sources {
  margin: .5rem 0 0;
}

.history-detail {
  border-top: 1px solid var(--line);
}
.history-detail > summary {
  color: var(--accent);
  padding: .65rem 0;
  font-size: .93rem;
  font-weight: 600;
}
.history-detail > summary:hover {
  color: #fff;
}
.history-detail[open] > summary {
  margin-bottom: .4rem;
}
.detail-body {
  padding: 0 0 1rem;
}
.detail-body > p,
.detail-body article > p {
  max-width: 77ch;
}
.detail-body h3 {
  margin: 1.18rem 0 .35rem;
}
.detail-body .measure {
  border-inline-start: 2px solid var(--accent);
  padding: .65rem .95rem;
  background: var(--surface);
}
.history-page .two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
  align-items: start;
}
.history-page .science-plot {
  margin: 1rem 0;
  max-width: 42rem;
}
.history-page .science-plot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}
.history-page .science-plot figcaption {
  color: var(--muted);
  font-size: .87rem;
  margin-top: .35rem;
}
.history-page .table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.history-page table {
  border-collapse: collapse;
  width: 100%;
  font-variant-numeric: tabular-nums;
  font-size: .92rem;
}
.history-page th,
.history-page td {
  text-align: right;
  padding: .4rem .55rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.history-page th:first-child,
.history-page td:first-child,
.history-page caption {
  text-align: left;
}
.history-page thead th {
  color: var(--muted);
}
.history-page caption {
  margin: .6rem 0;
}

.history-page .journal-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: clamp(.75rem, 2.3vw, 1.25rem);
}
.journal-panel header,
.journal-panel .scrub,
.journal-panel .stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem 1rem;
}
.journal-panel label {
  font-weight: 600;
}
.journal-panel input,
.journal-panel select {
  accent-color: var(--accent);
  background: var(--tint);
  border: 1px solid var(--line);
  color: var(--ink);
  font: inherit;
  border-radius: 3px;
  padding: .3rem;
}
.journal-panel input[type="number"] {
  width: 6rem;
}
.journal-panel input[type="range"] {
  width: clamp(9rem, 45%, 34rem);
  padding: 0;
}
.journal-panel canvas {
  display: block;
  width: 100%;
  height: clamp(12rem, 27vw, 18rem);
}
.journal-panel .stats {
  margin: .6rem 0;
  gap: .5rem 1.6rem;
}
.journal-panel .stats strong {
  font: 600 1.1rem var(--mono);
}
.history-page .journal-panel .plot-label {
  color: var(--muted);
  font: .86rem var(--mono);
  margin: 1rem 0 0;
}
.history-page [hidden] {
  display: none;
}
@media (max-width: 47rem) {
  .history-page main {
    width: calc(100% - 1.5rem);
  }
  .history-page .comparison,
  .history-page .two-col {
    grid-template-columns: 1fr;
  }
  .history-page .comparison {
    gap: .6rem;
  }
}

.history-page .stage-comparison :is(th, td) {
  text-align: left;
  vertical-align: top;
}
.history-page .comparison-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 58rem;
  margin: 1.15rem 0;
  padding: 0;
  list-style: none;
}

.comparison-steps li {
  position: relative;
  border-top: 1px solid var(--line);
  padding: .6rem 0;
}

.comparison-steps strong {
  display: block;
  color: var(--accent);
}

.comparison-steps li + li::before {
  position: absolute;
  inset-inline-start: -1.15rem;
  top: .55rem;
  content: "→";
  color: var(--muted);
}

@media (max-width: 47rem) {
  .history-page .comparison-steps {
    grid-template-columns: 1fr;
    gap: .3rem;
  }

  .comparison-steps li + li::before {
    content: none;
  }
}
