:root {
  color-scheme: light;
  --page: #fcfcfb;
  --surface: #ffffff;
  --ink: #17181a;
  --secondary: #52514e;
  --muted: #76746f;
  --rule: #e1e0d9;
  --blue: #2a78d6;
  --orange: #eb6834;
  --aqua: #1baf7a;
  --berry: #813f55;
  --soft-berry: #f9f1f3;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--page); color: var(--ink); font: 17px/1.68 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: #174e82; text-decoration-thickness: 1px; text-underline-offset: .17em; }
a:hover { color: var(--berry); }
a:focus-visible, summary:focus-visible, select:focus-visible, button:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 2px; }
.skip { position: absolute; z-index: 10; top: -5rem; left: 1rem; padding: .5rem .8rem; background: white; }
.skip:focus { top: 1rem; }
.sitebar { min-height: 42px; display: flex; justify-content: space-between; gap: 1rem; align-items: center; padding: .4rem clamp(1rem, 5vw, 5rem); font-size: .72rem; line-height: 1.3; color: var(--secondary); border-bottom: 1px solid var(--rule); }
.sitebar a { color: inherit; text-decoration: none; font-weight: 700; }
.opening { max-width: 1550px; margin: 0 auto; padding: clamp(2rem, 5vw, 5rem) 1.2rem 0; }
.eyebrow { margin: 0 0 1rem; text-align: center; font-size: .78rem; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--berry); }
h1 { max-width: 1000px; margin: 0 auto .9rem; text-align: center; font-size: clamp(3rem, 5.5vw, 5.6rem); line-height: 1.07; letter-spacing: -.054em; font-weight: 760; }
.dek { max-width: 775px; margin: 0 auto 2.25rem; text-align: center; color: var(--secondary); font-size: clamp(1.07rem, 1.55vw, 1.38rem); line-height: 1.58; }
.hero { margin: 0 auto; }
.hero .figure-frame { background: var(--surface); border: 1px solid var(--rule); }
.hero img { display: block; width: 100%; min-width: 780px; max-height: 530px; object-fit: contain; }
.hero figcaption { text-align: center; max-width: 850px; margin: .85rem auto 1.5rem; }
.figure-scroll { overflow-x: auto; }
figcaption { font-size: .78rem; line-height: 1.55; color: var(--secondary); }
figcaption strong { color: var(--ink); }
.meta { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.3fr) minmax(0, .65fr); max-width: 1040px; margin: 3.3rem auto 0; padding: 1.1rem 0 1.5rem; gap: 1.2rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: .83rem; line-height: 1.55; }
.meta-label { display: block; text-transform: uppercase; letter-spacing: .11em; color: var(--muted); font-size: .67rem; font-weight: 750; margin-bottom: .28rem; }
.page-grid { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 760px) minmax(0, 170px); max-width: 1250px; gap: 2.5rem; margin: 4.2rem auto 5rem; padding: 0 1rem; align-items: start; }
.toc { position: sticky; top: 1.2rem; max-height: calc(100vh - 2.4rem); overflow-y: auto; padding: .2rem .7rem .3rem 0; border-right: 1px solid var(--rule); font-size: .77rem; line-height: 1.45; }
.toc strong { font-size: .9rem; }
.toc ol { padding-left: 0; margin: .75rem 0; list-style: none; }
.toc li { margin: .63rem 0; }
.toc a { color: var(--secondary); text-decoration: none; }
.toc a:hover, .toc a[aria-current="location"] { color: var(--ink); text-decoration: underline; text-decoration-color: var(--berry); text-underline-offset: .2em; }
main, article { min-width: 0; }
article section { scroll-margin-top: 2rem; margin-bottom: 4.6rem; }
article h2 { margin: 0 0 1.1rem; font-size: clamp(1.72rem, 2.4vw, 2.15rem); line-height: 1.24; letter-spacing: -.035em; }
article h3 { margin: 2.1rem 0 .8rem; font-size: 1.14rem; line-height: 1.32; letter-spacing: -.01em; }
article p { margin: 0 0 1.18rem; }
article p strong { font-weight: 760; }
article aside { margin: 1.7rem 0 2rem; padding: 1.15rem 1.35rem; border-left: 3px solid var(--berry); background: var(--soft-berry); font-size: .87rem; line-height: 1.55; }
.rail { border-left: 1px solid var(--rule); padding-left: 1rem; color: var(--secondary); font-size: .75rem; line-height: 1.6; }
.rail p { margin: .1rem 0 1.8rem; }
.story-figure { width: min(100%, 870px); margin: 2.1rem 0 2.4rem; }
.story-figure h3 { margin-bottom: .7rem; }
.story-figure .figure-frame { min-height: 260px; background: var(--surface); border: 1px solid var(--rule); overflow: hidden; }
.story-figure .fallback { width: 100%; height: auto; display: block; }
.story-figure .live { display: none; width: 100%; min-height: 380px; }
.story-figure.enhanced .fallback { display: none; }
.story-figure.enhanced .live { display: block; }
.story-figure figcaption { margin: .8rem 0 .45rem; }
.chart-toolbar { display: flex; flex-wrap: wrap; gap: .6rem 1rem; margin: .75rem .8rem 0; font-size: .75rem; }
.chart-toolbar label { display: flex; align-items: center; gap: .55rem; font-weight: 650; }
.chart-toolbar select { background: #f4f4f2; color: var(--ink); border: 1px solid var(--rule); border-radius: 4px; padding: .32rem .5rem; font: inherit; min-width: 110px; }
.data-table { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-top: .6rem; font-size: .77rem; }
.data-table summary { cursor: pointer; padding: .55rem .3rem; font-weight: 650; }
.data-table div { max-height: 320px; overflow: auto; }
.data-table table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.data-table th, .data-table td { border-bottom: 1px solid var(--rule); padding: .3rem .55rem; text-align: left; white-space: nowrap; }
.data-table th { position: sticky; top: 0; background: white; }
.references { padding-left: 1.6rem; font-size: .84rem; line-height: 1.55; }
.references li { margin: .5rem 0; padding-left: .15rem; }
.closing { padding-top: 1.2rem; border-top: 1px solid var(--rule); font-weight: 670; }
footer { display: flex; justify-content: space-between; gap: 1rem; padding: 1.4rem max(1rem, calc((100vw - 1200px)/2)); border-top: 1px solid var(--rule); color: var(--secondary); font-size: .78rem; }
@media (max-width: 1120px) {
  .page-grid { max-width: 940px; grid-template-columns: 170px minmax(0, 760px); gap: 2rem; }
  .rail { display: none; }
}
@media (max-width: 720px) {
  body { font-size: 16px; line-height: 1.63; }
  .sitebar span { display: none; }
  .opening { padding-top: 2.5rem; }
  .dek { margin-bottom: 1.5rem; }
  .meta { grid-template-columns: 1fr 1fr; margin-top: 2rem; padding: .8rem 0; }
  .meta div:last-child { grid-column: 1 / -1; }
  .page-grid { display: block; margin-top: 2rem; }
  .toc { position: static; border-right: 0; border-bottom: 1px solid var(--rule); max-height: none; margin-bottom: 2.5rem; padding-bottom: .7rem; }
  .toc ol { display: grid; grid-template-columns: 1fr 1fr; column-gap: .6rem; }
  article section { margin-bottom: 3.3rem; }
  .story-figure .figure-frame { min-height: 210px; }
  .story-figure .live { min-height: 340px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
@media print {
  .sitebar, .toc, .chart-toolbar, footer { display: none; }
  .page-grid { display: block; max-width: 760px; margin: 1rem auto; }
  .story-figure.enhanced .live { display: none; }
  .story-figure.enhanced .fallback { display: block; }
  a { color: inherit; }
  article section { break-inside: avoid; }
}
