*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --green-dark:   #1e5631;
  --green-mid:    #2d7a45;
  --green-light:  #e8f5ee;
  --green-border: #b2d8be;
  --accent:       #3a9a5c;
  --text:         #1a1a1a;
  --text-muted:   #555;
  --bg:           #f7faf8;
  --white:        #ffffff;
  --badge-responded-bg:  #d4edda;
  --badge-responded-fg:  #155724;
  --badge-no-bg:         #e9ecef;
  --badge-no-fg:         #495057;
  --radius:       8px;
  --shadow:       0 2px 8px rgba(0,0,0,.10);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 1rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ── Site branding banner (matches main site) ── */
.site-banner-wrap {
  width: 100%;
}

.site-banner {
  width: 100%;
  max-height: 150px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

.site-title-wrap {
  text-align: center;
  padding-top: 2px;
  padding-bottom: 0;
}

.site-title {
  font-family: "Times New Roman", Times, serif;
  font-size: 32px;
  font-weight: bold;
  color: #333;
  margin: 2px 0 4px;
}

.site-tagline {
  font-size: .95rem;
  color: var(--text-muted);
  margin-bottom: .35rem;
}

.site-footer-main {
  margin-top: 2rem;
  text-align: center;
}

.footer-contact {
  font-family: "Times New Roman", Times, serif;
  font-size: 18px;
  color: #444;
  margin-bottom: 20px;
}

.footer-contact a {
  color: green;
}

/* ── Header ── */
.site-header {
  background: var(--green-dark);
  color: var(--white);
  padding: .65rem 1rem;
}

.site-header h1 {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.site-header .subtitle {
  display: none;
}

/* ── Notice ── */
.notice {
  background: #fff8e1;
  border-left: 4px solid #f0ad00;
  padding: .75rem 1rem;
  font-size: .85rem;
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* ── Footer ── */
.site-footer {
  margin-top: 2rem;
  padding: 1rem 0 2rem;
}

/* ── Filters ── */
.filters {
  margin-top: .4rem;
  margin-bottom: .75rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
  justify-content: center;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-start;
}

.race-btn,
.status-btn {
  background: var(--white);
  border: 2px solid var(--green-border);
  color: var(--green-dark);
  border-radius: 999px;
  padding: .4rem .9rem;
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  white-space: nowrap;
}

.race-btn:hover,
.status-btn:hover {
  background: var(--green-light);
}

.race-btn.active,
.status-btn.active {
  background: var(--green-dark);
  color: var(--white);
  border-color: var(--green-dark);
}

.search-wrap {
  flex: 1;
  min-width: 200px;
}

.search-input {
  width: 100%;
  padding: .5rem .85rem;
  border: 2px solid var(--green-border);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}

.search-input:focus {
  border-color: var(--green-mid);
}

/* ── Results count ── */
.results-count {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

/* ── Candidate grid ── */
.candidates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
  margin-bottom: 2.5rem;
}

/* ── Office group header ── */
.office-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .5rem 0 .25rem;
  border-bottom: 2px solid var(--green-border);
  margin-top: .75rem;
}

.office-header:first-child {
  margin-top: 0;
}

.office-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--green-dark);
}

.office-header-sub {
  font-size: .8rem;
  color: var(--text-muted);
}

/* ── Candidate card ── */
.card {
  background: var(--white);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .85rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .25rem;
}

.card-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.2;
}

.card-office {
  font-size: .8rem;
  color: var(--text-muted);
}

.candidate-actions {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .55rem;
}

.candidate-actions .btn {
  width: auto;
  min-width: 0;
  min-height: 26px;
  padding: .14rem .52rem;
  border-radius: 7px;
  font-size: .76rem;
  font-weight: 600;
  line-height: 1.1;
  box-shadow: 0 2px 5px rgba(0,0,0,.14);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.candidate-actions .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 9px rgba(0,0,0,.16);
}

.candidate-actions .btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

.candidate-actions .btn-primary {
  background: #24783a;
  color: var(--white);
  border: 1px solid #24783a;
}

.candidate-actions .btn-primary:hover {
  background: #1e6431;
}

.candidate-actions .btn-thank {
  background: #fff8df;
  color: #5a4100;
  border: 1px solid #e0c56a;
}

.candidate-actions .btn-thank:hover {
  background: #fef0b8;
}

.card-no-response {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: .14rem .52rem;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 600;
  background: #f3f4f1;
  color: #555;
  border: 1px solid #d7d9d2;
  cursor: pointer;
  white-space: nowrap;
  transition: background 160ms ease, transform 160ms ease;
}

.card-no-response:hover {
  background: #e9ece5;
  transform: translateY(-1px);
}

.card-no-response:active {
  transform: translateY(1px);
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .3rem;
  min-height: 40px;
  padding: .48rem .78rem;
  border-radius: 9px;
  font-size: .92rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  line-height: 1.1;
  box-shadow: 0 1px 3px rgba(0,0,0,.10);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 3px 7px rgba(0,0,0,.13);
}

.btn:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0,0,0,.10);
}

.btn-primary {
  background: #2f7d46;
  color: var(--white);
  border: 1px solid #2f7d46;
}

.btn-primary:hover {
  background: #276b3c;
}

.btn-secondary {
  background: var(--green-light);
  color: var(--green-dark);
  border: 1px solid var(--green-border);
}

.btn-ghost {
  background: transparent;
  color: var(--green-mid);
  border: 1px solid var(--green-border);
}

.btn-thank {
  background: #fff7df;
  color: #5c4200;
  border: 1px solid #e0c56a;
}

.btn-thank:hover {
  background: #fef0b8;
}

.btn-ask {
  background: #f0f4ff;
  color: #2c4080;
  border: 1px solid #b8c4f0;
}

.btn-ask:hover {
  background: #dce6ff;
}

.btn-no-response {
  display: inline-flex;
  align-items: center;
  padding: .3rem .7rem;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 600;
  background: var(--badge-no-bg);
  color: var(--badge-no-fg);
  border: 1px solid #ccc;
  cursor: default;
  user-select: none;
}

/* ── Contact modal buttons ── */
.btn-contact-action {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .48rem .85rem;
  border-radius: 9px;
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--green-light);
  color: var(--green-dark);
  border: 1px solid var(--green-border);
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(0,0,0,.10);
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.btn-contact-action:hover {
  background: #d4eddb;
  transform: translateY(-1px);
  box-shadow: 0 3px 7px rgba(0,0,0,.13);
}

.btn-contact-action:active {
  transform: translateY(1px);
  box-shadow: 0 1px 2px rgba(0,0,0,.10);
}

.btn-copy-contact {
  position: absolute;
  top: .45rem;
  right: .45rem;
  padding: .18rem .55rem;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: var(--green-dark);
  color: var(--white);
  opacity: .82;
  transition: opacity .15s;
}

.btn-copy-contact:hover { opacity: 1; }

/* ── Screen-reader only ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ── Empty state ── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── Process note ── */
.process-note {
  background: #f9fafb;
  border: 1px solid #dde3e8;
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin-bottom: 1.5rem;
  font-size: .8rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.process-note p + p {
  margin-top: .5rem;
}

.process-note-title {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: #888;
  margin-bottom: .4rem;
}

/* ── Compare page nav ── */
.compare-back-nav {
  margin: .3rem 0 .4rem;
}

.compare-back-link {
  font-size: .88rem;
  font-weight: 600;
  color: var(--green-mid);
  text-decoration: none;
}

.compare-back-link:hover {
  text-decoration: underline;
}

.join-pill,
.join-pill:hover,
.join-pill:visited {
  background: var(--green-light);
  border-color: var(--green-mid);
  color: var(--green-dark);
}

.compare-pill,
.compare-pill:hover,
.compare-pill:visited {
  text-decoration: none;
  font-size: .72rem;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  padding: .3rem .75rem;
}

/* ── Compare section ── */
.compare-section {
  background: var(--white);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}

.compare-intro {
  font-size: .9rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
}

.compare-section h2 {
  font-size: 1.15rem;
  color: var(--green-dark);
  margin-bottom: 1rem;
  text-align: center;
}

.compare-selects {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.compare-select-wrap {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.compare-select-wrap label {
  font-size: .85rem;
  font-weight: 600;
  color: var(--green-dark);
}

.compare-select-wrap select {
  padding: .5rem .75rem;
  border: 2px solid var(--green-border);
  border-radius: var(--radius);
  font-size: .9rem;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
}

.compare-select-wrap select:focus {
  outline: none;
  border-color: var(--green-mid);
}

.compare-output {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.compare-question-block {
  border-top: 1px solid var(--green-border);
  padding-top: 1rem;
}

.compare-question-label {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--green-mid);
  margin-bottom: .35rem;
}

.compare-question-text {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.compare-answers {
  display: grid;
  grid-template-columns: 1fr;
  gap: .75rem;
}

@media (min-width: 640px) {
  .compare-answers {
    grid-template-columns: 1fr 1fr;
  }
}

.compare-answer-col {
  background: var(--green-light);
  border-radius: var(--radius);
  padding: .75rem;
}

.compare-col-name {
  font-size: .8rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .4rem;
}

.compare-col-text {
  font-size: .88rem;
  white-space: pre-wrap;
  color: var(--text);
}

.compare-col-text.no-response {
  color: var(--text-muted);
  font-style: italic;
}

.compare-tip {
  font-size: .82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: .35rem;
  opacity: 1;
  transition: opacity 600ms ease;
  text-align: center;
}

.compare-prompt {
  color: var(--text-muted);
  font-size: .9rem;
  font-style: italic;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding: 1rem;
  overflow-y: auto;
}

.modal-overlay[hidden] {
  display: none;
}

.modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 720px;
  margin: 2rem auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0,0,0,.22);
}

.modal-close {
  position: sticky;
  top: 0;
  float: right;
  background: transparent;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: .5rem .75rem;
  z-index: 1;
}

.modal-close:hover { color: var(--text); }

.modal-content {
  padding: .5rem 1.25rem 1.75rem;
  clear: both;
}

.modal-candidate-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: .25rem;
}

.modal-office {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.modal-response-date {
  font-size: .8rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1.25rem;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--green-border);
}

.modal-meta a {
  color: var(--green-mid);
}

.modal-cta {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  font-size: .88rem;
  color: var(--text-muted);
}

.modal-cta-btn {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 30px;
  padding: .18rem .7rem;
}

/* ── Contact modal content ── */
.contact-instructions {
  font-size: .88rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .85rem;
  line-height: 1.5;
}

.contact-preview {
  position: relative;
  background: var(--green-light);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 1rem;
  font-size: .88rem;
  line-height: 1.65;
  color: var(--text);
  margin-bottom: 1.1rem;
}

.contact-address-line {
  font-size: .88rem;
  margin-bottom: .65rem;
  color: var(--text);
}

.contact-address-line a {
  color: var(--green-mid);
  font-weight: 600;
}

.contact-preview-body {
  white-space: pre-wrap;
  display: block;
  margin-top: .5rem;
}

.contact-preview-sig {
  display: block;
  margin-top: .5rem;
  color: var(--text-muted);
  font-size: .85rem;
}


.contact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: .75rem;
}

.contact-address {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .75rem;
}

.contact-source-note {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .5rem;
  line-height: 1.5;
}

.contact-source-note a {
  color: var(--green-mid);
}

.contact-no-info {
  font-size: .82rem;
  color: var(--text-muted);
  font-style: italic;
  margin-top: .25rem;
}

.modal-process-note {
  margin-top: 1.25rem;
  padding: .75rem .9rem;
  background: #f9fafb;
  border: 1px solid #dde3e8;
  border-radius: var(--radius);
  font-size: .78rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.responses-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.response-item {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
}

.response-label {
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--green-mid);
  margin-bottom: .2rem;
}

.response-question {
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .4rem;
}

.response-answer {
  font-size: .95rem;
  white-space: pre-wrap;
  color: var(--text);
}

.no-response-box {
  background: var(--green-light);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  font-size: .95rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── No-response info modal title ── */
.modal-info-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-dark);
  margin-bottom: 1rem;
}

.modal-info-title + p,
.modal-info-title ~ p {
  font-size: .92rem;
  color: var(--text);
  margin-bottom: .75rem;
  line-height: 1.6;
}

/* ── Mobile tap targets ── */
@media (max-width: 600px) {
  .btn {
    min-height: 44px;
    padding: .55rem .85rem;
  }

  .candidate-actions .btn {
    min-height: 40px;
    padding: .45rem .7rem;
    font-size: .82rem;
  }

  .btn-contact-action {
    min-height: 44px;
  }

  .card-no-response {
    min-height: 40px;
    padding: .35rem .65rem;
  }

  .race-btn,
  .status-btn {
    min-height: 40px;
    padding: .5rem 1rem;
  }

  .modal {
    margin: .5rem auto;
  }

  .modal-content {
    padding: .5rem 1rem 1.5rem;
  }
}

/* ── Narrow card stacking ── */
@media (max-width: 420px) {
  .candidate-actions {
    flex-direction: column;
  }

  .candidate-actions .btn {
    min-width: 160px;
  }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .btn-contact-action,
  .card-no-response,
  .candidate-actions .btn {
    transition: none;
  }

  .btn:hover,
  .btn:active,
  .btn-contact-action:hover,
  .btn-contact-action:active,
  .card-no-response:hover,
  .card-no-response:active,
  .candidate-actions .btn:hover,
  .candidate-actions .btn:active {
    transform: none;
  }
}

/* ── Modal join footer ── */
.modal-join-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--green-border);
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(2rem);
  background: var(--green-dark);
  color: var(--white);
  padding: .6rem 1.2rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  white-space: nowrap;
  z-index: 200;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Print ── */
@media print {
  .filters, .compare-section, .modal-overlay, .toast, .candidate-actions { display: none !important; }
  .site-header { background: var(--green-dark) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .modal-content { padding: 0; }
}
