:root {
  --paper: #f4f0e7;
  --paper-2: #ebe4d6;
  --ink: #1c1915;
  --muted: #5e584e;
  --line: #d9d0c1;
  --gilt: #8a5a22;
  --gilt-soft: #e7d3b0;
  --uk: #1a3654;
  --us: #8c3b2f;
  --ea: #1d5c4d;
  --boe: #4e4274;
  --pension: #8a5a22;
  --banks: #3d6b8a;
  --otherf: #6e6840;
  --overseas: #1d5c4d;
  --rest: #8a8175;
  --shadow: 0 1px 0 rgba(28, 25, 21, 0.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Segoe UI", "Helvetica Neue", sans-serif;
  font-size: 18px;
  line-height: 1.55;
}
a { color: var(--gilt); }
a:hover { color: var(--ink); }
button, input, select {
  font: inherit;
  color: inherit;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 1.25rem;
  padding: 1rem 1.25rem 0.8rem;
  border-bottom: 1px solid var(--line);
  background: rgba(244, 240, 231, 0.94);
  position: sticky;
  top: 0;
  z-index: 4;
}
.brand {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.brand span { color: var(--gilt); }
nav { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}
nav a[aria-current="page"], nav a:hover { color: var(--ink); }

main { max-width: 74rem; margin: 0 auto; padding: 2.2rem 1.25rem 4rem; }
h1, h2, h3 {
  font-family: Palatino, "Palatino Linotype", "Iowan Old Style", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); margin: 0.2rem 0 0.8rem; }
h2 { font-size: 1.7rem; margin: 2.4rem 0 0.6rem; }
h3 { font-size: 1.25rem; margin: 1.6rem 0 0.4rem; }
.kicker {
  margin: 0;
  color: var(--gilt);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.dek { font-size: 1.2rem; max-width: 40rem; color: var(--ink); }
.prose { max-width: 40rem; }
.prose p, .note { color: var(--ink); }
.muted, .source, figcaption, .readout { color: var(--muted); }
.source, figcaption { font-size: 0.85rem; }
.figure {
  margin: 1.4rem 0 0.4rem;
  background: #fbf8f2;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.8rem 0.8rem 0.4rem;
  box-shadow: var(--shadow);
}
.chart { width: 100%; min-height: 280px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart svg circle { cursor: pointer; }
.controls { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin: 0.8rem 0; }
.controls button, .controls label.chip {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}
.controls button[aria-pressed="true"], .controls label.chip:has(input:checked) {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.controls input[type="range"] { width: min(100%, 18rem); accent-color: var(--gilt); }
.controls input[type="date"], .controls select {
  background: #fbf8f2;
  border: 1px solid var(--line);
  border-radius: 2px;
  padding: 0.3rem 0.45rem;
}
.sentence {
  font-family: Palatino, "Palatino Linotype", Georgia, serif;
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  line-height: 1.35;
  max-width: 44rem;
}
.grid-2 { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 1.5rem; align-items: center; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.8rem; margin: 1rem 0; }
.stat {
  background: #fbf8f2;
  border: 1px solid var(--line);
  padding: 0.8rem 0.9rem;
}
.stat b {
  display: block;
  font-family: Palatino, Georgia, serif;
  font-size: 1.7rem;
  font-variant-numeric: tabular-nums;
}
.stat span { color: var(--muted); font-size: 0.85rem; }
details {
  border-top: 1px solid var(--line);
  padding: 0.7rem 0;
  max-width: 44rem;
}
summary { cursor: pointer; font-weight: 600; }
.formula { font-variant-numeric: tabular-nums; }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 0.28rem 0.4rem; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }
footer {
  border-top: 1px solid var(--line);
  padding: 1.2rem 1.25rem 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 74rem;
  margin: 0 auto;
}
.see-saw { width: 100%; }
.qa h2 { margin-top: 2rem; }
.warn {
  background: var(--gilt-soft);
  padding: 0.7rem 0.9rem;
  max-width: 44rem;
}

.gilt-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.2rem 0 0.4rem; }
.certificate {
  background: #fbf8f2;
  border: 1px solid var(--line);
  padding: 1rem 1.1rem 0.7rem;
}
.certificate .kind {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gilt);
}
.certificate h2 { margin: 0.15rem 0 0.8rem; font-size: 1.35rem; }
.certificate .field {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  padding: 0.38rem 0;
  font-variant-numeric: tabular-nums;
}
.certificate .field span { color: var(--muted); }
dl.terms { margin: 0.4rem 0 0; max-width: 44rem; }
dl.terms dt { font-weight: 600; margin-top: 0.85rem; }
dl.terms dd { margin: 0.15rem 0 0; }
.path { padding-left: 1.1rem; max-width: 44rem; }
.path li { margin: 0.35rem 0; }

@media (max-width: 800px) {
  body { font-size: 17px; }
  .grid-2, .stats, .gilt-pair { grid-template-columns: 1fr; }
  .top { position: static; }
}
