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

#map {
  position: relative;      /* important so legend anchors inside */
  height: 100%;
  width: 100%;
}

/* View toggle control (unchanged) */
.view-control {
  background: rgba(20, 20, 20, 0.9);
  padding: 6px;
  border-radius: 8px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

.view-control button {
  display: block;
  width: 100%;
  margin: 2px 0;
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #f0f0f0;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}

.view-control button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.view-control button.active {
  background: #ff9800;
  color: #111;
}

/* Legend */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", sans-serif;
}

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

/* View toggle control */
.view-control {
  background: rgba(20, 20, 20, 0.9);
  padding: 6px;
  border-radius: 8px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

.view-control button {
  display: block;
  width: 100%;
  margin: 2px 0;
  padding: 4px 8px;
  border: none;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #f0f0f0;
  font-size: 11px;
  cursor: pointer;
  text-align: left;
}

.view-control button:hover {
  background: rgba(255, 255, 255, 0.16);
}

.view-control button.active {
  background: #ff9800;
  color: #111;
}

/* Legend as Leaflet control */
.legend {
  background: rgba(20, 20, 20, 0.9);
  color: #f0f0f0;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11px;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.6);
}

.legend-title {
  font-weight: bold;
  margin-bottom: 2px;
}

.legend-subtitle {
  font-size: 10px;
  color: #cccccc;
  margin-bottom: 4px;
}

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

.legend-swatch {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  margin-right: 6px;
}

.legend-label {
  white-space: nowrap;
}

/* Floating hover card (replaces Leaflet popup for hover behavior) */
.hover-card {
  position: absolute;
  display: none;
  pointer-events: none; /* so it doesn't block map interaction */
  z-index: 1000;
}

/* Optional: if you ever remove inline styles from crashPopup
.hover-card-inner {
  background: rgba(240,240,240,0.9);
  padding: 12px 16px;
  border-radius: 8px;
  width: 260px;
  font-family: 'Segoe UI', sans-serif;
  font-size: 11.5px;
  line-height: 1.35;
}
*/


/* ------------------------------------------
   CUSTOM POPUP STYLE (REMOVE WHITE BOX)
------------------------------------------- */
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: transparent !important;
  box-shadow: none !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  padding: 0 !important;
}


