.hg-storm-history-map {
  --hg-storm-ink: #17313b;
  --hg-storm-muted: #5c6b73;
  --hg-storm-green: #1d6f5f;
  --hg-storm-gold: #d4932f;
  --hg-storm-line: #d7e2df;
  margin: 22px 0 30px;
  overflow: hidden;
  border: 1px solid var(--hg-storm-line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(18, 35, 45, 0.08);
  color: var(--hg-storm-ink);
}

.hg-storm-history-map__head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  padding: 20px;
  border-bottom: 1px solid var(--hg-storm-line);
  background: linear-gradient(135deg, #fbfaf6 0%, #eef7f4 100%);
}

.hg-storm-history-map__kicker {
  margin: 0 0 5px;
  color: var(--hg-storm-green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.07em;
  line-height: 1.3;
  text-transform: uppercase;
}

.hg-storm-history-map h3 {
  margin: 0;
  color: var(--hg-storm-ink);
  font-size: 25px;
  line-height: 1.22;
}

.hg-storm-history-map__intro {
  max-width: 760px;
  margin: 8px 0 0;
  color: #3e5159;
  font-size: 16px;
  line-height: 1.55;
}

.hg-storm-history-map__sources {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  max-width: 310px;
}

.hg-storm-history-map__sources a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid #bfd1cb;
  border-radius: 999px;
  background: #fff;
  color: #254d43;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.hg-storm-history-map__sources a:hover,
.hg-storm-history-map__sources a:focus-visible {
  border-color: var(--hg-storm-green);
  color: var(--hg-storm-green);
  outline: none;
}

.hg-storm-history-map__toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  padding: 14px 20px;
  border-bottom: 1px solid var(--hg-storm-line);
  background: #fff;
}

.hg-storm-history-map__field {
  flex: 1 1 360px;
  min-width: 0;
}

.hg-storm-history-map__field label {
  display: block;
  margin-bottom: 5px;
  color: #30474f;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
}

.hg-storm-history-map__select {
  width: 100%;
  min-height: 44px;
  padding: 9px 38px 9px 12px;
  border: 1px solid #aebfc5;
  border-radius: 8px;
  background: #fff;
  color: var(--hg-storm-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.hg-storm-history-map__select:focus-visible {
  border-color: #1866b4;
  outline: 3px solid rgba(24, 102, 180, 0.2);
  outline-offset: 1px;
}

.hg-storm-history-map__map {
  position: relative;
  width: 100%;
  height: 520px;
  background: #e8f0ee;
}

.hg-storm-history-map__loading,
.hg-storm-history-map__error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  color: var(--hg-storm-muted);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
}

.hg-storm-history-map__legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 18px;
  padding: 14px 20px;
  border-top: 1px solid var(--hg-storm-line);
  background: #fbfcfc;
}

.hg-storm-history-map__legend-item {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  color: #42565e;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.hg-storm-history-map__line-key {
  flex: 0 0 30px;
  width: 30px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
}

.hg-storm-history-map__line-key--hurricane { color: #a82932; }
.hg-storm-history-map__line-key--tropical { color: #c56a18; }
.hg-storm-history-map__line-key--eyewall {
  height: 3px;
  color: #7357a3;
  background: repeating-linear-gradient(90deg, currentColor 0 10px, transparent 10px 16px);
}
.hg-storm-history-map__line-key--offshore {
  height: 3px;
  color: #1866b4;
  background: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 10px);
}

.hg-storm-history-map__detail {
  display: grid;
  grid-template-columns: minmax(210px, 0.38fr) minmax(0, 1fr) auto;
  gap: 10px 18px;
  align-items: center;
  padding: 16px 20px;
  border-top: 1px solid var(--hg-storm-line);
  background: #fff;
}

.hg-storm-history-map__detail-meta,
.hg-storm-history-map__detail-title,
.hg-storm-history-map__detail-copy {
  margin: 0;
}

.hg-storm-history-map__detail-meta {
  color: var(--hg-storm-green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.3;
  text-transform: uppercase;
}

.hg-storm-history-map__detail-title {
  margin-top: 3px;
  color: var(--hg-storm-ink);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.25;
}

.hg-storm-history-map__detail-copy {
  color: #40545c;
  font-size: 14px;
  line-height: 1.5;
}

.hg-storm-history-map__detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid var(--hg-storm-green);
  border-radius: 8px;
  color: var(--hg-storm-green);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.hg-storm-history-map__detail-link:hover,
.hg-storm-history-map__detail-link:focus-visible {
  background: var(--hg-storm-green);
  color: #fff;
  outline: none;
}

.hg-storm-history-map__note {
  padding: 14px 20px 17px;
  border-top: 1px solid var(--hg-storm-line);
  background: #fffdf8;
  color: #596b72;
  font-size: 13px;
  line-height: 1.55;
}

.hg-storm-history-map__note p { margin: 0; }
.hg-storm-history-map__note strong { color: #354a52; }

.hg-storm-history-map .leaflet-container {
  font-family: inherit;
  font-size: 13px;
}

.hg-storm-history-map .leaflet-control-attribution {
  font-size: 10px;
}

.hg-storm-history-map .leaflet-tooltip {
  border: 0;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(15, 35, 44, 0.2);
  color: #263d46;
  font-size: 13px;
  font-weight: 800;
}

.hg-storm-history-map__point-tooltip {
  min-width: 150px;
  color: #30434b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
}

.hg-storm-history-map__point-tooltip strong {
  display: block;
  color: var(--hg-storm-ink);
  font-size: 13px;
}

@media (max-width: 760px) {
  .hg-storm-history-map__head {
    grid-template-columns: 1fr;
  }

  .hg-storm-history-map__sources {
    justify-content: flex-start;
    max-width: none;
  }

  .hg-storm-history-map h3 { font-size: 22px; }
  .hg-storm-history-map__intro { font-size: 15px; }
  .hg-storm-history-map__map { height: 430px; }

  .hg-storm-history-map__detail {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .hg-storm-history-map__detail-link {
    justify-self: start;
  }
}

@media (max-width: 480px) {
  .hg-storm-history-map__head,
  .hg-storm-history-map__toolbar,
  .hg-storm-history-map__legend,
  .hg-storm-history-map__detail,
  .hg-storm-history-map__note {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hg-storm-history-map__legend {
    grid-template-columns: 1fr;
  }

  .hg-storm-history-map__sources a {
    min-height: 38px;
  }

  .hg-storm-history-map__map { height: 390px; }
}

@media print {
  .hg-storm-history-map__toolbar,
  .hg-storm-history-map__map,
  .hg-storm-history-map__legend,
  .hg-storm-history-map__detail {
    display: none !important;
  }

  .hg-storm-history-map {
    box-shadow: none;
    break-inside: avoid;
  }
}
