*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body.rete-page {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--rete-bg);
  color: var(--rete-text);
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.rete-credit {
  flex-shrink: 0;
  padding: 18px 16px 16px;
  text-align: center;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--rete-muted);
  background: var(--rete-panel);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}
.rete-credit a {
  color: var(--rete-primary);
  text-decoration: none;
  font-weight: 600;
}
.rete-credit a:hover {
  text-decoration: underline;
}

.rete-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px 16px;
  padding: 12px 16px;
  background: var(--rete-panel);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rete-header__brand {
  justify-self: start;
  min-width: 0;
}

.rete-header__brand-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.rete-header__brand-link:hover h1 {
  color: var(--rete-accent);
}

.rete-header__nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  justify-self: center;
}

.rete-header__nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  color: #fff;
  background: var(--rete-primary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.rete-header__nav-btn:hover {
  filter: brightness(1.1);
}

.rete-header__nav-btn.is-active {
  background: var(--rete-accent);
  color: #1a1a1a;
  cursor: default;
  pointer-events: none;
}

.rete-header__status {
  justify-self: end;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  font-size: 0.9rem;
}

.rete-header__status p {
  margin: 0;
}

.rete-logo {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 8px;
  object-fit: contain;
  background: transparent;
}

.rete-header h1 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
}

.rete-header__sub {
  margin: 2px 0 0;
  font-size: 0.85rem;
  color: var(--rete-muted);
}

.rete-label {
  color: var(--rete-muted);
}

.rete-btn {
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  background: var(--rete-primary);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.rete-btn:hover {
  filter: brightness(1.08);
}

.rete-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(190px, 200px) 1fr;
  min-height: 0;
}

.rete-sidebar {
  background: var(--rete-panel);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  overflow: auto;
  padding: 12px;
}

.rete-map-wrap {
  min-height: 420px;
  height: calc(100vh - 148px);
}

/* Stesso comportamento TemplateNuovo: scroll pagina finché la mappa non è attivata (tap sul velo) */
@media (max-width: 1024px), (hover: none) and (pointer: coarse) {
  .tn-map-guard {
    position: relative;
    isolation: isolate;
  }
  .tn-map-guard__shield {
    position: absolute;
    inset: 0;
    z-index: 1000;
    background: transparent;
    cursor: default;
    touch-action: pan-x pan-y;
    -webkit-tap-highlight-color: transparent;
  }
  .tn-map-guard--active .tn-map-guard__shield {
    display: none;
    pointer-events: none;
  }
  .tn-map-guard:not(.tn-map-guard--active) > :not(.tn-map-guard__shield) {
    pointer-events: none !important;
  }
}

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

.rete-cat {
  margin-bottom: 10px;
}

.rete-cat__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--rete-accent);
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}

.rete-cat__label {
  min-width: 0;
}

.rete-cat__chevron {
  flex-shrink: 0;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.rete-cat.is-open .rete-cat__chevron {
  transform: rotate(225deg);
  margin-top: 4px;
}

.rete-cat.has-active-metric .rete-cat__toggle {
  color: #fff;
}

.rete-cat.has-active-metric .rete-cat__label::after {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--rete-primary);
  vertical-align: middle;
}

.rete-metric-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rete-metric-btn {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--rete-text);
  cursor: pointer;
  font-size: 0.88rem;
}

.rete-metric-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

.rete-metric-btn.is-active {
  border-color: var(--rete-primary);
  background: rgba(2, 136, 209, 0.2);
}

/* Desktop: sezioni live sempre aperte; Estremi collassabile */
@media (min-width: 901px) {
  .rete-cat--live .rete-cat__chevron {
    display: none;
  }

  .rete-cat--live .rete-cat__toggle {
    cursor: default;
    pointer-events: none;
  }

  .rete-cat--live .rete-metric-list {
    display: flex;
  }

  .rete-cat--extremes:not(.is-open) .rete-metric-list {
    display: none;
  }

  .rete-cat--extremes .rete-cat__toggle {
    cursor: pointer;
    pointer-events: auto;
  }
}

.rete-legend {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.rete-legend h2 {
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.rete-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.rete-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  flex-shrink: 0;
}

.rete-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  min-height: 20px;
  padding: 2px 5px;
  border-radius: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.85);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
}

.rete-marker--offline {
  background: #6b7280 !important;
  color: #fff !important;
}

.rete-marker--stale {
  background: #6b7280 !important;
  color: #fff !important;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.95);
  opacity: 0.9;
}

.rete-marker--wind {
  min-width: 30px;
  min-height: 30px;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rete-marker-wrap {
  position: relative;
  display: inline-block;
}

.rete-marker-wrap--warn .rete-marker-warn {
  position: absolute;
  top: -7px;
  right: -7px;
  pointer-events: none;
}

.rete-warn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e53935;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  color: #fff;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  flex-shrink: 0;
}

.rete-wind-icon {
  display: block;
  width: 22px;
  height: 22px;
  line-height: 0;
}

.rete-wind-icon svg,
.rete-wind-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.rete-legend-swatch--wind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 22px;
  padding: 1px;
  box-sizing: border-box;
}

.rete-legend-swatch--wind svg {
  width: 18px;
  height: 18px;
}

.rete-popup h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.rete-popup p {
  margin: 4px 0;
  font-size: 0.88rem;
}

.rete-popup-stale {
  color: #f4d03f !important;
}

.rete-popup a {
  color: var(--rete-primary);
}

@media (max-width: 1100px) {
  .rete-header {
    grid-template-columns: 1fr;
    justify-items: stretch;
    gap: 6px 12px;
    padding: 8px 12px;
  }

  .rete-header__brand,
  .rete-header__nav,
  .rete-header__status {
    justify-self: stretch;
  }

  .rete-header__nav {
    order: 2;
    padding: 0;
    gap: 6px;
  }

  .rete-header__status {
    order: 3;
    justify-content: flex-start;
  }
}

@media (max-width: 900px) {
  .rete-header {
    gap: 4px 8px;
    padding: 6px 10px;
  }

  .rete-header__brand-link {
    gap: 8px;
  }

  .rete-logo {
    width: 44px;
    height: 44px;
  }

  .rete-header h1 {
    font-size: 1rem;
  }

  .rete-header__sub {
    display: none;
  }

  .rete-header__nav {
    gap: 4px;
  }

  .rete-header__nav-btn {
    flex: 1 1 0;
    padding: 6px 8px;
    font-size: 0.75rem;
    border-radius: 6px;
  }

  .rete-header__status {
    gap: 6px 10px;
    font-size: 0.72rem;
    align-items: center;
  }

  .rete-header__status .rete-btn {
    padding: 4px 8px;
    font-size: 0.72rem;
    font-weight: 600;
  }

  .rete-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .rete-sidebar {
    max-height: 45vh;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 10px;
  }

  .rete-map-wrap {
    height: 50vh;
  }

  .rete-cat {
    margin-bottom: 4px;
  }

  .rete-cat__toggle {
    padding: 4px 2px;
    margin-bottom: 4px;
    font-size: 0.88rem;
  }

  /* Mobile: accordion — una sezione aperta alla volta */
  .rete-cat:not(.is-open) .rete-metric-list {
    display: none;
  }

  /* Mobile: pallino anche sulla voce attiva del sottomenù (oltre che sulla categoria) */
  .rete-metric-btn.is-active::after {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--rete-primary);
    vertical-align: middle;
  }

  .rete-legend {
    margin-top: 10px;
    padding-top: 8px;
  }

  .rete-legend h2 {
    font-size: 0.85rem;
    margin-bottom: 6px;
  }
}


/* ===== Layout mappa Meteogruppo 2026 - revisione ===== */
.rete-header.rete-header--minimal {
  min-height: 34px;
  height: 34px;
  padding: 4px 12px;
  display: flex;
  justify-content: flex-end;
  background: rgba(36,48,64,.96);
  border-bottom: 1px solid rgba(255,255,255,.10);
}
.rete-header--minimal .rete-header__status {
  margin-left: auto;
  display: flex;
  gap: 18px;
  font-size: .82rem;
}
.rete-layout {
  grid-template-columns: 205px minmax(0,1fr);
}
.rete-sidebar {
  padding: 9px;
}
.rete-side-nav {
  display: grid;
  gap: 6px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,.13);
}
.rete-side-nav__btn {
  display: block;
  width: 100%;
  padding: 8px 9px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  background: var(--rete-primary);
  color: #fff;
  font: inherit;
  font-size: .82rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.rete-side-nav__btn:hover { filter: brightness(1.08); }
.rete-side-nav__btn.is-active {
  background: var(--rete-accent);
  color: #151515;
}
.rete-side-nav__refresh {
  background: #44566c;
}
.rete-map-wrap {
  position: relative;
  height: calc(100vh - 34px);
  min-height: 420px;
}
.rete-credit { display:none; }

/* Legenda sovrapposta alla mappa, sul lato destro */
.rete-legend.rete-legend--map {
  position: absolute;
  z-index: 800;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  margin: 0;
  padding: 10px 9px;
  border: 1px solid rgba(0,0,0,.20);
  border-radius: 10px;
  background: rgba(255,255,255,.90);
  color: #17202a;
  box-shadow: 0 2px 10px rgba(0,0,0,.20);
  pointer-events: none;
}
.rete-legend--map h2 { display:none; }

.rete-temp-scale__title {
  margin: 0 0 7px;
  font-size: .78rem;
  font-weight: 800;
  white-space: nowrap;
}
.rete-temp-scale__body {
  display: flex;
  gap: 7px;
  height: 360px;
}
.rete-temp-scale__bar {
  width: 22px;
  height: 100%;
  border-radius: 5px;
  border: 1px solid rgba(0,0,0,.28);
  background: linear-gradient(
    to top,
    rgb(32,74,135) 0%,
    rgb(42,112,178) 10%,
    rgb(56,150,199) 20%,
    rgb(72,187,205) 30%,
    rgb(102,205,170) 40%,
    rgb(171,221,130) 50%,
    rgb(230,235,95) 60%,
    rgb(255,221,72) 65%,
    rgb(255,187,55) 70%,
    rgb(252,141,44) 75%,
    rgb(244,96,38) 80%,
    rgb(215,48,39) 90%,
    rgb(165,0,38) 100%
  );
}
.rete-temp-scale__ticks {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: .70rem;
  font-weight: 700;
  line-height: 1;
}
.rete-legend--map .rete-legend-item {
  color: #17202a;
}

@media (max-width: 900px) {
  .rete-layout { grid-template-columns: 165px minmax(0,1fr); }
  .rete-temp-scale__body { height: 260px; }
  .rete-temp-scale__bar { width: 18px; }
  .rete-legend.rete-legend--map { right: 7px; padding: 7px; }
}


/* ===== Correzione layout: pannello flottante e scala temperatura estesa ===== */
.rete-layout {
  position: relative;
  display: block;
  min-height: 0;
}

.rete-sidebar {
  position: absolute;
  z-index: 850;
  top: 10px;
  left: 10px;
  width: 185px;
  max-height: calc(100vh - 58px);
  overflow-y: auto;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid rgba(0,0,0,.20);
  border-radius: 10px;
  background: rgba(36,48,64,.90);
  box-shadow: 0 2px 10px rgba(0,0,0,.22);
  scrollbar-width: thin;
}

.rete-map-wrap {
  width: 100%;
  height: calc(100vh - 34px);
  min-height: 420px;
}

.rete-side-nav__btn {
  padding: 7px 8px;
}

.rete-cat {
  margin-bottom: 7px;
}

.rete-cat__toggle {
  margin-bottom: 5px;
}

.rete-metric-btn {
  padding-top: 7px;
  padding-bottom: 7px;
}

/* Scala temperatura molto più lunga */
.rete-temp-scale__body {
  height: min(72vh, 650px);
  min-height: 500px;
}

.rete-temp-scale__bar {
  width: 26px;
}

.rete-temp-scale__ticks {
  font-size: .74rem;
}

.rete-legend.rete-legend--map {
  right: 16px;
  padding: 10px 10px;
}

/* La mappa resta visibile anche dietro il pannello sinistro */
@media (max-width: 900px) {
  .rete-sidebar {
    width: 165px;
    max-height: calc(100vh - 50px);
  }
  .rete-temp-scale__body {
    height: min(62vh, 500px);
    min-height: 360px;
  }
}


/* ===== Correzione 3: niente barra scura verticale ===== */
.rete-sidebar {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  padding: 0 !important;
  overflow: visible !important;
}

/* I singoli gruppi restano leggibili, ma non formano una fascia continua */
.rete-side-nav,
#reteMenu {
  background: rgba(36,48,64,.82);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 2px 9px rgba(0,0,0,.18);
}

#reteMenu {
  margin-top: 8px;
  max-height: calc(100vh - 245px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Colonna/riquadro della scala temperatura più trasparente */
.rete-legend.rete-legend--map {
  background: rgba(255,255,255,.66) !important;
  border-color: rgba(255,255,255,.55) !important;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}


/* ===== Correzione 4: comandi realmente flottanti + legenda più trasparente ===== */

/* Nessun pannello scuro continuo dietro i comandi */
.rete-sidebar,
.rete-side-nav,
#reteMenu {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* La sidebar è solo un contenitore invisibile */
.rete-sidebar {
  padding: 0 !important;
}

/* Navigazione: nessun rettangolo unico dietro ai pulsanti */
.rete-side-nav {
  padding: 0 !important;
  margin: 0 0 8px 0 !important;
  gap: 5px !important;
}

/* I singoli pulsanti restano ben leggibili */
.rete-side-nav__btn {
  box-shadow: 0 1px 5px rgba(0,0,0,.28);
}

/* Menu parametri senza pannello scuro unico */
#reteMenu {
  margin-top: 0 !important;
  padding: 0 !important;
}

/* Le singole categorie non hanno sfondo continuo */
.rete-cat {
  background: transparent !important;
}

/* Manteniamo leggibili titoli e singoli pulsanti sopra la cartografia */
.rete-cat__toggle {
  width: auto !important;
  display: inline-flex !important;
  padding: 3px 7px !important;
  margin: 0 0 4px 0 !important;
  border-radius: 6px !important;
  background: rgba(36,48,64,.78) !important;
  text-shadow: 0 1px 2px rgba(0,0,0,.45);
}

.rete-metric-btn {
  background: rgba(36,48,64,.78) !important;
  box-shadow: 0 1px 4px rgba(0,0,0,.20);
}

.rete-metric-btn:hover,
.rete-metric-btn.is-active {
  background: rgba(18,112,166,.88) !important;
}

/* Scala temperatura: vetro molto più trasparente */
.rete-legend.rete-legend--map {
  background: rgba(255,255,255,.38) !important;
  border-color: rgba(255,255,255,.42) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,.14) !important;
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}


/* ===== Layout definitivo: scala sinistra, simboli destra ===== */
.rete-layout { display:block !important; position:relative !important; }
.rete-sidebar { display:none !important; }
.rete-map-wrap {
  position:relative !important;
  width:100% !important;
  height:calc(100vh - 34px) !important;
}

/* Scala a sinistra */
.rete-legend.rete-legend--map.rete-legend--left {
  left:18px !important;
  right:auto !important;
  top:50% !important;
  transform:translateY(-50%) !important;
  background:rgba(255,255,255,.40) !important;
  border:1px solid rgba(255,255,255,.55) !important;
  border-radius:12px !important;
  padding:11px 10px !important;
  box-shadow:0 2px 10px rgba(0,0,0,.14) !important;
  backdrop-filter:blur(1.5px);
  -webkit-backdrop-filter:blur(1.5px);
}
.rete-temp-scale__body {
  height:min(76vh,680px) !important;
  min-height:520px !important;
}
.rete-temp-scale__bar { width:27px !important; }

/* Barra chiara dei simboli a destra */
.rete-iconbar {
  position:absolute;
  z-index:900;
  top:50%;
  right:16px;
  transform:translateY(-50%);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:7px;
  padding:7px 5px;
  background:rgba(255,255,255,.34);
  border:1px solid rgba(255,255,255,.52);
  border-radius:25px;
  box-shadow:0 2px 10px rgba(0,0,0,.14);
  backdrop-filter:blur(2px);
  -webkit-backdrop-filter:blur(2px);
}
.rete-icon-metrics {
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:7px;
}
.rete-iconbtn {
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:43px;
  height:43px;
  min-width:43px;
  padding:0;
  box-sizing:border-box;
  border:1px solid rgba(30,80,130,.18);
  border-radius:50%;
  background:rgba(255,255,255,.95);
  color:#163d73;
  font:800 18px/1 Arial,sans-serif;
  text-decoration:none;
  cursor:pointer;
  box-shadow:0 2px 7px rgba(0,0,0,.16);
}
.rete-iconbtn:hover,
.rete-iconbtn:focus-visible {
  background:#fff;
  transform:scale(1.05);
}
.rete-iconbtn.is-active {
  color:#0788df;
  border-color:#42aaf0;
  box-shadow:0 0 0 2px rgba(66,170,240,.16),0 2px 7px rgba(0,0,0,.16);
}
.rete-iconbar__sep {
  width:34px;
  height:1px;
  margin:2px 0;
  background:rgba(25,70,110,.24);
}

/* Etichetta al passaggio del mouse */
.rete-iconbtn::before {
  content:attr(data-tip);
  position:absolute;
  right:calc(100% + 10px);
  top:50%;
  transform:translateY(-50%) translateX(4px);
  opacity:0;
  pointer-events:none;
  white-space:nowrap;
  padding:6px 9px;
  border-radius:7px;
  background:rgba(255,255,255,.97);
  color:#17202a;
  border:1px solid rgba(0,0,0,.12);
  box-shadow:0 2px 8px rgba(0,0,0,.16);
  font:700 12px/1.2 Arial,sans-serif;
  transition:opacity .12s ease,transform .12s ease;
}
.rete-iconbtn:hover::before,
.rete-iconbtn:focus-visible::before {
  opacity:1;
  transform:translateY(-50%) translateX(0);
}

.rete-header.rete-header--minimal {
  background:rgba(255,255,255,.76) !important;
  color:#17202a !important;
}
.rete-header--minimal .rete-label { color:#536273 !important; }

@media (max-width:900px) {
  .rete-iconbar { right:8px; gap:5px; }
  .rete-icon-metrics { gap:5px; }
  .rete-iconbtn { width:38px; height:38px; min-width:38px; font-size:16px; }
  .rete-legend.rete-legend--map.rete-legend--left { left:8px !important; }
  .rete-temp-scale__body { min-height:390px !important; height:64vh !important; }
}


/* ===== Scale continue per tutti i parametri ===== */
.rete-scale-wind .rete-temp-scale__bar,
.rete-scale-gust .rete-temp-scale__bar {
  background:linear-gradient(to top,
    rgb(35,100,170) 0%,
    rgb(70,180,200) 25%,
    rgb(120,205,130) 50%,
    rgb(245,225,75) 70%,
    rgb(247,145,45) 85%,
    rgb(195,35,35) 100%) !important;
}

/* Pioggia: bianco -> blu intenso */
.rete-scale-rain .rete-temp-scale__bar {
  background:linear-gradient(to top,
    rgb(255,255,255) 0%,
    rgb(225,242,255) 15%,
    rgb(160,215,245) 35%,
    rgb(85,175,225) 55%,
    rgb(30,115,190) 75%,
    rgb(0,45,120) 100%) !important;
}

.rete-scale-humidity .rete-temp-scale__bar {
  background:linear-gradient(to top,
    rgb(250,245,180) 0%,
    rgb(170,220,180) 35%,
    rgb(75,175,200) 65%,
    rgb(20,75,155) 100%) !important;
}
.rete-scale-pressure .rete-temp-scale__bar {
  background:linear-gradient(to top,
    rgb(55,105,180) 0%,
    rgb(230,235,190) 50%,
    rgb(190,55,45) 100%) !important;
}
.rete-scale-solar .rete-temp-scale__bar {
  background:linear-gradient(to top,
    rgb(245,245,235) 0%,
    rgb(255,230,95) 35%,
    rgb(250,145,45) 70%,
    rgb(190,45,35) 100%) !important;
}
.rete-scale-uv .rete-temp-scale__bar {
  background:linear-gradient(to top,
    rgb(80,180,90) 0%,
    rgb(245,220,65) 30%,
    rgb(245,140,40) 55%,
    rgb(210,45,40) 75%,
    rgb(115,45,150) 100%) !important;
}
.rete-direction-legend {
  width:100px;
  text-align:center;
}
.rete-direction-legend__arrow {
  font-size:42px;
  line-height:1;
  color:#163d73;
  margin:10px 0;
}
.rete-direction-legend__text {
  font-size:11px;
  line-height:1.25;
}


/* ===== Correzione simboli e tooltip barra destra ===== */
.rete-iconbar {
  overflow: visible !important;
}

.rete-icon-metrics {
  overflow: visible !important;
}

.rete-iconbtn {
  overflow: visible !important;
}

.rete-iconbtn__glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1em;
  line-height: 1;
  font-size: 17px;
  font-weight: 800;
}

.rete-iconbtn[data-tip]::before {
  z-index: 99999 !important;
  display: block !important;
  visibility: hidden;
  opacity: 0;
}

.rete-iconbtn[data-tip]:hover::before,
.rete-iconbtn[data-tip]:focus-visible::before {
  visibility: visible !important;
  opacity: 1 !important;
}

/* Tooltip un po' più evidente */
.rete-iconbtn::before {
  background: rgba(255,255,255,.98) !important;
  color: #12263f !important;
  border: 1px solid rgba(18,38,63,.18) !important;
  box-shadow: 0 3px 12px rgba(0,0,0,.22) !important;
}

/* Separazione leggera tra gruppi di parametri */
.rete-iconbar__sep--metric {
  margin: 1px 0 !important;
  opacity: .75;
}

/* Simboli testuali degli estremi leggermente più piccoli */
.rete-metric-icon[data-metric="Tmax"] .rete-iconbtn__glyph,
.rete-metric-icon[data-metric="Tmin"] .rete-iconbtn__glyph,
.rete-metric-icon[data-metric="Hmax"] .rete-iconbtn__glyph,
.rete-metric-icon[data-metric="Wmax"] .rete-iconbtn__glyph,
.rete-metric-icon[data-metric="Gmax"] .rete-iconbtn__glyph,
.rete-metric-icon[data-metric="Rday"] .rete-iconbtn__glyph {
  font-size: 13px;
}

.rete-legend--map.is-empty { display:none !important; }

.rete-logo--text{
  display:grid;
  place-items:center;
  width:80px;
  height:80px;
  border-radius:50%;
  background:#123c69;
  color:#fff;
  font-weight:800;
  font-size:26px;
  letter-spacing:.5px;
  flex:0 0 80px;
}

/* Stato rete compatto sopra la mappa, senza barra superiore */
.rete-map-status{
  position:fixed;
  top:10px;
  right:18px;
  z-index:1200;
  display:flex;
  align-items:center;
  gap:14px;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(255,255,255,.94);
  box-shadow:0 2px 12px rgba(0,0,0,.18);
  color:#263445;
  font-size:13px;
  line-height:1.2;
  backdrop-filter:blur(4px);
}
.rete-map-status strong{color:#5d6a78}
.rete-map-status__btn{
  border:0;
  border-radius:8px;
  padding:8px 11px;
  background:#168bd2;
  color:#fff;
  font-weight:700;
  cursor:pointer;
}
.rete-map-status__btn:hover{filter:brightness(.95)}
@media(max-width:700px){
  .rete-map-status{
    left:50%;
    right:auto;
    transform:translateX(-50%);
    max-width:calc(100vw - 20px);
    gap:8px;
    font-size:11px;
    white-space:nowrap;
  }
  .rete-map-status__btn{padding:6px 8px}
}
