:root {
  color-scheme: light;
  --ink: #1d252b;
  --ink-strong: #111820;
  --muted: #707a78;
  --muted-strong: #505b58;
  --paper: #f7f8f5;
  --surface: #ffffff;
  --surface-soft: #fbfbf8;
  --line: #e1e5df;
  --line-strong: #c8d0c8;
  --accent: #0f766e;
  --accent-deep: #134e4a;
  --accent-soft: #e6f3f1;
  --brand-coral: #e24a33;
  --brand-amber: #e6a93f;
  --brand-navy: #172b36;
  --warning-soft: #fff7ed;
  --blue: #1d4e89;
  --green: #15803d;
  --purple: #5b4c9a;
  --red: #b42318;
  --orange: #c2410c;
  --shadow: 0 1px 2px rgba(17, 24, 32, 0.04), 0 14px 40px rgba(17, 24, 32, 0.035);
  --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  --font-editorial: "Iowan Old Style", "Apple Garamond", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.site-header {
  position: relative;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-coral) 0 28%, var(--brand-amber) 28% 54%, var(--brand-navy) 54% 78%, var(--accent) 78% 100%);
}

.masthead {
  display: block;
  padding: 38px 0 34px;
}

.brand-bar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 38px;
}

.brand-lockup {
  display: inline-flex;
  gap: 11px;
  align-items: center;
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 760;
  text-decoration: none;
}

.brand-lockup img {
  width: 31px;
  height: 31px;
  border-radius: 0;
  object-fit: contain;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.contact-links a {
  display: inline-flex;
  min-height: 31px;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 680;
  text-decoration: none;
}

.contact-links a:hover {
  border-color: var(--accent);
  color: var(--accent-deep);
}

.section-kicker,
.panel-label {
  margin: 0;
  color: var(--accent-deep);
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  font-family: var(--font-editorial);
  letter-spacing: 0;
  color: var(--ink-strong);
}

h1 {
  max-width: 920px;
  margin: 6px 0 0;
  font-size: clamp(38px, 5.2vw, 68px);
  font-weight: 700;
  line-height: 0.98;
}

h2 {
  margin: 8px 0 8px;
  font-size: 25px;
  font-weight: 700;
  line-height: 1.18;
}

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.trust-badges span {
  display: inline-flex;
  min-height: 27px;
  align-items: center;
  border: 1px solid #c8ddd9;
  border-radius: 999px;
  background: #f4faf8;
  color: var(--accent-deep);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 720;
}

.section-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 248, 245, 0.9);
  backdrop-filter: blur(12px);
}

.nav-inner {
  display: flex;
  gap: 4px;
  min-height: 46px;
  align-items: center;
}

.nav-inner a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  border-radius: 8px;
  color: var(--muted-strong);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 680;
  text-decoration: none;
}

.nav-inner a:hover {
  background: #ffffff;
  color: var(--accent-deep);
}

.overview-section {
  padding: 20px 0;
}

.filter-panel,
.chart-panel,
.analysis-panel,
.rankings-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.methodology-card {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.section-note,
#chartSubtitle,
#heatmapNote,
.selected-state-note,
.filter-header p {
  color: var(--muted);
}

.filter-panel {
  position: relative;
  overflow: hidden;
  padding: 22px;
}

.filter-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--brand-coral), var(--brand-amber), var(--brand-navy), var(--accent));
}

.filter-header,
.chart-header {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  justify-content: space-between;
}

.filter-header h2 {
  font-family: var(--font-ui);
  margin-top: 0;
  font-size: 24px;
  font-weight: 760;
}

.filter-header p,
.section-note,
#chartSubtitle,
#heatmapNote,
.selected-state-note {
  margin: 0;
  line-height: 1.5;
}

.download-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--accent-deep);
  border-radius: 8px;
  background: var(--brand-navy);
  color: #ffffff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 740;
  text-decoration: none;
}

.button-secondary {
  border-color: var(--line);
  background: var(--surface-soft);
  color: var(--ink);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(210px, 1fr) minmax(150px, 0.85fr) minmax(250px, 1.15fr);
  gap: 14px;
  align-items: start;
  margin-top: 18px;
}

.control {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.control span,
.segmented legend,
.category-filter-header span {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 720;
}

.control small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
}

select:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.24);
  outline-offset: 2px;
}

.range-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.segmented {
  min-width: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
}

.segmented legend {
  margin-bottom: 7px;
}

.segmented label {
  display: grid;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted-strong);
  padding: 0 12px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label:has(input:checked) {
  border-color: #a9cbc6;
  background: #f4faf8;
  color: var(--accent-deep);
}

.category-filter,
.offense-filter {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #edf0eb;
}

.category-filter-header {
  display: grid;
  gap: 8px;
}

.category-filter-header button {
  width: fit-content;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 720;
  cursor: pointer;
}

.category-chips,
.offense-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.offense-chips {
  max-height: 190px;
  overflow: auto;
  border: 1px solid #edf0eb;
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 10px;
}

.filter-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.category-chips label,
.offense-chips label {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--muted-strong);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 680;
  cursor: pointer;
}

.category-chips label:has(input:checked),
.offense-chips label:has(input:checked) {
  border-color: #a9cbc6;
  background: #f4faf8;
  color: var(--accent-deep);
}

.category-chips label:has(input[value="Anti-Asian"]:checked) {
  border-color: rgba(29, 78, 137, 0.28);
  background: rgba(29, 78, 137, 0.06);
  color: #1d4e89;
}

.category-chips label:has(input[value="Anti-Hindu"]:checked) {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(15, 118, 110, 0.07);
  color: #0f766e;
}

.category-chips label:has(input[value="Anti-Sikh"]:checked) {
  border-color: rgba(217, 147, 30, 0.34);
  background: rgba(217, 147, 30, 0.10);
  color: #8f5c0a;
}

.category-chips label:has(input[value="Anti-Islamic (Muslim)"]:checked) {
  border-color: rgba(226, 74, 51, 0.30);
  background: rgba(226, 74, 51, 0.08);
  color: #b63a27;
}

.category-chips label:has(input[value="Anti-Arab"]:checked) {
  border-color: rgba(23, 43, 54, 0.28);
  background: rgba(23, 43, 54, 0.07);
  color: #172b36;
}

.category-chips input,
.offense-chips input {
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}

.chart-panel,
.visual-grid,
.rankings-section,

.preliminary-section {
  border-top: 1px solid var(--line);
  background: #fffdf8;
  padding: 34px 0 42px;
}

.preliminary-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.preliminary-copy h2 {
  font-size: 28px;
}

.preliminary-panel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 22px;
  border: 1px solid #eadfd3;
  border-radius: 8px;
  background: #ffffff;
  padding: 22px;
  box-shadow: 0 16px 40px rgba(23, 32, 42, 0.06);
}

.preliminary-stat {
  border-right: 1px solid #edf0eb;
  padding-right: 20px;
}

.preliminary-stat span {
  display: block;
  color: var(--brand-green);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preliminary-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1;
}

.preliminary-stat p,
.preliminary-copy p {
  color: var(--muted-strong);
}

.preliminary-panel h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

.methodology-section {
  margin-top: 22px;
}

.chart-panel {
  padding: 22px;
}

.chart-header {
  margin-bottom: 14px;
}

.chart-frame {
  min-height: 420px;
  overflow-x: auto;
  border: 1px solid #edf0eb;
  border-radius: 8px;
  background: var(--surface-soft);
}

.chart-frame svg {
  display: block;
  min-width: 760px;
  width: 100%;
  height: auto;
}

.axis-label,
.axis-title,
.legend-label,
.callout-label {
  fill: #65706c;
  font-size: 13px;
}

.callout-value {
  fill: var(--ink-strong);
  font-size: 13px;
  font-weight: 800;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-top: 12px;
}

.legend-item {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 680;
}

.legend-swatch {
  width: 18px;
  height: 4px;
  border-radius: 999px;
}

.legend-swatch.category-anti-asian,
.bar-fill.category-anti-asian {
  background: #1d4e89;
  fill: #1d4e89;
}

.legend-swatch.category-anti-hindu,
.bar-fill.category-anti-hindu {
  background: #0f766e;
  fill: #0f766e;
}

.legend-swatch.category-anti-sikh,
.bar-fill.category-anti-sikh {
  background: #d9931e;
  fill: #d9931e;
}

.legend-swatch.category-anti-islamic-muslim,
.bar-fill.category-anti-islamic-muslim {
  background: #e24a33;
  fill: #e24a33;
}

.legend-swatch.category-anti-arab,
.bar-fill.category-anti-arab {
  background: #172b36;
  fill: #172b36;
}

.legend-swatch.category-selected-categories {
  background: var(--accent);
}

.visual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.analysis-panel {
  padding: 22px;
}

.bar-panel {
  margin-top: 16px;
}

.bar-list {
  display: grid;
  gap: 14px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(155px, 210px) minmax(0, 1fr) 92px;
  gap: 12px;
  align-items: center;
}

.bar-label,
.bar-value {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 720;
}

.bar-value {
  text-align: right;
}

.bar-track {
  display: block;
  height: 11px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef1ec;
}

.bar-svg {
  display: block;
  width: 100%;
  height: 11px;
}

.bar-bg {
  fill: #eef1ec;
}

.bar-fill {
  fill: #334155;
}

.bar-percent {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid #edf0eb;
  border-radius: 8px;
  background: var(--surface-soft);
}

table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf0eb;
  text-align: left;
}

th {
  background: #f6f7f3;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

td {
  color: var(--muted-strong);
  font-size: 14px;
}

td:last-child,
th:last-child {
  text-align: right;
}

tr:last-child td {
  border-bottom: 0;
}

.rankings-section {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
  padding: 34px 0;
}

.rankings-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.rankings-copy {
  position: sticky;
  top: 74px;
}

.rankings-copy h2 {
  font-size: 28px;
}

.rankings-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.ranking-list {
  display: grid;
  gap: 8px;
}

.ranking-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 90px;
  gap: 12px;
  align-items: center;
  border: 1px solid #edf0eb;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
}

.ranking-row.is-selected {
  border-color: #a9cbc6;
  background: #f4faf8;
}

.ranking-rank {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.ranking-state {
  display: grid;
  gap: 2px;
}

.ranking-state strong {
  color: var(--ink-strong);
  font-size: 14px;
  font-weight: 720;
}

.ranking-state span {
  color: var(--muted);
  font-size: 12px;
}

.ranking-value {
  color: var(--ink-strong);
  font-size: 16px;
  font-weight: 760;
  text-align: right;
}

.heatmap-panel {
  border-top: 1px solid #edf0eb;
  padding-top: 18px;
}

.heatmap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 8px;
}

.heatmap-cell {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  border: 1px solid rgba(23, 32, 42, 0.08);
  border-radius: 8px;
  padding: 8px;
  color: #111820;
}

.heat-level-0 {
  background: rgba(226, 74, 51, 0.08);
}

.heat-level-1 {
  background: rgba(226, 74, 51, 0.16);
}

.heat-level-2 {
  background: rgba(226, 74, 51, 0.24);
}

.heat-level-3 {
  background: rgba(226, 74, 51, 0.32);
}

.heat-level-4 {
  background: rgba(226, 74, 51, 0.42);
}

.heat-level-5 {
  background: rgba(226, 74, 51, 0.52);
}

.heat-level-6 {
  background: rgba(226, 74, 51, 0.62);
}

.heat-level-7 {
  background: rgba(226, 74, 51, 0.72);
}

.heat-level-8 {
  background: rgba(226, 74, 51, 0.82);
}

.heatmap-cell.is-selected {
  border: 2px solid var(--brand-coral);
  box-shadow: 0 0 0 3px rgba(226, 74, 51, 0.13);
}

.heatmap-cell strong,
.heatmap-cell span {
  display: block;
}

.heatmap-cell strong {
  font-size: 14px;
}

.heatmap-cell span {
  color: #3e4948;
  font-size: 12px;
}


.preliminary-section {
  border-top: 1px solid var(--line);
  background: #fffdf8;
  padding: 34px 0 42px;
}

.preliminary-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.preliminary-copy h2 {
  font-size: 28px;
}

.preliminary-panel {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 22px;
  border: 1px solid #eadfd3;
  border-radius: 8px;
  background: #ffffff;
  padding: 22px;
  box-shadow: 0 16px 40px rgba(23, 32, 42, 0.06);
}

.preliminary-stat {
  border-right: 1px solid #edf0eb;
  padding-right: 20px;
}

.preliminary-stat span {
  display: block;
  color: var(--brand-green);
  font-size: 12px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.preliminary-stat strong {
  display: block;
  margin-top: 8px;
  color: var(--ink-strong);
  font-family: var(--font-display);
  font-size: 42px;
  line-height: 1;
}

.preliminary-stat p,
.preliminary-copy p {
  color: var(--muted-strong);
}

.preliminary-panel h3 {
  margin-bottom: 12px;
  font-size: 20px;
}

.methodology-section {
  padding: 24px 0 2px;
}

.methodology-card {
  padding: 24px 0 20px;
}

.methodology-intro p {
  max-width: 980px;
  font-size: 16px;
}

.methodology-card p,
.source-links {
  color: var(--muted-strong);
  line-height: 1.58;
}

.definition-panel {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid #edf1f4;
}

.definition-heading p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.definition-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
  margin: 0;
}

.definition-list div {
  min-width: 0;
}

.definition-list dt {
  color: var(--ink-strong);
  font-size: 13px;
  font-weight: 760;
}

.definition-list dd {
  margin: 4px 0 0;
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.48;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.source-links a {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent-deep);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 720;
  text-decoration: none;
}

.source-links a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.loading,
.empty-visual,
.error {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.error {
  color: var(--red);
  padding: 18px;
}

@media (max-width: 1040px) {
  .masthead,
  .rankings-grid,
  .preliminary-grid,
  .definition-panel,
  .visual-grid {
    grid-template-columns: 1fr;
  }

  .rankings-copy {
    position: static;
  }

  .preliminary-panel {
    grid-template-columns: 1fr;
  }

  .preliminary-stat {
    border-right: 0;
    border-bottom: 1px solid #edf0eb;
    padding-right: 0;
    padding-bottom: 16px;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .shell {
    width: min(100% - 24px, 1180px);
  }

  .masthead {
    padding: 28px 0 24px;
  }

  .brand-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 26px;
  }

  .contact-links {
    gap: 12px;
    justify-content: flex-start;
  }

  .contact-links a {
    min-height: auto;
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 12px;
  }

  .contact-links a:first-child {
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  h1 {
    font-size: 38px;
    line-height: 1.02;
  }

  .filter-panel,
  .chart-panel,
  .analysis-panel,
  .rankings-panel {
    padding: 16px;
  }

  .chart-frame {
    min-height: 340px;
  }

  .chart-frame svg {
    min-width: 660px;
  }

  .section-nav {
    position: static;
  }

  .nav-inner {
    overflow-x: auto;
  }

  .toolbar,
  .definition-list,
  .category-filter,
  .offense-filter {
    grid-template-columns: 1fr;
  }

  .filter-header,
  .chart-header {
    display: grid;
  }

  .download-actions {
    justify-content: stretch;
  }

  .button {
    flex: 1 1 140px;
  }

  .segmented {
    grid-auto-flow: row;
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-value {
    text-align: left;
  }

  .ranking-row {
    grid-template-columns: 34px minmax(0, 1fr) 70px;
  }
}
