html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

#map {
  position: absolute;
  inset: 0;
}

#panel {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  padding: 12px 16px;
  width: 260px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  font-size: 13px;
}

#panel h1 {
  font-size: 16px;
  margin: 0 0 4px;
}

#panel .subtitle {
  margin: 0 0 10px;
  color: #444;
}

#layer-toggles label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0;
  cursor: pointer;
}

#legend {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 3px 0;
}

.swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.35);
}

#panel .source {
  margin: 10px 0 0;
  font-size: 11px;
  color: #666;
}

#symbology {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid #ddd;
}

#symbology .filter-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #555;
  margin: 8px 0 4px;
}

#symbology select {
  width: 100%;
  box-sizing: border-box;
  padding: 4px 6px;
  font-size: 12px;
}

#panel .source a {
  color: #666;
}

#info-panel {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  width: 280px;
  max-width: calc(100vw - 24px);
}

#info-toggle {
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: #2e7d32;
  color: #fff;
  font-style: italic;
  font-family: Georgia, serif;
  font-size: 15px;
  line-height: 28px;
  text-align: center;
  cursor: pointer;
  position: absolute;
  top: -8px;
  right: -8px;
}

#info-panel-content {
  padding: 12px 16px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

#info-panel h2 {
  font-size: 15px;
  margin: 0 0 8px;
}

#info-panel .summary {
  margin: 0 0 10px;
  line-height: 1.4;
  color: #333;
}

#info-panel .citation {
  margin: 0 0 12px;
  line-height: 1.4;
  font-size: 12px;
  color: #333;
}

#info-panel .downloads {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

#info-panel .downloads-label {
  font-size: 12px;
  color: #555;
  margin-right: 2px;
}

#info-panel .downloads a {
  display: inline-block;
  padding: 4px 8px;
  border: 1px solid #2e7d32;
  border-radius: 4px;
  color: #2e7d32;
  text-decoration: none;
  font-size: 12px;
}

#info-panel .downloads a:hover {
  background: #2e7d32;
  color: #fff;
}

/* Collapsed state: only the round toggle button shows */
#info-panel.collapsed {
  width: auto;
  background: none;
  box-shadow: none;
}

#info-panel.collapsed #info-toggle {
  position: static;
}

#info-panel.collapsed #info-panel-content {
  display: none;
}

.maplibregl-popup-content {
  font-size: 12px;
  max-width: 240px;
}

.maplibregl-popup-content h3 {
  margin: 0 0 6px;
  font-size: 13px;
}
