:root {
  --bg: #f3f5f2;
  --panel: #ffffff;
  --ink: #14201c;
  --muted: #5f6d68;
  --line: #d5ddd8;
  --accent: #0f3d2e;
  --accent-soft: #1f6b52;
  --gold: #c9a227;
  --danger: #b33a3a;
  --warn: #c07a18;
  --support: #1f7a4d;
  --oppose: #a33d4a;
  --undecided: #6a6f8f;
  --shadow: 0 10px 30px rgba(15, 35, 28, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums lining-nums;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  min-height: 100vh;
  max-width: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding-bottom: env(safe-area-inset-bottom);
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px 10px;
  background: var(--gradient-topbar, linear-gradient(180deg, #0f3d2e 0%, #14553f 100%));
  color: #fff;
}

.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
}

.topbar p {
  margin: 4px 0 0;
  opacity: 0.85;
  font-size: 0.9rem;
}

.icon-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

.view {
  display: none;
  overflow: auto;
  padding: 14px 14px 88px;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.metric strong {
  display: block;
  font-size: 1.35rem;
}

.metric span {
  color: var(--muted);
  font-size: 0.85rem;
}

.metric.metric-drill {
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.metric.metric-drill:hover {
  border-color: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(15, 35, 28, 0.14);
}

.metric.metric-drill:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 107, 82, 0.28);
}

/* ===== Banner triage ===== */
.banner-stack {
  display: grid;
  gap: 8px;
  padding: 0 14px;
}

.banner-stack .banner {
  margin: 0;
}

.banner-stack.collapsed > .banner:not(.banner-pinned):nth-child(n + 3) {
  display: none;
}

.banner-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 14px 10px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px dashed var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.banner-more:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
}

/* ===== Metric clusters ===== */
.metric-clusters {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

.metric-cluster {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 12px 14px;
  box-shadow: var(--shadow);
}

.metric-cluster.metric-cluster-quiet {
  background: transparent;
  border: 1px dashed var(--line);
  box-shadow: none;
}

.metric-cluster-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 2px 4px 10px;
}

.metric-cluster-header h3 {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.metric-cluster-header .cluster-hint {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
}

.metric-cluster-header .cluster-hint.cluster-hint-good {
  color: var(--support);
  font-weight: 600;
}

.metric-cluster .metric-grid {
  margin-bottom: 0;
}

.metric-cluster .metric-grid:empty + .cluster-empty,
.metric-cluster .cluster-empty {
  margin: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #ecf6f0;
  color: var(--support);
  font-size: 0.85rem;
  font-weight: 600;
}

/* ===== Hero metric ===== */
.metric.metric-hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: linear-gradient(135deg, #ecf6f0 0%, #ffffff 65%);
  border: 1px solid #cee2d7;
}

.metric.metric-hero strong {
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
}

.metric.metric-hero span {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent-soft);
  margin-top: 6px;
}

.metric.metric-hero .hero-sub {
  font-size: 0.82rem;
  color: var(--muted);
  text-align: right;
  max-width: 60%;
  line-height: 1.35;
}

/* ===== Metric value states ===== */
.metric.metric-zero {
  opacity: 0.55;
}

.metric.metric-zero strong {
  color: var(--muted);
  font-weight: 600;
}

.metric.metric-attention {
  border-left: 4px solid var(--warn);
  background: linear-gradient(90deg, #fff7e8 0%, #ffffff 28%);
}

.metric.metric-attention strong {
  color: #8a5a12;
}

.metric.metric-danger {
  border-left: 4px solid var(--danger);
  background: linear-gradient(90deg, #fdecec 0%, #ffffff 28%);
}

.metric.metric-danger strong {
  color: var(--danger);
}

.metric.metric-good {
  border-left: 4px solid var(--support);
}

.metric.metric-good strong {
  color: var(--support);
}

/* ===== Support breakdown polish ===== */
.bar-row {
  grid-template-columns: minmax(110px, 1.2fr) minmax(0, 2fr) auto;
  font-size: 0.85rem;
  gap: 10px;
}

.bar-row .bar-label {
  font-weight: 600;
  color: var(--ink);
}

.bar-row .bar-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
  min-width: 60px;
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  justify-content: flex-end;
}

.bar-row .bar-pct {
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.75rem;
}

.bar-track {
  background: #ecf2ee;
  height: 8px;
  border-radius: 999px;
}

.bar-row.bar-row-support .bar-fill {
  background: linear-gradient(90deg, var(--support), #2da366);
}

.bar-row.bar-row-oppose .bar-fill {
  background: linear-gradient(90deg, var(--oppose), #c75462);
}

.bar-row.bar-row-undecided .bar-fill {
  background: linear-gradient(90deg, var(--undecided), #8a91a8);
}

.bar-row.bar-row-neutral .bar-fill {
  background: linear-gradient(90deg, #c2c7c4, #9ca29e);
}

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

  .metric-cluster.metric-cluster-wide {
    grid-column: 1 / -1;
  }
}

/* ===== Walk list toolbar v2 ===== */
.walk-toolbar-v2 {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.walk-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.walk-controls .walk-search-input {
  grid-column: 1 / -1;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 14px;
  background: #fff;
}

.walk-controls .walk-quick-select {
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 8px 10px;
  background: #fff;
  font-size: 0.88rem;
  min-width: 0;
}

.walk-filters-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease;
}

.walk-filters-toggle:hover {
  border-color: var(--accent-soft);
}

.walk-filters-toggle[aria-expanded="true"] {
  background: #e8f2ed;
  border-color: var(--accent-soft);
  color: var(--accent);
}

.walk-filters-toggle::after {
  content: "▾";
  font-size: 0.75rem;
  color: var(--muted);
  transition: transform 160ms ease;
}

.walk-filters-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.walk-filters-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.walk-filters-toggle[aria-expanded="true"] .walk-filters-count {
  background: var(--accent);
}

.walk-filters-clear {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.walk-filters-clear:hover {
  color: var(--danger);
}

/* ===== Filter chip strip ===== */
.walk-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.walk-filter-chips:empty {
  display: none;
}

.walk-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  background: #e8f2ed;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid #cbe2d7;
  white-space: nowrap;
  max-width: 100%;
}

.walk-filter-chip-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 220px;
}

.walk-filter-chip-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: none;
  background: rgba(15, 61, 46, 0.08);
  color: var(--accent);
  cursor: pointer;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0;
}

.walk-filter-chip-clear:hover {
  background: rgba(15, 61, 46, 0.18);
}

/* ===== Filter drawer + groups ===== */
.walk-filters {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.walk-filters.collapsed {
  display: none;
}

.filter-group {
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px 12px;
}

.filter-group > h4 {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.filter-group-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  white-space: nowrap;
}

.filter-chip-input:hover {
  border-color: var(--accent-soft);
}

.filter-chip-input input[type="checkbox"] {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.filter-chip-input:has(input[type="checkbox"]:checked) {
  background: #e8f2ed;
  border-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.filter-chip-input-select {
  padding: 4px 8px 4px 12px;
  gap: 8px;
}

.filter-chip-input-select > span {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted);
}

.filter-chip-input-select select {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.82rem;
  background: #fff;
}

@media (min-width: 640px) {
  .walk-controls {
    grid-template-columns: minmax(0, 1fr) 180px 160px auto auto;
  }

  .walk-controls .walk-search-input {
    grid-column: auto;
  }

  .walk-filters {
    grid-template-columns: 1fr 1fr;
  }

  .filter-group {
    margin: 0;
  }
}

@media (min-width: 960px) {
  .walk-filters:not(.collapsed) {
    grid-template-columns: 1fr 1fr 1fr;
  }
}

/* ===== Analytics — KPI strip + summaries + hotspot cards ===== */
#analytics-content {
  display: grid;
  gap: 12px;
}

.analytics-kpi-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.analytics-kpi-strip .metric {
  margin: 0;
}

.analytics-summary-grid {
  display: grid;
  gap: 10px;
}

.analytics-summary {
  margin: 0;
  padding: 12px 14px 14px;
}

.analytics-summary h3 {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-kv-list {
  display: grid;
  gap: 6px;
}

.analytics-kv-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.88rem;
}

.analytics-kv-row:last-child {
  border-bottom: none;
}

.analytics-kv-row .kv-label {
  color: var(--ink);
  font-weight: 500;
}

.analytics-kv-row .kv-value {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ink);
}

.analytics-kv-row .kv-share {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.analytics-district-list {
  display: grid;
  gap: 8px;
}

.analytics-district-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  background: #f7faf8;
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.analytics-district-row .dist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.analytics-district-row .dist-name {
  display: grid;
  gap: 2px;
}

.analytics-district-row .dist-name .dist-name-line {
  font-weight: 600;
  color: var(--ink);
}

.analytics-district-row .dist-name .dist-name-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.analytics-district-row .dist-stats {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.analytics-district-row .dist-rate {
  font-weight: 700;
  color: var(--accent);
}

.analytics-district-row .dist-sub {
  font-size: 0.74rem;
  color: var(--muted);
}

/* Hotspot section + card grid */
.hotspot-section {
  margin: 0;
  padding: 12px 14px 14px;
}

.hotspot-section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.hotspot-section-header h3 {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}

.hotspot-section-count {
  font-size: 0.74rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.hotspot-section-empty {
  font-size: 0.78rem;
  color: var(--support);
  font-weight: 600;
}

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

.hotspot-card {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  text-align: left;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
  min-width: 0;
}

.hotspot-card:hover {
  border-color: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(15, 35, 28, 0.08);
}

.hotspot-card:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 107, 82, 0.28);
}

.hotspot-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.hotspot-card .hotspot-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 2px 6px;
  border-radius: 6px;
  background: #e8f2ed;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.hotspot-card-loc {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 0;
  line-height: 1.2;
}

.hotspot-card-loc > strong {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hotspot-card-loc > span {
  font-size: 0.72rem;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hotspot-card-metric {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 2px;
}

.hotspot-card-metric strong {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.hotspot-card-metric span {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.hotspot-card-foot {
  display: grid;
  gap: 4px;
  margin-top: 2px;
}

.hotspot-ratio-track {
  height: 4px;
  background: #ecf2ee;
  border-radius: 999px;
  overflow: hidden;
}

.hotspot-ratio-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  border-radius: 999px;
}

.hotspot-ratio-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Tone variants on cards */
.hotspot-card-attention {
  border-left: 4px solid var(--warn);
}
.hotspot-card-attention .hotspot-card-metric strong { color: #8a5a12; }
.hotspot-card-attention .hotspot-ratio-fill { background: linear-gradient(90deg, #e8b260, var(--warn)); }
.hotspot-card-attention .hotspot-badge { background: #fff4e0; color: #8a5a12; }

.hotspot-card-danger {
  border-left: 4px solid var(--danger);
}
.hotspot-card-danger .hotspot-card-metric strong { color: var(--danger); }
.hotspot-card-danger .hotspot-ratio-fill { background: linear-gradient(90deg, #e08086, var(--danger)); }
.hotspot-card-danger .hotspot-badge { background: #fde8eb; color: var(--danger); }

.hotspot-card-good {
  border-left: 4px solid var(--support);
}
.hotspot-card-good .hotspot-card-metric strong { color: var(--support); }
.hotspot-card-good .hotspot-ratio-fill { background: linear-gradient(90deg, #66ba8a, var(--support)); }
.hotspot-card-good .hotspot-badge { background: #e4f4ea; color: var(--support); }

.hotspot-card-oppose {
  border-left: 4px solid var(--oppose);
}
.hotspot-card-oppose .hotspot-card-metric strong { color: var(--oppose); }
.hotspot-card-oppose .hotspot-ratio-fill { background: linear-gradient(90deg, #c97f8a, var(--oppose)); }
.hotspot-card-oppose .hotspot-badge { background: #fde8eb; color: var(--oppose); }

.hotspot-card-muted {
  background: #fafbf9;
}
.hotspot-card-muted .hotspot-card-metric strong { color: var(--muted); }
.hotspot-card-muted .hotspot-ratio-fill { background: #c8d0cb; }

/* Analytics export bar — light visual upgrade */
.analytics-export-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 0 0 8px;
}

.analytics-export-row .small-btn {
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  background: #fff;
  border: 1px solid var(--line);
}

.analytics-export-row .small-btn:hover {
  border-color: var(--accent-soft);
  color: var(--accent);
}

@media (min-width: 640px) {
  .analytics-kpi-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .analytics-summary-grid {
    grid-template-columns: 1fr 1fr;
  }

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

@media (min-width: 960px) {
  .hotspot-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* ===== Turfs filters row ===== */
.turf-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.turf-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.78rem;
  min-height: 36px;
  margin: 0;
}

.turf-filter-pill > span {
  flex: 0 0 auto;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--muted);
}

.turf-filter-pill > span.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.turf-filter-pill select,
.turf-filter-pill input {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.82rem;
  background: #fff;
  min-width: 0;
}

.turf-filter-pill input[type="search"] {
  min-width: 220px;
}

.turf-filter-pill:has(input:not([value=""]):not([value=" "])),
.turf-filter-pill:has(select:not([data-empty])) {
  border-color: var(--accent-soft);
}

.turf-filter-pill:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 107, 82, 0.18);
}

#turf-filter-chips {
  margin-bottom: 8px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.toolbar,
.search-row,
.walk-toolbar {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.search-row {
  grid-template-columns: 1fr auto;
}

.toolbar {
  grid-template-columns: 1fr;
}

input,
select,
textarea,
button {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 10px 12px;
}

button {
  cursor: pointer;
  background: #fff;
}

button.primary,
.search-row button,
#turf-form button[type="submit"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.text-btn {
  border: none;
  background: transparent;
  color: var(--accent-soft);
  padding: 0;
}

.card-list,
.walk-list,
.result-list,
.bar-list,
.mini-list {
  display: grid;
  gap: 10px;
}

.card,
.walk-item,
.result-item {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  width: 100%;
  box-shadow: var(--shadow);
}

.card {
  cursor: pointer;
}

.card h3,
.walk-item h3,
.result-item h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}

.card p,
.walk-item p,
.result-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.card .stats,
.walk-item .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
}

.pill.support {
  background: #e4f4ea;
  color: var(--support);
}

.pill.oppose {
  background: #fde8eb;
  color: var(--oppose);
}

.pill.neutral {
  background: #eef0f8;
  color: var(--undecided);
}

.pill.muted {
  background: #edf1ef;
  color: var(--muted);
}

.bar-row {
  display: grid;
  grid-template-columns: 120px 1fr 48px;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.85rem;
}

.bar-track {
  height: 10px;
  background: #e8eeea;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-soft), var(--gold));
}

.walk-header {
  margin-bottom: 10px;
}

.walk-header h2 {
  margin: 6px 0 0;
}

.walk-footer {
  position: sticky;
  bottom: 72px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: rgba(243, 245, 242, 0.95);
  padding: 10px 0;
  backdrop-filter: blur(6px);
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: min(720px, 100%);
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-around;
  gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  background: var(--color-surface-panel, rgba(255, 255, 255, 0.96));
  border-top: 1px solid var(--line);
  z-index: 50;
}

.bottom-nav .nav-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 6px;
  font-size: 0.9rem;
}

/* ── Sidebar (desktop) ──────────────────────────────────────── */
.sidebar {
  display: none;
}
.sidebar-brand {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 18px 16px 16px;
  border-bottom: 1px solid var(--line);
}
.sidebar-mark { width: 36px; height: 36px; }
.sidebar-brand strong { display: block; font-size: 0.95rem; line-height: 1.1; }
.sidebar-brand .small { font-size: 0.75rem; }
.sidebar-nav { flex: 1 1 auto; overflow-y: auto; padding: 8px 6px; }
.sidebar-group { margin-bottom: 6px; }
.sidebar-group.hidden { display: none; }
.sidebar-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}
.sidebar-group-header:hover { background: var(--color-surface-tonal, #e8f2ed); color: var(--ink); }
.sidebar-group-caret {
  display: inline-block;
  width: 14px;
  font-size: 0.8rem;
  transition: transform 160ms ease;
}
.sidebar-group:not(.is-open) .sidebar-group-caret { transform: rotate(-90deg); }
.sidebar-group-body {
  max-height: 600px;
  overflow: hidden;
  transition: max-height 220ms ease, opacity 180ms ease;
  opacity: 1;
  padding: 2px 6px 6px;
}
.sidebar-group:not(.is-open) .sidebar-group-body {
  max-height: 0;
  opacity: 0;
  padding: 0 6px;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px 9px 18px;
  background: transparent;
  border: none;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.sidebar-item:hover { background: var(--color-surface-tonal, #e8f2ed); }
.sidebar-item.active {
  background: var(--color-surface-tonal, #e8f2ed);
  border-left-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.sidebar-item.hidden { display: none; }
.sidebar-item-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  font-size: 0.95rem;
  color: var(--muted);
  flex-shrink: 0;
}
.sidebar-item.active .sidebar-item-icon { color: var(--accent); }
.sidebar-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--line);
}

/* When sidebar is visible, layout becomes 2-column grid */
@media (min-width: 900px) {
  #app-shell.app {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 100vh;
    max-width: none;
    padding-bottom: 0;
  }
  .sidebar {
    display: flex;
    flex-direction: column;
    background: var(--color-surface-panel, #fff);
    border-right: 1px solid var(--line);
    height: 100vh;
    overflow: hidden;
    position: sticky;
    top: 0;
  }
  .app-main {
    overflow-y: auto;
    max-height: 100vh;
    width: 100%;
  }
  .app-main > .view,
  .app-main > .topbar,
  .app-main > .quickfind,
  .app-main > #offline-bar,
  .app-main > #install-banner,
  .app-main > #phase-banner,
  .app-main > #app-boot-banner {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
  }
  .app-main > .quickfind { position: sticky; top: 0; }
  .bottom-nav { display: none !important; }
}

@media (max-width: 899px) {
  .app-main { display: block; }
}

.quickfind {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 8px 14px;
  background: var(--color-surface-panel, #fff);
  border-bottom: 1px solid var(--line);
}
.quickfind-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.quickfind-row input[type="search"] { flex: 1 1 auto; min-width: 0; }
.quickfind-scopes {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  flex-shrink: 0;
}
.quickfind-scope {
  border: none;
  background: transparent;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  font-weight: 600;
}
.quickfind-scope.active {
  background: var(--accent);
  color: #fff;
}
.quickfind-scope:hover:not(.active) { background: var(--color-surface-tonal, #e8f2ed); color: var(--ink); }
@media (max-width: 520px) {
  .quickfind-row { flex-wrap: wrap; }
  .quickfind-scopes { width: 100%; justify-content: stretch; }
  .quickfind-scope { flex: 1 1 0; text-align: center; }
}
.quickfind input[type="search"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 1rem;
}
.quickfind input[type="search"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.quickfind-results {
  position: absolute;
  left: 14px;
  right: 14px;
  margin-top: 4px;
  max-height: 360px;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.18);
  z-index: 41;
}
.quickfind-results.hidden { display: none; }
.quickfind-section {
  padding: 6px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--bg);
}
.quickfind-result {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  background: var(--panel);
  border: none;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
  color: var(--ink);
}
.quickfind-result:last-child { border-bottom: none; }
.quickfind-result:hover,
.quickfind-result[aria-selected="true"] { background: var(--color-surface-tonal, #e8f2ed); }
.quickfind-result strong { display: block; font-size: 0.95rem; }
.quickfind-result span { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.quickfind-empty { padding: 14px; color: var(--muted); font-size: 0.9rem; }

/* ── Canvass Sheet ─────────────────────────────────────────── */
.canvass-breadcrumb-panel { padding: 12px 14px; }
.canvass-breadcrumb {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
}
.canvass-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink);
  flex-shrink: 0;
}
.canvass-crumb:hover:not(:disabled) { border-color: var(--accent); }
.canvass-crumb:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  background: transparent;
}
.canvass-crumb.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.canvass-crumb.is-active .canvass-crumb-num { background: rgba(255,255,255,0.25); color: #fff; }
.canvass-crumb-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-surface-tonal, #e8f2ed);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
}
.canvass-crumb-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.7;
}
.canvass-crumb-value { font-weight: 600; font-size: 0.92rem; }
.canvass-crumb-sep { color: var(--muted); padding: 0 2px; font-size: 1.1rem; align-self: center; }

.canvass-step-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.canvass-step-head h2 { margin: 0; }
.canvass-step-search {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.92rem;
  min-width: 200px;
}
.canvass-step-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.92rem;
}
.canvass-voters-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.canvass-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.canvass-region-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.canvass-region-card:hover { border-color: var(--accent); }
.canvass-region-card strong { font-size: 1rem; color: var(--ink); }
.canvass-region-card .canvass-region-no { font-size: 0.72rem; font-weight: 700; color: var(--accent); }
.canvass-region-card .canvass-region-meta { font-size: 0.78rem; color: var(--muted); }

.canvass-division-list { display: grid; gap: 8px; }
.canvass-division-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.canvass-division-row:hover { border-color: var(--accent); }
.canvass-division-row strong { font-size: 0.95rem; color: var(--ink); display: block; }
.canvass-division-row .canvass-division-sub { font-size: 0.78rem; color: var(--muted); }
.canvass-division-row .canvass-division-bar {
  width: 90px;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.canvass-division-row .canvass-division-bar > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.canvass-voter-list { display: grid; gap: 6px; }
.canvass-voter-row {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  text-align: left;
}
.canvass-voter-row:hover { border-color: var(--accent); }
.canvass-voter-row .canvass-voter-bar {
  align-self: stretch;
  border-radius: 4px;
  background: var(--line);
}
.canvass-voter-row .canvass-voter-name { font-weight: 600; color: var(--ink); }
.canvass-voter-row .canvass-voter-meta { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.canvass-voter-row .canvass-voter-pills { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.canvass-voter-row .canvass-voter-pills .pill { font-size: 0.72rem; padding: 2px 6px; }

/* Support color bars */
.canvass-voter-row[data-support="strong_support"] .canvass-voter-bar,
.canvass-voter-row[data-support="lean_support"] .canvass-voter-bar { background: var(--support, #1f7a4d); }
.canvass-voter-row[data-support="strong_oppose"] .canvass-voter-bar,
.canvass-voter-row[data-support="lean_oppose"] .canvass-voter-bar { background: var(--oppose, #a33d4a); }
.canvass-voter-row[data-support="undecided"] .canvass-voter-bar { background: var(--undecided, #6a6f8f); }
.canvass-voter-row[data-support="refused"] .canvass-voter-bar,
.canvass-voter-row[data-support="not_home"] .canvass-voter-bar { background: var(--warn, #c07a18); }
.canvass-voter-row[data-support="not_contacted"] .canvass-voter-bar { background: var(--line); }

/* ── Charts (inline SVG) ──────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 12px;
}
.chart-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
}
.chart-card h3 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}
.chart-card .chart-sub { margin: 0 0 10px; font-size: 0.78rem; color: var(--muted); }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-legend {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.82rem;
}
.chart-legend .row { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 8px; }
.chart-legend .sw { width: 12px; height: 12px; border-radius: 3px; }
.chart-legend .ct { color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-bar-row {
  display: grid;
  grid-template-columns: 130px 1fr 60px;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  font-size: 0.85rem;
}
.chart-bar-row .label { color: var(--ink); }
.chart-bar-row .track {
  position: relative;
  height: 14px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}
.chart-bar-row .fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent);
  border-radius: 6px;
}
.chart-bar-row .count { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.chart-bar-row[data-tone="warn"] .fill { background: var(--warn); }
.chart-bar-row[data-tone="oppose"] .fill { background: var(--oppose); }
.chart-bar-row[data-tone="support"] .fill { background: var(--support); }
.chart-bar-row[data-tone="undecided"] .fill { background: var(--undecided); }
.chart-bar-row[data-tone="muted"] .fill { background: var(--line); }

/* ── About view ──────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.about-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.about-card h3 { margin: 0 0 8px; font-size: 0.95rem; color: var(--accent); }
.about-list, .about-stats {
  margin: 0;
  padding-left: 18px;
  font-size: 0.88rem;
}
.about-list li, .about-stats li { padding: 3px 0; }
.about-list a { color: var(--accent); }
.about-list a:hover { text-decoration: underline; }
.about-card .small { font-size: 0.78rem; }

/* ── Map embed (iframe to /maps/viewer/) ─────────────────── */
.map-panel { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; min-height: 80vh; }
.map-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
}
.map-panel-head h2 { margin: 0; }
.map-panel-actions { display: flex; gap: 6px; }
.map-frame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 70vh;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
}
@media (min-width: 900px) {
  .map-frame { min-height: 78vh; }
}

/* When the standalone viewer detects ?embed=1 it suppresses its own brand row */

/* ── Data Viewer ───────────────────────────────────────────── */
.data-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}
.data-toolbar label { display: grid; gap: 4px; font-size: 0.8rem; }
.data-toolbar label > span { color: var(--muted); font-weight: 600; text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.04em; }
.data-toolbar select,
.data-toolbar input[type="search"] {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
  font: inherit;
  font-size: 0.92rem;
}
.data-filter-grow { flex: 1 1 200px; }
.data-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.rr-toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.rr-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.rr-counts { display: flex; gap: 6px; flex-wrap: wrap; }
.rr-input { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); font-size: 0.85rem; }
#rr-table-wrap { overflow-x: auto; }
.rr-detail h3 { margin: 8px 0 4px; }
.rr-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0; align-items: center; }
.rr-detail-actions .rr-input { min-width: 240px; flex: 1; }
.rr-btn, .rr-btn-primary { padding: 7px 14px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; font-size: 0.85rem; background: var(--surface, #fff); }
.rr-btn-primary { background: var(--accent, #1f7a4d); color: #fff; border-color: transparent; }
.rr-btn-small { padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface, #fff); cursor: pointer; font-size: 0.78rem; margin-left: 8px; }
.rr-btn-link { background: none; border: none; color: var(--accent, #1f7a4d); cursor: pointer; padding: 0; margin-bottom: 8px; font-size: 0.85rem; }
.rr-input.is-corrected { border-color: var(--accent, #1f7a4d); background: rgba(31, 122, 77, 0.06); }
.rr-history { list-style: none; padding: 0; margin: 6px 0; }
.rr-history li { padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.85rem; }
.banner.error { color: var(--danger, #b00020); }
.rr-sbs { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.rr-sbs-fields { flex: 1 1 360px; min-width: 320px; }
.rr-sbs-source { flex: 1 1 360px; min-width: 320px; }
.rr-source-pdf { width: 100%; height: 540px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.rr-upload { margin: 8px 0; }
.rr-upload textarea { width: 100%; font-family: monospace; font-size: 0.8rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
#admin-search { width: 100%; max-width: 480px; }
.admin-search-group { margin-top: 12px; }
.admin-search-group h4 { margin: 0 0 6px; }
.admin-search-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface, #fff); cursor: pointer; margin-bottom: 4px; }
.admin-search-item:hover { background: var(--color-surface-tonal, #e8f2ed); }
#admin-edit-panel:not(:empty) { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
#reconcile-input, #lc-bulk-uids { width: 100%; font-family: monospace; font-size: 0.8rem; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; }
.ae-lifecycle { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.dup-group { margin: 8px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.rec-summary { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.data-table th, .data-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}
.data-table th {
  background: var(--bg);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  cursor: pointer;
  position: sticky;
  top: 0;
  z-index: 1;
}
.data-table th .sort-arrow {
  display: inline-block;
  width: 12px;
  opacity: 0.5;
}
.data-table th.is-sorted .sort-arrow { opacity: 1; color: var(--accent); }
.data-table tbody tr:hover { background: var(--color-surface-tonal, #e8f2ed); cursor: pointer; }
.data-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table .pct-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.data-table .pill-warn {
  background: rgba(176, 122, 24, 0.12);
  color: var(--warn);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
}

.region-laa-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  padding: 8px 10px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.88rem;
}
.region-laa-row:last-child { border-bottom: none; }

.region-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}
.region-detail-head h2 { margin: 0 0 4px; }
.region-detail-actions { display: flex; gap: 6px; }
.region-card-wide { grid-column: 1 / -1; }

/* Region drill row — Summary's "region winners" card grid.
   `minmax(0, 1fr)` + `min-width: 0` lets the name column shrink properly
   within a narrow chart card so the vote-bar + Open button don't overflow.
   On narrow viewports the bar + button wrap to their own rows. */
.region-summary-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.6fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 0.88rem;
}
.region-summary-row .region-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  flex-shrink: 0;
}
.region-summary-row .name {
  font-weight: 600;
  min-width: 0;       /* required for grid children to shrink below content */
  overflow-wrap: anywhere;
}
.region-summary-row .vote-bars {
  display: flex;
  gap: 2px;
  min-width: 0;       /* let it compress in narrow cards */
  height: 14px;
  align-items: center;
}
.region-summary-row .vote-bars .seg { height: 10px; }
@media (max-width: 720px) {
  .region-summary-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    row-gap: 6px;
  }
  .region-summary-row .vote-bars {
    grid-column: 1 / -1;
    min-width: 0;
  }
}
.region-summary-row .open-btn {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
}

/* ── Phone Bank ────────────────────────────────────────────── */
.phonebank-scope {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}
.phonebank-scope label { flex: 1 1 200px; min-width: 160px; }
.phonebank-scope select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg);
}
.phonebank-current {
  text-align: center;
}
.phonebank-pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.phonebank-name {
  margin: 12px 0 4px;
  font-size: 1.4rem;
}
.phonebank-address {
  margin: 0 0 14px;
  font-size: 0.95rem;
}
.phonebank-call {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 18px 32px;
  margin: 14px auto 18px;
  font-size: 1.4rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  border-radius: 14px;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.phonebank-call:hover { background: var(--accent-soft, #1f6b52); }
.phonebank-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.phonebank-btn {
  padding: 18px 14px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}
.phonebank-btn:hover { border-color: var(--accent); }
.phonebank-btn-spoke {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.phonebank-btn-spoke:hover { background: var(--accent-soft, #1f6b52); border-color: var(--accent-soft, #1f6b52); }
.phonebank-expand {
  margin-top: 14px;
  text-align: left;
}
.phonebank-expand summary {
  cursor: pointer;
  padding: 8px;
  font-weight: 600;
  color: var(--muted);
}
.phonebank-extra {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
}
.phonebank-extra .full { grid-column: 1 / -1; }
.phonebank-extra label { display: grid; gap: 4px; font-size: 0.85rem; }
.phonebank-extra input, .phonebank-extra select, .phonebank-extra textarea {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
}

/* Voter sheet — collapse, save & next, tap-to-call, copy address */
.voter-more-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  margin: 4px 0 8px;
}
.voter-more-toggle:hover { border-color: var(--accent); }
.voter-more-toggle[aria-expanded="true"] { background: var(--color-surface-tonal, #e8f2ed); }
.voter-more-caret { display: inline-block; transition: transform 160ms ease; }
.voter-more-toggle[aria-expanded="true"] .voter-more-caret { transform: rotate(90deg); }
.voter-more-label { flex-shrink: 0; }
.voter-more-hint { font-weight: 400; font-size: 0.78rem; }
.voter-more-fields { display: grid; gap: 12px; }
.voter-more-fields.hidden { display: none; }

.voter-phone-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.voter-phone-row input { flex: 1 1 auto; min-width: 0; }
#voter-phone-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
}

.voter-copy-btn { margin-top: 4px; }

.voter-save-next {
  background: var(--accent-soft, #1f6b52);
  border-color: var(--accent-soft, #1f6b52);
}

.print-cols-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 6px;
}
.print-cols-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.92rem;
}
.print-cols-grid label:has(input:checked) {
  border-color: var(--accent);
  background: var(--color-surface-tonal, #e8f2ed);
}
.print-cols-grid .col-order {
  display: inline-block;
  width: 18px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

/* Use element+class specificity (0-1-1) so this beats the generic
   `.small-btn { background:#fff }` rule that appears later in the file —
   otherwise the green fill loses to white and the white label becomes
   invisible until hover. */
button.canvass-print-btn {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
button.canvass-print-btn:hover { background: var(--accent-soft, #1f6b52); border-color: var(--accent-soft, #1f6b52); }

.canvass-voters-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 12px;
}

.page-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px;
  margin: 8px 0 4px;
  background: var(--color-surface-panel, #fff);
  border-radius: 10px;
  border: 1px solid var(--line);
}
.page-jumps a {
  padding: 6px 12px;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.page-jumps a:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.home-hero h1 { margin: 0 0 4px; }
.home-hero .small { font-size: 0.85rem; }
.home-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.home-action {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
  font: inherit;
}
.home-action:hover { border-color: var(--accent); }
.home-action strong { font-size: 1rem; color: var(--ink); }
.home-action span { font-size: 0.82rem; }

.nav-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.nav-btn.active {
  color: var(--accent);
  background: var(--color-surface-tonal, #e8f2ed);
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-grid label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
}

.checkbox {
  grid-template-columns: auto 1fr;
  align-items: start;
}

dialog {
  border: none;
  border-radius: 18px 18px 0 0;
  width: min(720px, 100%);
  max-width: 100%;
  max-height: 92vh;
  margin: auto 0 0;
  padding: 0;
  box-shadow: var(--shadow);
  z-index: 2000;
}

dialog::backdrop {
  background: rgba(10, 20, 16, 0.45);
}

.voter-sheet,
.settings-sheet {
  padding: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-height: 92vh;
  min-height: 0;
}

.voter-sheet-header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 12px 16px 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fafdfb 100%);
  border-bottom: 1px solid var(--line);
}

.voter-sheet-header-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.voter-sheet-close {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.voter-sheet-close:hover {
  border-color: var(--accent-soft);
  color: var(--accent);
}

.voter-sheet-map-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
}

.voter-sheet-map-link:hover {
  border-color: var(--accent-soft);
  background: #e8f2ed;
}

.voter-sheet-header h2 {
  margin: 4px 0 2px;
  font-size: 1.15rem;
  line-height: 1.25;
  word-break: break-word;
}

.voter-sheet-address {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.35;
}

.voter-sheet-body {
  overflow-y: auto;
  padding: 12px 16px 8px;
  -webkit-overflow-scrolling: touch;
}

.voter-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  margin-bottom: 10px;
}

.voter-section {
  margin: 0 0 14px;
}

.voter-section-title {
  margin: 0 0 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.voter-field-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.voter-sheet label {
  display: grid;
  gap: 4px;
  margin: 0;
}

.voter-sheet label > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
}

.voter-sheet input,
.voter-sheet select,
.voter-sheet textarea {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.95rem;
}

.voter-sheet textarea {
  min-height: 64px;
  resize: vertical;
}

.voter-sheet input:focus-visible,
.voter-sheet select:focus-visible,
.voter-sheet textarea:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(31, 107, 82, 0.22);
}

.voter-tag-fieldset {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.voter-tag-fieldset .voter-field-full {
  flex: 1 1 100%;
  margin-top: 6px;
}

.voter-checkbox-pill {
  grid-template-columns: auto auto;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 0.85rem;
  min-height: 40px;
  margin: 0;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.voter-checkbox-pill:hover {
  border-color: var(--accent-soft);
}

.voter-checkbox-pill input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  accent-color: var(--accent);
  margin: 0;
}

.voter-checkbox-pill:has(input[type="checkbox"]:checked) {
  background: #e8f2ed;
  border-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.voter-checkbox-pill span {
  font-size: 0.85rem;
  font-weight: inherit;
  color: inherit;
}

.voter-log-contact {
  margin: 4px 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f7faf8;
  border: 1px solid var(--line);
}

.voter-actions {
  position: sticky;
  bottom: 0;
  background: #fff;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(15, 35, 28, 0.06);
}

.voter-actions .primary {
  width: 100%;
  min-height: 48px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
}

.subpanel {
  margin: 14px 0 8px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
}

.subpanel h3 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 0.5rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
  min-height: 34px;
}

.tag-chip:hover {
  border-color: var(--accent-soft);
}

.tag-chip:has(input:checked) {
  background: #e8f2ed;
  border-color: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

.tag-chip input {
  margin: 0;
  accent-color: var(--accent);
  min-height: 0;
  padding: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 420px) {
  .voter-field-grid {
    grid-template-columns: 1fr 1fr;
  }

  .voter-field-grid .voter-field-full {
    grid-column: 1 / -1;
  }
}

.hidden {
  display: none !important;
}

.support-strong_support,
.support-lean_support {
  border-left: 4px solid var(--support);
}

.support-strong_oppose,
.support-lean_oppose {
  border-left: 4px solid var(--oppose);
}

.support-undecided {
  border-left: 4px solid var(--undecided);
}

.support-not_contacted {
  border-left: 4px solid var(--line);
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 20px;
  background:
    radial-gradient(circle at 90% 8%, rgba(247, 197, 24, 0.18), transparent 40%),
    radial-gradient(circle at 8% 92%, rgba(15, 138, 63, 0.22), transparent 35%),
    var(--gradient-topbar, linear-gradient(160deg, #0f3d2e, #1a5c47));
  background-attachment: fixed;
}

.login-stack {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
}

.login-card {
  width: 100%;
  background: var(--panel);
  border-radius: 20px;
  padding: 28px 24px 22px;
  display: grid;
  gap: 14px;
  box-shadow: 0 28px 56px rgba(0, 0, 0, 0.22), 0 8px 20px rgba(0, 0, 0, 0.12);
}

.login-brand {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
}

.login-logo {
  width: 72px;
  height: auto;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
}

.login-brand h1 {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.15;
}

.login-tagline {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 500;
}

.login-divider {
  height: 1px;
  background: var(--line);
  margin: 2px 0 0;
}

.login-divider-labelled {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  height: auto;
  margin: 4px 0 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.login-divider-labelled::before,
.login-divider-labelled::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-field > span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.login-field input {
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--color-surface-elevated, #f7faf8);
  font-size: 0.95rem;
}

.login-field input:focus-visible {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(31, 107, 82, 0.18);
}

.login-submit {
  min-height: 48px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 12px;
  margin-top: 4px;
  box-shadow: 0 6px 14px rgba(15, 138, 63, 0.28);
}

.boot-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 24, 18, 0.62);
  backdrop-filter: blur(4px);
}

.boot-overlay.hidden {
  display: none;
  pointer-events: none;
}

.boot-progress {
  display: grid;
  gap: 4px;
  width: min(360px, 100%);
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel, #fff);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.boot-status-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
}

.boot-detail,
.boot-elapsed {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.35;
}

.login-resume-row {
  margin: 0;
  text-align: center;
}

.login-resume-row .text-btn {
  font-size: 0.88rem;
}

.app-boot-banner {
  margin: 0;
  border-radius: 0;
  border-left: none;
  border-right: none;
  text-align: center;
  font-size: 0.88rem;
}

.login-pilot-block {
  display: grid;
  gap: 8px;
}

.login-pilot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.login-pilot-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--color-surface-elevated, #f7faf8);
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--ink);
  font-weight: 500;
  transition: border-color 120ms ease, transform 120ms ease, background 120ms ease;
}

.login-pilot-chip:hover {
  border-color: var(--accent-soft);
  background: var(--color-surface-tonal, #e8f2ed);
  transform: translateY(-1px);
}

.login-pilot-chip strong {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.login-pilot-chip span {
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
}

.login-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 8px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.login-footer-brand {
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--eg-gold-400, #f7c518);
}

.login-footer-meta {
  text-align: right;
  opacity: 0.9;
}

/* ===== Topbar mark ===== */
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
}

.topbar-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.topbar-brand h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.topbar-brand p {
  margin: 2px 0 0;
  opacity: 0.85;
  font-size: 0.82rem;
}

@media (max-width: 380px) {
  .topbar-mark {
    width: 32px;
    height: 32px;
  }

  .topbar-brand h1 {
    font-size: 1.1rem;
  }
}

/* ============================================================
   FIELD MODE polish overrides
   Targets the hardcoded light-color spots in the legacy
   styles.css that don't reskin via the compat layer.
   ============================================================ */
.theme-field-mode .pill.support {
  background: #1a3520;
  color: #66d690;
}

.theme-field-mode .pill.oppose {
  background: #381a1d;
  color: #f08891;
}

.theme-field-mode .pill.neutral {
  background: #1b2333;
  color: #97a3c4;
}

.theme-field-mode .pill.muted {
  background: var(--color-surface-raised);
  color: var(--color-ink-muted);
}

.theme-field-mode .pill.warn {
  background: #3a2d12;
  color: #f5c542;
  border-color: rgba(245, 197, 66, 0.35);
}

.theme-field-mode .pill.danger {
  background: #3a1818;
  color: #ff8a8a;
  border-color: rgba(255, 100, 100, 0.35);
}

.theme-field-mode .banner {
  background: var(--color-surface-tonal);
  color: var(--color-brand-primary);
}

.theme-field-mode .banner.warn {
  background: #3a2d12;
  color: #f5c542;
  border-color: rgba(245, 197, 66, 0.35);
}

.theme-field-mode .metric.metric-attention {
  background: linear-gradient(90deg, #2a2210 0%, var(--color-surface-panel) 28%);
}

.theme-field-mode .metric.metric-attention strong {
  color: #f5c542;
}

.theme-field-mode .metric.metric-danger {
  background: linear-gradient(90deg, #2a1414 0%, var(--color-surface-panel) 28%);
}

.theme-field-mode .metric.metric-danger strong {
  color: #ff8a8a;
}

.theme-field-mode .metric.metric-good {
  border-left-color: var(--color-success);
}

.theme-field-mode .metric.metric-good strong {
  color: var(--color-success);
}

.theme-field-mode .quick-taps button {
  background: var(--color-surface-tonal);
  border: 1px solid var(--color-line-strong);
  color: var(--color-brand-primary);
}

.theme-field-mode .bar-track,
.theme-field-mode .hotspot-ratio-track {
  background: var(--color-surface-sunken);
}

.theme-field-mode .crosswalk-preview .mini-table th,
.theme-field-mode .crosswalk-preview .mini-table td {
  border-bottom-color: var(--color-line-default);
}

/* Hotspot card tone variants on dark */
.theme-field-mode .hotspot-card-attention {
  background: linear-gradient(90deg, #2a2210 0%, var(--color-surface-raised) 30%);
}

.theme-field-mode .hotspot-card-attention .hotspot-card-metric strong {
  color: #f5c542;
}

.theme-field-mode .hotspot-card-attention .hotspot-badge {
  background: #3a2d12;
  color: #f5c542;
}

.theme-field-mode .hotspot-card-danger {
  background: linear-gradient(90deg, #2a1414 0%, var(--color-surface-raised) 30%);
}

.theme-field-mode .hotspot-card-danger .hotspot-card-metric strong {
  color: #ff8a8a;
}

.theme-field-mode .hotspot-card-danger .hotspot-badge {
  background: #3a1818;
  color: #ff8a8a;
}

.theme-field-mode .hotspot-card-good {
  background: linear-gradient(90deg, #133a26 0%, var(--color-surface-raised) 30%);
}

.theme-field-mode .hotspot-card-good .hotspot-badge {
  background: #133a26;
  color: var(--color-success);
}

.theme-field-mode .hotspot-card-oppose .hotspot-card-metric strong {
  color: #f08891;
}

.theme-field-mode .hotspot-card-oppose .hotspot-badge {
  background: #381a1d;
  color: #f08891;
}

.theme-field-mode .hotspot-card-muted {
  background: var(--color-surface-sunken);
}

/* District/region rows on dark */
.theme-field-mode .analytics-district-row .dist-badge {
  background: var(--color-brand-primary);
  color: var(--color-ink-inverse);
}

/* Walk-item support border colors stay visible — already use vars */

/* Login pilot chips on dark — already use vars but enhance hover */
.theme-field-mode .login-pilot-chip:hover {
  background: var(--color-surface-tonal);
  border-color: var(--color-brand-primary-soft);
}

.theme-field-mode .login-pilot-chip strong {
  color: var(--color-brand-primary);
}

/* Login card on dark — make the soft shadow visible */
.theme-field-mode .login-card {
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.5),
    0 8px 20px rgba(0, 0, 0, 0.35);
}

/* Login field background on dark */
.theme-field-mode .login-field input {
  background: var(--color-surface-sunken);
}

/* Make sure the hero metric gradient reads as dark */
.theme-field-mode .metric.metric-hero strong {
  color: var(--color-brand-primary);
}

.theme-field-mode .metric.metric-hero span {
  color: var(--color-brand-primary-soft);
}

/* Hotspot section panel — already uses var(--panel) ✓ */

/* Walk pack banner */
.theme-field-mode .pack-banner.warn {
  border-color: rgba(245, 197, 66, 0.45);
}

/* Subpanel borders on dark */
.theme-field-mode .subpanel {
  border-top-color: var(--color-line-default);
}

/* Topbar mark drop-shadow on dark */
.theme-field-mode .topbar-mark {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
}

/* Voter sheet map-link on dark */
.theme-field-mode .voter-sheet-map-link {
  background: var(--color-surface-raised);
  color: var(--color-brand-primary);
}

.theme-field-mode .voter-sheet-close {
  background: var(--color-surface-raised);
  color: var(--color-ink-default);
}

.theme-field-mode .voter-sheet-close:hover {
  background: var(--color-surface-tonal);
  color: var(--color-brand-primary);
}

/* Bottom-nav: ensure the active tab uses dark-mode tonal */
.theme-field-mode .nav-btn {
  color: var(--color-ink-muted);
}

.theme-field-mode .nav-btn.active {
  color: var(--color-brand-primary);
  background: var(--color-surface-tonal);
}

/* ===== Empty state component ===== */
.empty-state {
  padding: 28px 20px 30px;
  text-align: center;
  background: var(--color-surface-elevated, #f7faf8);
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--ink);
  display: grid;
  gap: 8px;
  justify-items: center;
}

.empty-state-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: var(--color-surface-tonal, #e8f2ed);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.empty-state-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.empty-state-body {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 320px;
  line-height: 1.45;
}

.empty-state-hint {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: italic;
}

.theme-field-mode .empty-state {
  background: var(--color-surface-sunken);
}

.muted,
.hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
}

.offline-bar {
  background: var(--warn);
  color: #fff;
  text-align: center;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.offline-bar.online {
  background: var(--support);
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.small-btn {
  margin-top: 8px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #fff;
}

/* Areas / Walk / Result cards · inline "Map" anchor inside a button-card
   was rendering as a default underlined <a> (overlapping the voter-count
   pill). Force it back to a proper small-button look + own row + clean gap. */
.card a.small-btn,
.walk-item a.small-btn,
.result-item a.small-btn {
  display: inline-block;
  margin-top: 10px;
  text-decoration: none;
  color: var(--ink, #0D1C14);
  background: var(--bg, #FBF8EF);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 12px;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 8px;
  align-self: flex-start;
  cursor: pointer;
}
.card a.small-btn:hover,
.walk-item a.small-btn:hover,
.result-item a.small-btn:hover {
  background: var(--accent-tonal, #E8F2ED);
  border-color: var(--accent, #1F8F5F);
}

.quick-taps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.quick-taps button {
  padding: 6px 10px;
  font-size: 0.8rem;
  border-radius: 999px;
  background: #e8f2ed;
  border: 1px solid #c5ddd2;
}

.bottom-nav {
  grid-template-columns: repeat(5, 1fr);
}

.bottom-nav .nav-btn {
  font-size: 0.72rem;
  padding: 0.5rem 0.25rem;
}

.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.tag-chip input {
  margin: 0;
}

.crosswalk-preview {
  font-size: 0.9rem;
  margin-top: 8px;
}

.crosswalk-preview .mini-table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
}

.crosswalk-preview .mini-table th,
.crosswalk-preview .mini-table td {
  text-align: left;
  padding: 4px 8px;
  border-bottom: 1px solid var(--border);
}

.crosswalk-preview .error-list {
  color: var(--danger);
  margin: 8px 0;
  padding-left: 1.2rem;
}

.issue-tags {
  border: none;
  padding: 0;
  margin: 0.5rem 0;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.agreement-dialog::backdrop {
  background: rgba(15, 35, 28, 0.65);
}

.agreement-card {
  max-width: 520px;
  margin: 0 auto;
  display: grid;
  gap: 0.75rem;
}

.agreement-body {
  max-height: 50vh;
  overflow-y: auto;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.92rem;
}

.agreement-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.stat.warn strong {
  color: var(--warn);
}

.pill.danger {
  background: rgba(179, 58, 58, 0.12);
  color: var(--danger);
  border: 1px solid rgba(179, 58, 58, 0.35);
}

.pack-freshness-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 0.85rem;
}

.pack-freshness-detail {
  font-size: 0.82rem;
}

.pack-banner.warn {
  border-color: rgba(192, 122, 24, 0.45);
}

.script-variant {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}

.script-variant::before {
  content: "Issue talking points";
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-soft);
  margin-bottom: 6px;
}

.gotv-row .gotv-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  padding: 0 4px 8px;
}

.gotv-row .result-item {
  width: 100%;
  text-align: left;
}

.pill.warn {
  background: #fff4e6;
  color: var(--warn);
  border: 1px solid #e8c89a;
}

.banner {
  margin: 0 14px 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: #e8f4ef;
  color: var(--accent);
  font-size: 0.9rem;
}

.banner.warn {
  background: #fff4e6;
  color: #8a5a12;
  border: 1px solid #e8c89a;
}

.script-body {
  font-size: 0.88rem;
  line-height: 1.45;
  margin-top: 8px;
}

.script-body h3,
.script-body h4 {
  margin: 0.6em 0 0.25em;
  font-size: 0.95rem;
}

.code-block {
  font-size: 0.75rem;
  max-height: 200px;
  overflow: auto;
  padding: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.toolbar-row span {
  flex: 0 0 auto;
  font-size: 0.9rem;
  color: var(--muted);
}

.toolbar-row select {
  flex: 1;
  min-width: 0;
}

.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.analytics-grid .metric {
  margin: 0;
}

.analytics-block {
  grid-column: span 2;
  font-size: 0.9rem;
}

.analytics-block h3 {
  margin: 0 0 0.35rem;
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.analytics-block.full {
  grid-column: 1 / -1;
}

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

  .walk-toolbar {
    grid-template-columns: 1fr 1fr 1fr;
  }

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

  .analytics-block {
    grid-column: span 2;
  }
}

/* ────────────────────────────────────────────────────────────
   Polish pass — skeleton loaders, focus rings, empty states,
   touch targets, hover feedback. No functional changes.
   ──────────────────────────────────────────────────────────── */

/* Universal focus ring — visible on keyboard nav, invisible on mouse-click */
:where(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

/* Smooth subtle transitions on common interactive elements */
.metric, .chart-card, .home-action, .canvass-region-card,
.canvass-division-row, .canvass-voter-row, .sidebar-item,
.small-btn, .primary {
  transition: border-color 140ms ease, background-color 140ms ease,
              box-shadow 140ms ease, transform 80ms ease;
}

.metric:hover, .chart-card:hover {
  box-shadow: 0 6px 18px rgba(15, 35, 28, 0.08);
}

.canvass-voter-row:hover { transform: translateX(2px); }
.home-action:hover, .canvass-region-card:hover { transform: translateY(-1px); }
.primary:active, .small-btn:active { transform: translateY(1px); }

/* Bigger tappable targets on mobile bottom nav */
@media (max-width: 899px) {
  .bottom-nav .nav-btn { min-height: 44px; }
  .small-btn { min-height: 36px; }
}

/* Skeleton loader — replace 'Loading…' text with shimmering blocks */
@keyframes skeleton-shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    rgba(0,0,0,0.06) 0%,
    rgba(0,0,0,0.12) 50%,
    rgba(0,0,0,0.06) 100%);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
  border-radius: 6px;
  color: transparent !important;
  user-select: none;
}
.skeleton-block { display: block; height: 14px; margin: 6px 0; }
.skeleton-h1    { height: 28px; width: 60%; }
.skeleton-h2    { height: 20px; width: 40%; }
.skeleton-line  { height: 12px; width: 90%; }
.skeleton-line.short { width: 50%; }
.skeleton-tile  { height: 80px; margin: 4px 0; }
.skeleton-row   { height: 36px; margin: 4px 0; }

/* Friendly empty / status messages */
.empty-state-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
}
.empty-state-mini .empty-icon {
  font-size: 2rem;
  opacity: 0.6;
}
.empty-state-mini strong {
  color: var(--ink);
  font-size: 0.95rem;
}
.empty-state-mini span {
  font-size: 0.85rem;
  max-width: 400px;
}

/* Sticky toolbars inside views that scroll a lot */
@media (min-width: 900px) {
  .canvass-step-head,
  .data-toolbar {
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 5;
    padding-bottom: 8px;
    margin-bottom: 8px;
  }
}

/* Make chart loading states feel like skeletons too */
.chart-card p.muted.small:only-of-type {
  font-style: italic;
}

/* Print button polish — pulse subtly when ready */
.canvass-print-btn:not(:disabled) {
  box-shadow: 0 2px 6px rgba(15, 138, 63, 0.25);
}

/* Active sidebar item — left accent bar appears with a subtle slide */
.sidebar-item {
  position: relative;
}
.sidebar-item.active {
  font-weight: 700;
}

/* Nicer scrollbars in chrome/edge */
.app-main, .sidebar-nav, .data-table-wrap, .quickfind-results {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 61, 46, 0.3) transparent;
}
.app-main::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar,
.data-table-wrap::-webkit-scrollbar,
.quickfind-results::-webkit-scrollbar { width: 8px; height: 8px; }
.app-main::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb,
.data-table-wrap::-webkit-scrollbar-thumb,
.quickfind-results::-webkit-scrollbar-thumb {
  background: rgba(15, 61, 46, 0.3);
  border-radius: 6px;
}

/* Better phone-bank call CTA shadow + arrow */
.phonebank-call {
  box-shadow: 0 8px 20px rgba(15, 138, 63, 0.3);
}
.phonebank-call:active { transform: translateY(2px); box-shadow: 0 4px 10px rgba(15, 138, 63, 0.25); }

/* Region detail metric tiles — subtle accent left edge */
#region-metrics .metric {
  border-left: 3px solid var(--accent);
}

/* Status pills in Data Viewer get a colored chip background */
.data-table td.pct-cell {
  font-weight: 600;
}

/* Sidebar group header click target slightly larger */
.sidebar-group-header { min-height: 32px; }

/* Quickfind input wider focus glow */
.quickfind-row input[type="search"]:focus {
  box-shadow: 0 0 0 3px rgba(15, 61, 46, 0.15);
}

/* ────────────────────────────────────────────────────────────
   Slice E · First-impression polish
   Splash · login entrance · cross-fade transitions
   ──────────────────────────────────────────────────────────── */

/* Brand splash — shows on initial load, fades out when ready */
.app-splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 35%, #1a5c47, #0f3d2e 70%);
  color: #FBF8EF;
  opacity: 1;
  transition: opacity 0.45s ease-out;
}
.app-splash.is-leaving {
  opacity: 0;
  pointer-events: none;
}
.app-splash[hidden],
.app-splash.is-gone {
  display: none;
}
.app-splash-inner {
  display: grid;
  place-items: center;
  gap: 14px;
  padding: 24px;
}
.app-splash-logo {
  width: 116px;
  height: auto;
  display: block;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.35));
  animation: app-splash-logo 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.app-splash-title {
  margin: 0;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  animation: app-splash-fadeup 0.7s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.app-splash-tagline {
  margin: 0;
  opacity: 0.78;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: #fbf8ef;
  animation: app-splash-fadeup 0.7s 0.16s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.app-splash-progress {
  margin-top: 10px;
  width: 160px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
  overflow: hidden;
}
.app-splash-progress::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, #C9A227, transparent);
  animation: app-splash-progress 1.4s ease-in-out infinite;
}
@keyframes app-splash-logo {
  from { opacity: 0; transform: translateY(10px) scale(0.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes app-splash-fadeup {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
@keyframes app-splash-progress {
  to { transform: translateX(100%); }
}

/* Login screen — subtle pattern overlay + entry animation */
.login-screen {
  position: relative;
  isolation: isolate;
}
.login-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0);
  background-size: 28px 28px;
  opacity: 0.6;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.0) 0%, rgba(0,0,0,0.7) 30%, rgba(0,0,0,1) 70%);
}
.login-stack {
  position: relative;
  z-index: 1;
  animation: login-enter 0.45s 0.08s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
@keyframes login-enter {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
.login-card {
  transition: box-shadow 0.25s ease;
}
.login-card:focus-within {
  box-shadow:
    0 32px 64px rgba(0, 0, 0, 0.28),
    0 10px 22px rgba(0, 0, 0, 0.14),
    0 0 0 3px rgba(201, 162, 39, 0.16);
}
.login-logo {
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.login-card:hover .login-logo {
  transform: scale(1.03) rotate(-2deg);
}

/* Smooth cross-fade between login and app shell */
.login-screen.is-leaving {
  opacity: 0;
  transition: opacity 0.32s ease-out;
  pointer-events: none;
}
#app-shell.is-entering {
  animation: app-enter 0.42s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes app-enter {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .app-splash,
  .app-splash-logo,
  .app-splash-title,
  .app-splash-tagline,
  .app-splash-progress::after,
  .login-stack,
  .login-screen.is-leaving,
  #app-shell.is-entering {
    animation: none !important;
    transition: none !important;
  }
}

/* ────────────────────────────────────────────────────────────
   Slice D · Empty states + micro-interactions
   Toasts · skeleton shimmer · save success · SVG illustrations
   ──────────────────────────────────────────────────────────── */

/* Toast container — fixed at top, stacked, doesn't block clicks */
.toast-container {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  gap: 8px;
  z-index: 9000;
  pointer-events: none;
  width: min(440px, calc(100% - 24px));
  max-height: 80vh;
  overflow: hidden;
}

.toast {
  pointer-events: auto;
  background: var(--panel, #fff);
  border-radius: 12px;
  padding: 12px 14px 14px;
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.18),
    0 4px 12px rgba(0, 0, 0, 0.08);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  font-size: 0.9rem;
  color: var(--ink);
  border-left: 4px solid var(--accent, #1F6B52);
  position: relative;
  overflow: hidden;
  animation: toast-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.toast.is-leaving { animation: toast-out 0.26s ease-in forwards; }

.toast--success { border-left-color: var(--support, #1F8F5F); }
.toast--success .toast-icon { color: var(--support, #1F8F5F); }
.toast--error   { border-left-color: var(--danger, #B33A3A); }
.toast--error   .toast-icon { color: var(--danger, #B33A3A); }
.toast--warn    { border-left-color: var(--warn,   #C07A18); }
.toast--warn    .toast-icon { color: var(--warn,   #C07A18); }
.toast--info    { border-left-color: var(--accent, #1F6B52); }
.toast--info    .toast-icon { color: var(--accent, #1F6B52); }

.toast-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 700;
  flex-shrink: 0;
}

.toast-msg {
  line-height: 1.4;
  word-wrap: break-word;
}

.toast-close {
  width: 24px;
  height: 24px;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.toast-close:hover {
  background: var(--color-surface-tonal, #e8f2ed);
  color: var(--ink);
}

/* Progress bar at the bottom of the toast — drains over duration */
.toast::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: currentColor;
  opacity: 0.4;
  transform-origin: left;
  animation: toast-progress var(--toast-duration, 3500ms) linear;
}
.toast--success::after { background: var(--support, #1F8F5F); }
.toast--error::after   { background: var(--danger,  #B33A3A); }
.toast--warn::after    { background: var(--warn,    #C07A18); }
.toast--info::after    { background: var(--accent,  #1F6B52); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px) scale(0.98); }
}
@keyframes toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* Skeleton shimmer — adds gentle horizontal sweep to existing .skeleton elements */
.skeleton {
  position: relative;
  overflow: hidden;
  background: var(--color-surface-tonal, #eef3f0);
  border-radius: 6px;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.5) 50%,
    transparent 100%
  );
  transform: translateX(-100%);
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
}
.theme-field-mode .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.08) 50%,
    transparent 100%
  );
}
@keyframes skeleton-shimmer {
  to { transform: translateX(100%); }
}

/* Save-success micro-interaction.
   Add class .is-saved to a button to flash a green checkmark overlay for ~1s. */
.btn-save-success {
  position: relative;
  overflow: hidden;
}
.btn-save-success.is-saved::after {
  content: "✓ Saved";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--support, #1F8F5F);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: inherit;
  animation: save-pulse 1.1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes save-pulse {
  0%   { opacity: 0; transform: scale(0.95); }
  10%  { opacity: 1; transform: none; }
  70%  { opacity: 1; transform: none; }
  100% { opacity: 0; transform: scale(1.02); }
}

/* Empty-state illustrations.
   Add .empty-state-illustration sibling to the existing .empty-state-icon
   for richer empty states (no-results, no-data, error, ok). */
.empty-state-illustration {
  width: 96px;
  height: 96px;
  margin: 4px auto 10px;
  display: block;
  opacity: 0.92;
}
.empty-state-illustration--no-results {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'><circle cx='42' cy='42' r='26' fill='none' stroke='%231F6B52' stroke-width='3'/><line x1='62' y1='62' x2='82' y2='82' stroke='%231F6B52' stroke-width='4' stroke-linecap='round'/><path d='M30 42 L40 50 L56 36' fill='none' stroke='%23C9A227' stroke-width='3' stroke-linecap='round' stroke-linejoin='round' opacity='0.55'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.empty-state-illustration--no-data {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'><rect x='12' y='62' width='14' height='20' rx='2' fill='%231F6B52' opacity='0.35'/><rect x='32' y='48' width='14' height='34' rx='2' fill='%231F6B52' opacity='0.55'/><rect x='52' y='34' width='14' height='48' rx='2' fill='%231F6B52' opacity='0.75'/><rect x='72' y='20' width='14' height='62' rx='2' fill='%23C9A227' opacity='0.85'/><line x1='8' y1='86' x2='90' y2='86' stroke='%231F6B52' stroke-width='2'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.empty-state-illustration--error {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'><circle cx='48' cy='48' r='34' fill='none' stroke='%23B33A3A' stroke-width='3'/><line x1='48' y1='30' x2='48' y2='52' stroke='%23B33A3A' stroke-width='4' stroke-linecap='round'/><circle cx='48' cy='64' r='3' fill='%23B33A3A'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.empty-state-illustration--success {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'><circle cx='48' cy='48' r='34' fill='%231F8F5F' opacity='0.12'/><circle cx='48' cy='48' r='34' fill='none' stroke='%231F8F5F' stroke-width='3'/><path d='M30 48 L43 60 L66 36' fill='none' stroke='%231F8F5F' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}
.empty-state-illustration--offline {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 96 96'><path d='M16 50 Q48 22 80 50' fill='none' stroke='%235F6D68' stroke-width='3' stroke-linecap='round'/><path d='M28 60 Q48 44 68 60' fill='none' stroke='%235F6D68' stroke-width='3' stroke-linecap='round' opacity='0.7'/><circle cx='48' cy='72' r='4' fill='%235F6D68'/><line x1='14' y1='14' x2='82' y2='82' stroke='%23B33A3A' stroke-width='4' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* Tighter spacing when illustration is present */
.empty-state:has(.empty-state-illustration) {
  padding: 24px 20px 26px;
  gap: 6px;
}

/* Reduced motion: kill the toast progress + skeleton shimmer + save pulse */
@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast::after,
  .skeleton::after,
  .btn-save-success.is-saved::after {
    animation: none !important;
  }
  .toast::after { opacity: 0; }
}

/* ────────────────────────────────────────────────────────────
   Slice A · Home dashboard transformation
   Hero · priority cards · stat strip · rich quick actions
   ──────────────────────────────────────────────────────────── */

/* Hero — branded greeting block with pills aligned right */
.home-hero-v2 {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: flex-start;
  padding: 24px 22px;
  background:
    linear-gradient(135deg, rgba(15, 61, 46, 0.04) 0%, transparent 60%),
    var(--panel, #fff);
  border-radius: 16px;
  position: relative;
  overflow: hidden;
}
.home-hero-v2::before {
  content: "";
  position: absolute;
  inset: 0 0 auto auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(201, 162, 39, 0.13), transparent 70%);
  transform: translate(60px, -80px);
  pointer-events: none;
}
.home-hero-content {
  min-width: 0;
  position: relative;
  z-index: 1;
}
.home-hero-eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #1F6B52);
}
#home-greeting {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--ink, #0D1C14);
  line-height: 1.15;
}
.home-hero-tagline {
  margin: 0;
  font-size: 0.92rem;
  color: var(--muted, #5F6D68);
  line-height: 1.45;
}
.home-hero-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  position: relative;
  z-index: 1;
}
.home-role-pill,
.home-phase-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.home-role-pill {
  background: var(--color-surface-tonal, #e8f2ed);
  color: var(--accent, #1F6B52);
  border: 1px solid rgba(31, 107, 82, 0.18);
}
.home-phase-pill {
  background: var(--gold, #C9A227);
  color: var(--green, #0F3D2E);
}
.home-phase-pill[data-phase="election_day"] {
  background: var(--danger, #B33A3A);
  color: #fff;
}
.home-phase-pill[data-phase="gotv"] {
  background: var(--warn, #C07A18);
  color: #fff;
}

/* Section spacing rhythm */
.home-section {
  margin-top: 16px;
}
.home-section-title {
  margin: 0 0 14px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, #5F6D68);
}

/* Today's priorities — 3 contextual cards */
.priority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.priority-card {
  background: var(--panel, #fff);
  border: 1px solid var(--line, #D5DDD8);
  border-left-width: 4px;
  border-left-color: var(--muted, #5F6D68);
  border-radius: 12px;
  padding: 16px 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.18s ease, transform 0.18s ease;
}
.priority-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08);
  transform: translateY(-1px);
}
.priority-card--accent  { border-left-color: var(--accent, #1F6B52); }
.priority-card--warn    { border-left-color: var(--warn,   #C07A18); }
.priority-card--alert   { border-left-color: var(--danger, #B33A3A); }
.priority-card--neutral { border-left-color: var(--muted,  #5F6D68); }
.priority-card-tag {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #1F6B52);
}
.priority-card--warn    .priority-card-tag { color: var(--warn,   #C07A18); }
.priority-card--alert   .priority-card-tag { color: var(--danger, #B33A3A); }
.priority-card--neutral .priority-card-tag { color: var(--muted,  #5F6D68); }
.priority-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink, #0D1C14);
  line-height: 1.25;
}
.priority-card-body {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted, #5F6D68);
  line-height: 1.45;
  flex: 1;
}
.priority-card-cta {
  align-self: flex-start;
  margin-top: 6px;
  padding: 8px 12px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--accent, #1F6B52);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.priority-card-cta:hover {
  background: var(--color-surface-tonal, #e8f2ed);
}
.priority-card-cta:focus-visible {
  outline: 2px solid var(--accent, #1F6B52);
  outline-offset: 2px;
}

/* Stat strip — at-a-glance numbers across the top */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.stat-strip-tile {
  background: var(--color-surface-elevated, #f7faf8);
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 12px;
  padding: 14px 14px 12px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.stat-strip-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gold, #C9A227);
}
.stat-strip-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--green, #0F3D2E);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.stat-strip-label {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted, #5F6D68);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Rich quick-action buttons — icon + body layout */
.home-actions-rich {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.home-action-rich {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line, #D5DDD8);
  background: var(--panel, #fff);
  cursor: pointer;
  font: inherit;
  transition: border-color 0.15s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.home-action-rich:hover {
  border-color: var(--accent, #1F6B52);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.home-action-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--color-surface-tonal, #e8f2ed);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  transition: background 0.15s ease;
}
.home-action-rich:hover .home-action-icon {
  background: var(--gold, #C9A227);
}
.home-action-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.home-action-body strong {
  font-size: 0.98rem;
  color: var(--ink, #0D1C14);
  font-weight: 700;
}
.home-action-body span {
  font-size: 0.8rem;
  color: var(--muted, #5F6D68);
  line-height: 1.35;
}

/* Mobile tweaks — stack the hero pills below the greeting */
@media (max-width: 640px) {
  .home-hero-v2 {
    grid-template-columns: 1fr;
    padding: 20px 18px;
  }
  .home-hero-meta {
    align-items: flex-start;
    flex-direction: row;
    flex-wrap: wrap;
  }
  #home-greeting {
    font-size: 1.5rem;
  }
}

/* Theme: field mode (dark) gets surface tweaks */
.theme-field-mode .home-hero-v2 {
  background: var(--panel);
}
.theme-field-mode .home-hero-v2::before {
  opacity: 0.5;
}
.theme-field-mode .priority-card,
.theme-field-mode .home-action-rich {
  background: var(--panel);
}
.theme-field-mode .stat-strip-tile {
  background: var(--color-surface-tonal);
}

/* Reduced motion — kill all the new hover transforms */
@media (prefers-reduced-motion: reduce) {
  .priority-card:hover,
  .home-action-rich:hover {
    transform: none !important;
  }
}

/* ────────────────────────────────────────────────────────────
   Slice B · Voter detail polish
   Avatar · dialog open animation · backdrop fade
   ──────────────────────────────────────────────────────────── */

/* Layout: avatar to the left of the name block */
.voter-sheet-identity {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  margin-top: 4px;
}
.voter-sheet-identity-text {
  min-width: 0;
}
.voter-sheet-identity-text h2 {
  margin: 0 0 2px;
}

/* Initials avatar — colored circle with white initials */
.voter-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent, #1F6B52);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
  user-select: none;
  text-transform: uppercase;
}

/* Dialog open animation — scale-fade in on desktop, slide-up on mobile */
#voter-dialog[open] {
  animation: voter-dialog-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
#voter-dialog::backdrop {
  background: rgba(13, 28, 20, 0.5);
  animation: voter-dialog-backdrop-in 0.28s ease-out;
}
@keyframes voter-dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes voter-dialog-backdrop-in {
  from { background: rgba(13, 28, 20, 0); }
  to   { background: rgba(13, 28, 20, 0.5); }
}

@media (max-width: 640px) {
  /* On mobile, slide up from the bottom for a more app-like feel */
  #voter-dialog[open] {
    animation: voter-dialog-slide-up 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
  }
  @keyframes voter-dialog-slide-up {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: none; }
  }
  .voter-avatar {
    width: 44px;
    height: 44px;
    font-size: 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  #voter-dialog[open],
  #voter-dialog::backdrop {
    animation: none !important;
  }
}

/* ────────────────────────────────────────────────────────────
   Slice C · Phone bank confidence
   Session stats strip · streak counter · card slide-in
   ──────────────────────────────────────────────────────────── */

/* Compact stats strip above the current-voter card */
.phonebank-stats {
  padding: 12px 14px;
  margin-bottom: 12px;
}
.phonebank-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.phonebank-stat {
  text-align: center;
  padding: 6px 4px 4px;
  border-radius: 10px;
  background: var(--color-surface-tonal, #e8f2ed);
}
.phonebank-stat-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--green, #0F3D2E);
  line-height: 1.1;
  transition: color 0.2s ease;
}
.phonebank-stat-num--hot {
  color: var(--gold, #C9A227);
  animation: phonebank-streak-pulse 0.6s ease-out;
}
@keyframes phonebank-streak-pulse {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.phonebank-stat-label {
  font-size: 0.7rem;
  color: var(--muted, #5F6D68);
  font-weight: 600;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Current-voter card slide-in on each cycle */
#phonebank-current-panel.is-cycling {
  animation: phonebank-cycle 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes phonebank-cycle {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* Card-design refresh — soft shadow, rounded corners, more generous padding */
#phonebank-current-panel {
  border-radius: 16px;
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.08),
    0 3px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid var(--line, #D5DDD8);
  padding: 22px 22px 20px;
}
#phonebank-current-panel .phonebank-name {
  font-size: 1.6rem;
  font-weight: 800;
  text-align: center;
  margin: 14px 0 4px;
  letter-spacing: -0.01em;
  color: var(--ink, #0D1C14);
}
#phonebank-current-panel .phonebank-address {
  text-align: center;
  margin: 0 0 16px;
}

@media (prefers-reduced-motion: reduce) {
  #phonebank-current-panel.is-cycling,
  .phonebank-stat-num--hot {
    animation: none !important;
  }
}

/* ────────────────────────────────────────────────────────────
   Slice B (finishing) · suggested action callout + timeline
   ──────────────────────────────────────────────────────────── */

/* Suggested next action — small dismissible callout in voter dialog */
.voter-suggested {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--color-surface-tonal, #e8f2ed);
  border-left: 3px solid var(--accent, #1F6B52);
  margin: 6px 0 10px;
  animation: voter-suggested-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.voter-suggested[data-tone="warn"]    { border-left-color: var(--warn, #C07A18); background: rgba(192, 122, 24, 0.08); }
.voter-suggested[data-tone="success"] { border-left-color: var(--support, #1F8F5F); background: rgba(31, 143, 95, 0.08); }
.voter-suggested[data-tone="accent"]  { border-left-color: var(--gold, #C9A227); background: rgba(201, 162, 39, 0.10); }
.voter-suggested[data-tone="neutral"] { border-left-color: var(--muted, #5F6D68); background: var(--color-surface-elevated, #f7faf8); }
.voter-suggested[data-tone="info"]    { border-left-color: var(--accent, #1F6B52); }

.voter-suggested-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--panel, #fff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}
.voter-suggested-tag {
  margin: 0 0 2px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #1F6B52);
}
.voter-suggested[data-tone="warn"] .voter-suggested-tag    { color: var(--warn, #C07A18); }
.voter-suggested[data-tone="success"] .voter-suggested-tag { color: var(--support, #1F8F5F); }
.voter-suggested[data-tone="accent"] .voter-suggested-tag  { color: var(--gold-dark, #8E7218); }
.voter-suggested[data-tone="neutral"] .voter-suggested-tag { color: var(--muted, #5F6D68); }
.voter-suggested-text {
  margin: 0;
  font-size: 0.9rem;
  color: var(--ink, #0D1C14);
  line-height: 1.4;
}

@keyframes voter-suggested-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* Contact history vertical timeline */
.voter-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.voter-timeline::before {
  /* The vertical line behind the dots */
  content: "";
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line, #D5DDD8);
  border-radius: 2px;
}
.voter-timeline-item {
  position: relative;
  padding-left: 32px;
  padding-bottom: 12px;
  --timeline-accent: var(--accent, #1F6B52);
}
.voter-timeline-item:last-child {
  padding-bottom: 0;
}
.voter-timeline-dot {
  position: absolute;
  left: 2px;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--timeline-accent);
  border: 3px solid var(--panel, #fff);
  box-shadow: 0 0 0 1px var(--line, #D5DDD8), 0 2px 4px rgba(0, 0, 0, 0.08);
  z-index: 1;
}
.voter-timeline-card {
  background: var(--panel, #fff);
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 10px;
  padding: 8px 12px 10px;
}
.voter-timeline-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 2px;
}
.voter-timeline-head strong {
  font-size: 0.92rem;
  color: var(--ink, #0D1C14);
  font-weight: 700;
}
.voter-timeline-when {
  font-size: 0.78rem;
  color: var(--muted, #5F6D68);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.voter-timeline-meta {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: var(--muted, #5F6D68);
  text-transform: capitalize;
}
.voter-timeline-notes {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ink, #0D1C14);
  font-style: italic;
  line-height: 1.4;
}

@media (prefers-reduced-motion: reduce) {
  .voter-suggested {
    animation: none !important;
  }
}

/* ────────────────────────────────────────────────────────────
   Slice G · Cross-filter charts
   Scope chip + clickable region rows + active/muted states
   ──────────────────────────────────────────────────────────── */

/* Floating scope chip at the top of the Summary view */
.summary-scope-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--gold, #C9A227);
  color: var(--green, #0F3D2E);
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(201, 162, 39, 0.25);
  font-size: 0.92rem;
  animation: scope-chip-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.summary-scope-chip-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}
.summary-scope-chip-label {
  flex: 1;
  line-height: 1.4;
}
.summary-scope-chip-label strong {
  font-weight: 800;
}
.summary-scope-chip-clear {
  background: rgba(15, 61, 46, 0.92);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.summary-scope-chip-clear:hover {
  background: var(--green, #0F3D2E);
}
@keyframes scope-chip-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* Clickable region rows in the voters-per-region chart */
button.chart-bar-row--clickable {
  /* Reset button defaults so the existing grid layout still works */
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  padding: 4px 6px;
  margin: 0 -6px 2px;
  border-radius: 8px;
  width: calc(100% + 12px);
  transition: background 0.15s ease, opacity 0.2s ease, transform 0.15s ease;
}
button.chart-bar-row--clickable:hover {
  background: var(--color-surface-tonal, #e8f2ed);
}
button.chart-bar-row--clickable:hover .fill {
  filter: brightness(1.05);
}
button.chart-bar-row--clickable:focus-visible {
  outline: 2px solid var(--accent, #1F6B52);
  outline-offset: 1px;
}

/* Active row when filter is set — gold accent + bolder */
button.chart-bar-row--clickable.is-active {
  background: rgba(201, 162, 39, 0.12);
  font-weight: 700;
}
button.chart-bar-row--clickable.is-active .fill {
  background: var(--gold, #C9A227);
  box-shadow: 0 0 0 1px rgba(201, 162, 39, 0.4);
}
button.chart-bar-row--clickable.is-active .label::before {
  content: "● ";
  color: var(--gold, #C9A227);
  font-weight: 900;
}

/* Muted rows — when a filter is active, non-selected rows fade */
button.chart-bar-row--clickable.is-muted {
  opacity: 0.5;
}
button.chart-bar-row--clickable.is-muted:hover {
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .summary-scope-chip {
    animation: none !important;
  }
}

/* ────────────────────────────────────────────────────────────
   Slice F · Native Leaflet map
   Map container · side panel · tooltips · legend · color-mode select
   ──────────────────────────────────────────────────────────── */

.map-mode-select {
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  border: 1px solid var(--line, #D5DDD8);
  background: var(--panel, #fff);
  color: var(--ink, #0D1C14);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.map-mode-select:hover {
  border-color: var(--accent, #1F6B52);
}

.map-leaflet-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 12px;
  min-height: 70vh;
  height: 70vh;
}
@media (max-width: 900px) {
  .map-leaflet-wrap {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.map-leaflet {
  position: relative;
  min-height: 70vh;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line, #D5DDD8);
  background: var(--color-surface-elevated, #f7faf8);
}
@media (max-width: 900px) {
  .map-leaflet {
    min-height: 55vh;
  }
}

.map-leaflet-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 1;
  pointer-events: none;
}

.map-side-panel {
  background: var(--panel, #fff);
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 12px;
  padding: 16px 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 70vh;
}
@media (max-width: 900px) {
  .map-side-panel {
    max-height: none;
  }
}

.map-side-eyebrow {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #1F6B52);
}
#map-side-title {
  margin: -8px 0 0;
  font-size: 1.3rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink, #0D1C14);
  letter-spacing: -0.01em;
}
.map-side-body p {
  margin: 0;
}

/* Stat tiles inside the side panel */
.map-side-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.map-side-stat {
  background: var(--color-surface-tonal, #e8f2ed);
  border-radius: 10px;
  padding: 10px 10px 8px;
  text-align: center;
}
.map-side-stat-num {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--green, #0F3D2E);
  line-height: 1.1;
}
.map-side-stat-label {
  font-size: 0.7rem;
  color: var(--muted, #5F6D68);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.map-side-result {
  border-left: 4px solid var(--winner-color, var(--accent));
  padding: 8px 12px;
  background: var(--color-surface-elevated, #f7faf8);
  border-radius: 8px;
}
.map-side-result-tag {
  margin: 0 0 2px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted, #5F6D68);
}
.map-side-result-winner {
  margin: 0 0 2px;
  font-size: 0.95rem;
  color: var(--ink, #0D1C14);
}
.map-side-result-winner strong {
  color: var(--winner-color, var(--accent));
  font-weight: 800;
}
.map-side-result-turnout {
  margin: 0;
}

.map-side-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.map-side-action {
  text-align: left;
  font-weight: 600;
}

/* Legend at the bottom of the side panel */
.map-legend {
  border-top: 1px solid var(--line, #D5DDD8);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-legend-title {
  margin: 0 0 4px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted, #5F6D68);
}
.map-legend-row {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
  color: var(--ink, #0D1C14);
}
.map-legend-sw {
  width: 16px;
  height: 10px;
  border-radius: 3px;
  display: inline-block;
}

/* Leaflet tooltip styling — pill-shaped, branded */
.leaflet-tooltip.map-tooltip {
  background: var(--panel, #fff);
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 10px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink, #0D1C14);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.leaflet-tooltip.map-tooltip::before {
  display: none;
}
.map-tip-head {
  font-size: 0.95rem;
}
.map-tip-meta {
  font-size: 0.8rem;
  color: var(--muted, #5F6D68);
  margin-top: 2px;
}

/* Hide the legacy iframe class since we're not using it on this view */
#view-map .map-frame {
  display: none;
}

/* Map Explorer · LAA layer side panel · divisions list */
.map-side-section-tag {
  margin: 14px 0 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent, #1F6B52);
}
.map-laa-divisions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 360px;
  overflow-y: auto;
  padding-right: 4px;
}
.map-laa-div-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-align: left;
  background: var(--color-surface-elevated, #f7faf8);
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  font: inherit;
}
.map-laa-div-row:hover {
  border-color: var(--accent, #1F6B52);
  background: var(--color-surface-tonal, #e8f2ed);
}
.map-laa-div-name {
  font-size: 0.88rem;
  color: var(--ink, #0D1C14);
  font-weight: 700;
  line-height: 1.25;
}
.map-laa-div-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.map-laa-div-count {
  font-weight: 700;
  color: var(--accent, #1F6B52);
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}

/* ────────────────────────────────────────────────────────────
   Loading-state polish · chart-card skeleton rows
   Replaces the full-width flat skeleton bar with a row that
   mimics the actual chart-bar-row layout (label · track · count).
   The shimmer streak now sweeps inside a narrow fill, not the whole card.
   ──────────────────────────────────────────────────────────── */

.chart-skeleton-row {
  /* Reuse the chart-bar-row 130px / 1fr / 60px grid but force gentle defaults
     so it works even outside that context. */
  display: grid;
  grid-template-columns: 130px 1fr 60px;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
  pointer-events: none;
}
.chart-skeleton-row .skeleton {
  height: 12px;
  border-radius: 4px;
}
.chart-skeleton-row .skeleton-line-label {
  width: 88%;
  height: 11px;
}
.chart-skeleton-row .skeleton-line-count {
  width: 70%;
  justify-self: end;
  height: 10px;
}
.chart-skeleton-row .chart-skeleton-track {
  position: relative;
  height: 14px;
  background: transparent;
  display: block;
}
.chart-skeleton-row .skeleton-line-fill {
  display: block;
  height: 14px;
  border-radius: 6px;
}
/* Slight per-row width nudge so 4 stacked rows feel like sorted-desc data
   (visual rhythm, not the same flat block 4 times). */
.chart-skeleton-row:nth-child(odd) .skeleton-line-label  { width: 75%; }
.chart-skeleton-row:nth-child(even) .skeleton-line-label { width: 86%; }

/* ────────────────────────────────────────────────────────────
   Admin · LAA crosswalk editor
   Summary tiles · toolbar · table · source chips · confidence pills · edit dialog
   ──────────────────────────────────────────────────────────── */

.crosswalk-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0 16px;
}
.crosswalk-summary-tile {
  background: var(--color-surface-elevated, #f7faf8);
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 10px;
  padding: 10px 12px;
  text-align: center;
}
.crosswalk-summary-tile .num {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--green, #0F3D2E);
  line-height: 1.1;
}
.crosswalk-summary-tile .lbl {
  font-size: 0.7rem;
  color: var(--muted, #5F6D68);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 2px;
}

.crosswalk-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0;
  align-items: flex-end;
}
.crosswalk-toolbar label {
  display: grid;
  gap: 4px;
}
.crosswalk-toolbar label > span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #5F6D68);
}
.crosswalk-toolbar select,
.crosswalk-toolbar input[type="search"] {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line, #D5DDD8);
  background: var(--panel, #fff);
  font-size: 0.9rem;
  min-width: 180px;
  font-family: inherit;
}
.crosswalk-export-btn,
.crosswalk-review-btn {
  min-height: 36px;
  padding: 6px 14px;
  font-weight: 700;
  align-self: flex-end;
  cursor: pointer;
  border-radius: 8px;
}
.crosswalk-export-btn {
  background: var(--gold, #C9A227);
  color: var(--green, #0F3D2E);
  border: 1px solid var(--gold, #C9A227);
}
.crosswalk-export-btn:hover {
  background: var(--green, #0F3D2E);
  color: #fff;
  border-color: var(--green, #0F3D2E);
}
.crosswalk-review-btn {
  background: var(--panel, #fff);
  color: var(--warn, #C07A18);
  border: 1px solid var(--warn, #C07A18);
}
.crosswalk-review-btn:hover {
  background: var(--warn, #C07A18);
  color: #fff;
}
.crosswalk-review-btn.is-active {
  background: var(--warn, #C07A18);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(192, 122, 24, 0.18);
}

/* Crosswalk recent-changes list */
.crosswalk-recent-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.crosswalk-recent-item {
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--color-surface-elevated, #f7faf8);
  border-left: 3px solid var(--accent, #1F6B52);
}
.crosswalk-recent-item.is-admin {
  border-left-color: var(--gold, #C9A227);
}
.crosswalk-recent-item.is-correction {
  border-left-color: var(--danger, #B33A3A);
}
.crosswalk-recent-item header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.crosswalk-recent-when {
  font-size: 0.78rem;
  color: var(--muted, #5F6D68);
  font-weight: 600;
  min-width: 80px;
  cursor: help;
}
.crosswalk-recent-count-pill {
  background: var(--color-surface-tonal, #e8f2ed);
  color: var(--accent, #1F6B52);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: auto;
}
.crosswalk-recent-notes {
  margin: 4px 0 0;
  font-size: 0.85rem;
  color: var(--ink, #0D1C14);
  line-height: 1.4;
}

/* ────────────────────────────────────────────────────────────
   2026 LAA Campaign hub
   Operations landing page · LAA-centric across all 10 regions
   ──────────────────────────────────────────────────────────── */

.sidebar-item-hub {
  background: linear-gradient(90deg, rgba(201, 162, 39, 0.15), transparent);
  border-left: 3px solid var(--gold, #C9A227);
  font-weight: 700;
}
.sidebar-item-hub .sidebar-item-icon {
  color: var(--gold, #C9A227);
}

.laa-hub-hero {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  padding: 28px 32px 24px;
  margin-bottom: 16px;
  color: #FBF8EF;
}
.laa-hub-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 90% 18%, rgba(201, 162, 39, 0.28), transparent 45%),
    radial-gradient(circle at 8% 92%, rgba(31, 138, 63, 0.32), transparent 40%),
    linear-gradient(135deg, #0F3D2E 0%, #1F6B52 100%);
}
.laa-hub-hero-content {
  position: relative;
  z-index: 1;
}
.laa-hub-eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  font-weight: 800;
  color: var(--gold, #C9A227);
}
.laa-hub-hero h1 {
  margin: 0 0 6px;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #fff;
  line-height: 1.1;
}
.laa-hub-tagline {
  margin: 0 0 22px;
  font-size: 1rem;
  color: rgba(251, 248, 239, 0.85);
  font-style: italic;
  max-width: 720px;
}
.laa-hub-countdowns {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.laa-hub-countdown {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
  border-left: 4px solid var(--gold, #C9A227);
}
.laa-hub-countdown--ship    { border-left-color: #1F8F5F; }
.laa-hub-countdown--primary { border-left-color: var(--gold, #C9A227); }
.laa-hub-countdown--gold    { border-left-color: var(--gold-soft, #F2D777); }
.laa-hub-countdown-num {
  font-size: 1.9rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1;
}
.laa-hub-countdown-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--gold, #C9A227);
}
.laa-hub-countdown-sub {
  font-size: 0.78rem;
  color: rgba(251, 248, 239, 0.7);
  margin-top: 2px;
}

.laa-hub-panel {
  margin-bottom: 12px;
}
.laa-hub-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.laa-hub-panel-head h2 {
  margin: 0;
  font-size: 1.25rem;
  color: var(--green, #0F3D2E);
}
.laa-hub-panel-head p {
  margin: 0;
}

.laa-hub-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.laa-hub-stat-tile {
  background: var(--color-surface-elevated, #f7faf8);
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.laa-hub-stat-tile::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--gold, #C9A227);
}
.laa-hub-stat-num {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--green, #0F3D2E);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.laa-hub-stat-label {
  margin-top: 4px;
  font-size: 0.74rem;
  color: var(--muted, #5F6D68);
  font-weight: 600;
  letter-spacing: 0.02em;
}

.laa-hub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 900px) {
  .laa-hub-grid { grid-template-columns: 1fr; }
}

/* Top LAAs list */
.laa-hub-top-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 540px;
  overflow-y: auto;
}
.laa-hub-row {
  background: transparent;
  border: 0;
  text-align: left;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  width: 100%;
}
.laa-hub-row:hover { background: var(--color-surface-tonal, #e8f2ed); }
.laa-hub-row-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.laa-hub-row-head strong {
  color: var(--ink, #0D1C14);
  font-size: 0.92rem;
}
.laa-hub-row-count {
  margin-left: auto;
  color: var(--accent, #1F6B52);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.88rem;
}
.laa-hub-row-track {
  height: 8px;
  background: var(--color-surface-tonal, #e8f2ed);
  border-radius: 4px;
  overflow: hidden;
}
.laa-hub-row-fill {
  height: 100%;
  background: var(--accent, #1F6B52);
  border-radius: 4px;
}
.laa-hub-row.is-muni .laa-hub-row-fill { background: var(--gold, #C9A227); }

/* Per-region distribution */
.laa-hub-region-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.laa-hub-region-row {
  display: grid;
  grid-template-columns: 200px 1fr 160px;
  gap: 10px;
  align-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background 0.15s ease;
}
@media (max-width: 720px) {
  .laa-hub-region-row { grid-template-columns: 1fr; }
}
.laa-hub-region-row:hover { background: var(--color-surface-tonal, #e8f2ed); }
.laa-hub-region-row-name {
  font-size: 0.88rem;
  color: var(--ink, #0D1C14);
}
.laa-hub-region-row-bar {
  height: 10px;
  background: var(--color-surface-tonal, #e8f2ed);
  border-radius: 5px;
  position: relative;
  overflow: hidden;
}
.laa-hub-region-row-fill {
  position: absolute;
  inset: 0 auto 0 0;
  background: var(--accent-soft, var(--accent, #1F6B52));
}
.laa-hub-region-row-stats {
  text-align: right;
  font-size: 0.82rem;
}
.laa-hub-region-row-count {
  font-weight: 700;
  color: var(--green, #0F3D2E);
  margin-right: 4px;
}

/* Focus cards */
.laa-hub-focus-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 720px) {
  .laa-hub-focus-grid { grid-template-columns: 1fr; }
}
.laa-hub-focus-card {
  background: var(--panel, #fff);
  border: 1px solid var(--line, #D5DDD8);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.laa-hub-focus-card--accent  { border-left-color: var(--accent, #1F6B52); }
.laa-hub-focus-card--warn    { border-left-color: var(--warn,   #C07A18); }
.laa-hub-focus-card--neutral { border-left-color: var(--muted,  #5F6D68); }
.laa-hub-focus-tag {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent, #1F6B52);
}
.laa-hub-focus-card--warn .laa-hub-focus-tag    { color: var(--warn, #C07A18); }
.laa-hub-focus-card--neutral .laa-hub-focus-tag { color: var(--muted, #5F6D68); }
.laa-hub-focus-card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink, #0D1C14);
}
.laa-hub-focus-body {
  margin: 0;
  font-size: 0.86rem;
  color: var(--muted, #5F6D68);
  line-height: 1.45;
  flex: 1;
}
.laa-hub-focus-cta {
  align-self: flex-start;
  background: transparent;
  border: 0;
  color: var(--accent, #1F6B52);
  font-weight: 700;
  font-size: 0.86rem;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 6px;
}
.laa-hub-focus-cta:hover {
  background: var(--color-surface-tonal, #e8f2ed);
}

/* Interactive Leaflet mini-map */
.laa-hub-map-container {
  height: 360px;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line, #D5DDD8);
  background: var(--color-surface-elevated, #f7faf8);
  position: relative;
}
.laa-hub-map-loading {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

/* Map preview · region tile grid (fallback when Leaflet can't load) */
.laa-hub-map-preview {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.laa-hub-region-tiles {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
@media (max-width: 720px) {
  .laa-hub-region-tiles { grid-template-columns: repeat(3, 1fr); }
}
.laa-hub-region-tile {
  background: var(--panel, #fff);
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 8px;
  padding: 8px 8px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.laa-hub-region-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.laa-hub-region-tile-num {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--green, #0F3D2E);
  text-align: center;
}
.laa-hub-region-tile-winner {
  display: block;
  text-align: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  padding: 4px 0;
  border-radius: 4px 4px 0 0;
  margin: 0 -8px;
}
.laa-hub-map-legend {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--muted, #5F6D68);
  justify-content: center;
}
.laa-hub-map-legend span { display: inline-flex; align-items: center; gap: 6px; }
.laa-hub-legend-sw {
  display: inline-block;
  width: 14px;
  height: 10px;
  border-radius: 3px;
}
.laa-hub-map-foot {
  text-align: right;
  margin: 8px 0 0;
}
.laa-hub-map-foot .text-btn {
  background: transparent;
  border: 0;
  color: var(--accent, #1F6B52);
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.laa-hub-map-foot .text-btn:hover {
  background: var(--color-surface-tonal, #e8f2ed);
}

/* Campaign milestones panel · vertical timeline */
.laa-hub-milestones {
  position: relative;
  padding-left: 8px;
}
.laa-hub-milestones::before {
  content: "";
  position: absolute;
  left: 17px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--line, #D5DDD8);
  border-radius: 2px;
}
.laa-hub-milestone {
  display: grid;
  grid-template-columns: 24px 160px 1fr;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0 12px;
  position: relative;
}
.laa-hub-milestone-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-top: 4px;
  background: var(--line, #D5DDD8);
  border: 3px solid var(--panel, #fff);
  box-shadow: 0 0 0 1px var(--line, #D5DDD8);
  position: relative;
  z-index: 1;
}
.laa-hub-milestone.is-past .laa-hub-milestone-dot {
  background: var(--ship, #1F8F5F);
  box-shadow: 0 0 0 1px var(--ship, #1F8F5F);
}
.laa-hub-milestone.is-soon .laa-hub-milestone-dot {
  background: var(--gold, #C9A227);
  box-shadow: 0 0 0 1px var(--gold, #C9A227);
  animation: laa-hub-milestone-pulse 2s ease-in-out infinite;
}
.laa-hub-milestone.is-future .laa-hub-milestone-dot {
  background: var(--panel, #fff);
}
@keyframes laa-hub-milestone-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.18); }
}
.laa-hub-milestone-date {
  text-align: left;
}
.laa-hub-milestone-day {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink, #0D1C14);
  font-variant-numeric: tabular-nums;
}
.laa-hub-milestone-rel {
  font-size: 0.72rem;
  color: var(--muted, #5F6D68);
  margin-top: 2px;
}
.laa-hub-milestone.is-past .laa-hub-milestone-rel    { color: var(--ship, #1F8F5F); }
.laa-hub-milestone.is-soon .laa-hub-milestone-rel    { color: var(--warn, #C07A18); font-weight: 700; }
.laa-hub-milestone-body strong {
  color: var(--ink, #0D1C14);
  font-size: 0.92rem;
  display: block;
}
.laa-hub-milestone.is-past .laa-hub-milestone-body strong {
  color: var(--muted, #5F6D68);
  text-decoration: line-through;
  text-decoration-color: var(--ship, #1F8F5F);
  text-decoration-thickness: 1.5px;
}
.laa-hub-milestone-body p {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: var(--muted, #5F6D68);
  line-height: 1.4;
}
@media (max-width: 720px) {
  .laa-hub-milestone {
    grid-template-columns: 24px 1fr;
  }
  .laa-hub-milestone-date {
    grid-column: 2;
    margin-bottom: 4px;
  }
  .laa-hub-milestone-body {
    grid-column: 2;
  }
}

/* Recent activity feed */
.laa-hub-activity {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 460px;
  overflow-y: auto;
}
.laa-hub-activity-item {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--color-surface-elevated, #f7faf8);
  border-left: 3px solid var(--accent, #1F6B52);
}
.laa-hub-activity-item.is-admin       { border-left-color: var(--gold, #C9A227); }
.laa-hub-activity-item.is-correction  { border-left-color: var(--danger, #B33A3A); }
.laa-hub-activity-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-surface-tonal, #e8f2ed);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent, #1F6B52);
  flex-shrink: 0;
}
.laa-hub-activity-item.is-admin .laa-hub-activity-icon {
  background: var(--gold, #C9A227);
  color: #fff;
}
.laa-hub-activity-item.is-correction .laa-hub-activity-icon {
  background: var(--danger, #B33A3A);
  color: #fff;
}
.laa-hub-activity-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}
.laa-hub-activity-head strong {
  color: var(--ink, #0D1C14);
  font-size: 0.9rem;
}
.laa-hub-activity-when {
  font-size: 0.74rem;
  color: var(--muted, #5F6D68);
  font-weight: 600;
  cursor: help;
}
.laa-hub-activity-meta {
  font-size: 0.8rem;
  color: var(--muted, #5F6D68);
  line-height: 1.4;
  margin-top: 3px;
}

/* Resource cards */
.laa-hub-resources {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}
.laa-hub-resource {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line, #D5DDD8);
  background: var(--panel, #fff);
  text-decoration: none;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.laa-hub-resource:hover {
  border-color: var(--accent, #1F6B52);
  transform: translateY(-1px);
}
.laa-hub-resource-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-surface-tonal, #e8f2ed);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.laa-hub-resource-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.laa-hub-resource-body strong {
  color: var(--ink, #0D1C14);
}
.laa-hub-resource-body span {
  font-size: 0.78rem;
}

/* Slice 9 · Sidebar nav badges */
.sidebar-badge {
  margin-left: auto;
  background: var(--gold, #C9A227);
  color: var(--green, #0F3D2E);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-width: 22px;
  text-align: center;
  line-height: 1.2;
  letter-spacing: 0;
}
.sidebar-item {
  /* Make sure the badge can push to the right edge */
  align-items: center;
}
.sidebar-item.is-active .sidebar-badge {
  background: var(--green, #0F3D2E);
  color: var(--gold, #C9A227);
}

/* Region Explorer · compare mode */
.region-compare-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  margin: 12px 0;
  background: var(--color-surface-elevated, #f7faf8);
  border: 1px dashed var(--line, #D5DDD8);
  border-radius: 10px;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.region-compare-bar.is-active {
  background: rgba(201, 162, 39, 0.08);
  border-color: var(--gold, #C9A227);
  border-style: solid;
}
.region-compare-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  font-size: 0.9rem;
  color: var(--ink, #0D1C14);
  font-weight: 600;
}
.region-compare-label select {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line, #D5DDD8);
  background: var(--panel, #fff);
  font-size: 0.9rem;
  min-width: 220px;
  font-family: inherit;
}
.region-compare-bar .text-btn {
  background: transparent;
  border: 0;
  color: var(--muted, #5F6D68);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}
.region-compare-bar .text-btn:hover {
  background: var(--color-surface-tonal, #e8f2ed);
  color: var(--ink, #0D1C14);
}

.region-compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 720px) {
  .region-compare-grid { grid-template-columns: 1fr; }
}
.region-compare-side {
  border-radius: 8px;
  padding: 8px 8px 10px;
  background: var(--color-surface-elevated, #f7faf8);
}
.region-compare-side--primary {
  background: rgba(31, 107, 82, 0.06);
  border-top: 3px solid var(--accent, #1F6B52);
}
.region-compare-side--secondary {
  background: rgba(201, 162, 39, 0.08);
  border-top: 3px solid var(--gold, #C9A227);
}
.region-compare-side-tag {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted, #5F6D68);
}
.region-compare-side--primary .region-compare-side-tag { color: var(--accent, #1F6B52); }
.region-compare-side--secondary .region-compare-side-tag { color: var(--gold-dark, #8E7218); }

/* Metric tile compare layout — primary number left, secondary right */
.metric-compare {
  position: relative;
}
.metric-compare-row {
  display: flex;
  gap: 14px;
  align-items: baseline;
  justify-content: space-between;
}
.metric-compare-primary {
  color: var(--accent, #1F6B52);
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.metric-compare-secondary {
  color: var(--gold-dark, #8E7218);
  font-size: 1.4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.metric-compare-label {
  display: block;
  margin-top: 4px;
}
.metric-compare-legend {
  display: block;
  margin-top: 2px;
  font-size: 0.7rem;
}

/* Region Explorer · LAA mini bar chart */
.region-laa-bar {
  padding: 8px 0;
  border-bottom: 1px solid var(--line, #D5DDD8);
}
.region-laa-bar:last-child {
  border-bottom: 0;
}
.region-laa-bar-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.region-laa-bar-head strong {
  color: var(--ink, #0D1C14);
  font-size: 0.92rem;
}
.region-laa-bar-count {
  margin-left: auto;
  color: var(--accent, #1F6B52);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
}
.region-laa-bar-track {
  height: 10px;
  background: var(--color-surface-tonal, #e8f2ed);
  border-radius: 5px;
  overflow: hidden;
}
.region-laa-bar-fill {
  height: 100%;
  background: var(--accent, #1F6B52);
  border-radius: 5px;
  transition: width 0.3s ease;
}
.region-laa-bar.is-muni .region-laa-bar-fill {
  background: var(--gold, #C9A227);
}
.region-laa-bar-foot {
  margin-top: 3px;
}

/* Slice 3 · chart card freshness footer */
.chart-card-freshness {
  margin: 12px 0 0;
  padding: 6px 0 0;
  border-top: 1px solid var(--line, #D5DDD8);
  font-size: 0.75rem;
  color: var(--muted, #5F6D68);
  text-align: right;
}
.chart-card-freshness strong {
  color: var(--accent, #1F6B52);
  font-weight: 700;
  cursor: help;
}

.crosswalk-table-wrap {
  overflow: auto;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 10px;
  max-height: 65vh;
}
.crosswalk-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.crosswalk-table thead {
  position: sticky;
  top: 0;
  background: var(--color-surface-tonal, #e8f2ed);
  z-index: 1;
}
.crosswalk-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--green, #0F3D2E);
  border-bottom: 2px solid var(--line, #D5DDD8);
}
.crosswalk-table th.num,
.crosswalk-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.crosswalk-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line, #D5DDD8);
  vertical-align: middle;
}
.crosswalk-table tbody tr:hover {
  background: var(--color-surface-elevated, #f7faf8);
}

.crosswalk-source-chip {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.crosswalk-source-chip.source-auto    { background: #e8f2ed; color: #1F6B52; }
.crosswalk-source-chip.source-manual  { background: #fbefbf; color: #8E7218; }
.crosswalk-source-chip.source-admin   { background: #C9A227; color: #0F3D2E; font-weight: 700; }
.crosswalk-source-chip.source-none    { background: #f2f4f3; color: #5F6D68; }

.crosswalk-conf {
  display: inline-block;
  min-width: 44px;
  text-align: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-size: 0.8rem;
}
.crosswalk-conf--high   { background: #d9f0e1; color: #1F8F5F; }
.crosswalk-conf--medium { background: #fbefbf; color: #8E7218; }
.crosswalk-conf--low    { background: #f9d8db; color: #B33A3A; }
.crosswalk-conf--none   { background: #f2f4f3; color: #5F6D68; }

.crosswalk-edit-btn {
  font-size: 0.82rem;
  padding: 4px 12px;
  white-space: nowrap;
}

/* Edit dialog */
.crosswalk-edit-dialog {
  border: 0;
  border-radius: 14px;
  padding: 0;
  max-width: 560px;
  width: 95vw;
  box-shadow: 0 24px 48px rgba(0,0,0,0.22), 0 8px 18px rgba(0,0,0,0.12);
}
.crosswalk-edit-dialog::backdrop {
  background: rgba(13, 28, 20, 0.5);
}
.crosswalk-edit-dialog[open] {
  animation: voter-dialog-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.crosswalk-edit-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line, #D5DDD8);
}
.crosswalk-edit-head h3 { margin: 0; font-size: 1.15rem; color: var(--green, #0F3D2E); }
.crosswalk-edit-body {
  padding: 16px 20px;
  display: grid;
  gap: 14px;
}
.crosswalk-edit-body label {
  display: grid;
  gap: 4px;
  font-size: 0.85rem;
}
.crosswalk-edit-body label > span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted, #5F6D68);
}
.crosswalk-edit-body input,
.crosswalk-edit-body select,
.crosswalk-edit-body textarea {
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line, #D5DDD8);
  background: var(--panel, #fff);
  font-size: 0.95rem;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.crosswalk-edit-body input:disabled {
  background: var(--color-surface-tonal, #e8f2ed);
  color: var(--muted, #5F6D68);
}
.crosswalk-edit-summary {
  margin: 0;
  font-size: 1.05rem;
}
.crosswalk-edit-summary strong {
  display: block;
  font-size: 1.15rem;
  color: var(--ink, #0D1C14);
}
.crosswalk-edit-summary .muted {
  display: block;
  font-size: 0.82rem;
  margin-top: 2px;
}
.crosswalk-edit-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--line, #D5DDD8);
}

/* ─────────────────────────────────────────────────────────────
   LGE 2023 result card — Map Explorer side panel
   ───────────────────────────────────────────────────────────── */
.lge-2023-card {
  background: linear-gradient(180deg, #fbf8ef 0%, #ffffff 100%);
  border: 1px solid var(--line, #D5DDD8);
  border-left: 4px solid var(--winner-color, #5F6D68);
  border-radius: 8px;
  padding: 12px 14px;
  margin: 14px 0 10px;
}
.lge-2023-card--empty {
  background: #f7f7f5;
  border-left-color: #d5dddc;
}
.lge-2023-tag {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #5F6D68;
  text-transform: uppercase;
}
.lge-2023-comp {
  font-weight: 700;
  letter-spacing: 0.15em;
}
.lge-2023-winner {
  margin: 0 0 8px;
  font-size: 14px;
  color: #0D1C14;
}
.lge-2023-parties {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 6px 0;
}
.lge-2023-party-row {
  display: grid;
  grid-template-columns: 70px 1fr 110px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.lge-2023-party-name {
  font-weight: 700;
  font-size: 11px;
}
.lge-2023-party-bar {
  height: 6px;
  background: #E8F2ED;
  border-radius: 3px;
  overflow: hidden;
}
.lge-2023-party-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.lge-2023-party-num {
  text-align: right;
  font-size: 11px;
  color: #5F6D68;
}
.lge-2023-meta {
  margin: 6px 0 0;
}

/* ─────────────────────────────────────────────────────────────
   Live 2026 vs 2023 baseline — LAA Campaign hub
   ───────────────────────────────────────────────────────────── */
.laa-hub-live-panel {
  background: linear-gradient(180deg, #ffffff 0%, #fbf8ef 100%);
}
.laa-hub-live-pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1F8F5F;
  margin-left: 6px;
  box-shadow: 0 0 0 0 rgba(31,143,95,0.6);
  animation: laa-hub-live-pulse 2s ease-out infinite;
  vertical-align: middle;
}
@keyframes laa-hub-live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(31,143,95,0.45); }
  70%  { box-shadow: 0 0 0 8px rgba(31,143,95,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,143,95,0); }
}
.laa-hub-live-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 14px 0 20px;
}
@media (max-width: 900px) {
  .laa-hub-live-strip { grid-template-columns: repeat(2, 1fr); }
}
.laa-hub-live-tile {
  /* button reset — tiles are real buttons now */
  font: inherit;
  color: inherit;
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-top: 3px solid #5F6D68;
  border-radius: 6px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease,
              transform 120ms ease, box-shadow 120ms ease;
  position: relative;
}
.laa-hub-live-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(15, 61, 46, 0.08);
}
.laa-hub-live-tile:focus-visible {
  outline: 2px solid #C9A227;
  outline-offset: 2px;
}
.laa-hub-live-tile.is-active {
  background: #F2F8F4;
  box-shadow: inset 0 0 0 2px #0F3D2E, 0 2px 6px rgba(15, 61, 46, 0.12);
}
.laa-hub-live-tile.is-active::after {
  content: "▾";
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translate(-50%, 50%);
  color: #0F3D2E;
  font-size: 14px;
  line-height: 1;
  background: #F2F8F4;
  padding: 0 4px;
  pointer-events: none;
}
.laa-hub-live-tile--ship    { border-top-color: #1F6B52; }
.laa-hub-live-tile--primary { border-top-color: #5FB071; }
.laa-hub-live-tile--gold    { border-top-color: #C9A227; }
.laa-hub-live-tile--ppp     { border-top-color: #C9353F; }
.laa-hub-live-tile--accent  { border-top-color: #0F3D2E; background: #E8F2ED; }
.laa-hub-live-tile--accent.is-active { background: #DCEBE3; }
.laa-hub-live-tile-num {
  font-size: 28px;
  font-weight: 700;
  color: #0F3D2E;
  line-height: 1;
}
.laa-hub-live-tile-label {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #0D1C14;
}
.laa-hub-live-tile-sub {
  margin-top: 3px;
  font-size: 11px;
  color: #5F6D68;
}
.laa-hub-live-h3 {
  margin: 22px 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #0F3D2E;
}
.laa-hub-live-targets {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.laa-hub-live-target-row {
  display: block;
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease;
}
.laa-hub-live-target-row:hover {
  background: #fbf8ef;
  border-color: #C9A227;
}
.laa-hub-live-target-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.laa-hub-live-target-bars {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.laa-hub-live-target-bar {
  display: grid;
  grid-template-columns: 88px 1fr 170px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.laa-hub-live-target-bar-label {
  font-weight: 600;
  color: #5F6D68;
  font-size: 11px;
}
.laa-hub-live-target-bar-track {
  height: 7px;
  background: #E8F2ED;
  border-radius: 3px;
  overflow: hidden;
}
.laa-hub-live-target-bar-fill {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.laa-hub-live-target-bar-num {
  text-align: right;
  font-weight: 600;
  color: #0D1C14;
}
.laa-hub-live-target-status.is-ahead  { color: #1F6B52; }
.laa-hub-live-target-status.is-pace   { color: #C9A227; }
.laa-hub-live-target-status.is-behind { color: #C9353F; }
.laa-hub-live-foot {
  margin-top: 14px;
}

/* ─────────────────────────────────────────────────────────────
   Region Explorer — LGE 2023 panel
   ───────────────────────────────────────────────────────────── */
.region-lge-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin: 6px 0 14px;
}
.region-lge-tile {
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-top: 3px solid var(--c, #5F6D68);
  border-radius: 6px;
  padding: 10px;
  text-align: center;
}
.region-lge-tile-num {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: #0D1C14;
}
.region-lge-tile-label {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5F6D68;
}
.region-lge-subhead {
  margin: 16px 0 8px;
  font-size: 13px;
  color: #0F3D2E;
  letter-spacing: 0.04em;
}
.region-lge-parties {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.region-lge-party-row {
  display: grid;
  grid-template-columns: 80px 1fr 160px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.region-lge-party-name {
  font-weight: 700;
  font-size: 11px;
}
.region-lge-party-bar {
  height: 7px;
  background: #E8F2ED;
  border-radius: 3px;
  overflow: hidden;
}
.region-lge-party-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
}
.region-lge-party-num {
  text-align: right;
  color: #5F6D68;
  font-size: 12px;
}
.region-lge-table-wrap {
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 6px;
  overflow: auto;
  max-height: 360px;
}
.region-lge-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.region-lge-table th,
.region-lge-table td {
  padding: 6px 10px;
  border-bottom: 1px solid #f0f3ef;
}
.region-lge-table thead {
  position: sticky;
  top: 0;
  background: #E8F2ED;
  z-index: 1;
}
.region-lge-table th {
  text-align: left;
  font-weight: 700;
  color: #0F3D2E;
  letter-spacing: 0.04em;
}
.region-lge-table tbody tr:hover {
  background: #fbf8ef;
}

/* ─────────────────────────────────────────────────────────────
   Voter detail — LGE 2023 context badge
   ───────────────────────────────────────────────────────────── */
.voter-lge2023 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: -4px 0 10px;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(15,61,46,0.05) 0%, rgba(255,255,255,0) 100%);
  border-left: 3px solid var(--winner-color, #5F6D68);
  border-radius: 4px;
  font-size: 12px;
}
.voter-lge2023-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.voter-lge2023-winner {
  font-size: 14px;
}
.voter-lge2023-share {
  color: #0D1C14;
  font-weight: 600;
}
.voter-lge2023-meta {
  margin-left: auto;
}

/* ─────────────────────────────────────────────────────────────
   Map Explorer · LAA councillors list (side panel)
   ───────────────────────────────────────────────────────────── */
.map-side-section-tag--with-gap {
  margin-top: 18px;
}
.map-laa-councillors {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-councillor-row {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-left: 3px solid var(--party-color, #5F6D68);
  border-radius: 4px;
}
.map-councillor-num {
  font-size: 11px;
  font-weight: 700;
  color: #5F6D68;
  text-align: center;
}
.map-councillor-info {
  min-width: 0;
}
.map-councillor-name {
  font-size: 12px;
  font-weight: 600;
  color: #0D1C14;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-councillor-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 1px;
  font-size: 11px;
}
.map-councillor-party {
  font-weight: 700;
}

/* Coverage pill on the intro side panel */
.map-side-coverage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 6px 10px;
  background: #E8F2ED;
  border: 1px solid #1F8F5F;
  border-radius: 14px;
  font-size: 11px;
  color: #0F3D2E;
}
.map-side-coverage-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1F8F5F;
  box-shadow: 0 0 0 0 rgba(31,143,95,0.6);
  animation: map-side-coverage-pulse 2s ease-out infinite;
}
@keyframes map-side-coverage-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(31,143,95,0.45); }
  70%  { box-shadow: 0 0 0 6px rgba(31,143,95,0); }
  100% { box-shadow: 0 0 0 0 rgba(31,143,95,0); }
}

/* ─────────────────────────────────────────────────────────────
   Region quick-jump pills (LAA + constituency layers)
   ───────────────────────────────────────────────────────────── */
.map-region-jump {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  background: #fbf8ef;
  border-top: 1px solid var(--line, #D5DDD8);
  border-bottom: 1px solid var(--line, #D5DDD8);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.map-region-jump.hidden { display: none; }
.map-region-jump-label {
  flex-shrink: 0;
  font-weight: 600;
  color: #0F3D2E;
  margin-right: 4px;
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.map-region-pill {
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 14px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: #0F3D2E;
  transition: all 120ms ease;
  font-family: Calibri, system-ui, sans-serif;
}
.map-region-pill:hover {
  background: #E8F2ED;
  border-color: #1F8F5F;
  color: #1F6B52;
}
.map-region-pill.is-active {
  background: #0F3D2E;
  border-color: #0F3D2E;
  color: #ffffff;
}
.map-region-pill--all {
  background: #C9A227;
  border-color: #B8901F;
  color: #ffffff;
}
.map-region-pill--all:hover {
  background: #B8901F;
  border-color: #9F7C1A;
  color: #ffffff;
}
.map-region-pill--all.is-active {
  background: #C9A227;
  border-color: #B8901F;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.32);
}
/* Per-region LAA count badge — small pill-on-pill */
.map-region-pill-count {
  display: inline-block;
  margin-left: 5px;
  padding: 0 6px;
  min-width: 18px;
  background: rgba(15, 61, 46, 0.10);
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #0F3D2E;
  transition: background 120ms ease, color 120ms ease;
}
.map-region-pill.is-active .map-region-pill-count {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
}
.map-region-pill:hover .map-region-pill-count {
  background: rgba(31, 143, 95, 0.18);
}
/* Empty region — visible but greyed; clickable for an explanation */
.map-region-pill.is-empty {
  background: #f4f4f0;
  border-color: #E3E7E5;
  color: #9CA8A3;
  opacity: 0.78;
}
.map-region-pill.is-empty:hover {
  background: #fbf8ef;
  border-color: #C9A227;
  color: #5F6D68;
  opacity: 1;
}
.map-region-pill.is-empty .map-region-pill-count {
  background: rgba(156, 168, 163, 0.18);
  color: #9CA8A3;
}
.map-region-pill.is-empty .map-region-pill-count::after {
  content: " ⓘ";
  margin-left: 1px;
}

/* Separator between region pills and the LAA jump picker */
.map-region-jump-sep {
  flex-shrink: 0;
  margin: 0 4px;
  color: #9CA8A3;
  font-weight: 700;
}
/* LAA picker — secondary jump for the LAA layer */
.map-region-jump-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  font-size: 11px;
  color: #0F3D2E;
}
.map-region-jump-picker-label {
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #5F6D68;
}
.map-laa-jump {
  flex-shrink: 0;
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 14px;
  padding: 5px 28px 5px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #0F3D2E;
  font-family: Calibri, system-ui, sans-serif;
  cursor: pointer;
  max-width: 280px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #0F3D2E 50%),
                    linear-gradient(135deg, #0F3D2E 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px),
                       calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  transition: all 120ms ease;
}
.map-laa-jump:hover,
.map-laa-jump:focus-visible {
  border-color: #1F8F5F;
  outline: none;
  box-shadow: 0 0 0 2px rgba(31, 143, 95, 0.18);
}

/* ─────────────────────────────────────────────────────────────
   LAA intro side panel — "missing geometry" list
   ───────────────────────────────────────────────────────────── */
.map-side-missing {
  margin-top: 14px;
  background: #fbf8ef;
  border: 1px solid #E9DCA8;
  border-radius: 6px;
  padding: 10px 12px;
}
.map-side-missing[open] {
  background: #fff;
  border-color: #C9A227;
}
.map-side-missing-summary {
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  color: #0F3D2E;
  list-style: none;
}
.map-side-missing-summary::-webkit-details-marker { display: none; }
.map-side-missing-summary::before {
  content: "▸";
  display: inline-block;
  color: #C9A227;
  font-size: 11px;
  transition: transform 120ms ease;
  margin-right: 2px;
}
.map-side-missing[open] > .map-side-missing-summary::before {
  transform: rotate(90deg);
}
.map-side-missing-icon {
  color: #C9A227;
  font-size: 13px;
}
.map-side-missing-help {
  margin: 8px 0 12px;
  line-height: 1.45;
}
.map-side-missing-region {
  margin: 0 0 10px;
}
.map-side-missing-region-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 0 4px;
  border-bottom: 1px solid #EFE7C7;
  margin-bottom: 4px;
}
.map-side-missing-region-head strong {
  color: #0F3D2E;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.map-side-missing-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.map-side-missing-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #E3E7E5;
  border-radius: 5px;
  padding: 7px 10px;
  cursor: pointer;
  font-family: inherit;
  transition: all 120ms ease;
}
.map-side-missing-item:hover {
  background: #fff8e1;
  border-color: #C9A227;
  transform: translateX(2px);
}
.map-side-missing-item:focus-visible {
  outline: 2px solid #C9A227;
  outline-offset: 1px;
}
.map-side-missing-item-name {
  font-size: 12px;
  font-weight: 600;
  color: #0F3D2E;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-side-missing-item-meta {
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

/* "No shape" banner shown on a missing-LAA detail panel */
.map-side-no-shape {
  display: flex;
  gap: 10px;
  background: #fff8e1;
  border: 1px solid #C9A227;
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  color: #0F3D2E;
}
.map-side-no-shape-icon {
  color: #C9A227;
  font-size: 16px;
  line-height: 1.2;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────────────────────────
   Regions side panel — parliamentary seats accents
   ───────────────────────────────────────────────────────────── */
.map-side-stat--accent {
  background: #FBEFBF;
  border-color: #C9A227 !important;
}
.map-side-stat--accent .map-side-stat-num {
  color: #0F3D2E;
}
.map-side-parl-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin: 14px 0 4px;
}
.map-side-parl-tile {
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-top: 3px solid #1F8F5F;
  border-radius: 6px;
  padding: 10px 8px;
  text-align: center;
}
.map-side-parl-tile--total {
  background: #E8F2ED;
  border-top-color: #0F3D2E;
}
.map-side-parl-num {
  font-size: 22px;
  font-weight: 700;
  color: #0F3D2E;
  line-height: 1;
}
.map-side-parl-label {
  margin-top: 4px;
  font-size: 11px;
  color: #0D1C14;
}
.map-legend-foot {
  margin: 6px 0 0;
  font-size: 10px;
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────
   Campaign 2026 sidebar group + sub-view scaffolding
   ───────────────────────────────────────────────────────────── */
.sidebar-group-campaign .sidebar-group-header {
  background: linear-gradient(90deg, rgba(15,61,46,0.06), rgba(255,255,255,0));
  border-radius: 8px;
}
.sidebar-group-title-campaign {
  color: var(--accent, #0F3D2E);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.sidebar-group-campaign .sidebar-item {
  /* subtle indent so the section feels distinct from Overview/Field ops */
  position: relative;
}
.sidebar-group-campaign .sidebar-item::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent, #1F8F5F), var(--gold, #C9A227));
  border-radius: 1px;
  opacity: 0.45;
}
.sidebar-group-campaign .sidebar-item.active::before { opacity: 1; }

/* Sub-view headers — uniform across Targets / Focus / Milestones */
.campaign-subview-head {
  padding: 22px 24px 18px;
  background: linear-gradient(135deg, #F4F8F2 0%, #FBF8EF 100%);
  border-left: 4px solid var(--accent, #0F3D2E);
}
.campaign-subview-head h1 {
  margin: 6px 0 6px;
  font-size: 1.6rem;
  color: var(--ink, #0D1C14);
  letter-spacing: -0.01em;
}
.campaign-subview-head .laa-hub-eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--accent, #0F3D2E);
  font-weight: 700;
  text-transform: uppercase;
}
.campaign-subview-head p.muted {
  margin: 0;
  max-width: 70ch;
}

/* Dashboard's "Jump to" navigation grid */
.campaign-jump-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}
.campaign-jump-card {
  display: grid;
  grid-template-columns: 44px 1fr 24px;
  gap: 14px;
  align-items: center;
  text-align: left;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.campaign-jump-card:hover {
  background: var(--accent-tonal, #E8F2ED);
  border-color: var(--accent, #1F8F5F);
  transform: translateY(-1px);
}
.campaign-jump-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--accent-tonal, #E8F2ED);
  color: var(--accent, #0F3D2E);
  border-radius: 8px;
  font-size: 1.4rem;
  font-weight: 700;
}
.campaign-jump-card:hover .campaign-jump-icon {
  background: var(--accent, #1F8F5F);
  color: #ffffff;
}
.campaign-jump-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.campaign-jump-body strong {
  font-size: 1.05rem;
  color: var(--ink, #0D1C14);
}
.campaign-jump-arrow {
  color: var(--muted, #5F6D68);
  font-size: 1.4rem;
  transition: transform 120ms ease, color 120ms ease;
}
.campaign-jump-card:hover .campaign-jump-arrow {
  color: var(--accent, #1F8F5F);
  transform: translateX(3px);
}

/* ─────────────────────────────────────────────────────────────
   LAA EXPLORER · sister view to Region Explorer
   ───────────────────────────────────────────────────────────── */
.laa-explorer-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.laa-explorer-filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.laa-pick-filter {
  padding: 8px 12px;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 8px;
  font: inherit;
  min-width: 200px;
  background: var(--bg, #FBF8EF);
}
.laa-pick-district {
  padding: 8px 12px;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 8px;
  font: inherit;
  background: var(--bg, #FBF8EF);
}
.laa-pick-grid {
  display: grid;
  gap: 16px;
}
.laa-pick-region {
  display: grid;
  gap: 8px;
}
.laa-pick-region-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line, #D5DDD8);
}
.laa-pick-region-head strong { color: var(--accent, #0F3D2E); font-size: 0.95rem; }
.laa-pick-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}
.laa-pick-card {
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease;
}
.laa-pick-card:hover {
  background: var(--accent-tonal, #E8F2ED);
  border-color: var(--accent, #1F8F5F);
}
.laa-pick-card-name {
  font-weight: 700;
  color: var(--ink, #0D1C14);
  font-size: 0.92rem;
  margin-bottom: 4px;
}
.laa-pick-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.78rem;
}
.laa-pick-card-type {
  color: var(--muted, #5F6D68);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}
.laa-pick-card-voters {
  color: var(--ink, #0D1C14);
  font-variant-numeric: tabular-nums;
}

/* LAA Explorer · detail – division list + councillors */
.laa-div-row {
  display: block;
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 4px;
  cursor: pointer;
  transition: background 100ms ease, border-color 100ms ease;
}
.laa-div-row:hover {
  background: var(--accent-tonal, #E8F2ED);
  border-color: var(--accent, #1F8F5F);
}
.laa-div-row-name {
  font-weight: 600;
  margin-bottom: 2px;
}
.laa-div-row-meta {
  display: flex;
  gap: 12px;
  font-size: 0.82rem;
}
.laa-div-row-count {
  color: var(--ink, #0D1C14);
  font-variant-numeric: tabular-nums;
}
.laa-div-row-pct {
  color: var(--accent, #1F8F5F);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.laa-councillors-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.laa-councillor-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  padding: 8px 10px;
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-left: 3px solid var(--party-color, #5F6D68);
  border-radius: 6px;
}
.laa-councillor-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted, #5F6D68);
  text-align: center;
}
.laa-councillor-body { min-width: 0; }
.laa-councillor-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--ink, #0D1C14);
}
.laa-councillor-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
  font-size: 0.78rem;
}
.laa-councillor-party {
  font-weight: 700;
}

/* ─────────────────────────────────────────────────────────────
   POLISH BATCH B · shared confirm dialog
   Replaces native window.prompt() / window.confirm() across the app.
   ───────────────────────────────────────────────────────────── */
.confirm-dialog {
  padding: 0;
  border: none;
  border-radius: 12px;
  max-width: min(540px, 92vw);
  width: 100%;
}
.confirm-dialog-card {
  padding: 22px 22px 16px;
  background: #ffffff;
  border-radius: 12px;
}
.confirm-dialog-head h2 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  color: var(--ink, #0D1C14);
}
.confirm-dialog-head p {
  margin: 0;
  font-size: 0.95rem;
}
.confirm-dialog-input-wrap {
  margin: 14px 0 4px;
  display: grid;
  gap: 6px;
}
.confirm-dialog-input-wrap.hidden { display: none; }
.confirm-dialog-label span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink, #0D1C14);
}
.confirm-dialog-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line, #D5DDD8);
  border-radius: 6px;
  font: inherit;
  font-size: 0.95rem;
  resize: vertical;
  background: var(--bg, #FBF8EF);
  color: var(--ink, #0D1C14);
}
.confirm-dialog-input:focus {
  outline: 2px solid #1F8F5F;
  outline-offset: 1px;
  background: #ffffff;
}
.confirm-dialog-input-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 2px;
}
.confirm-dialog-input-foot .hidden { display: none; }
#shared-confirm-input-counter {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
#shared-confirm-input-counter.is-under { color: var(--warn, #C07A18); }
#shared-confirm-input-counter.is-ok    { color: #1F8F5F; }
.confirm-dialog-actions {
  margin-top: 16px;
}
/* Tone variants on the OK button */
.confirm-dialog #shared-confirm-ok.danger {
  background: #C9353F;
  border-color: #B12832;
}
.confirm-dialog #shared-confirm-ok.danger:hover { background: #B12832; }
.confirm-dialog #shared-confirm-ok.warn {
  background: #C9A227;
  border-color: #B8901F;
  color: #0D1C14;
}
.confirm-dialog #shared-confirm-ok.warn:hover { background: #B8901F; }

/* ─────────────────────────────────────────────────────────────
   POLISH BATCH F · mobile reflow + missing styles
   ───────────────────────────────────────────────────────────── */

/* Geography view — `.stats-grid` and `.stat` had no styling, rendering as
   a vertical unstyled list. Match the LAA-hub tile aesthetic. */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 10px 0;
}
.stats-grid .stat {
  background: #ffffff;
  border: 1px solid var(--line, #D5DDD8);
  border-top: 3px solid var(--accent, #C9A227);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}
.stats-grid .stat strong {
  display: block;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink, #0D1C14);
  line-height: 1;
}
.stats-grid .stat span {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted, #5F6D68);
}

/* Bottom-nav — base CSS had flex with `flex: 1 1 0` squeezing 7-9 items
   into tiny pills on phones. Switch to horizontal scroll so each item
   keeps a readable width. Also drop a dead `grid-template-columns`
   override at line 3148 (rule never applied — parent is flex, not grid). */
@media (max-width: 720px) {
  .bottom-nav {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    justify-content: flex-start;
    padding-left: 12px;
    padding-right: 12px;
    scroll-snap-type: x proximity;
  }
  .bottom-nav::-webkit-scrollbar { display: none; }
  .bottom-nav .nav-btn {
    flex: 0 0 auto;
    min-width: 76px;
    scroll-snap-align: start;
  }
}

/* Chart bar rows — 130px label column squeezes the bar on narrow screens.
   Stack label above bar + value on phones. */
@media (max-width: 540px) {
  .chart-bar-row {
    grid-template-columns: 1fr;
    row-gap: 2px;
    margin-bottom: 10px;
  }
  .chart-bar-row .count {
    text-align: left;
  }
}

/* Live 2026 vs 2023 hub — 3-col grid (88 / 1fr / 170) loses the bar on phones. */
@media (max-width: 540px) {
  .laa-hub-live-target-bar {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }
  .laa-hub-live-target-bar-num {
    text-align: left;
  }
  .laa-hub-live-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Region Explorer LGE 2023 party-row — same pattern. */
@media (max-width: 540px) {
  .region-lge-party-row {
    grid-template-columns: 1fr;
    row-gap: 2px;
  }
  .region-lge-party-num {
    text-align: left;
  }
  .region-lge-tiles {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* APNU logo is a circular mark on a white square (JPG). The green ring sits at
   ~48.4% radius (measured), so clip to a 48% circle: removes the white square
   corners + the thin margin, leaving a clean circular badge on any background. */
.app-splash-logo,
.login-logo,
.sidebar-mark,
.topbar-mark {
  border-radius: 50%;
  clip-path: circle(48%);
  object-fit: cover;
}

/* Summary → "2025 election — region winners": full-width responsive grid so all
   10 region rows lay out in 2–3 columns instead of stacking in a cramped ⅓ card. */
.region-winners-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 8px 12px;
  margin-top: 4px;
}
.region-winners-grid .region-summary-row {
  margin-bottom: 0;
  height: 100%;
}
/* Contest badge ("General"/"Regional") shown on a region row only when both
   2025 contests are on screen at once (region drill-down). */
.election-tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  margin-left: 6px;
  vertical-align: middle;
}

/* Admin → "Update voter list" upload wizard */
.wizard-pill {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  vertical-align: middle;
  margin-left: 8px;
}
.wizard-steps {
  margin: 12px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 14px;
}
.wizard-steps > li { line-height: 1.5; }
.wizard-steps > li > strong { display: block; margin-bottom: 4px; }
.wizard-file-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 4px 0;
}
.wizard-file-row input[type="file"] { flex: 1 1 260px; min-width: 0; }
.wizard-advanced { margin-top: 8px; }
.wizard-advanced summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.wizard-advanced textarea { margin-top: 8px; width: 100%; }
