:root {
  --ink: #16201d;
  --muted: #66706c;
  --paper: #f4f1e8;
  --card: #fffdf8;
  --line: #d8d4c9;
  --green: #176b52;
  --orange: #d66b31;
  --blue: #3667a6;
  --gold: #dcae45;
  --red: #a7463b;
  --shadow: 0 18px 48px rgba(27, 42, 36, .09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .28;
  background-image: radial-gradient(#8c968f .55px, transparent .55px);
  background-size: 8px 8px;
  mix-blend-mode: multiply;
}
.wrap { width: min(1220px, calc(100% - 36px)); margin: auto; position: relative; }
.mast { padding: 58px 0 38px; }
.eyebrow { color: var(--green); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 850; }
h1, h2, .serif { font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
h1 { margin: 17px 0 18px; font-size: clamp(2.8rem, 6vw, 5.5rem); line-height: .94; letter-spacing: -.05em; max-width: 1000px; }
.lede { max-width: 860px; font-size: clamp(1.03rem, 1.8vw, 1.3rem); color: #46504c; }
.meta { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 24px; }
.pill { border: 1px solid var(--line); background: rgba(255,253,248,.75); padding: 7px 12px; border-radius: 999px; font-size: .78rem; font-weight: 750; }
.pill.good { color: var(--green); border-color: #9bc9b5; background: #e7f4ee; }
.pill.warn { color: #88521f; border-color: #e3bd8c; background: #fff3de; }
.topnav { position: sticky; top: 0; z-index: 20; border-block: 1px solid rgba(190,188,179,.8); background: rgba(244,241,232,.9); backdrop-filter: blur(14px); }
.topnav .wrap { display: flex; align-items: center; gap: 22px; overflow-x: auto; }
.topnav a { color: var(--muted); text-decoration: none; font-size: .79rem; font-weight: 800; padding: 13px 0; white-space: nowrap; }
.topnav a:hover, .topnav a.active { color: var(--green); }
main { padding: 34px 0 70px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 21px; padding: 26px; box-shadow: var(--shadow); margin-bottom: 18px; }
.panel.dark { background: var(--ink); color: #f9f4e9; border-color: var(--ink); }
.panel-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-head h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 2.8rem); letter-spacing: -.035em; line-height: 1; }
.panel-head p { max-width: 580px; margin: 0; color: var(--muted); font-size: .9rem; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.control-group { display: flex; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: #f4f1e9; }
button { font: inherit; }
.toggle { border: 0; background: transparent; color: var(--muted); font-size: .78rem; font-weight: 800; padding: 7px 12px; border-radius: 999px; cursor: pointer; }
.toggle.active { background: var(--ink); color: white; }
.chart-shell { position: relative; min-height: 490px; }
.chart-shell.compact { min-height: 420px; }
.chart { width: 100%; height: 500px; display: block; }
.facets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.facet { border: 1px solid var(--line); background: #fffefa; border-radius: 14px; padding: 10px; min-width: 0; }
.facet h3 { font-size: .88rem; margin: 2px 4px 2px; }
.facet svg { display: block; width: 100%; height: 285px; }
.tooltip { position: fixed; z-index: 50; pointer-events: none; opacity: 0; transform: translate(10px, 10px); background: rgba(17,27,23,.95); color: white; border-radius: 10px; padding: 10px 12px; font-size: .74rem; line-height: 1.45; box-shadow: 0 8px 25px rgba(0,0,0,.2); max-width: 260px; }
.legend { display: flex; gap: 15px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); font-size: .74rem; font-weight: 700; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border-radius: 50%; background: var(--swatch); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat { padding: 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,253,248,.8); }
.stat strong { display: block; font-family: Georgia, serif; font-size: 1.9rem; line-height: 1.05; }
.stat span { color: var(--muted); font-size: .73rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 800; }
.note { border-left: 4px solid var(--gold); background: #fff6e4; border-radius: 0 13px 13px 0; padding: 17px 19px; color: #635945; font-size: .88rem; }
.note.green { border-color: var(--green); background: #e9f5ef; color: #34584b; }
.note.red { border-color: var(--red); background: #faeae6; color: #6d4842; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .83rem; }
th { text-align: left; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; font-size: .67rem; border-bottom: 2px solid var(--ink); padding: 10px; }
td { border-bottom: 1px solid var(--line); padding: 10px; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.sig { color: var(--green); font-weight: 850; }
.ns { color: var(--muted); }
.fineprint { color: var(--muted); font-size: .76rem; margin-top: 12px; }
.footer { border-top: 1px solid var(--line); padding: 35px 0 55px; color: var(--muted); font-size: .78rem; }
.loading { color: var(--muted); display: grid; place-items: center; height: 380px; }
svg text { font-family: Inter, ui-sans-serif, system-ui, sans-serif; fill: #68716d; font-size: 11px; }
svg .axis { stroke: #aeb4b0; stroke-width: 1; }
svg .grid { stroke: #e6e3db; stroke-width: 1; }
svg .ci { stroke-width: 1; opacity: .23; }
svg .series-line { fill: none; stroke-width: 2.2; }
svg .point { stroke: #fffdf8; stroke-width: 1; cursor: crosshair; }
@media (max-width: 900px) {
  .facets { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .panel-head { align-items: start; flex-direction: column; }
}
@media (max-width: 620px) {
  .facets, .grid2 { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .chart { height: 410px; }
  .mast { padding-top: 42px; }
}
