:root {
  color-scheme: light;
  --paper: #f4f3ee;
  --white: #fcfbf8;
  --ink: #1e2523;
  --muted: #636b66;
  --line: #d6d6cc;
  --accent: #7d3b2c;
  --soft: #e8e8df;
  --serif: Georgia, "Palatino Linotype", "Times New Roman", serif;
  --sans: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; scroll-padding-top: 1rem; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 17px/1.65 var(--sans);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: env(safe-area-inset-top, 0px) calc(4rem + env(safe-area-inset-bottom, 0px));
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.15; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.3rem); letter-spacing: -0.01em; }
h3 { font-size: 1.25rem; }
p { margin: 0; }

.shell { max-width: 72rem; margin: 0 auto; display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 3rem; }
.toc { position: sticky; top: 1.5rem; align-self: start; font-size: 0.88rem; display: grid; gap: 0.35rem; padding-top: 3.2rem; }
.toc p { font-weight: 600; margin-bottom: 0.3rem; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--accent); }
main { min-width: 0; }

section { padding-block: 3rem; border-bottom: 1px solid var(--line); display: grid; gap: 1.25rem; }
section > p, .text { max-width: 40rem; }
.intro { padding-top: 3rem; }
.title { display: grid; gap: 0.6rem; }
.kicker { font-size: 1rem; font-weight: 600; color: var(--accent); text-wrap: balance; }
.intro .lede { font-size: 1.2rem; max-width: 40rem; }
.byline { font-size: 0.9rem; color: var(--muted); }
.credit { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.5rem; }
.credit img { width: 44px; height: 44px; object-fit: cover; object-position: center 12%; border-radius: 50%; filter: grayscale(1); border: 1px solid var(--line); }
.credit p { font-size: 0.9rem; line-height: 1.45; }
.credit span { display: block; color: var(--muted); font-size: 0.82rem; }

figure { margin: 0; display: grid; gap: 0.5rem; min-width: 0; }
figure button { padding: 0; border: 1px solid var(--line); background: var(--white); cursor: zoom-in; display: block; width: 100%; }
figure img { width: 100%; }
figcaption { font-size: 0.85rem; color: var(--muted); line-height: 1.45; }
figcaption b { color: var(--ink); font-weight: 600; }
.hero-pair { display: grid; grid-template-columns: minmax(0, 0.717fr) minmax(0, 0.952fr); gap: 1rem; align-items: start; max-width: 46rem; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.lead-fig { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1.75rem; align-items: start; }
.lead-fig .text { display: grid; gap: 1rem; }
figure.wide { max-width: 46rem; }

.tablewrap { overflow-x: auto; border: 1px solid var(--line); background: var(--white); }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; min-width: 38rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
thead th { font-size: 0.78rem; font-weight: 600; color: var(--muted); background: var(--soft); }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
td.n, th.n { font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.mark td, tr.mark th { background: var(--soft); }
tbody th { font-weight: 600; }

.notice { background: var(--white); border: 1px solid var(--line); padding: 1.4rem 1.5rem; font-family: var(--serif); font-size: 1rem; line-height: 1.6; max-width: 40rem; display: grid; gap: 0.6rem; }
.notice .head { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.red { background: var(--ink); color: transparent; border-radius: 1px; user-select: none; }

ol.plain, ul.plain { margin: 0; padding-left: 1.2rem; display: grid; gap: 0.55rem; max-width: 40rem; }
.timeline { display: grid; gap: 0; max-width: 46rem; border-left: 2px solid var(--line); margin-left: 0.4rem; }
.timeline div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1rem; padding: 0.55rem 0 0.55rem 1.1rem; position: relative; }
.timeline div::before { content: ""; position: absolute; left: -0.42rem; top: 0.95rem; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: var(--paper); border: 2px solid var(--muted); }
.timeline div.key::before { background: var(--accent); border-color: var(--accent); }
.timeline time { font-variant-numeric: tabular-nums; font-size: 0.9rem; color: var(--muted); padding-top: 0.1rem; }

.sources { font-size: 0.9rem; display: grid; gap: 0.4rem; max-width: 46rem; margin: 0; padding-left: 1.2rem; }
footer { max-width: 72rem; margin: 0 auto; padding-top: 2rem; font-size: 0.85rem; color: var(--muted); }

dialog { border: 0; padding: 0; max-width: min(96vw, 1100px); background: var(--white); color: var(--ink); }
dialog::backdrop { background: rgba(0, 0, 0, 0.75); }
dialog img { max-height: 82vh; width: auto; margin: 0 auto; }
dialog p { padding: 0.75rem 1rem; font-size: 0.9rem; }
dialog .close { position: absolute; top: 0.5rem; right: 0.5rem; background: var(--white); color: var(--ink); border: 1px solid var(--line); padding: 0.3rem 0.7rem; font: inherit; cursor: pointer; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; gap: 0; }
  .toc { display: none; }
  .lead-fig, .grid2 { grid-template-columns: 1fr; }
  .hero-pair { gap: 0.6rem; }
  .grid3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .grid3 { grid-template-columns: 1fr; }
  .timeline div { grid-template-columns: 1fr; gap: 0.1rem; }
}
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.clip img { background: #fff; }
.lang { display: flex; gap: 0.8rem; font-size: 0.88rem; flex-wrap: wrap; }
.tablewrap td:first-child { font-weight: 600; }
.chain td { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) { .pair { grid-template-columns: 1fr; } }
