html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body.map-page {
  overflow: hidden;
  background: #07111f;
  color: #eef6f8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.map-skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 30;
  transform: translateY(-150%);
  border-radius: 8px;
  background: #f8fafc;
  color: #082f49;
  padding: 10px 14px;
  font-weight: 800;
  text-decoration: none;
}

.map-skip-link:focus {
  transform: translateY(0);
}

.map-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.map-canvas {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: #07111f;
}

.map-panel {
  position: absolute;
  z-index: 10;
  top: 22px;
  bottom: 22px;
  display: flex;
  width: min(360px, calc(100vw - 44px));
  flex-direction: column;
  gap: 18px;
  box-sizing: border-box;
  overflow: auto;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.72);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(18px) saturate(138%);
  -webkit-backdrop-filter: blur(18px) saturate(138%);
}

.map-panel-left {
  left: 22px;
  padding: 18px;
}

.map-panel-right {
  right: 22px;
  padding: 22px;
}

.map-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.map-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  font-size: 17px;
  font-weight: 850;
  letter-spacing: 0;
  text-decoration: none;
}

.map-brand-mark img {
  width: 32px;
  height: 32px;
}

.map-panel-section {
  display: grid;
  gap: 12px;
}

.map-panel-section.compact {
  margin-top: auto;
}

.map-eyebrow {
  margin: 0;
  color: #5eead4;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-panel h1,
.map-panel h2 {
  margin: 0;
  color: #f8fafc;
  font-size: 26px;
  line-height: 1.08;
  letter-spacing: 0;
}

.map-panel h2 {
  font-size: 24px;
}

.map-muted {
  margin: 0;
  color: #b7c7d6;
  font-size: 14px;
  line-height: 1.5;
}

.map-metric-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.map-metric-group legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.map-metric-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.56);
  padding: 12px;
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.map-metric-option:hover {
  border-color: rgba(94, 234, 212, 0.44);
  background: rgba(17, 35, 51, 0.7);
}

.map-metric-option:has(input:checked) {
  border-color: rgba(45, 212, 191, 0.82);
  background: rgba(13, 148, 136, 0.2);
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.18);
}

.map-metric-option input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: #0d9488;
}

.map-metric-option strong,
.map-metric-option em {
  display: block;
}

.map-metric-option strong {
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.2;
}

.map-metric-option em {
  margin-top: 4px;
  color: #a3b7c7;
  font-size: 12px;
  font-style: normal;
}

.map-metric-legend {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.42);
  padding: 10px;
}

.map-metric-legend-title {
  color: #dbeafe;
  font-size: 12px;
  font-weight: 850;
}

.map-metric-ramp {
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ramp-start), var(--ramp-mid), var(--ramp-end));
}

.map-metric-legend-labels {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #9fb2c3;
  font-size: 11px;
  font-weight: 750;
}

.map-empty-state {
  border: 1px dashed rgba(148, 163, 184, 0.34);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.48);
  color: #c8d7e3;
  padding: 16px;
  font-size: 14px;
  line-height: 1.45;
}

.map-selected-state {
  display: grid;
  gap: 10px;
}

.map-selected-state[hidden] {
  display: none;
}

.map-lead-card.compact {
  margin-top: auto;
}

.map-selected-kicker {
  margin: 0;
  color: #5eead4;
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-selected-state h3,
.map-lead-card h3 {
  margin: 0;
  color: #f8fafc;
  font-size: 21px;
  line-height: 1.12;
  letter-spacing: 0;
}

.map-feature-details {
  display: grid;
  gap: 8px;
  margin: 4px 0 0;
}

.map-feature-details div {
  display: grid;
  grid-template-columns: minmax(90px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding: 0 0 8px;
}

.map-feature-details dt {
  color: #8ea3b4;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.map-feature-details dd {
  margin: 0;
  color: #e6f3f5;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.map-lead-card {
  display: grid;
  gap: 12px;
  box-sizing: border-box;
  border: 1px solid rgba(45, 212, 191, 0.38);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(13, 148, 136, 0.24), rgba(15, 23, 42, 0.58));
  padding: 14px;
  box-shadow: 0 18px 40px rgba(13, 148, 136, 0.14);
}

.map-lead-card[hidden] {
  display: none;
}

.map-lead-form {
  display: grid;
  gap: 8px;
}

.map-lead-form label {
  color: #c8d7e3;
  font-size: 12px;
  font-weight: 850;
}

.map-lead-form input,
.map-lead-form select {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.36);
  border-radius: 8px;
  background: rgba(2, 6, 23, 0.66);
  color: #f8fafc;
  font: inherit;
  font-size: 14px;
  padding: 9px 10px;
}

.map-lead-form input:focus,
.map-lead-form select:focus {
  border-color: rgba(94, 234, 212, 0.88);
  outline: 2px solid rgba(45, 212, 191, 0.2);
  outline-offset: 1px;
}

.map-lead-form button {
  min-height: 44px;
  margin-top: 4px;
  border: 0;
  border-radius: 8px;
  background: #0d9488;
  color: #f8fafc;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.map-lead-form button:hover {
  background: #0f766e;
}

.map-status {
  position: absolute;
  right: 22px;
  bottom: 22px;
  z-index: 11;
  max-width: min(360px, calc(100vw - 44px));
  box-sizing: border-box;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  background: rgba(7, 17, 31, 0.78);
  color: #c9d7e2;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.map-status[hidden] {
  display: none;
}

.maplibregl-ctrl-bottom-left,
.maplibregl-ctrl-bottom-right {
  z-index: 12;
}

@media (max-width: 1020px) {
  .map-panel {
    width: min(320px, calc(50vw - 28px));
  }
}

@media (max-width: 760px) {
  .map-panel {
    top: auto;
    bottom: 14px;
    max-height: 42vh;
    width: calc(50vw - 20px);
    padding: 14px;
  }

  .map-panel-left {
    left: 14px;
  }

  .map-panel-right {
    right: 14px;
  }

  .map-panel h1,
  .map-panel h2 {
    font-size: 19px;
  }

  .map-status {
    right: 14px;
    bottom: calc(42vh + 24px);
  }
}

@media (max-width: 560px) {
  .map-panel-left {
    top: 12px;
    bottom: auto;
    left: 12px;
    right: 12px;
    max-height: 34vh;
    width: auto;
  }

  .map-panel-right {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-height: 34vh;
    width: auto;
  }

  .map-status {
    right: 12px;
    left: 12px;
    bottom: calc(34vh + 22px);
    max-width: none;
  }
}
