/* OSCOPE DATA: estilos del sitio.
   Los colores están definidos como variables al inicio: cambia uno y cambia en todo el sitio. */

:root {
  color-scheme: light;
  --paper: #ffffff;
  --panel: #f3f5f8;
  --ink: #0e1726;
  --ink-2: #445063;
  --muted: #687386;
  --hair: #e1e5eb;
  --axis: #c3c9d2;
  --scope: #2342e8; /* azul de marca: resalta el estado elegido */
  --context: #c6cdd6; /* gris de los demás estados */
  --pos: #2a78d6;
  --neg: #d9524f;

  /* Escala secuencial (mapas): de menor a mayor */
  --seq-0: #86b6ef;
  --seq-1: #5598e7;
  --seq-2: #2a78d6;
  --seq-3: #1c5cab;
  --seq-4: #0d366b;
  --seq-t-0: #0e1726;
  --seq-t-1: #0e1726;
  --seq-t-2: #ffffff;
  --seq-t-3: #ffffff;
  --seq-t-4: #ffffff;

  /* Escala divergente (cambios): rojo baja, azul sube */
  --div-n3: #9e2b2b;
  --div-n2: #d9524f;
  --div-n1: #ec8f8c;
  --div-p1: #86b6ef;
  --div-p2: #2a78d6;
  --div-p3: #0d366b;
  --div-t-n3: #ffffff;
  --div-t-n2: #ffffff;
  --div-t-n1: #0e1726;
  --div-t-p1: #0e1726;
  --div-t-p2: #ffffff;
  --div-t-p3: #ffffff;

  /* Grupos raciales y étnicos (pestaña Race del mapa de portada) */
  --race-white: #2a78d6;
  --race-black: #1baf7a;
  --race-asian: #4a3aa7;
  --race-other: #8b94a2;
  --race-hispanic: #eb6834;
  --race-t-white: #ffffff;
  --race-t-black: #0e1726;
  --race-t-asian: #ffffff;
  --race-t-other: #0e1726;
  --race-t-hispanic: #0e1726;

  --wrap: 1180px;
  --gutter: 16px;
  --font: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    color-scheme: dark;
    --paper: #14171c;
    --panel: #1b1f26;
    --ink: #eef1f5;
    --ink-2: #b9c1cd;
    --muted: #8f98a6;
    --hair: #2a2f38;
    --axis: #3b414b;
    --scope: #7088ff;
    --context: #3d434d;
    --pos: #3a7fd8;
    --neg: #e66767;
    --seq-0: #1c4a85;
    --seq-1: #2a6cc0;
    --seq-2: #4a8fe6;
    --seq-3: #86b6ef;
    --seq-4: #cde2fb;
    --seq-t-0: #ffffff;
    --seq-t-1: #ffffff;
    --seq-t-2: #ffffff;
    --seq-t-3: #14171c;
    --seq-t-4: #14171c;
    --div-n3: #f2a3a1;
    --div-n2: #c94c4b;
    --div-n1: #8a3030;
    --div-p1: #1c4a85;
    --div-p2: #3a7fd8;
    --div-p3: #9ec5f4;
    --div-t-n3: #14171c;
    --div-t-n2: #ffffff;
    --div-t-n1: #ffffff;
    --div-t-p1: #ffffff;
    --div-t-p2: #ffffff;
    --div-t-p3: #14171c;
    --race-white: #3987e5;
    --race-black: #199e70;
    --race-asian: #b45fc4;
    --race-other: #6f7887;
    --race-hispanic: #d95926;
    --race-t-white: #14171c;
    --race-t-black: #14171c;
    --race-t-asian: #14171c;
    --race-t-other: #ffffff;
    --race-t-hispanic: #14171c;
  }
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #14171c;
  --panel: #1b1f26;
  --ink: #eef1f5;
  --ink-2: #b9c1cd;
  --muted: #8f98a6;
  --hair: #2a2f38;
  --axis: #3b414b;
  --scope: #7088ff;
  --context: #3d434d;
  --pos: #3a7fd8;
  --neg: #e66767;
  --seq-0: #1c4a85;
  --seq-1: #2a6cc0;
  --seq-2: #4a8fe6;
  --seq-3: #86b6ef;
  --seq-4: #cde2fb;
  --seq-t-0: #ffffff;
  --seq-t-1: #ffffff;
  --seq-t-2: #ffffff;
  --seq-t-3: #14171c;
  --seq-t-4: #14171c;
  --div-n3: #f2a3a1;
  --div-n2: #c94c4b;
  --div-n1: #8a3030;
  --div-p1: #1c4a85;
  --div-p2: #3a7fd8;
  --div-p3: #9ec5f4;
  --div-t-n3: #14171c;
  --div-t-n2: #ffffff;
  --div-t-n1: #ffffff;
  --div-t-p1: #ffffff;
  --div-t-p2: #ffffff;
  --div-t-p3: #14171c;
  --race-white: #3987e5;
  --race-black: #199e70;
  --race-asian: #b45fc4;
  --race-other: #6f7887;
  --race-hispanic: #d95926;
  --race-t-white: #14171c;
  --race-t-black: #14171c;
  --race-t-asian: #14171c;
  --race-t-other: #ffffff;
  --race-t-hispanic: #14171c;
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  font-stretch: 100%;
  overflow-x: hidden;
}
img,
svg {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
a:hover {
  color: var(--scope);
}
:focus-visible {
  outline: 2px solid var(--scope);
  outline-offset: 2px;
  border-radius: 2px;
}
h1,
h2,
h3 {
  margin: 0;
  line-height: 1.1;
}
h2 {
  font-size: 1.6rem;
  font-weight: 760;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}
h3 {
  font-size: 1.05rem;
  font-weight: 650;
}
p {
  margin: 0;
}
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
@media (min-width: 720px) {
  :root {
    --gutter: 32px;
  }
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  z-index: 20;
}
.skip:focus {
  left: 8px;
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- Logo ---------- */
.logo-mark .lm-body,
.chart-brand-mark .lm-body {
  fill: var(--ink);
}
.logo-mark .lm-ring,
.chart-brand-mark .lm-ring {
  fill: none;
  stroke: var(--paper);
  stroke-width: 1.8;
}
.logo-mark .lm-glint,
.chart-brand-mark .lm-glint {
  fill: var(--paper);
}

/* ---------- Encabezado ---------- */
.site-header {
  border-bottom: 1px solid var(--hair);
  background: var(--paper);
}
.header-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    'brand search'
    'nav nav';
  align-items: center;
  column-gap: 16px;
  padding-top: 12px;
}
.brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover {
  color: var(--ink);
}
.brand .logo-mark {
  width: 30px;
  height: 30px;
}
.brand-name {
  font-weight: 850;
  font-stretch: 125%;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}
.brand-thin {
  font-weight: 380;
}
.nav {
  grid-area: nav;
  overflow-x: auto;
}
.nav ul {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 10px 0 12px;
}
.nav a {
  text-decoration: none;
  font-weight: 560;
  white-space: nowrap;
  padding: 4px 0;
}
.nav a[aria-current='page'] {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 8px;
}
.search-compact {
  grid-area: search;
  justify-self: end;
  width: min(100%, 240px);
}
@media (min-width: 860px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: 'brand nav search';
    padding-top: 0;
    min-height: 68px;
  }
  .nav {
    justify-self: center;
  }
  .nav ul {
    padding: 0;
    gap: 32px;
  }
}

/* ---------- Buscador ---------- */
.search {
  position: relative;
}
.search input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--axis);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 0.95rem;
}
.search input::placeholder {
  color: var(--muted);
}
.search input:focus-visible {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--scope) 35%, transparent);
}
.search-hero input {
  border: 2px solid var(--ink);
  font-size: 1.15rem;
  padding: 16px 24px;
}
.search-list {
  position: absolute;
  z-index: 10;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--axis);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(14, 23, 38, 0.14);
}
.search-list li {
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.search-list li span {
  color: var(--muted);
}
.search-list li[aria-selected='true'] {
  background: var(--panel);
}
.search-list .search-empty {
  color: var(--muted);
  cursor: default;
}

/* ---------- Tipografía de páginas ---------- */
.display {
  font-size: clamp(2.5rem, 6.2vw, 4.6rem);
  font-weight: 820;
  font-stretch: 125%;
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.lead {
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 62ch;
  margin-top: 18px;
  text-wrap: pretty;
}
.crumbs {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 14px;
}
.page-head {
  padding-top: 48px;
  padding-bottom: 32px;
}
@media (min-width: 720px) {
  .page-head {
    padding-top: 72px;
  }
}

/* ---------- Secciones ---------- */
.section {
  margin-top: 56px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
  margin-bottom: 24px;
}
.section-head {
  flex-wrap: wrap;
}
.section-head a {
  font-weight: 560;
}

/* ---------- Portada ---------- */
.hero {
  display: grid;
  gap: 40px;
  padding-top: 48px;
}
.hero > * {
  min-width: 0;
}
.hero-text .lead {
  margin-bottom: 28px;
}
.hero-hint {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}
@media (min-width: 980px) {
  .hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: start;
    padding-top: 80px;
    gap: 56px;
  }
  .hero-text {
    padding-top: 24px;
  }
}
.map-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 6px;
  margin-bottom: 16px;
  scrollbar-width: thin;
}
@media (min-width: 980px) {
  .map-tabs {
    flex-wrap: wrap;
    overflow: visible;
  }
}
.map-tabs button {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 560;
  color: var(--ink);
  background: transparent;
  border: 1.5px solid var(--axis);
  border-radius: 999px;
  padding: 6px 14px;
  white-space: nowrap;
  cursor: pointer;
}
.map-tabs button:hover {
  border-color: var(--ink);
}
.map-tabs button[aria-selected='true'],
.map-tabs button[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.map-caption {
  font-size: 0.95rem;
  color: var(--ink-2);
  margin-bottom: 12px;
}
.map-caption strong {
  color: var(--ink);
}
.map-more {
  margin-top: 12px;
  font-size: 0.95rem;
  font-weight: 560;
}

/* Segunda capa del mapa: los condados de un estado */
.drill {
  animation: drill-in 0.22s ease-out;
}
@keyframes drill-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.drill-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-bottom: 14px;
}
.drill-back {
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--panel);
  border: 1.5px solid var(--axis);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.drill-back:hover {
  border-color: var(--ink);
}
.drill-profile {
  font-size: 0.95rem;
  font-weight: 560;
}
.drill-title {
  margin-bottom: 6px;
  font-size: 1.5rem;
  font-weight: 760;
  font-stretch: 112%;
  letter-spacing: -0.01em;
}
/* Pestaña Race: botones para elegir qué colorea el mapa */
.race-views {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -4px 0 16px;
}
.race-views[hidden] {
  display: none;
}
.race-views-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-right: 2px;
}
.race-views button {
  font: inherit;
  font-size: 0.82rem;
  font-weight: 560;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--axis);
  border-radius: 999px;
  padding: 3px 11px;
  cursor: pointer;
}
.race-views button:hover {
  border-color: var(--ink);
  color: var(--ink);
}
.race-views button[aria-pressed='true'] {
  color: var(--ink);
  background: var(--panel);
  border-color: var(--ink);
}
.race-map .data-table {
  margin-top: 14px;
}
.cty.race-white { fill: var(--race-white); }
.cty.race-black { fill: var(--race-black); }
.cty.race-asian { fill: var(--race-asian); }
.cty.race-other { fill: var(--race-other); }
.cty.race-hispanic { fill: var(--race-hispanic); }
.drill-title:focus {
  outline: none;
}
.drill-map svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(60vh, 520px);
  margin: 0 auto;
  overflow: visible;
}
.cty {
  stroke: var(--paper);
  stroke-width: 0.75px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.cty.has-link {
  cursor: pointer;
}
.cty-hi {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2px;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}
.cty.seq-0 { fill: var(--seq-0); }
.cty.seq-1 { fill: var(--seq-1); }
.cty.seq-2 { fill: var(--seq-2); }
.cty.seq-3 { fill: var(--seq-3); }
.cty.seq-4 { fill: var(--seq-4); }
.cty.div-n3 { fill: var(--div-n3); }
.cty.div-n2 { fill: var(--div-n2); }
.cty.div-n1 { fill: var(--div-n1); }
.cty.div-p1 { fill: var(--div-p1); }
.cty.div-p2 { fill: var(--div-p2); }
.cty.div-p3 { fill: var(--div-p3); }
.cty.nodata { fill: var(--hair); }
.swatch.nodata {
  background: var(--hair);
  box-shadow: inset 0 0 0 1px var(--axis);
}
.drill-note {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--muted);
}
.drill-note a {
  color: var(--ink);
  font-weight: 560;
  white-space: nowrap;
}
.hero-map[aria-busy='true'] .tile-link {
  cursor: progress;
}

/* Historias */
.story-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px 40px;
}
@media (min-width: 760px) {
  .story-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
.story-title {
  display: block;
  font-size: 1.35rem;
  font-weight: 760;
  font-stretch: 110%;
  line-height: 1.15;
  text-decoration: none;
  text-wrap: balance;
}
.story-title:hover {
  text-decoration: underline;
}
.story-dek {
  margin-top: 10px;
  color: var(--ink-2);
}
.story-meta {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

/* Temas */
.topic-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 28px 32px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
@media (min-width: 1040px) {
  .topic-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
.topic-name {
  font-size: 1.5rem;
  font-weight: 820;
  font-stretch: 125%;
  text-decoration: none;
}
.topic-name:hover {
  text-decoration: underline;
}
.topic-grid p {
  margin-top: 8px;
  color: var(--ink-2);
}
.topic-grid .topic-inds {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Índice de estados */
.state-index {
  list-style: none;
  margin: 0;
  padding: 0;
  columns: 2;
  column-gap: 24px;
}
.state-index li {
  padding: 3px 0;
  break-inside: avoid;
}
.state-index a {
  text-decoration: none;
}
.state-index a:hover {
  text-decoration: underline;
}
@media (min-width: 640px) {
  .state-index {
    columns: 3;
  }
}
@media (min-width: 960px) {
  .state-index {
    columns: 5;
  }
}

/* ---------- Perfiles ---------- */
.page-head-state {
  display: grid;
  gap: 24px;
  align-items: end;
}
.locator {
  width: 150px;
}
@media (min-width: 860px) {
  .page-head-state {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 48px;
  }
  .locator {
    width: 220px;
  }
}
.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 28px 24px;
  margin: 8px 0 0;
}
@media (min-width: 860px) {
  .stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
.stat {
  border-top: 2px solid var(--ink);
  padding-top: 12px;
}
.stat dt {
  font-size: 0.95rem;
  color: var(--ink-2);
  font-weight: 520;
}
.stat dd {
  margin: 0;
}
.stat-value {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
  font-weight: 800;
  font-stretch: 112%;
  line-height: 1.1;
  margin-top: 6px !important;
}
.stat-note {
  margin-top: 6px !important;
  font-size: 0.9rem;
  color: var(--ink-2);
}
.topic-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 40px;
  font-weight: 560;
}
.ind-list {
  display: grid;
}
.ind-row {
  display: grid;
  gap: 16px 48px;
  padding: 22px 0;
  border-top: 1px solid var(--hair);
}
.ind-row:first-child {
  border-top: 0;
  padding-top: 0;
}
@media (min-width: 860px) {
  .ind-row {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: center;
  }
}
.ind-value {
  font-size: 2rem;
  font-weight: 780;
  font-stretch: 112%;
  line-height: 1.15;
  margin-top: 4px;
}
.ind-unit {
  font-size: 1rem;
  font-weight: 420;
  font-stretch: 100%;
  color: var(--muted);
}
.ind-compare {
  margin-top: 6px;
}
.ind-explain {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--muted);
}
.strip-key {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 28px;
  font-size: 0.88rem;
  color: var(--ink-2);
}
.strip-key > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.key-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--context);
}
.key-hi {
  position: relative;
  width: 11px;
  height: 11px;
  margin: 0 4px;
  border-radius: 50%;
  background: var(--scope);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink);
}
.key-us {
  width: 2px;
  height: 16px;
  background: var(--ink);
}
.source-note {
  font-size: 0.9rem;
  color: var(--muted);
  border-top: 1px solid var(--hair);
  padding-top: 16px;
}

/* ---------- Franja de puntos ---------- */
.strip {
  padding: 0 8px;
}
.strip-track {
  position: relative;
  height: 52px;
}
.strip-track::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 32px;
  height: 1px;
  background: var(--axis);
}
.dot {
  position: absolute;
  top: 32px;
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--context);
  box-shadow: 0 0 0 2px var(--paper);
}
.dot.is-active {
  background: var(--ink-2);
}
.dot-hi {
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  background: var(--scope);
  z-index: 2;
}
.dot-hi::after {
  content: '';
  position: absolute;
  inset: -6px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.strip-us {
  position: absolute;
  top: 22px;
  height: 20px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  z-index: 1;
}
.strip-us-label {
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.strip-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--muted);
  margin: 2px -8px 0;
}

/* ---------- Mapa de cuadrados ---------- */
.tilemap svg {
  width: 100%;
  height: auto;
  overflow: visible;
}
.tile {
  stroke: transparent;
  stroke-width: 0;
}
.tile-label {
  font-family: var(--font);
  font-size: 13px;
  font-weight: 650;
  text-anchor: middle;
  pointer-events: none;
}
.tile.seq-0 { fill: var(--seq-0); }
.tile.seq-1 { fill: var(--seq-1); }
.tile.seq-2 { fill: var(--seq-2); }
.tile.seq-3 { fill: var(--seq-3); }
.tile.seq-4 { fill: var(--seq-4); }
.tile-label.seq-0 { fill: var(--seq-t-0); }
.tile-label.seq-1 { fill: var(--seq-t-1); }
.tile-label.seq-2 { fill: var(--seq-t-2); }
.tile-label.seq-3 { fill: var(--seq-t-3); }
.tile-label.seq-4 { fill: var(--seq-t-4); }
.tile.div-n3 { fill: var(--div-n3); }
.tile.div-n2 { fill: var(--div-n2); }
.tile.div-n1 { fill: var(--div-n1); }
.tile.div-p1 { fill: var(--div-p1); }
.tile.div-p2 { fill: var(--div-p2); }
.tile.div-p3 { fill: var(--div-p3); }
.tile-label.div-n3 { fill: var(--div-t-n3); }
.tile-label.div-n2 { fill: var(--div-t-n2); }
.tile-label.div-n1 { fill: var(--div-t-n1); }
.tile-label.div-p1 { fill: var(--div-t-p1); }
.tile-label.div-p2 { fill: var(--div-t-p2); }
.tile-label.div-p3 { fill: var(--div-t-p3); }
.tile-link {
  cursor: pointer;
  outline: none;
}
.tile-link:hover .tile,
.tile-link:focus-visible .tile {
  stroke: var(--ink);
  stroke-width: 2.5px;
}
.scope-ring {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5px;
  pointer-events: none;
}
.tilemap-small .tile {
  fill: var(--context);
}
.tilemap-small .tile-label {
  display: none;
}
.tilemap-small .scope-ring {
  fill: var(--scope);
  stroke: var(--ink);
  stroke-width: 3px;
}
.tilemap-small .tile-link {
  cursor: default;
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex: none;
}
.swatch.seq-0 { background: var(--seq-0); }
.swatch.seq-1 { background: var(--seq-1); }
.swatch.seq-2 { background: var(--seq-2); }
.swatch.seq-3 { background: var(--seq-3); }
.swatch.seq-4 { background: var(--seq-4); }
.swatch.div-n3 { background: var(--div-n3); }
.swatch.div-n2 { background: var(--div-n2); }
.swatch.div-n1 { background: var(--div-n1); }
.swatch.div-p1 { background: var(--div-p1); }
.swatch.div-p2 { background: var(--div-p2); }
.swatch.div-p3 { background: var(--div-p3); }

/* ---------- Barras ---------- */
.bar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bar-row {
  display: grid;
  grid-template-columns: 7.2rem minmax(0, 1fr) 4.6rem;
  align-items: center;
  column-gap: 10px;
  height: 22px;
  font-size: 0.85rem;
}
@media (min-width: 640px) {
  .bar-row {
    grid-template-columns: 9.5rem minmax(0, 1fr) 5rem;
  }
}
.bar-name {
  text-decoration: none;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar-row.is-hi .bar-name {
  color: var(--ink);
  font-weight: 700;
}
.bar-track {
  position: relative;
  height: 12px;
}
.bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 12px;
  background: var(--context);
  border-radius: 0 4px 4px 0;
}
.bar-hi {
  background: var(--scope);
}
.bar-list[style*='--us'] .bar-track::after {
  content: '';
  position: absolute;
  left: var(--us);
  top: -5px;
  bottom: -5px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
}
.bar-value {
  text-align: right;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.bar-row.is-hi .bar-value {
  font-weight: 700;
}
.bar-value.is-quiet {
  color: var(--muted);
  opacity: 0;
}
.bar-row:hover .bar-value.is-quiet,
.bar-row:focus-within .bar-value.is-quiet {
  opacity: 1;
}
.bar-row:hover .bar:not(.bar-hi):not(.bar-pos):not(.bar-neg) {
  background: var(--ink-2);
}
.bars-us-key {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--ink-2);
}
.us-line-key {
  width: 2px;
  height: 16px;
  background: var(--ink);
}
.bars-diverging .bar-list .bar-track::after {
  content: '';
  position: absolute;
  left: var(--zero);
  top: -5px;
  bottom: -5px;
  width: 1px;
  background: var(--ink);
}
.bar-pos {
  background: var(--pos);
  border-radius: 0 4px 4px 0;
}
.bar-neg {
  background: var(--neg);
  border-radius: 4px 0 0 4px;
}
.bar-row:hover .bar-pos,
.bar-row:hover .bar-neg {
  filter: brightness(0.85);
}
.legend-inline {
  margin-top: 12px;
}

/* ---------- Marco de gráficos ---------- */
.chart {
  margin: 40px 0;
}
.chart-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 18px;
}
.chart-title {
  font-size: 1.25rem;
  font-weight: 760;
  font-stretch: 110%;
  line-height: 1.2;
}
.chart-sub {
  font-size: 0.92rem;
  color: var(--ink-2);
}
.chart-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
  font-size: 0.8rem;
  color: var(--muted);
}
.chart-brand {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-stretch: 112%;
  color: var(--ink);
}
.chart-brand-mark {
  width: 16px;
  height: 16px;
}
.data-table {
  margin-top: 12px;
  font-size: 0.9rem;
}
.data-table summary {
  cursor: pointer;
  font-weight: 560;
  color: var(--ink-2);
  width: fit-content;
}
.data-table table,
.method-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}
.data-table th,
.data-table td,
.method-table th,
.method-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--hair);
  font-weight: 400;
  vertical-align: top;
}
.data-table thead th,
.method-table thead th {
  font-weight: 650;
  color: var(--ink-2);
  border-bottom: 1.5px solid var(--axis);
}
.data-table .num {
  text-align: right;
}
.data-table .us-row th,
.data-table .us-row td {
  font-weight: 700;
}
.method-table th[scope='row'] {
  font-weight: 650;
}

/* ---------- Páginas de temas ---------- */
.topic-ind {
  display: grid;
  gap: 8px 56px;
  border-top: 2px solid var(--ink);
  padding-top: 16px;
}
.topic-ind-text h2 {
  margin-bottom: 10px;
}
.topic-ind-text > p {
  color: var(--ink-2);
  max-width: 48ch;
}
.topic-ind .chart {
  margin-top: 8px;
}
@media (min-width: 980px) {
  .topic-ind {
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  }
  .topic-ind .chart {
    margin-top: 0;
  }
}
.extremes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.extremes h3 {
  font-size: 0.95rem;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.short-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.95rem;
}
.short-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--hair);
}
.short-list span {
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
}

/* ---------- Historias y texto largo ---------- */
.story-head {
  max-width: calc(760px + 2 * var(--gutter));
  padding-top: 48px;
}
.story-head .story-meta {
  margin-top: 18px;
}
@media (min-width: 720px) {
  .story-head {
    padding-top: 72px;
  }
}
.story-body,
.prose {
  max-width: calc(760px + 2 * var(--gutter));
  margin-left: auto;
  margin-right: auto;
}
.story-head {
  margin-left: auto;
  margin-right: auto;
}
.story-body {
  margin-top: 32px;
}
.story-body > p,
.prose p,
.prose li {
  font-size: 1.1rem;
  line-height: 1.65;
}
.story-body > p + p,
.prose p + p {
  margin-top: 1em;
}
.story-body > p {
  margin-top: 1em;
}
.story-body h2,
.prose h2 {
  margin: 1.8em 0 0.4em;
  font-size: 1.45rem;
}
.prose ul {
  padding-left: 1.2em;
}
.prose li + li {
  margin-top: 0.4em;
}
.prose .method-table {
  font-size: 0.92rem;
}

/* ---------- Pie de página ---------- */
.site-footer {
  margin-top: 96px;
  background: var(--panel);
  padding: 48px 0 40px;
}
.footer-inner {
  display: grid;
  gap: 24px;
}
.footer-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  max-width: 40ch;
}
.footer-brand .logo-mark {
  width: 36px;
  height: 36px;
  flex: none;
}
.footer-brand .lm-ring,
.footer-brand .lm-glint {
  stroke: var(--panel);
}
.footer-brand .lm-glint {
  fill: var(--panel);
}
.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-weight: 560;
}
.footer-links a {
  text-decoration: none;
}
.footer-legal {
  font-size: 0.85rem;
  color: var(--muted);
}
@media (min-width: 860px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .footer-legal {
    grid-column: 1 / -1;
  }
}

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  background: var(--ink);
  color: var(--paper);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.35;
  display: grid;
  max-width: 240px;
}
.tooltip[hidden] {
  display: none;
}
.tt-val {
  font-size: 1rem;
  font-weight: 750;
}
.tt-note {
  opacity: 0.75;
}
.tt-note:empty {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
}

/* ---------- Grupos raciales y étnicos ---------- */
.tile.race-white { fill: var(--race-white); }
.tile.race-black { fill: var(--race-black); }
.tile.race-asian { fill: var(--race-asian); }
.tile.race-other { fill: var(--race-other); }
.tile.race-hispanic { fill: var(--race-hispanic); }
.tile-label.race-white { fill: var(--race-t-white); }
.tile-label.race-black { fill: var(--race-t-black); }
.tile-label.race-asian { fill: var(--race-t-asian); }
.tile-label.race-other { fill: var(--race-t-other); }
.tile-label.race-hispanic { fill: var(--race-t-hispanic); }
.swatch.race-white,
.pc-bar.race-white { background: var(--race-white); }
.swatch.race-black,
.pc-bar.race-black { background: var(--race-black); }
.swatch.race-asian,
.pc-bar.race-asian { background: var(--race-asian); }
.swatch.race-other,
.pc-bar.race-other { background: var(--race-other); }
.swatch.race-hispanic,
.pc-bar.race-hispanic { background: var(--race-hispanic); }

.race-layout {
  display: grid;
  gap: 32px 56px;
}
.race-layout > * {
  min-width: 0;
}
@media (min-width: 980px) {
  .race-layout {
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
  }
}
.race-intro {
  font-size: 1.15rem;
  color: var(--ink-2);
  max-width: 46ch;
}
.race-facts {
  list-style: none;
  margin: 20px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  max-width: 46ch;
}
.race-facts li {
  padding-left: 14px;
  border-left: 2px solid var(--ink);
}
.race-chart .chart {
  margin-top: 0;
}
.map-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 70ch;
}
.table-scroll {
  overflow-x: auto;
}

/* Tarjeta con barras: popup del mapa y resumen de EE. UU. */
.popcard,
.us-card {
  display: block;
  width: 250px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--axis);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 0.85rem;
  line-height: 1.35;
}
.popcard {
  position: fixed;
  z-index: 30;
  pointer-events: none;
  box-shadow: 0 12px 32px rgba(14, 23, 38, 0.18);
}
.popcard[hidden] {
  display: none;
}
.us-card {
  width: 100%;
  max-width: 320px;
  margin-top: 28px;
  border-color: var(--hair);
  background: var(--panel);
}
.pc-title {
  display: block;
  font-size: 1rem;
  font-weight: 760;
}
.pc-sub {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.pc-head {
  display: block;
  margin: 12px 0 6px;
  font-weight: 600;
  color: var(--ink-2);
}
.pc-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 5px;
}
.pc-rows li {
  display: grid;
  grid-template-columns: 4.4rem minmax(0, 1fr) 3.1rem;
  align-items: center;
  gap: 8px;
}
.pc-rows li.is-main {
  font-weight: 750;
}
.pc-track {
  position: relative;
  height: 11px;
  border-left: 1px solid var(--axis);
}
.pc-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  min-width: 2px;
  border-radius: 0 3px 3px 0;
}
.pc-val {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Tarjeta de un condado (mapa de condados) */
.popcard.is-wide {
  width: 292px;
}
.pc-stats {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
}
.pc-stats li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 12px;
  color: var(--ink-2);
}
.pc-stats li.is-main {
  color: var(--ink);
  font-weight: 750;
}
.pc-rank {
  grid-column: 1 / -1;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}
.pc-foot {
  display: block;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--hair);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Barras de grupos en los perfiles */
.race-compare {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.race-compare li {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr) 3.4rem;
  grid-template-areas: 'label track val' '. usval .';
  align-items: center;
  column-gap: 12px;
  font-size: 0.92rem;
}
.race-compare li.is-main {
  font-weight: 700;
}
.rc-label { grid-area: label; }
.rc-track {
  grid-area: track;
  position: relative;
  height: 14px;
  border-left: 1px solid var(--axis);
}
.rc-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  min-width: 2px;
  border-radius: 0 4px 4px 0;
}
.rc-bar.race-white { background: var(--race-white); }
.rc-bar.race-black { background: var(--race-black); }
.rc-bar.race-asian { background: var(--race-asian); }
.rc-bar.race-other { background: var(--race-other); }
.rc-bar.race-hispanic { background: var(--race-hispanic); }
.rc-us {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--paper);
}
.rc-val {
  grid-area: val;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.rc-usval {
  grid-area: usval;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rc-key {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--ink-2);
}

/* ---------- Condados: franja de rango ---------- */
.range {
  padding: 0 8px;
}
.range-track {
  position: relative;
  height: 64px;
}
.range-line {
  position: absolute;
  top: 31px;
  height: 2px;
  background: var(--axis);
}
.range-band {
  position: absolute;
  top: 25px;
  height: 14px;
  min-width: 2px;
  border-radius: 3px;
  background: var(--context);
}
.range-ref {
  position: absolute;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
  height: 14px;
}
.range-ref.is-above {
  top: 15px;
}
.range-ref.is-below {
  top: 35px;
}
.range-ref-label {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  font-weight: 650;
  white-space: nowrap;
  color: var(--ink);
}
.range-ref.is-above .range-ref-label {
  bottom: calc(100% + 1px);
}
.range-ref.is-below .range-ref-label {
  top: calc(100% + 1px);
}
.range-dot {
  position: absolute;
  top: 32px;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--scope);
  box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--ink);
  z-index: 2;
}
.range-ends {
  position: relative;
  height: 1.3em;
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--muted);
}
.range-min,
.range-max {
  position: absolute;
  top: 0;
  white-space: nowrap;
}
.range-scale {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-style: italic;
}
.key-band {
  width: 22px;
  height: 10px;
  border-radius: 3px;
  background: var(--context);
}

/* ---------- Condados: tabla en el perfil del estado ---------- */
.counties-intro {
  max-width: 70ch;
  color: var(--ink-2);
  font-size: 1.05rem;
}
.table-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin: 22px 0 14px;
}
.table-tools label {
  font-weight: 600;
}
.table-tools input {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--axis);
  border-radius: 999px;
  padding: 7px 14px;
  width: min(100%, 260px);
}
.table-tools input:focus-visible {
  border-color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--scope) 35%, transparent);
}
.table-count {
  font-size: 0.9rem;
  color: var(--muted);
}
.table-scroll {
  overflow-x: auto;
  max-height: 640px;
  overflow-y: auto;
  border-top: 1.5px solid var(--axis);
  border-bottom: 1px solid var(--hair);
}
.county-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.county-table th,
.county-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--hair);
  text-align: left;
  font-weight: 400;
  white-space: nowrap;
}
.county-table .num {
  text-align: right;
}
.county-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--paper);
  border-bottom: 1.5px solid var(--axis);
  padding: 0;
}
.county-table thead button {
  font: inherit;
  font-weight: 650;
  font-size: 0.85rem;
  color: var(--ink-2);
  background: none;
  border: 0;
  width: 100%;
  text-align: inherit;
  padding: 10px;
  cursor: pointer;
  white-space: normal;
  min-width: 7.5em;
}
.county-table thead button:hover {
  color: var(--ink);
}
.county-table thead th[aria-sort] button {
  color: var(--ink);
}
.county-table thead th[aria-sort='descending'] button::after {
  content: ' ↓';
}
.county-table thead th[aria-sort='ascending'] button::after {
  content: ' ↑';
}
.county-table tbody th {
  position: sticky;
  left: 0;
  background: var(--paper);
  z-index: 1;
}
.county-table tbody th a {
  text-decoration: none;
  font-weight: 560;
}
.county-table tbody th a:hover {
  text-decoration: underline;
}
.county-table tbody tr:hover th,
.county-table tbody tr:hover td {
  background: var(--panel);
}
.table-note {
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
  max-width: 80ch;
}

/* ---------- Condados: de tamaño parecido ---------- */
.similar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0 32px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.similar-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--hair);
}
.similar-list a {
  font-weight: 560;
  text-decoration: none;
}
.similar-list a:hover {
  text-decoration: underline;
}
.similar-list span {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
