@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;
  /* Warm paper, charcoal ink, hairlines (approved light mockup). */
  --bg: #f5f1e8;
  --panel: #fffdf8;
  --ink: #27251f;
  --muted: #6b665c;
  --line: #e2dbcc;
  --line-strong: #cfc6b2;
  --accent: #1f3a68;
  --soft: #efe9dc;
  --hatch: #e6e0d3;
  --hatch-line: #a9a293;
  --focus: #b5452f;
  --shadow: 0 1px 2px rgb(60 48 24 / 6%), 0 3px 12px rgb(60 48 24 / 5%);
  --shadow-lift: 0 2px 4px rgb(60 48 24 / 7%), 0 10px 26px rgb(60 48 24 / 9%);
  /* Party colors: Dem navy, GOP muted crimson */
  --gop: #a63a37;
  --gop-light: #f5e2dd;
  --dem: #1f4785;
  --dem-light: #e2e9f3;
  --ind: #6b665c;
  /* Sentiment (when not party-specific): sage / brick / amber */
  --sent-pos: #55804f;
  --sent-neg: #ad4a43;
  --sent-mixed: #c4952c;
  /* Divergence dots */
  --world: #2f5596;
  --us: #ad4a43;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font:
    15px/1.55 'DM Sans',
    system-ui,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
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;
  text-wrap: balance;
}
h1 {
  font-size: clamp(28px, 3.2vw, 42px);
  letter-spacing: -0.9px;
  margin: 0 0 6px;
}
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: 20px 0;
  border-bottom: 1px solid var(--line);
  gap: 12px 20px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  color: var(--ink);
}
.brand-name {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  letter-spacing: -0.5px;
  line-height: 1;
}
.brand-kicker {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.4px;
  margin-left: 10px;
}
.masthead-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.updated-pill {
  font-size: 12.5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 4px;
}
.brand-star {
  width: 30px;
  height: 30px;
  fill: var(--ink);
}
.language {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.language select {
  font-size: 12px;
}
.intro {
  padding: 26px 0 18px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  color: var(--accent);
}
.lede {
  font-size: 17px;
  line-height: 1.6;
  color: var(--muted);
  max-width: 62ch;
}
.status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 12px;
  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: 12px;
  padding: 6px 6px 14px;
  box-shadow: 0 1px 2px #0000000d;
}
.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: 600;
  letter-spacing: 0.2px;
}
.divergence-gap {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 44px;
  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: auto 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: 12px;
  padding: 24px 24px 18px;
  overflow: hidden;
  box-shadow: 0 1px 2px #0000000d;
}
.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: 13px;
  line-height: 1.6;
  margin-top: 12px;
  min-height: 38px;
  max-width: 70ch;
  text-wrap: pretty;
}
.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: 12px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}
.item-title {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 24px;
  line-height: 1.25;
  text-wrap: balance;
  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: 1px solid var(--line);
  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);
  font-size: 14px;
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 32px 20px;
  margin-top: 8px;
}
/* Loading skeletons: shown until app.js marks the page ready or failed. */
body[data-state='loading'] #feed-list {
  min-height: 420px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--soft) 25%, var(--panel) 50%, var(--soft) 75%) 0 0 / 200% 100% no-repeat;
  animation: shimmer 1.4s linear infinite;
}
/* Map skeleton lasts until D3 draws into the svg; the error banner turns it off. */
.maps svg:empty {
  min-height: 300px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--soft) 25%, var(--panel) 50%, var(--soft) 75%) 0 0 / 200% 100% no-repeat;
  animation: shimmer 1.4s linear infinite;
}
body[data-state='error'] .maps svg:empty,
.maps-details:has(+ #map-error:not([hidden])) svg:empty {
  background: none;
  animation: none;
}
@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 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;
}
/* Candidate-first dashboard */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
}
.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seg button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 13px;
  border-radius: 999px;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 500;
}
.seg button:hover {
  border-color: var(--line-strong);
}
.seg button[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--panel);
}
.lang-toggle button {
  min-height: 36px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.party-chip.dem {
  color: var(--dem);
  background: var(--dem-light);
}
.party-chip.gop {
  color: var(--gop);
  background: var(--gop-light);
}
.seg .party-chip.dem[aria-pressed='true'] {
  background: var(--dem);
  border-color: var(--dem);
  color: var(--panel);
}
.seg .party-chip.gop[aria-pressed='true'] {
  background: var(--gop);
  border-color: var(--gop);
  color: var(--panel);
}
.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}
.dot.pos {
  background: var(--sent-pos);
}
.dot.neg {
  background: var(--sent-neg);
}
.dot.mixed {
  background: var(--sent-mixed);
}
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 14px 0;
  border-block: 1px solid var(--line);
}
.filter-groups {
  display: contents;
}
.filters .seg + .seg {
  padding-left: 12px;
  border-left: 1px solid var(--line);
}
.search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 170px;
  max-width: 300px;
  margin-left: auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: var(--shadow);
  color: var(--muted);
}
.search:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 0;
}
.board {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 28px;
  padding: 22px 0 30px;
}
.key {
  align-self: start;
  position: sticky;
  top: 16px;
  padding-right: 22px;
  border-right: 1px solid var(--line);
  font-size: 13px;
}
.key-heading {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.3px;
  text-transform: uppercase;
}
.key-list {
  margin: 0 0 22px;
  display: grid;
  gap: 10px;
}
.key-list dt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}
.key-list dd {
  margin: 1px 0 0 26px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.key-line {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}
.key-line.pos {
  background: var(--sent-pos);
}
.key-line.neg {
  background: var(--sent-neg);
}
.key-line.mixed {
  background: var(--sent-mixed);
}
.key-dot {
  width: 10px;
  height: 10px;
  margin: 0 4px;
  border-radius: 50%;
}
.key-dot.world {
  background: var(--world);
}
.key-dot.us {
  background: var(--us);
}
.key-note {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 {
  font-size: 24px;
}
.candidates:focus {
  outline: none;
}
.cand-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(262px, 1fr));
  gap: 14px;
}
.cand-item {
  position: relative;
  min-width: 0;
}
.cand {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  height: 100%;
  padding: 14px 16px 14px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  transition:
    box-shadow 0.15s,
    border-color 0.15s;
}
.cand:hover,
.cand[aria-expanded='true'] {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-lift);
}
.cand.is-selected {
  border-color: var(--accent);
  box-shadow:
    inset 0 0 0 1px var(--accent),
    var(--shadow);
}
.avatar {
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--soft);
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
}
.initials {
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.cand-photo {
  width: 76px;
  height: 76px;
}
.cand-photo .initials {
  font-size: 26px;
}
.cand-body {
  display: grid;
  gap: 1px;
  flex: 1;
  min-width: 0;
}
.cand-name {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.2px;
}
.cand-office {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
}
.party-badge {
  display: inline-block;
  min-height: 1px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
  color: var(--panel);
}
.party-badge.dem {
  background: var(--dem);
}
.party-badge.gop {
  background: var(--gop);
}
.party-badge.ind {
  background: var(--ind);
}
.cand-net {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.cand-net.pos,
.tip-side-value.pos {
  color: var(--sent-pos);
}
.cand-net.neg,
.tip-side-value.neg {
  color: var(--sent-neg);
}
.cand-net.mixed,
.tip-side-value.mixed {
  color: #8a6a1c;
}
.meter {
  position: relative;
  height: 5px;
  margin-top: 8px;
  border-radius: 3px;
  background: var(--soft);
}
.meter-zero {
  position: absolute;
  left: 50%;
  top: -3px;
  bottom: -3px;
  width: 1px;
  background: var(--line-strong);
}
.meter-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  border-radius: 3px;
}
.meter-fill.pos {
  background: var(--sent-pos);
}
.meter-fill.neg {
  background: var(--sent-neg);
}
.meter-fill.mixed {
  background: var(--sent-mixed);
}
.cand-note {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--muted);
}
.cand-tip {
  position: absolute;
  z-index: 30;
  top: 0;
  width: 360px;
  padding: 18px 18px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow-lift);
  font-size: 13px;
}
.cand-tip[data-side='right'] {
  left: calc(100% + 14px);
}
.cand-tip[data-side='left'] {
  right: calc(100% + 14px);
}
.cand-tip::before {
  content: '';
  position: absolute;
  top: var(--arrow-y, 44px);
  width: 14px;
  height: 14px;
  margin-top: -7px;
  background: var(--panel);
  transform: rotate(45deg);
}
.cand-tip[data-side='right']::before {
  left: -8px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cand-tip[data-side='left']::before {
  right: -8px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
}
.tip-head {
  display: flex;
  align-items: center;
  gap: 16px;
}
.tip-photo {
  width: 96px;
  height: 96px;
}
.tip-photo .initials {
  font-size: 32px;
}
.tip-who {
  display: grid;
  gap: 3px;
  justify-items: start;
  min-width: 0;
}
.tip-name {
  font-family: 'Newsreader', Georgia, serif;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.1;
}
.tip-office {
  color: var(--muted);
  margin-bottom: 4px;
}
.tip-close {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
}
.tip-block {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.tip-kicker {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.tip-side {
  display: grid;
  grid-template-columns: 52px 1fr 48px 40px;
  align-items: center;
  gap: 10px;
  min-height: 26px;
}
.tip-track {
  position: relative;
  height: 2px;
  background: var(--line);
}
.tip-zero {
  position: absolute;
  left: 50%;
  top: -4px;
  width: 1px;
  height: 10px;
  background: var(--line-strong);
}
.tip-dot {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--panel);
  transform: translate(-50%, -50%);
}
.tip-dot.world {
  background: var(--world);
}
.tip-dot.us {
  background: var(--us);
}
.tip-side-value {
  text-align: right;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tip-side-n,
.tip-gap,
.tip-meta {
  font-size: 11.5px;
  color: var(--muted);
}
.tip-side-n {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.tip-gap {
  margin-top: 6px;
}
.tip-news {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
}
.tip-news li {
  display: grid;
  gap: 2px;
  padding-left: 12px;
  position: relative;
}
.tip-news li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
}
.tip-headline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--ink);
  font-weight: 500;
  line-height: 1.35;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.tip-headline:hover {
  text-decoration: underline;
}
.tip-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.tip-foot strong {
  font-variant-numeric: tabular-nums;
}
.tip-cta {
  width: 100%;
  margin-top: 12px;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--panel);
  font-weight: 600;
}
.tip-cta:hover {
  filter: brightness(1.1);
}
.tip-credit {
  margin-top: 10px;
  font-size: 10.5px;
  line-height: 1.45;
  color: var(--muted);
}
.tip-credit a {
  color: inherit;
}
.photo-note {
  margin-top: 8px;
}
.maps-details {
  margin: 8px 0 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}
.maps-details > summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  font-size: 15px;
}
.maps-details[open] > summary {
  border-bottom: 1px solid var(--line);
}
.maps-details > .maps {
  padding: 16px;
}
.maps-details .panel {
  box-shadow: 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 {
    /* Warm charcoal counterpart of the paper palette. */
    --bg: #1b1a17;
    --panel: #24221e;
    --ink: #ece6da;
    --muted: #a9a191;
    --line: #3a3630;
    --line-strong: #4d4840;
    --accent: #9db5e0;
    --soft: #2d2a25;
    --hatch: #34312b;
    --hatch-line: #6a6458;
    --focus: #e08a6c;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%);
    --shadow-lift: 0 10px 30px rgb(0 0 0 / 45%);
    --gop: #d9706a;
    --gop-light: #3a2422;
    --dem: #8fb0e6;
    --dem-light: #1f2a3c;
    --ind: #a9a191;
    --sent-pos: #8fbf86;
    --sent-neg: #e0837a;
    --sent-mixed: #e0b85a;
    --world: #8fb0e6;
    --us: #e0837a;
  }
  #updated.stale {
    color: #e9bd68;
  }
  .health-table tr.down td:nth-child(2),
  .method-badge.low {
    color: #e9bd68;
  }
  .entity-chip.pos {
    background: #24331f;
    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;
  }
  .cand-net.mixed,
  .tip-side-value.mixed {
    color: var(--sent-mixed);
  }
}
@media (max-width: 1023px) {
  .board {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 16px;
  }
  /* Grid first; the key follows it. */
  .key {
    order: 2;
    position: static;
    padding: 16px 0 0;
    border-right: 0;
    border-top: 1px solid var(--line);
  }
  .key-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 22px;
    margin-bottom: 12px;
  }
  .key-list dd {
    margin-left: 26px;
  }
}
/* Narrow screens: the preview becomes a bottom sheet with a close button. */
@media (max-width: 700px) {
  .cand-tip {
    position: fixed;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 16px 16px 0 0;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .cand-tip[data-side] {
    left: 0;
    right: 0;
  }
  .cand-tip::before {
    display: none;
  }
  .tip-close {
    display: block;
  }
  .tip-head {
    padding-right: 40px;
  }
}
@media (max-width: 767px) {
  main,
  .masthead,
  footer {
    width: calc(100% - 32px);
  }
  .masthead {
    padding: 14px 0;
  }
  .brand-name {
    font-size: 26px;
  }
  .brand-star {
    width: 24px;
    height: 24px;
  }
  .brand-kicker {
    flex-basis: 100%;
    margin-left: 0;
    font-size: 10.5px;
    letter-spacing: 1px;
  }
  /* One swipeable chip row, then search, so the grid starts near the top. */
  .filters {
    padding: 12px 0;
  }
  .filter-groups {
    display: flex;
    gap: 10px;
    width: calc(100% + 16px);
    margin-right: -16px;
    padding: 2px 16px 6px 0;
    overflow-x: auto;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }
  .filter-groups::-webkit-scrollbar {
    display: none;
  }
  .filter-groups .seg {
    flex-wrap: nowrap;
    flex: none;
  }
  .filter-groups .seg button {
    white-space: nowrap;
  }
  .search {
    flex-basis: 100%;
    max-width: none;
    margin-left: 0;
  }
  .cand-grid {
    grid-template-columns: 1fr;
  }
  .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: 20px 16px 16px;
  }
  h2 {
    font-size: 27px;
  }
  .caption {
    font-size: 12px;
  }
  .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;
  }
}
@media (prefers-reduced-motion: reduce) {
  body[data-state='loading'] #feed-list,
  .maps svg:empty {
    animation: none;
  }
}
