:root {
  --blue: #123f73;
  --blue-deep: #092d57;
  --blue-bright: #2f79b8;
  --blue-pale: #edf4fa;
  --red: #c75252;
  --red-dark: #a83d3d;
  --green: #287c67;
  --ink: #252a30;
  --muted: #68717b;
  --paper: #fff;
  --canvas: #f3f5f7;
  --line: #dce1e7;
  --line-dark: #c9d0d8;
  --shadow: 0 18px 50px rgba(20, 43, 70, .11);
  --shadow-soft: 0 7px 24px rgba(20, 43, 70, .07);
  --radius: 16px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button, summary, select { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
.wrap { width: min(1260px, calc(100% - 40px)); margin-inline: auto; }

.brandbar {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid #e6e9ed;
  background: #fff;
}
.brandbar-inner {
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.site-logo { display: inline-flex; text-decoration: none; }
.site-logo img { width: 218px; height: auto; }
.brandbar-links { display: flex; align-items: center; gap: 22px; color: var(--muted); font-size: 12px; font-weight: 750; }
.brandbar-links span:first-child { padding-right: 22px; border-right: 1px solid var(--line); color: var(--blue); letter-spacing: .04em; text-transform: uppercase; }
.brandbar-links a { color: var(--blue); text-decoration: none; }
.brandbar-links a:hover { color: var(--red-dark); text-decoration: underline; text-underline-offset: 3px; }

.home-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 5px solid var(--red);
  background: linear-gradient(120deg, var(--blue-deep) 0%, var(--blue) 58%, #1c6098 100%);
  color: #fff;
}
.home-hero::before,
.home-hero::after {
  position: absolute;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 50%;
  content: "";
}
.home-hero::before { right: -90px; top: -210px; width: 570px; height: 570px; }
.home-hero::after { right: 130px; bottom: -310px; width: 460px; height: 460px; }
.home-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 58px;
  align-items: center;
  padding: 42px 0 76px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: #dfeeff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.eyebrow::before { width: 28px; height: 3px; border-radius: 4px; background: var(--red); content: ""; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1, .profile h2 { margin: 0; font-weight: 830; letter-spacing: -.045em; }
h1 { max-width: 820px; font-size: clamp(37px, 4.8vw, 62px); line-height: 1.03; }
.deck { max-width: 740px; margin: 15px 0 0; color: rgba(255,255,255,.82); font-size: 16px; line-height: 1.6; }
.source-stamp {
  padding: 20px 22px;
  border: 1px solid rgba(255,255,255,.17);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  box-shadow: 0 12px 32px rgba(0,0,0,.10);
}
.source-stamp span { display: block; margin-bottom: 5px; color: #bcd7ef; font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.source-stamp strong { display: block; color: #fff; font-size: 18px; }
.source-stamp p { margin: 8px 0 0; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.5; }

.content { padding: 28px 0 68px; }
.page-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}
.home-results-columns { margin-top: 33px; }
.home-results-columns .results-head { margin-top: 0; }
.primary-column { min-width: 0; }
.page-columns .candidate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.election-news {
  position: sticky;
  top: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 5px solid var(--red);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}
.news-heading { padding: 20px 20px 17px; background: linear-gradient(145deg, #fff, var(--blue-pale)); }
.news-heading span { display: block; margin-bottom: 5px; color: var(--red-dark); font-size: 9px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.news-heading h2 { margin: 0; color: var(--blue-deep); font-size: 22px; font-weight: 850; letter-spacing: -.035em; line-height: 1.12; }
.news-list { margin: 0; padding: 0 20px; list-style: none; }
.news-list li { border-top: 1px solid #e8ebef; }
.news-list article { padding: 16px 0; }
.news-list time { display: block; margin-bottom: 5px; color: var(--red-dark); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.news-list h3 { margin: 0; color: var(--ink); font-size: 15px; font-weight: 820; letter-spacing: -.016em; line-height: 1.28; }
.news-list h3 a { text-decoration: none; }
.news-list h3 a:hover { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.news-list p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.news-empty { margin: 0; padding: 18px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.5; }
.news-all { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line); background: var(--blue); color: #fff; font-size: 12px; font-weight: 850; text-decoration: none; }
.news-all:hover { background: var(--blue-deep); }
[data-candidate-browser] { position: relative; z-index: 2; margin-top: -74px; }
.filters {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow);
}
.filters-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 22px 15px;
  border-bottom: 1px solid #e8ebef;
}
.filters-heading span,
.results-title > span {
  display: block;
  margin-bottom: 4px;
  color: var(--red-dark);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.filters-heading h2 { margin: 0; font-size: 23px; font-weight: 820; letter-spacing: -.03em; }
.clear-button {
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid transparent;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}
.clear-button:hover { border-color: var(--blue); }
.clear-button:disabled { cursor: not-allowed; color: #9aa1a8; }
.filters-primary,
.advanced-grid {
  display: grid;
  gap: 14px;
}
.filters-primary { grid-template-columns: 1fr 1.15fr 1fr 1.5fr; padding: 18px 22px 21px; }
.advanced-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 17px 22px 22px; }
.field { min-width: 0; }
.field label {
  display: block;
  margin: 0 0 7px;
  color: #59636d;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}
input, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus { border-color: var(--blue-bright); outline: 0; box-shadow: 0 0 0 3px rgba(47,121,184,.13); }
input:disabled, select:disabled { cursor: not-allowed; background: #f2f3f4; color: #8c939a; }
.advanced-filters { border-top: 1px solid #e8ebef; background: #fafbfc; }
.advanced-filters summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 22px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  list-style: none;
}
.advanced-filters summary::-webkit-details-marker { display: none; }
.advanced-filters summary::after { content: "+"; font-size: 20px; font-weight: 500; }
.advanced-filters[open] summary::after { content: "−"; }
.advanced-filters[open] summary { border-bottom: 1px solid #e8ebef; }

.button {
  display: inline-flex;
  min-height: 45px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 18px;
  border: 1px solid var(--blue);
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}
.button:hover { border-color: var(--blue-deep); background: var(--blue-deep); transform: translateY(-1px); }
.button.secondary { border-color: #dde2e8; background: #edf0f3; color: #3f4b57; }
.button-outline { border-color: var(--line-dark); background: transparent; color: var(--blue); }

.results-head { display: flex; gap: 22px; justify-content: space-between; align-items: end; margin: 33px 0 16px; }
.results-title h2 { margin: 0; font-size: 31px; font-weight: 830; letter-spacing: -.04em; }
.results-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.results-count { padding: 7px 11px; border-radius: 999px; background: #e5eef6; color: var(--blue); font-size: 12px; font-weight: 850; }
.muted { color: var(--muted); }

.candidate-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.candidate-card {
  display: flex;
  min-width: 0;
  overflow: hidden;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: var(--shadow-soft);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.candidate-card:hover { border-color: #bdc8d3; box-shadow: var(--shadow); transform: translateY(-3px); }
.card-photo {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3.65;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(145deg, #e7eff7, #d8e5f1);
  color: var(--blue);
  text-decoration: none;
}
.card-photo::after { position: absolute; inset: auto 0 0; height: 35%; background: linear-gradient(transparent, rgba(3,21,39,.42)); content: ""; pointer-events: none; }
.card-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.photo-fallback { font-size: 44px; font-weight: 900; letter-spacing: -.06em; opacity: .78; }
.candidate-number {
  position: absolute;
  z-index: 2;
  right: 12px;
  bottom: 11px;
  min-width: 50px;
  padding: 7px 9px;
  border: 2px solid rgba(255,255,255,.78);
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
}
.candidate-body { display: flex; min-height: 278px; flex: 1; flex-direction: column; padding: 16px 16px 14px; }
.candidate-labels { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 9px; }
.office-label { min-width: 0; overflow: hidden; color: var(--red-dark); font-size: 9px; font-weight: 900; letter-spacing: .055em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.badge { display: inline-flex; flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; font-size: 9px; font-weight: 900; letter-spacing: .02em; line-height: 1.25; text-transform: uppercase; }
.badge-primary { background: rgba(40,124,103,.11); color: var(--green); }
.candidate-card h3 { margin: 0 0 7px; font-size: 22px; font-weight: 830; letter-spacing: -.035em; line-height: 1.08; }
.candidate-card h3 a { text-decoration: none; }
.candidate-card h3 a:hover { color: var(--blue-bright); }
.candidate-party { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; line-height: 1.4; }
.candidate-party span { color: #b2b8bf; }
.registration-status { margin: 13px 0 16px; padding: 10px 11px; border-left: 3px solid #9fb8d0; background: #f4f7fa; }
.registration-status span,
.registration-status strong { display: block; }
.registration-status span { margin-bottom: 3px; color: #7b848e; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.registration-status strong { color: #404850; font-size: 11px; line-height: 1.35; }
.card-actions { display: grid; gap: 10px; margin-top: auto; padding-top: 2px; }
.card-primary-action { width: 100%; min-height: 42px; padding: 9px 11px; font-size: 12px; }
.card-tse-link { display: inline-flex; align-items: center; justify-content: center; gap: 5px; color: var(--blue); font-size: 11px; font-weight: 800; text-align: center; text-decoration: none; }
.card-tse-link:hover { color: var(--red-dark); text-decoration: underline; text-underline-offset: 3px; }
.load-more { display: flex; justify-content: center; margin-top: 28px; }
.load-more .button { min-width: 190px; }
.empty, .notice { grid-column: 1 / -1; padding: 44px 28px; border: 1px dashed #c3ccd5; border-radius: 14px; background: rgba(255,255,255,.7); color: var(--muted); text-align: center; }
.empty strong, .empty span { display: block; }
.empty strong { color: var(--ink); font-size: 17px; }
.loading strong::after { content: "…"; }
.error { border-color: rgba(168,61,61,.35); color: var(--red-dark); }

.back-link { display: inline-flex; align-items: center; margin: 0 0 18px; color: var(--blue); font-size: 13px; font-weight: 850; text-decoration: none; }
.back-link:hover { color: var(--red-dark); text-decoration: underline; text-underline-offset: 3px; }
.profile { overflow: hidden; border: 1px solid var(--line); border-top: 5px solid var(--blue); border-radius: 18px; background: var(--paper); box-shadow: var(--shadow); }
.profile-hero { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 42px; padding: 36px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, #fff 45%, #eef5fa); }
.profile-photo { position: relative; display: grid; aspect-ratio: 3 / 4; place-items: center; overflow: hidden; border: 1px solid #ced8e1; border-radius: 12px; background: #e3ecf4; color: var(--blue); box-shadow: 0 12px 28px rgba(18,63,115,.14); font-size: 48px; font-weight: 900; }
.profile-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.profile-intro { align-self: center; min-width: 0; }
.profile-kicker { margin: 0 0 10px; color: var(--red-dark); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.profile h2 { color: var(--ink); font-size: clamp(38px, 5vw, 64px); line-height: 1.02; }
.profile-subtitle { margin: 12px 0 0; color: var(--muted); font-size: 15px; }
.profile-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 700px; margin-top: 24px; }
.profile-stat { min-width: 0; padding: 12px 14px; border: 1px solid #dbe1e7; border-radius: 9px; background: rgba(255,255,255,.82); }
.profile-stat span,
.profile-stat strong { display: block; }
.profile-stat span { margin-bottom: 4px; color: #77808a; font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.profile-stat strong { overflow-wrap: anywhere; color: #343b43; font-size: 14px; line-height: 1.35; }
.profile-stat.status { border-color: rgba(40,124,103,.26); background: rgba(40,124,103,.07); }
.profile-stat.status strong { color: var(--green); }
.profile-actions { margin-top: 20px; }
.profile-actions .button { min-width: 230px; }
.profile-email { margin: 15px 0 0; color: var(--muted); font-size: 12px; }
.profile-email a, .contact-line a { color: var(--blue); font-weight: 750; text-underline-offset: 3px; }
.relations { padding: 25px 36px; border-bottom: 1px solid var(--line); background: #f9f6f4; }
.relations h3 { margin: 0 0 13px; font-size: 21px; font-weight: 830; letter-spacing: -.025em; }
.relation-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.relation-card { padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-decoration: none; }
.relation-card:hover { border-color: var(--blue-bright); }
.relation-card strong, .relation-card span { display: block; }
.relation-card span { margin-bottom: 4px; color: var(--red-dark); font-size: 9px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.accordions { display: grid; gap: 10px; padding: 26px 36px 36px; }
.accordion { border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.accordion summary { display: flex; justify-content: space-between; gap: 20px; padding: 17px 18px; font-weight: 830; list-style: none; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { color: var(--blue); content: "+"; font-size: 22px; line-height: .8; }
.accordion[open] summary::after { content: "−"; }
.accordion[open] summary { color: var(--blue); }
.accordion-body { padding: 0 18px 18px; border-top: 1px solid var(--line); }
.data-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 0; }
.data-item { min-width: 0; padding: 15px 13px 15px 0; border-bottom: 1px solid #eceff2; }
.data-item dt { margin: 0 0 5px; color: #757e87; font-size: 9px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; }
.data-item dd { margin: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.45; }
.contact-line { margin: 17px 0 0; padding: 13px 14px; border-left: 3px solid var(--blue-bright); background: var(--blue-pale); font-size: 13px; }
.asset-list, .social-list { margin: 0; padding: 0; list-style: none; }
.asset-list li, .social-list li { padding: 14px 0; border-bottom: 1px solid #eceff2; }
.asset-list strong { display: block; margin-bottom: 4px; }
.asset-total { margin: 17px 0 0; color: var(--blue); font-size: 21px; font-weight: 830; }
.social-list a { color: var(--blue); overflow-wrap: anywhere; text-underline-offset: 3px; }
.footer { padding: 24px 0 45px; color: var(--muted); font-size: 12px; line-height: 1.65; }
.footer strong { color: var(--ink); }

@media (max-width: 1080px) {
  .candidate-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .page-columns { grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
  .page-columns .candidate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-hero-inner { grid-template-columns: minmax(0, 1fr) 280px; }
  .filters-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .home-hero-inner { grid-template-columns: 1fr; gap: 24px; padding-bottom: 92px; }
  .source-stamp { max-width: 500px; }
  .candidate-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-columns { grid-template-columns: 1fr; }
  .election-news { position: static; }
  .advanced-grid, .data-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-hero { grid-template-columns: 210px minmax(0, 1fr); gap: 28px; padding: 28px; }
  .profile-stats { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .wrap { width: min(100% - 22px, 1260px); }
  .brandbar-inner { min-height: 72px; }
  .site-logo img { width: 184px; }
  .brandbar-links span:first-child { display: none; }
  .brandbar-links { font-size: 11px; }
  .home-hero-inner { padding: 32px 0 88px; }
  h1 { font-size: clamp(35px, 11vw, 48px); }
  .deck { font-size: 15px; }
  .source-stamp { display: none; }
  [data-candidate-browser] { margin-top: -62px; }
  .filters-heading { align-items: flex-start; }
  .filters-heading h2 { font-size: 21px; }
  .filters-primary, .advanced-grid { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .filters-heading, .advanced-filters summary { padding-left: 16px; padding-right: 16px; }
  .candidate-grid, .page-columns .candidate-grid, .relation-grid, .data-grid { grid-template-columns: 1fr; }
  .card-photo { aspect-ratio: 4 / 3.45; }
  .results-head { align-items: flex-start; flex-direction: column; gap: 10px; }
  .profile-hero { grid-template-columns: 1fr; padding: 20px; }
  .profile-photo { width: min(250px, 100%); }
  .profile h2 { font-size: clamp(36px, 12vw, 52px); }
  .profile-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .relations, .accordions { padding-left: 18px; padding-right: 18px; }
  .profile-actions .button { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
