:root {
  --ink: #14201a;
  --muted: #617068;
  --brand: #2f6f4e;
  --brand-dark: #1f4d36;
  --blue: #2d6f8f;
  --paper: #f5f6f2;
  --panel: #ffffff;
  --line: #d8dfda;
  --warm: #b95c45;
  --shadow: 0 18px 50px rgba(27, 51, 38, .08);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--brand-dark); text-underline-offset: 3px; }
.skip-link { position: absolute; left: -9999px; top: 0; padding: .75rem 1rem; background: #fff; z-index: 10; }
.skip-link:focus { left: 1rem; }
.site-header { min-height: 62px; padding: .5rem max(1.2rem, calc((100% - 1240px) / 2)); background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-size: 1.05rem; font-weight: 700; letter-spacing: 0; }
.brand b { color: var(--brand); }
.brand-logo { width: 29px; height: 31px; object-fit: contain; }
nav { display: flex; flex-wrap: wrap; gap: 1.25rem; }
nav a { color: var(--ink); font-weight: 650; text-decoration: none; }
main { width: min(1240px, calc(100% - 2.4rem)); margin: 0 auto; }
.hero { margin: 1.25rem 0 .75rem; padding: clamp(1.4rem, 3vw, 2.5rem); color: white; border-radius: 24px; display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 2rem; align-items: center; background: radial-gradient(circle at 80% 10%, rgba(255,255,255,.12), transparent 30%), linear-gradient(135deg, #163c2b, #2f6f4e); box-shadow: var(--shadow); }
.hero h1 { margin: 0; max-width: 760px; font: 700 clamp(2.5rem, 5vw, 4.8rem)/.95 Georgia, serif; letter-spacing: -.04em; }
.hero-meta { width: 100%; }
.hero-meta .eyebrow { margin-bottom: .65rem; }
.eyebrow { margin: 0 0 .45rem; text-transform: uppercase; letter-spacing: .14em; font-size: .73rem; font-weight: 800; }
.lede { max-width: 760px; margin: 0; font-size: clamp(1rem, 2vw, 1.22rem); line-height: 1.6; }
.freshness { width: 100%; padding: .85rem 1rem; border: 1px solid rgba(255,255,255,.28); border-radius: 14px; background: rgba(255,255,255,.08); line-height: 1.45; }
.toolbar { margin: 1rem 0; padding: 1rem 1.2rem; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; display: flex; align-items: center; gap: 1rem; box-shadow: var(--shadow); }
.toolbar label { font-weight: 750; }
select { min-height: 42px; padding: .55rem 2.2rem .55rem .8rem; color: var(--ink); background: #fff; border: 1px solid #b7c3bb; border-radius: 9px; font: inherit; }
input { min-height: 42px; padding: .55rem .8rem; color: var(--ink); background: #fff; border: 1px solid #b7c3bb; border-radius: 9px; font: inherit; }
input:disabled { color: #7b8680; background: #eef1ee; cursor: not-allowed; }
.playback-controls { display: inline-flex; align-items: center; gap: .4rem; }
.playback-controls button { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; color: var(--brand-dark); background: #fff; border: 1px solid #9fb2a6; border-radius: 9px; font: 800 1.15rem/1 system-ui, sans-serif; cursor: pointer; }
.playback-controls button:hover { color: #fff; background: var(--brand); border-color: var(--brand); }
.playback-controls button:focus-visible { outline: 3px solid rgba(47,111,78,.3); outline-offset: 2px; }
.playback-controls button:disabled { opacity: .45; cursor: wait; }
.playback-controls button[aria-pressed="true"] { color: #fff; background: var(--brand-dark); border-color: var(--brand-dark); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: .65rem 1rem; margin-left: auto; color: white; background: var(--brand); border-radius: 9px; font-weight: 750; text-decoration: none; }
.button:hover { background: var(--brand-dark); }
.kpi-grid { margin: 1rem 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.kpi { min-height: 126px; padding: 1.2rem; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.kpi span { display: block; color: var(--muted); font-size: .8rem; font-weight: 750; text-transform: uppercase; letter-spacing: .06em; }
.kpi strong { display: block; margin-top: .55rem; font: 700 clamp(1.25rem, 2.5vw, 2rem)/1.1 Georgia, serif; }
.chart-panel, .table-section, .content-page { margin: 1rem 0 2rem; padding: clamp(1.1rem, 3vw, 2rem); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.section-heading { margin-bottom: 1rem; display: flex; align-items: end; justify-content: space-between; gap: 1.5rem; }
.section-heading h2, .content-page h1, .content-page h2 { margin: 0; font-family: Georgia, serif; }
.section-heading p { max-width: 480px; margin: 0; color: var(--muted); line-height: 1.5; text-align: right; }
.chart-wrap { position: relative; height: 520px; }
.chart-note { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .8rem .7rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; }
.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-pill { display: inline-block; padding: .25rem .5rem; border-radius: 999px; background: #e5f0e9; color: var(--brand-dark); font-size: .78rem; font-weight: 800; }
.status-pill.provisional { background: #fff0d4; color: #815b14; }
.source-cards { margin: 1.5rem 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.source-cards article { padding: 1.2rem; border: 1px solid var(--line); border-radius: 14px; background: #fafbf8; }
.source-cards p, .prose p { color: var(--muted); line-height: 1.65; }
.source-metadata { margin: 1rem 0 0; color: var(--muted); font-size: .82rem; }
.source-metadata div { margin-top: .35rem; display: flex; justify-content: space-between; gap: .8rem; }
.source-metadata dt { font-weight: 750; }
.source-metadata dd { margin: 0; text-align: right; }
.download-callout { margin: 1.5rem 0; padding: 1.3rem; display: flex; align-items: center; gap: 1rem; background: #eaf1ec; border-radius: 14px; }
.download-callout h2, .download-callout p { margin: 0; }
.download-callout p { margin-top: .3rem; color: var(--muted); }
.content-page { margin-top: 2rem; }
.content-page > h1 { font-size: clamp(2.3rem, 5vw, 4rem); }
.trend-page { margin: .7rem 0 2rem; }
.trend-heading { padding: .45rem 0 .25rem; display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.trend-heading h1 { margin: 0; font: 700 clamp(2.3rem, 4vw, 3rem)/1 Georgia, serif; letter-spacing: -.025em; white-space: nowrap; }
.trend-heading p:not(.eyebrow) { margin: .65rem 0 0; color: var(--muted); }
.trend-search { min-width: min(100%, 500px); }
.trend-search-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; }
.trend-search-field label { display: block; margin-bottom: .45rem; font-weight: 750; }
.trend-search-field input { width: 100%; min-width: 0; }
.trend-search-actions { margin-top: .65rem; display: flex; align-items: center; justify-content: flex-end; gap: .8rem; }
.trend-search-actions button { min-height: 42px; padding: .55rem .85rem; color: white; background: var(--brand); border: 0; border-radius: 9px; font: 750 1rem/1 system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.trend-search-actions button:hover { background: var(--brand-dark); }
.trend-panel { padding-bottom: 1.25rem; }
.trend-chart-scroll { width: 100%; overflow-x: auto; }
.trend-chart-wrap { position: relative; min-width: 1040px; height: 580px; }
.trend-data { margin: -1rem 0 2rem; padding: 1rem 1.25rem; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.trend-data summary { color: var(--brand-dark); font-weight: 750; cursor: pointer; }
.trend-data[open] summary { margin-bottom: 1rem; }
.ranked-page { margin: 1.5rem 0 2rem; }
.ranked-heading { padding: 1.25rem 0 .35rem; display: flex; align-items: end; justify-content: space-between; gap: 2rem; }
.ranked-heading h1 { margin: 0; font: 700 clamp(2.3rem, 5vw, 4rem)/1 Georgia, serif; letter-spacing: -.025em; }
.ranked-heading p:not(.eyebrow) { max-width: 700px; margin: .65rem 0 0; color: var(--muted); line-height: 1.5; }
.ranked-controls { display: flex; align-items: end; gap: .7rem; }
.ranked-controls label { display: block; margin-bottom: .45rem; font-weight: 750; }
.ranked-panel { padding-bottom: 1.25rem; }
.ranked-chart-scroll { width: 100%; overflow-x: auto; }
.ranked-chart-wrap { position: relative; min-width: 1040px; height: 610px; }
.ranked-data { margin-top: -1rem; }
.ranked-highlight-row { background: #faeee9; }
.ranked-highlight-row td:nth-child(2), .ranked-highlight-row td:nth-child(3) { color: #8f3f2e; font-weight: 750; }
.form-error { min-height: 1.2em; margin: .6rem 0 0; color: #9b3d2e; font-weight: 700; }
.prose { max-width: 850px; }
.prose h2 { margin-top: 1.7rem; }
code { font-size: .82rem; }
.site-footer { padding: 2rem max(1.2rem, calc((100% - 1240px) / 2)); display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); border-top: 1px solid var(--line); }

@media (max-width: 850px) {
  .hero { grid-template-columns: 1fr; align-items: start; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .source-cards { grid-template-columns: 1fr; }
  .chart-wrap { height: 430px; }
  .trend-heading, .ranked-heading { align-items: stretch; flex-direction: column; gap: 1rem; }
}

@media (max-width: 580px) {
  .site-header { align-items: flex-start; flex-direction: column; }
  nav { gap: .8rem 1rem; }
  main { width: min(calc(100% - 1.2rem), 1240px); }
  .hero { margin-top: .7rem; border-radius: 16px; }
  .toolbar, .download-callout, .section-heading, .site-footer { align-items: stretch; flex-direction: column; }
  .toolbar select, .button { width: 100%; margin-left: 0; }
  .playback-controls { justify-content: center; }
  .playback-controls button { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr; }
  .section-heading p { text-align: left; }
  .chart-wrap { height: 520px; }
  .trend-search-fields { grid-template-columns: 1fr; }
  .trend-search-actions { align-items: stretch; flex-direction: column; }
  .trend-search-actions button { width: 100%; min-width: 0; }
  .trend-heading h1 { white-space: normal; }
  .trend-chart-wrap { height: 500px; }
  .ranked-controls { align-items: stretch; flex-direction: column; }
  .ranked-controls select { width: 100%; }
  .ranked-chart-wrap { height: 540px; }
  th, td { padding: .65rem .55rem; }
}
