
.emergency-map-page {
  background: #eef3f8;
}
.emergency-map-hero {
  padding: 56px 0 42px;
  background:
    radial-gradient(circle at 85% 20%, rgba(244,212,123,.18), transparent 28%),
    linear-gradient(135deg, #061a33, #0b4d7d);
  color: #fff;
}
.emergency-map-hero .eyebrow { color: #f4d47b; }
.emergency-map-hero h1 {
  margin: 8px 0 14px;
  max-width: 850px;
  font-size: clamp(2.4rem, 6vw, 5.2rem);
  line-height: .98;
  letter-spacing: -.055em;
}
.emergency-map-hero p {
  max-width: 780px;
  margin: 0;
  color: rgba(255,255,255,.8);
  font-size: 1.03rem;
}
.map-dashboard {
  padding: 28px 0 70px;
}
.map-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.map-stat {
  padding: 18px;
  border: 1px solid #dbe5ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 15px 38px rgba(9,36,74,.07);
}
.map-stat strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
  color: #061a33;
}
.map-stat span {
  display: block;
  margin-top: 8px;
  color: #617187;
  font-size: .84rem;
  font-weight: 750;
}
.map-layout {
  display: grid;
  grid-template-columns: minmax(0,1.7fr) minmax(300px,.7fr);
  gap: 18px;
  align-items: start;
}
.map-card,
.map-side-card {
  border: 1px solid #dbe5ef;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(9,36,74,.08);
  overflow: hidden;
}
.map-toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 16px 18px;
  border-bottom: 1px solid #dbe5ef;
  background: #fff;
}
.map-toolbar__filters {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.map-toolbar select,
.map-toolbar button {
  min-height: 42px;
  border: 1px solid #cbd8e6;
  border-radius: 12px;
  padding: 8px 12px;
  background: #fff;
  color: #152033;
  font: inherit;
  font-weight: 800;
}
.map-toolbar button {
  cursor: pointer;
  background: #eaf2fb;
  color: #0e5aa7;
}
.map-updated {
  color: #64748b;
  font-size: .8rem;
}
#emergencyLiveMap {
  width: 100%;
  min-height: 650px;
  background: #dce9f4;
}
.map-side-card {
  position: sticky;
  top: 110px;
}
.map-side-card__head {
  padding: 19px 20px;
  background: #061a33;
  color: #fff;
}
.map-side-card__head h2 {
  margin: 0;
  font-size: 1.3rem;
}
.map-side-card__head p {
  margin: 5px 0 0;
  color: rgba(255,255,255,.66);
  font-size: .84rem;
}
.map-report-list {
  display: grid;
  max-height: 650px;
  overflow: auto;
}
.map-report {
  padding: 16px 18px;
  border-bottom: 1px solid #e3eaf2;
}
.map-report:last-child { border-bottom: 0; }
.map-report__top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.map-report h3 {
  margin: 0;
  font-size: 1rem;
}
.map-report p {
  margin: 8px 0 0;
  color: #5d6c80;
  font-size: .87rem;
  line-height: 1.48;
}
.map-report small {
  display: block;
  margin-top: 8px;
  color: #8090a3;
}
.map-badge {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: .69rem;
  font-weight: 900;
  white-space: nowrap;
}
.map-badge--active { background: #fff0ed; color: #9d2118; }
.map-badge--resolved { background: #e8f7ef; color: #126c45; }
.map-empty {
  padding: 28px;
  color: #64748b;
  text-align: center;
}
.map-privacy {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid #cfe0f3;
  background: #eef7ff;
  color: #294e70;
  font-size: .88rem;
}
.map-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.map-actions a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 11px 16px;
  border-radius: 999px;
  font-weight: 900;
}
.map-actions .primary {
  background: linear-gradient(135deg,#d7aa38,#f2ce68);
  color: #121212;
}
.map-actions .secondary {
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
}
.leaflet-popup-content-wrapper {
  border-radius: 16px;
}
.map-popup h3 {
  margin: 0 0 7px;
  font-size: 1rem;
}
.map-popup p {
  margin: 5px 0;
  color: #4d5d70;
}
.map-popup small {
  color: #7b8999;
}
.map-legend {
  padding: 10px 12px;
  border-radius: 13px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 8px 22px rgba(5,25,48,.16);
  font-size: .76rem;
  line-height: 1.6;
}
.map-legend span {
  display: flex;
  gap: 7px;
  align-items: center;
}
.map-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
@media (max-width: 1000px) {
  .map-layout { grid-template-columns: 1fr; }
  .map-side-card { position: static; }
  .map-report-list { max-height: none; }
}
@media (max-width: 720px) {
  .map-stats { grid-template-columns: 1fr 1fr; }
  #emergencyLiveMap { min-height: 520px; }
  .map-toolbar { align-items: stretch; }
  .map-toolbar__filters { width: 100%; }
  .map-toolbar select,
  .map-toolbar button { flex: 1; }
}


/* El mapa queda contenido bajo el encabezado y sus menús */
.emergency-map-page .site-header {
  z-index: 5000;
}
.map-dashboard,
.map-layout,
.map-card {
  position: relative;
  z-index: 1;
}
.map-card {
  isolation: isolate;
}
#emergencyLiveMap {
  position: relative;
  z-index: 0 !important;
  isolation: isolate;
}
#emergencyLiveMap .leaflet-control-container {
  position: relative;
  z-index: 10;
}


/* Santiago más cercano y comunas sin novedades */
.map-clear-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #cbd8e6;
  border-radius: 12px;
  padding: 8px 12px;
  background: #effaf4;
  color: #17653f;
  font-size: .83rem;
  font-weight: 850;
  cursor: pointer;
}
.map-clear-toggle input {
  width: auto;
  margin: 0;
  accent-color: #178653;
}
.map-popup--clear strong {
  color: #178653;
}
.leaflet-tooltip {
  border-radius: 10px;
  border: 1px solid #cfe5d8;
  box-shadow: 0 7px 20px rgba(18,108,69,.12);
  color: #17653f;
  font-weight: 800;
}


/* Estaciones de radio con y sin novedades */
.station-div-icon { background: transparent; border: 0; }
.station-marker {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 3px solid #fff;
  color: #fff;
  box-shadow: 0 7px 20px rgba(4,20,43,.28);
}
.station-marker svg {
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.station-marker--safe { background: #178653; }
.station-marker--active {
  background: #b42318;
  animation: station-alert-pulse 1.8s ease-out infinite;
}
.station-marker--resolved { background: #d09a22; }
@keyframes station-alert-pulse {
  0% { box-shadow: 0 0 0 0 rgba(180,35,24,.52), 0 7px 20px rgba(4,20,43,.28); }
  70% { box-shadow: 0 0 0 13px rgba(180,35,24,0), 0 7px 20px rgba(4,20,43,.28); }
  100% { box-shadow: 0 0 0 0 rgba(180,35,24,0), 0 7px 20px rgba(4,20,43,.28); }
}
.legend-station {
  width: 13px !important;
  height: 13px !important;
  border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,.2);
}
.legend-station--safe { background: #178653; }
.legend-station--active { background: #b42318; }
.legend-station--resolved { background: #d09a22; }
.map-badge--station-safe { background: #e8f7ef; color: #126c45; }
.map-badge--station-active { background: #fff0ed; color: #9d2118; }
.map-badge--station-resolved { background: #fff6dc; color: #77510a; }
.map-station-row { border-left: 5px solid transparent; }
.map-station-row--safe { border-left-color: #178653; }
.map-station-row--active { border-left-color: #b42318; }
.map-station-row--resolved { border-left-color: #d09a22; }
.map-popup--safe strong { color: #126c45; }
.map-popup--active strong { color: #9d2118; }
.map-popup--resolved strong { color: #77510a; }
