:root {
  --yea: #1a7f37;
  --nay: #c62828;
  --present: #b07d10;
  --nv: #777;
  --ann: #5b5bd6;
  --dem: #2e6fd8;
  --rep: #d84a4a;
  --oth: #777;
  --border: #e2e2e2;
  --bg-soft: #f7f7f9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #222;
  background: #fff;
}

a { color: #2058b0; text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.site-header .brand { font-weight: 700; font-size: 18px; color: #222; }
.site-header .brand:hover { text-decoration: none; }
.site-header .tagline { color: #666; font-size: 13px; }

main { min-height: 70vh; }

footer {
  border-top: 1px solid var(--border);
  margin-top: 40px;
  padding: 16px 22px;
  font-size: 12px;
  color: #666;
}

.page { max-width: 1200px; margin: 0 auto; padding: 20px 22px; }
.crumb { margin-bottom: 10px; font-size: 14px; }

h1 { font-size: 24px; margin: 6px 0; }
h2 { font-size: 16px; margin: 18px 0 8px; }

.sub { color: #666; font-size: 13px; }
.sub.big { font-size: 15px; margin-top: 2px; }
.nowrap { white-space: nowrap; }

/* ---------- search page ---------- */

.search-page { max-width: 640px; margin: 10vh auto 0; padding: 0 20px; text-align: center; }
.search-page h1 { font-size: 30px; }
.search-box { position: relative; margin-top: 18px; }
#q {
  width: 100%;
  font-size: 18px;
  padding: 12px 16px;
  border: 2px solid #bbb;
  border-radius: 8px;
  outline: none;
}
#q:focus { border-color: #2058b0; }
.results {
  position: absolute;
  left: 0; right: 0;
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,.12);
  text-align: left;
  max-height: 60vh;
  overflow-y: auto;
  z-index: 10;
}
.results.hidden { display: none; }
.results li {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}
.results li.active { background: #eaf1fb; }
.results .r-name { font-weight: 600; }
.results .r-detail { color: #666; font-size: 12px; white-space: nowrap; }
.hint { color: #777; font-size: 13px; margin-top: 14px; }

/* ---------- politician page ---------- */

.person-head { border-bottom: 1px solid var(--border); padding-bottom: 10px; margin-bottom: 14px; }
.person-meta { color: #555; font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; }

table.timeline { width: 100%; border-collapse: collapse; font-size: 14px; }
table.timeline th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #777;
  border-bottom: 2px solid var(--border);
  padding: 6px 8px;
  position: sticky;
  top: 0;
  background: #fff;
}
table.timeline td { border-bottom: 1px solid var(--border); padding: 7px 8px; vertical-align: top; }
table.timeline tr:hover td { background: var(--bg-soft); }
.col-vote { width: 46%; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge.yea { color: var(--yea); background: #e5f4ea; }
.badge.nay { color: var(--nay); background: #fbe9e7; }
.badge.present { color: var(--present); background: #faf3df; }
.badge.nv { color: var(--nv); background: #eee; }
.badge.ann { color: var(--ann); background: #ececfb; }

.partyline { font-size: 13px; white-space: nowrap; }
.partyline.dem { color: var(--dem); }
.partyline.rep { color: var(--rep); }
.partyline.oth { color: var(--oth); }

/* ---------- vote page ---------- */

.vote-layout { display: flex; gap: 28px; align-items: flex-start; }
.vote-meta { flex: 0 0 320px; }
.vote-meta dl { margin: 0; font-size: 14px; }
.vote-meta dt { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #777; margin-top: 8px; }
.vote-meta dd { margin: 2px 0 0; }
ul.links { padding-left: 18px; font-size: 14px; }

table.tally { border-collapse: collapse; width: 100%; font-size: 14px; }
table.tally th, table.tally td { border-bottom: 1px solid var(--border); padding: 5px 6px; text-align: right; }
table.tally th:first-child, table.tally td:first-child { text-align: left; }
table.tally th { font-size: 11px; text-transform: uppercase; color: #777; }

.vote-columns { flex: 1; display: flex; flex-wrap: wrap; gap: 18px; }
.vcol {
  flex: 1 1 220px;
  min-width: 220px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.vcol h3 {
  margin: 0;
  padding: 8px 12px;
  font-size: 14px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
}
.vcol h3.yea { color: var(--yea); }
.vcol h3.nay { color: var(--nay); }
.vcol h3.present { color: var(--present); }
.vcol h3.nv { color: var(--nv); }
.vcol h3.ann { color: var(--ann); }
.vcol h3 .count { font-weight: 400; color: #888; }
.vcol ul { list-style: none; margin: 0; padding: 6px 0; max-height: 70vh; overflow-y: auto; }
.vcol li { padding: 3px 12px; font-size: 13px; display: flex; gap: 6px; align-items: baseline; }
.vcol li a { flex: 1; }
.tag { font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag.dem { color: var(--dem); }
.tag.rep { color: var(--rep); }
.tag.oth { color: var(--oth); }
.note { font-size: 11px; color: #999; font-style: italic; }

@media (max-width: 900px) {
  .vote-layout { flex-direction: column; }
  .vote-meta { flex: 1 1 auto; width: 100%; }
  .col-vote { width: auto; }
}
