:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #ffffe9;
  background: #232426;
  font-synthesis: none;
  --bg: #232426;
  --surface: #2b2d2e;
  --raised: #343637;
  --cream: #ffffe9;
  --green: #008f47;
  --blue: #006aa3;
  --muted: rgba(255, 255, 233, .76);
  --line: rgba(255, 255, 233, .17);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: var(--bg); }
a { color: inherit; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--cream);
  outline-offset: 3px;
}

main {
  max-width: 1510px;
  margin: auto;
  padding: 1rem clamp(1.25rem, 4vw, 4.5rem) 2.75rem;
}
.intro {
  display: grid;
  grid-template-columns: minmax(250px, 340px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 5.5rem);
  max-width: 1180px;
  margin: 0 auto 2.15rem;
}
.brand {
  display: block;
  width: min(100%, 340px);
  justify-self: center;
  text-decoration: none;
}
.brand img { display: block; width: 100%; height: auto; }
.intro-copy { min-width: 0; }
.eyebrow {
  margin: 0 0 .45rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 650;
  letter-spacing: .01em;
}
.intro h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.75rem, 4.2vw, 4.25rem);
  line-height: 1.06;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.intro-copy > p:not(.eyebrow) {
  max-width: 650px;
  margin: 1.1rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
  text-wrap: balance;
}
.source-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: 1rem;
  padding-bottom: .25rem;
  border-bottom: 2px solid var(--green);
  color: var(--cream);
  font-size: .85rem;
  font-weight: 650;
  text-decoration: none;
}
.source-link:hover { border-color: var(--blue); }

.workspace { display: grid; max-width: 1000px; margin: auto; transition: max-width .25s ease; }
.workspace.has-results {
  max-width: none;
  grid-template-columns: minmax(360px, .92fr) minmax(470px, 1.08fr);
  gap: 1.3rem;
  align-items: start;
}
.map-stage, .results {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: none;
}
.map-stage { position: relative; padding: 1.45rem 1.65rem 1.15rem; }
.stage-heading, .map-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 650;
}
.stage-heading { letter-spacing: .07em; }
.stage-heading > span:first-child { color: var(--cream); }
.stage-separator { color: var(--green); margin: 0 .35rem; }
.stage-heading #total-count {
  color: var(--cream);
  font-weight: 750;
  letter-spacing: 0;
  white-space: nowrap;
}
.map-frame { position: relative; max-width: 760px; margin: 0 auto; }
.map-frame svg { display: block; width: min(100%, 70vh); height: auto; margin: auto; }
.map-frame path {
  fill: var(--cream);
  stroke: var(--bg);
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: fill .13s ease;
}
.map-frame path:hover, .map-frame path.is-hovered, .map-frame path:focus-visible {
  fill: var(--green);
  outline: none;
}
.map-frame path.is-selected { fill: var(--blue); }
.map-frame path.is-selected:hover, .map-frame path.is-selected:focus-visible {
  fill: var(--blue);
}
.map-frame.is-touring path { transition: fill .5s ease; }
.map-tooltip {
  position: absolute;
  transition: opacity .2s ease;
  z-index: 2;
  pointer-events: none;
  min-width: 160px;
  padding: .65rem .85rem;
  border-top: 4px solid var(--green);
  border-radius: 9px;
  background: var(--cream);
  color: var(--bg);
  box-shadow: 0 10px 35px rgba(0, 0, 0, .3);
  font-size: .8rem;
  line-height: 1.5;
}
.map-tooltip.is-fading { opacity: 0; }
.map-tooltip strong { display: block; font-size: .93rem; }
.map-controls { border-top: 1px solid var(--line); padding-top: 1rem; }
.workspace.has-results .map-hint { display: none; }
.workspace.has-results .map-controls { justify-content: flex-end; }
.map-hint { font-weight: 400; }
.state-picker { display: flex; align-items: center; gap: .65rem; white-space: nowrap; }
.state-picker select {
  max-width: 190px;
  padding: .5rem 2rem .5rem .7rem;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--raised);
  color: var(--cream);
}

.results {
  max-height: 815px;
  overflow: auto;
  padding: 1.6rem;
}
.results[hidden] { display: none; }
.back-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: .87rem;
}
.back-button:hover { color: var(--cream); }
.results-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.65rem;
}
.results-title-row .eyebrow { margin-bottom: .5rem; }
.results h2 { margin: 0; font-size: clamp(1.65rem, 2.6vw, 2.25rem); letter-spacing: -.04em; }
.uf-tag {
  padding: .45rem .75rem;
  border-radius: 7px;
  background: var(--green);
  color: var(--cream);
  font-size: .83rem;
}
.results-count { margin: .65rem 0 .4rem; color: var(--muted); font-size: .88rem; }
.count-explainer { margin: 0 0 1.3rem; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.count-explainer summary { width: max-content; max-width: 100%; cursor: pointer; }
.count-explainer p { max-width: 62ch; margin: .55rem 0 0; }
.filters {
  display: grid;
  grid-template-columns: 1fr minmax(145px, .7fr);
  gap: .8rem;
  margin-bottom: 1.2rem;
}
.filters label { color: var(--cream); font-size: .78rem; font-weight: 650; }
.filters input, .filters select {
  display: block;
  width: 100%;
  height: 43px;
  margin-top: .45rem;
  padding: 0 .75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--raised);
  color: var(--cream);
}
.filters input:focus, .filters select:focus { border-color: var(--green); }
.filters input::placeholder { color: var(--muted); }
.candidate-list { display: grid; gap: .75rem; }
.candidate-card {
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--raised);
  transition: border-color .15s ease;
}
.candidate-card:hover { border-color: var(--green); }
.card-main { display: flex; align-items: flex-start; gap: 1rem; }
.candidate-photo {
  width: 3.12rem;
  height: 4.02rem;
  flex-shrink: 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface);
  object-fit: cover;
}
.candidate-number {
  display: grid;
  place-items: center;
  min-width: 4.5rem;
  min-height: 3.35rem;
  padding: .3rem .5rem;
  border-radius: 4px;
  background: var(--blue);
  color: var(--cream);
  font-size: 1.4rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.04em;
  line-height: 1;
}
.candidate-identity { min-width: 0; }
.candidate-identity h3 {
  margin: 0 0 .18rem;
  font-size: 1.02rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.candidate-identity p { margin: 0; color: var(--muted); font-size: .84rem; }
.status { display: inline-block; margin-top: .65rem; color: var(--muted); font-size: .75rem; }
.status::before {
  content: "";
  display: inline-block;
  width: .45rem;
  height: .45rem;
  margin-right: .45rem;
  border-radius: 50%;
  background: var(--green);
  vertical-align: .06rem;
}
.status.review::before { background: var(--cream); }
.candidate-card details {
  margin: .8rem 0 0;
  padding-top: .65rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}
.candidate-card summary { width: max-content; max-width: 100%; color: var(--cream); cursor: pointer; }
.candidate-card summary:hover { text-decoration: underline; text-decoration-color: var(--green); }
.candidate-card dl { display: grid; gap: .45rem; margin: .8rem 0 0; }
.candidate-card dl div { display: flex; gap: .45rem; }
.candidate-card dt { min-width: 6rem; color: var(--muted); }
.candidate-card dd { margin: 0; color: var(--cream); overflow-wrap: anywhere; }
.load-more {
  width: 100%;
  margin-top: 1rem;
  padding: .8rem;
  border: 0;
  border-radius: 10px;
  background: var(--green);
  color: var(--cream);
  font-weight: 700;
}
.load-more:hover { background: var(--blue); }
.empty-state {
  padding: 1.4rem;
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.data-note { margin: 1.8rem auto 0; color: var(--muted); font-size: .82rem; line-height: 1.5; text-align: center; }
.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  max-width: 1510px;
  margin: auto;
  padding: 1.35rem clamp(1.25rem, 4vw, 4.5rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.5;
}
.footer a { color: var(--cream); text-decoration: none; }
.footer a:hover { text-decoration: underline; text-decoration-color: var(--green); }

@media (max-width: 1080px) {
  .workspace.has-results { grid-template-columns: 1fr; max-width: 820px; }
  .results { max-height: none; }
  .workspace.has-results .map-frame svg { width: min(100%, 500px); }
}
@media (max-width: 820px) {
  .intro { grid-template-columns: 1fr; gap: .3rem; text-align: center; }
  .brand { width: 225px; }
  .intro h1 { margin: auto; font-size: clamp(2.3rem, 5vw, 3.2rem); }
  .intro-copy > p:not(.eyebrow) { margin-right: auto; margin-left: auto; }
}
@media (max-width: 620px) {
  main { padding-top: .9rem; }
  .intro { margin-bottom: 1.6rem; }
  .brand { width: 190px; }
  .intro h1 { font-size: clamp(2.1rem, 8vw, 2.85rem); }
  .intro-copy > p:not(.eyebrow) { font-size: .96rem; }
  .map-stage { padding: 1.25rem 1rem 1rem; }
  .map-frame svg { width: 100%; }
  .stage-heading { font-size: .71rem; }
  .map-controls { flex-direction: column; align-items: stretch; gap: .85rem; }
  .map-hint { display: none; }
  .state-picker { justify-content: space-between; }
  .state-picker select { width: 65%; max-width: none; }
  .results { padding: 1.15rem; }
  .filters { grid-template-columns: 1fr; }
  .footer { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
