/* ── SVG icons ─────────────────────────────────────────────────────── */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  pointer-events: none;
}

/* ── Reset & base ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sr-bg: #f5f5f3;
  --sr-panel: #ffffff;
  --sr-surface: #ffffff;
  --sr-surface-soft: #fafaf9;
  --sr-line: rgba(0, 0, 0, 0.08);
  --sr-line-strong: rgba(0, 0, 0, 0.15);
  --sr-text: #121212;
  --sr-text-soft: #4a4a4a;
  --sr-text-muted: #848484;
  --sr-accent: #245c3c;
  --sr-accent-strong: #173f2a;
  --sr-accent-soft: #e8efe8;
  --sr-warm: #f0f0ee;
  --sr-shadow: none;
  --sr-radius-sm: 0px;
  --sr-radius-md: 0px;
  --sr-radius-lg: 0px;
  --sr-radius-xl: 0px;

  /* ── Map marker palette (muted, brand-aligned) ──────────────────── */
  --sr-neon-green: #2e8b57;
  --sr-neon-yellow: #b8960c;
  --sr-neon-red: #c0392b;
  --sr-neon-gray: #8a8a8a;
  --sr-neon-badge-bg: rgba(36, 40, 36, 0.88);
}

html, body {
  height: 100%;
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  color: var(--sr-text);
  background: var(--sr-bg);
}

body {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

/* ── App layout ────────────────────────────────────────────────────── */
.app {
  --sidebar-width: 48vw;
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: transparent;
}

.app.is-resizing {
  cursor: col-resize;
  user-select: none;
}

/* ── Left panel ────────────────────────────────────────────────────── */
.panel-left {
  width: var(--sidebar-width);
  min-width: 280px;
  max-width: min(70vw, 960px);
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-right: 1px solid var(--sr-line);
  overflow-y: auto;
  flex-shrink: 0;
  z-index: 10;
}

.panel-resizer {
  position: relative;
  flex: 0 0 6px;
  align-self: stretch;
  cursor: col-resize;
  background: transparent;
  border-right: 1px solid var(--sr-line);
  transition: background 0.15s ease;
  z-index: 15;
}

.panel-resizer::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 40px;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.15);
}

.panel-resizer:hover,
.panel-resizer:focus-visible,
.app.is-resizing .panel-resizer {
  background: rgba(0, 0, 0, 0.04);
}

.panel-resizer:focus-visible {
  outline: none;
}

/* ── Brand ─────────────────────────────────────────────────────────── */
.brand {
  padding: 12px 16px;
  border-bottom: none;
  background: var(--sr-accent);
  color: #ffffff;
  flex-shrink: 0;
}
.brand-eyebrow {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 2px;
}
.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #ffffff;
}
.brand-badge {
  display: inline-block;
  font-size: 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.7);
  padding: 2px 5px;
  border-radius: 3px;
  vertical-align: middle;
  margin-left: 6px;
  position: relative;
  top: -1px;
}

/* ── Mode toggle ───────────────────────────────────────────────────── */
.mode-toggle {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  flex-shrink: 0;
  padding: 0;
}
.mode-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: none;
  border-bottom: 2px solid transparent;
  background: var(--sr-surface-soft);
  color: var(--sr-text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mode-btn:hover {
  background: #ffffff;
  color: var(--sr-text);
}
.mode-btn.active {
  background: #ffffff;
  color: var(--sr-accent);
  border-bottom-color: var(--sr-accent);
}

/* Heating mode: shift active colour to orange/red */
[data-mode="heating"] .mode-btn.active {
  color: #9b4e28;
  border-bottom-color: #9b4e28;
}
[data-mode="heating"] .brand {
  background: #9b4e28;
}
[data-mode="heating"] .btn-primary          { background: #121212; }
[data-mode="heating"] .btn-primary:hover    { background: #2a2a2a; }
[data-mode="heating"] #search-input:focus   { border-color: #121212; }
[data-mode="heating"] .score-bar-fill       { background: #121212; }
[data-mode="heating"] .score-value          { color: var(--sr-text); }
[data-mode="heating"] .card-section-score   { background: var(--sr-surface-soft); }

/* ── Search ────────────────────────────────────────────────────────── */
.search-section {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--sr-line);
  flex-shrink: 0;
}
.search-row {
  display: flex;
  gap: 8px;
}
#search-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--sr-line-strong);
  border-radius: 0;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
  background: #ffffff;
}
#search-input:focus { border-color: #121212; }

.btn-primary {
  padding: 10px 18px;
  background: #121212;
  color: #fff;
  border: none;
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-primary:hover { background: #2a2a2a; }
.search-context {
  margin-top: 8px;
  font-size: 12px;
  color: var(--sr-text-muted);
  line-height: 1.45;
}

.search-error {
  margin-top: 8px;
  font-size: 12px;
  color: #8d3f1f;
  background: #fbf2ee;
  padding: 8px 10px;
  border-radius: 0;
  border: 1px solid rgba(141, 63, 31, 0.16);
}

/* ── Empty state ───────────────────────────────────────────────────── */
.empty-state {
  padding: 24px 16px;
  color: var(--sr-text-soft);
}
.empty-state-card {
  padding: 24px 18px;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  background: var(--sr-surface);
  text-align: left;
}
.empty-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border-radius: 0;
  background: rgba(0, 0, 0, 0.05);
  opacity: 0.75;
}
.empty-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--sr-text);
  line-height: 1.35;
}
.empty-hint {
  margin-top: 10px;
  font-size: 13px;
  color: var(--sr-text-soft);
  line-height: 1.55;
}

/* ── Empty state: pathway guide ───────────────────────────────────── */
.empty-pathways {
  padding: 12px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.empty-pathways-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.empty-pathways-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sr-text-muted);
}

/* Numbered steps */
.empty-pathway-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.empty-step {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--sr-line);
}
.empty-step:last-child {
  border-bottom: none;
}
.empty-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: var(--sr-accent);
  border: 1.5px solid var(--sr-accent);
  border-radius: 50%;
}
.empty-step-text {
  font-size: 12px;
  color: var(--sr-text-soft);
  line-height: 1.35;
}

/* Alternative entry points */
.empty-pathway-alt {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--sr-line);
}
.empty-pathway-alt:last-child {
  border-bottom: none;
}
.empty-pathway-alt-input {
  font-weight: 600;
  color: var(--sr-text);
  min-width: 100px;
  font-family: var(--sr-font-mono, monospace);
  font-size: 11px;
  letter-spacing: 0.01em;
}
.empty-pathway-alt-desc {
  color: var(--sr-text-soft);
  font-size: 11px;
}

/* Available municipalities in empty state */
.empty-available-municipalities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 4px;
  justify-content: center;
}
.empty-test-municipalities {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
}
.empty-test-municipalities-hint {
  font-size: 11px;
  color: var(--sr-text-muted);
}
.empty-test-municipality-btn {
  display: inline-block;
  padding: 4px 10px;
  font-size: 11px;
  font-family: var(--sr-font);
  font-weight: 600;
  color: var(--sr-accent);
  background: none;
  border: 1px solid var(--sr-accent);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.empty-test-municipality-btn:hover {
  background: var(--sr-accent);
  color: #ffffff;
}
.empty-pathway-collab {
  font-size: 11px;
  line-height: 1.5;
  color: var(--sr-text-soft);
  padding: 4px 0;
}
.empty-pathway-collab a {
  color: var(--sr-accent);
  text-decoration: underline;
}

/* ── Search guidance ──────────────────────────────────────────────── */
.search-guidance {
  padding: 4px 16px 8px;
  font-size: 11px;
  color: var(--sr-text-muted);
  line-height: 1.45;
}

/* ── Map first-visit overlay ──────────────────────────────────────── */
.map-first-visit {
  position: absolute;
  inset: 0;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 245, 243, 0.55);
  backdrop-filter: blur(2px);
}
.map-first-visit-content {
  text-align: center;
  max-width: 320px;
  padding: 28px 24px 22px;
  background: var(--sr-surface);
  border: 1px solid var(--sr-line-strong);
}
.map-first-visit-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--sr-text);
  line-height: 1.4;
  margin-bottom: 6px;
}
.map-first-visit-sub {
  font-size: 12px;
  color: var(--sr-text-soft);
  margin-bottom: 16px;
}
.map-first-visit-close {
  display: inline-block;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: #ffffff;
  background: #121212;
  border: none;
  cursor: pointer;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 0.15s;
}
.map-first-visit-close:hover {
  background: #2a2a2a;
}
.map-first-visit-close:focus-visible {
  outline: 2px solid var(--sr-accent);
  outline-offset: 2px;
}
.map-first-visit-close:active {
  background: #000000;
}

/* ── Loading ───────────────────────────────────────────────────────── */
.loading-state {
  padding: 32px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--sr-text-soft);
  justify-content: center;
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: #121212;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result card ───────────────────────────────────────────────────── */
.result-card {
  padding: 0 0 28px;
}

.card-header {
  position: relative;
  padding: 18px 44px 14px 16px;
  border-bottom: 1px solid var(--sr-line);
  background: transparent;
}
/* ── Assumptions ⋮ button ── */
.assumptions-menu-btn {
  position: absolute;
  top: 14px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--sr-text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.assumptions-menu-btn:hover,
.assumptions-menu-btn.is-active {
  background: var(--sr-line);
  color: var(--sr-accent-strong);
}
/* ── Assumptions panel ── */
.assumptions-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--sr-surface);
  border-left: 2px solid #121212;
  box-shadow: -2px 0 8px rgba(0,0,0,0.08);
  z-index: 50;
  padding: 0 0 16px;
  border-radius: 0;
}
.assumptions-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--sr-line);
  background: var(--sr-surface);
  position: sticky;
  top: 0;
  z-index: 1;
}
.assumptions-panel-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sr-accent-strong);
  letter-spacing: 0.01em;
}
.assumptions-panel-close {
  border: none;
  background: none;
  font-size: 14px;
  color: var(--sr-text-soft);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  line-height: 1;
}
.assumptions-panel-close:hover {
  background: var(--sr-line);
  color: var(--sr-text);
}
.assumptions-panel .solar-analysis-assumptions {
  padding: 10px 16px 4px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* panel sits inside panel-left which is position:relative */
.panel-left {
  position: relative;
}
.card-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sr-text-muted);
  margin-bottom: 8px;
}
.result-address {
  font-size: 22px;
  font-weight: 600;
  color: var(--sr-text);
  line-height: 1.4;
  letter-spacing: -0.02em;
}
.result-egid {
  font-size: 12px;
  color: var(--sr-text-soft);
  margin-top: 6px;
}

/* ── Card sections ─────────────────────────────────────────────────── */
.card-section {
  padding: 16px;
  border-bottom: 1px solid var(--sr-line);
}
.card-section:last-child { border-bottom: none; }
.card-section[hidden] { display: none; }

.section-title {
  display: flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sr-text-muted);
  margin-bottom: 12px;
}
.section-icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
  margin-right: 5px;
}

.data-empty {
  font-size: 13px;
  color: var(--sr-text-muted);
  line-height: 1.5;
}

/* ── Solar data ────────────────────────────────────────────────────── */
.inspection-brief {
  margin-bottom: 14px;
  padding: 14px 14px 12px;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  background: var(--sr-surface-soft);
}
.inspection-brief-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--sr-text-muted);
  margin-bottom: 8px;
}
.inspection-brief-note {
  font-size: 16px;
  line-height: 1.45;
  color: var(--sr-text);
  font-weight: 500;
}
.inspection-brief-meta {
  margin-top: 10px;
  font-size: 12px;
  color: var(--sr-text-soft);
  line-height: 1.45;
}
.solar-hero {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  background: #ffffff;
}
.solar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  height: 44px;
  border-radius: var(--sr-radius-md);
  font-size: 15px;
  font-weight: 800;
  color: var(--sr-text);
  background: #d8ddd4;
  padding: 0 12px;
  text-transform: uppercase;
}
.solar-badge.class-1 { background: #d8eef3; color: #255a66; }
.solar-badge.class-2 { background: #f2edc6; color: #625a18; }
.solar-badge.class-3 { background: #f5dfbf; color: #744a14; }
.solar-badge.class-4 { background: #f4d5c6; color: #8a4420; }
.solar-badge.class-5 { background: #ead0ce; color: #7f2d28; }
.solar-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.solar-hero-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--sr-text);
}
.solar-match-note {
  font-size: 12px;
  color: var(--sr-text-soft);
  line-height: 1.45;
}
.solar-filter-block {
  margin-bottom: 14px;
}
.solar-filter-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.solar-filter-summary {
  font-size: 12px;
  font-weight: 700;
  color: var(--sr-accent);
}
.solar-tier-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tier-filter-btn {
  border: 1px solid var(--sr-line-strong);
  background: #ffffff;
  color: var(--sr-text-soft);
  border-radius: 0;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.tier-filter-btn:hover {
  border-color: var(--sr-text);
  color: var(--sr-text);
}
.tier-filter-btn[data-tier="1"].active { background: #d8eef3; border-color: #9cc9d4; color: #255a66; }
.tier-filter-btn[data-tier="2"].active { background: #f2edc6; border-color: #d8ce89; color: #625a18; }
.tier-filter-btn[data-tier="3"].active { background: #f5dfbf; border-color: #d7b784; color: #744a14; }
.tier-filter-btn[data-tier="4"].active { background: #f4d5c6; border-color: #d7a88f; color: #8a4420; }
.tier-filter-btn[data-tier="5"].active { background: #ead0ce; border-color: #c79f9b; color: #7f2d28; }
.solar-summary-grid {
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  background: #ffffff;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  padding: 8px 14px;
}
.solar-analysis-card {
  margin-bottom: 14px;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  background: var(--sr-surface-soft);
  padding: 14px;
}
.solar-analysis-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.solar-analysis-note {
  font-size: 12px;
  color: var(--sr-text-soft);
  line-height: 1.45;
}
.solar-analysis-selection {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 0;
  background: var(--sr-accent-soft);
  color: var(--sr-accent);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.solar-battery-toggle-row {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--sr-surface-soft);
  border: 1px solid var(--sr-line);
  border-radius: 0;
  margin-bottom: 2px;
}
.solar-battery-toggle-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sr-accent-strong);
  cursor: pointer;
  user-select: none;
}
.solar-battery-toggle-check {
  width: 15px;
  height: 15px;
  accent-color: var(--sr-accent);
  cursor: pointer;
}
.solar-battery-info-text {
  font-size: 11px;
  color: var(--sr-text-soft);
  flex: 1;
  text-align: right;
}
/* ── EIV subsidy toggle ── */
.solar-eiv-toggle-row {
  grid-column: 1 / -1;
  border: 1px solid var(--sr-line-strong);
  border-radius: 0;
  padding: 6px 8px 6px 8px;
  margin-top: 2px;
}
.solar-eiv-info {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.solar-eiv-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.solar-eiv-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--sr-radius-sm);
  background: var(--sr-accent-soft);
  color: var(--sr-accent-strong);
  white-space: nowrap;
}
.solar-eiv-badge-vs {
  background: #f3eadf;
  color: #8a5a28;
}
.solar-eiv-disclaimer {
  font-size: 10px;
  color: var(--sr-text-soft);
  margin: 0;
  line-height: 1.5;
}
.solar-eiv-disclaimer a {
  color: var(--sr-accent);
  text-decoration: none;
}
.solar-eiv-disclaimer a:hover {
  text-decoration: underline;
}
.solar-eiv-amount {
  color: var(--sr-accent);
  font-weight: 600;
}
.solar-net-investment {
  font-weight: 700;
}
.solar-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  background: rgba(0, 0, 0, 0.08);
  color: var(--sr-text-soft);
  border-radius: 50%;
  font-size: 9px;
  font-weight: 900;
  font-style: normal;
  cursor: help;
  margin-left: 4px;
  vertical-align: middle;
  line-height: 1;
}

.solar-analysis-assumptions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.solar-analysis-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.solar-analysis-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--sr-text-muted);
}
.solar-analysis-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  border: 1px solid var(--sr-line-strong);
  border-radius: 0;
  background: #ffffff;
  min-height: 38px;
}
.solar-analysis-input-wrap:focus-within {
  border-color: #121212;
}
.solar-analysis-input {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--sr-text);
  font-size: 13px;
  padding: 8px 74px 8px 10px;
  outline: none;
}
.solar-analysis-unit {
  position: absolute;
  right: 10px;
  color: var(--sr-text-muted);
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
}
.solar-analysis-status {
  margin-bottom: 10px;
  padding: 9px 10px;
  border-radius: 0;
  border: 1px solid var(--sr-line);
  background: var(--sr-surface-soft);
  color: var(--sr-accent);
  font-size: 12px;
  line-height: 1.45;
}
.solar-analysis-status-error {
  border-color: rgba(155, 78, 40, 0.16);
  background: #fdf3ee;
  color: #9b4e28;
}
.solar-analysis-ratings {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.solar-analysis-rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid var(--sr-line);
}
.solar-analysis-ratings .solar-analysis-rating-row:last-child {
  border-bottom: none;
}
.analysis-rating {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 0;
  background: #f0f0f0;
  color: var(--sr-text-soft);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}
.analysis-rating.is-strong { background: #e1ece2; color: #21533a; }
.analysis-rating.is-good { background: #edf2e6; color: #4a5f2e; }
.analysis-rating.is-weak { background: #f3e5e2; color: #8c3a2f; }
.analysis-rating.is-neutral { background: #edf1ec; color: var(--sr-text-soft); }
.solar-analysis-grid {
  margin-bottom: 12px;
}
.stat-grid.solar-analysis-grid {
  /* override data-grid gap when used as stat-grid */
  gap: 8px;
}

.solar-best-card {
  margin-bottom: 14px;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  background: #ffffff;
  padding: 12px 14px;
}
.solar-subtitle {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--sr-text-muted);
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--sr-line);
}
.solar-tier-table-wrap {
  margin-bottom: 12px;
  overflow-x: auto;
}
.solar-tier-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.solar-tier-table th,
.solar-tier-table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--sr-line);
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
  overflow: visible;
}
.solar-tier-table th:first-child,
.solar-tier-table td:first-child {
  text-align: left;
}
.solar-tier-table th {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sr-text-muted);
  background: var(--sr-surface-soft);
}
.solar-tier-table td {
  font-weight: 500;
}
.solar-tier-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--sr-text);
}
.solar-tier-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #c8c8c8;
  flex-shrink: 0;
}
.solar-tier-dot.class-1 { background: #22b8f0; }
.solar-tier-dot.class-2 { background: #fff200; }
.solar-tier-dot.class-3 { background: #ffab00; }
.solar-tier-dot.class-4 { background: #ff5a14; }
.solar-tier-dot.class-5 { background: #b00000; }
.solar-tier-table tbody tr {
  cursor: pointer;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;
}
.solar-tier-table tbody tr:hover { background: rgba(24, 35, 29, 0.025); }
.solar-tier-table tr.is-selected.class-1 { background: rgba(216, 238, 243, 0.78); box-shadow: inset 3px 0 0 #8eb9c3; }
.solar-tier-table tr.is-selected.class-2 { background: rgba(242, 237, 198, 0.82); box-shadow: inset 3px 0 0 #c9bb63; }
.solar-tier-table tr.is-selected.class-3 { background: rgba(245, 223, 191, 0.82); box-shadow: inset 3px 0 0 #d29f58; }
.solar-tier-table tr.is-selected.class-4 { background: rgba(244, 213, 198, 0.82); box-shadow: inset 3px 0 0 #c98c68; }
.solar-tier-table tr.is-selected.class-5 { background: rgba(234, 208, 206, 0.82); box-shadow: inset 3px 0 0 #b9756f; }
.solar-tier-table tr:last-child td {
  border-bottom: none;
}
.solar-warnings {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.solar-warning {
  font-size: 12px;
  line-height: 1.45;
  color: #775b2a;
  background: #fbf6ea;
  border: 1px solid #e6d8b6;
  border-radius: 0;
  padding: 9px 10px;
}

/* ── Data grid ─────────────────────────────────────────────────────── */
.data-grid { display: flex; flex-direction: column; gap: 0; }
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--sr-line);
}
.data-row:last-child { border-bottom: none; }
.data-label { font-size: 12px; color: var(--sr-text-muted); flex-shrink: 0; }
.data-value { font-size: 13px; font-weight: 600; color: var(--sr-text); text-align: right; }

/* ── KPI stat blocks ───────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.stat-block {
  background: #ffffff;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-block-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--sr-text-muted);
}
.stat-block-value {
  font-size: 17px;
  font-weight: 700;
  color: var(--sr-text);
  letter-spacing: -0.3px;
  line-height: 1.2;
}

/* ── Tooltips ──────────────────────────────────────────────────────── */
.has-tooltip {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted currentColor;
  text-decoration: none;
}
.has-tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 9px);
  left: 50%;
  transform: translateX(-50%);
  background: #121212;
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 0;
  width: 210px;
  text-align: left;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 300;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
}
.has-tooltip::before {
  content: "";
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #121212;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 300;
}
.has-tooltip:hover::after,
.has-tooltip:hover::before {
  opacity: 1;
}
/* Ensure tooltip stays inside panel for left-edge elements */
.has-tooltip.tooltip-right::after { left: 0; transform: none; }
.has-tooltip.tooltip-right::before { left: 10px; transform: none; }
.has-tooltip.tooltip-left::after { left: auto; right: 0; transform: none; }
.has-tooltip.tooltip-left::before { left: auto; right: 10px; transform: none; }

/* ── Formula tooltip (LaTeX hover) ─────────────────────────────────── */
.formula-tooltip {
  position: fixed;
  z-index: 9999;
  background: #121212;
  color: #e0e0e0;
  border-radius: 2px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  pointer-events: none;
  max-width: 480px;
  font-family: 'IBM Plex Sans', sans-serif;
}
.formula-tooltip-section + .formula-tooltip-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #333;
}
.formula-tooltip-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #888;
  margin-bottom: 4px;
}
.formula-tooltip-math {
  min-height: 18px;
  overflow-x: auto;
}
.formula-tooltip-math .katex {
  font-size: 14px;
  color: #fff;
}
.formula-tooltip-params {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.45;
}
.formula-tooltip-params td {
  padding: 1.5px 0;
  vertical-align: baseline;
}
.formula-tooltip-params td:first-child {
  padding-right: 8px;
  text-align: right;
  white-space: nowrap;
}
.formula-tooltip-params td:first-child .katex {
  font-size: 12px;
  color: #ccc;
}
.formula-tooltip-params td:nth-child(2) {
  color: #888;
  padding-right: 10px;
}
.formula-tooltip-params td:last-child {
  text-align: right;
  font-family: 'IBM Plex Mono', 'SF Mono', monospace;
  font-size: 11px;
  color: #e0e0e0;
  white-space: nowrap;
}
.has-formula {
  cursor: help;
  border-bottom: 1px dotted rgba(0,0,0,0.25);
}
.stat-block-value.has-formula {
  border-bottom: 1px dotted rgba(0,0,0,0.2);
}

/* ── Fossil badge ──────────────────────────────────────────────────── */
.fossil-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--sr-radius-sm);
  font-size: 11px;
  font-weight: 700;
  background: #ecefe9;
  color: var(--sr-text-soft);
}
.fossil-badge.fossil    { background: #f3e5e2; color: #8c3a2f; }
.fossil-badge.renewable { background: #e1ece2; color: #21533a; }
.fossil-badge.unknown   { background: #ecefe9; color: var(--sr-text-soft); }

/* ── Confidence tier badge ─────────────────────────────────────────── */
.confidence-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--sr-radius-sm);
  font-size: 11px;
  font-weight: 700;
  background: #ecefe9;
  color: var(--sr-text-soft);
}
.confidence-badge.tier-a { background: #e1ece2; color: #21533a; }
.confidence-badge.tier-b { background: #f3eadf; color: #8a5a28; }
.confidence-badge.tier-c { background: #ecefe9; color: var(--sr-text-muted); }

.inspection-details {
  margin-top: 14px;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  background: #ffffff;
  overflow: hidden;
}
.inspection-details summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sr-text-soft);
}
.inspection-details summary::-webkit-details-marker { display: none; }
.inspection-details summary::after {
  content: "+";
  float: right;
  font-size: 14px;
  color: var(--sr-text-muted);
}
.inspection-details[open] summary::after { content: "−"; }
.inspection-details[open] summary {
  border-bottom: 1px solid var(--sr-line);
}
.inspection-detail-stack {
  padding: 14px 16px 16px;
}
.inspection-details-compact .inspection-detail-stack {
  padding-top: 12px;
}


/* ── PV status badge ──────────────────────────────────────────────── */
.panel-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: var(--sr-radius-sm);
  font-size: 11px;
  font-weight: 700;
}
.panel-yes     { background: #f3e5e2; color: #8c3a2f; }
.panel-no      { background: #e1ece2; color: #21533a; }
.panel-unknown { background: #ecefe9; color: var(--sr-text-soft); }

/* ── Opportunity score ─────────────────────────────────────────────── */
.card-section-score {
  background: var(--sr-surface-soft);
}
.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.score-bar-track {
  flex: 1;
  height: 6px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 0;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  background: #121212;
  border-radius: 0;
  transition: width 0.5s ease;
}
.score-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--sr-accent);
  min-width: 54px;
  text-align: right;
}
.score-description { font-size: 13px; color: var(--sr-text-soft); line-height: 1.55; }
.score-method { font-size: 11px; color: var(--sr-text-soft); opacity: 0.7; line-height: 1.4; font-family: var(--sr-font-mono); margin-top: 2px; }
.score-method:empty { display: none; }

/* ── Map panel ─────────────────────────────────────────────────────── */
.panel-right {
  flex: 1;
  position: relative;
  overflow: hidden;
  background: #e8e8e6;
}
#map {
  width: 100%;
  height: 100%;
  cursor: crosshair;
}
.map-hint {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 18, 18, 0.88);
  color: #ffffff;
  font-size: 12px;
  padding: 8px 14px;
  border-radius: 0;
  pointer-events: none;
  z-index: 1000;
  white-space: nowrap;
  transition: opacity 0.3s;
}
.map-hint.hidden { opacity: 0; }

/* ── Leaflet popup tweak ───────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  border-radius: 0 !important;
  font-size: 13px;
}

/* ── Batch toolbar ─────────────────────────────────────────────────── */
.batch-toolbar {
  position: absolute;
  bottom: 60px;
  right: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.batch-btn {
  background: rgba(255,255,255,0.96);
  border: 1px solid var(--sr-line-strong);
  border-radius: 0;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: background 0.15s;
  white-space: nowrap;
}
.batch-btn:hover { background: #fff; }
.batch-status {
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--sr-line-strong);
  border-radius: 0;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--sr-text);
  max-width: 260px;
}
.batch-status a { color: var(--sr-accent); font-weight: 600; }

/* ── Map legend ────────────────────────────────────────────────────── */
.sr-map-legend {
  position: relative;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--sr-line-strong);
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 10px 12px;
  min-width: 198px;
  max-width: 280px;
  font-size: 12px;
  font-family: inherit;
}
.sr-map-legend.is-collapsed {
  min-width: 0;
  padding: 0;
}
.sr-legend-toggle {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--sr-line);
  border-radius: var(--sr-radius-sm);
  cursor: pointer;
  font-size: 14px;
  color: var(--sr-text-soft);
  line-height: 1;
  padding: 0;
}
.sr-map-legend.is-collapsed .sr-legend-toggle {
  position: static;
  background: transparent;
  border: none;
}
.sr-legend-title {
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--sr-text-muted);
  margin-bottom: 10px;
  padding-right: 28px;
}
.sr-legend-item { margin-bottom: 12px; }
.sr-legend-item:last-child { margin-bottom: 0; }
.sr-legend-layer-name {
  font-size: 11px;
  color: var(--sr-text);
  margin-bottom: 5px;
  font-weight: 600;
}
.sr-legend-img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--sr-radius-sm);
}
.sr-legend-stats {
  font-size: 11px;
  color: var(--sr-text-soft);
  margin-bottom: 6px;
  line-height: 1.45;
}
.sr-legend-swatches {
  display: grid;
  gap: 5px;
}
.sr-legend-swatch-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 6px;
  align-items: center;
}
.sr-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  background: var(--swatch-fill, #999);
  border: 1px solid var(--swatch-stroke, #666);
  box-sizing: border-box;
}
.sr-legend-swatch-label {
  font-size: 11px;
  color: var(--sr-text-soft);
}
.sr-legend-swatch-count {
  font-size: 11px;
  color: var(--sr-text-muted);
  font-variant-numeric: tabular-nums;
}
.sr-legend-note {
  margin-top: 6px;
  font-size: 11px;
  color: var(--sr-text-soft);
  line-height: 1.45;
}
.sr-map-popup {
  line-height: 1.45;
  color: var(--sr-text);
}
.sr-map-popup-meta {
  color: var(--sr-text-muted);
  font-size: 11px;
}

.sr-heat-tooltip {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--sr-line-strong);
  border-radius: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  color: var(--sr-text);
  padding: 5px 9px;
}
.sr-heat-tooltip-text {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.sr-heat-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 7px;
  margin-right: 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.sr-heat-badge--confirmed_fossil {
  background: #fde8e8;
  color: #9f1d1d;
}
.sr-heat-badge--likely_fossil {
  background: #fff3cd;
  color: #8a5300;
}
.sr-heat-badge--unknown {
  background: #eef1f3;
  color: #51606d;
}
.sr-heat-badge--likely_non_fossil {
  background: #e3f8ea;
  color: #1d6f42;
}
.sr-heat-badge--non_fossil {
  background: #daf4e4;
  color: #166534;
}
.sr-heat-popup {
  min-width: 220px;
}
.sr-heat-popup-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sr-text);
  margin-bottom: 6px;
}
.sr-heat-popup-line {
  font-size: 12px;
  color: var(--sr-text-soft);
  margin-bottom: 4px;
}
.sr-heat-popup-line:last-child {
  margin-bottom: 0;
}
.sr-heat-popup-line--warn {
  color: #9b4e28;
  font-weight: 600;
}

/* ── Municipality ranking ──────────────────────────────────────────── */
.municipality-ranking-section {
  padding: 14px 16px 16px;
  border-bottom: 1px solid var(--sr-line);
}
.municipality-ranking-header {
  margin-bottom: 12px;
}
.municipality-ranking-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.municipality-ranking-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sr-text);
  display: block;
}
.municipality-ranking-subtitle {
  font-size: 12px;
  color: var(--sr-text-muted);
  display: block;
  margin-top: 4px;
  line-height: 1.45;
}
.municipality-search-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.municipality-input-wrapper {
  flex: 1;
  position: relative;
}
.municipality-input {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--sr-line-strong);
  border-radius: 0;
  font-size: 13px;
  color: var(--sr-text);
  background: #ffffff;
  outline: none;
  box-sizing: border-box;
}
.municipality-input:focus {
  border-color: #121212;
}
.municipality-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin: 0;
  padding: 0;
  list-style: none;
  background: #ffffff;
  border: 1px solid var(--sr-line-strong);
  border-top: none;
  z-index: 1000;
  max-height: 240px;
  overflow-y: auto;
}
.municipality-suggestions li {
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--sr-text);
}
.municipality-suggestions li:hover,
.municipality-suggestions li.active {
  background: var(--sr-surface);
}
.municipality-suggestions li .suggestion-type {
  font-size: 11px;
  color: var(--sr-text-muted);
  margin-left: 8px;
}
.search-no-data {
  margin-top: 8px;
  padding: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--sr-text);
  background: var(--sr-surface);
  border: 1px solid var(--sr-line);
}
.search-no-data a {
  color: var(--sr-accent-solar);
  text-decoration: underline;
}
.municipality-search-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.municipality-priority-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.municipality-control-card {
  padding: 8px 12px;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  background: var(--sr-surface);
}
.municipality-control-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
/* When used as <summary> inside <details> */
summary.municipality-control-head {
  cursor: pointer;
  list-style: none;
  user-select: none;
  margin-bottom: 0;
}
summary.municipality-control-head::-webkit-details-marker { display: none; }
summary.municipality-control-head::after {
  content: "+";
  font-size: 14px;
  font-weight: 400;
  color: var(--sr-text-muted);
  flex-shrink: 0;
  line-height: 1;
}
details[open] > summary.municipality-control-head::after {
  content: "\2212";
}
details[open] > summary.municipality-control-head {
  margin-bottom: 8px;
  border-bottom: 1px solid var(--sr-line);
  padding-bottom: 8px;
}
/* ── Consolidated settings body ── */
.municipality-settings-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.municipality-settings-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.municipality-settings-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sr-text-muted);
}
.municipality-inline-fields--2col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.municipality-settings-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.municipality-control-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sr-text-muted);
}
.municipality-control-note {
  font-size: 11px;
  color: var(--sr-text-muted);
  line-height: 1.4;
  text-align: right;
}
.municipality-inline-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.municipality-select-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.municipality-select-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--sr-text-soft);
}
.municipality-inline-select {
  min-height: 38px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--sr-line-strong);
  border-radius: 0;
  background: #ffffff;
  color: var(--sr-text);
  font-size: 12px;
  font-weight: 600;
  outline: none;
}
.municipality-inline-select:focus {
  border-color: #121212;
}
.municipality-sort-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.municipality-sort-option {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  background: var(--sr-surface);
  color: var(--sr-text);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
}
.municipality-sort-option:hover {
  border-color: var(--sr-line-strong);
  background: var(--sr-surface-soft);
}
.municipality-sort-option.is-active::after {
  content: "";
}
.municipality-sort-option.is-active {
  border-color: #121212;
  background: var(--sr-surface-soft);
}
.municipality-sort-option-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--sr-text);
}
.municipality-sort-option-meta {
  display: none;
}
.btn-secondary {
  padding: 8px 14px;
  background: transparent;
  border: 1px solid var(--sr-line-strong);
  border-radius: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--sr-text);
  cursor: pointer;
  white-space: nowrap;
}
.btn-secondary:hover { background: var(--sr-surface-soft); border-color: var(--sr-text); }
.btn-secondary.btn-sm { padding: 6px 10px; font-size: 11px; }
.btn-tertiary {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid var(--sr-line);
  border-radius: 0;
  background: transparent;
  color: var(--sr-text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-tertiary:hover {
  border-color: var(--sr-text);
  color: var(--sr-text);
}
.municipality-assessment-card {
  padding-bottom: 10px;
}
.municipality-assessment-filters {
  display: grid;
  gap: 10px;
  padding: 0;
  font-size: 12px;
}
.municipality-toggle-block {
  display: grid;
  gap: 8px;
}
.municipality-toggle-block-inline {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.assessment-filter-label {
  color: var(--sr-text-soft);
  font-weight: 600;
}
.municipality-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.assessment-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 0;
  border: 1px solid var(--sr-line);
  background: #ffffff;
  user-select: none;
}
.assessment-filter-chip:hover {
  background: var(--sr-surface-soft);
  border-color: var(--sr-line-strong);
}
.assessment-filter-chip input {
  accent-color: var(--sr-accent);
}
.assessment-filter-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 10px;
  border-radius: 0;
  border: 1px solid var(--sr-line);
  background: #ffffff;
  color: var(--sr-text-soft);
  font-weight: 600;
}
.assessment-filter-switch input {
  accent-color: var(--sr-accent);
}
.municipality-ranking-active-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.municipality-summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(36, 92, 60, 0.08);
  color: var(--sr-accent-strong);
  font-size: 11px;
  font-weight: 600;
}
.municipality-summary-pill strong {
  font-weight: 700;
}
.municipality-ranking-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--sr-text-muted);
}
.spinner-sm {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-top-color: #121212;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.municipality-ranking-result { margin-top: 12px; }
.municipality-ranking-meta {
  font-size: 11px;
  color: var(--sr-text-muted);
  margin-top: 8px;
  line-height: 1.4;
}
/* ── Ranking summary panel ── */
.ranking-summary {
  margin-bottom: 12px;
  border: 1px solid var(--sr-line);
  background: var(--sr-surface);
}
.ranking-summary-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sr-text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.ranking-summary-toggle::-webkit-details-marker { display: none; }
.ranking-summary-toggle::after {
  content: "+";
  margin-left: auto;
  font-size: 13px;
  font-weight: 400;
  color: var(--sr-text-muted);
  line-height: 1;
}
details[open] > .ranking-summary-toggle::after {
  content: "\2212";
}
.ranking-summary-badge {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--sr-font-mono, monospace);
  color: var(--sr-text-soft);
  letter-spacing: 0;
  text-transform: none;
}
.ranking-summary-body {
  padding: 0 12px 12px;
}
.ranking-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.ranking-summary-stat {
  padding: 8px 10px;
  background: var(--sr-bg);
}
.ranking-summary-stat-value {
  font-size: 14px;
  font-weight: 700;
  font-family: var(--sr-font-mono, monospace);
  color: var(--sr-text);
  line-height: 1.3;
}
.ranking-summary-stat-label {
  font-size: 10px;
  color: var(--sr-text-muted);
  margin-top: 2px;
  line-height: 1.3;
}
.ranking-summary-distributions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 10px;
}
.ranking-summary-disclaimer {
  margin-top: 10px;
  font-size: 11px;
  color: var(--sr-text-muted);
  line-height: 1.4;
}
.ranking-dist-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ranking-dist-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--sr-text-muted);
  margin-bottom: 2px;
}
.ranking-dist-note {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--sr-text-muted);
  opacity: 0.7;
}
.ranking-dist-bar {
  display: flex;
  height: 6px;
  overflow: hidden;
  background: var(--sr-bg);
}
.ranking-dist-bar > span {
  display: block;
  height: 100%;
  min-width: 1px;
}
.ranking-dist-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
}
.ranking-dist-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--sr-text-soft);
  line-height: 1.4;
}
.ranking-dist-legend-dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
}
.ranking-dist-legend-item strong {
  font-weight: 600;
  font-family: var(--sr-font-mono, monospace);
  color: var(--sr-text);
}
.ranking-list-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sr-text-muted);
  margin-bottom: 6px;
}
.municipality-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 360px;
  overflow-y: auto;
}
.ranking-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--sr-surface);
  border-bottom: 1px solid var(--sr-line);
  cursor: pointer;
  transition: background 0.12s;
}
.ranking-row:hover {
  background: var(--sr-surface-soft);
}
.ranking-row.is-highlighted {
  box-shadow: inset 3px 0 0 var(--sr-line);
}
.ranking-row.is-active {
  box-shadow: inset 3px 0 0 var(--sr-accent);
}
.ranking-row.is-active.is-highlighted {
  box-shadow: inset 3px 0 0 var(--sr-accent);
}
.ranking-rank {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--sr-font-mono, monospace);
  color: var(--sr-text-muted);
  min-width: 22px;
  text-align: right;
  padding-top: 1px;
  line-height: 1.35;
}
.ranking-info {
  flex: 1;
  min-width: 0;
}
.ranking-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.ranking-address {
  font-size: 13px;
  font-weight: 600;
  color: var(--sr-text);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ranking-primary-pill {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  padding: 2px 7px;
  background: rgba(24, 35, 29, 0.05);
  color: var(--sr-accent-strong);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--sr-font-mono, monospace);
  letter-spacing: -0.01em;
}
/* ── Inline tags (badges) ── */
.ranking-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.ranking-tags > span {
  display: inline-block;
  padding: 1px 5px;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.4;
  white-space: nowrap;
}
.ranking-pv-badge {
  background: rgba(159, 29, 29, 0.07);
  color: #9f1d1d;
}
.ranking-merge-note {
  background: rgba(36, 92, 60, 0.06);
  color: var(--sr-accent);
}
.ranking-roof-badge {
  background: rgba(0, 0, 0, 0.04);
  color: var(--sr-text-muted);
}
.ranking-roof-badge.roof-new    { color: #1e6e35; }
.ranking-roof-badge.roof-medium { color: #7a5400; }
.ranking-roof-badge.roof-old    { color: #9f1d1d; }
.ranking-roof-badge.roof-skip   { color: #888; }
/* ── Expandable detail table ── */
.ranking-detail {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--sr-line);
}
.ranking-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.5;
}
.ranking-detail-table tr + tr .ranking-detail-label,
.ranking-detail-table tr + tr .ranking-detail-value {
  padding-top: 2px;
}
.ranking-detail-label {
  color: var(--sr-text-muted);
  font-weight: 400;
  padding-right: 16px;
  white-space: nowrap;
  vertical-align: top;
}
.ranking-detail-value {
  color: var(--sr-text);
  font-weight: 600;
  font-family: var(--sr-font-mono, monospace);
  text-align: right;
  vertical-align: top;
}
/* ── Building metadata chips (card header) ── */
.building-meta-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.bm-chip {
  display: inline-block;
  padding: 1px 7px;
  background: var(--sr-bg);
  border: 1px solid var(--sr-line);
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--sr-font-mono, monospace);
  color: var(--sr-text-soft);
}
/* ── Roof assessment visible signals ── */
.ra-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}
.ra-signal-tag {
  display: inline-block;
  padding: 1px 6px;
  background: var(--sr-bg);
  border: 1px solid var(--sr-line);
  border-radius: 4px;
  font-size: 10px;
  color: var(--sr-text-soft);
}
.municipality-ranking-pagination { margin-top: 8px; }
.municipality-ranking-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
}
.municipality-ranking-actions .btn-secondary {
  font-size: 11px;
}
.municipality-ranking-error {
  margin-top: 8px;
  font-size: 12px;
  color: #c0392b;
}
.ranking-empty { font-size: 12px; color: var(--sr-text-muted); padding: 8px 0; }
.sr-ranking-map-icon {
  background: transparent;
  border: none;
  overflow: visible !important;
}
.sr-ranking-map-badge {
  position: absolute;
  left: 0;
  bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 18px;
  padding: 0 5px 0 6px;
  border-radius: 0;
  background: var(--sr-neon-badge-bg);
  border: none;
  border-left: 2px solid var(--sr-neon-yellow);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  color: #e8d48c;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

/* ── Assessment tick indicator ───────────────────────────────────────── */
.sr-assess-tick-icon {
  background: transparent !important;
  border: none !important;
  overflow: visible !important;
}
.sr-assess-tick {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(10, 14, 10, 0.78);
  border: 1.5px solid var(--sr-neon-gray);
  cursor: pointer;
  transition: border-color 0.15s;
}
.sr-assess-tick svg {
  width: 9px;
  height: 9px;
  stroke: var(--sr-neon-gray);
  stroke-width: 3;
  fill: none;
}
.sr-assess-tick--complete {
  border-color: var(--sr-neon-green);
}
.sr-assess-tick--complete svg {
  stroke: var(--sr-neon-green);
}
.sr-assess-tick:hover {
  border-color: #fff;
}

/* ── Heating-mode tick markers (fossil / renewable / unknown) ────────── */
.sr-heat-tick-icon {
  background: transparent !important;
  border: none !important;
  overflow: visible !important;
}
.sr-heat-tick {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
}
.sr-heat-tick svg {
  width: 10px;
  height: 10px;
}

/* Fossil — warm terracotta-derived, no glow */
.sr-heat-tick--fossil {
  background: rgba(140, 55, 25, 0.88);
  border: 1.5px solid rgba(200, 90, 40, 0.7);
  color: #ffd8c0;
}

/* Renewable — forest-green-derived, no glow */
.sr-heat-tick--renewable {
  background: rgba(30, 80, 50, 0.88);
  border: 1.5px solid rgba(60, 140, 75, 0.7);
  color: #c4e4d0;
}

/* Unknown — barely visible */
.sr-heat-tick--unknown {
  background: rgba(10, 14, 10, 0.25);
  border: 1px solid rgba(138, 138, 138, 0.12);
  color: rgba(138, 138, 138, 0.25);
}

.sr-assess-popup {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 12px;
  line-height: 1.45;
  color: var(--sr-text);
}
.sr-assess-popup-title {
  font-weight: 700;
  margin-bottom: 4px;
}
.sr-assess-popup-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 1px 0;
}
.sr-assess-popup-label {
  color: var(--sr-text-muted);
}
.sr-assess-popup-value {
  font-weight: 600;
  text-align: right;
}
.sr-assess-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
}
.sr-assess-status--complete { color: #1a7a3a; }
.sr-assess-status--partial { color: var(--sr-text-muted); }

.municipality-settings-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--sr-text-soft);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.municipality-settings-btn:hover,
.municipality-settings-btn.is-active {
  background: var(--sr-line);
  color: var(--sr-accent-strong);
}
[data-mode="heating"] .municipality-inline-select:focus {
  border-color: #121212;
}
[data-mode="heating"] .municipality-summary-pill {
  background: rgba(155, 78, 40, 0.10);
  color: #71361b;
}
[data-mode="heating"] .municipality-sort-option.is-active {
  border-color: #121212;
  background: var(--sr-surface-soft);
}
[data-mode="heating"] .assessment-filter-chip input,
[data-mode="heating"] .assessment-filter-switch input {
  accent-color: #9b4e28;
}
[data-mode="heating"] .ranking-primary-pill {
  color: #71361b;
}

/* ── Responsive ────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .app {
    --sidebar-width: 100%;
    flex-direction: column;
  }
  .panel-left { width: 100%; max-width: 100%; height: 45vh; border-right: none; border-bottom: 1px solid #e0e0e0; }
  .panel-resizer { display: none; }
  .panel-right { height: 55vh; }
  .result-address { font-size: 19px; }
  .score-value { font-size: 20px; min-width: 46px; }
  .inspection-brief-note { font-size: 15px; }
  .municipality-search-row { flex-direction: column; align-items: stretch; }
  .municipality-search-actions { justify-content: space-between; }
  .municipality-inline-fields { grid-template-columns: 1fr; }
  .municipality-control-head { flex-direction: column; align-items: flex-start; }
  .municipality-control-note { text-align: left; }
  .municipality-sort-group { grid-template-columns: 1fr; }
  .municipality-toggle-block-inline { grid-template-columns: 1fr; }
  .ranking-head { flex-direction: column; }
  .ranking-primary-pill { align-self: flex-start; }
  .solar-hero { flex-direction: column; }
  .solar-summary-grid,
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .solar-analysis-head {
    flex-direction: column;
  }
  .solar-analysis-assumptions {
    grid-template-columns: 1fr;
  }
  .sr-map-legend {
    max-width: min(80vw, 280px);
  }
  .map-first-visit-close {
    min-height: 44px;
    padding: 12px 24px;
  }
  .map-first-visit-content {
    max-width: min(85vw, 320px);
  }
}

/* ── Reduced motion ────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .spinner, .spinner-sm { animation: none; border-top-color: var(--sr-accent); opacity: 0.7; }
  .score-bar-fill { transition: none; }
  .map-hint { transition: none; }
  .map-first-visit { backdrop-filter: none; }
}
