/* =========================================
   CSS VARIABLES
   ========================================= */
:root {
  --primary:       #1a3a6b;
  --primary-dark:  #0f2347;
  --primary-light: #2c5299;
  --red:           #c0392b;
  --red-light:     #e74c3c;
  --green:         #27ae60;
  --green-light:   #2ecc71;
  --orange:        #e67e22;
  --orange-light:  #f39c12;
  --blue:          #2980b9;
  --blue-light:    #3498db;
  --purple:        #8e44ad;
  --gray:          #7f8c8d;
  --gray-light:    #bdc3c7;
  --bg:            #f0f2f5;
  --card-bg:       #ffffff;
  --text:          #2c3e50;
  --text-muted:    #7f8c8d;
  --border:        #e0e4e8;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.10);
  --shadow:        0 2px 10px rgba(0,0,0,0.12);
  --shadow-lg:     0 4px 20px rgba(0,0,0,0.16);
  --radius-sm:     6px;
  --radius:        10px;
  --radius-lg:     16px;
}

/* =========================================
   RESET & BASE
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea {
  font: inherit;
  border: none;
  outline: none;
}

/* =========================================
   SCREENS
   ========================================= */
.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* =========================================
   LOGIN SCREEN
   ========================================= */
.login-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 20px;
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 60%, var(--primary-light) 100%);
}

.login-logo {
  text-align: center;
  color: #ffffff;
  margin-bottom: 36px;
}

.logo-icon {
  width: 72px;
  height: 72px;
  background: rgba(255,255,255,0.15);
  border: 3px solid rgba(255,255,255,0.35);
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 800;
  color: #fff;
  margin: 0 auto 16px;
  letter-spacing: 1px;
}

.login-logo h1 {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.login-logo p {
  font-size: 14px;
  opacity: 0.75;
  letter-spacing: 0.3px;
}

.login-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-lg);
}

.login-card .field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

/* =========================================
   HEADER
   ========================================= */
.app-header {
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: var(--shadow);
}

.header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 36px;
}

.header-main h2 {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.canvasser-chip {
  background: rgba(255,255,255,0.18);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 600;
}

.doors-chip {
  background: rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.85);
}

/* =========================================
   SHARED BUTTONS
   ========================================= */
.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  margin-top: 16px;
  transition: background 0.15s;
}
.btn-primary:active { background: var(--primary-dark); }

.btn-back {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.btn-back:active { background: rgba(255,255,255,0.25); }

.btn-icon-header {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
}
.btn-icon-header:active { background: rgba(255,255,255,0.25); }

.btn-danger-sm {
  background: var(--red);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
}
.btn-danger-sm:active { background: #a93226; }

.btn-export {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}
.btn-export:active { background: rgba(255,255,255,0.25); }

/* =========================================
   TEXT INPUTS
   ========================================= */
.text-input {
  display: block;
  width: 100%;
  padding: 13px 14px;
  background: #f7f9fc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  color: var(--text);
  transition: border-color 0.15s;
}
.text-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.notes-input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  background: #f7f9fc;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  resize: none;
  transition: border-color 0.15s;
}
.notes-input:focus {
  border-color: var(--primary);
  background: #fff;
  outline: none;
}

/* =========================================
   GPS + PRINT BAR
   ========================================= */
.gps-bar {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.btn-gps {
  flex: 1;
  padding: 9px 12px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}
.btn-gps:active { background: var(--border); }

.btn-print {
  padding: 9px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray);
}
.btn-print:active { background: var(--border); }

/* =========================================
   WALK LIST
   ========================================= */
.walk-list {
  padding: 12px 12px 80px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.voter-row {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: stretch;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.15s;
  border: 1.5px solid transparent;
}
.voter-row:active { box-shadow: var(--shadow); }
.voter-row.contacted { opacity: 0.6; }
.voter-row.contacted .voter-row-body { background: #fafafa; }
.voter-row:hover { border-color: var(--border); }

.voter-row-num {
  width: 36px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.voter-row.contacted .voter-row-num { background: var(--gray); }

.voter-row-body {
  flex: 1;
  padding: 12px 14px;
}

.voter-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.voter-row-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
}

.party-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.party-R { background: #fde8e6; color: var(--red); }
.party-D { background: #e6eef8; color: var(--primary); }
.party-I { background: #f0f0f0; color: var(--gray); }

.voter-row-address {
  font-size: 13px;
  color: var(--text-muted);
}

.voter-row-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.voter-row-age {
  font-size: 12px;
  color: var(--text-muted);
}

.result-pip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.pip-not_home  { background: #fef3e2; color: var(--orange); }
.pip-talked    { background: #e8f8f0; color: var(--green); }
.pip-refused   { background: #fde8e6; color: var(--red); }
.pip-moved     { background: #f0f0f0; color: var(--gray); }
.pip-info      { background: #e6eef8; color: var(--blue); }

.voter-row-arrow {
  display: flex;
  align-items: center;
  padding: 0 12px;
  color: var(--gray-light);
  font-size: 18px;
}

/* =========================================
   HOUSEHOLD / ADDRESS GROUPS (Walk List)
   ========================================= */
.address-group {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1.5px solid transparent;
}
.address-group.addr-group-done {
  border-color: var(--green);
  opacity: 0.65;
}
.address-group.addr-group-partial {
  border-color: var(--orange);
}

.address-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #f4f7fb;
  border-bottom: 1px solid var(--border);
}

.addr-stop-num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.addr-stop-num.stop-done { background: var(--green); }

.addr-group-info { flex: 1; }

.addr-group-street {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
}

.addr-group-city {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
}

.household-voter {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 12px;
  border-bottom: 1px solid #f0f3f8;
  cursor: pointer;
  transition: background 0.12s;
}
.household-voter:last-child { border-bottom: none; }
.household-voter:active { background: #f4f7fb; }
.household-voter.hh-contacted { background: #fafafa; opacity: 0.65; }

.hh-voter-info {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  flex-wrap: wrap;
}

.hh-voter-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.hh-arrow {
  color: var(--gray-light);
  font-size: 18px;
  flex-shrink: 0;
}

/* =========================================
   VOTER CARD
   ========================================= */
.contacted-badge {
  background: var(--green);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.voter-card-body {
  padding: 0 0 80px;
}

.voter-info-panel {
  background: var(--card-bg);
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.voter-name-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.voter-name-row h3 {
  font-size: 20px;
  font-weight: 800;
  flex: 1;
}

.voter-address {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.voter-meta-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meta-pill {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 3px 10px;
  border-radius: 20px;
}

.phone-pill { color: var(--primary); font-weight: 600; }
.propensity-pill { color: var(--orange); font-weight: 600; }

/* Card sections */
.card-section {
  background: var(--card-bg);
  margin: 0 0 8px;
  padding: 14px 16px;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* Result buttons */
.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.result-btn {
  padding: 14px 10px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  border: 2px solid transparent;
  transition: all 0.12s;
  color: var(--text);
}

.btn-not-home  { background: #fef3e2; color: #7d4400; border-color: #f5cba7; }
.btn-talked    { background: #e8f8f0; color: #1a5c35; border-color: #a9dfbf; }
.btn-refused   { background: #fde8e6; color: #7b241c; border-color: #f5b7b1; }
.btn-moved     { background: #f0f0f0; color: #4a4a4a; border-color: #d0d0d0; }
.btn-info      { background: #e6eef8; color: #1a3a6b; border-color: #a9c4e8; }

/* Last column spans full width */
.result-grid .result-btn:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.result-btn.selected {
  border-width: 2.5px;
  box-shadow: 0 0 0 3px rgba(26,58,107,0.12);
  transform: scale(0.98);
}
.btn-not-home.selected  { border-color: var(--orange); background: #fde3b5; }
.btn-talked.selected    { border-color: var(--green);  background: #c5edd8; }
.btn-refused.selected   { border-color: var(--red);    background: #fac0ba; }
.btn-moved.selected     { border-color: var(--gray);   background: #d8d8d8; }
.btn-info.selected      { border-color: var(--blue);   background: #c2d9f0; }

.not-home-notice {
  margin-top: 10px;
  padding: 10px 12px;
  background: #fff8e1;
  border: 1px solid #f5cba7;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #7d4400;
  font-weight: 600;
}

/* Observation tags */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-btn {
  padding: 9px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.12s;
}
.tag-btn:active { background: var(--border); }
.tag-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* DNC section */
.dnc-section { border-top: 3px solid var(--border); }

.dnc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dnc-text strong {
  font-size: 15px;
  color: var(--text);
  display: block;
  margin-bottom: 3px;
}
.dnc-text p {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-dnc-off {
  padding: 9px 20px;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  color: var(--gray);
  letter-spacing: 0.5px;
  min-width: 64px;
  text-align: center;
  transition: all 0.15s;
}
.btn-dnc-on {
  padding: 9px 20px;
  background: var(--red);
  border: 2px solid var(--red);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  min-width: 64px;
  text-align: center;
  transition: all 0.15s;
}

/* Save row */
.save-row {
  padding: 16px;
  position: sticky;
  bottom: 0;
  background: rgba(240,242,245,0.95);
  backdrop-filter: blur(6px);
  border-top: 1px solid var(--border);
}

.btn-save {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 4px 16px rgba(26,58,107,0.3);
  transition: background 0.15s;
}
.btn-save:active { background: var(--primary-dark); }

/* =========================================
   REPORT SCREEN
   ========================================= */
.stats-panel {
  padding: 14px 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 12px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  display: block;
  line-height: 1.1;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.canvassers-panel {
  padding: 0 12px 8px;
}

.canvassers-panel h4 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 8px;
}

.canvasser-row {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  box-shadow: var(--shadow-sm);
}

.canvasser-row-name { font-size: 14px; font-weight: 700; }
.canvasser-row-doors { font-size: 13px; color: var(--text-muted); }

.report-table-wrap {
  padding: 0 12px 40px;
  overflow-x: auto;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.report-table th {
  background: var(--primary);
  color: rgba(255,255,255,0.85);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
}

.report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  max-width: 180px;
  word-break: break-word;
}

.report-table tr:last-child td { border-bottom: none; }
.report-table tr:nth-child(even) td { background: #fafbfc; }

.result-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
  display: inline-block;
}
.tag-not_home { background: #fef3e2; color: #7d4400; }
.tag-talked   { background: #e8f8f0; color: #1a5c35; }
.tag-refused  { background: #fde8e6; color: #7b241c; }
.tag-moved    { background: #f0f0f0; color: #4a4a4a; }
.tag-info     { background: #e6eef8; color: #1a3a6b; }

/* =========================================
   MODAL
   ========================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-lg);
}

.modal-card h3 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--primary);
}

.modal-stat-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.modal-stat-row:last-of-type { border-bottom: none; margin-bottom: 4px; }
.modal-stat-row span:first-child { color: var(--text-muted); }
.modal-stat-row span:last-child { font-weight: 700; }

/* =========================================
   TOAST
   ========================================= */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #2c3e50;
  color: #fff;
  padding: 12px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  z-index: 600;
  box-shadow: var(--shadow-lg);
  max-width: 320px;
  text-align: center;
  transition: opacity 0.25s;
  pointer-events: none;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red);   }
.toast.warning { background: var(--orange); }

/* =========================================
   EMPTY STATE
   ========================================= */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state p { font-size: 15px; margin-top: 8px; }

/* =========================================
   CAMPAIGN SELECTION
   ========================================= */
.campaign-list {
  padding: 16px 12px 80px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.campaign-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  padding: 20px 16px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.campaign-card:active {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
}

.campaign-card-inner { flex: 1; }

.campaign-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}

.campaign-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.campaign-arrow {
  font-size: 24px;
  color: var(--gray-light);
  margin-left: 12px;
}

.campaign-race {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 3px;
}

.campaign-pending {
  opacity: 0.55;
  cursor: default;
}
.campaign-pending .campaign-name { color: var(--gray); }

/* =========================================
   WALKBOOK SELECTION SCREEN
   ========================================= */
.wb-search-bar {
  padding: 10px 12px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.walkbook-list {
  padding: 10px 12px 60px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.walkbook-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
}
.walkbook-card:active { border-color: var(--primary); }

.wb-num {
  width: 44px;
  height: 44px;
  background: var(--primary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
}
.wb-num.complete { background: var(--green); }
.wb-num.partial  { background: var(--orange); }

.wb-info { flex: 1; }
.wb-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.wb-precinct {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.wb-progress-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wb-progress-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.wb-progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 3px;
  transition: width 0.3s;
}
.wb-count {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.wb-arrow {
  color: var(--gray-light);
  font-size: 20px;
  flex-shrink: 0;
}

/* =========================================
   SCRIPT LAUNCH SECTION
   ========================================= */
.script-launch-section {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  padding: 18px 16px;
}

.btn-start-script {
  display: block;
  width: 100%;
  padding: 15px;
  background: #fff;
  color: var(--primary);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.2);
  transition: transform 0.12s;
}
.btn-start-script:active { transform: scale(0.97); }

.script-hint {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  margin-top: 8px;
}

/* =========================================
   SURVEY SUMMARY ON VOTER CARD
   ========================================= */
.survey-summary-section { border-top: 2px solid var(--green); }

.survey-answer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.survey-answer-row:last-child { border-bottom: none; }
.survey-answer-label { color: var(--text-muted); }
.survey-answer-value { font-weight: 700; color: var(--text); }
.survey-answer-value.priority { color: var(--green); }
.survey-answer-value.yes-val  { color: var(--primary); }

/* =========================================
   FULL OVERLAYS (Script, Survey, Thank You)
   ========================================= */
.full-overlay {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 400;
  display: flex;
  flex-direction: column;
}

.overlay-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

.overlay-header-bar {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  flex-shrink: 0;
}

.overlay-title {
  font-size: 17px;
  font-weight: 700;
}

.btn-overlay-close {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 600;
  padding: 6px 10px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-sm);
  min-width: 60px;
  text-align: center;
}
.btn-overlay-close:active { background: rgba(255,255,255,0.25); }

/* Script overlay */
.script-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  background: var(--bg);
}

.script-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--primary);
}

.script-text {
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
}

.script-tip {
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 16px;
  font-style: italic;
}

.overlay-footer {
  padding: 16px;
  background: rgba(240,242,245,0.95);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.btn-begin-survey {
  display: block;
  width: 100%;
  padding: 16px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius);
  font-size: 17px;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 4px 16px rgba(26,58,107,0.3);
}
.btn-begin-survey:active { background: var(--primary-dark); }

/* Survey overlay */
.survey-progress-track {
  height: 5px;
  background: var(--border);
  flex-shrink: 0;
}

.survey-progress-fill {
  height: 100%;
  background: var(--primary);
  transition: width 0.3s ease;
}

.survey-progress-label {
  font-size: 13px;
  color: rgba(255,255,255,0.8);
  font-weight: 600;
  min-width: 40px;
  text-align: right;
}

.survey-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 16px 16px;
  overflow-y: auto;
}

.survey-question-text {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 28px;
  text-align: center;
}

.survey-options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.survey-option-btn {
  width: 100%;
  padding: 16px 20px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.12s;
}
.survey-option-btn:active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  transform: scale(0.98);
}

/* Thank you overlay */
.thankyou-overlay {
  background: var(--green);
  align-items: center;
  justify-content: center;
}

.thankyou-content {
  text-align: center;
  color: #fff;
}

.thankyou-check {
  font-size: 72px;
  line-height: 1;
  margin-bottom: 16px;
}

.thankyou-content h2 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 8px;
}

.thankyou-content p {
  font-size: 20px;
  opacity: 0.9;
}

/* Priority voter badge in walk list */
.priority-badge {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #fff8e1;
  color: #7d4400;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
  body { background: white; max-width: none; }
  .app-header, .gps-bar, .save-row { display: none !important; }
  .screen { display: block !important; }
  #screen-voter, #screen-login, #screen-report { display: none !important; }
  #screen-walklist { display: block !important; }
  .voter-row {
    box-shadow: none !important;
    border: 1px solid #ccc;
    break-inside: avoid;
    margin-bottom: 6px;
  }
  .voter-row-num { background: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .walk-list { padding: 12px; }
  .btn-print, .btn-gps { display: none; }
}

/* =========================================
   RESPONSIVE — larger screens
   ========================================= */
@media (min-width: 480px) {
  .result-grid { grid-template-columns: repeat(3, 1fr); }
  .result-grid .result-btn:last-child:nth-child(odd) { grid-column: auto; }
  .stats-panel { grid-template-columns: repeat(4, 1fr); }
}
