:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  color: #17263d;
  background: #f0f4fa;
  --ink: #17263d;
  --muted: #465e7d;
  --line: #dce5f1;
  --acid: #a9d8ff;
  --red: #e03d34;
  --low: #d17162;
  --middle: #9ab1d1;
  --high: #2566be;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: inherit; text-decoration: none; }
p, h1, h2, h3, ol, ul, dl, dd { margin: 0; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid #285ec6; outline-offset: 3px; }
.wrap { width: min(1192px, calc(100% - 64px)); margin-inline: auto; }
.masthead { color: #f5faff; background: #111f37; }
.masthead-inner { min-height: 67px; display: flex; align-items: center; gap: 42px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand-logo { display: block; width: clamp(150px, 22vw, 212px); height: auto; color: #f5faff; }
nav { display: flex; gap: 29px; font-size: 13px; font-weight: 650; color: #d9e5f6; }
nav a:hover { color: #fff; text-decoration: underline 2px var(--red); text-underline-offset: 6px; }
.demo { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--acid); border: 1px solid #466793; padding: 6px 10px; border-radius: 5px; }
.intro { display: grid; grid-template-columns: 1fr minmax(255px, .42fr); align-items: end; gap: 42px; padding: 39px 0 28px; }
.context { color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
h1 { margin-top: 15px; font-size: clamp(47px, 6.7vw, 93px); line-height: .87; letter-spacing: -.092em; font-weight: 850; }
h1 span { color: #2e6dcc; }
.intro h1 { font-size: clamp(36px, 5.9vw, 82px); line-height: .96; letter-spacing: -.071em; text-wrap: balance; }
.demo:hover { border-color: var(--red); }
.description { max-width: 485px; margin-top: 21px; color: #3c5270; font-size: 17px; line-height: 1.5; }
.overview { display: grid; gap: 0; padding-bottom: 4px; }
.overview div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 55px; border-top: 1px solid #cbd9eb; }
.overview dt { color: #3c5270; font-size: 13px; font-weight: 650; }
.overview dd { color: #163b73; font-size: 29px; font-weight: 850; letter-spacing: -.07em; font-variant-numeric: tabular-nums; }
.dashboard, .vote-demo { scroll-margin-top: 16px; }
.chamber, .rank { border-radius: 18px; min-width: 0; }
.chamber {
  padding: clamp(17px, 3vw, 32px);
  background: radial-gradient(ellipse at 50% 40%, #1c3b66 0%, #14294b 48%, #101e37 100%);
  border: 1px solid #243b5e;
  color: #f4f9ff;
}
.card-heading p { margin-top: 7px; color: #c1d0e7; font-size: 13px; }
.card-heading a, .source a { text-decoration: underline; text-underline-offset: 3px; }
.chamber :focus-visible { outline-color: #e6f4ff; }
h2 { font-size: clamp(23px, 2.45vw, 32px); letter-spacing: -.06em; line-height: 1.1; }
.seats { position: relative; margin: 18px auto 4px; width: min(100%, 690px); aspect-ratio: 536 / 280; }
.seat {
  position: absolute;
  width: 1.28%;
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--seat-color, transparent);
  transform: translate(-50%, -50%);
}
button.seat { transition: transform .12s, opacity .12s; }
button.seat::after { content: ""; position: absolute; inset: -36%; border-radius: inherit; }
button.seat:hover, button.seat:focus-visible {
  z-index: 1;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.34);
  box-shadow: 0 0 0 2px #162b4c, 0 0 0 3px #fff;
  outline: 0;
}
.seat.vacant { border: 1px solid #b1c2db; }
.seat.dimmed { opacity: .20; }
.seat-preview {
  --preview-width: min(226px, 100%);
  position: absolute;
  z-index: 3;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  width: var(--preview-width);
  left: clamp(0px, var(--preview-left), calc(100% - var(--preview-width)));
  top: var(--preview-top);
  transform: translateY(calc(-100% - 10px));
  padding: 8px;
  border: 1px solid #c7d7ec;
  border-radius: 10px;
  background: #f7fbff;
  color: #172f50;
  box-shadow: 0 7px 22px #07162f66;
  pointer-events: none;
}
.seat-preview.below { transform: translateY(10px); }
.seat-preview .portrait-visual { aspect-ratio: 3 / 4; border-radius: 5px; font-size: 15px; }
.seat-preview strong { display: block; font-size: 13px; overflow-wrap: anywhere; }
.seat-preview p { margin-top: 4px; color: #48658a; font-size: 11px; }
.seat-detail { min-height: 2lh; text-align: center; color: #d4e4f8; padding-top: 8px; font-size: 12px; }
.chamber-base { max-width: 760px; margin-inline: auto; border-top: 1px solid #3b5275; padding-top: 14px; }
.group-filters { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; }
.group-filters button, .vacant-key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 4px 7px;
  border: 1px solid #456181;
  border-radius: 6px;
  background: #183051;
  color: #e9f2ff;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.group-filters button::before, .vacant-key::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--seat-color, transparent);
}
.vacant-key::before { border: 1px solid #c1cee0; }
.group-filters button:hover, .group-filters button[aria-pressed=true] { border-color: #e0edff; background: #2b4a75; }
.source { text-align: center; margin-top: 12px; color: #c1d0e7; font-size: 11px; }
.portrait-visual {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 5 / 4;
  overflow: hidden;
  color: #214778;
  background: linear-gradient(140deg, #dceafa, #a9c6eb);
  font-size: 27px;
  font-weight: 800;
}
.portrait-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.vote-demo { margin-top: 30px; }
.vote-demo > p { margin: 6px 0 12px; color: var(--muted); font-size: 14px; }
.sample-dashboard { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.deputy-profile { display: grid; align-items: center; grid-template-columns: minmax(80px, 146px) 1fr; gap: 18px; }
.deputy-profile h2 { overflow-wrap: anywhere; }
.deputy-profile p { margin-top: 8px; color: var(--muted); line-height: 1.35; }
.portrait-frame .portrait-visual { aspect-ratio: 3 / 4; border-radius: 9px; }
.portrait-frame small { display: block; margin-top: 6px; color: var(--muted); font-size: 10px; }
.portrait-frame small a, .official-link { text-decoration: underline; text-underline-offset: 3px; }
.official-link { display: block; color: #21589e; font-size: 13px; margin-top: 9px; }
[hidden] { display: none !important; }
.rank { background: #fff; border: 1px solid var(--line); padding: clamp(17px, 2.5vw, 28px); }
.segments { display: flex; gap: 3px; background: #edf2f9; border-radius: 7px; padding: 3px; margin: 17px 0 9px; }
.segments button { flex: 1; padding: 7px 3px; border: 0; border-radius: 5px; font-size: 12px; font-weight: 750; color: #3a5278; background: transparent; }
.segments [aria-pressed=true] { color: #19366a; background: #fff; box-shadow: 0 1px 3px #1b2d491b; }
#ranking { padding: 0; list-style: none; }
#ranking li + li { border-top: 1px solid #e8eef7; }
.member { display: grid; width: 100%; grid-template-columns: 22px 1fr auto 16px; align-items: center; gap: 8px; text-align: left; min-height: 48px; background: transparent; border: 0; padding: 5px 2px; color: var(--ink); }
.member:hover { background: #f2f7ff; }
.position { color: #4c6385; font-size: 12px; font-variant-numeric: tabular-nums; }
.member strong { display: block; font-size: 14px; }
.member small { display: block; font-size: 11px; color: #465e7d; margin-top: 2px; }
.score { font-size: 17px; font-weight: 850; font-variant-numeric: tabular-nums; }
.score.high { color: #225eb0; }
.score.low { color: #a6493c; }
.chevron { color: #3d6196; }
.group-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 15px; }
.group { padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 9px; }
.group-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px; }
.group h3 { font-size: 13px; }
.group .score { white-space: nowrap; }
.group small { display: block; margin-top: 5px; color: #465e7d; }
.track { margin-top: 11px; height: 5px; border-radius: 5px; background: #e3ebf8; overflow: hidden; }
.track b { display: block; height: 100%; background: #4989e4; }
footer { margin-top: 32px; border-top: 1px solid var(--line); padding: 17px 0 24px; font-size: 13px; font-weight: 750; }
footer span { color: #465e7d; font-weight: 500; margin-left: 10px; }
dialog { width: min(560px, calc(100% - 28px)); max-height: 84vh; border: 1px solid var(--line); border-radius: 14px; padding: 26px; color: var(--ink); background: #fff; }
dialog::backdrop { background: #102141aa; }
dialog h2 { margin-top: 7px; padding-right: 22px; }
dialog h3 { margin-top: 16px; font-size: 15px; }
.close { position: absolute; top: 10px; right: 12px; border: 0; border-radius: 5px; background: #edf2f9; color: var(--ink); font-size: 25px; width: 34px; }
.profile-score { margin-top: 9px; }
.profile-score strong { font-size: 31px; letter-spacing: -.06em; }
.votes { padding: 0; list-style: none; margin-top: 4px; }
.votes li { display: flex; gap: 12px; justify-content: space-between; border-top: 1px solid var(--line); padding: 7px 0; font-size: 13px; }
.votes span { color: #395982; white-space: nowrap; }
@media (max-width: 800px) {
  .wrap { width: calc(100% - 36px); }
  .masthead-inner { gap: 24px; }
  .intro { gap: 24px; }
  .sample-dashboard { grid-template-columns: 1fr; }
  .group-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 540px) {
  .masthead-inner { gap: 10px; min-height: 58px; }
  nav { display: none; }
  .demo { font-size: 10px; }
  .intro { display: block; padding: 29px 0 18px; }
  h1 { font-size: clamp(43px, 10.4vw, 61px); }
  .description { font-size: 14px; margin-top: 14px; }
  .overview { grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 19px; }
  .overview div { display: flex; align-items: start; flex-direction: column-reverse; justify-content: start; gap: 2px; padding-top: 4px; }
  .overview dt { font-size: 10px; }
  .overview dd { font-size: 23px; }
  .group-filters button, .vacant-key { font-size: 10px; min-height: 26px; padding-inline: 5px; }
  .deputy-profile { gap: 11px; }
}

.deputy-evidence { margin-top: 20px; border-top: 1px solid var(--line); }
.deputy-evidence p { margin-top: 7px; color: var(--muted); font-size: 13px; }
#deputy-score { font-weight: 750; color: #214778; }
.ranking-intro { padding: clamp(29px, 5vw, 58px) 0 25px; }
.ranking-intro h1 { font-size: clamp(38px, 6.7vw, 80px); line-height: .96; }
.ranking-intro .description { max-width: 100%; }
.ranking-filters { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 12px; }
.ranking-filters > div { display: grid; min-width: 0; gap: 6px; }
.ranking-filters label { color: var(--muted); font-size: 13px; font-weight: 700; }
.ranking-filters input, .ranking-filters select {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 8px 11px;
  border: 1px solid #bdcee4;
  border-radius: 7px;
  background: #f7faff;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
}
.ranking-status { margin-top: 18px; padding: 9px 0; color: var(--muted); font-size: 13px; }
.ranking-roster { list-style: none; padding: 0; scroll-margin-top: 12px; }
#ranking-sentinel { min-height: 1px; }
.ranking-roster li { border-top: 1px solid var(--line); }
.roster-member { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; min-height: 64px; padding: 6px 4px; }
.roster-member .portrait-visual { aspect-ratio: 3 / 4; border-radius: 6px; font-size: 15px; }
.roster-member small { font-size: 12px; }
.roster-score { color: #465e7d; font-size: 12px; }
@media (max-width: 650px) {
  .ranking-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .ranking-filters > div:first-child { grid-column: 1 / -1; }
  .roster-member { grid-template-columns: 38px minmax(0, 1fr); gap: 2px 9px; }
  .roster-member .portrait-visual { grid-row: span 2; }
  .roster-score { grid-column: 2; }
}

.score-coverage { margin-top: 14px; color: #214778; font-size: 13px; font-weight: 750; }
.evidence-list { list-style: none; padding: 0; margin-top: 10px; }
.evidence-list li { padding: 11px 0; border-top: 1px solid var(--line); }
.evidence-list .official-link { margin-top: 6px; }
.evidence-title { font-size: 14px; font-weight: 750; color: #214778; text-decoration: underline; text-underline-offset: 3px; }
.roster-score { font-weight: 750; }
.home-rankings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .9fr);
  align-items: start;
  gap: 16px;
  margin-top: 21px;
}
.group-ranking { scroll-margin-top: 16px; }
.group-ranking ol { margin-top: 12px; padding: 0; list-style: none; }
.group-ranking li + li { border-top: 1px solid var(--line); }
.group-ranking li a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 5px 3px;
  font-size: 13px;
}
.group-ranking li a:hover > strong { text-decoration: underline 2px var(--red); text-underline-offset: 3px; }
.group-ranking li a > span { color: #214778; text-align: right; font-variant-numeric: tabular-nums; }
.group-ranking small { display: block; color: var(--muted); font-size: 11px; }
@media (max-width: 760px) {
  .home-rankings { grid-template-columns: minmax(0, 1fr); }
}
.top-five-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.top-five-heading .official-link { margin-top: 0; }
.top-five .roster-member { padding-inline: 8px; }

footer { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
footer span { margin-left: 0; }
.footer-brand .brand-logo { width: 137px; color: #0b1b28; }
.score-method { margin-top: 12px; color: var(--muted); font-size: 13px; }
.score-method summary { cursor: pointer; }
.score-method p { margin-top: 7px; }
.top-five .segments { max-width: 420px; }
.top-five .segments [aria-pressed="true"] { box-shadow: inset 0 -2px var(--red); }
