:root {
  --green: #607456;
  --cream: #EEE0CC;
  --terracotta: #ba6a4c;
  --dark-red: #7b2525;
  --missing: #a7a7a7;
  --ink: #211d19;
  --muted-ink: #675d52;
  --paper: #f7eddf;
  --line: rgba(62, 51, 41, 0.24);
  --serif: "Merriweather", Georgia, "Times New Roman", serif;
  --sans: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
a { color: var(--dark-red); text-underline-offset: 3px; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid #1c4fa0; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 1000; top: 12px; left: 12px; transform: translateY(-160%); background: #fff; color: #111; padding: 10px 14px; }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: relative; z-index: 30; background: #E8D6B9; border-bottom: 1px solid var(--line); }
.header-inner { width: min(100% - 24px, 1360px); min-height: 52px; margin-inline: auto; display: grid; grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr); align-items: center; gap: 18px; padding: 3px 0; }
.tracker-intro, .tracker-shell, .comparison-section, .tracker-about, .related-stories { width: min(100% - 40px, 1240px); margin-inline: auto; }
.brand-link { justify-self: start; display: inline-flex; align-items: center; color: var(--dark-red); text-decoration: none; }
.brand-logo { width: 190px; height: 34px; display: block; background-image: var(--brand-logo-image, url("../assets/bs-logo-tracker-v2.png?v=20260821-5")); background-repeat: no-repeat; background-size: var(--brand-logo-size-desktop, 269px 135px); background-position: var(--brand-logo-position-desktop, -40px -50px); mix-blend-mode: multiply; }
.desktop-site-nav { justify-self: center; display: flex; align-items: stretch; align-self: stretch; gap: 8px; }
.desktop-site-nav > a, .nav-more summary { display: flex; align-items: center; min-height: 40px; padding: 12px; color: #313038; font-family: Arial, Helvetica, sans-serif; font-size: 13px; font-weight: 700; line-height: 1; text-decoration: none; white-space: nowrap; }
.desktop-site-nav > a:hover, .nav-more summary:hover, .nav-more[open] summary { background: rgba(123,37,37,0.08); color: var(--dark-red); }
.nav-more { position: relative; display: flex; align-items: stretch; }
.nav-more summary { height: 100%; margin: 0; cursor: pointer; list-style: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary span { margin-left: 5px; font-size: 0.6rem; letter-spacing: 1px; }
.nav-more-menu { position: absolute; z-index: 50; top: calc(100% - 1px); right: 0; width: 420px; max-height: min(70vh, 520px); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 3px 0; overflow-y: auto; background: #282b32; box-shadow: 0 7px 18px rgba(0,0,0,0.2); }
.nav-more-menu a { margin: 0 8px; padding: 5px; border-bottom: 1px solid #505050; color: white; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: 700; line-height: 18px; text-decoration: none; }
.nav-more-menu a:hover { background: #3a3e47; color: #fff; }
.mobile-menu-toggle, .mobile-site-nav { display: none; }
h1 { margin: 0; font: 700 28px/1.25 var(--serif); letter-spacing: -0.025em; }
.tracker-intro { padding: 14px 0 10px; border-bottom: 1px solid var(--line); }
.deck { max-width: none; margin: 4px 0 0; font: 400 17px/1.45 var(--serif); color: #3d352e; }

main { min-width: 0; }
.tracker-shell { padding: 10px 0 28px; }
.section-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.section-kicker h2 { margin: 0; font: 600 clamp(1.35rem, 2vw, 1.75rem)/1.15 var(--serif); letter-spacing: -0.025em; }
.explore-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 25px; align-items: start; }
.metric-rail { min-width: 0; }
.explore-stage { min-width: 0; }
.pill-toggle { display: inline-flex; align-items: center; padding: 3px; border: 1px solid rgba(33,29,25,0.42); border-radius: 999px; background: rgba(255,255,255,0.25); }
.pill-toggle button { min-height: 34px; padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--ink); font-size: 0.78rem; font-weight: 800; white-space: nowrap; }
.pill-toggle button[aria-pressed="true"] { background: var(--dark-red); color: white; box-shadow: 0 1px 4px rgba(33,29,25,0.18); }
.mode-toggle { width: 100%; margin-bottom: 10px; }
.mode-toggle button { flex: 1; min-width: 0; padding-inline: 7px; }
.metric-nav { display: flex; flex-direction: column; gap: 7px; overflow: visible; padding: 0; }
.metric-nav::-webkit-scrollbar { display: none; }
.metric-item { position: relative; }
.metric-button { width: 100%; min-height: 32px; border: 1px solid rgba(33,29,25,0.42); border-radius: 3px; padding: 6px 10px; background: transparent; color: var(--ink); font-size: 0.75rem; font-weight: 700; line-height: 1.2; text-align: left; }
.metric-button:hover { border-color: var(--dark-red); }
.metric-button[aria-pressed="true"] { background: var(--dark-red); border-color: var(--dark-red); color: white; }
@media (min-width: 1181px) {
  .metric-button { min-height: 44px; padding: 9px 12px; font-size: 1rem; line-height: 1.25; }
}
.state-select-wrap { min-width: 0; }
.state-select-control { position: relative; }
.state-select-control input { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid rgba(33,29,25,0.52); border-radius: 999px; background: rgba(255,255,255,0.28); color: var(--ink); font-size: 0.82rem; font-weight: 700; }
.metric-information { border-bottom: 1px solid var(--line); padding: 3px 0 9px; }
.metric-heading-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 9px; }
.metric-heading-row h3 {
  margin: 0;
  max-width: 820px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--dark-red);
  font: 700 1.1rem/1.3 var(--sans);
}
.direction-badge { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 0; padding: 1px 0 1px 8px; background: transparent; border: 0; border-left: 3px solid var(--green); border-radius: 0; color: #44543d; font-size: 0.72rem; font-weight: 700; line-height: 1.3; }
.metric-explainer { margin-top: 8px; }
.metric-explainer summary { display: inline-flex; align-items: center; gap: 9px; min-height: 34px; padding: 5px 11px; border: 1px solid var(--ink); border-radius: 3px; background: transparent; color: var(--ink); cursor: pointer; font-size: 0.77rem; font-weight: 800; list-style: none; }
.metric-explainer summary::-webkit-details-marker { display: none; }
.metric-explainer summary::after { content: "+"; font-size: 1rem; line-height: 1; }
.metric-explainer[open] summary { background: var(--ink); color: white; }
.metric-explainer[open] summary::after { content: "−"; }
.metric-explainer-content { padding-top: 3px; }
.metric-definition { max-width: 1020px; margin: 11px 0 13px; font-family: var(--serif); font-size: 1rem; }
.formula-box { max-width: 1120px; border: 1px solid var(--line); background: rgba(255,255,255,0.28); }
.formula-row, .denominator-row { display: grid; grid-template-columns: 230px minmax(0, 1fr); align-items: stretch; }
.formula-row > span, .denominator-heading { padding: 13px 15px; border-right: 1px solid var(--line); color: var(--dark-red); font-weight: 400; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.formula-row > strong { padding: 12px 16px; font-family: var(--serif); font-size: 1.02rem; }
.denominator-row { border-top: 1px solid var(--line); }
.denominator-heading { line-height: 1.45; }
.denominator-heading strong { font-weight: 800; }
.denominator-row p { margin: 0; padding: 12px 16px; }
.metric-extra-note { max-width: 950px; padding-left: 14px; border-left: 3px solid var(--terracotta); color: var(--muted-ink); }

.control-label { color: var(--muted-ink); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 800; }
.year-readout { display: flex; flex-direction: column; min-width: 112px; }
#selected-year-label { font-family: var(--serif); font-size: 0.92rem; white-space: nowrap; }
.timeline-control { display: grid; grid-template-columns: 34px minmax(0, 1fr) 34px; align-items: center; gap: 5px; min-width: 0; }
.timeline-control > button { width: 34px; height: 34px; border: 1px solid var(--ink); border-radius: 50%; background: transparent; font-size: 1rem; line-height: 1; }
.timeline { display: flex; min-width: 0; gap: 5px; overflow-x: auto; padding: 2px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.timeline::-webkit-scrollbar { display: none; }
.year-button { flex: 0 0 auto; min-width: 84px; min-height: 40px; padding: 3px 8px; scroll-snap-align: center; border: 1px solid var(--line); background: rgba(255,255,255,0.2); color: var(--ink); }
.year-button span, .year-button small { display: block; }
.year-button span { font-size: 0.82rem; font-weight: 800; line-height: 1.2; }
.year-button small { min-height: 13px; color: inherit; font-size: 0.58rem; line-height: 1.15; text-transform: uppercase; }
.year-button[aria-pressed="true"] { border-color: var(--dark-red); background: var(--dark-red); color: white; }
.timeline-empty { margin: 8px 0; color: var(--muted-ink); }

.visual-toolbar { display: grid; grid-template-columns: auto auto minmax(260px, 1fr) auto; align-items: center; gap: 10px; margin: 10px 0 12px; padding: 8px; border: 1px solid var(--line); background: rgba(255,255,255,0.22); }
.visual-toolbar.state-toolbar { grid-template-columns: auto minmax(260px, 1fr); }
.view-toggle button { min-width: 70px; }
.sort-control { display: flex; align-items: center; gap: 9px; color: var(--muted-ink); font-size: 0.82rem; font-weight: 700; }
.sort-control select { min-height: 36px; padding: 5px 30px 5px 8px; border: 1px solid var(--ink); background: var(--cream); color: var(--ink); }

.main-visual-grid { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(290px, 0.85fr); gap: clamp(24px, 4vw, 50px); align-items: start; }
.visual-panel { min-width: 0; }
.map-container { min-height: 470px; display: grid; place-items: center; }
.map-container .india-map { opacity: 0; }
.map-container.is-ready .india-map { opacity: 1; }
.map-container svg { width: 100%; height: min(66vw, 650px); max-height: 650px; }
.map-container [id^="IN"] { cursor: pointer; }
.map-container [id^="IN"]:focus { outline: none; filter: drop-shadow(0 0 2px #1c4fa0); }
.map-container [id^="IN"].is-selected path,
.map-container [id^="IN"].is-selected polygon,
.map-container path[id^="IN"].is-selected,
.map-container polygon[id^="IN"].is-selected { stroke: #101010 !important; stroke-width: 2.8px !important; }
.asset-empty { width: min(100%, 620px); border: 1px dashed var(--dark-red); padding: 36px; text-align: center; background: rgba(255,255,255,0.25); }
.asset-empty strong { font-family: var(--serif); font-size: 1.35rem; }
.asset-empty p { margin: 8px auto 0; max-width: 500px; }
.asset-empty code { font-size: 0.9em; }
.bar-chart { max-height: 780px; overflow-y: auto; }
.bar-chart svg { width: 100%; overflow: visible; }
.bar-label, .bar-value { font-family: var(--sans); font-size: 12px; fill: var(--ink); }
.bar-row { cursor: pointer; }
.bar-row:focus { outline: none; }
.bar-row:focus .bar-mark, .bar-row.is-selected .bar-mark { stroke: #101010; stroke-width: 2.5px; }
.bar-row.is-missing .bar-value { fill: #34302c; font-size: 10px; }
.bar-axis text, .comparison-axis text { font-family: var(--sans); fill: var(--muted-ink); font-size: 11px; }
.bar-axis path, .bar-axis line, .comparison-axis path, .comparison-axis line { stroke: rgba(33,29,25,0.35); }
.zero-line { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; }

.map-legend { margin-top: 18px; max-width: 620px; }
.legend-ramp { width: 100%; height: 13px; border: 1px solid rgba(33,29,25,0.42); }
.legend-labels { display: flex; justify-content: space-between; gap: 20px; margin-top: 6px; font-size: 0.75rem; font-weight: 700; }
.missing-key { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 0.75rem; color: var(--muted-ink); }
.missing-key i { width: 15px; height: 15px; background: var(--missing); border: 1px solid #777; }
.selected-state-action { margin-top: 15px; }
.selected-state-action button { min-height: 40px; padding: 8px 13px; border: 1px solid var(--dark-red); border-radius: 999px; background: transparent; color: var(--dark-red); font-size: 0.8rem; font-weight: 800; }
.selected-state-action button:hover { background: var(--dark-red); color: white; }

.state-mode-header { padding: 2px 0 8px; border-bottom: 1px solid var(--line); }
.state-mode-header h3 {
  margin: 0;
  font: 500 clamp(1.1rem, 1.55vw, 1.35rem)/1.15 var(--serif);
  letter-spacing: -0.015em;
}
.state-mode-header p { max-width: 760px; margin: 5px 0 0; font-family: var(--serif); font-size: 0.92rem; color: var(--muted-ink); }
.state-mode-content { min-width: 0; }
.state-map-container { width: min(100%, 650px); min-height: 450px; margin: 10px auto 0; display: grid; place-items: center; }
.state-map-container .india-map { opacity: 0; }
.state-map-container.is-ready .india-map { opacity: 1; }
.state-map-container svg { width: 100%; height: min(62vw, 600px); max-height: 600px; }
.state-map-container.has-selection { width: 210px; min-height: 130px; height: 150px; margin: 10px 0 14px; place-items: start; }
.state-map-container.has-selection svg { width: 100%; height: 150px; max-height: 150px; }
.state-map-container [id^="IN"] { cursor: pointer; }
.state-map-container [id^="IN"].is-selected path,
.state-map-container [id^="IN"].is-selected polygon,
.state-map-container path[id^="IN"].is-selected,
.state-map-container polygon[id^="IN"].is-selected { stroke: #211d19 !important; stroke-width: 1.8px !important; }
.state-profile-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.state-profile-card { min-width: 0; min-height: 300px; display: flex; flex-direction: column; padding: 15px; border: 1px solid var(--line); border-top: 5px solid var(--card-accent); background: rgba(255,255,255,0.28); }
.state-profile-card.is-missing { background: rgba(167,167,167,0.12); }
.profile-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profile-card-heading h4 { margin: 0; font: 600 1rem/1.2 var(--serif); }
.metric-info-button { flex: 0 0 auto; width: 27px; height: 27px; display: grid; place-items: center; padding: 0; border: 1px solid var(--muted-ink); border-radius: 50%; background: transparent; color: var(--muted-ink); font-family: var(--serif); font-weight: 800; }
.profile-card-value { margin: 21px 0 5px; font: 600 clamp(1.45rem, 2.1vw, 2rem)/1.08 var(--serif); color: var(--ink); }
.profile-card-value span { display: block; margin-top: 4px; font: 400 0.72rem/1.25 var(--sans); color: var(--muted-ink); }
.profile-card-rank { margin: 12px 0 0; font-weight: 800; }
.profile-card-median { margin: 2px 0 0; font-size: 0.82rem; color: var(--muted-ink); }
.profile-card-verdict { display: grid; gap: 2px; min-height: 52px; margin: 10px 0 12px; padding: 8px 10px; border-left: 3px solid var(--muted-ink); background: rgba(255,255,255,0.34); }
.profile-card-verdict strong { font: 600 0.82rem/1.25 var(--serif); }
.profile-card-verdict span { color: var(--muted-ink); font-size: 0.69rem; line-height: 1.35; }
.profile-card-verdict.is-healthier { border-left-color: var(--green); }
.profile-card-verdict.is-stretched { border-left-color: var(--terracotta); }
.profile-direction { align-self: flex-start; margin-top: auto; padding: 4px 7px; border: 1px solid var(--green); border-radius: 999px; background: rgba(96,116,86,0.12); color: #33402e; font-size: 0.66rem; font-weight: 800; }
.profile-compare, .profile-previous { align-self: flex-start; margin-top: 12px; padding: 0; border: 0; background: transparent; color: var(--dark-red); font-size: 0.75rem; font-weight: 800; text-align: left; text-decoration: underline; text-underline-offset: 3px; }
.profile-card-unavailable { margin: 24px 0 5px; color: #555; font: 600 1.05rem/1.3 var(--serif); }
.profile-previous-note { display: block; margin-top: 5px; color: var(--muted-ink); font-size: 0.68rem; }
.ranking-column { display: grid; gap: 22px; }
.ranking-card { border-top: 4px solid var(--green); background: rgba(255,255,255,0.26); }
.ranking-card-bottom { border-top-color: var(--dark-red); }
.ranking-heading { display: flex; align-items: start; justify-content: space-between; padding: 18px 16px 11px; }
.ranking-heading h3 { margin: 0; font: 600 1.55rem/1 var(--serif); }
.ranking-heading p { margin: 5px 0 0; color: var(--muted-ink); font-size: 0.76rem; }
.ranking-heading > span { font-size: 1.55rem; color: var(--green); }
.ranking-card-bottom .ranking-heading > span { color: var(--dark-red); }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; }
thead th { padding: 8px 12px; border-block: 1px solid var(--line); color: var(--muted-ink); font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.08em; }
tbody td, tbody th { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.84rem; }
tbody td:last-child { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tbody th button { padding: 0; border: 0; background: transparent; color: inherit; text-align: left; font-weight: 700; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
tbody th button:hover { text-decoration-color: currentColor; }
.rank-number { width: 42px; font-family: var(--serif); font-size: 1.04rem; }
.empty-cell { padding: 22px 12px; text-align: center !important; color: var(--muted-ink); }
.table-scroll { width: 100%; overflow-x: auto; }

.dynamic-footnotes { margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted-ink); font-size: 0.79rem; }
.dynamic-footnotes p { margin: 5px 0; }
.dynamic-footnotes sup { display: inline-block; width: 20px; color: var(--dark-red); font-weight: 800; }
.metric-download { display: flex; justify-content: flex-start; margin-top: 10px; }
.metric-download button { min-height: 0; padding: 2px 0; border: 0; border-bottom: 1px solid rgba(103,93,82,0.45); border-radius: 0; background: transparent; color: var(--muted-ink); font-size: 0.68rem; font-weight: 700; }
.metric-download button:hover { border-bottom-color: currentColor; color: var(--dark-red); }

@media (max-width: 1180px) {
  .explore-layout { grid-template-columns: 1fr; gap: 8px; }
  .mode-toggle { width: min(100%, 260px); }
  .metric-nav { flex-direction: row; gap: 8px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 3px 4px 8px; scroll-snap-type: x proximity; }
  .metric-item { flex: 0 0 auto; scroll-snap-align: start; }
  .metric-button { width: auto; min-height: 32px; border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
}

.comparison-section { padding: 30px 0 72px; border-top: 1px solid var(--line); }
.comparison-metric-context { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin: 24px 0 -17px; }
.comparison-metric-label { margin: 0; color: var(--muted-ink); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.04em; }
.comparison-direction { min-height: 28px; padding: 4px 8px; font-size: 0.68rem; }
.median-toggle { min-height: 28px; padding: 3px 9px; border: 1px solid rgba(33,29,25,0.42); border-radius: 999px; background: transparent; color: var(--muted-ink); font-size: 0.68rem; font-weight: 700; }
.median-toggle[aria-pressed="true"] { background: #59636e; border-color: #59636e; color: white; }
.comparison-intro { display: flex; align-items: start; justify-content: space-between; gap: 30px; }
.comparison-intro p { max-width: 740px; margin: 0; font-family: var(--serif); font-size: 1.08rem; }
#selection-count { flex: 0 0 auto; color: var(--muted-ink); font-size: 0.8rem; font-weight: 800; }
.state-picker { margin-top: 25px; }
.state-picker > label { display: block; margin-bottom: 7px; font-size: 0.77rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.search-row { display: flex; align-items: stretch; gap: 8px; }
.search-row input { width: min(100%, 480px); min-height: 46px; border: 1px solid var(--ink); background: rgba(255,255,255,0.3); color: var(--ink); padding: 10px 12px; }
.search-row button { min-height: 46px; padding: 9px 16px; border: 1px solid var(--dark-red); background: var(--dark-red); color: white; font-weight: 800; }
.search-row .button-quiet { border-color: var(--ink); background: transparent; color: var(--ink); }
.search-row button:disabled { opacity: 0.45; cursor: not-allowed; }
.selected-chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 18px; margin-top: 16px; }
.state-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 6px 8px 6px 12px; border: 1px solid var(--line); border-left: 5px solid var(--series-colour); background: rgba(255,255,255,0.25); font-size: 0.82rem; font-weight: 700; }
.state-chip button { display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(33,29,25,0.1); color: var(--ink); font-size: 1.1rem; }
.comparison-empty { margin: 30px 0 0; padding: 35px; border: 1px dashed var(--line); text-align: center; color: var(--muted-ink); }
.comparison-chart { margin-top: 28px; }
.comparison-chart svg { width: 100%; min-height: 330px; overflow: visible; }
.series-line { stroke-width: 2.5px; vector-effect: non-scaling-stroke; transition: opacity 140ms ease, stroke-width 140ms ease; }
.series-line.is-muted { opacity: 0.14; }
.series-line.is-active { stroke-width: 4px; }
.series-line:focus { outline: none; filter: drop-shadow(0 0 1px #111); }
.series-point { stroke: var(--cream); stroke-width: 1.5px; }
.series-point:focus { stroke: #111; stroke-width: 3px; outline: none; }
.yearly-median-line { stroke: #59636e; stroke-width: 1.5px; stroke-dasharray: 5 5; opacity: 0.82; vector-effect: non-scaling-stroke; }
.yearly-median-point { fill: var(--cream); stroke: #59636e; stroke-width: 1.8px; vector-effect: non-scaling-stroke; }
.yearly-median-point:focus { outline: none; stroke: #111; stroke-width: 3px; }
.yearly-median-label { fill: #59636e; font-family: var(--sans); font-size: 10px; font-weight: 700; }

.related-stories { padding: 34px 0 46px; }
.related-stories > h2 { margin: 0 0 20px; color: var(--dark-red); font-size: 0.82rem; line-height: 1.3; letter-spacing: 0.08em; }
.related-stories-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 26px; }
.story-card { min-width: 0; min-height: 150px; display: grid; grid-template-columns: minmax(190px, 0.78fr) minmax(0, 1.22fr); align-items: stretch; border-top: 1px solid var(--ink); background: rgba(255,255,255,0.2); color: var(--ink); text-decoration: none; }
.story-image { height: 150px; min-height: 0; overflow: hidden; background: var(--missing); }
.story-image img { width: 100%; height: 100%; min-height: 0; object-fit: cover; transition: transform 180ms ease; }
.story-card:hover .story-image img { transform: scale(1.025); }
.story-copy { min-width: 0; padding: 12px 14px; }
.story-section { margin: 0 0 6px; color: var(--dark-red); font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.07em; }
.story-card h3 { margin: 0; font: 600 0.96rem/1.35 var(--serif); }
.story-card h3 { color: var(--ink); }
.story-card:hover h3 { color: var(--dark-red); text-decoration: underline; }
.story-card time { display: block; margin-top: 10px; color: var(--muted-ink); font-size: 0.65rem; }

.bs-footer { background: #f7f8fc; color: #0d0d0d; border-top: 1px solid #dee2e6; }
.bs-footer-inner { width: min(100% - 40px, 1240px); margin-inline: auto; }
.bs-footer-brand { display: flex; justify-content: center; padding: 22px 0; border-bottom: 1px solid #dee2e6; }
.bs-footer-brand img { width: min(100%, 390px); height: auto; }
.bs-footer-group { border-bottom: 1px solid #ececec; padding: 9px 0 10px; }
.bs-footer-group h2 { margin: 0; padding: 0 10px 8px; font: 700 0.7rem/1.3 var(--serif); }
.bs-footer-links { display: flex; flex-wrap: wrap; align-items: center; }
.bs-footer-links a { margin: 5px 0; padding: 0 10px; border-right: 1px solid #777; color: #0d0d0d; font: 700 0.75rem/1.4 var(--serif); text-decoration: none; }
.bs-footer-links a:hover { color: var(--dark-red); text-decoration: underline; }
.bs-footer-links a:last-child { border-right: 0; }
.bs-footer-legal { padding-top: 12px; }
.bs-footer-bottom { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 15px 10px 22px; }
.bs-footer-bottom p { margin: 0; font-size: 0.7rem; }
.social-links { display: flex; flex-wrap: wrap; gap: 7px; }
.social-links a { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: #282b32; color: white; font-size: 0.58rem; font-weight: 800; text-decoration: none; }
.social-links a:hover { background: var(--dark-red); }

.tracker-about { padding: 26px 0 24px; border-top: 1px solid var(--line); }
.tracker-about > p { max-width: 1060px; margin: 0; font: 400 1rem/1.55 var(--serif); }
.tracker-about > p strong { font-weight: 700; }
.tracker-about .tracker-data-basis { margin-top: 8px; color: var(--muted-ink); font: 400 0.8rem/1.5 var(--sans); }
.tracker-about .tracker-data-basis a { color: var(--dark-red); }
.methodology { padding: 64px max(20px, calc((100vw - 1240px) / 2)) 74px; background: var(--dark-red); color: #fff8ed; }
.methodology-lead { display: grid; grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr); gap: 50px; margin: 38px 0 48px; padding: 30px 0; border-block: 1px solid rgba(255,255,255,0.35); }
.methodology-lead h3 { margin: 0; font: 600 clamp(1.35rem, 2vw, 1.75rem)/1.15 var(--serif); }
.methodology-lead p { margin: 0; font-family: var(--serif); font-size: 1.12rem; }
.method-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 42px; }
.method-column { min-width: 0; }
.method-grid details { border-top: 1px solid rgba(255,255,255,0.32); }
.method-grid summary { position: relative; cursor: pointer; min-height: 58px; padding: 17px 32px 17px 0; font-family: var(--serif); font-size: 1.08rem; font-weight: 700; list-style: none; }
.method-grid summary::-webkit-details-marker { display: none; }
.method-grid summary::after { content: "+"; position: absolute; right: 2px; top: 14px; font-family: var(--sans); font-size: 1.25rem; }
.method-grid details[open] summary::after { content: "−"; }
.method-grid details > p { margin: 0 0 23px; color: #f3e6d4; font-size: 0.9rem; }
.method-formulas { margin: 0 0 24px; padding: 12px 15px; border-left: 3px solid var(--terracotta); background: rgba(0,0,0,0.12); }
.method-formulas p { margin: 4px 0; font-size: 0.84rem; }
.methodology-source-note { margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.32); color: #f3e6d4; font-size: 0.76rem; }
.methodology-source-note p { max-width: 980px; margin: 4px 0; }
.methodology-source-note a { color: #fff8ed; }

.chart-tooltip { position: fixed; z-index: 100; display: grid; gap: 3px; max-width: 300px; padding: 12px 14px; background: #211d19; color: #fff; box-shadow: 0 7px 24px rgba(0,0,0,0.24); pointer-events: none; font-size: 0.78rem; line-height: 1.4; }
.chart-tooltip strong { font-family: var(--serif); font-size: 1rem; }
.chart-tooltip span { color: #dfd2c2; }
.chart-tooltip b { font-size: 1.15rem; }
.chart-tooltip small { color: #dfd2c2; }

@media (max-width: 900px) {
  .main-visual-grid { grid-template-columns: 1fr; }
  .ranking-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .map-container { min-height: 410px; }
  .map-container svg { height: min(82vw, 620px); }
  .state-profile-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .methodology-lead { grid-template-columns: 1fr; gap: 15px; }
}

@media (max-width: 800px) {
  .header-inner { display: grid; grid-template-columns: 36px minmax(0, 1fr) 36px; gap: 10px; }
  .desktop-site-nav { display: none; }
  .mobile-menu-toggle { justify-self: start; width: 36px; height: 36px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; padding: 0; border: 0; background: transparent; }
  .mobile-menu-toggle span { width: 22px; height: 2px; background: var(--ink); transition: transform 140ms ease, opacity 140ms ease; }
  .brand-link { justify-self: start; }
  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .mobile-menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .mobile-site-nav:not([hidden]) { width: min(100% - 24px, 760px); max-height: calc(100vh - 58px); margin: 0 auto 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 3px 0; overflow-y: auto; border-top: 0; background: #282b32; box-shadow: 0 7px 18px rgba(0,0,0,0.2); }
  .mobile-site-nav a { margin: 0 8px; padding: 5px; border-bottom: 1px solid #505050; color: #fff; font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: 700; line-height: 18px; text-decoration: none; }
  .mobile-site-nav a:hover, .mobile-site-nav a:focus-visible { background: #3a3e47; color: #fff; }
  .related-stories-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  .tracker-intro, .tracker-shell, .comparison-section, .tracker-about, .related-stories, .bs-footer-inner { width: min(100% - 28px, 1240px); }
  .header-inner { width: calc(100% - 20px); min-height: 48px; padding: 3px 0; }
  .brand-logo { width: 176px; height: 32px; background-size: var(--brand-logo-size-mobile, 249px 125px); background-position: var(--brand-logo-position-mobile, -37px -45px); }
  h1 { font-size: 22px; line-height: 1.25; }
  .tracker-intro { padding: 10px 0 8px; }
  .deck { margin-top: 3px; font-size: 17px; line-height: 1.45; }
  .tracker-shell { padding-block: 14px 24px; }
  .comparison-section { padding-block: 26px 48px; }
  .section-kicker { margin-bottom: 18px; }
  .metric-nav { margin-inline: -14px; padding-inline: 14px; }
  .mode-toggle { width: 100%; margin-bottom: 8px; }
  .state-select-wrap { margin-bottom: 5px; }
  .metric-button { min-height: 32px; padding: 6px 12px; }
  .metric-information { padding-top: 3px; }
  .metric-heading-row { display: flex; gap: 8px; }
  .direction-badge { margin-top: 0; }
  .metric-heading-row .direction-badge { padding-left: 0; border-left: 0; }
  .metric-definition { font-size: 1.02rem; }
  .formula-row, .denominator-row { grid-template-columns: 1fr; }
  .formula-row > span, .denominator-heading { border-right: 0; border-bottom: 1px solid var(--line); }
  .visual-toolbar { grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 7px 9px; padding: 7px; }
  .visual-toolbar.state-toolbar { grid-template-columns: minmax(0, 1fr); }
  .year-readout { grid-column: 2; grid-row: 1; min-width: 0; }
  .timeline-control { grid-column: 1 / -1; }
  .view-toggle { grid-column: 1; grid-row: 1; }
  .view-toggle button { flex: 1; min-width: 0; }
  .visual-toolbar.state-toolbar .year-readout { grid-column: 1; grid-row: 1; }
  .visual-toolbar.state-toolbar .timeline-control { grid-column: 1; grid-row: 2; }
  .sort-control { grid-column: 1 / -1; justify-content: space-between; }
  .sort-control select { flex: 1; }
  .map-container { min-height: 300px; }
  .map-container svg { height: min(110vw, 520px); }
  .state-map-container { min-height: 320px; }
  .state-map-container svg { height: min(110vw, 500px); }
  .state-map-container.has-selection { width: 160px; min-height: 110px; height: 120px; }
  .state-map-container.has-selection svg { height: 120px; max-height: 120px; }
  .state-profile-cards { grid-template-columns: 1fr; }
  .state-profile-card { min-height: 270px; }
  .asset-empty { padding: 26px 18px; }
  .ranking-column { grid-template-columns: 1fr; }
  .comparison-intro { display: block; }
  #selection-count { display: block; margin-top: 8px; }
  .search-row { display: grid; grid-template-columns: 1fr; }
  .search-row input { grid-column: 1 / -1; width: 100%; }
  .search-row button { width: 100%; }
  .comparison-empty { padding: 25px 16px; }
  .related-stories { padding-block: 28px 36px; }
  .story-card { min-height: 112px; grid-template-columns: minmax(108px, 0.72fr) minmax(0, 1.28fr); }
  .story-image { height: 112px; }
  .story-copy { padding: 9px 10px; }
  .story-card h3 { font-size: 0.82rem; }
  .bs-footer-brand { padding: 17px 0; }
  .bs-footer-brand img { width: min(100%, 300px); }
  .bs-footer-group { padding-inline: 0; }
  .bs-footer-links a { font-size: 0.68rem; padding-inline: 8px; }
  .bs-footer-bottom { align-items: flex-start; flex-direction: column; padding-inline: 8px; }
  .methodology { padding: 48px 14px 58px; }
  .method-grid { grid-template-columns: 1fr; }
  .methodology-lead { margin: 28px 0 38px; padding: 24px 0; }
  .chart-tooltip { position: fixed; inset: auto 12px 12px !important; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
