/* FEMA Flood Zones source-backed legend styling for SHOKKER: ON THE MAP (:8870) */
.shokker-flood-legend {
  pointer-events: auto;
  position: fixed;
  left: clamp(12px, calc(100vw - 352px), 332px);
  bottom: 106px;
  z-index: 11;
  margin: 0 !important;
  width: min(340px, calc(100vw - 704px));
  max-height: calc(100vh - 130px);
  max-height: calc(100dvh - 130px);
  overflow-y: auto;
  background: rgba(11, 15, 22, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  padding: 11px 13px;
  color: #f3f6fb;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  box-sizing: border-box;
  max-width: calc(100vw - 24px);
}

.shokker-flood-legend[hidden] {
  display: none !important;
}

.flood-legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.flood-legend-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.flood-legend-mode {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: #dbe6f5;
  white-space: nowrap;
}

.flood-legend-mode.is-aerial {
  border-color: rgba(56, 189, 248, 0.55);
  background: rgba(56, 189, 248, 0.16);
  color: #bae6fd;
}

.flood-legend-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.flood-legend-row {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
}

.flood-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1.5px solid #64b5f6;
  flex-shrink: 0;
}

.flood-legend-label {
  flex: 1;
  color: #e2ebf7;
}

.flood-legend-count {
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.flood-legend-foot {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 10.5px;
  color: #9fb0c6;
}

.flood-legend-status {
  font-size: 11.5px;
  color: #cfe0f5;
}

.flood-legend-status.is-error {
  color: #ff8a80;
}

/* Reserve a right-hand navigation lane and an 8px gap below the compact left column (33.5vh + 24vh). */
@media (max-width: 900px) {
  .shokker-flood-legend {
    left: 12px;
    bottom: max(184px, calc(23vh + 34px), calc(19vh + 50px));
    bottom: max(184px, calc(23dvh + 34px), calc(19dvh + 50px));
    width: min(340px, calc(100vw - 76px));
    max-height: min(18vh, calc(19.5vh - 42px), calc(23.5vh - 58px));
    max-height: min(18dvh, calc(19.5dvh - 42px), calc(23.5dvh - 58px));
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 9px 11px;
  }
}
