.rep-app {
  --ink: #17212f;
  --muted: #5d6878;
  --line: #d8dee8;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --accent: #176f82;
  --accent-2: #8c3f21;
  --navy: #102a43;
  --gold: #e7a72f;
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 20px 72px;
  color: var(--ink);
  overflow-x: hidden;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 6px;
  background: #fff;
  color: #17212f;
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus { transform: translateY(0); }

.rep-app :focus-visible {
  outline: 3px solid #f2a900;
  outline-offset: 3px;
}

.rep-app,
.rep-app *,
.rep-app *::before,
.rep-app *::after {
  box-sizing: border-box;
}

.rep-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: end;
  padding: 42px 32px 30px;
  margin-top: 22px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8fbfd 0%, #edf6f7 62%, #fff7e8 100%);
  border: 1px solid #d6e5e8;
  box-shadow: 0 18px 45px rgba(16, 42, 67, .08);
}

.rep-hero h1 {
  max-width: 820px;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
  color: var(--navy);
  font-size: clamp(2.35rem, 5vw, 4.5rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}

.rep-hero .lede {
  max-width: 780px;
  font-size: 1.16rem;
  line-height: 1.65;
}

.trust-row,
.topic-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.trust-row span,
.topic-chips button,
.small-action {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 14px;
}

.topic-chips button,
.small-action {
  cursor: pointer;
  min-height: 44px;
}

.topic-chips button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.rep-status,
.rep-controls,
.article-origin,
.member-panel,
.topic-panel,
.tracker-panel,
.committee-meetings-panel,
.source-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.rep-status {
  padding: 18px;
  border-top: 4px solid var(--gold);
  box-shadow: 0 10px 24px rgba(16, 42, 67, .08);
}

.instructions {
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.instructions summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 16px;
  color: var(--navy);
  font-weight: 800;
  cursor: pointer;
}

.instructions-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--navy);
  color: #fff;
}

.instructions-hint { margin-left: auto; color: var(--muted); font-size: 13px; font-weight: 600; }
.instructions-body { padding: 0 20px 18px 58px; color: var(--muted); }
.instructions-body ol { margin: 0; padding-left: 20px; }
.instructions-body li + li { margin-top: 10px; }
.instructions-body p { margin: 14px 0 0; }

.journey {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.journey li {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 11px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.journey span { grid-row: 1 / 3; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #e6f2f4; color: #115362; font-weight: 900; }
.journey strong { color: var(--navy); }
.journey small { color: var(--muted); }

.section-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  color: var(--navy);
}

.section-kicker span { border-radius: 999px; padding: 5px 9px; background: var(--navy); color: #fff; font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }

.rep-status p,
.lookup-note,
.source-panel p,
.member-meta,
.vote-meta,
.vote-summary,
.source-card p {
  color: var(--muted);
}

.donor-review-panel {
  margin: 14px 0;
  border: 1px solid #d7c08f;
  border-radius: 8px;
  background: #fffaf0;
}

.donor-review-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--navy);
}

.donor-review-panel summary span {
  border-radius: 999px;
  padding: 4px 8px;
  background: #8c3f21;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.donor-review-body {
  padding: 0 12px 12px;
  color: var(--muted);
}

.donor-review-gate {
  margin-top: 0;
  color: #6f331d;
}

.donor-buckets {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.donor-buckets div {
  padding: 10px;
  border: 1px solid #ead8ad;
  border-radius: 8px;
  background: #fff;
}

.donor-buckets dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.donor-buckets dd {
  margin: 4px 0 0;
  color: var(--navy);
  font-weight: 900;
}

.donor-warnings {
  margin: 12px 0 0;
  padding-left: 20px;
}

.rep-controls {
  padding: 22px;
  margin: 18px 0 22px;
}

.article-origin {
  padding: 16px 18px;
  margin: -4px 0 22px;
  background: #f7fbfb;
}

.article-origin p {
  margin: 0;
  color: var(--muted);
}

.lookup-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.5fr) minmax(140px, .8fr) 150px 120px 150px 200px;
  gap: 14px;
  align-items: end;
}

.lookup-grid label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
}

.lookup-grid select,
.lookup-grid input,
.lookup-action button {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}

.lookup-action button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(23, 111, 130, .2);
}

.lookup-action button:disabled {
  opacity: .7;
  cursor: wait;
}

.lookup-note {
  margin: 12px 0 0;
  font-size: 13px;
}

.member-name-field { grid-column: 1 / -1; }
.member-name-feedback {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}
.member-name-feedback:empty { display: none; }
.member-name-feedback p { margin: 0; color: var(--muted); }
.member-name-feedback button {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.member-name-feedback button:hover,
.member-name-feedback button:focus-visible { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(23, 111, 130, .12); }
.member-name-feedback span { color: var(--muted); font-size: 13px; }

.lookup-note.ok {
  color: #1f6f46;
}

.lookup-note.warn {
  color: var(--accent-2);
}

.lookup-note.busy {
  color: var(--accent);
}

.data-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.data-status.warn {
  border-left: 4px solid var(--accent-2);
  padding: 8px 10px;
  background: #fff7ed;
  color: #8a3f12;
}

.zip-candidates:empty { display: none; }
.zip-candidates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
}
.zip-candidates strong { color: var(--ink); }
.candidate-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--soft);
}

.rep-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
}

.member-panel,
.topic-panel {
  padding: 22px;
  box-shadow: 0 10px 30px rgba(16, 42, 67, .05);
}

.vote-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 10px;
}
.vote-filter-grid label { display: grid; gap: 6px; font-size: 13px; font-weight: 700; }
.vote-filter-grid select {
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 10px;
  background: #fff;
  font: inherit;
}
.coverage-note { color: var(--muted); font-size: 13px; margin: 12px 0; }
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.pagination button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.pagination button:disabled { cursor: default; opacity: .55; }
.pagination span { color: var(--muted); font-size: 14px; }

.panel-heading {
  margin-bottom: 16px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 22px;
}

.panel-heading.split {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.member-list,
.vote-results {
  display: grid;
  gap: 12px;
}

.member-card,
.vote-card,
.source-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
}

.member-card h3,
.vote-card h3,
.source-card h3 {
  margin: 0 0 7px;
  font-size: 18px;
}

.member-card h3 a,
.simple-rep-card h3 a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--accent);
}

.member-card h3 a:hover,
.simple-rep-card h3 a:hover,
.member-card h3 a:focus-visible,
.simple-rep-card h3 a:focus-visible {
  color: var(--accent);
}

.member-card.vacant-seat {
  border-left: 5px solid var(--accent-2);
  background: #fff7ed;
}

.member-role,
.vote-tag {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 4px 9px;
  background: #e6f2f4;
  color: #115362;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .03em;
}

.member-meta,
.vote-meta,
.vote-summary {
  margin: 6px 0;
  font-size: 14px;
}

.vote-stakes {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  background: #f8fbfd;
}

.vote-stakes p {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.45;
}

.vote-stakes p + p {
  margin-top: 6px;
}

.vote-stakes-effects,
.vote-side-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.vote-stakes-list,
.vote-stakes-sides {
  margin-top: 10px;
}

.vote-stakes-list > strong,
.vote-stakes-sides > strong {
  display: block;
  margin-bottom: 5px;
  color: var(--navy);
  font-size: 13px;
}

.vote-stakes-list ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.vote-stakes-list li + li {
  margin-top: 4px;
}

.vote-side-grid p {
  padding: 8px 10px;
  border: 1px solid #dce6ea;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.vote-side-grid span {
  display: inline-block;
  margin-right: 6px;
  color: var(--navy);
  font-weight: 900;
}

.vote-stakes-source {
  margin-top: 10px !important;
  color: var(--muted) !important;
  font-size: 12px !important;
}

.vote-stakes-source a {
  color: var(--accent);
  font-weight: 800;
}

.vote-card.match-yea {
  border-left: 5px solid #2e7d4f;
}

.vote-card.match-nay {
  border-left: 5px solid var(--accent-2);
}

.vote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.vote-actions a,
.source-card a {
  color: var(--accent);
  font-weight: 800;
}

/* Share cards: same text-link visual language as the existing .vote-actions
   links, just on a <button> so it can run script instead of navigating. */
.vote-actions button.vote-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--accent);
  font-weight: 800;
  font-size: inherit;
  font-family: inherit;
  cursor: pointer;
}

.vote-actions button.vote-share-btn:hover,
.vote-actions button.vote-share-btn:focus-visible {
  text-decoration: underline;
}

.vote-share-icon {
  font-size: 15px;
  line-height: 1;
}

.source-panel {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
  padding: 18px;
}

.tracker-panel {
  margin-top: 22px;
  padding: 18px;
}

.alert-interest-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 440px);
  gap: 22px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.rep-alert-form { display: grid; gap: 10px; }
.rep-alert-form input[type="email"] { min-height: 44px; }
.consent-row { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.consent-row input { width: 20px; height: 20px; margin-top: 2px; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lookup-action-button { min-height: 44px; }

.tracker-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tracker-grid h3 {
  margin: 0 0 10px;
  font-size: 17px;
}

.tracker-list {
  display: grid;
  gap: 10px;
}

.tracker-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--soft);
}

.tracker-item strong {
  display: block;
  margin-bottom: 4px;
}

.tracker-item p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.tracker-date {
  color: var(--muted);
  font-size: 13px;
}

.tracker-date.warn {
  color: #8a3f12;
  font-weight: 700;
}

.committee-meetings-panel {
  margin-top: 22px;
  padding: 18px;
}

.committee-meetings-list {
  display: grid;
  gap: 20px;
}

.committee-meeting-group h3 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--ink);
}

.committee-meeting-item p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 14px;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.trust-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.trust-links a { color: #115362; font-weight: 800; }

/* --- Simple / Advanced mode toggle -------------------------------------- */
html:not([data-rep-mode="advanced"]) .advanced-only { display: none !important; }
html[data-rep-mode="advanced"] .simple-only { display: none !important; }

.mode-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 14px 0 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px 6px 6px;
  background: var(--soft);
  color: var(--navy);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.mode-toggle-switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--line);
  transition: background .15s ease;
}

.mode-toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 42, 67, .35);
  transition: transform .15s ease;
}

.mode-toggle[aria-pressed="true"] .mode-toggle-switch { background: var(--accent); }
.mode-toggle[aria-pressed="true"] .mode-toggle-switch::after { transform: translateX(16px); }

.mode-bar-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  flex: 1 1 260px;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-left: 20px !important;
}

.glossary .instructions-body { padding-left: 20px; }

.mini-explainer {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 12px;
  background: var(--soft);
}

.mini-explainer summary {
  padding: 8px 0;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  min-height: 30px;
}

.mini-explainer p,
.mini-explainer ul {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.journey-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.lookup-explainer {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.simple-member-list,
.simple-vote-list {
  display: grid;
  gap: 12px;
}

.rep-simple-members,
.rep-simple-topics,
.rep-simple-votes,
.rep-simple-upcoming {
  margin: 22px 0;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(16, 42, 67, .05);
}

.simple-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--soft);
}

.simple-empty h3 { margin: 0 0 6px; font-size: 16px; }
.simple-empty p { margin: 0; color: var(--muted); font-size: 14px; }

.simple-rep-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--soft);
}

.simple-rep-card h3 { margin: 6px 0; font-size: 20px; }
.simple-rep-card.simple-vacant { border-left: 5px solid var(--accent-2); background: #fff7ed; }

.simple-vote-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.simple-vote-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  background: var(--soft);
}

.simple-vote-card h3 { margin: 6px 0 12px; font-size: 19px; line-height: 1.35; }

.simple-position-row {
  display: grid;
  grid-template-columns: 128px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.simple-position-row button.vote-share-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper, #fff);
  padding: 6px 12px;
  color: var(--accent);
  font-weight: 800;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.simple-position-row button.vote-share-btn:hover,
.simple-position-row button.vote-share-btn:focus-visible {
  text-decoration: underline;
}

.simple-position-row:first-of-type { border-top: none; }
.simple-position-row p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.simple-position-row strong { display: block; font-size: 15px; }

.simple-position-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 8px;
  padding: 6px 10px;
  font-weight: 900;
  font-size: 15px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #fff;
  background: var(--muted);
}

.simple-position-badge.yea { background: #1f6f46; }
.simple-position-badge.nay { background: var(--accent-2); }
.simple-position-badge.present { background: var(--gold); color: #3a2a02; }
.simple-position-badge.notvoting { background: #6a7381; }
.simple-position-badge.other { background: #3a4a5c; }

.simple-no-rep-note {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eef4f6;
  color: var(--muted);
  font-size: 14px;
}

.simple-context-list {
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 14px;
}

.simple-context-list li + li { margin-top: 4px; }

.simple-show-more {
  display: block;
  margin: 16px auto 0;
}

/* display:block above beat the browser's own [hidden] rule, so the script
   setting simpleShowMore.hidden = true left the button on screen. That put
   "Show more votes (N more available)" directly under "No matching recorded
   votes for this topic yet." — the page contradicting itself. */
.simple-show-more[hidden] { display: none; }

.topic-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.topic-tile {
  display: grid;
  gap: 6px;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.topic-tile strong { font-size: 15px; }
.topic-tile span { color: var(--muted); font-size: 12px; }

.topic-tile.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.topic-tile.active span { color: rgba(255, 255, 255, .85); }

.topic-tile.disabled {
  opacity: .55;
  cursor: not-allowed;
  background: var(--soft);
}

.simple-search-field {
  display: grid;
  gap: 7px;
  max-width: 480px;
  font-weight: 700;
  font-size: 14px;
}

.simple-search-field input {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  font: inherit;
  background: #fff;
}

.simple-upcoming-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.simple-upcoming-card h3 { margin: 0 0 10px; font-size: 17px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media (forced-colors: active) {
  .rep-app :focus-visible {
    outline: 3px solid Highlight;
  }
  .topic-chips button.active,
  .lookup-action button {
    border: 2px solid ButtonText;
    forced-color-adjust: auto;
  }
}

@media (max-width: 900px) {
  .rep-hero,
  .rep-layout,
  .tracker-grid,
  .source-panel,
  .alert-interest-panel,
  .lookup-grid,
  .vote-filter-grid,
  .journey,
  .journey-4,
  .simple-upcoming-grid,
  .vote-stakes-effects,
  .vote-side-grid {
    grid-template-columns: 1fr;
  }
  .simple-position-row {
    grid-template-columns: 1fr;
  }
}

/* Astra QA F2 (2026-09-25): a rule here hid .site-header .nav-links at <=700px
   and, loading after styles.css with equal specificity, also beat the shared
   ".nav-links.is-open{display:flex}" — so the phone menu opened invisibly.
   The shared styles.css already collapses the nav behind the Menu button at
   <=820px, so this page-level rule is removed. */

@media (max-width: 560px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }
  .site-header {
    width: 100%;
    max-width: 100%;
  }
  .rep-app {
    width: 100%;
    max-width: 100%;
    padding-inline: 14px;
  }
  .rep-app *,
  .rep-app *::before,
  .rep-app *::after {
    max-width: 100%;
  }
  .rep-app p,
  .rep-app h1,
  .rep-app h2,
  .rep-app h3,
  .rep-app a,
  .rep-app input,
  .rep-app select {
    overflow-wrap: anywhere;
  }
  .rep-hero h1 {
    font-size: 36px;
    line-height: 1.12;
  }
  .rep-hero { padding: 28px 20px 22px; }
  .instructions-hint { display: none; }
  .instructions-body { padding: 0 16px 16px; }
  .lookup-grid select,
  .lookup-grid input {
    min-width: 0;
  }
  .rep-status,
  .rep-controls,
  .member-panel,
  .topic-panel,
  .source-panel,
  .committee-meetings-panel,
  .member-card,
  .vote-card,
  .source-card,
  .rep-simple-members,
  .rep-simple-topics,
  .rep-simple-votes,
  .rep-simple-upcoming,
  .simple-rep-card,
  .simple-vote-card,
  .simple-empty,
  .mode-bar,
  .topic-search-feedback,
  .mini-request-form {
    min-width: 0;
  }
  .panel-heading.split {
    display: grid;
  }
  .source-grid {
    grid-template-columns: 1fr;
  }
  .glossary-grid {
    grid-template-columns: 1fr;
  }
  .rep-simple-members,
  .rep-simple-topics,
  .rep-simple-votes,
  .rep-simple-upcoming {
    padding: 16px;
  }
  .topic-tile-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }
  .topic-search-chip-row {
    grid-template-columns: 1fr;
  }
}

/* --- Smart topic window: "Did you mean" / zero-result / matched-topic note --- */
.topic-search-feedback:empty { display: none; }
.topic-search-feedback.has-content {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--soft);
}

.topic-search-note {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.topic-search-options p,
.topic-search-zero p {
  margin: 0 0 10px;
  font-size: 14px;
}

.topic-search-suboption {
  color: var(--muted);
  font-size: 13px !important;
}

.topic-search-chip-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.topic-search-chip {
  display: grid;
  gap: 2px;
  text-align: left;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.topic-search-chip:hover { border-color: var(--accent); }

.topic-search-chip.vote-chip strong {
  font-size: 13px;
  font-weight: 700;
}

.topic-search-chip.vote-chip span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.mini-request-form {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  max-width: 420px;
}

.mini-request-form input[type="email"] { min-height: 44px; }
.mini-request-form button { min-height: 44px; }

/* Candidate structure pass: action first, teaching stays available on demand. */
.rep-app {
  --ink: #183c35;
  --muted: #566961;
  --line: #d8dfd2;
  --panel: #fffdf7;
  --soft: #f1efe6;
  --accent: #246247;
  --accent-2: #9a4c31;
  --navy: #183c35;
  --gold: #d6b15f;
  overflow-x: visible;
}
.rep-hero {
  display: block;
  margin-top: 12px;
  padding: clamp(28px,4vw,46px);
  background: linear-gradient(135deg,#fffdf7 0%,#eef1df 62%,#eedbcd 100%);
  border-color: var(--line);
}
.rep-hero h1 { max-width: 760px; }
.rep-boundaries { margin: 16px 0; }
.rep-controls-primary {
  margin-top: 16px;
  border: 2px solid #9fb49a;
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 0 18px 44px rgba(24,60,53,.11);
}
.rep-controls-primary .section-kicker span { background: var(--accent); }
.rep-controls-primary .lookup-action button { min-height: 48px; background: var(--navy); border-color: var(--navy); }
.lookup-grid label span small { color: var(--muted); font-weight: 500; }
.local-results-scroll { min-width: 0; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.instructions { background: #fffdf7; }
.mode-bar { border-color: var(--line); background: #eef1df; }
@media (max-width: 560px) {
  html, body { overflow-x: visible; }
  .rep-app { padding-inline: 12px; }
  .rep-hero { padding: 25px 18px 22px; }
  .rep-hero h1 { font-size: 34px; line-height: 1.06; }
  .rep-hero .lede { font-size: 16px; line-height: 1.5; }
  .rep-status { padding: 14px; }
  .rep-controls-primary { padding: 18px 15px; }
  .lookup-grid input,.lookup-grid select,.lookup-action button { min-height: 48px; font-size: 16px; }
  .local-results-scroll { max-width: 100%; }
}

/* --- Member extras: election countdown + missed-vote percentage --- */
.member-extra { margin: 6px 0; }

.election-countdown {
  font-size: 14px;
  font-weight: 700;
  color: var(--navy);
}

.election-countdown.warn { color: #8a3f12; }

.election-countdown .member-extra-note {
  font-weight: 400;
  color: var(--muted);
}

.attendance p {
  margin: 4px 0;
  font-size: 14px;
}

/* Money headline on the member card — added 2026-09-12.
   David: "What about the function that shows where they get their money... I just need to make
   sure that it's easily visible for people to find." The breakdown was accurate but collapsed
   inside a toggle called "Campaign funding buckets", so nobody found it. This puts the answer
   on the card itself; the full table stays in the toggle underneath. */
.donor-headline {
  margin: 12px 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--line, #d8dfd2);
  border-left: 4px solid var(--gold, #d6b15f);
  border-radius: 10px;
  background: rgba(214, 177, 95, .07);
}
.donor-headline-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 8px;
}
.donor-headline-total span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted, #566961);
}
.donor-headline-total strong {
  font-size: 21px;
  letter-spacing: -.01em;
  /* On a 375px phone the flex row squeezed the figure and it broke mid-digits
     ("$2,699,3 16"). A dollar amount must never wrap. */
  white-space: nowrap;
}
@media (max-width: 430px) {
  /* Stack the label above the figure rather than fighting for the same line. */
  .donor-headline-total { display: block; }
  .donor-headline-total span { display: block; margin-bottom: 2px; }
}
.donor-headline-split {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}
.donor-headline-split li { color: var(--muted, #566961); }
.donor-headline-split b { color: var(--ink, #183c35); font-weight: 800; }

/* UNDA-82 — the "votes current through" line, in the view readers actually use.
   It was only in the Advanced coverage note, which Simple view hides. */
.simple-freshness {
  margin: 0 0 14px;
  padding: 10px 13px;
  border-radius: 9px;
  border: 1px solid var(--line, #d8dfd2);
  background: var(--panel, #fffdf7);
  color: var(--muted, #566961);
  font-size: 13.5px;
  line-height: 1.5;
}
.simple-freshness strong { color: var(--ink, #183c35); }

/* Named committees — who actually gave, and what they are. Added 2026-09-12.
   David: "we need to be able to identify the packs and what special groups to put them together"
   Built from the FEC's FREE bulk files into one static file per member, so a visitor fetches
   ~26 KB and the server does no work. No API, no key, no per-user cost at any traffic level. */
.pac-detail { margin: 14px 0 4px; }
.pac-summary {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin: 0 0 16px; padding: 0; list-style: none; font-size: 14px;
}
.pac-summary li { color: var(--muted, #566961); }
.pac-summary b { color: var(--ink, #183c35); }
.pac-group { margin: 0 0 18px; }
.pac-group h4 {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline;
  margin: 0 0 3px; font-size: 15px;
}
.pac-group h4 span { font-size: 13px; font-weight: 500; color: var(--muted, #566961); }
.pac-blurb { margin: 0 0 9px; font-size: 13px; color: var(--muted, #566961); }
.pac-list { margin: 0; padding: 0; list-style: none; }
.pac-list li {
  display: grid; grid-template-columns: 92px 1fr; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--line, #d8dfd2); align-items: baseline;
}
.pac-amount { font-weight: 800; font-size: 14.5px; white-space: nowrap; }
.pac-who a { font-weight: 650; font-size: 14.5px; }
.pac-who small { display: block; margin-top: 1px; font-size: 12.5px; color: var(--muted, #566961); }
@media (max-width: 430px) {
  /* Amount above the name rather than a cramped two-column squeeze. */
  .pac-list li { grid-template-columns: 1fr; gap: 2px; }
}

/* --- Promise-scorecard badge ---------------------------------------------
   Shown only on members who have a written promise scorecard. It states that
   a scorecard exists and links to that member's section; it never grades,
   scores, or ranks the member. Colour is a supporting signal only: the badge
   always carries its own words, so it still reads in black and white and to a
   colour-blind reader. Palette is the tool's existing --accent / --soft. */
.rv-scorecard-line { margin: 2px 0 8px; }

.rv-scorecard-badge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  max-width: 100%;
  padding: 5px 11px;
  border: 1px solid var(--accent, #176f82);
  border-left: 4px solid var(--accent, #176f82);
  border-radius: 999px;
  background: var(--soft, #f4f7fb);
  color: var(--accent, #176f82);
  font-size: 13.5px;
  line-height: 1.35;
  font-weight: 800;
  text-decoration: none;
}

.rv-scorecard-badge:hover,
.rv-scorecard-badge:focus-visible {
  background: var(--accent, #176f82);
  color: #fff;
  border-color: var(--accent, #176f82);
}

.rv-scorecard-badge:hover .rv-scorecard-dot,
.rv-scorecard-badge:focus-visible .rv-scorecard-dot { background: #fff; }

.rv-scorecard-badge:hover .rv-scorecard-go,
.rv-scorecard-badge:focus-visible .rv-scorecard-go { color: #fff; }

.rv-scorecard-dot {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: var(--accent, #176f82);
}

.rv-scorecard-text { white-space: nowrap; }

.rv-scorecard-go {
  font-weight: 600;
  font-size: 12.5px;
  color: var(--muted, #5d6878);
}

.rv-scorecard-go::after { content: " \2192"; }

@media (max-width: 430px) {
  /* Phone: the badge stacks its own two lines instead of overflowing. */
  .rv-scorecard-badge { border-radius: 12px; align-items: flex-start; }
  .rv-scorecard-go { display: block; width: 100%; }
}

@media (prefers-contrast: more), (forced-colors: active) {
  .rv-scorecard-badge { border-width: 2px; }
}

/* ===================================================================== */
/* Plain words on every vote                                             */
/* Added 2026-09-21 after David walked the live tool:                    */
/*   "It says 'On ordering previous question H Res 1438'. How would you  */
/*    vote? I have no fucking clue what H-res 1438 is."                  */
/* The plain sentence is now the headline. The official wording stays    */
/* directly underneath, smaller, because that is what they will search   */
/* for if they go and look the vote up themselves.                       */
/* ===================================================================== */

.rv-plain-title {
  font-size: 1.12rem;
  line-height: 1.45;
  margin: 0 0 0.35rem;
  font-weight: 650;
}

.rv-official-title {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0.72;
}

.rv-official-title span {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  opacity: 0.8;
  margin-right: 0.35rem;
}

/* A process vote read as a policy vote is the worst thing this tool can
   do to a reader. The warning is never colour alone - it always says the
   words "This is a process vote." */
.rv-procedural-flag {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
  border-left: 4px solid #b8860b;
  background: rgba(184, 134, 11, 0.09);
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.rv-yeanay {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.rv-yeanay li {
  padding: 0.4rem 0.65rem;
  border-radius: 6px;
  font-size: 0.9rem;
  line-height: 1.45;
  border: 1px solid rgba(127, 127, 127, 0.28);
}

.rv-yeanay-yea { border-left: 4px solid #1f7a3d; }
.rv-yeanay-nay { border-left: 4px solid #a32b2b; }

.rv-official-text summary { cursor: pointer; }

.rv-source-note {
  font-size: 0.82rem;
  opacity: 0.75;
  line-height: 1.45;
}

@media (max-width: 640px) {
  .rv-plain-title { font-size: 1.04rem; }
}

/* ===================================================================== */
/* "The votes that decided something" - the way in                       */
/* David, 2026-09-21: "I can't find a way to check their score on        */
/*  anything. I think we need to have a top 10 of the highest-profile    */
/*  votes and it should be said what it is, and then a search for how    */
/*  they can look for the rest of the votes."                            */
/* ===================================================================== */

.headline-votes-list {
  display: grid;
  gap: 0.85rem;
  margin: 0.75rem 0 1rem;
}

.headline-vote {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border: 1px solid rgba(127, 127, 127, 0.28);
  border-radius: 10px;
}

.headline-rank {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  opacity: 0.45;
  font-variant-numeric: tabular-nums;
}

.headline-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  line-height: 1.45;
}

.headline-count {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.headline-why {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.88;
}

.headline-method summary { cursor: pointer; }
.headline-method ul { margin: 0.5rem 0 0; padding-left: 1.1rem; }
.headline-method li { margin-bottom: 0.45rem; line-height: 1.5; font-size: 0.88rem; }

.headline-votes-more {
  font-size: 0.9rem;
  line-height: 1.5;
  opacity: 0.85;
}

/* Meetings: say plainly whether the meeting can change anything. */
.rv-meeting-power {
  font-size: 0.88rem;
  line-height: 1.5;
  opacity: 0.9;
  margin: 0.2rem 0 0.4rem;
}

/* The results list needs a way out, not just a way further down. */
.simple-list-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.simple-collapsed-note { text-align: left; }

@media (max-width: 640px) {
  .headline-vote { grid-template-columns: 1.75rem 1fr; padding: 0.75rem 0.8rem; }
  .headline-body h3 { font-size: 1rem; }
}

/* --- Astra QA fixes, 2026-09-25 ------------------------------------------ */
.rv-amendment-context,
.rv-action-note {
  margin: 0 0 0.75rem;
  padding: 0.6rem 0.75rem;
  border-left: 4px solid var(--accent, #176f82);
  background: rgba(23, 111, 130, 0.07);
  border-radius: 0 6px 6px 0;
  font-size: 0.88rem;
  line-height: 1.5;
}
.rv-amendment-context a { margin-left: 4px; }
.focused-vote-banner h3 { margin-bottom: 8px; }
.focused-vote-banner .vote-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.attendance .member-extra-note { font-weight: 400; color: var(--muted); }
.rv-scorecard-none { color: var(--muted); font-size: 0.9rem; }
.rv-scorecard-none .rv-scorecard-text { font-weight: 700; color: var(--ink, inherit); }
.nonvoting-note { font-size: 0.88rem; }
.vote-share-fallback { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 0.88rem; }
.vote-share-download { font-weight: 700; }
.rv-poll__nocount { font-size: 0.88rem; color: var(--muted); }
