* {
  box-sizing: border-box;
}

:root {
  --bg: #07111f;
  --bg2: #0b1828;
  --panel: rgba(255,255,255,.075);
  --panel2: rgba(255,255,255,.105);
  --border: rgba(255,255,255,.12);
  --text: #ffffff;
  --muted: #9fb3c8;
  --muted2: #6f8197;
  --blue: #3da5ff;
  --cyan: #2ee6e6;
  --red: #ff4d4d;
  --orange: #ffb347;
  --green: #8cffc1;
  --yellow: #ffd166;
  --danger: #ff6b6b;
  --shadow: 0 18px 45px rgba(0,0,0,.28);
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(61,165,255,.18), transparent 34%),
    radial-gradient(circle at top right, rgba(46,230,230,.10), transparent 28%),
    linear-gradient(180deg, #07111f 0%, #081523 55%, #050b14 100%);
  color: var(--text);
}

.site-header {
  max-width: 1320px;
  margin: 0 auto;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(61,165,255,.25), rgba(255,255,255,.08));
  border: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 10px 25px rgba(0,0,0,.25);
}

.brand h1 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -.3px;
}

.brand p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.main-menu {
  display: flex;
  gap: 8px;
  align-items: center;
}

.main-menu a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.main-menu a.active,
.main-menu a:hover {
  color: #fff;
  background: rgba(255,255,255,.10);
  border-color: rgba(255,255,255,.10);
}

.live-badge,
.small-live {
  background: linear-gradient(135deg, #ff3b30, #ff6b5f);
  color: #fff;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 8px 20px rgba(255,59,48,.25);
}

.page {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 22px 42px;
}



.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.75fr 1fr;
  gap: 15px;
  align-items: start;
}

.panel {
  background: linear-gradient(180deg, rgba(255,255,255,.095), rgba(255,255,255,.055));
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.panel-title {
  color: #ffffff;
  font-size: 15px;
  font-weight: bold;
  margin-bottom: 15px;
  letter-spacing: -.1px;
}

.panel-subtitle {
  margin: 16px 0 10px;
  color: #ffffff;
  font-size: 13px;
  font-weight: bold;
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.big-temp {
  font-size: 52px;
  line-height: .95;
  font-weight: 800;
  letter-spacing: -2px;
}

.weather-icon {
  width: 70px;
  height: 70px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,179,71,.25), rgba(61,165,255,.14));
  border: 1px solid rgba(255,255,255,.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
}

.subtext {
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
}

.temp-extreme-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.temp-extreme-cards div {
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 16px;
  padding: 12px;
}

.temp-extreme-cards span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.temp-extreme-cards strong {
  display: block;
  font-size: 18px;
}

.temp-extremes {
  display: flex;
  gap: 12px;
  margin: 7px 0;
  font-size: 13px;
  color: var(--muted);
}

.temp-extremes strong {
  color: #fff;
}
.mini-data-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mini-data-grid div,
.rain-grid div,
.comfort-grid div {
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 16px;
  padding: 12px;
}

.mini-data-grid span,
.rain-grid span,
.comfort-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 7px;
}

.mini-data-grid strong,
.rain-grid strong,
.comfort-grid strong {
  display: block;
  font-size: 16px;
  color: #fff;
}

.webcam-panel {
  min-height: 100%;
}

.webcam-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.main-webcam {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  height: 430px;
  border: 1px solid rgba(255,255,255,.10);
}

.main-webcam img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}

.webcam-caption {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  background: rgba(0,0,0,.52);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(8px);
}

.webcam-caption span {
  color: #dce8f5;
  font-size: 13px;
}

.webcam-caption strong {
  font-size: 13px;
}

.cam-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.cam-grid-inside {
  margin-top: 14px;
}

.cam-grid img {
  width: 100%;
  height: 118px;
  object-fit: cover;
  background: #000;
  border-radius: 18px;
  cursor: pointer;
  opacity: .9;
  border: 1px solid rgba(255,255,255,.12);
  transition: opacity .2s ease, transform .2s ease, border-color .2s ease;
}

.cam-grid img:hover {
  opacity: 1;
  transform: translateY(-2px);
  border-color: rgba(61,165,255,.40);
}

.side-panel {
  display: flex;
  flex-direction: column;
}

.pm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 12px;
}

.pm-grid div {
  background: rgba(0,0,0,.20);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 12px 8px;
  text-align: center;
}

.pm-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.pm-grid strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
}

.pm-grid small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.aqi-box {
  background: linear-gradient(135deg, rgba(30,180,120,.30), rgba(255,255,255,.075));
  border: 1px solid rgba(140,255,193,.25);
  border-radius: 20px;
  padding: 17px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.aqi-box span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.aqi-box strong {
  display: block;
  font-size: 44px;
  line-height: 1;
  margin-top: 5px;
}

.aqi-box small {
  display: block;
  margin-top: 6px;
  color: #9fffcf;
  font-size: 13px;
}

.smile {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(140,255,193,.15);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
}

.comfort-grid,
.rain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.air-good {
  color: var(--green) !important;
}

.air-medium {
  color: var(--yellow) !important;
}

.air-bad {
  color: var(--danger) !important;
}

.info-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.info-strip div {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}

.info-strip strong {
  color: #fff;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.8fr 1fr;
  gap: 14px;
  align-items: start;
}

.realtime-panel {
  height: auto;
}

.air-panel {
  height: auto;
}
.home-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  margin-top: 16px;
}

.chart-small-card {
  height: 305px;
  min-height: 305px;
  padding: 16px;
  overflow: hidden;
}

.chart-small-card .panel-title {
  margin-bottom: 10px;
  font-size: 14px;
}

.chart-small-card canvas {
  display: block;
  width: 100% !important;
  height: 232px !important;
  max-height: 232px !important;
}

.more-charts {
  text-align: right;
  margin: 15px 0 0;
  font-size: 14px;
}

.more-charts a {
  color: #7fd0ff;
  text-decoration: none;
  font-weight: bold;
}

.more-charts a:hover {
  text-decoration: underline;
}

.footer {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 22px 28px;
  color: var(--muted2);
  font-size: 12px;
}

.small-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 14px;
}

.data-card {
  background: rgba(255,255,255,.075);
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 18px;
  padding: 16px;
}

.data-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.data-card strong {
  display: block;
  margin-top: 10px;
  font-size: 22px;
}

.charts-row {
  margin-top: 14px;
}

.chart-home-card {
  height: 310px;
}

.chart-home-card canvas {
  width: 100% !important;
  height: 250px !important;
}

@media (max-width: 1150px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .main-webcam {
    height: 390px;
  }

  .top-status-bar {
    grid-template-columns: repeat(3, 1fr);
  }

  .site-header {
    flex-wrap: wrap;
  }

  .main-menu {
    order: 3;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }
}

@media (max-width: 850px) {
  .home-charts-grid {
    grid-template-columns: 1fr;
  }

  .chart-small-card {
    height: 292px;
    min-height: 292px;
  }

  .chart-small-card canvas {
    height: 220px !important;
    max-height: 220px !important;
  }

  .top-status-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .info-strip {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .small-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .site-header {
    padding: 15px;
  }

  .page {
    padding: 0 14px 30px;
  }

  .brand h1 {
    font-size: 20px;
  }

  .brand p {
    font-size: 12px;
  }

  .live-badge {
    display: none;
  }

  .top-status-bar {
    grid-template-columns: 1fr;
  }

  .top-status-bar div {
    min-height: auto;
  }

  .panel {
    padding: 15px;
    border-radius: 20px;
  }

  .big-temp {
    font-size: 44px;
  }

  .weather-icon {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    font-size: 32px;
  }

  .temp-extreme-cards,
  .mini-data-grid,
  .comfort-grid,
  .rain-grid,
  .pm-grid {
    grid-template-columns: 1fr;
  }

  .main-webcam {
    height: 260px;
  }

  .cam-grid {
    grid-template-columns: 1fr;
  }

  .cam-grid img {
    height: 145px;
  }

  .info-strip {
    grid-template-columns: 1fr;
  }

  .small-cards {
    grid-template-columns: 1fr;
  }

  .chart-small-card {
    height: 280px;
    min-height: 280px;
  }

  .chart-small-card canvas {
    height: 210px !important;
    max-height: 210px !important;
  }

  .more-charts {
    text-align: center;
  }
}
.live-maps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 16px;
}

.live-map-card {
  height: 305px;
  padding: 16px;
  overflow: hidden;
}

.live-map-card iframe {
  width: 100%;
  height: 235px;
  border: 0;
  border-radius: 16px;
  background: #000;
}

@media (max-width: 850px) {
  .live-maps-grid {
    grid-template-columns: 1fr;
  }

  .live-map-card {
    height: 300px;
  }

  .live-map-card iframe {
    height: 230px;
  }
.ilmeteo-banner{
    margin-top:18px;
    text-align:center;
}

.ilmeteo-box{
    display:flex;
    justify-content:center;
    align-items:center;
    overflow:auto;
}

.ilmeteo-box iframe{
    border:0;
    border-radius:18px;
    box-shadow:0 8px 25px rgba(0,0,0,.25);
}
}
.ilmeteo-banner{
    margin-top:20px;
    padding:20px;
}

.ilmeteo-banner .panel-title{
    text-align:center;
    margin-bottom:18px;
}

.ilmeteo-box{
    display:flex;
    justify-content:center;
    align-items:center;
}

.ilmeteo-box iframe{
    border:0;
    border-radius:18px;
    overflow:hidden;
    box-shadow:0 10px 30px rgba(0,0,0,.30);
.mini-extreme{
    display:block;
    margin-top:4px;
    font-size:11px;
    font-weight:600;
}

.min-value{
    color:#2196f3;
}

.max-value{
    color:#e53935;
}
}
.min-value,
.min-value b{
    color:#2196f3 !important;
}

.max-value,
.max-value b{
    color:#e53935 !important;
}

.single-max,
.single-max b{
    color:#e53935 !important;
}
/* ===== MENU STAZIONI ===== */

.menu-dropdown{
    position:relative;
    display:inline-block;
}

.menu-dropdown > a{
    cursor:pointer;
}

.menu-dropdown-content{
    display:none;
    position:absolute;
    top:100%;
    left:0;
    min-width:220px;
    background:#ffffff;
    border-radius:12px;
    overflow:hidden;
    box-shadow:0 8px 25px rgba(0,0,0,.18);
    z-index:9999;
}

.menu-dropdown-content a{
    display:block;
    padding:12px 16px;
    color:#222 !important;
    text-decoration:none;
    font-weight:600;
    transition:.2s;
}

.menu-dropdown-content a:hover{
    background:#0b74c9;
    color:#fff !important;
}

.menu-dropdown:hover .menu-dropdown-content{
    display:block;
}