:root {
  --ink: #172019;
  --ink-soft: #3f4a42;
  --muted: #6f776f;
  --paper: #f3f0e8;
  --paper-deep: #e9e5da;
  --line: #c8c6bc;
  --support: #1e6d4d;
  --support-dark: #0a3e2c;
  --support-mid: #70a487;
  --support-pale: #e4eee6;
  --support-faint: #eef4ef;
  --opponent: #bd5923;
  --opponent-dark: #7a2e0d;
  --opponent-mid: #da9462;
  --opponent-pale: #f4e6da;
  --opponent-faint: #faf0e8;
  --side-pad: clamp(24px, 4.7vw, 78px);
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 62px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
summary {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 16px;
  top: 12px;
  transform: translateY(-150%);
  padding: 10px 14px;
  border-radius: 3px;
  background: var(--ink);
  color: white;
  font-size: 13px;
}

.skip-link:focus {
  transform: translateY(0);
}

.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(
      100deg,
      rgba(30, 109, 77, 0.075) 0%,
      rgba(30, 109, 77, 0.025) 38%,
      rgba(243, 240, 232, 0.78) 50%,
      rgba(189, 89, 35, 0.025) 62%,
      rgba(189, 89, 35, 0.075) 100%
    ),
    var(--paper);
}

.hero::after {
  display: none;
}

.section-marker::after {
  content: "";
  position: absolute;
  top: 34px;
  left: 50%;
  width: 72px;
  height: 4px;
  transform: translateX(-50%);
  border-radius: 10px;
  background: linear-gradient(90deg, var(--support), #8d806e 50%, var(--opponent));
  opacity: 0.55;
  pointer-events: none;
}

.hero-topline {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(24px, 4vw, 68px);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 1;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hero-topline p,
.eyebrow,
.section-marker > p:first-child,
.footer-kicker,
.side-label,
.panel-n,
.coverage,
.chart-heading > span,
.subsection-head > p,
.map-legend,
.data-note,
.total-number-wrap > span {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.hero-topline p {
  margin: 0;
  color: var(--muted);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.wordmark-mark {
  width: 22px;
  height: 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  border-radius: 50%;
  transform: rotate(-8deg);
}

.wordmark-mark i:first-child {
  background: var(--support);
}

.wordmark-mark i:last-child {
  background: var(--opponent);
}

.hero-copy {
  width: min(1240px, calc(100% - 48px));
  margin: auto;
  padding: clamp(62px, 8vh, 112px) 0 clamp(62px, 8vh, 100px);
  text-align: center;
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 28px;
  color: var(--muted);
}

h1,
.section-marker h2,
footer h2,
.letter-panel h3 {
  text-wrap: balance;
}

h1 {
  max-width: 1080px;
  margin: 0 auto;
  font-size: clamp(58px, 8.8vw, 134px);
  line-height: 0.86;
  letter-spacing: -0.075em;
  font-weight: 700;
}

h1 em {
  font-family: var(--serif);
  font-weight: 400;
  color: #596259;
}

.dek {
  max-width: 680px;
  margin: 36px auto 0;
  color: var(--ink-soft);
  font-size: clamp(16px, 1.5vw, 20px);
  line-height: 1.58;
  letter-spacing: -0.016em;
}

.filter-switch {
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 38px auto 0;
  padding: 12px 12px 12px 18px;
  border: 1px solid #acaea6;
  border-radius: 4px;
  background: rgba(243, 240, 232, 0.86);
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.top-filter {
  gap: 12px;
  margin: 0;
  padding: 0;
  border-color: transparent;
  background: transparent;
}

.top-filter:hover {
  border-color: transparent;
}

.filter-switch:hover {
  border-color: var(--ink);
}

.filter-switch:focus-within {
  outline: 3px solid rgba(23, 32, 25, 0.16);
  outline-offset: 3px;
}

.switch-copy {
  display: grid;
  gap: 2px;
}

.switch-copy strong {
  font-size: 13px;
  font-weight: 650;
}

.switch-copy small {
  color: var(--muted);
  font-size: 11px;
}

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

.switch-track {
  width: 48px;
  height: 28px;
  flex: 0 0 auto;
  padding: 3px;
  border-radius: 30px;
  background: #b8bab3;
  transition: background 180ms ease;
}

.switch-track i {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease;
}

.filter-switch input:checked + .switch-track {
  background: #2878d2;
}

.filter-switch input:checked + .switch-track i {
  transform: translateX(20px);
}

.hero-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
}

.hero-total {
  min-height: 195px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 34px var(--side-pad) 30px;
}

.hero-total h2 {
  margin: 12px 0 2px;
  font-size: clamp(28px, 3vw, 46px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.supporter-tone {
  color: var(--support-dark);
}

.opponent-tone {
  color: var(--opponent-dark);
}

.opponent-tone {
  flex-direction: row-reverse;
  border-left: 1px solid var(--line);
}

.opponent-tone .total-number-wrap {
  justify-items: start;
}

.side-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 700;
}

.side-label span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.total-number-wrap {
  display: grid;
  justify-items: end;
}

.total-number {
  display: block;
  font-size: clamp(56px, 6vw, 92px);
  line-height: 0.78;
  letter-spacing: -0.065em;
}

.total-number-wrap > span {
  margin-top: 15px;
}

.versus {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.noscript {
  margin: 0;
  padding: 12px 24px;
  background: #fff2b8;
  text-align: center;
  font-size: 13px;
}

.section-nav {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 3.2vw, 52px);
  min-height: 58px;
  padding: 0 24px;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(243, 240, 232, 0.94);
  backdrop-filter: blur(14px);
}

.section-nav a {
  flex: 0 0 auto;
  padding: 20px 0 17px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.01em;
  transition: color 140ms ease, border-color 140ms ease;
}

.section-nav a span {
  margin-right: 6px;
  color: #989b94;
  font-family: var(--mono);
  font-size: 9px;
}

.section-nav a:hover,
.section-nav a[aria-current="true"] {
  border-color: var(--ink);
  color: var(--ink);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  scroll-margin-top: 58px;
}

.section-marker {
  grid-column: 1 / -1;
  position: relative;
  z-index: 1;
  padding: 88px 24px 70px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(
      100deg,
      rgba(228, 238, 230, 0.96) 0%,
      rgba(228, 238, 230, 0.78) 42%,
      rgba(243, 240, 232, 0.97) 49%,
      rgba(243, 240, 232, 0.97) 51%,
      rgba(250, 240, 232, 0.78) 58%,
      rgba(250, 240, 232, 0.96) 100%
    ),
    var(--paper);
  text-align: center;
}

.section-marker > * {
  position: relative;
  z-index: 1;
}

.section-marker > p:first-child {
  margin: 0 0 20px;
  color: var(--muted);
}

.section-marker h2 {
  max-width: 860px;
  margin: 0 auto;
  font-family: var(--serif);
  font-size: clamp(38px, 5.2vw, 74px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.045em;
  color: #3e4941;
}

.section-marker > p:last-child {
  max-width: 620px;
  margin: 22px auto 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.side-panel {
  min-width: 0;
  padding: 52px var(--side-pad) 74px;
  border-bottom: 1px solid var(--line);
}

.supporter-panel {
  background: var(--support-pale);
  color: var(--support-dark);
}

.opponent-panel {
  border-left: 1px solid var(--line);
  background: var(--opponent-pale);
  color: var(--opponent-dark);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 26px;
  margin-bottom: 42px;
}

.panel-n,
.coverage {
  margin: 0;
  color: currentColor;
  opacity: 0.72;
}

.panel-n strong {
  font-size: 12px;
}

.letter-panel {
  min-height: 620px;
  display: flex;
  flex-direction: column;
}

.letter-panel h3 {
  max-width: 600px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(32px, 3.8vw, 54px);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.letter-panel blockquote {
  max-width: 650px;
  margin: 38px 0 48px;
  padding: 0 0 0 22px;
  border-left: 2px solid currentColor;
  font-family: var(--serif);
  font-size: clamp(18px, 1.7vw, 24px);
  font-style: italic;
  line-height: 1.5;
}

.letter-actions {
  display: grid;
  gap: 14px;
  margin-top: auto;
}

.letter-actions details,
.letter-actions > a {
  border-top: 1px solid color-mix(in srgb, currentColor 30%, transparent);
  border-bottom: 1px solid color-mix(in srgb, currentColor 30%, transparent);
}

.letter-actions > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

.letter-actions > a:hover span {
  transform: translate(2px, -2px);
}

.letter-actions > a span {
  transition: transform 140ms ease;
}

summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  cursor: pointer;
  list-style: none;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

summary::-webkit-details-marker {
  display: none;
}

summary i {
  width: 18px;
  height: 18px;
  position: relative;
}

summary i::before,
summary i::after {
  content: "";
  position: absolute;
  left: 3px;
  top: 8px;
  width: 12px;
  height: 1px;
  background: currentColor;
}

summary i::after {
  transform: rotate(90deg);
  transition: transform 160ms ease;
}

details[open] summary i::after {
  transform: rotate(0);
}

.letter-copy {
  height: 340px;
  margin: 0 0 18px;
  padding: 20px 22px;
  overflow: auto;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink-soft);
  font-family: var(--serif);
  font-size: 14px;
  line-height: 1.65;
}

.letter-copy p {
  margin: 0 0 1.15em;
}

.letter-copy h4 {
  margin: 1.8em 0 0.65em;
  color: currentColor;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.letter-copy h4:first-child {
  margin-top: 0;
}

.letter-copy a {
  font-weight: 650;
  text-decoration-line: underline;
  text-decoration-color: color-mix(in srgb, currentColor 58%, transparent);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}

.letter-copy a:hover,
.letter-copy a:focus-visible {
  color: var(--ink);
  text-decoration-color: currentColor;
}

.chart-section .side-panel {
  min-height: 720px;
}

.map-wrap {
  margin: -14px 0 24px;
}

.world-map {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.world-map .sphere {
  fill: rgba(255, 255, 255, 0.32);
  stroke: color-mix(in srgb, currentColor 22%, transparent);
  stroke-width: 0.8;
}

.world-map .country {
  stroke: rgba(255, 255, 255, 0.82);
  stroke-width: 0.65;
  transition: fill 180ms ease, stroke 120ms ease, opacity 120ms ease;
  vector-effect: non-scaling-stroke;
}

.world-map .country.has-data {
  cursor: pointer;
}

.world-map .country.has-data:hover,
.world-map .country.has-data:focus {
  stroke: var(--ink);
  stroke-width: 1.6;
  outline: none;
}

.map-legend {
  display: grid;
  grid-template-columns: auto minmax(90px, 180px) auto;
  align-items: center;
  justify-content: end;
  gap: 8px;
  margin-top: -8px;
  color: currentColor;
}

.map-legend .gradient {
  height: 7px;
  border-radius: 8px;
}

.subsection-head,
.chart-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid color-mix(in srgb, currentColor 24%, transparent);
}

.subsection-head h3,
.chart-heading h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.subsection-head p,
.chart-heading > span {
  margin: 0;
  opacity: 0.7;
}

.bar-chart {
  display: grid;
  gap: 14px;
  padding-top: 24px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 42%) minmax(60px, 1fr) max-content;
  align-items: center;
  gap: 12px;
  min-height: 24px;
}

.bar-label {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 1px;
  background: rgba(255, 255, 255, 0.55);
}

.bar-fill {
  display: block;
  height: 100%;
  width: 0;
  min-width: 0;
  background: currentColor;
  opacity: 0.84;
  transition: width 520ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.bar-value {
  min-width: 42px;
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.bar-value em {
  margin-left: 4px;
  opacity: 0.65;
  font-style: normal;
}

.affiliation-chart .bar-row {
  grid-template-columns: minmax(150px, 50%) minmax(40px, 1fr) 38px;
}

.affiliation-overview {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  margin: -8px 0 34px;
  padding-bottom: 26px;
  border-bottom: 1px solid color-mix(in srgb, currentColor 24%, transparent);
}

.affiliation-overview strong {
  font-size: clamp(42px, 4.4vw, 68px);
  line-height: 0.8;
  letter-spacing: -0.065em;
}

.affiliation-overview span {
  max-width: 160px;
  color: currentColor;
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.72;
}

.affiliation-coverage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-top: 30px;
  border-top: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  border-bottom: 1px solid color-mix(in srgb, currentColor 24%, transparent);
  background: rgba(255, 255, 255, 0.2);
}

.affiliation-coverage-metric {
  min-width: 0;
  padding: 22px 18px 20px 0;
}

.affiliation-coverage-metric + .affiliation-coverage-metric {
  padding-right: 0;
  padding-left: 24px;
  border-left: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.affiliation-coverage-metric strong {
  display: block;
  margin-bottom: 9px;
  font-size: clamp(34px, 3.6vw, 52px);
  line-height: 0.9;
  letter-spacing: -0.055em;
}

.affiliation-coverage-metric span {
  display: block;
  max-width: 220px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  opacity: 0.72;
}

.affiliation-share-statement {
  max-width: 220px;
  margin: 0;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  opacity: 0.72;
}

.affiliation-share-statement strong {
  margin: 8px 0;
  opacity: 1;
}

.affiliation-coverage-note {
  margin: 12px 0 0;
  color: currentColor;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.5;
  opacity: 0.58;
}

.all-affiliations {
  margin-top: 28px;
  border-top: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  border-bottom: 1px solid color-mix(in srgb, currentColor 28%, transparent);
}

.full-list {
  max-height: 430px;
  margin-bottom: 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
  background: rgba(255, 255, 255, 0.25);
}

.full-list-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) max-content;
  gap: 12px;
  align-items: baseline;
  padding: 11px 12px;
  border-bottom: 1px solid color-mix(in srgb, currentColor 13%, transparent);
}

.full-list-row:last-child {
  border-bottom: 0;
}

.full-list-row > span:first-child,
.full-list-row > strong {
  font-family: var(--mono);
  font-size: 9px;
}

.full-list-row > span:first-child {
  opacity: 0.48;
}

.full-list-row > span:nth-child(2) {
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.35;
}

.full-list-row > strong {
  color: var(--ink-soft);
}

.field-chart .bar-row,
.rank-chart .bar-row {
  grid-template-columns: minmax(155px, 48%) minmax(44px, 1fr) 76px;
}

.data-note {
  margin: 28px 0 0;
  color: currentColor;
  opacity: 0.68;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.55;
}

.method-note {
  grid-column: 1 / -1;
  margin: 0;
  padding: 20px clamp(24px, 5vw, 78px) 22px;
  border-bottom: 1px solid var(--line);
  background: var(--paper-deep);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
  text-align: center;
}

.method-note a {
  color: var(--ink-soft);
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.method-note a:hover,
.method-note a:focus-visible {
  color: var(--ink);
}

.gender-pie,
.field-group-pie,
.rank-pie {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--pie, #ccc);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.gender-pie {
  width: min(330px, 76%);
  margin: 12px auto 48px;
}

.field-group-heading {
  margin-top: 0;
}

.pie-centre {
  position: absolute;
  inset: 27%;
  display: grid;
  place-content: center;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
  text-align: center;
}

.supporter-panel .pie-centre {
  background: var(--support-pale);
}

.opponent-panel .pie-centre {
  background: var(--opponent-pale);
}

.pie-centre strong {
  font-size: clamp(22px, 2.5vw, 36px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.pie-centre span {
  margin-top: 6px;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  opacity: 0.68;
}

.pie-fragment-label {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 1px;
  min-width: 48px;
  max-width: 78px;
  padding: 4px 5px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 3px;
  background: rgba(243, 240, 232, 0.88);
  box-shadow: 0 2px 8px rgba(23, 32, 25, 0.1);
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 7px;
  line-height: 1.15;
  letter-spacing: 0.02em;
  text-align: center;
  text-transform: uppercase;
  pointer-events: none;
}

.pie-fragment-label strong {
  font-size: 9px;
}

.pie-fragment-label.is-outside {
  background: rgba(243, 240, 232, 0.96);
}

.gender-legend {
  display: grid;
  border-top: 1px solid color-mix(in srgb, currentColor 25%, transparent);
}

.gender-key {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.gender-key i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.gender-key span {
  color: var(--ink-soft);
  font-size: 13px;
}

.gender-key strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 11px;
}

.field-groups,
.rank-groups {
  display: grid;
  grid-template-columns: minmax(150px, 240px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(28px, 4vw, 56px);
  margin: 0 0 54px;
}

.field-group-pie,
.rank-pie {
  width: 100%;
}

.field-groups {
  margin-top: 30px;
}

.field-group-legend,
.rank-group-legend {
  display: grid;
  min-width: 0;
}

.group-key {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 17%, transparent);
}

.group-key i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.group-key span {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-key strong {
  color: var(--ink-soft);
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.tooltip {
  position: fixed;
  z-index: 80;
  top: 0;
  left: 0;
  max-width: 240px;
  padding: 11px 13px;
  transform: translate(-999px, -999px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 3px;
  background: rgba(23, 32, 25, 0.94);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  color: white;
  font-size: 12px;
  line-height: 1.4;
  pointer-events: none;
  opacity: 0;
  transition: opacity 100ms ease;
}

.tooltip.is-visible {
  opacity: 1;
}

.tooltip strong {
  display: block;
  margin-bottom: 2px;
  font-size: 13px;
}

.load-error {
  position: fixed;
  z-index: 100;
  right: 20px;
  bottom: 20px;
  max-width: 440px;
  padding: 16px 18px;
  border-radius: 4px;
  background: #852d17;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
  color: white;
  font-size: 13px;
  line-height: 1.45;
}

footer {
  padding: 82px clamp(24px, 5vw, 78px) 30px;
  background: var(--ink);
  color: #f3f0e8;
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(420px, 1fr);
  gap: 80px;
  padding-bottom: 76px;
}

.footer-kicker {
  margin: 0 0 18px;
  color: #9ca59e;
}

footer h2 {
  max-width: 500px;
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(42px, 5vw, 72px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.045em;
}

.download-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.download-groups h3 {
  margin: 0 0 16px;
  color: #9ca59e;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.download-groups a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 0;
  border-top: 1px solid #49534c;
  text-decoration: none;
  font-size: 13px;
}

.download-groups a:last-child {
  border-bottom: 1px solid #49534c;
}

.download-groups > div:first-child a:hover {
  color: #79c99d;
}

.download-groups > div:last-child a:hover {
  color: #f0aa7d;
}

.footer-notes {
  display: flex;
  justify-content: space-between;
  gap: 48px;
  padding-top: 26px;
  border-top: 1px solid #49534c;
  color: #9ca59e;
  font-size: 11px;
  line-height: 1.65;
}

.footer-notes p {
  max-width: 650px;
  margin: 0;
}

.footer-notes p:last-child {
  text-align: right;
}

.footer-notes a {
  color: #f3f0e8;
  text-underline-offset: 3px;
}

@media (max-width: 1080px) {
  .hero-total {
    align-items: flex-end;
    gap: 14px;
  }

  .supporter-tone {
    flex-direction: row;
  }

  .opponent-tone {
    flex-direction: row-reverse;
  }

  .bar-row,
  .affiliation-chart .bar-row,
  .field-chart .bar-row,
  .rank-chart .bar-row {
    grid-template-columns: minmax(110px, 48%) minmax(32px, 1fr) max-content;
    gap: 8px;
  }

  .footer-main {
    grid-template-columns: 1fr;
    gap: 48px;
  }
}

@media (max-width: 760px) {
  :root {
    --side-pad: 22px;
  }

  html {
    scroll-padding-top: 52px;
  }

  .hero {
    min-height: auto;
  }

  .hero::after,
  .section-marker::after {
    display: none;
  }

  .hero-topline {
    min-height: 60px;
    padding: 0 20px;
  }

  .hero-copy {
    width: calc(100% - 40px);
    padding: 64px 0 54px;
    text-align: left;
  }

  .eyebrow {
    max-width: 260px;
    margin-bottom: 22px;
  }

  h1 {
    font-size: clamp(50px, 16.5vw, 74px);
    line-height: 0.91;
  }

  .dek {
    margin: 28px 0 0;
    font-size: 16px;
  }

  .top-filter {
    width: max-content;
    justify-content: flex-end;
    gap: 9px;
    margin: 0;
    padding: 0;
  }

  .hero-totals {
    grid-template-columns: 1fr;
  }

  .hero-total {
    min-height: 170px;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    padding: 30px 22px;
  }

  .opponent-tone {
    flex-direction: row-reverse;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .total-number-wrap {
    justify-items: end;
  }

  .opponent-tone .total-number-wrap {
    justify-items: start;
  }

  .total-number {
    font-size: 58px;
  }

  .versus {
    top: 50%;
  }

  .section-nav {
    min-height: 52px;
    justify-content: flex-start;
    gap: 24px;
    padding: 0 18px;
  }

  .section-nav a {
    padding: 17px 0 14px;
  }

  .split-section {
    grid-template-columns: 1fr;
    scroll-margin-top: 52px;
  }

  .section-marker {
    padding: 66px 22px 54px;
    background: var(--paper);
  }

  .section-marker h2 {
    font-size: 43px;
  }

  .side-panel {
    padding: 38px var(--side-pad) 58px;
  }

  .opponent-panel {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .letter-panel,
  .chart-section .side-panel {
    min-height: auto;
  }

  .letter-panel h3 {
    font-size: 38px;
  }

  .letter-copy {
    height: 300px;
  }

  .affiliation-coverage {
    grid-template-columns: 1fr;
  }

  .affiliation-coverage-metric + .affiliation-coverage-metric {
    padding-top: 22px;
    padding-right: 18px;
    padding-left: 0;
    border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
    border-left: 0;
  }

  .map-wrap {
    margin-top: 0;
  }

  .field-groups,
  .rank-groups {
    grid-template-columns: minmax(130px, 42%) minmax(0, 1fr);
    gap: 24px;
  }

  .footer-main,
  .download-groups {
    grid-template-columns: 1fr;
  }

  .footer-main {
    padding-bottom: 50px;
  }

  .download-groups {
    gap: 34px;
  }

  .footer-notes {
    flex-direction: column;
    gap: 22px;
  }

  .footer-notes p:last-child {
    text-align: left;
  }
}

@media (max-width: 480px) {
  .field-groups,
  .rank-groups {
    grid-template-columns: 1fr;
  }

  .field-group-pie,
  .rank-pie {
    width: min(260px, 72%);
    margin: 0 auto;
  }
}

@media (max-width: 430px) {
  .wordmark {
    gap: 0;
    font-size: 0;
  }

  .top-filter .switch-copy strong {
    font-size: 10px;
  }

  .top-filter .switch-track {
    width: 42px;
    height: 24px;
    padding: 3px;
  }

  .top-filter .switch-track i {
    width: 18px;
    height: 18px;
  }

  .top-filter input:checked + .switch-track i {
    transform: translateX(18px);
  }

  .hero-total {
    grid-template-columns: 1fr;
  }

  .total-number-wrap {
    justify-items: start;
    margin-top: 24px;
  }

  .bar-row,
  .affiliation-chart .bar-row,
  .field-chart .bar-row,
  .rank-chart .bar-row {
    grid-template-columns: minmax(120px, 52%) minmax(24px, 1fr) max-content;
  }

  .bar-label {
    font-size: 11px;
  }

  .bar-value {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
