/* ===== Base ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: #111;
  background: #0b1220; /* dark background */
}

/* ===== Nav ===== */
.nav {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px 18px;
  background: #0a1730;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.nav a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-size: 14px;
}
.nav a:hover { text-decoration: underline; }
.brand a { font-weight: 700; }

/* ===== Layout ===== */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px;
}

.card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 16px;
  padding: 16px;
  color: rgba(255,255,255,0.95);
}

/* ===== Typography ===== */
h1 { margin: 0 0 8px; font-size: 28px; }
h2 { margin: 18px 0 10px; font-size: 18px; }
p { margin: 0 0 12px; line-height: 1.5; }
.muted { color: rgba(255,255,255,0.70); }

/* ===== UI helpers ===== */
.page-head { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; }
.pill {
  padding: 6px 10px;
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 999px;
  font-size: 14px;
  background: rgba(0,0,0,0.12);
  color: rgba(255,255,255,0.9);
}

.grid { display: grid; gap: 12px; }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid.cols-3 { grid-template-columns: 1fr; } }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin: 14px 0 18px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.field.checkbox { min-width: 200px; }
.field.actions { min-width: auto; flex-direction: row; gap: 10px; }

label { font-size: 13px; color: rgba(255,255,255,0.75); }
input, select {
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 12px;
  font-size: 14px;
  background: rgba(0,0,0,0.20);
  color: rgba(255,255,255,0.92);
  outline: none;
}
input::placeholder { color: rgba(255,255,255,0.45); }

.btn {
  display: inline-block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.92);
  color: #0b1220;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}
.btn.secondary {
  background: rgba(0,0,0,0.18);
  color: rgba(255,255,255,0.92);
}
.btn.disabled { opacity: .45; pointer-events: none; }

.empty { padding: 22px; border: 1px dashed rgba(255,255,255,0.25); border-radius: 14px; background: rgba(0,0,0,0.10); }
.empty-title { font-weight: 800; margin-bottom: 6px; }

.mp-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  text-decoration: none;
  color: rgba(255,255,255,0.92);
  background: rgba(0,0,0,0.12);
}
.mp-card:hover { border-color: rgba(255,255,255,0.22); }

.mp-photo {
  width: 62px; height: 62px;
  border-radius: 14px;
  overflow: hidden;
  flex: 0 0 auto;
  background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
}
.mp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-placeholder { font-size: 12px; color: rgba(255,255,255,0.65); }

.mp-name { font-weight: 800; line-height: 1.2; }
.mp-sub { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.06);
  font-size: 12px;
  width: max-content;
}

.footer {
  margin-top: 14px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
/* ===== MP Profile ===== */
.profile.profile { padding: 16px; }
.profile-head { display: flex; gap: 16px; align-items: flex-start; }
.profile-photo { width: 120px; height: 120px; border-radius: 18px; overflow: hidden; flex: 0 0 auto; background: rgba(255,255,255,0.08); display:flex; align-items:center; justify-content:center; }
.profile-photo img { width: 100%; height: 100%; object-fit: cover; display:block; }

.profile-main { flex: 1 1 auto; min-width: 0; }
.profile-title { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.profile-title h1 { margin: 0; }

.status { font-size: 12px; padding: 6px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.16); }
.status.current { background: rgba(0,0,0,0.16); }
.status.former { background: rgba(0,0,0,0.10); opacity: .9; }

.profile-badges { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.badge.link { text-decoration: none; }
.badge.link:hover { text-decoration: underline; }

.kv { margin-top: 12px; display: grid; gap: 8px; max-width: 520px; }
.kv-row { display: grid; grid-template-columns: 140px 1fr; gap: 10px; padding: 10px 12px; border: 1px solid rgba(255,255,255,0.10); border-radius: 14px; background: rgba(0,0,0,0.10); }
.kv-k { color: rgba(255,255,255,0.65); font-size: 13px; }
.kv-v { color: rgba(255,255,255,0.92); font-weight: 650; }

.profile-panels { margin-top: 14px; }
.card.subtle { background: rgba(0,0,0,0.10); }

.bullets { margin: 10px 0 0; padding-left: 18px; color: rgba(255,255,255,0.85); }
.empty.small { padding: 14px; border-radius: 14px; }
@media (max-width: 800px) {
  .profile-head { flex-direction: column; }
  .profile-photo { width: 110px; height: 110px; }
  .kv-row { grid-template-columns: 1fr; }
}
.badge.party {
  border: 1px solid rgba(255,255,255,0.18);
  font-weight: 700;
}

.party-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 8px;
  vertical-align: middle;
  border: 1px solid rgba(255,255,255,0.18);
}

.party-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.party-card-left {
  min-width: 0;
}

.party-card-right {
  flex: 0 0 auto;
}

/* ===== FORCE LIGHT LINKS (high specificity) ===== */

/* Any link anywhere */
a,
a:visited {
  color: #BFDFFF !important;
  text-decoration: underline;
}

/* Links inside cards (most of your site) */
.card a,
.card a:visited,
.card a:hover {
  color: #CFE8FF !important;
}

/* MP cards, party cards, constituency cards */
.mp-card a,
.mp-card a:visited,
.mp-card:hover a {
  color: #D8ECFF !important;
}

/* Headings that contain links */
h1 a, h2 a, h3 a, h4 a {
  color: #E3F2FF !important;
}

/* Constituency + MP name links */
.mp-name a,
.list-item a {
  color: #E0F0FF !important;
  text-decoration: underline;
}

/* Navigation links */
.nav a,
.nav a:visited {
  color: #E6F2FF !important;
}

.nav a:hover {
  color: #FFFFFF !important;
}

/* Do NOT affect party badges */
.badge.party,
.badge.party a {
  color: inherit !important;
  text-decoration: none !important;
}
/* ===== Division detail header + breakdown ===== */
.division-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.division-title h1 { margin: 0; }

.division-meta {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.12);
  color: rgba(255,255,255,0.9);
  font-size: 12px;
}

.notice {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.12);
  color: rgba(255,255,255,0.92);
}

.notice.warn {
  border-color: rgba(255, 200, 0, 0.35);
  background: rgba(255, 200, 0, 0.10);
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.pill.big {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.12);
}

.pill-k { color: rgba(255,255,255,0.75); font-size: 12px; }
.pill-v { font-weight: 800; font-size: 14px; }

@media (max-width: 800px) {
  .division-head { flex-direction: column; }
}

/* ===== Vote grouping (division detail) ===== */
.vote-groups { display: grid; gap: 10px; margin-top: 10px; }

.vote-group {
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  background: rgba(0,0,0,0.10);
  padding: 8px 10px;
}

.vote-group summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 4px;
}

.vote-group summary::-webkit-details-marker { display: none; }

.vg-left { display: inline-flex; align-items: center; gap: 10px; }
.vg-title { font-weight: 800; }
.vg-count {
  font-weight: 800;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.12);
}

.vote-group[open] { border-color: rgba(255,255,255,0.20); }
.vote-group[open] summary .vg-hint { opacity: 0.7; }
