:root {
  --rte-dark: #1a1e22;
  --rte-black: #010000;
  --rte-grey: #6e6f6e;
  --rte-cyan: #00a7b3;
  --rte-cyan-dark: #008a94;
  --bg-base: #f0f4f9;
  --bg-deep: #d9e5f5;
  --ink-strong: #0f223f;
  --ink-soft: #41597a;
  --panel: rgba(255, 255, 255, 0.92);
  --stroke: rgba(15, 34, 63, 0.16);
  --cool: #138aaf;
  --mint: #2f9e77;
  --gold: #d89a1d;
  --shadow: 0 14px 30px rgba(8, 24, 48, 0.1);
  --pc: #2e6be6;
  --mw: #2a8cab;
  --pl: #7a9d2d;
  --gf: #d4662d;
  --cr: #d14f7b;
  --ap: #8d68e0;
  --gl: #2ca18d;
  --ne: #2c87d3;
  --dc: #5f6d7c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink-strong);
  background:
    linear-gradient(180deg, #eef3fa 0%, #dde9f7 100%);
  overflow-x: hidden;
}

.us-rte-hero-banner {
  background:
    linear-gradient(125deg, rgba(1, 0, 0, 0.95), rgba(12, 23, 49, 0.96)),
    repeating-linear-gradient(
      0deg,
      rgba(233, 27, 35, 0.2) 0px,
      rgba(233, 27, 35, 0.2) 14px,
      rgba(255, 255, 255, 0.06) 14px,
      rgba(255, 255, 255, 0.06) 28px
    );
  padding: 3.1rem 2rem 3.35rem;
  text-align: center;
  border-bottom: 4px solid #0044c9;
}

.us-rte-hero-content {
  max-width: 1200px;
  margin: 0 auto;
}

.us-rte-brandline {
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 0.75rem;
}

.us-rte-logo {
  font-size: 2.1rem;
  font-weight: 900;
  color: white;
  letter-spacing: 0.15em;
  text-shadow: 0 0 24px rgba(0, 68, 201, 0.4);
}

.us-election-header {
  background: white;
  max-width: 1200px;
  margin: -2.25rem auto 1.4rem;
  padding: 2.2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  border-left: 8px solid #0044c9;
  position: relative;
  z-index: 2;
}

.us-election-tag {
  display: inline-block;
  background: #e91b23;
  color: white;
  padding: 0.45rem 1rem;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.95rem;
}

.us-election-title {
  font-size: clamp(1.85rem, 3.8vw, 3rem);
  line-height: 1.15;
  color: var(--rte-dark);
  margin: 0 0 0.65rem;
  font-weight: 900;
}

.us-election-subtitle {
  font-size: 1.12rem;
  color: var(--rte-grey);
  line-height: 1.5;
  margin-bottom: 1rem;
  font-weight: 400;
}

.us-election-meta {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  color: var(--rte-grey);
  font-size: 0.92rem;
  padding-top: 1rem;
  border-top: 1px solid #e7e7e7;
}

.us-election-meta strong {
  color: var(--rte-dark);
}

.page-shell {
  width: min(1560px, 98vw);
  margin: 0 auto;
  padding: 0.3rem 0 2.25rem;
}

.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.reveal.is-live {
  opacity: 1;
  transform: translateY(0);
}

.hero {
  margin-bottom: 1.75rem;
}

.kicker {
  margin: 0;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--cool);
}

h1 {
  margin: 0.4rem 0 0;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(1.95rem, 4.3vw, 3.35rem);
  letter-spacing: 0.01em;
  line-height: 1.07;
}

.subtitle {
  margin: 0.65rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 2vw, 1.15rem);
}

.disclaimer {
  margin: 0 0 0.9rem;
  color: #5f6f86;
  font-size: 0.86rem;
}

.explorer {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(300px, 0.85fr);
  gap: 1.1rem;
  align-items: start;
}

.detail-panel {
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: var(--panel);
  backdrop-filter: blur(6px);
  box-shadow: var(--shadow);
}

.board-wrap {
  padding: 0.2rem 0;
}

.board-title-row {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.45rem;
}

.hover-readout {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.84rem;
  text-align: right;
}

.map-frame {
  border-radius: 0;
  padding: 0;
}

.svg-map {
  width: 100%;
  min-height: clamp(560px, 74vh, 920px);
}

.svg-map svg {
  width: 100%;
  height: auto;
  display: block;
}

.svg-map p {
  margin: 0;
  padding: 1rem 0.8rem;
  color: var(--ink-soft);
}

.svg-map .state {
  cursor: pointer;
  transition: filter 0.18s ease, stroke 0.18s ease, stroke-width 0.18s ease, opacity 0.18s ease;
  stroke: rgba(10, 24, 44, 0.18);
  stroke-width: 1.05;
}

.svg-map .state:focus,
.svg-map .state:focus-visible {
  outline: none;
}

.svg-map .state:hover,
.svg-map .state.is-hovered {
  filter: brightness(1.08);
  stroke: rgba(10, 24, 44, 0.62);
  stroke-width: 1.9;
}

.svg-map .state.is-selected {
  stroke: #ffffff;
  stroke-width: 2.1;
  filter: saturate(1.13) brightness(1.05);
}

.legend {
  margin-top: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.legend span {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 34, 63, 0.1);
  border-radius: 999px;
  padding: 0.28rem 0.52rem;
}

.detail-panel {
  padding: 0.95rem;
  transition: transform 0.3s ease, opacity 0.3s ease;
  position: sticky;
  top: 0.9rem;
  width: 100%;
  margin-left: 0;
}

.panel-kicker {
  margin: 0;
  color: var(--cool);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.72rem;
  font-weight: 800;
}

#panel-region {
  margin: 0.35rem 0 0;
  font-family: "Archivo Black", sans-serif;
  font-size: 1.35rem;
}

.panel-ev {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-weight: 700;
}

.panel-note {
  margin: 0.45rem 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.candidate-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.8rem;
}

.race-group {
  border: 1px solid rgba(15, 34, 63, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  padding: 0.52rem;
}

.race-title {
  margin: 0 0 0.5rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}

.candidate-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem;
  padding: 0.62rem 0.74rem;
  border-radius: 12px;
  background: rgba(15, 34, 63, 0.045);
  border: 1px solid rgba(15, 34, 63, 0.07);
  opacity: 0;
  transform: translateY(8px);
  animation: pop-in 0.22s ease forwards;
  animation-delay: calc(var(--i) * 35ms);
}

.candidate-main {
  min-width: 0;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 0.52rem;
}

.candidate-main-undecided {
  grid-template-columns: 14px minmax(0, 1fr);
}

.undecided-marker {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #8794a7;
  border: 1px solid rgba(15, 34, 63, 0.22);
}

.candidate-list-headshot {
  width: 38px;
  height: 38px;
  border-radius: 8px;
}

.candidate-list-headshot.party-border-H {
  border-color: rgba(233, 27, 35, 0.55);
  box-shadow: 0 0 0 1px rgba(233, 27, 35, 0.18);
}

.candidate-list-headshot.party-border-P {
  border-color: rgba(0, 68, 201, 0.55);
  box-shadow: 0 0 0 1px rgba(0, 68, 201, 0.18);
}

.candidate-list-headshot.party-border-I {
  border-color: rgba(107, 75, 196, 0.55);
  box-shadow: 0 0 0 1px rgba(107, 75, 196, 0.18);
}

.candidate-list-headshot.party-border-F {
  border-color: rgba(75, 49, 122, 0.58);
  box-shadow: 0 0 0 1px rgba(75, 49, 122, 0.22);
}

.candidate-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.86rem;
  font-weight: 700;
}

.candidate-side {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.candidate-percent {
  font-size: 0.73rem;
  font-weight: 800;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 34, 63, 0.12);
  border-radius: 999px;
  padding: 0.16rem 0.42rem;
}

.party-pill {
  font-size: 0.74rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  color: #fff;
}

.party-H {
  background: #e91b23;
}

.party-P {
  background: #0044c9;
}

.party-I {
  background: #6b4bc4;
}

.party-F {
  background: #4b317a;
}

.party-U {
  background: #7a8699;
}

.community-poll {
  margin-top: 1rem;
  display: block;
}

.chamber-forecast {
  margin-top: 1rem;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.chamber-forecast h2 {
  margin: 0;
  font-family: "Archivo Black", sans-serif;
  font-size: 1.12rem;
}

.chamber-intro {
  margin: 0.45rem 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.chamber-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.chamber-card {
  border: 1px solid rgba(15, 34, 63, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.84);
  padding: 0.7rem;
}

.chamber-card h3 {
  margin: 0;
  font-size: 0.92rem;
}

.seat-chart {
  width: 100%;
  margin-top: 0.55rem;
  border-radius: 10px;
  background: radial-gradient(circle at 50% 88%, rgba(255, 255, 255, 0.95), rgba(228, 236, 251, 0.95));
}

.seat-dot {
  cursor: pointer;
  transition: filter 0.14s ease, stroke-width 0.14s ease;
  transform-box: fill-box;
  transform-origin: center;
}

.seat-dot.party-P {
  fill: #0044c9;
}

.seat-dot.party-H {
  fill: #e91b23;
}

.seat-dot.party-I {
  fill: #0a9b8e;
}

.seat-dot.party-F {
  fill: #4b317a;
}

.seat-dot.party-U {
  fill: #8c96aa;
}

.seat-dot.is-pickup {
  stroke: #e7b01d;
  stroke-width: 2.2;
}

.seat-dot.not-up {
  opacity: 0.82;
}

.seat-dot.is-active,
.seat-dot:hover {
  filter: brightness(1.08);
  stroke: #0f223f;
  stroke-width: 1.8;
}

.seat-hover-readout {
  margin: 0.5rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  min-height: 1.2rem;
}

.seat-legend-row {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.seat-legend-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid rgba(15, 34, 63, 0.1);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  background: rgba(255, 255, 255, 0.86);
}

.seat-key {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.seat-key-P {
  background: #0044c9;
}

.seat-key-H {
  background: #e91b23;
}

.seat-key-I {
  background: #0a9b8e;
}

.seat-key-F {
  background: #4b317a;
}

.seat-key-pickup {
  background: #b1b8c7;
  border: 2px solid #e7b01d;
}

.chamber-note {
  margin: 0.68rem 0 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.35;
}

.presidential-poll-card {
  margin-top: 1rem;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.98), rgba(231, 241, 255, 0.95));
  box-shadow: var(--shadow);
  padding: 1rem 1rem 1.08rem;
}

.presidential-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.7rem;
  font-weight: 800;
  color: #48638f;
}

.presidential-poll-card h2 {
  margin: 0.22rem 0 0;
  font-family: "Archivo Black", sans-serif;
  font-size: 1.12rem;
  line-height: 1.22;
}

.presidential-subtitle {
  margin: 0.38rem 0 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.presidential-poll-list {
  list-style: none;
  margin: 0.82rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.presidential-poll-list li {
  display: grid;
  gap: 0.34rem;
  border: 1px solid rgba(15, 34, 63, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.84);
  padding: 0.46rem 0.58rem;
  font-size: 0.84rem;
}

.presidential-row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.presidential-row-head strong {
  font-size: 0.86rem;
}

.presidential-bar-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(15, 34, 63, 0.12);
  overflow: hidden;
}

.presidential-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.presidential-bar-fill.fill-raymond {
  background: linear-gradient(90deg, #295ec8, #4f7fdd);
}

.presidential-bar-fill.fill-maxabilian {
  background: linear-gradient(90deg, #d4363d, #e76a6f);
}

.presidential-bar-fill.fill-undecided {
  background: linear-gradient(90deg, #6d768b, #9da8bf);
}

.community-poll-card {
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 1rem;
}

.community-poll-card h2 {
  margin: 0;
  font-family: "Archivo Black", sans-serif;
  font-size: 1.2rem;
}

.community-poll-card p {
  margin: 0.5rem 0 0.8rem;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.poll-embed {
  width: 100%;
  min-height: 980px;
  border: 1px solid rgba(15, 34, 63, 0.12);
  border-radius: 12px;
  background: #fff;
}

.poll-fallback-link a {
  color: #0044c9;
  font-weight: 700;
}

.candidate-headshot {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #f2f4f8, #dfe3ec);
  border: 1px solid rgba(15, 34, 63, 0.1);
  position: relative;
}

.candidate-headshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.candidate-headshot.missing::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(45deg, transparent 47%, rgba(15, 34, 63, 0.24) 48%, rgba(15, 34, 63, 0.24) 52%, transparent 53%),
    linear-gradient(-45deg, transparent 47%, rgba(15, 34, 63, 0.24) 48%, rgba(15, 34, 63, 0.24) 52%, transparent 53%);
}

@keyframes pop-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .explorer {
    grid-template-columns: 1fr;
  }

  .chamber-grid {
    grid-template-columns: 1fr;
  }

  .us-election-header {
    margin: -1.5rem 1rem 1.1rem;
    padding: 1.7rem;
  }

  .svg-map {
    min-height: clamp(420px, 62vh, 680px);
  }

  .detail-panel {
    position: static;
  }
}

@media (max-width: 700px) {
  .page-shell {
    width: min(97vw, 560px);
  }

  .us-rte-hero-banner {
    padding: 2.5rem 1rem;
  }

  .us-election-subtitle {
    font-size: 1rem;
  }

  .board-title-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .hover-readout {
    text-align: left;
  }

  .map-frame {
    padding: 0;
  }

  .svg-map {
    min-height: 300px;
  }

  .poll-embed {
    min-height: 760px;
  }
}
