@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Newsreader:opsz,wght@6..72,500;6..72,600&display=swap');

:root {
  color-scheme: light dark;
  --bg: #f7f7f5;
  --panel: #fff;
  --ink: #1a2744;
  --muted: #5a6a7a;
  --line: #d5dae0;
  --accent: #1a3a6e;
  --soft: #e8ecf2;
  --hatch: #dce0e6;
  --hatch-line: #9aa5b4;
  --focus: #c94040;
  /* Party colors */
  --gop: #c93535;
  --gop-light: #fbe8e8;
  --dem: #2166ac;
  --dem-light: #e4eef8;
  /* Sentiment (when not party-specific) */
  --sent-pos: #2d7d46;
  --sent-neg: #a13d5c;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.5 'DM Sans',
    system-ui,
    sans-serif;
}
a {
  color: var(--accent);
}
button,
select {
  font: inherit;
  color: var(--ink);
}
button,
select,
a {
  touch-action: manipulation;
}
button,
select {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 6px;
  padding: 9px 12px;
  max-width: 100%;
}
button {
  cursor: pointer;
}
select {
  min-height: 44px;
}
h1,
h2,
p {
  margin: 0;
}
h1,
h2 {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 500;
  line-height: 1.12;
}
h1 {
  font-size: clamp(36px, 4.5vw, 62px);
  letter-spacing: -1.7px;
  margin: 12px 0;
}
h2 {
  font-size: 30px;
  letter-spacing: -0.6px;
}
main,
.masthead,
footer {
  width: min(1328px, calc(100% - 64px));
  margin: auto;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 0;
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--dem) 0%, var(--dem) 40%, #fff 40%, #fff 60%, var(--gop) 60%, var(--gop) 100%) 1;
  gap: 12px;
}
.brand {
  font-size: 13px;
  letter-spacing: 1.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 4px;
}
.brand-star {
  width: 22px;
  height: 22px;
  fill: var(--accent);
}
.language {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.language select {
  font-size: 12px;
}
.intro {
  padding: 36px 0 27px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--accent);
}
.lede {
  font-size: 16px;
  color: var(--muted);
  max-width: 740px;
}
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--muted);
}
#updated:before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 7px;
}
#updated.stale {
  color: #986000;
  font-weight: 600;
}
#updated.stale:before {
  background: #b27812;
}
.divergence {
  border-top: 1px solid var(--line);
  padding: 24px 0 28px;
}
.divergence .eyebrow {
  margin-bottom: 8px;
}
.divergence .caption {
  min-height: 0;
  max-width: 900px;
}
.divergence-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.divergence-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 6px 14px;
}
.divergence-select {
  display: grid;
  gap: 2px;
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 7px;
  background: none;
  padding: 10px 10px 8px;
}
.divergence-select:hover {
  background: var(--soft);
}
.divergence-select[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--soft);
}
.divergence-label {
  font-size: 13px;
  font-weight: 700;
}
.divergence-gap {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 40px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.divergence-gap.up {
  color: var(--sent-pos);
}
.divergence-gap.down {
  color: var(--sent-neg);
}
.divergence-direction {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.divergence-nets,
.divergence-n {
  font-size: 12px;
  color: var(--muted);
}
.divergence-nets {
  margin-top: 6px;
}
.divergence-countries {
  font-size: 12px;
  padding: 0 10px;
}
.method-badge {
  align-self: flex-start;
  margin: 4px 10px 0;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--soft);
  text-decoration: none;
}
.method-badge.low {
  border-color: #b27812;
  color: #986000;
  background: none;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  border-block: 1px solid var(--line);
  padding: 16px 0;
  margin-bottom: 24px;
}
.toolbar label {
  font-size: 12px;
  font-weight: 700;
}
.toolbar select {
  min-width: 240px;
  max-width: 390px;
}
.toolbar p {
  font-size: 12px;
  color: var(--muted);
  margin-left: auto;
}
.share-row {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.share-summary {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
#share {
  border-color: var(--accent);
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  min-height: 44px;
}
#share:disabled {
  cursor: default;
  opacity: 0.5;
}
.share-status {
  font-size: 12px;
  color: var(--muted);
}
.share-fallback {
  flex-basis: 100%;
  font: 12px/1.5 ui-monospace, monospace;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  resize: vertical;
}
.window-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.window-toggle button {
  min-height: 44px;
  font-weight: 600;
}
.window-toggle button[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--panel);
}
.maps {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 20px;
}
.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 23px 22px 17px;
  overflow: hidden;
}
.panel-heading,
.feed-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.panel .eyebrow,
.feed-heading .eyebrow {
  margin-bottom: 8px;
}
.tag {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  background: var(--soft);
  padding: 5px 9px;
  border-radius: 4px;
  white-space: nowrap;
  border: 1px solid var(--line);
}
.caption {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 12px;
  min-height: 38px;
}
.panel svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 10px 0 12px;
  overflow: visible;
}
.region {
  stroke: var(--panel);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  outline: none;
}
.region.priority {
  stroke: var(--ink);
  stroke-width: 1.5;
}
.region:hover,
.region:focus-visible,
.region.selected {
  stroke: var(--focus);
  stroke-width: 2.5;
}
.hatch-bg {
  fill: var(--hatch);
}
.hatch-line {
  stroke: var(--hatch-line);
  stroke-width: 1;
}
.legend {
  font-size: 10px;
  color: var(--muted);
}
.legend-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.legend-ramp {
  height: 7px;
  border-radius: 3px;
  margin: 6px 0;
}
.legend-ticks {
  display: flex;
  justify-content: space-between;
}
.legend-low {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}
.hatch-swatch {
  height: 10px;
  width: 18px;
  display: inline-block;
  background: repeating-linear-gradient(
    135deg,
    var(--hatch),
    var(--hatch) 3px,
    var(--hatch-line) 3px,
    var(--hatch-line) 4px
  );
}
.map-note {
  font-size: 10px;
  color: var(--muted);
  margin-top: 12px;
  min-height: 30px;
}
.banner {
  border: 1px solid var(--line);
  border-left: 3px solid #b27812;
  background: var(--panel);
  padding: 12px 16px;
  margin-top: 20px;
  font-size: 13px;
}
.error {
  border-left-color: #b44c26;
}
#feed {
  padding: 34px 0;
}
.feed-heading {
  margin-bottom: 18px;
}
.feed-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 12px;
}
.feed-controls select {
  max-width: 310px;
}
.filter-chip {
  border-color: var(--accent);
  color: var(--accent);
}
#feed-scope {
  min-height: 0;
  margin-bottom: 16px;
}
.feed-list {
  padding: 0;
  margin: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 34px;
}
.feed-item {
  border-top: 1px solid var(--line);
  padding: 18px 0 20px;
  min-width: 0;
}
.item-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}
.item-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 23px;
  line-height: 1.25;
  color: var(--ink);
  text-decoration: none;
  overflow-wrap: anywhere;
}
.item-title:hover {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 11px;
}
.entity-chip {
  font-size: 10px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 3px 6px;
}
.entity-chip.pos {
  background: #e4f2ea;
  color: #1d6040;
}
.entity-chip.neg {
  background: #f5e8ee;
  color: #8a3050;
}
.entity-chip.neu {
  background: #f0eee5;
  color: #675d40;
}
.entity-chip.unscored {
  background: var(--soft);
  color: var(--muted);
}
.entity-chip.gop {
  background: var(--gop-light);
  color: var(--gop);
}
.entity-chip.dem {
  background: var(--dem-light);
  color: var(--dem);
}
footer {
  padding: 25px 0 35px;
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--gop) 0%, var(--gop) 40%, #fff 40%, #fff 60%, var(--dem) 60%, var(--dem) 100%) 1;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 24px;
  font-size: 11px;
  color: var(--muted);
}
footer p {
  max-width: 850px;
}
footer a {
  white-space: nowrap;
}
.empty {
  color: var(--muted);
  padding: 30px 0;
}
#tooltip {
  position: fixed;
  z-index: 10;
  max-width: min(310px, calc(100vw - 24px));
  padding: 13px 16px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: 0 8px 30px #0002;
  font-size: 12px;
  white-space: pre-line;
  pointer-events: none;
}
/* Methodology page */
.methodology .brand {
  color: inherit;
  text-decoration: none;
}
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}
.mix-bar {
  display: flex;
  height: 14px;
  margin: 18px 0 16px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--soft);
}
.mix-segment.llm,
.mix-swatch.llm {
  background: var(--accent);
}
.mix-segment.lexicon,
.mix-swatch.lexicon {
  background: var(--hatch-line);
}
.mix-segment.none,
.mix-swatch.none {
  background: var(--hatch);
}
.mix-list {
  margin: 0;
}
.mix-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.mix-row dt {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mix-row dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.mix-swatch {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  border: 1px solid var(--line);
}
.method-note {
  margin-top: 14px;
  font-size: 12px;
  color: var(--muted);
}
.method-note.warn {
  border-left: 3px solid #b27812;
  padding-left: 10px;
  color: var(--ink);
}
.table-wrap {
  overflow-x: auto;
  margin-top: 8px;
}
.health-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.health-table th,
.health-table td {
  text-align: left;
  padding: 7px 8px 7px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 400;
}
.health-table thead th {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.health-table .num {
  text-align: right;
  padding-right: 0;
  font-variant-numeric: tabular-nums;
}
.health-table tr.down td:nth-child(2) {
  color: #986000;
  font-weight: 700;
}
.limits {
  margin: 20px 0 34px;
}
.limits-list {
  margin: 14px 0 4px;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  max-width: 900px;
  font-size: 14px;
}
.skip {
  position: fixed;
  top: 5px;
  left: 5px;
  z-index: 20;
  background: var(--panel);
  padding: 10px;
  transform: translateY(-150%);
}
.skip:focus {
  transform: translateY(0);
}
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1520;
    --panel: #151f2e;
    --ink: #e8ecf2;
    --muted: #a0afc0;
    --line: #2a3a4e;
    --accent: #6a9fd4;
    --soft: #1e2c40;
    --hatch: #2a3848;
    --hatch-line: #506070;
    --focus: #e86060;
    --gop: #e85555;
    --gop-light: #3a2020;
    --dem: #5a9ad8;
    --dem-light: #1a2a40;
    --sent-pos: #4cb070;
    --sent-neg: #d06080;
  }
  #updated.stale {
    color: #e9bd68;
  }
  .health-table tr.down td:nth-child(2),
  .method-badge.low {
    color: #e9bd68;
  }
  .entity-chip.pos {
    background: #1e3828;
    color: #8cd8a8;
  }
  .entity-chip.neg {
    background: #3a2030;
    color: #e8a0c0;
  }
  .entity-chip.neu {
    background: #303028;
    color: #d8d0a8;
  }
  .entity-chip.gop {
    background: var(--gop-light);
    color: #f0a0a0;
  }
  .entity-chip.dem {
    background: var(--dem-light);
    color: #90c0e8;
  }
}
@media (max-width: 767px) {
  main,
  .masthead,
  footer {
    width: calc(100% - 32px);
  }
  .masthead {
    padding: 16px 0;
    align-items: start;
  }
  .brand {
    font-size: 10px;
    letter-spacing: 0.8px;
    gap: 6px;
    padding-top: 10px;
  }
  .brand-mark {
    font-size: 21px;
  }
  .language {
    display: block;
  }
  .language > span {
    display: none;
  }
  .language select {
    font-size: 11px;
    padding: 8px;
    max-width: 132px;
  }
  .intro {
    padding: 28px 0 22px;
  }
  h1 {
    letter-spacing: -1px;
  }
  .lede {
    font-size: 14px;
  }
  .status-row {
    gap: 7px 14px;
    margin-top: 16px;
    font-size: 11px;
  }
  .divergence-list {
    grid-template-columns: 1fr;
  }
  .divergence-gap {
    font-size: 34px;
  }
  .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px 0;
  }
  .toolbar select {
    min-width: 0;
    width: 100%;
    max-width: 100%;
  }
  .toolbar p {
    margin: 0;
  }
  .maps,
  .method-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .panel {
    padding: 18px 15px 14px;
  }
  h2 {
    font-size: 27px;
  }
  .caption {
    font-size: 11px;
  }
  .map-note {
    min-height: 0;
  }
  .feed-heading {
    align-items: start;
  }
  .feed-heading h2 {
    font-size: 28px;
  }
  .feed-list {
    grid-template-columns: 1fr;
  }
  .feed-controls {
    display: grid;
    grid-template-columns: 1fr;
  }
  .feed-controls select {
    width: 100%;
    max-width: 100%;
  }
  .filter-chip {
    text-align: left;
    white-space: normal;
  }
  .item-title {
    font-size: 22px;
  }
  footer {
    display: block;
  }
  footer a {
    display: inline-block;
    margin-top: 13px;
  }
}
