/* ==========================================================================
   Dr. Patil Rahul – MMC Election 2026 Voter Portal (Sr. No. 39)
   ========================================================================== */

:root {
  /* Deep blue + amber palette */
  --primary:       #1e40af;  /* blue-800 */
  --primary-dark:  #1e3a8a;  /* blue-900 */
  --primary-light: #3b82f6;  /* blue-500 */
  --accent:        #fbbf24;  /* amber-400 */
  --accent-dark:   #d97706;  /* amber-600 */
  --success:       #059669;
  --wa:            #25D366;
  --download:      #d97706;
  --danger:        #dc2626;
  --danger-bg:     #fee2e2;
  --bg:            #eff6ff;  /* blue-50 */
  --surface:       #ffffff;
  --text:          #0f172a;
  --text-muted:    #64748b;
  --border:        #dbeafe;  /* blue-100 */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(180deg, #bfdbfe 0%, var(--bg) 260px);
  color: var(--text);
  margin: 0;
  min-height: 100vh;
  padding: 16px;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

/* ----- results page (shown in place of landing when $searched) ----- */
.results-page {
  padding: 8px 0;
}
.results-page-banner {
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: 0 4px 22px rgba(15, 23, 42, 0.12);
  background: #0f2947;
}
.results-page-banner img {
  width: 100%;
  height: auto;
  display: block;
}
.results-page .back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  transition: transform 0.1s, background 0.15s;
}
.results-page .back-link:hover {
  background: var(--primary-dark);
  color: var(--accent);
  transform: translateX(-2px);
}

/* ----- variants nav (small preview switcher) ----- */
.variants-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: #111827;
  color: #e5e7eb;
  border-radius: 999px;
  font-size: 12px;
  max-width: max-content;
  margin: 0 auto 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.16);
}
.variants-nav span { color: #9ca3af; padding-right: 6px; border-right: 1px solid #374151; }
.variants-nav a {
  color: #e5e7eb;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 999px;
  transition: background 0.15s;
}
.variants-nav a:hover { background: #1f2937; }
.variants-nav a.active { background: var(--accent); color: #111827; font-weight: 700; }

/* ----- modal overlay (AJAX search results) ----- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 78, 59, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  overflow-y: auto;
  animation: modal-fade 0.18s ease-out;
}
.modal-backdrop[hidden] { display: none; }
.modal-panel {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  padding: 28px;
  max-width: 980px;
  width: auto;
  min-width: 500px;     /* enough for 1 voter-card + 9-slate row without squish */
  margin: auto;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  animation: modal-slide 0.22s ease-out;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #f1f5f9;
  border: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}
.modal-close:hover { background: #e2e8f0; }
.modal-body { min-height: 120px; }
.modal-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-weight: 600;
}
.modal-loading .dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: var(--primary);
  border-radius: 50%;
  margin: 0 2px;
  animation: bounce 1s infinite;
}
.modal-loading .dot:nth-child(2) { animation-delay: 0.15s; }
.modal-loading .dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes modal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-slide { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* In the modal, tighten the results header + drop redundant section margins */
.modal-body .results-header { margin-top: 0; margin-bottom: 16px; }

@media (max-width: 640px) {
  .modal-backdrop { padding: 0; }
  .modal-panel {
    width: 100%;
    border-radius: 0;
    margin: 0;
    min-height: 100vh;
    padding: 60px 14px 20px;
  }
}

/* ===== hero banner (landing) — uses pre-designed artwork ===== */
.hero-banner-img {
  width: 100%;
  margin: 0 0 12px 0;
  background: #0f2947;
  overflow: hidden;
  text-align: center;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
}
.hero-banner-img img {
  max-width: 100%;
  max-height: 380px;     /* cap height so banner + form fit on one screen */
  width: auto;
  height: auto;
  display: block;
  margin: 0 auto;
}
/* On smaller screens let the image take full width naturally — the height cap stops being restrictive */
@media (max-width: 900px) {
  .hero-banner-img img { max-height: none; width: 100%; }
}

/* legacy .full-hero styles kept for safety; unused by current markup */
.full-hero {
  width: 100%;
  margin: 0 0 10px 0;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}

.full-hero .banner-strip {
  background: var(--primary-dark);
  color: var(--accent);
  padding: 6px 16px;
  font-weight: 800;
  font-size: 12.5px;
  letter-spacing: 1.2px;
  text-align: center;
  border-bottom: 2px solid var(--accent);
  text-transform: uppercase;
}

.hero-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  align-items: stretch;
}

/* --- left branded panel --- */
.hero-brand {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
  color: white;
  padding: 12px 14px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}
.hero-brand::after {
  content: '';
  position: absolute;
  right: -40px; bottom: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(251,191,36,0.22) 0%, transparent 65%);
  pointer-events: none;
}
.hero-logo-img {
  width: 80px;
  height: auto;
  max-height: 80px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.35));
}
.hero-brand-text { flex: 1; min-width: 0; }
.hero-brand-text .eyebrow {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
  font-size: 9.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.hero-brand-text h1 {
  margin: 0;
  font-size: 20px;
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.4px;
  color: white;
}

/* mobile-only tagline that appears next to the logo on phones */
.hero-brand-tagline { display: none; }

/* --- candidate strip — all 9 in one row --- */
.hero-candidates {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  background: var(--surface);
  overflow: hidden;
}

.hero-candidate {
  padding: 10px 4px 10px;
  text-align: center;
  border-left: 1px solid #eef2f6;
  position: relative;
  min-width: 0;      /* allow cell to shrink below content size */
  overflow: hidden;
}
.hero-candidate:first-child { border-left: none; }
.hero-candidate .sr-pill {
  display: inline-block;
  background: var(--primary-dark);
  color: white;
  padding: 2px 9px;
  border-radius: 5px;
  font-weight: 800;
  font-size: 11px;
  border: 1.5px solid white;
  box-shadow: 0 2px 6px rgba(30,64,175,0.3);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.hero-candidate img {
  width: 100%;       /* fill cell, never overflow */
  max-width: 76px;   /* cap on wide screens */
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  border: 3px solid var(--primary-dark);
  background: #eff6ff;
  display: block;
  margin: 0 auto 6px;
  box-shadow: 0 3px 8px rgba(30,64,175,0.18);
}
.hero-candidate .name {
  font-weight: 700;
  font-size: 11px;
  color: var(--primary-dark);
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hero-candidate .role { display: none; }

@media (max-width: 1100px) {
  .hero-candidate img { max-width: 64px; border-width: 2.5px; }
  .hero-candidate .name { font-size: 10px; }
  .hero-candidate .sr-pill { font-size: 10px; padding: 2px 7px; }
}

/* --- footer strip --- */
.hero-footer-strip {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  color: white;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 8px 20px;
  gap: 16px;
  border-top: 2px solid var(--accent);
}
.hero-tagline {
  font-weight: 700;
  font-size: 12.5px;
  color: var(--accent);
  line-height: 1.3;
}
.hero-voting {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero-voting-date {
  background: white;
  color: var(--primary-dark);
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
}
.hero-vote-seal {
  background: var(--accent);
  color: var(--primary-dark);
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.5px;
  border: 2px solid white;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  flex-shrink: 0;
}

/* --- logos strip BELOW the hero --- */
.logos-under-hero {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 16px;
  max-width: 920px;
  margin: 0 auto 12px;
  background: var(--surface);
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}
.logos-under-hero img {
  height: 36px;
  max-width: 100%;
  object-fit: contain;
}

/* --- responsive --- */
@media (max-width: 900px) {
  .hero-row { grid-template-columns: 1fr; }
  .hero-brand { padding: 14px 16px; justify-content: center; }
  .hero-candidate { padding: 8px 2px; }
  .hero-candidate img { max-width: 56px; border-width: 2px; }
  .hero-candidate .name { display: none; }
  .hero-candidate .sr-pill { font-size: 9.5px; padding: 1px 6px; margin-bottom: 4px; }
}

/* ----- MOBILE ----- */
@media (max-width: 540px) {
  /* Brand block: logo on LEFT, tagline on RIGHT — big title hidden */
  .hero-brand {
    padding: 8px 14px;
    gap: 12px;
    align-items: center;
    justify-content: flex-start;
  }
  .hero-logo-img { width: 44px; max-height: 44px; }
  .hero-brand-text { display: none; }     /* hide "IMA YUVA PANEL" big title */
  .hero-brand-tagline {
    display: block;
    flex: 1 1 auto;
    color: var(--accent);
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1.35;
    text-align: right;
    letter-spacing: 0.2px;
  }

  /* Candidate strip: flex-wrap, 5 per row, 2nd row auto-centres */
  .hero-candidates {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 2px;
  }
  .hero-candidate {
    flex: 0 0 20%;     /* exactly 5 per row; 2nd row with 4 items centres */
    padding: 10px 2px 10px;
    border-left: 1px solid #eef2f6;
    border-top: none;
  }
  .hero-candidate:nth-child(5n+1) { border-left: none; }
  .hero-candidate:nth-child(n+6)  { border-top: 1px solid #eef2f6; }
  .hero-candidate img { max-width: 56px; border-width: 2.5px; }
  .hero-candidate .sr-pill { font-size: 10px; padding: 2px 8px; margin-bottom: 5px; }

  /* Footer strip: tagline moved to brand — footer just has date + seal */
  .hero-footer-strip {
    grid-template-columns: 1fr auto;
    text-align: left;
    padding: 8px 14px;
    gap: 12px;
    align-items: center;
  }
  .hero-tagline { display: none; }         /* tagline now lives in the brand block */
  .hero-voting { justify-content: flex-end; flex-wrap: nowrap; }
  .hero-voting-date { font-size: 11px; padding: 5px 12px; }
  .hero-vote-seal { width: 38px; height: 38px; font-size: 10.5px; }

  .full-hero .banner-strip { font-size: 10.5px; padding: 6px 10px; letter-spacing: 0.8px; }
  .logos-under-hero { margin: 0 10px 12px; padding: 6px 12px; border-radius: 8px; }
  .logos-under-hero img { height: 28px; }
}

/* ----- extra narrow phones ----- */
@media (max-width: 380px) {
  .hero-logo-img { width: 38px; max-height: 38px; }
  .hero-brand-tagline { font-size: 10.5px; }
  .hero-candidate { padding: 8px 1px; }
  .hero-candidate img { max-width: 48px; border-width: 2px; }
  .hero-candidate .sr-pill { font-size: 9.5px; padding: 1px 6px; }
}

/* ----- hero / cover ----- */
.hero {
  background: var(--surface);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  margin-bottom: 20px;
}
.hero img { width: 100%; height: auto; display: block; }

.election-strip {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--accent);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 3px solid var(--accent);
}
.election-strip > span { color: white; }
.election-strip strong { font-size: 16px; color: var(--accent); }
.election-strip svg { color: var(--accent); }

/* ----- panel hub (featured candidate + 8 panel members on same level) ----- */
.panel-hub {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px 28px 0;
  margin-bottom: 24px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  border-top: 5px solid var(--accent);
}
.panel-hub-head { text-align: center; margin-bottom: 24px; }
.panel-eyebrow {
  display: inline-block;
  background: var(--primary-dark);
  color: var(--accent);
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.panel-hub-head h1 {
  margin: 0 0 6px 0;
  font-size: 30px;
  color: var(--primary-dark);
  font-weight: 800;
  letter-spacing: -0.5px;
}
.panel-tagline {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

/* 6-column grid on desktop; featured card spans 2×2, others fill the other 4×2 */
.panel-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
@media (min-width: 720px) {
  .panel-hub-grid { grid-template-columns: repeat(6, 1fr); }
}

.panel-card {
  position: relative;
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s, box-shadow 0.2s;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
}
.panel-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}
.panel-card > img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center center;
  display: block;
  background: #f1f5f9;
}

.panel-card-body {
  padding: 6px 8px 10px;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.sr-circle {
  background: var(--primary);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  border: 3px solid white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.18);
  margin-top: -26px;
  margin-bottom: 8px;
  font-family: 'Inter', sans-serif;
}
.sr-circle.sm {
  width: 34px; height: 34px;
  font-size: 14px;
  border-width: 2.5px;
  margin-top: -20px;
  margin-bottom: 6px;
}

.panel-card h3, .panel-card h4 {
  margin: 0;
  color: var(--primary-dark);
  line-height: 1.15;
  word-break: break-word;
}
.panel-card h3 { font-size: 17px; font-weight: 800; letter-spacing: -0.2px; }
.panel-card h4 { font-size: 12.5px; font-weight: 700; }

.panel-card .en-name {
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  margin: 2px 0 6px;
}
.panel-card .role {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}
.panel-card .role-sm {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 10.5px;
  line-height: 1.35;
}

/* Featured (Dr. Rahul) — spans 2 cols × 2 rows, horizontal layout inside */
.panel-card.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.28), 0 12px 32px rgba(217, 119, 6, 0.22);
  background: var(--surface);
}

@media (min-width: 720px) {
  .panel-card.featured {
    grid-column: span 2;
    grid-row: span 2;
    flex-direction: row;       /* photo left, info right */
  }
  .panel-card.featured > img {
    width: 46%;
    height: 100%;
    aspect-ratio: auto;
    object-fit: cover;
    object-position: center 25%;
  }
  .panel-card.featured .panel-card-body {
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 20px 22px;
    text-align: center;
  }
  .panel-card.featured .sr-circle {
    margin-top: 0;
    margin-bottom: 10px;
    width: 56px;
    height: 56px;
    font-size: 21px;
  }
}

/* Mobile: photo on top, info below */
.panel-card.featured > img {
  aspect-ratio: 5 / 4;
  object-position: center 25%;
}
.panel-card.featured .panel-card-body { padding: 14px 18px 20px; }

.featured-ribbon {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent-dark);
  color: white;
  font-size: 10.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  z-index: 2;
  box-shadow: 0 3px 10px rgba(0,0,0,0.22);
}

.vote-slogan {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: var(--accent);
  padding: 10px 16px;
  border-radius: 10px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  border: 2px solid var(--accent);
  width: 100%;
  text-align: center;
}
.vote-slogan strong {
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.panel-footer {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  text-align: center;
  padding: 14px 20px;
  margin: 24px -28px 0;
  font-size: 14px;
  font-weight: 500;
  border-top: 3px solid var(--accent);
}
.panel-footer strong { color: var(--accent); font-weight: 800; letter-spacing: 0.3px; }

@media (max-width: 640px) {
  .panel-hub { padding: 20px 14px 0; }
  .panel-hub-head h1 { font-size: 22px; }
  .panel-eyebrow { font-size: 10px; padding: 4px 12px; }
  .panel-hub-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .panel-card.featured { grid-column: 1 / -1; grid-row: auto; }
  .panel-card.featured > img { aspect-ratio: 16 / 10; }
  .panel-card h4 { font-size: 11.5px; }
  .panel-card .role-sm { font-size: 10px; }
  .sr-circle.sm { width: 30px; height: 30px; font-size: 13px; margin-top: -18px; }
  .panel-footer { margin: 18px -14px 0; padding: 12px 14px; font-size: 13px; }
  .featured-ribbon { font-size: 9.5px; padding: 4px 10px; }
}

/* ----- search form ----- */
.search-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.08);
  margin-bottom: 24px;
}
.search-card h2 {
  margin: 0 0 4px 0;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-dark);
}
.search-card .sub {
  color: var(--text-muted);
  margin: 0 0 20px 0;
  font-size: 14px;
}

.form-group { margin-bottom: 16px; }

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}

input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafbfc;
}
input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.12);
}

button[type="submit"] {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 16px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.3px;
  transition: transform 0.1s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
button[type="submit"]:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(30, 64, 175, 0.35); }
button[type="submit"]:active { transform: translateY(0); }

.or-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 12px; font-weight: 600; letter-spacing: 1.5px;
}
.or-divider::before, .or-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.error {
  color: var(--danger);
  background: var(--danger-bg);
  border-left: 4px solid var(--danger);
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: none;
  font-size: 14px;
  font-weight: 500;
}

/* ----- results header ----- */
.results-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 12px 4px 16px 4px;
}
.results-header h2 { font-size: 20px; margin: 0; color: var(--primary-dark); }
.results-header .count { font-size: 13px; color: var(--text-muted); font-weight: 500; }

/* ----- voter card ----- */
.results-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.results-grid > .voter-card {
  flex: 0 1 600px;
  max-width: 640px;
}
/* When modal has only one card, let the panel shrink to content width */
.modal-body .results-grid:has(> .voter-card:only-child) {
  justify-content: center;
}

.voter-card {
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
}

.voter-card-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 3px solid var(--accent);
}
.voter-card-header .sr-badge {
  background: var(--accent);
  color: var(--primary-dark);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
}
.voter-card-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  flex: 1;
  word-break: break-word;
}

.voter-card-body { padding: 18px 20px; flex-grow: 1; }

.info-row {
  display: grid;
  grid-template-columns: 18px 100px 1fr;
  gap: 10px;
  align-items: center;
  padding: 5px 0;
  font-size: 14px;
}
.info-row svg { color: var(--primary); }
.info-row .label {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.info-row .value { color: var(--text); font-weight: 500; word-break: break-word; }

.polling-strip {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-left: 4px solid var(--accent-dark);
  padding: 14px 16px;
  border-radius: 10px;
  margin: 14px 0 12px;
}
.polling-strip-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--accent-dark);
  letter-spacing: 1.2px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.polling-strip-name {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  font-size: 15px;
}
.polling-strip-address {
  color: #374151;
  font-size: 13px;
  line-height: 1.45;
}

.time-strip {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}
.time-strip > div {
  background: #ecfdf5;
  padding: 10px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-dark);
  border: 1px solid var(--border);
}
.time-strip svg { color: var(--primary); flex-shrink: 0; }

/* ----- compact panel ribbon at TOP of voter card ----- */
.panel-ribbon {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  padding: 10px 14px 12px;
  text-align: center;
  border-bottom: 3px solid var(--accent);
}
.panel-ribbon-label {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.panel-ribbon-strip {
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 4px;
  overflow: hidden;
}
.panel-ribbon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}
.panel-ribbon-item img {
  width: 100%;
  max-width: 42px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 22%;
  border: 2px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  display: block;
}
.panel-ribbon-item .num {
  background: var(--accent);
  color: var(--primary-dark);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 800;
  min-width: 22px;
  text-align: center;
  line-height: 1.3;
}

/* New slate CTA at the bottom of the voter card — title + 9 number pills */
.vote-cta-slate {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  border-radius: 12px;
  padding: 14px 14px 12px;
  margin-top: 12px;
  border: 2px solid var(--accent);
  box-shadow: 0 3px 12px rgba(30, 64, 175, 0.22);
  text-align: center;
}
.vote-cta-slate-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.vote-cta-slate-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  background: var(--accent);
  color: var(--primary-dark);
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.vote-cta-slate-check svg { stroke-width: 3; }
.vote-cta-slate-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: white;
  text-transform: uppercase;
}
.vote-cta-slate-title strong {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.4px;
}
.vote-cta-slate-nums {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.vote-cta-slate-num {
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 800;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 6px;
  min-width: 32px;
  text-align: center;
  letter-spacing: 0.3px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
}

@media (max-width: 480px) {
  .vote-cta-slate-num { font-size: 12px; padding: 3px 8px; min-width: 28px; }
  .vote-cta-slate-nums { gap: 5px; }
  .vote-cta-slate-title { font-size: 12px; }
}

/* Wide info row (full-width value on its own line — for long text like qualification/address) */
.info-row-wide {
  grid-template-columns: 20px 1fr !important;
  align-items: flex-start !important;
}
.info-row-wide .label {
  grid-column: 2;
  margin-bottom: 2px;
}
.info-row-wide .value {
  grid-column: 2;
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 500;
}
.info-row-wide svg {
  grid-row: 1 / span 2;
  margin-top: 3px;
}

@media (max-width: 420px) {
  .panel-ribbon-item img { max-width: 34px; }
  .panel-ribbon-item .num { font-size: 9.5px; padding: 1px 5px; }
}

/* legacy .vote-cta kept for any consumers still using it */
.vote-cta {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  padding: 14px 14px 12px;
  border-radius: 10px;
  text-align: center;
  margin-top: 8px;
  box-shadow: 0 2px 10px rgba(6, 78, 59, 0.25);
  border: 2px solid var(--accent);
}
.vote-cta .panel-label {
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.6px;
  margin-bottom: 10px;
  text-transform: uppercase;
}
.vote-cta .panel-slate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
}
.panel-slate-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
}
.panel-slate-item img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 25%;
  border: 2.5px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.1);
  display: block;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.panel-slate-item span {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  min-width: 26px;
  text-align: center;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

@media (max-width: 600px) {
  .panel-slate-item img { width: 44px; height: 44px; }
  .panel-slate-item span { font-size: 11px; padding: 2px 6px; min-width: 22px; }
}
@media (max-width: 420px) {
  .panel-slate-item img { width: 36px; height: 36px; }
  .panel-slate-item span { font-size: 10px; padding: 1px 5px; }
}

.panel-banner {
  display: block;
  width: calc(100% + 40px);
  margin: 16px -20px -18px -20px;
  border-top: 1px solid var(--border);
}

/* ----- action buttons ----- */
.card-actions {
  display: flex;
  gap: 6px;
  padding: 12px;
  background: #fafbfc;
  border-top: 1px solid var(--border);
}
.action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 6px;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: transform 0.1s, filter 0.2s;
  white-space: nowrap;
}
.action-btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.action-btn:active { transform: translateY(0); }
.action-btn svg { flex-shrink: 0; }
.btn-map { background: var(--primary); }
.btn-download { background: var(--download); }
.btn-wa { background: var(--wa); }

/* ----- empty / no results ----- */
.empty-state {
  background: var(--surface);
  border-radius: 14px;
  padding: 44px 24px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.empty-state svg { color: var(--text-muted); margin-bottom: 14px; }
.empty-state h3 { margin: 0 0 6px 0; color: var(--text); font-size: 18px; }
.empty-state p { margin: 0; color: var(--text-muted); font-size: 14px; }

.footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 28px;
  padding: 16px 0;
}

/* ----- responsive ----- */
@media (max-width: 640px) {
  body { padding: 10px; font-size: 15px; }
  .search-card { padding: 20px 16px; }
  .search-card h2 { font-size: 20px; }
  .voter-card-header { padding: 14px 16px; }
  .voter-card-header h3 { font-size: 15px; }
  .voter-card-body { padding: 14px 16px; }
  .info-row { grid-template-columns: 18px 88px 1fr; font-size: 13px; gap: 8px; }
  .action-btn { padding: 10px 4px; font-size: 12px; }
  .card-actions { padding: 10px; gap: 5px; }
}
