
:root{
  --navy:#071a36;--navy2:#0d2b57;--blue:#1677ff;--blue2:#45a3ff;
  --red:#ef4444;--red2:#fb7185;--gold:#f5b942;--ink:#17233b;
  --muted:#68758d;--line:#dce5f2;--bg:#f4f7fb;--card:#fff;
  --green:#16a36a;--shadow:0 16px 45px rgba(10,32,66,.10);
}
*{box-sizing:border-box}html{scroll-behavior:smooth}
body{margin:0;font-family:Inter,ui-sans-serif,system-ui,-apple-system,Segoe UI,sans-serif;background:var(--bg);color:var(--ink)}
a{color:inherit;text-decoration:none}button,input,select,textarea{font:inherit}
.topbar{background:linear-gradient(100deg,var(--navy),var(--navy2));color:#fff;position:sticky;top:0;z-index:50;box-shadow:0 8px 24px rgba(4,18,41,.2)}
.nav{max-width:1220px;margin:auto;display:flex;align-items:center;gap:25px;padding:12px 20px}
.brand{display:flex;align-items:center;gap:11px;font-weight:900;letter-spacing:.01em;font-size:21px;margin-right:auto}
.brand img{width:43px;height:43px;object-fit:contain;border-radius:10px;background:#fff}
.navlinks{display:flex;align-items:center;gap:24px;font-weight:750;font-size:14px}
.navlinks a{opacity:.82}.navlinks a:hover,.navlinks a.active{opacity:1;color:#9fd0ff}
.menuBtn{display:none;background:transparent;border:0;color:#fff;font-size:25px}
.page{max-width:1220px;margin:auto;padding:34px 20px 70px}
.hero{background:radial-gradient(circle at 85% 0%,rgba(76,156,255,.34),transparent 34%),linear-gradient(120deg,#071a36,#123c77);color:#fff;border-radius:26px;padding:42px;box-shadow:var(--shadow);overflow:hidden}
.heroGrid{display:grid;grid-template-columns:1.45fr .8fr;gap:30px;align-items:center}
.kicker{font-size:12px;letter-spacing:.18em;text-transform:uppercase;font-weight:900;color:#8ec5ff}
.hero h1{font-size:clamp(35px,5vw,65px);line-height:1.02;margin:10px 0 16px;letter-spacing:-.045em}
.hero p{font-size:18px;line-height:1.65;max-width:720px;color:#dceaff}
.probCard{background:rgba(255,255,255,.1);border:1px solid rgba(255,255,255,.18);backdrop-filter:blur(8px);border-radius:22px;padding:26px;text-align:center}
.bigProb{font-size:74px;font-weight:950;letter-spacing:-.07em}.subtle{color:var(--muted)}
.section{margin-top:32px}.sectionHead{display:flex;align-items:end;justify-content:space-between;gap:20px;margin-bottom:15px}
.sectionHead h2{margin:0;font-size:27px;letter-spacing:-.03em}.sectionHead p{margin:5px 0 0;color:var(--muted)}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:18px}.grid2{display:grid;grid-template-columns:repeat(2,1fr);gap:18px}
.card{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:22px;box-shadow:0 7px 24px rgba(13,36,70,.055)}
.card:hover{transform:translateY(-2px);transition:.2s;box-shadow:var(--shadow)}
.controlBar{height:18px;border-radius:99px;overflow:hidden;display:flex;background:#edf1f6;margin:13px 0}
.dem{background:linear-gradient(90deg,var(--blue),var(--blue2))}.rep{background:linear-gradient(90deg,var(--red),var(--red2))}
.badge{display:inline-flex;padding:6px 10px;border-radius:999px;font-size:11px;font-weight:900;letter-spacing:.05em;text-transform:uppercase;background:#e9f2ff;color:#1761ad}
.badge.red{background:#ffe9ec;color:#b9253d}.badge.gold{background:#fff4d9;color:#996700}.badge.green{background:#e4f8f0;color:#08744b}
.raceCard h3{font-size:20px;margin:12px 0 5px}.raceMeta{display:flex;justify-content:space-between;gap:10px;color:var(--muted);font-size:13px}
.candidates{margin:15px 0}.candidateLine{display:flex;align-items:center;justify-content:space-between;padding:8px 0;border-bottom:1px solid #edf1f6}
.partyDot{width:10px;height:10px;border-radius:50%;display:inline-block;margin-right:8px}.party-D{background:var(--blue)}.party-R{background:var(--red)}.party-I{background:#8b5cf6}
.tableWrap{overflow:auto;border-radius:18px;border:1px solid var(--line);background:#fff}
table{width:100%;border-collapse:collapse;min-width:760px}th,td{text-align:left;padding:14px 15px;border-bottom:1px solid #e8eef6;font-size:14px}
th{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:#6d7890;background:#f8fafd}
.btn{border:0;border-radius:11px;padding:11px 16px;font-weight:850;cursor:pointer;background:var(--navy);color:#fff}
.btn.blue{background:var(--blue)}.btn.red{background:var(--red)}.btn.light{background:#e9eff8;color:#18345b}.btn.green{background:var(--green)}
.btn:disabled{opacity:.5;cursor:not-allowed}.linkBtn{color:var(--blue);font-weight:800}
.empty{padding:44px;text-align:center;color:var(--muted)}
.footer{background:#06152d;color:#b9c8df;padding:34px 20px}.footerInner{max-width:1220px;margin:auto;display:flex;justify-content:space-between;gap:25px}
.formGrid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px}.field{display:flex;flex-direction:column;gap:7px}
.field.full{grid-column:1/-1}.field label{font-size:12px;font-weight:850;color:#4f5d74}
input,select,textarea{width:100%;border:1px solid #cfd9e8;border-radius:11px;padding:11px 12px;background:#fff;color:var(--ink)}
textarea{min-height:95px;resize:vertical}.authShell{min-height:100vh;display:grid;place-items:center;padding:25px;background:radial-gradient(circle at 20% 10%,#1c5aa7,transparent 35%),#06152d}
.authCard{max-width:440px;width:100%;background:#fff;border-radius:24px;padding:32px;box-shadow:0 25px 80px rgba(0,0,0,.35)}
.authCard .brand{color:var(--navy);margin-bottom:24px}.notice{padding:12px 14px;border-radius:11px;background:#fff6dc;color:#7a5700;font-size:13px;margin:12px 0}
.notice.error{background:#ffe7ec;color:#9c1730}.notice.success{background:#e5f8ef;color:#0b704a}
.adminLayout{display:grid;grid-template-columns:235px 1fr;min-height:calc(100vh - 68px)}
.sidebar{background:#0a1e3d;color:#fff;padding:22px 15px}.sidebar button{width:100%;text-align:left;border:0;background:transparent;color:#c8d7ed;padding:12px;border-radius:10px;font-weight:750;cursor:pointer;margin-bottom:4px}
.sidebar button.active,.sidebar button:hover{background:#163967;color:#fff}.adminMain{padding:25px;min-width:0}
.adminHead{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:20px}
.adminPanel{display:none}.adminPanel.active{display:block}.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.modal{position:fixed;inset:0;background:rgba(2,13,31,.68);display:none;place-items:center;padding:22px;z-index:100}.modal.open{display:grid}
.modalCard{background:#fff;border-radius:20px;padding:24px;max-width:780px;width:100%;max-height:90vh;overflow:auto}
.modalHead{display:flex;justify-content:space-between;align-items:center;margin-bottom:16px}.modalHead h2{margin:0}.close{border:0;background:#edf1f7;border-radius:50%;width:36px;height:36px;cursor:pointer;font-size:18px}
.statGrid{display:grid;grid-template-columns:repeat(4,1fr);gap:14px}.stat{background:#fff;border:1px solid var(--line);border-radius:16px;padding:18px}.stat strong{display:block;font-size:30px}
.chart{height:155px;display:flex;align-items:end;gap:6px;padding:15px 0}.chart span{flex:1;background:linear-gradient(var(--blue2),var(--blue));border-radius:5px 5px 0 0;min-height:5px}
.loading{padding:40px;text-align:center;color:var(--muted)}
@media(max-width:850px){.heroGrid,.grid3,.grid2,.statGrid{grid-template-columns:1fr}.navlinks{display:none;position:absolute;top:67px;left:0;right:0;background:var(--navy);padding:18px;flex-direction:column;align-items:flex-start}.navlinks.open{display:flex}.menuBtn{display:block}.adminLayout{grid-template-columns:1fr}.sidebar{display:flex;overflow:auto;gap:4px}.sidebar button{width:auto;white-space:nowrap}.formGrid{grid-template-columns:1fr}.field.full{grid-column:auto}.footerInner{flex-direction:column}.hero{padding:28px}.adminMain{padding:16px}}
/* Homepage control forecasts */

.controlForecasts {
  display: grid;
  gap: 16px;
}

.controlForecastCard {
  display: block;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 16px;
  color: inherit;
  text-decoration: none;
  background:
    linear-gradient(
      145deg,
      rgba(45, 76, 118, 0.18),
      rgba(15, 28, 45, 0.88)
    );
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.controlForecastCard:hover {
  transform: translateY(-3px);
  border-color: rgba(108, 160, 239, 0.55);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.controlForecastLabel {
  margin-bottom: 8px;
  color: #7fb1ff;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.controlForecastMessage {
  color: #f8fafc;
  font-size: 1.25rem;
  font-weight: 750;
  line-height: 1.35;
}

.controlForecastLink {
  margin-top: 12px;
  color: #aebdce;
  font-size: 0.86rem;
}

@media (max-width: 760px) {
  .controlForecastCard {
    padding: 18px;
  }

  .controlForecastMessage {
    font-size: 1.08rem;
  }
}
.houseMapCard {
  overflow: hidden;
}

.houseHexMap {
  display: grid;
  grid-template-columns:
    repeat(auto-fill, minmax(58px, 1fr));
  gap: 10px 6px;
  align-items: center;
  justify-items: center;
  padding: 24px 12px;
}

.houseHex {
  position: relative;
  width: 58px;
  height: 66px;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: white;
  font-family: inherit;
  font-weight: 800;
  background: #94a3b8;

  clip-path: polygon(
    25% 6.7%,
    75% 6.7%,
    100% 50%,
    75% 93.3%,
    25% 93.3%,
    0% 50%
  );

  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

.houseHex:hover,
.houseHex:focus-visible {
  transform: scale(1.12);
  filter: brightness(1.08);
  z-index: 5;
  outline: none;
}

.houseHexLabel {
  display: block;
  max-width: 52px;
  padding: 0 3px;
  overflow: hidden;
  font-size: 11px;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.houseHexRating {
  display: block;
  margin-top: 3px;
  font-size: 8px;
  line-height: 1;
  opacity: 0.9;
}

.mapLegend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.mapLegend span {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.legendDot {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

/* Democratic ratings */

.houseHex.map-dem-safe,
.legendDot.map-dem-safe,
.map-dem-safe {
  background: #174ea6;
  fill: #174ea6;
}

.houseHex.map-dem-likely,
.legendDot.map-dem-likely,
.map-dem-likely {
  background: #3977c9;
  fill: #3977c9;
}

.houseHex.map-dem-lean,
.legendDot.map-dem-lean,
.map-dem-lean {
  background: #6da4df;
  fill: #6da4df;
}

.houseHex.map-dem-tilt,
.legendDot.map-dem-tilt,
.map-dem-tilt {
  background: #a9cff2;
  fill: #a9cff2;
  color: #10233d;
}

/* Toss-up */

.houseHex.map-tossup,
.legendDot.map-tossup,
.map-tossup {
  background: #8b8f97;
  fill: #8b8f97;
}

/* Republican ratings */

.houseHex.map-rep-tilt,
.legendDot.map-rep-tilt,
.map-rep-tilt {
  background: #f3b4b4;
  fill: #f3b4b4;
  color: #3c1111;
}

.houseHex.map-rep-lean,
.legendDot.map-rep-lean,
.map-rep-lean {
  background: #df7777;
  fill: #df7777;
}

.houseHex.map-rep-likely,
.legendDot.map-rep-likely,
.map-rep-likely {
  background: #c54545;
  fill: #c54545;
}

.houseHex.map-rep-safe,
.legendDot.map-rep-safe,
.map-rep-safe {
  background: #991f1f;
  fill: #991f1f;
}

@media (max-width: 700px) {
  .houseHexMap {
    grid-template-columns:
      repeat(auto-fill, minmax(48px, 1fr));
    gap: 7px 3px;
    padding: 18px 4px;
  }

  .houseHex {
    width: 49px;
    height: 56px;
  }

  .houseHexLabel {
    max-width: 44px;
    font-size: 9px;
  }

  .houseHexRating {
    font-size: 7px;
  }
}
