:root {
  color-scheme: light;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: #f6f7fb;
  color: #0f172a;
}

body {
  margin: 0;
  padding: 0 24px 40px;
}

header {
  padding: 24px 0 8px;
}

h1 {
  margin: 0;
  font-size: 2.2rem;
}

.subtitle {
  margin-top: 6px;
  color: #475569;
}

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin: 16px 0 24px;
}

.kpi {
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.kpi span {
  display: block;
  font-size: 1.6rem;
  font-weight: 600;
}

.kpi label {
  color: #64748b;
  font-size: 0.9rem;
}

main {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.map-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.map-toolbar h2 {
  margin: 0;
  font-size: 1.2rem;
}

.map-toggle {
  display: inline-flex;
  background: #e2e8f0;
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.toggle-button {
  border: none;
  background: transparent;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  color: #334155;
  cursor: pointer;
}

.toggle-button.active {
  background: white;
  color: #0f172a;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.12);
}

#map {
  height: 560px;
  background: #d4d4d8;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  font-size: 0.9rem;
  color: #475569;
}

.map-legend .legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: white;
  padding: 6px 10px;
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.map-legend .legend-swatch {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1px solid #cbd5f5;
}

aside {
  background: white;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

aside h2 {
  margin-top: 0;
}

aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

aside li {
  padding: 8px 0;
  border-bottom: 1px solid #e2e8f0;
}

footer {
  margin-top: 28px;
  color: #64748b;
}

.attribution {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 6px;
}

.attribution a {
  color: #64748b;
  text-decoration: underline;
}

.attribution a:hover {
  color: #0f172a;
}

.glossary {
  margin-top: 32px;
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}

.glossary h2 {
  margin-top: 0;
  font-size: 1.4rem;
}

.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.glossary-card {
  background: #f8fafc;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.glossary-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.glossary-card p,
.glossary-card ul {
  margin: 0;
  color: #475569;
  line-height: 1.5;
  padding-left: 18px;
}

.glossary-card p {
  padding-left: 0;
}

@media (max-width: 960px) {
  main {
    grid-template-columns: 1fr;
  }

  #map {
    height: 420px;
  }
}