:root {
  --bg0: #1b4560;
  --bg1: #244f6a;
  --bg2: #234961;
  --ink: #edf7ff;
  --line: rgba(163, 204, 228, 0.2);
  --accent: #17f1c0;
  --panelA: #2a566f;
  --panelB: #34627c;
  --bottom-nav-height: 62px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  color: var(--ink);
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  background: linear-gradient(180deg, var(--bg0), var(--bg1) 42%, var(--bg2));
}

#app-shell { position: relative; width: 100%; height: 100%; }

#topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 1400;
  min-height: 60px;
  background: rgba(31, 58, 79, 0.62);
  border-bottom: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
}

.top-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.towntext {
  font-size: 1.55rem;
  line-height: 34px;
  font-weight: 700;
  color: #f1fbff;
}
#date_measure { display: none; }
#info-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 8px; border: 0;
  background: transparent; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
#info-btn .info-letter {
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  font-size: 1.55rem;
  line-height: 1;
  font-weight: 700;
  color: #f1fbff;
  text-transform: none;
}
#visit-btn {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
#visit-btn img {
  width: 27px;
  height: 27px;
  object-fit: contain;
}
.top-center { pointer-events: none; }
#info-btn,
#visit-btn { z-index: 2; }
#info-btn.active::before,
#visit-btn.active::before {
  content: "";
  position: absolute;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #ffffff;
}
#info-btn.active .info-letter,
#visit-btn.active img {
  position: relative;
  z-index: 1;
}
#info-btn.active .info-letter { color: #1f3a4f; }
#visit-btn.active img { filter: brightness(0) saturate(100%) invert(20%) sepia(13%) saturate(1325%) hue-rotate(161deg) brightness(95%) contrast(92%); }

#home-stage, #map-stage, #content-stage { position: absolute; inset: 0; }

#home-stage {
  padding: 60px 0 70px;
  background: linear-gradient(180deg, #1b4560 0%, #244f6a 100%);
}

#home-hero {
  min-height: 158px;
  border-radius: 0;
  overflow: hidden;
  border: 0;
  box-shadow: none;
  display: block;
  position: relative;
  background-size: cover;
  background-position: center top;
}

.hero-sunny {
  background-image: linear-gradient(160deg, rgba(13,103,170,0.55), rgba(90,180,255,0.35)), url('../icons/sol.png');
}
.hero-cloudy {
  background-image: linear-gradient(160deg, rgba(23,98,150,0.28), rgba(98,161,205,0.22)), url('../icons/Nublado.png');
}
.hero-alert-fire {
  background-image: linear-gradient(160deg, rgba(94, 18, 10, 0.5), rgba(166, 42, 24, 0.35)), url('../icons/Incendio.png');
}
#home-hero.hero-alert-fire { background-position: center bottom; }
.hero-maintenance {
  background-image: linear-gradient(160deg, rgba(20,56,88,0.38), rgba(55,96,128,0.3)), url('../icons/mantenimiento.png');
}
.hero-rainy {
  background-image: linear-gradient(160deg, rgba(8,53,96,0.5), rgba(35,91,132,0.35)), url('../icons/Lluvia.png');
}
.hero-night {
  background-image: linear-gradient(160deg, rgba(6,29,58,0.68), rgba(19,59,104,0.48)), url('../icons/Noche.png');
}
.hero-snowy {
  background-image: linear-gradient(160deg, rgba(35,78,124,0.42), rgba(88,130,170,0.3)), url('../icons/Nieve.png');
}

.hero-glass {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0.62) 0%, rgba(0,0,0,0.36) 55%, rgba(0,0,0,0.12) 100%);
  padding: 8px 0 6px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-topA {
  display: none;
  width: 100%;
  justify-content: center;
  margin-bottom: 8px;
  padding: 0 14px;
}

.hero-topA .risk-label {
  display: inline-block;
  color: #f6fbff;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0;
  text-align: center;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  transform: none;
  width: 100%;
  padding: 0 14px;
}
.hero-left { display: flex; flex-direction: column; gap: 8px; }
.hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.hidden-forecast { display: none; }
#hero-flame-white {
  display: none;
  width: 84px;
  height: 84px;
  object-fit: contain;
}
#hero-no-data {
  display: none;
  color: #ffffff;
  font-size: 2.8rem;
  line-height: 1;
  font-weight: 300;
  margin-top: 0;
}

.hero-icon img {
  width: 82px;
  height: 82px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}
.hero-temp {
  font-size: 4.2rem;
  line-height: 0.9;
  font-weight: 300;
  letter-spacing: -0.03em;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

.hero-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 14px;
  font-size: 1.04rem;
  font-weight: 700;
  color: #f6fbff;
}

.hero-risk {
  margin-top: 2px;
  padding-top: 0;
  font-size: 1rem;
  color: #f5fbff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  font-weight: 700;
  width: 100%;
  padding: 0 14px 0 8px;
  text-align: left;
}
.hero-risk .risk-label { text-align: left; }
.hero-risk #risk_measure { text-align: right; padding-right: 8px; }

.hero-risk .riskvalue { display: inline-flex; gap: 7px; align-items: center; }
.hero-risk .riskvalue i { width: 14px; height: 14px; border-radius: 50%; }
.hero-risk .riskvalue { white-space: nowrap; }

.mode-home .hero-risk {
  padding-left: 14px;
}

.status-alert .hero-risk .risk-label,
.status-maintenance .hero-risk .risk-label { display: none; }

.status-alert .hero-risk {
  justify-content: center;
  text-align: center;
}

.status-maintenance .hero-risk {
  justify-content: center;
  text-align: center;
}

.risk-alert-text {
  color: #ff2a34;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.risk-maint-text {
  color: #ffffff;
  font-weight: 700;
}

.status-alert #hero-no-data,
.status-maintenance #hero-no-data { display: block; }
.status-alert #hero-no-data { display: none; }
.status-alert .hero-topA { display: flex; }
.mode-home.status-alert .hero-topA { justify-content: flex-start; }
.mode-home.status-alert .hero-topA .risk-label { text-align: left; }
.status-alert #hero-flame-white { display: block; }

.status-alert #topbar {
  background: rgba(178, 12, 12, 0.62);
}
.status-alert #bottom-nav {
  background: rgba(178, 12, 12, 0.62);
}
.status-maintenance #topbar {
  background: rgba(92, 102, 112, 0.62);
}
.status-maintenance #bottom-nav {
  background: rgba(92, 102, 112, 0.62);
}

.status-alert .hero-risk { display: none; }

.hero-maintenance-msg {
  display: none;
  margin-top: 8px;
  width: 100%;
  text-align: center;
  color: #ffffff;
  padding: 0 14px;
}
.maint-line1 {
  font-family: "Manrope", "Segoe UI", Arial, sans-serif;
  font-size: 1.55rem;
  line-height: 1.15;
  font-weight: 700;
}
.maint-line2 {
  margin-top: 6px;
  font-size: 1rem;
  line-height: 1.2;
  font-weight: 700;
}

.status-maintenance .hero-top,
.status-maintenance .hero-risk,
.status-maintenance .hero-topA,
.status-maintenance #hero-no-data,
.status-maintenance #hero-flame-white {
  display: none !important;
}
.status-maintenance .hero-maintenance-msg {
  display: block;
}
.status-maintenance #bottom-nav .nav-btn:not([data-mode="home"]) {
  pointer-events: none;
}
.status-maintenance #bottom-nav .nav-btn:not([data-mode="home"]) svg {
  stroke: rgba(255,255,255,0.45);
}

#map-stage { display: none; }
#map { width: 100%; height: 100%; }

#content-stage {
  z-index: 1100;
  display: none;
  overflow: auto;
  padding: 80px 12px 70px;
  background: linear-gradient(180deg, #1b4560 0%, #244f6a 100%);
}

.content-panel { display: none; }
.content-panel h2 {
  font-size: 1.08rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f1fbff;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.2;
}

.base-mapa.mode-forecast #forecast-panel h2,
.base-mapa.mode-images #images-panel h2,
.base-mapa.mode-meteo #meteo-panel h2,
.base-mapa.mode-alerts #alerts-panel h2,
.base-mapa.mode-info #info-panel h2,
.base-mapa.mode-visit #visit-panel h2 {
  color: #000000;
}

.base-mapa #info-btn .info-letter { color: #f1fbff; }
.base-mapa #visit-btn img { filter: none; }

.graph-card {
  background: rgba(31, 58, 79, 0.62);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  padding: 10px;
  margin-bottom: 10px;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.graph-card b { display: block; text-align: center; color: #f1fbff; margin-bottom: 6px; }
.graph-placeholder { width: 100%; height: 160px; overflow: hidden; }

.photo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.photo-tile { border: 0; border-radius: 12px; overflow: hidden; background: #1f4258; padding: 0; cursor: pointer; }
.photo-tile img { width: 100%; min-height: 120px; object-fit: cover; display: block; }

.forecast-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  height: 100%;
}
.forecast-head, .forecast-row { display: grid; grid-template-columns: 1.5fr .85fr .75fr .75fr .8fr; align-items: center; padding: 8px 10px; border-radius: 14px; }
.forecast-head { background: rgba(31, 58, 79, 0.62); border: 1px solid rgba(255,255,255,0.16); color: #eef9ff; font-size: 0.78rem; text-transform: uppercase; z-index: 5; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.forecast-head span { text-align: center; }
.forecast-head span:first-child { text-align: left; }
.forecast-row { background: rgba(31, 58, 79, 0.62); border: 1px solid rgba(255,255,255,0.16); color: #eef9ff; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.forecast-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  gap: 8px;
  padding-bottom: 88px;
}
.f-day { font-weight: 700; font-size: 1.02rem; line-height: 1; }
.f-icon img { width: 34px; height: 34px; object-fit: contain; filter: brightness(0) invert(1); opacity: 0.95; }
.f-temp,.f-risk { text-align: center; }
.f-temp { font-size: 1.02rem; font-weight: 400; line-height: 1; }
.f-risk i { width: 15px; height: 15px; border-radius: 50%; display: inline-block; }

.alerts-list { display: grid; gap: 10px; }
.alert-item {
  background: linear-gradient(135deg, #2a566f 0%, #34627c 50%, #29536d 100%);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 12px;
  padding: 11px;
}
.alert-item h3 { font-size: 0.96rem; margin-bottom: 6px; color: #f1fbff; }
.alert-item h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.alert-time {
  font-size: 0.8rem;
  font-weight: 400;
  font-style: normal;
  opacity: 0.92;
  white-space: nowrap;
}
.alert-item p { font-size: 0.9rem; color: #d4ecfa; line-height: 1.35; }
.alert-item.alert-red {
  background: #c71f31;
  border-color: #c71f31;
}
.alert-item.alert-red h3,
.alert-item.alert-red p { color: #ffffff; }
.alert-item.alert-orange {
  background: #ffb238;
  border-color: #ffb238;
}
.alert-item.alert-orange h3,
.alert-item.alert-orange p { color: #111111; }
.alert-item.alert-light {
  background: #f7f9fc;
  border-color: #f7f9fc;
}
.alert-item.alert-light h3,
.alert-item.alert-light p { color: #111111; }

#bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1300;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0;
  height: var(--bottom-nav-height);
  border-radius: 0;
  overflow: hidden;
  border: 0;
  background: rgba(31, 58, 79, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-btn {
  height: 62px;
  width: 62px;
  flex: 0 0 62px;
  border: 0;
  position: relative;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.nav-btn svg { width: 28px; height: 28px; fill: none; stroke: #f1f1f1; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; color: #f1f1f1; opacity: 0.98; }
.nav-btn .nav-icon-img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: 0.98;
}
.nav-btn span { display: none; }

.nav-btn.active {
  background: transparent;
  box-shadow: none;
}
.nav-btn.active::before {
  content: "";
  position: absolute;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
}
.nav-btn.active svg {
  position: relative;
  z-index: 1;
  color: #1f3a4f;
  stroke: #1f3a4f;
  filter: none;
}
.nav-btn.active .nav-icon-img {
  position: relative;
  z-index: 1;
  filter: brightness(0) saturate(100%) invert(20%) sepia(13%) saturate(1325%) hue-rotate(161deg) brightness(95%) contrast(92%);
}
.nav-btn:disabled,
.nav-btn.nav-btn-disabled {
  pointer-events: none;
  cursor: default;
}
.nav-btn:disabled svg,
.nav-btn.nav-btn-disabled svg {
  stroke: rgba(241,255,255,0.42);
}
.nav-btn:disabled .nav-icon-img,
.nav-btn.nav-btn-disabled .nav-icon-img {
  opacity: 0.42;
}


.flot-x-axis div, .flot-y-axis div, .flot-text div { color: #ebf8ff !important; }

.info {
  padding: 8px 10px;
  background: linear-gradient(180deg, rgba(64,116,145,0.92), rgba(53,99,125,0.92));
  color: #fff;
  border: 1px solid rgba(31,169,255,0.68);
  border-radius: 10px;
}

.info.legend {
  display: none !important;
  max-width: none;
  width: auto;
  font: 12px/1.28 "Inter", Arial, sans-serif;
  padding: 7px 8px;
}
.legend h4 { font: 700 12px/1.15 "Inter", Arial, sans-serif; margin-bottom: 4px; color: #fff; }
.legend i { width: 10px; height: 10px; float: left; margin-right: 6px; margin-top: 2px; border-radius: 50%; }

.infoBottom {
  padding: 10px;
  font: 700 13px/1.15 Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, rgba(64,116,145,0.92), rgba(53,99,125,0.92));
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}
.overtext { display: none !important; }

.logo, .capCam { display: none !important; }

.leaflet-top { top: 72px; }
.leaflet-top .leaflet-control-layers { margin-top: 92px; }
.leaflet-top .info.legend { margin-top: 6px; }
.leaflet-control-layers,
.leaflet-control-layers-expanded {
  display: none !important;
  background: #ffffff !important;
  color: #1a1a1a !important;
  border: 1px solid rgba(0,0,0,0.2) !important;
  width: auto;
  min-width: 108px;
  max-width: none;
}
.leaflet-control-attribution {
  margin-bottom: 66px !important;
  margin-right: 8px !important;
  padding: 2px 6px !important;
  font-size: 10px !important;
  line-height: 1.2 !important;
  background: transparent !important;
  color: #ffffff !important;
}
.leaflet-control-attribution a,
.leaflet-control-attribution span {
  color: #ffffff !important;
}
.base-mapa .leaflet-control-attribution {
  color: #111111 !important;
}
.base-mapa .leaflet-control-attribution a,
.base-mapa .leaflet-control-attribution span {
  color: #111111 !important;
}
.leaflet-control-layers label,
.leaflet-control-layers-expanded label,
.leaflet-control-layers-base span,
.leaflet-control-layers-overlays span {
  color: #1a1a1a !important;
}

.mode-home #home-stage {
  display: block;
  z-index: 1205;
  background: transparent;
  pointer-events: none;
}
.mode-home #home-hero { pointer-events: auto; }
.mode-home #map-stage {
  display: block;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  border-top: 0;
  z-index: 1200;
}
.mode-home #content-stage { display: none; }
.mode-home #map {
  border-radius: 0;
  overflow: hidden;
  border: 0;
}
#home-map-tap {
  display: none;
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
}
.mode-home #home-map-tap { display: none; }

.mode-map #map-stage { display: block; }
.mode-map #map-stage { top: 0; bottom: 0; left: 0; right: 0; }
.mode-map #home-stage, .mode-map #content-stage { display: none; }

.mode-forecast #content-stage,
.mode-images #content-stage,
.mode-meteo #content-stage,
.mode-alerts #content-stage,
.mode-info #content-stage,
.mode-visit #content-stage { display: block; }

.mode-forecast #home-stage,
.mode-images #home-stage,
.mode-meteo #home-stage,
.mode-alerts #home-stage,
.mode-info #home-stage,
.mode-visit #home-stage { display: none; }

.mode-forecast #map-stage,
.mode-images #map-stage,
.mode-meteo #map-stage,
.mode-alerts #map-stage,
.mode-info #map-stage,
.mode-visit #map-stage { display: block; top: 0; bottom: 0; left: 0; right: 0; }

.mode-forecast #forecast-panel { display: block; }
.mode-images #images-panel { display: block; }
.mode-meteo #meteo-panel { display: block; }
.mode-alerts #alerts-panel { display: block; }
.mode-info #info-panel { display: block; }
.mode-visit #visit-panel { display: block; }

#forecast-panel h2 {
  position: relative;
  z-index: 6;
  margin-bottom: 0;
  padding-bottom: 8px;
  background: transparent;
}

.mode-forecast #content-stage { overflow: hidden; }
.mode-forecast #content-stage { background: transparent; }
.mode-forecast #forecast-panel {
  height: 100%;
  overflow: hidden;
  padding-bottom: 8px;
  background: rgba(255,255,255,0.12);
}

.mode-forecast #content-stage,
.mode-images #content-stage,
.mode-meteo #content-stage,
.mode-alerts #content-stage,
.mode-info #content-stage,
.mode-visit #content-stage {
  top: 60px;
  bottom: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.mode-images #content-stage {
  bottom: var(--bottom-nav-height);
}


.mode-forecast .content-panel,
.mode-images .content-panel,
.mode-meteo .content-panel,
.mode-alerts .content-panel,
.mode-info .content-panel,
.mode-visit .content-panel {
  height: 100%;
  overflow: auto;
  border-radius: 0;
  border: 0;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 10px 10px 74px;
}

.mode-images .content-panel {
  padding-bottom: 28px;
}

.mode-forecast #map-menu-wrap,
.mode-images #map-menu-wrap,
.mode-meteo #map-menu-wrap,
.mode-alerts #map-menu-wrap,
.mode-info #map-menu-wrap,
.mode-visit #map-menu-wrap { display: none !important; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,0.8); z-index: 2500; display: none; align-items: center; justify-content: center; padding: 18px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 12px; }
.lightbox-close { position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.25); background: rgba(15,40,58,0.92); color: #fff; font-size: 1.8rem; cursor: pointer; }
.info-full {
  width: 100%;
  background: rgba(31, 58, 79, 0.62);
  border: 1px solid rgba(255,255,255,0.16);
  border-radius: 14px;
  padding: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.status-maintenance.mode-info .info-full,
.status-maintenance.mode-visit .info-full {
  background: rgba(92, 102, 112, 0.62);
}
.info-full p { color: #d4ecfa; line-height: 1.35; margin-bottom: 8px; }
.info-partner {
  margin-top: 8px;
  margin-bottom: 10px;
  text-align: center;
}
.partner-line {
  display: block;
  color: #d4ecfa;
  font-size: 0.92rem;
  line-height: 1.3;
  margin-bottom: 8px;
  text-align: left;
}
.partner-logo {
  width: 170px;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}
.visit-link {
  margin-top: 14px;
}
.visit-link a {
  color: #ffffff;
  text-decoration: none;
}
.visit-link a:hover,
.visit-link a:focus {
  text-decoration: underline;
}
.info-risk {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.18);
}
.info-risk h3 {
  font-size: 0.95rem;
  color: #f1fbff;
  margin-bottom: 8px;
}
.info-risk .scale {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.info-risk .scale-row {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 10px;
  align-items: start;
}
.info-risk .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-top: 4px;
}
.info-risk .txt {
  color: #d4ecfa;
  font-size: 0.9rem;
  line-height: 1.3;
}
.info-banner {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.18);
  margin-bottom: 12px;
}

#map-menu-wrap {
  position: absolute;
  inset: 0;
  z-index: 1400;
  pointer-events: none;
}
#map-menu-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1502;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(31, 58, 79, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: inline-flex; align-items: center; justify-content: center;
  pointer-events: auto;
}
#map-menu-btn svg { width: 22px; height: 22px; fill: none; stroke: #ffffff; stroke-width: 1.8; stroke-linecap: round; }
#map .user-loc-wrapper {
  background: transparent;
  border: 0;
}
#map .user-loc-svg {
  width: 24px;
  height: 34px;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,0.28));
}
#map-locate-btn {
  position: absolute;
  top: 62px;
  right: 12px;
  z-index: 1502;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(31, 58, 79, 0.62);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}
#map-locate-btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #ffffff;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-home #map-menu-btn { top: 230px; }
.mode-home #map-locate-btn { top: 280px; }
.mode-map #map-menu-btn { top: 72px; }
.mode-map #map-locate-btn { top: 122px; }
#map-menu-panel {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: max-content;
  min-width: 220px;
  max-width: min(330px, calc(100vw - 22px));
  z-index: 1501;
  background: rgba(255,255,255,0.50);
  border: 0;
  border-radius: 0;
  padding: 12px 12px 14px;
  color: #111111;
  overflow-y: auto;
  transform: translateX(0);
  transition: none;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
#map-menu-panel.open { display: block; }

.mode-home #map-menu-panel {
  top: 218px;
  height: calc(100% - 218px - 62px);
}

.mode-map #map-menu-panel {
  top: 60px;
  height: calc(100% - 60px - 62px);
}
.map-menu-title { font-weight: 800; font-size: 0.83rem; margin: 4px 0 6px; }
#map-menu-panel label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  margin-bottom: 8px;
}
#map-menu-panel input { transform: scale(1.04); }
.risk-legend-mini div {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.risk-legend-mini i { width: 10px; height: 10px; display: inline-block; border-radius: 50%; margin-right: 0; }
.sensor-state-title { display: none; }
.sensor-legend { display: none; }
.status-alert .sensor-state-title,
.status-alert .sensor-legend { display: block; }
.sensor-legend div {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.sensor-legend i { width: 10px; height: 10px; display: inline-block; border-radius: 50%; }
.sensor-legend-icon {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.sensor-legend-icon img {
  width: 34px;
  height: 34px;
  display: block;
  flex: 0 0 auto;
}

@media (min-width: 900px) {
  #topbar { padding: 12px 20px; }
  .towntext { font-size: 1.55rem; line-height: 34px; }
  #home-stage { width: 100%; margin: 0; }
  #content-stage { width: 100%; margin: 0; }
  #content-stage { padding-top: 86px; padding-bottom: 84px; }
  .content-panel { max-width: 1180px; margin: 0 auto; }
  .mode-forecast .content-panel,
  .mode-images .content-panel,
  .mode-meteo .content-panel,
  .mode-alerts .content-panel,
  .mode-info .content-panel,
  .mode-visit .content-panel {
    max-width: none;
    width: 100%;
    margin: 0;
  }
  #bottom-nav {
    left: 0;
    right: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    background: rgba(31, 58, 79, 0.62);
  }
  #bottom-nav .nav-btn { max-width: 62px; }
  .nav-btn svg { width: 28px; height: 28px; }
  .mode-home #map-stage { left: 0; right: 0; top: 0; bottom: 0; border-top: 0; }
  .mode-map #map-stage { top: 0; bottom: 0; left: 0; right: 0; }
  #home-hero .hero-top,
  #home-hero .hero-topA,
  #home-hero .hero-risk {
    max-width: 430px;
    margin-left: auto;
    margin-right: auto;
  }
  .mode-home #home-hero .hero-risk {
    padding-left: 14px;
  }
  .mode-forecast #map-stage,
  .mode-images #map-stage,
  .mode-meteo #map-stage,
  .mode-alerts #map-stage,
  .mode-info #map-stage,
  .mode-visit #map-stage { top: 0; bottom: 0; }
  .mode-forecast #content-stage,
  .mode-images #content-stage,
  .mode-meteo #content-stage,
  .mode-alerts #content-stage,
  .mode-info #content-stage,
  .mode-visit #content-stage { top: 60px; bottom: 0; padding: 0; }
  .mode-images #content-stage { bottom: var(--bottom-nav-height); }
  .mode-forecast #forecast-panel .forecast-table {
    max-width: 860px;
    margin: 0 auto;
  }
  .mode-alerts #alerts-panel .alerts-list {
    max-width: 760px;
    margin: 0 auto;
  }
  .mode-info #info-panel .info-full,
  .mode-visit #visit-panel .info-full {
    max-width: 860px;
    margin: 0 auto;
  }
  .mode-home #map-menu-panel {
    top: 226px;
    height: calc(100% - 226px - 62px);
  }
  .photo-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
  .mode-home #map-menu-wrap,
  .mode-forecast #map-menu-wrap,
  .mode-images #map-menu-wrap,
  .mode-meteo #map-menu-wrap,
  .mode-alerts #map-menu-wrap,
  .mode-info #map-menu-wrap,
  .mode-visit #map-menu-wrap { display: none; }
  .mode-home #map-menu-wrap { display: block; }
  .mode-map #map-menu-wrap { display: block; }
}
