:root {
  --bg: #0f1724;
  --panel: #101a2b;
  --accent: #3ad16c;
  --accent-strong: #1fa956;
  --muted: #8ba1c2;
  --text: #eaf2ff;
  --card: #132036;
  --stroke: rgba(255, 255, 255, 0.05);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', 'Archivo', system-ui, -apple-system, sans-serif;
  background: radial-gradient(circle at 15% 20%, rgba(58, 209, 108, 0.08), transparent 30%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hero {
  padding: 48px 5vw 24px;
}

.hero__content {
  max-width: 960px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 8px;
}

h1 {
  font-size: clamp(32px, 4vw, 44px);
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.lede {
  font-size: 17px;
  color: var(--muted);
  max-width: 760px;
  line-height: 1.6;
  margin: 0 0 14px;
}

.badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pill {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(58, 209, 108, 0.12);
  color: #c0ffd7;
  border: 1px solid rgba(58, 209, 108, 0.35);
  font-weight: 600;
  font-size: 13px;
}

.pill--alt {
  background: rgba(255, 255, 255, 0.06);
  color: #e7eeff;
  border-color: var(--stroke);
}

.layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  padding: 0 5vw 48px;
}

.panel {
  background: linear-gradient(145deg, var(--panel), #0c1523);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

#map {
  height: 520px;
  width: 100%;
}

.legend {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid var(--stroke);
}

.legend__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #d9f7e6;
}

.dot {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(58, 209, 108, 0.15);
}

.legend__hint {
  color: var(--muted);
  font-size: 13px;
}

.sidebar {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.filters {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sources {
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.sources h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.sources ul {
  margin: 0;
  padding-left: 18px;
  color: #d8e7ff;
  line-height: 1.5;
}

.sources a {
  color: #9ce6b8;
  text-decoration: none;
}

.sources a:hover {
  text-decoration: underline;
}

.statement {
  margin-top: 8px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
}

.statement summary {
  cursor: pointer;
  font-weight: 700;
  color: #dce7ff;
}

.statement p {
  margin: 8px 0 0;
  color: #c4d5f2;
  line-height: 1.5;
  font-size: 14px;
}

.notice {
  margin: 0 5vw 16px;
}

.notice details {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  padding: 10px 12px;
}

.notice summary {
  cursor: pointer;
  font-weight: 700;
  color: #dce7ff;
}

.notice p {
  margin: 8px 0 0;
  color: #c4d5f2;
  line-height: 1.5;
  font-size: 14px;
}

.resources {
  padding: 12px;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.resources h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.resources ul {
  margin: 0;
  padding-left: 18px;
  color: #d8e7ff;
  line-height: 1.5;
}

.resources a {
  color: #9ce6b8;
  text-decoration: none;
}

.resources a:hover {
  text-decoration: underline;
}

.back-top {
  position: fixed;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(58, 209, 108, 0.7);
  background: linear-gradient(135deg, rgba(58, 209, 108, 0.25), rgba(58, 209, 108, 0.45));
  color: #0f1724;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 1000;
}

.back-top--visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.cta {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(58, 209, 108, 0.6);
  background: linear-gradient(135deg, rgba(58, 209, 108, 0.25), rgba(58, 209, 108, 0.45));
  color: #0f1724;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}

.cta:hover {
  border-color: rgba(58, 209, 108, 0.9);
  background: linear-gradient(135deg, rgba(58, 209, 108, 0.35), rgba(58, 209, 108, 0.55));
}

.cta-hint {
  margin: 6px 0 0;
  color: #9bb2d4;
  font-size: 13px;
  line-height: 1.5;
}

.filters input,
.filters select {
  width: 100%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(58, 209, 108, 0.25);
  border-radius: 12px;
  padding: 11px 14px;
  color: #eaf2ff;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.filters input::placeholder {
  color: #9bb2d4;
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: rgba(58, 209, 108, 0.8);
  box-shadow: 0 0 0 2px rgba(58, 209, 108, 0.15);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.08));
}

.filters select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #c0ffd7 50%),
    linear-gradient(135deg, #c0ffd7 50%, transparent 50%),
    linear-gradient(135deg, rgba(255,255,255,0.08), rgba(255,255,255,0));
  background-position: calc(100% - 18px) 48%, calc(100% - 12px) 48%, 0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
  padding-right: 36px;
  cursor: pointer;
}

.filters select option {
  color: #0f1724;
}

.filters__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.sidebar__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.01em;
}

.muted {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.metric {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 8px 12px;
  min-width: 90px;
  text-align: right;
}

.metric__label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.metric__value {
  font-size: 26px;
  font-weight: 700;
  color: #d9f7e6;
}

.people {
  display: grid;
  gap: 10px;
  overflow-y: auto;
  max-height: 430px;
  padding-right: 6px;
}

.person {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 12px;
  transition: border 0.2s ease, transform 0.2s ease;
}

.person:hover {
  border-color: rgba(58, 209, 108, 0.6);
  transform: translateY(-2px);
}

.person__name {
  margin: 0 0 4px;
  font-weight: 700;
  color: #f5fbff;
}

.person__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #cfe4ff;
  font-size: 14px;
}

.chip {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(58, 209, 108, 0.1);
  color: #c0ffd7;
  border: 1px solid rgba(58, 209, 108, 0.3);
  font-weight: 600;
  font-size: 12px;
}

.bubble-icon {
  display: grid;
  place-items: center;
}

.bubble-marker {
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, #4af08a, #1fa956);
  color: #0a1320;
  border-radius: 50%;
  font-weight: 800;
  font-size: 12px;
  border: 2px solid rgba(10, 36, 18, 0.5);
  box-shadow: 0 12px 25px rgba(0, 0, 0, 0.35);
}

.leaflet-popup-content-wrapper {
  background: #0f1826;
  color: #eaf2ff;
  border: 1px solid rgba(58, 209, 108, 0.4);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.35);
}

.leaflet-popup-tip {
  background: #0f1826;
}

.leaflet-popup-content {
  color: #eaf2ff;
  max-height: 360px;
  overflow-y: auto;
}

.popup-list {
  padding-left: 18px;
  margin: 8px 0 0;
  line-height: 1.5;
  color: #d8e7ff;
}

.popup-list--full {
  max-height: 220px;
  overflow-y: auto;
  margin-top: 6px;
  padding-right: 4px;
}

.popup-list--full::-webkit-scrollbar {
  width: 8px;
}

.popup-list--full::-webkit-scrollbar-thumb {
  background: rgba(58, 209, 108, 0.55);
  border-radius: 6px;
}

.popup-list--full::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}

.popup-toggle {
  margin-top: 8px;
  padding: 8px 10px;
  background: linear-gradient(135deg, rgba(58, 209, 108, 0.2), rgba(58, 209, 108, 0.35));
  border: 1px solid rgba(58, 209, 108, 0.5);
  color: #0f1724;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  #map {
    height: 420px;
  }

  .people {
    max-height: none;
  }
}
