:root {
  /* Chad Gilbert campaign palette */
  --navy: #0F1F3A;
  --red: #C4123D;          /* campaign red */
  --bg: #0a1426;
  --panel: #11203a;
  --panel-2: #17294a;
  --line: #25395c;
  --text: #e9eef6;
  --muted: #93a3bd;
  --brand: #2a7fb8;        /* steel/brand blue (UI accent) */
  --brand-2: #19618A;
  --a: #16a34a;   /* prime */
  --b: #4ade80;   /* strong R */
  --c: #a3e635;   /* lean */
  --d: #94a3b8;   /* unknown */
  --opp: #ef4444; /* opponent */
  --gold: #f5b301;
  --radius: 16px;
  --shadow: 0 10px 30px -12px rgba(0,0,0,.6);
  --card-shadow: 0 1px 0 rgba(255,255,255,.03), 0 12px 28px -18px rgba(0,0,0,.65);
  --font-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-head: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Headlines */
h1, h2, h3, .greet-h, .proj-big, .plan-big, .hero-stats .num, .auth-brand h1, .summary-hero h2 {
  font-family: var(--font-head);
  letter-spacing: 0;
}
.proj-big, .plan-big, .hero-stats .num { font-weight: 900; letter-spacing: -.01em; }

/* Small metrics read as data: DM Mono + tabular figures */
.stat .num, .scorebox .n, .tier-num b, .lb-num b, .lb-rank {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}
.brand-logo { height: 38px; width: auto; max-width: 48vw; object-fit: contain; display: block; }
h1, h2, h3 { margin: 0; font-weight: 650; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px;
  background: linear-gradient(180deg, #141b24, #11161d);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: none; border: none; padding: 0; cursor: pointer; }
.brand:active { opacity: .8; }
.brand h1 { font-size: 17px; }
.brand-product { font-family: var(--font-head); font-size: 10px; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); }
.brand p { margin: 0; font-size: 11px; color: var(--muted); }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--brand);
       box-shadow: 0 0 0 4px rgba(47,109,246,.2); }
.canvasser input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 999px; padding: 7px 12px; font-size: 13px; width: 110px;
}

main { padding: 14px; max-width: 1200px; margin: 0 auto; }

/* Cards */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}
.card h2 { font-size: 14px; color: var(--muted); text-transform: uppercase;
           letter-spacing: .06em; margin-bottom: 12px; }

/* Stat grid */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: var(--panel-2); border: 1px solid var(--line);
        border-radius: 12px; padding: 14px; }
.stat .num { font-size: 26px; font-weight: 750; }
.stat .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat.accent { background: linear-gradient(135deg, #19618A, #0F1F3A); border-color: #2a4f74; }
.stat.gold .num { color: var(--gold); }

/* Projection */
.proj-big { font-size: 40px; font-weight: 800; letter-spacing: -.02em; }
.proj-band { color: var(--muted); font-size: 13px; }
.bar { height: 10px; border-radius: 999px; background: var(--panel-2);
       overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #6f9bff); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
        padding: 4px 10px; border-radius: 999px; background: var(--panel-2);
        border: 1px solid var(--line); }

/* Tier chips */
.tier { font-weight: 700; font-size: 11px; padding: 2px 8px; border-radius: 6px; color: #04210f; }
.tier.A { background: var(--a); color:#dcffe8; }
.tier.B { background: var(--b); color:#04210f; }
.tier.C { background: var(--c); color:#1a2a04; }
.tier.D { background: var(--d); color:#0b1118; }
.tier.OPP { background: var(--opp); color:#fff; }

/* Neighborhood table */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
tr.clickable:hover { background: var(--panel-2); cursor: pointer; }
.minibar { height: 6px; background: var(--panel-2); border-radius: 4px; overflow: hidden; }
.minibar > span { display:block; height:100%; background: var(--brand); }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.filters select, .filters input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 9px 11px; font-size: 13px; flex: 1; min-width: 120px;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
        border-radius: 999px; padding: 6px 12px; font-size: 12px; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* Voter list rows */
.vrow { display: flex; align-items: center; gap: 12px; padding: 12px 8px;
        border-bottom: 1px solid var(--line); }
.vrow:hover { background: var(--panel-2); cursor: pointer; }
.vrow .avatar { width: 38px; height: 38px; border-radius: 10px; flex: none;
        display: grid; place-items: center; font-weight: 700; font-size: 13px;
        background: var(--panel-2); border: 1px solid var(--line); }
.vrow .main { flex: 1; min-width: 0; }
.vrow .name { font-weight: 600; }
.vrow .sub { font-size: 12px; color: var(--muted); white-space: nowrap;
        overflow: hidden; text-overflow: ellipsis; }
.vrow .right { text-align: right; flex: none; }
.status-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; background: var(--muted); }
.status-dot.talked { background: var(--a); }
.status-dot.not_home { background: var(--gold); }
.status-dot.refused { background: var(--opp); }
.sign { color: var(--gold); }
.street-head { position: sticky; top: 0; background: var(--panel);
        padding: 8px; font-weight: 700; font-size: 13px; color: var(--brand);
        border-bottom: 1px solid var(--line); }

/* Map */
#map { height: 56vh; min-height: 340px; border-radius: var(--radius);
       border: 1px solid var(--line);
       position: relative; z-index: 0; }  /* contain Leaflet's layer z-indexes below the nav */
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; margin-right: 5px; vertical-align: -1px; }
.leaflet-popup-content-wrapper { background: var(--panel); color: var(--text); }
.leaflet-popup-tip { background: var(--panel); }

/* Bottom sheet (voter CRM) */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; }
.voter-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: var(--panel); border-top-left-radius: 20px; border-top-right-radius: 20px;
  border-top: 1px solid var(--line); box-shadow: var(--shadow);
  max-height: 92vh; overflow-y: auto; padding: 18px 16px 28px;
  animation: slideup .18s ease;
}
@keyframes slideup { from { transform: translateY(100%); } to { transform: none; } }
.sheet-grip { width: 40px; height: 4px; background: var(--line); border-radius: 4px; margin: 0 auto 14px; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.sheet-head h2 { font-size: 20px; }
.kv { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.scorerow { display: flex; gap: 10px; margin: 12px 0; }
.scorebox { flex: 1; background: var(--panel-2); border: 1px solid var(--line);
            border-radius: 12px; padding: 12px; text-align: center; }
.scorebox .n { font-size: 22px; font-weight: 750; }
.scorebox .l { font-size: 11px; color: var(--muted); }

.section-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
               color: var(--muted); margin: 16px 0 8px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.opt {
  flex: 1; min-width: 70px; text-align: center; padding: 12px 8px; border-radius: 12px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); font-size: 13px;
}
.opt.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.opt.s1.on { background: var(--a); border-color: var(--a); }
.opt.s2.on { background: var(--b); border-color: var(--b); color:#04210f; }
.opt.s3.on { background: var(--gold); border-color: var(--gold); color:#1a1400; }
.opt.s4.on { background: #f97316; border-color: #f97316; }
.opt.s5.on { background: var(--opp); border-color: var(--opp); }
.toggle.on { background: var(--gold); border-color: var(--gold); color: #1a1400; font-weight: 700; }
textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 12px; font: inherit; resize: vertical; min-height: 64px;
}
.save-btn {
  width: 100%; margin-top: 16px; padding: 15px; border: none; border-radius: 14px;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 700;
}
.save-btn:active { background: var(--brand-2); }
.callbtn { background: var(--a); color:#fff; border:none; border-radius: 10px; padding: 9px 14px; font-weight:600; text-decoration:none; font-size:13px; }
.close-x { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
           border-radius: 10px; width: 36px; height: 36px; font-size: 18px; }

.histtable td { padding: 6px 8px; font-size: 12px; }
.vote-r { color: var(--b); font-weight: 700; }
.vote-d { color: #60a5fa; font-weight: 700; }
.vote-y { color: var(--text); }
.vote-n { color: var(--muted); }

/* Tabbar */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: flex; background: #11161d; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  flex: 1; background: none; border: none; color: var(--muted); padding: 8px 4px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px;
}
.tabbar button .ic { font-size: 20px; }
.tabbar button.active { color: var(--brand); }

.muted { color: var(--muted); }
.loading { text-align: center; color: var(--muted); padding: 40px; }
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
         background: var(--a); color: #fff; padding: 11px 18px; border-radius: 999px;
         z-index: 200; font-weight: 600; box-shadow: var(--shadow); }

/* ---- Polish pass (mobile UI principles) ---- */
/* Active tab gets a clear top indicator, not just color */
.tabbar button { position: relative; transition: color .15s; }
.tabbar button.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand);
}
/* Comfortable tap targets */
.chip { padding: 9px 13px; min-height: 38px; display: inline-flex; align-items: center; }
.opt { min-height: 46px; }
.tabbar button { min-height: 52px; }
/* Press feedback */
.opt:active, .chip:active, .save-btn:active, .callbtn:active { transform: scale(.97); }
.opt, .chip, .save-btn, .vrow, .tier-row, .route-btn { transition: transform .08s ease, background .15s ease, border-color .15s ease; }
/* A toggled-on commitment gives a small satisfying pop */
.toggle.on { animation: pop .22s ease; }
@keyframes pop { 0% { transform: scale(1); } 45% { transform: scale(1.06); } 100% { transform: scale(1); } }
/* Nicer toast */
.toast { animation: toastin .22s cubic-bezier(.2,.8,.3,1); display: flex; align-items: center; gap: 7px; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* Empty / loading states with guidance */
.empty { text-align: center; color: var(--muted); padding: 40px 24px; }
.empty .ic { font-size: 34px; display: block; margin-bottom: 10px; opacity: .7; }
.empty .title { color: var(--text); font-weight: 600; margin-bottom: 4px; }

/* Export bar */
.export-bar { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.export-resp { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.export-resp input { width: 16px; height: 16px; accent-color: var(--brand); }

/* Leaderboard + team color swatches */
.lb-row { display: flex; align-items: center; gap: 11px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.lb-row:last-child { border-bottom: none; }
.lb-rank { width: 22px; text-align: center; font-weight: 700; color: var(--muted); font-family: var(--font-mono); }
.lb-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.lb-info { flex: 1; min-width: 0; }
.lb-name { font-size: 14px; font-weight: 600; }
.lb-num { text-align: right; width: 64px; }
.lb-num b { font-family: var(--font-mono); }
.lb-avatar { width: 28px; height: 28px; border-radius: 50%; flex: none; display: grid;
  place-items: center; font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), #6f9bff); }
.swatch { width: 34px; height: 34px; border-radius: 9px; border: 2px solid transparent; }
.swatch.on { border-color: #fff; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor; }
.swatch.taken { opacity: .28; cursor: not-allowed; }

/* Install-app banner (above the tab bar) */
.install-banner { position: fixed; left: 12px; right: 12px;
  bottom: calc(72px + env(safe-area-inset-bottom)); z-index: 70;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 11px 12px; font-size: 13px; animation: toastin .22s ease; }
.install-banner .ib-actions { display: flex; gap: 6px; flex: none; }
.install-banner #ib-go { background: var(--brand); color: #fff; border: none; border-radius: 8px;
  padding: 8px 14px; font-weight: 700; font-size: 13px; }
.install-banner #ib-x { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
  border-radius: 8px; padding: 8px 10px; }
@media (min-width: 760px) { .install-banner { max-width: 420px; left: auto; right: 16px; } }

/* Offline / sync status pill (sits just above the tab bar) */
.net-status { position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 80;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 600;
  padding: 7px 14px; border-radius: 999px; box-shadow: var(--shadow); }
.net-status.offline { background: var(--gold); color: #1a1400; }

/* Dashboard greeting + canvasser hero */
.greet { display: flex; align-items: center; justify-content: space-between; margin: 2px 2px 14px; }
.greet-h { font-size: 22px; font-weight: 700; }
.greet-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.countdown { display: inline-block; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--gold); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.hero-day { background: linear-gradient(160deg, #19618A 0%, #0F1F3A 78%); border-color: #2a4f74; }
.hero-day .card-head h2, .hero-day .link-btn { color: #dbe6ff; }
.hero-stats { display: flex; gap: 6px; margin: 4px 0 16px; }
.hero-stats > div { flex: 1; text-align: center; background: rgba(255,255,255,.06);
  border-radius: 12px; padding: 12px 4px; }
.hero-stats .num { font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.hero-stats .lbl { font-size: 11px; color: #aebfe0; margin-top: 2px; }
.cta { width: 100%; padding: 16px; border: none; border-radius: 14px; background: #fff;
  color: #15233f; font-size: 17px; font-weight: 750; }
.cta:active { transform: scale(.98); }
.cta-secondary { width: 100%; margin-top: 8px; padding: 13px; border-radius: 12px;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  color: #dbe6ff; font-size: 14px; font-weight: 600; }
.plan-empty { text-align: center; padding: 28px 18px; }
.plan-empty .welcome-ic { font-size: 46px; margin-bottom: 8px; }
.plan-empty h2 { font-size: 21px; margin-bottom: 8px; }
.plan-empty p { max-width: 360px; margin: 0 auto 18px; }
.plan-empty .cta { color: #fff; background: var(--brand); }

/* Session summary + confetti */
.confetti { position: fixed; top: -8vh; z-index: 400; pointer-events: none;
  animation: fall 2.2s ease-in forwards; }
@keyframes fall {
  0% { transform: translateY(0) rotate(0); opacity: 0; }
  12% { opacity: 1; }
  100% { transform: translateY(112vh) rotate(360deg); opacity: 0; }
}
.summary-hero { text-align: center; padding: 6px 0 4px; }
.summary-emoji { font-size: 48px; animation: pop .4s ease; }
.today-card .pill { background: var(--panel-2); }

/* Welcome carousel */
.welcome { text-align: center; padding: 10px 6px 4px; }
.welcome-ic { font-size: 46px; margin-bottom: 8px; }
.welcome h2 { font-size: 21px; margin-bottom: 8px; }
.welcome p { max-width: 340px; margin: 0 auto 18px; }
.dots { display: flex; gap: 7px; justify-content: center; margin-bottom: 18px; }
.dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--brand); width: 20px; border-radius: 999px; }

/* Card header with action on the right (no overlap) */
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head .link-btn { padding: 0; white-space: nowrap; }

/* Tier breakdown rows */
.tier-row { display: flex; align-items: center; gap: 12px; padding: 9px 6px; border-radius: 10px; }
.tier-row:hover { background: var(--panel-2); cursor: pointer; }
.tier-info { flex: 1; min-width: 0; }
.tier-label { font-size: 13px; margin-bottom: 5px; }
.tier-num { text-align: right; width: 56px; }

.pill.warn { background: #3a2a10; border-color: #7a5b1a; color: #f5c97a; }

/* Map view toolbar */
.map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }

/* Route builder */
.route-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: 14px 0 6px; }
.route-bar { display: flex; gap: 8px; margin-top: 4px; align-items: flex-end; }
.r-field { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); }
.r-field:first-child { flex: 1; min-width: 0; }
.r-stops-field { flex: none; }
.route-bar select { width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 9px 10px; font-size: 13px; }
.route-bar input { width: 70px; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--text); border-radius: 10px; padding: 9px; font-size: 13px; text-align: center; }
.route-btn { flex: none; padding: 9px 14px; background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.route-btn:disabled { opacity: .6; }
.route-pin { background: var(--brand); color: #fff; border: 2px solid #fff; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.5); }

/* Plan tab */
.plan-hero { display: flex; align-items: baseline; gap: 12px; padding: 16px;
  border-radius: 12px; margin-top: 12px; border: 1px solid var(--line); }
.plan-hero.ok { background: linear-gradient(135deg, #14361f, #0f2a18); border-color: #1f6b3a; }
.plan-hero.bad { background: linear-gradient(135deg, #3a2a10, #2a1f0c); border-color: #7a5b1a; }
.plan-hero > div:last-child { font-size: 13px; color: var(--muted); }
.plan-big { font-size: 40px; font-weight: 800; line-height: 1; }
.wx-day { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.wx-date { width: 92px; flex: none; font-size: 13px; }
.wx-wins { display: flex; flex-wrap: wrap; gap: 6px; }
.wx-win { font-size: 11px; border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; background: var(--panel-2); }

/* Explainers, referrals, misc Phase-1 UI */
.link-btn { background: none; border: none; color: var(--brand); font-size: 12px;
  padding: 6px 0; text-decoration: underline; cursor: pointer; }
.explain { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; font-size: 13px; margin: 8px 0; }
.explain ul { margin: 8px 0 0; padding-left: 18px; }
.explain li { margin-bottom: 8px; }
.explain p { margin: 0 0 8px; }
.opt.dnv.on { background: var(--opp); border-color: var(--opp); color: #fff; }
.ref-item { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; margin-bottom: 6px; font-size: 13px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ref-del { flex: none; background: none; border: none; color: var(--muted); font-size: 14px;
  padding: 4px 6px; border-radius: 6px; }
.ref-del:active { color: var(--opp); }
.toast-undo { background: rgba(255,255,255,.2); border: none; color: #fff; font-weight: 700;
  border-radius: 7px; padding: 5px 12px; margin-left: 4px; font-size: 13px; }
.ref-form { margin-top: 8px; }
.ref-form input { width: 100%; margin-bottom: 8px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 11px; font: inherit; }
.guide-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line); }
.guide-row .tier { margin-top: 2px; }

/* Auth screen */
.auth-screen { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center;
  background: radial-gradient(1200px 600px at 50% -10%, #19618A33, #0a1426); padding: 20px; }
.auth-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 22px; width: 100%; max-width: 380px; box-shadow: var(--shadow); }
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand h1 { font-size: 20px; }
.auth-logo { width: 100%; max-width: 280px; display: block; margin: 4px auto 6px; }
.auth-sub { color: var(--muted); font-size: 12px; margin: 4px 0 18px; text-align: center; }
.auth-msg { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 13px; margin-bottom: 14px; }
.fld { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
.fld input { display: block; width: 100%; margin-top: 5px; background: var(--panel-2);
  border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 12px; font: inherit; }
/* Show/hide password toggle */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 62px; }
.pw-toggle { position: absolute; right: 6px; bottom: 6px; background: var(--panel);
  border: 1px solid var(--line); color: var(--muted); font-size: 12px; font-weight: 600;
  padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.pw-toggle:active { transform: scale(.95); }
.auth-err { color: #fca5a5; font-size: 13px; min-height: 18px; margin-bottom: 6px; }
.auth-btn { width: 100%; padding: 14px; border: none; border-radius: 12px; background: var(--brand);
  color: #fff; font-size: 15px; font-weight: 700; }
.auth-btn:active { background: var(--brand-2); }
.auth-link { width: 100%; margin-top: 10px; background: none; border: none; color: var(--muted);
  font-size: 13px; text-decoration: underline; }

/* Campaign setup color row */
.color-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.color-row input[type=color] { width: 54px; height: 40px; padding: 2px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--panel-2); }

/* Campaign setup logo */
.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-preview { height: 40px; max-width: 180px; object-fit: contain; background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; }
.photo-preview { height: 52px; width: 52px; border-radius: 50%; object-fit: cover;
  background: var(--panel-2); border: 1px solid var(--line); }

/* Top-bar actions (search icon + account) */
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn { background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; width: 40px; height: 40px; font-size: 21px; line-height: 1;
  display: grid; place-items: center; flex: none; }
.icon-btn:active { transform: scale(.95); }
.icon-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }

/* User menu */
.user-menu { background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 12px; padding: 6px 12px; text-align: right; min-width: 90px; }
.um-name { font-size: 13px; font-weight: 600; }
.um-scope { font-size: 10px; color: var(--muted); }

/* Admin team cards */
.team-card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-bottom: 10px; }
.team-head { display: flex; justify-content: space-between; align-items: flex-start; }
.team-actions { display: flex; gap: 6px; }
.mini { background: var(--panel); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; }
.mini.danger { color: var(--opp); border-color: #5b2330; }
.invite-row { display: flex; gap: 6px; margin-top: 10px; }
.invite-row input { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line);
  color: var(--muted); border-radius: 8px; padding: 8px 10px; font-size: 11px; }

/* Mobile responsiveness — keep wide content from getting cut off */
@media (max-width: 640px) {
  /* Tables scroll horizontally instead of overflowing the card */
  .card table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  th, td { padding: 9px 8px; }
  .minibar { min-width: 52px; }
  /* Multi-input rows wrap instead of overflowing */
  .route-bar, .map-toolbar { flex-wrap: wrap; }
  .route-bar .route-btn { width: 100%; }
  main { padding: 12px; }
}

@media (min-width: 760px) {
  .stats { grid-template-columns: repeat(4, 1fr); }
  .voter-sheet { left: 50%; right: auto; bottom: 50%; transform: translate(-50%, 50%);
                 width: 560px; border-radius: 20px; animation: none; }
  #map { height: 68vh; }
  .two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
}
