/* ==========================================================================
   TPR Elected Officials Directory — shared stylesheet
   Load once site-wide (or on directory pages only). Everything is scoped
   under .tprdir so it cannot collide with the theme.
   ========================================================================== */

.tprdir {
  --navy: #273e5a;
  --navy-dark: #1c2e44;
  --bronze: #926b38;
  --bronze-light: #b08a55;
  --light: #f7fafd;
  --green: #496b42;
  --red: #822008;
  --ink: #1f2a37;
  --muted: #5b6878;
  --line: #dfe5ec;
  --card: #ffffff;
  --rep: #822008;
  --dem: #273e5a;
  --ind: #5b6878;
  --radius: 10px;
  --font: "Trade Gothic Next", "Trade Gothic LT Std", "Trade Gothic", "Libre Franklin", "Helvetica Neue", Arial, sans-serif;

  font-family: var(--font);
  color: var(--ink);
  line-height: 1.5;
  font-size: 16px;
  max-width: 1080px;
  margin: 0 auto;
  box-sizing: border-box;
}
.tprdir *, .tprdir *::before, .tprdir *::after { box-sizing: inherit; }
.tprdir a { color: var(--navy); }
.tprdir a:hover { color: var(--bronze); }
.tprdir h1, .tprdir h2, .tprdir h3 { font-family: var(--font); color: var(--navy); line-height: 1.2; margin: 0; }
.tprdir .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Shared pieces ---------- */
.tprdir .crumbs { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.tprdir .crumbs a { color: var(--muted); text-decoration: none; }
.tprdir .crumbs a:hover { color: var(--bronze); text-decoration: underline; }
.tprdir .crumbs span[aria-hidden] { margin: 0 6px; }

.tprdir .badge {
  display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
  background: var(--light); color: var(--navy); border: 1px solid var(--line);
  white-space: nowrap;
}
.tprdir .badge.party-R { background: var(--rep); color: #fff; border-color: var(--rep); }
.tprdir .badge.party-D { background: var(--dem); color: #fff; border-color: var(--dem); }
.tprdir .badge.party-I, .tprdir .badge.party-L { background: var(--ind); color: #fff; border-color: var(--ind); }
.tprdir .badge.body { background: var(--navy); color: #fff; border-color: var(--navy); }
.tprdir .badge.bronze { background: var(--bronze); color: #fff; border-color: var(--bronze); }
.tprdir .badge.status-elect { background: #fff; color: var(--green); border-color: var(--green); }
.tprdir .badge.status-outgoing { background: #fff; color: var(--muted); border-color: var(--muted); }
.tprdir .badge.status-vacant { background: #eef1f4; color: var(--muted); }

.tprdir .btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  font-family: var(--font); font-size: 13px; font-weight: 700; letter-spacing: .03em;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--navy);
  background: var(--navy); color: #fff !important; text-decoration: none; cursor: pointer;
  line-height: 1.2;
}
.tprdir .btn:hover { background: var(--navy-dark); }
.tprdir .btn.ghost { background: #fff; color: var(--navy) !important; }
.tprdir .btn.ghost:hover { background: var(--light); }
.tprdir .btn.bronze { background: var(--bronze); border-color: var(--bronze); text-transform: uppercase; }
.tprdir .btn.bronze:hover { background: #7c5a2f; }

.tprdir .avatar {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: center 20%;
  background: var(--light); border: 3px solid var(--line); flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--navy); font-size: 28px;
}
.tprdir .avatar.party-R { border-color: var(--rep); }
.tprdir .avatar.party-D { border-color: var(--dem); }

.tprdir .panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-bottom: 18px; break-inside: avoid;
}
.tprdir .panel > h2 {
  font-size: 18px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--navy);
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
}
.tprdir .panel > h2 .anchor {
  font-size: 13px; color: var(--muted); text-decoration: none; opacity: 0; transition: opacity .15s;
}
.tprdir .panel:hover > h2 .anchor, .tprdir .panel > h2 .anchor:focus { opacity: 1; }
.tprdir .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- HUB ---------- */
.tprdir .hub-head { text-align: center; margin-bottom: 18px; }
.tprdir .hub-head h1 { font-size: 30px; margin-bottom: 6px; }
.tprdir .hub-head p { color: var(--muted); margin: 0 auto; max-width: 640px; }

.tprdir .tabs {
  display: flex; gap: 4px; border-bottom: 2px solid var(--navy); margin-bottom: 18px;
  overflow-x: auto; scrollbar-width: none;
}
.tprdir .tabs::-webkit-scrollbar { display: none; }
.tprdir .tab {
  font-family: var(--font); font-size: 14px; font-weight: 700; white-space: nowrap;
  padding: 10px 16px; border: 1px solid var(--line); border-bottom: none;
  border-radius: 8px 8px 0 0; background: var(--light); color: var(--navy); cursor: pointer;
}
.tprdir .tab[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.tprdir .tab .count { font-weight: 400; opacity: .75; margin-left: 4px; }

.tprdir .summary {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: center;
  background: var(--light); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 16px;
}
.tprdir .leaders { display: flex; flex-wrap: wrap; gap: 22px; }
.tprdir .leader { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.tprdir .leader .avatar { width: 52px; height: 52px; font-size: 16px; border-width: 2px; }
.tprdir .leader strong { display: block; color: var(--navy); font-size: 14px; }
.tprdir .leader small { color: var(--muted); font-size: 12px; }

.tprdir .partisan .bar {
  display: flex; height: 26px; border-radius: 6px; overflow: hidden; margin: 6px 0;
  font-size: 12px; font-weight: 700; color: #fff;
}
.tprdir .partisan .bar span { display: flex; align-items: center; justify-content: center; min-width: 26px; }
.tprdir .partisan .seg-R { background: var(--rep); }
.tprdir .partisan .seg-D { background: var(--dem); }
.tprdir .partisan .seg-O { background: var(--ind); }
.tprdir .partisan .seg-V { background: #c9d1da; color: var(--ink); }
.tprdir .partisan .legend { font-size: 12px; color: var(--muted); }

.tprdir .toolbar {
  display: grid; grid-template-columns: 2fr repeat(3, 1fr) auto; gap: 10px; align-items: end;
  margin-bottom: 10px;
}
.tprdir .toolbar label { display: block; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.tprdir .toolbar input, .tprdir .toolbar select {
  width: 100%; font-family: var(--font); font-size: 14px; padding: 9px 10px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink);
}
.tprdir .toolbar input:focus, .tprdir .toolbar select:focus { outline: 2px solid var(--bronze); outline-offset: 1px; }
.tprdir .viewtoggle { display: inline-flex; border: 1px solid var(--navy); border-radius: 999px; overflow: hidden; }
.tprdir .viewtoggle button {
  font-family: var(--font); font-size: 13px; font-weight: 700; padding: 8px 14px;
  border: none; background: #fff; color: var(--navy); cursor: pointer;
}
.tprdir .viewtoggle button[aria-pressed="true"] { background: var(--navy); color: #fff; }

.tprdir .resultline { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin: 6px 0 14px; flex-wrap: wrap; }
.tprdir .linklike { background: none; border: none; padding: 0; font: inherit; color: var(--bronze); font-weight: 700; cursor: pointer; text-decoration: underline; }

.tprdir .grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.tprdir .card {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 12px 14px; text-decoration: none; color: var(--ink);
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.tprdir .card:hover { box-shadow: 0 6px 18px rgba(39,62,90,.14); transform: translateY(-2px); border-color: var(--bronze-light); color: var(--ink); }
.tprdir .card .avatar { margin-bottom: 10px; }
.tprdir .card .name { font-weight: 700; color: var(--navy); font-size: 16px; }
.tprdir .card .where { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.tprdir .card .badges { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.tprdir .card.vacant .name { color: var(--muted); }

.tprdir table.list { width: 100%; border-collapse: collapse; font-size: 14px; background: #fff; }
.tprdir table.list th {
  text-align: left; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  border-bottom: 2px solid var(--navy); padding: 8px; cursor: pointer; white-space: nowrap; user-select: none;
}
.tprdir table.list th[aria-sort="ascending"]::after { content: " ▲"; }
.tprdir table.list th[aria-sort="descending"]::after { content: " ▼"; }
.tprdir table.list td { border-bottom: 1px solid var(--line); padding: 8px; vertical-align: middle; }
.tprdir table.list tr:hover td { background: var(--light); }
.tprdir table.list .who { display: flex; align-items: center; gap: 10px; }
.tprdir table.list .avatar { width: 36px; height: 36px; font-size: 12px; border-width: 2px; }
.tprdir table.list a { font-weight: 700; text-decoration: none; }
.tprdir .tablewrap { overflow-x: auto; }

.tprdir .empty { text-align: center; padding: 40px 10px; color: var(--muted); }
.tprdir .hub-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 22px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ---------- OFFICIAL PAGE ---------- */
.tprdir .hero {
  display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: start;
  background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--navy);
  border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
}
.tprdir .hero.party-R { border-top-color: var(--rep); }
.tprdir .hero.party-D { border-top-color: var(--dem); }
.tprdir .hero .avatar { width: 140px; height: 140px; font-size: 40px; border-width: 4px; }
.tprdir .hero .badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.tprdir .hero h1 { font-size: 30px; }
.tprdir .hero .seat { font-size: 17px; color: var(--muted); margin: 2px 0 10px; }
.tprdir .hero .lede { margin: 0 0 12px; }
.tprdir .facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 0; font-size: 14px; }
.tprdir .facts div { display: flex; gap: 6px; }
.tprdir .facts dt { font-weight: 700; color: var(--navy); }
.tprdir .facts dd { margin: 0; }
.tprdir .hero .actions { display: flex; flex-direction: column; gap: 8px; min-width: 190px; }

.tprdir .jump {
  position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none;
  background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px; margin-bottom: 18px;
}
.tprdir .jump::-webkit-scrollbar { display: none; }
.tprdir .jump a {
  font-size: 13px; font-weight: 700; text-decoration: none; color: var(--navy);
  padding: 6px 12px; border-radius: 999px; white-space: nowrap;
}
.tprdir .jump a:hover, .tprdir .jump a.on { background: var(--navy); color: #fff; }

.tprdir .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.tprdir .cols > .panel { margin-bottom: 0; }
.tprdir .section-gap { height: 18px; }

.tprdir .office { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-bottom: 10px; font-size: 14px; }
.tprdir .office .eyebrow { display: block; margin-bottom: 4px; }
.tprdir .office address { font-style: normal; }
.tprdir .office a.tel { font-weight: 700; text-decoration: none; }
.tprdir .contact-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tprdir .contact-row + .contact-row { margin-top: 8px; }
.tprdir .social {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; text-decoration: none;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--navy);
}
.tprdir .social:hover { border-color: var(--bronze); }
.tprdir .social svg { width: 14px; height: 14px; fill: currentColor; }

.tprdir .map { display: block; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 12px; background: var(--light); }
.tprdir .map img { display: block; width: 100%; height: auto; }
.tprdir .map-ph { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.tprdir .kv { margin: 0 0 12px; font-size: 14px; }
.tprdir .kv dt { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tprdir .kv dd { margin: 2px 0 10px; }

.tprdir .committees { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tprdir .committee { border: 1px solid var(--line); border-left: 4px solid var(--navy); border-radius: 6px; padding: 10px 12px; }
.tprdir .committee.chair { border: 2px solid #926b38; border-left-width: 4px; background: #fbf7f1; }
.tprdir .committee.chair .eyebrow { color: #926b38; }
.tprdir .committee .eyebrow { display: block; }
.tprdir .committee a, .tprdir .committee span.cname { font-weight: 700; text-decoration: none; color: var(--navy); }
.tprdir .session-label { font-size: 13px; color: var(--muted); margin: -6px 0 12px; }

.tprdir .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tprdir .stat { border: 1px solid var(--line); border-radius: 8px; padding: 12px; text-align: center; }
.tprdir .stat b { display: block; font-size: 28px; color: var(--navy); line-height: 1.1; }
.tprdir .stat .eyebrow { display: block; margin-top: 4px; }

.tprdir .bio { font-size: 15px; }
.tprdir .bio .more[hidden] { display: none; }
.tprdir section.panel[hidden], .tprdir .jump a[hidden] { display: none; }
.tprdir .source-note { font-size: 12px; color: var(--muted); font-style: italic; margin-top: 10px; }

.tprdir .service { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.tprdir .service li { position: relative; padding: 0 0 12px 18px; font-size: 14px; }
.tprdir .service li::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); }
.tprdir .service li.current::before { background: var(--bronze); border-color: var(--bronze); }
.tprdir .service b { color: var(--navy); }

.tprdir .finance-slot { min-height: 60px; }
.tprdir .coverage-list { list-style: none; margin: 0; padding: 0; }
.tprdir .coverage-list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.tprdir .coverage-list li:last-child { border-bottom: none; }
.tprdir .coverage-list a { font-weight: 700; text-decoration: none; }
.tprdir .coverage-list time { display: block; font-size: 12px; color: var(--muted); }
.tprdir .coverage-more { margin-top: 12px; }

.tprdir .page-foot { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 6px; }
.tprdir .copied { font-size: 12px; color: var(--green); font-weight: 700; margin-left: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  .tprdir .toolbar { grid-template-columns: 1fr 1fr; }
  .tprdir .toolbar .f-search { grid-column: 1 / -1; }
  .tprdir .summary { grid-template-columns: 1fr; }
  .tprdir .hero { grid-template-columns: auto 1fr; }
  .tprdir .hero .actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; min-width: 0; }
  .tprdir .cols, .tprdir .committees { grid-template-columns: 1fr; }
  .tprdir .cols > .panel + .panel { margin-top: 0; }
}
@media (max-width: 560px) {
  .tprdir { font-size: 15px; }
  .tprdir .hero { grid-template-columns: 1fr; text-align: center; padding: 18px; }
  .tprdir .hero .avatar { margin: 0 auto; width: 120px; height: 120px; }
  .tprdir .hero .badges, .tprdir .facts, .tprdir .hero .actions { justify-content: center; }
  .tprdir .hero h1 { font-size: 25px; }
  .tprdir .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tprdir .card .avatar { width: 76px; height: 76px; }
  .tprdir .stats { grid-template-columns: 1fr; }
  .tprdir .stat b { font-size: 24px; }
}

@media print {
  .tprdir .jump, .tprdir .toolbar, .tprdir .tabs, .tprdir .hero .actions, .tprdir .viewtoggle { display: none !important; }
  .tprdir .panel, .tprdir .hero { break-inside: avoid; border-color: #bbb; }
  .tprdir .panel > h2 { break-after: avoid; }
}

/* ---------- COMMITTEES & SENIORITY ---------- */
.tprdir .subnav { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: -6px 0 18px; }
.tprdir .subnav a { font-size: 13px; font-weight: 700; text-decoration: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--navy); }
.tprdir .subnav a.on, .tprdir .subnav a:hover { background: var(--navy); color: #fff; border-color: var(--navy); }

.tprdir .cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tprdir .ccard {
  display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--line);
  border-top: 4px solid var(--navy); border-radius: var(--radius); padding: 16px; color: var(--ink);
}
.tprdir .ccard:hover { box-shadow: 0 6px 18px rgba(39,62,90,.12); border-color: var(--bronze-light); }
.tprdir .ccard h3 { font-size: 17px; }
.tprdir .ccard h3 a { text-decoration: none; color: var(--navy); }
.tprdir .ccard .badges { display: flex; gap: 4px; flex-wrap: wrap; }
.tprdir .ccard .lead { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; font-size: 13px; }
.tprdir .ccard .lead a { font-weight: 700; text-decoration: none; }
.tprdir .ccard .meta { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.tprdir .minibar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: #c9d1da; }
.tprdir .minibar .seg-R { background: var(--rep); } .tprdir .minibar .seg-D { background: var(--dem); } .tprdir .minibar .seg-O { background: var(--ind); }
.tprdir .subs { border-top: 1px dashed var(--line); padding-top: 8px; font-size: 13px; }
.tprdir .subs ul { list-style: none; margin: 6px 0 0; padding: 0; }
.tprdir .subs li { padding: 3px 0; }
.tprdir .subs a { text-decoration: none; font-weight: 700; }
.tprdir .ccard.dissolved { opacity: .7; border-top-color: var(--muted); }

.tprdir .leadcards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tprdir .leadcard { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-left: 4px solid var(--bronze); border-radius: 8px; padding: 12px; text-decoration: none; color: var(--ink); }
.tprdir .leadcard:hover { border-color: var(--bronze); color: var(--ink); }
.tprdir .leadcard .avatar { width: 60px; height: 60px; font-size: 18px; border-width: 2px; }
.tprdir .leadcard strong { display: block; color: var(--navy); font-size: 16px; }
.tprdir .leadcard small { color: var(--muted); font-size: 13px; }

.tprdir .roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.tprdir .rmember { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; text-decoration: none; color: var(--ink); font-size: 13px; }
.tprdir .rmember:hover { border-color: var(--bronze-light); background: var(--light); color: var(--ink); }
.tprdir .rmember .avatar { width: 38px; height: 38px; font-size: 12px; border-width: 2px; }
.tprdir .rmember b { display: block; color: var(--navy); font-size: 14px; }
.tprdir .rmember small { color: var(--muted); }

.tprdir .charges { margin: 0; padding-left: 20px; font-size: 15px; }
.tprdir .charges li { margin-bottom: 10px; }
.tprdir .charges b { color: var(--navy); }

.tprdir table.list td.num, .tprdir table.list th.num { text-align: right; }
.tprdir table.list .rank { font-weight: 700; color: var(--navy); width: 48px; }
@media (max-width: 860px) { .tprdir .leadcards { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .tprdir .cgrid { grid-template-columns: 1fr; } .tprdir .roster { grid-template-columns: 1fr; } }

/* ---------- Banner, CTA, jurisdiction, explainer ---------- */
.tprdir .banner { display: block; width: 100%; aspect-ratio: 6 / 1; object-fit: cover; border-radius: 8px; margin: 0 0 22px; background: #d9d4cc; filter: sepia(.35); }
.tprdir .banner[src*="Elected-Officials-Directory-"] { filter: none; }
.tprdir .banner-ph { display: flex; align-items: center; justify-content: center; color: #6b6255; font-size: 13px; filter: none; background: repeating-linear-gradient(45deg,#e4ded4,#e4ded4 12px,#ddd6ca 12px,#ddd6ca 24px); }
.tprdir .cta { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.tprdir .cta > div { background: var(--navy); color: #fff; border-radius: 6px; padding: 18px; text-align: center; }
.tprdir .cta > div.light { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.tprdir .cta h3 { color: inherit; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 8px; }
.tprdir .cta p { font-size: 13px; margin: 0 0 12px; opacity: .9; }
.tprdir .cta .btn { text-transform: uppercase; }
.tprdir .charges ul { margin: 6px 0 0; padding-left: 18px; list-style: circle; }
.tprdir .charges ul li { margin-bottom: 4px; font-size: 14px; }
.tprdir .cols.wide-narrow { grid-template-columns: 2fr 1fr; }
.tprdir .rules { margin: 0; padding-left: 18px; font-size: 14px; }
.tprdir .rules li { margin-bottom: 6px; }
.tprdir .rules-intro, .tprdir .rules-outro { font-size: 14px; margin: 0 0 8px; }
.tprdir .rules-outro { margin-top: 8px; }
.tprdir .kvbox { border: 1px solid var(--line); border-radius: 8px; padding: 10px; text-align: center; margin-bottom: 10px; }
.tprdir .kvbox .eyebrow { display: block; }
.tprdir .kvbox b { color: var(--navy); }
.tprdir .explain p { margin: 0 0 12px; }
.tprdir .factors { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; margin-top: 6px; }
.tprdir .factor { background: var(--light); border: 1px solid var(--line); border-radius: 8px; padding: 12px; font-size: 14px; }
.tprdir .factor .eyebrow { display: block; color: var(--bronze); }
.tprdir .factor b { display: block; color: var(--navy); margin: 2px 0 4px; text-transform: uppercase; font-size: 13px; letter-spacing: .04em; }
.tprdir .chambercards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.tprdir .chambercard { display: block; border-radius: 8px; overflow: hidden; background: var(--navy); color: #fff; text-decoration: none; text-align: center; }
.tprdir .chambercard .banner { aspect-ratio: 16 / 7; margin: 0; border-radius: 0; }
.tprdir .chambercard strong { display: block; padding: 12px 10px 2px; letter-spacing: .06em; text-transform: uppercase; font-size: 14px; }
.tprdir .chambercard span { display: block; padding: 0 10px 12px; font-size: 12px; color: #d9b98a; }
.tprdir .chambercard:hover { color: #fff; filter: brightness(1.08); }
@media (max-width: 860px) { .tprdir .cols.wide-narrow { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .tprdir .cta, .tprdir .chambercards { grid-template-columns: 1fr; } .tprdir .banner { aspect-ratio: 3 / 1; } }

.tprdir .termtoggle { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 0 14px; }
.tprdir .termtoggle button { font-family: var(--font); font-size: 13px; font-weight: 700; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--bronze); background: #fff; color: var(--bronze); cursor: pointer; }
.tprdir .termtoggle button[aria-pressed="true"] { background: var(--bronze); color: #fff; }

/* Long county / city lists: first dozen inline, the rest behind a toggle (added by the script) */
.tprdir .longlist .rest[hidden] { display: none; }
.tprdir .morebtn { background: none; border: 0; padding: 0; margin-left: 6px; font: inherit; font-size: 13px; font-weight: 700; color: var(--bronze); cursor: pointer; white-space: nowrap; }
.tprdir .morebtn:hover { text-decoration: underline; }

/* Address finder on the hub */
.tprdir .finder { background: var(--light); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; margin: 0 0 22px; }
.tprdir .finder h2 { font-size: 18px; margin: 0 0 10px; }
.tprdir .finder form { display: flex; gap: 8px; flex-wrap: wrap; }
.tprdir .finder input { flex: 1 1 320px; min-width: 0; font: inherit; font-size: 15px; padding: 10px 12px; border: 1px solid #b9c3cf; border-radius: 6px; background: #fff; }
.tprdir .finder input:focus { outline: 2px solid var(--bronze); outline-offset: 1px; }
.tprdir .finder-note { font-size: 12px; color: var(--muted); margin: 8px 0 0; }
.tprdir .finder-status { margin: 14px 0 6px; }
.tprdir .fgroup { margin-top: 14px; }
.tprdir .fgroup h3 { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.tprdir .fcard { display: inline-flex; gap: 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px 8px 8px; margin: 0 8px 8px 0; text-decoration: none; color: var(--ink); min-width: 240px; vertical-align: top; }
.tprdir a.fcard:hover { border-color: var(--bronze); }
.tprdir .fcard .avatar.sm { width: 48px; height: 48px; font-size: 15px; border-width: 2px; flex: none; }
.tprdir .fcard .who { display: flex; flex-direction: column; line-height: 1.3; }
.tprdir .fcard b { color: var(--navy); }
.tprdir .fcard small { color: var(--muted); font-size: 12px; }
.tprdir .fcard .when { font-style: normal; font-size: 11px; font-weight: 700; color: var(--bronze); text-transform: uppercase; letter-spacing: .04em; }
.tprdir .fnote { font-size: 14px; margin: 12px 0 0; }
.tprdir .linkish { background: none; border: 0; padding: 0; font: inherit; font-size: 12px; font-weight: 700; color: var(--bronze); cursor: pointer; text-transform: none; letter-spacing: 0; }
.tprdir .linkish:hover { text-decoration: underline; }
@media (max-width: 560px) { .tprdir .fcard { display: flex; min-width: 0; margin-right: 0; } }

/* Key session dates strip on the hub */
.tprdir .keydates { margin: 0 0 22px; }
.tprdir .keydates h2 { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.tprdir .keydates ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.tprdir .keydates li { border: 1px solid var(--line); border-top: 3px solid var(--navy); border-radius: 6px; padding: 8px 10px; background: #fff; display: flex; flex-direction: column; gap: 2px; }
.tprdir .keydates time { font-weight: 700; color: var(--navy); font-size: 14px; }
.tprdir .keydates span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.tprdir .keydates li.next { border-top-color: var(--bronze); background: #fbf7f1; }
.tprdir .keydates li.next time { color: var(--bronze); }
.tprdir .keydates li.past { opacity: .55; }
@media (max-width: 860px) { .tprdir .keydates ol { grid-template-columns: repeat(2, 1fr); } }
/* Liberty Index panel (appears only when a score is filled in) */
.tprdir .liscore { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.tprdir .liscore b { font-size: 40px; color: var(--bronze); line-height: 1; }
.tprdir .liscore span { color: var(--muted); }

/* District profile */
.tprdir .pstat { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 14px; }
.tprdir .pstat > div { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.tprdir .pstat b { display: block; font-size: 22px; color: var(--navy); line-height: 1.15; }
.tprdir .pstat span { font-size: 12px; color: var(--muted); }
.tprdir .pbar, .tprdir .pres { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #e6e9ee; }
.tprdir .pbar .seg, .tprdir .pres .seg { display: block; height: 100%; }
.tprdir .seg.h, .tprdir .pkey i.h { background: #926b38; } .tprdir .seg.a, .tprdir .pkey i.a { background: #273e5a; }
.tprdir .seg.b, .tprdir .pkey i.b { background: #496b42; } .tprdir .seg.s, .tprdir .pkey i.s { background: #c9a46a; }
.tprdir .seg.o, .tprdir .pkey i.o { background: #b9c3cf; }
.tprdir .pkey { list-style: none; padding: 0; margin: 8px 0 16px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.tprdir .pkey i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.tprdir .psub { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 6px 0 10px; }
.tprdir .prace { display: grid; grid-template-columns: 130px 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px; font-size: 14px; }
.tprdir .prace .plabel { font-weight: 700; color: var(--navy); }
.tprdir .seg.r { background: #822008; } .tprdir .seg.d { background: #273e5a; }
.tprdir .pnums b.r { color: #822008; } .tprdir .pnums b.d { color: #273e5a; }
@media (max-width: 560px) { .tprdir .prace { grid-template-columns: 1fr; gap: 4px; } }

/* CSV button, archive tab */
.tprdir .btn.sm { padding: 5px 12px; font-size: 12px; }
.tprdir .resultline { gap: 10px; flex-wrap: wrap; }
.tprdir .summary.archive { display: block; }
.tprdir .summary.archive p { margin: 0; color: var(--muted); max-width: 760px; }

/* "Print this list" from the address finder: only the results print */
@media print {
  html.tprdir-printing-finder body * { visibility: hidden !important; }
  html.tprdir-printing-finder .tprdir [data-finder-out], html.tprdir-printing-finder .tprdir [data-finder-out] * { visibility: visible !important; }
  html.tprdir-printing-finder .tprdir [data-finder-out] { position: absolute; left: 0; top: 0; width: 100%; }
  html.tprdir-printing-finder .tprdir [data-finder-out]::before { content: "Your elected officials · Texas Policy Research · texaspolicyresearch.com/legislative-directory/"; display: block; font-weight: 700; margin-bottom: 10px; }
  html.tprdir-printing-finder .tprdir .linkish { display: none !important; }
  html.tprdir-printing-finder .tprdir .fcard { break-inside: avoid; border-color: #999; }
}

.tprdir table.list small.of{color:var(--muted);font-size:.85em}
.tprdir details.subs > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tprdir details.subs > summary::-webkit-details-marker { display: none; }
.tprdir details.subs > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; margin-right: 4px; }
.tprdir details.subs[open] > summary::after { transform: rotate(-135deg); }
.tprdir details.subs > summary:focus-visible { outline: 2px solid var(--bronze, #926b38); outline-offset: 2px; }

/* committee cards: chair / vice chair headshots over the names, and a More Info button (matches the published committee hub) */
.tprdir .ccard .lead { align-items: start; }
.tprdir .ccard .officer { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.tprdir .ccard .avatar.cav { width: 52px; height: 52px; font-size: 16px; border-width: 2px; margin-bottom: 4px; }
.tprdir .ccard .more { margin-top: auto; align-self: flex-start; }
/* directory list view: every column centered except the Official column */
.tprdir table.dirlist th, .tprdir table.dirlist td { text-align: center; }
.tprdir table.dirlist th:first-child, .tprdir table.dirlist td:first-child { text-align: left; }

/* Headshots: TPR's headshot images are a full-bleed party-colored disc on a white square, so the disc itself is the ring.
   Drop the CSS border on photos and clip just inside the disc's edge; otherwise the white corners show as a hairline. */
.tprdir img.avatar { border: 0 !important; background: transparent; clip-path: circle(calc(50% - 1.5px) at 50% 50%); object-position: center; }

/* interactive district map */
.tprdir .dmap { position: relative; height: 340px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin-bottom: 6px; background: #eef0f2; z-index: 0; }
.tprdir .dmap.dmap-static { height: auto; background: var(--light); }
.tprdir .dmap.dmap-static img, .tprdir .dmap noscript img { display: block; width: 100%; height: auto; }
.tprdir .dmap .leaflet-container, .tprdir .dmap.leaflet-container { font: 12px/1.4 inherit; background: #eef0f2; }
.tprdir .dmap .leaflet-tile { filter: grayscale(1) contrast(.82) brightness(1.08); }
.tprdir .dmap-label { background: transparent; border: 0; box-shadow: none; font-weight: 800; font-size: 13px; color: #1b2430;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff; letter-spacing: .02em; }
.tprdir .dmap-label::before { display: none; }
.tprdir .dmap-tip { font-size: 12px; }
.tprdir .dmap path.leaflet-interactive { cursor: pointer; }
.tprdir .map-links { margin: 0 0 12px; font-size: 13px; }
@media (max-width: 640px) { .tprdir .dmap { height: 280px; } }
@media print { .tprdir .dmap { height: 300px; break-inside: avoid; } .tprdir .dmap .leaflet-control-container { display: none; } }
