:root {
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #17213a;
  background: #f5f7fb;
  --muted: #54627a;
  --primary: #5146de;
  --pun-official: #23639c;
  --historical: #835521;
  --line: #e4e9f2;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.shell { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.topbar { background: white; border-bottom: 1px solid var(--line); }
.topbar-inner { height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 750; letter-spacing: -.025em; }
.brand-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 10px; color: white; background: var(--primary); }
.brand-icon svg { width: 20px; }
.brand-secondary { color: var(--primary); }
.header-note { color: var(--muted); font-size: .82rem; font-weight: 650; }
.intro { padding-top: 37px; margin-bottom: 22px; }
.eyebrow { margin: 0 0 9px; color: var(--primary); font-size: .72rem; font-weight: 800; letter-spacing: .15em; }
h1 { margin: 0; font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.05; letter-spacing: -.06em; }
.intro-copy { margin: 11px 0 0; color: var(--muted); }
.notice { padding: 11px 14px; margin-bottom: 18px; border: 1px solid #efdbad; border-radius: 10px; background: #fff8e6; color: #704b16; font-size: .87rem; }
.market-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 19px; }
.market-picker { display: inline-flex; flex-wrap: wrap; max-width: 100%; gap: 4px; padding: 4px; background: #e9edf5; border-radius: 12px; }
.market-picker button { display: flex; align-items: center; gap: 8px; padding: 8px 13px; border: 0; border-radius: 8px; background: transparent; color: #45536b; font-size: .88rem; font-weight: 750; white-space: nowrap; }
.market-picker button svg { width: 18px; height: 18px; }
.market-picker button span { font-weight: 500; }
.market-picker button[aria-pressed="true"] { color: var(--primary); background: white; box-shadow: 0 1px 3px #14244b1a; }
.market-picker button:hover:not([aria-pressed="true"]) { background: #dfe5f0; }
.unit-picker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--muted); font-size: .83rem; font-weight: 650; }
.unit-picker select { padding: 6px 8px; border: 1px solid #8290a8; border-radius: 8px; background: white; color: #17213a; font: inherit; cursor: pointer; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; margin-bottom: 16px; }
.stats--pun { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: white; border: 1px solid var(--line); border-radius: 15px; box-shadow: 0 3px 8px #11204b06; }
.stat { padding: 15px 19px; }
.stat-label, .stat-detail { color: var(--muted); margin: 0; font-size: .83rem; }
.stat-label { font-weight: 650; }
.stat-official .stat-label { color: var(--pun-official); }
.stat-detail { font-size: .78rem; min-height: 1.1em; }
.stat-value { margin: 5px 0 4px; font-weight: 750; font-size: clamp(1.45rem, 3.5vw, 2rem); letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat-unit { font-size: .78rem; color: var(--muted); letter-spacing: 0; white-space: nowrap; }
.stat-value[data-direction="up"] { color: #a83b45; }
.stat-value[data-direction="down"] { color: #007759; }
.chart-card { padding: 21px 23px 15px; }
.chart-header { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.chart-header h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.025em; }
.chart-header p { margin: 5px 0 0; color: var(--muted); font-size: .83rem; }
.periods { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: #f0f3f8; border-radius: 9px; }
.periods button { min-width: 35px; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--muted); font-size: .78rem; font-weight: 700; }
.periods button:hover { color: var(--primary); }
.periods button[aria-pressed="true"] { background: white; color: var(--primary); box-shadow: 0 1px 3px #14244b1a; }
.range-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 14px; padding: 10px 12px; background: #f5f7fb; border: 1px solid var(--line); border-radius: 9px; }
.range-fields, .range-actions { display: flex; flex-wrap: wrap; gap: 7px; min-width: 0; }
.range-fields label { display: grid; gap: 3px; flex: 1 1 7rem; color: var(--muted); font-size: .75rem; font-weight: 650; }
.range-fields input, .range-actions button { min-height: 34px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; font: inherit; font-size: .8rem; }
.range-fields input { min-width: 0; width: 100%; color: #17213a; background: white; }
.range-actions button { font-weight: 700; }
.range-apply { color: white; background: var(--primary); }
.range-reset { color: var(--primary); background: white; }
.range-actions button:hover { filter: brightness(.92); }
.range-help, .range-error { flex: 1 0 100%; margin: 0; font-size: .75rem; }
.range-help { color: var(--muted); }
.range-error { color: #a83b45; font-weight: 650; }
.series-group { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.series-chip { --series: #5850ec; display: flex; align-items: center; gap: 5px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 8px; color: #45536b; font-size: .78rem; font-weight: 650; cursor: pointer; }
.series-chip.official { --series: var(--pun-official); }
.series-chip.historical { --series: var(--historical); }
.series-chip.historical::after { content: ''; width: 13px; flex: none; border-top: 2px dashed var(--series); }
.series-chip.f1 { --series: #c45017; }
.series-chip.f2 { --series: #007f78; }
.series-chip.f3 { --series: #b23392; }
.series-chip input { accent-color: var(--series); margin: 0; cursor: pointer; }
.series-chip:has(input:checked) { color: var(--series); background: color-mix(in srgb, var(--series) 6%, white); border-color: color-mix(in srgb, var(--series) 25%, white); }
.method-note { margin: 8px 0 0; color: var(--muted); font-size: .78rem; }
.chart-frame { --pp-chart-height: 100%; position: relative; min-width: 0; height: clamp(260px, 34vw, 330px); margin-top: 12px; }
/* Keep the mean visible when it coincides with the official series. */
.pp-chart__line[data-series="official"] { stroke-dasharray: 6 6; }
.pp-chart__line[data-series="historical"] { stroke-dasharray: 3 5; }
.pp-chart__point[data-series="official"],
.pp-chart__marker[data-series="official"] { fill: none; stroke: var(--pun-official); stroke-width: var(--pp-point-outline, 1.8px); }
.pp-chart__marker[data-series="official"] { r: 6.5px; }
.chart-message { display: grid; place-items: center; height: 100%; margin: 0; padding: 1rem; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; background: #f9fbfe; }
.chart-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; margin-top: 9px; color: var(--muted); font-size: .75rem; overflow-wrap: anywhere; }
.chart-footer span { display: block; }
.chart-provenance:not(:has(span:not([hidden]))) { display: none; }
#coverage { font-weight: 650; }
#data-details { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: .83rem; }
#data-details summary { width: fit-content; cursor: pointer; font-weight: 650; }
.table-scroll { overflow: auto; max-height: 22rem; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; text-align: end; }
th { background: #f5f7fb; }
th:first-child, td:first-child { text-align: start; }
#data-table :is(th, td):nth-last-child(-n+2) { min-width: 11rem; white-space: pre-line; overflow-wrap: anywhere; text-align: start; }
.site-footer { padding: 19px 0 25px; color: var(--muted); font-size: .77rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 820px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats:not(.stats--pun) .stat-count { grid-column: span 2; }
}
@media (max-width: 610px) {
  .shell { width: calc(100% - 26px); }
  .topbar-inner { height: 56px; }
  .intro { padding-top: 26px; }
  .stats { gap: 7px; }
  .stat { padding: 10px 8px; }
  .stat-label, .stat-detail { font-size: .71rem; }
  .chart-card { padding: 14px 12px; }
}
