/* Weather Sicily — anteprima home v2 (dark + light). Prototipo, non tocca la home live. */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root[data-theme="dark"] {
  --bg: #07152b;
  --bg-grad: radial-gradient(120% 80% at 50% -10%, #16386b 0%, #0c2247 38%, #07152b 78%);
  --hero-grad: linear-gradient(160deg, rgba(28,72,130,.55), rgba(8,26,52,.20));
  --text: #f2f6ff;
  --text-dim: rgba(226,236,255,.60);
  --text-faint: rgba(226,236,255,.40);
  --card: rgba(255,255,255,.055);
  --card-2: rgba(255,255,255,.085);
  --card-border: rgba(255,255,255,.10);
  --hairline: rgba(255,255,255,.09);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --hot: #ff9f1c; --cold: #4aa3ff; --good: #36c46b; --warn: #ffb02e; --bad: #ff5a5f;
  --chip: rgba(255,255,255,.07);
  --tab-bg: rgba(8,22,44,.86);
}
:root[data-theme="light"] {
  --bg: #eaf1fb;
  --bg-grad: radial-gradient(120% 80% at 50% -10%, #dbe8fb 0%, #eaf1fb 60%);
  --hero-grad: linear-gradient(160deg, rgba(38,98,170,.16), rgba(255,255,255,.05));
  --text: #102844;
  --text-dim: rgba(16,40,68,.68);
  --text-faint: rgba(16,40,68,.66);
  --card: #ffffff;
  --card-2: #f4f8ff;
  --card-border: rgba(16,40,68,.08);
  --hairline: rgba(16,40,68,.10);
  --shadow: 0 8px 22px rgba(31,69,128,.10);
  --hot: #b65300; --cold: #1768b3; --good: #187e47; --warn: #9a5d00; --bad: #c1323b;
  --chip: rgba(16,40,68,.05);
  --tab-bg: rgba(255,255,255,.92);
}

html, body { background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Open Sans", Roboto, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
.app {
  max-width: 480px; margin: 0 auto; min-height: 100vh;
  background: var(--bg-grad); background-attachment: fixed;
  padding: 0 14px calc(78px + env(safe-area-inset-bottom)); position: relative;
}
.loading { padding: 34vh 0; text-align: center; color: var(--text-dim); }
.loading-logo { height: 92px; width: auto; margin-bottom: 20px; transform-origin: center;
  animation: splashLogo 1.25s cubic-bezier(.22,.61,.36,1) both, splashPulse 2.2s ease-in-out .75s infinite; }
@keyframes splashLogo { from { opacity: 0; transform: scale(.78) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes splashPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ---------- Header ---------- */
.hdr { display: flex; align-items: center; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 4px 10px; }
.hdr-loc { flex: 1; text-align: center; line-height: 1.15; }
.hdr-spacer { flex: 0 0 38px; width: 38px; }
.hdr-loc .name { font-weight: 700; font-size: 17px; display: inline-flex; align-items: center; justify-content: center; }
/* Pill "tocca per cercare": rende evidente che l'header è un selettore di località */
.loc-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 12px;
  border-radius: 999px; background: var(--chip); border: 1px solid var(--card-border);
  transition: transform .16s ease, background .16s ease, border-color .16s ease, box-shadow .16s ease; }
.hdr-loc .name .mi { width: 16px; height: 16px; color: var(--cold); flex: 0 0 auto; }
.loc-nm { max-width: 58vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hdr-loc .name .chev { width: 14px; height: 14px; opacity: .5; margin-left: 1px; flex: 0 0 auto; }
.loc-mag { width: 13px; height: 13px; opacity: .55; margin-left: -2px; flex: 0 0 auto; }
.hdr-loc:hover .loc-pill { border-color: var(--cold); background: var(--card-2); }
.hdr-loc:active .loc-pill { transform: scale(.97); background: var(--card-2); }
.hdr-loc:hover .loc-pill .chev, .hdr-loc:hover .loc-pill .loc-mag { opacity: .8; }
.hdr-loc .sub { font-size: 11.5px; color: var(--text-dim); margin-top: 3px; }
.loc-hint { color: var(--cold); font-weight: 600; opacity: .9; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--chip); color: var(--text);
  display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Hero ---------- */
.hero { position: relative; border-radius: 22px; overflow: hidden; padding: 18px 18px 16px; margin-top: 4px;
  background: var(--hero-grad), var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow); }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center bottom; opacity: .13;
  -webkit-mask-image: linear-gradient(90deg, transparent 18%, #000 75%); mask-image: linear-gradient(90deg, transparent 18%, #000 75%); }
.hero-row { position: relative; display: flex; align-items: center; justify-content: center; gap: clamp(4px, 2vw, 10px); }
.hero-row > * { flex: 1 1 0; min-width: 0; text-align: center; }
.hero-temp { font-weight: 800; font-size: 64px; line-height: .9; letter-spacing: -1.5px; }
.hero-temp .dec { font-size: 30px; vertical-align: top; }
.hero-temp .u { font-size: 24px; color: var(--text-dim); font-weight: 700; }
.hero-feel { color: var(--text-dim); font-size: 13.5px; margin-top: 8px; }
.hero-mm { margin-top: 8px; font-size: 14.5px; font-weight: 700; }
.hero-mm .min { color: var(--cold); } .hero-mm .sep { color: var(--text-faint); margin: 0 8px; } .hero-mm .max { color: var(--hot); }
.hero-mm2 { display: flex; flex-direction: column; align-items: center; align-self: center; justify-content: center; gap: 2px; }
.hmm-col { display: flex; flex-direction: column; align-items: center; text-align: center; }
.hmm-l { font-size: clamp(10px, 3vw, 12.5px); font-weight: 800; letter-spacing: .4px; }
.hmm-v { font-size: clamp(30px, 9vw, 46px); font-weight: 800; line-height: .92; letter-spacing: -1.5px; margin-top: 3px; }
.hmm-min { color: var(--cold); } .hmm-max { color: var(--hot); }
.hmm-div { display: none; }
.hero-ico { width: clamp(64px, 20vw, 96px); height: clamp(64px, 20vw, 96px); object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.30)); }
.hero-cond { position: relative; text-align: center; color: var(--text-dim); font-size: 13px; margin-top: -6px; }
.hero-gauge { position: relative; min-width: clamp(76px, 22vw, 96px); }
.gauge { width: clamp(76px, 22vw, 96px); height: auto; }
.gauge-cap { text-align: center; font-size: clamp(9.5px, 2.6vw, 11px); color: var(--text-dim); margin-top: 2px; }
.gauge-val { text-align: center; font-weight: 800; font-size: clamp(15px, 4.4vw, 18px); color: var(--good); }

/* ---------- Metric row ---------- */
.metrics { display: flex; margin-top: 12px; background: var(--card); border: 1px solid var(--card-border);
  border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.metric { flex: 1; padding: 11px 6px; text-align: center; border-right: 1px solid var(--hairline); }
.metric:last-child { border-right: 0; }
.metric .mi { width: 20px; height: 20px; margin: 0 auto 5px; display: block; color: var(--text); opacity: .9; }
.metric .ml { font-size: 11px; color: var(--text-dim); }
.metric .mv { font-size: 13.5px; font-weight: 700; margin-top: 1px; }
.metric .ms { font-size: 10.5px; color: var(--text-faint); }

/* ---------- Section card ---------- */
.sec { margin-top: 14px; background: var(--card); border: 1px solid var(--card-border); border-radius: 20px;
  box-shadow: var(--shadow); padding: 14px; }
.sec-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sec-h .t { font-size: 13px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--text); }
.sec-h .more { font-size: 12.5px; color: var(--cold); font-weight: 600; display: inline-flex; align-items: center; gap: 2px; }

/* ---------- Hourly ---------- */
.hours { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hours::-webkit-scrollbar { display: none; }
.hour { min-width: 58px; text-align: center; padding: 4px 2px; border-radius: 14px; position: relative; }
.hour.now { background: var(--card-2); }
.hour .hh { font-size: 12px; color: var(--text-dim); font-weight: 600; }
.hour.now .hh { color: var(--cold); }
.hour .hi { width: 34px; height: 34px; object-fit: contain; margin: 4px auto 2px; display: block; }
.hour .ht { font-size: 15px; font-weight: 800; }
.hour.peak .ht { color: var(--hot); }
.hour .hr { font-size: 10.5px; color: var(--text-faint); margin-top: 6px; line-height: 1.25; }
.hour .hr b { color: var(--cold); font-weight: 700; }
.hour .hw { font-size: 10px; color: var(--text-dim); margin-top: 4px; }
.hour .hw .wv { font-weight: 700; color: var(--text); }
.sparkline { display: block; width: 100%; height: 26px; margin: 2px 0 0; }

/* ---------- Mini cards (luna/santo/alba/uv) ---------- */
.minis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mini { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 11px 12px;
  box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; min-height: 70px; }
.mini .mimg { width: 38px; height: 38px; border-radius: 50%; flex: none; object-fit: cover; background: var(--chip); }
.mini .mco { width: 38px; height: 38px; flex: none; display: grid; place-items: center; color: var(--text); }
.mini .mco svg { width: 26px; height: 26px; }
.mini .mt { font-size: 11px; color: var(--text-dim); }
.mini .mb { font-size: 14px; font-weight: 700; line-height: 1.15; }
.mini .msub { font-size: 10.5px; color: var(--text-faint); }
.mini.sun .rowx { display: flex; gap: 14px; }
.mini.sun .rowx span { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 14px; }
.mini.sun svg { width: 16px; height: 16px; color: var(--hot); }
.uvbar { height: 5px; border-radius: 3px; margin-top: 6px; background: linear-gradient(90deg,#36c46b,#ffd23f,#ff9f1c,#ff5a5f,#9b59b6); position: relative; }
.uvbar .dot { position: absolute; top: -2px; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px rgba(0,0,0,.2); transform: translateX(-50%); }

/* ---------- Indici grid ---------- */
.idx-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 6px; }
.idx { text-align: center; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.idx:active { transform: scale(.95); }
.idx-sheet { display: flex; align-items: center; gap: 14px; padding: 6px 2px 12px; }
.idx-sheet .ib { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 48px; }
.idx-sheet .ib svg { width: 26px; height: 26px; }
.idx-sheet-v { font-size: 22px; font-weight: 800; }
.idx-all { display: flex; flex-direction: column; gap: 12px; }
.idx-all-row { display: flex; align-items: center; gap: 12px; }
.idx-all-row .ib { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 40px; }
.idx-all-row .ib svg { width: 21px; height: 21px; }
.idx-all-info { flex: 1; min-width: 0; } .idx-all-info b { display: block; font-size: 14px; } .idx-all-info span { font-size: 12px; color: var(--text-dim); line-height: 1.3; }
.idx-all-v { font-weight: 700; font-size: 14px; }
.idx .ib { width: 50px; height: 50px; border-radius: 50%; margin: 0 auto 6px; display: grid; place-items: center;
  color: #fff; box-shadow: 0 6px 14px rgba(0,0,0,.22); }
.idx .ib svg { width: 26px; height: 26px; }
.idx .il { font-size: 12.5px; font-weight: 700; }
.idx .iv { font-size: 11px; color: var(--text-dim); }

/* ---------- Accuracy ---------- */
.acc { display: flex; align-items: center; gap: 12px; margin-top: 14px; background: var(--card);
  border: 1px solid var(--card-border); border-radius: 18px; box-shadow: var(--shadow); padding: 12px 14px; }
.acc .ac-ic { width: 30px; height: 30px; flex: none; color: var(--bad); }
.acc .ac-tx { flex: 1; }
.acc .ac-tx .t { font-weight: 800; font-size: 13.5px; }
.acc .ac-tx .s { font-size: 11.5px; color: var(--text-dim); }
.acc .ac-vals { display: flex; gap: 14px; }
.acc .av { text-align: center; }
.acc .av .k { font-size: 10px; color: var(--text-dim); }
.acc .av .n { font-size: 13.5px; font-weight: 800; }

/* ---------- Bottom tab bar ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: flex; max-width: 480px; margin: 0 auto;
  background: var(--tab-bg); backdrop-filter: saturate(140%) blur(14px); -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--card-border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
.tab { flex: 1; border: 0; background: transparent; font: inherit; text-align: center; color: var(--text-faint); font-size: 10.5px; cursor: pointer; }
.tab svg { width: 23px; height: 23px; display: block; margin: 0 auto 2px; }
.tab.active { color: var(--cold); }
.tab-ico { position: relative; display: block; width: 23px; margin: 0 auto 2px; }
.tab-ico svg { margin: 0; }
.tab-badge { position: absolute; top: -1px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 1.5px solid var(--tab-bg); }

/* approfondimenti */
.appro { margin-top: 16px; }
.sec-h2 { margin: 6px 4px 10px; }
.sec-h2 .t { font-size: 13px; font-weight: 800; letter-spacing: .6px; text-transform: uppercase; color: var(--text); }
.acard { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; box-shadow: var(--shadow);
  padding: 13px 15px; margin-bottom: 10px; }
.ac-t { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700; }
.ac-i { width: 22px; height: 22px; flex: none; color: var(--text); opacity: .85; display: inline-grid; place-items: center; }
.ac-i svg { width: 22px; height: 22px; }
.ac-b { font-size: 13px; color: var(--text-dim); margin-top: 5px; line-height: 1.45; }
.ac-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 7px; line-height: 1.4; }
.ac-img { width: 100%; border-radius: 12px; margin-top: 10px; display: block; }
.ac-vid { width: 100%; border-radius: 12px; margin-top: 10px; display: block; background: #000; }
.ac-aud { width: 100%; margin-top: 10px; height: 38px; }

/* header location button + chevron */
.hdr-loc { background: none; border: 0; color: inherit; cursor: pointer; font: inherit; }
.chev { width: 15px; height: 15px; opacity: .55; }

/* day tabs */
.daytabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 8px 2px 2px; }
.daytabs::-webkit-scrollbar { display: none; }
.dt { flex: none; border: 1px solid var(--card-border); background: var(--card); color: var(--text-dim);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; }
.dt.on { background: var(--cold); border-color: var(--cold); color: #fff; }

/* switcher località */
.sw-ov { position: fixed; inset: 0; z-index: 50; background: rgba(4,12,26,.55); backdrop-filter: blur(3px);
  display: flex; align-items: flex-end; }
.sw { width: 100%; max-width: 480px; margin: 0 auto; max-height: 86vh; background: var(--bg); background-image: var(--bg-grad);
  border-radius: 22px 22px 0 0; border: 1px solid var(--card-border); display: flex; flex-direction: column;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom)); animation: slideUp .28s ease both; }
@keyframes slideUp { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.sw-bar { display: flex; gap: 8px; align-items: center; }
.sw-input { flex: 1; border: 1px solid var(--card-border); background: var(--card); color: var(--text);
  border-radius: 14px; padding: 12px 14px; font-size: 15px; outline: none; }
.sw-x { width: 40px; height: 40px; border: 0; background: var(--chip); color: var(--text); border-radius: 12px; font-size: 22px; cursor: pointer; }
.sw-gps { margin-top: 10px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--card-border); background: var(--card); color: var(--cold); border-radius: 14px; padding: 11px; font-weight: 600; font-size: 14px; cursor: pointer; }
.sw-gps svg { width: 18px; height: 18px; }
.sw-list { margin-top: 10px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sw-row { display: flex; align-items: center; gap: 10px; padding: 11px 6px; border-bottom: 1px solid var(--hairline); cursor: pointer; }
.sw-info { flex: 1; } .sw-n { font-weight: 600; font-size: 15px; } .sw-p { font-size: 12px; color: var(--text-dim); }
.sw-fav { border: 0; background: none; color: var(--text-faint); cursor: pointer; padding: 6px; }
.sw-fav svg { width: 20px; height: 20px; } .sw-fav.on { color: var(--warn); } .sw-fav.on svg path { fill: var(--warn); }
.sw-empty { padding: 24px; text-align: center; color: var(--text-dim); }

/* overlay iframe fullscreen (Maps / Clima / ecc.) */
.fr-ov { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column; }
.fr-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: var(--tab-bg); color: var(--text);
  font-weight: 700; border-bottom: 1px solid var(--card-border); }
.fr-if { flex: 1; border: 0; width: 100%; }

/* sheet segnalazioni / notifiche / altro */
.sh-h { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 800; padding: 4px 2px 6px; }
.sh-msg { color: var(--text-dim); font-size: 13.5px; padding: 4px 2px 10px; line-height: 1.4; }
.rep-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.rep-b { flex: 1 1 30%; border: 1px solid var(--card-border); background: var(--card); color: var(--text);
  border-radius: 14px; padding: 13px 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.rep-b.on { background: var(--cold); border-color: var(--cold); color: #fff; }
.rep-b:disabled { opacity: .55; }
.rep-link { display: block; margin-top: 12px; color: var(--cold); font-size: 13.5px; font-weight: 600; text-decoration: none; text-align: center; }
.menu { display: flex; flex-direction: column; }
.menu-i { display: flex; align-items: center; justify-content: space-between; border: 0; border-bottom: 1px solid var(--hairline);
  background: none; color: var(--text); font: inherit; font-size: 15px; font-weight: 600; padding: 15px 4px; cursor: pointer; text-align: left; }
.menu-i .chev { transform: rotate(-90deg); opacity: .5; display: inline-grid; }
.menu-i .chev svg { width: 16px; height: 16px; }

.fade-in { animation: fadeIn .5s cubic-bezier(.22,.61,.36,1) both; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* cascata elegante delle sezioni della Home */
.hero.fade-in { animation-delay: .04s; }
.metrics.fade-in { animation-delay: .10s; }
.sec.fade-in { animation-delay: .16s; }
.minis.fade-in { animation-delay: .22s; }
.acc.fade-in { animation-delay: .30s; }
.appro.fade-in { animation-delay: .36s; }

/* ===== Motion polish: eleganza (solo transform/opacity, GPU) ===== */
/* logo header: entrata soffice */
@keyframes logoIn { from { opacity: 0; transform: translateY(-5px) scale(.9); } to { opacity: 1; transform: none; } }
.hdr-logo { animation: logoIn .55s cubic-bezier(.22,.61,.36,1) both; transition: transform .18s ease; }
.hdr-logo:active { transform: scale(.94); }
/* icona hero: pop con leggero overshoot */
@keyframes heroIcoIn { from { opacity: 0; transform: scale(.8); } to { opacity: 1; transform: none; } }
.hero-ico { animation: heroIcoIn .6s cubic-bezier(.34,1.56,.64,1) .14s both; }
/* numeri min/max e attendibilità: salgono con la hero */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hero-mm2 { animation: rise .5s cubic-bezier(.22,.61,.36,1) .1s both; }
.hero-gauge { animation: rise .5s cubic-bezier(.22,.61,.36,1) .18s both; }
/* linguette giorno: transizione fluida di stato + pressione */
.dt { transition: background .22s ease, border-color .22s ease, color .22s ease, transform .12s ease; }
.dt:active { transform: scale(.94); }
.dt.on { box-shadow: 0 4px 14px rgba(47,127,214,.35); }
/* barra inferiore: colore fluido + micro-pop dell'icona attiva */
.tab { transition: color .22s ease, transform .14s ease; }
.tab:active { transform: scale(.9); }
.tab-ico { transition: transform .28s cubic-bezier(.34,1.56,.64,1); }
.tab.active .tab-ico { transform: translateY(-1px) scale(1.12); }
/* card metriche: icona che reagisce al tocco */
.metric .mi { transition: transform .18s ease, opacity .18s ease; }
.metric:active .mi { transform: scale(1.15); opacity: 1; }
/* voci del menu: chevron che scorre al passaggio/tocco */
.drw-i .drw-chev, .menu-i .chev { transition: transform .2s ease, opacity .2s ease; }
.drw-i:active .drw-chev { transform: rotate(-90deg) translateY(2px); opacity: .7; }
/* rispetto delle preferenze di accessibilità */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0s !important; transition-duration: .001ms !important; }
}

/* ===== DRAWER laterale Material (replica menu nativo) ===== */
.drw-ov { position: fixed; inset: 0; z-index: 70; background: rgba(4,12,26,0); backdrop-filter: blur(0);
  transition: background .26s ease, backdrop-filter .26s ease; }
.drw-ov.open { background: rgba(4,12,26,.55); backdrop-filter: blur(3px); }
.drw { position: absolute; left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: 480px; margin: 0 auto;
  height: 90vh; max-height: 90vh; overflow: hidden;
  background: var(--bg); background-image: var(--bg-grad); border-top: 1px solid var(--card-border);
  border-radius: 22px 22px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transform: translateY(103%); transition: transform .36s cubic-bezier(.22,.61,.36,1); }
.drw-ov.open .drw { transform: none; }
/* menù laterale (impostazione utente: Menù · A lato) */
.drw-ov.side .drw { left: 0; right: auto; top: 0; bottom: 0; margin: 0; width: 86%; max-width: 350px;
  height: 100%; max-height: 100%; border-top: 0; border-right: 1px solid var(--card-border);
  border-radius: 0 20px 20px 0; padding-top: env(safe-area-inset-top);
  transform: translateX(-102%); transition: transform .34s cubic-bezier(.22,.61,.36,1); }
.drw-ov.side.open .drw { transform: none; }
.drw-ov.side .drw-grip { display: none; }
/* posizione tasto Menù secondo l'impostazione: a lato = hamburger nell'header; in basso = voce nella tabbar */
:root[data-menu="side"] .tabbar .tab[data-tab="menu"] { display: none; }
:root[data-menu="bottom"] #menuBtn { visibility: hidden; pointer-events: none; }
/* voce flagship WS Cam in evidenza */
.drw-hero { background: var(--chip); border-radius: 12px; margin: 2px 0 6px; }
.drw-hero .drw-ic { color: var(--cold); }
.drw-hero .drw-t { font-weight: 700; }
.drw-hero-tag { display: inline-block; margin-left: 8px; font-size: 10px; font-weight: 700; font-style: normal;
  letter-spacing: .4px; text-transform: uppercase; color: #fff; background: var(--bad); padding: 2px 7px; border-radius: 999px; vertical-align: 1px; }
.drw-grip { width: 40px; height: 4.5px; border-radius: 3px; background: var(--text-faint); opacity: .45;
  margin: 8px auto 2px; flex: 0 0 auto; }
.drw-hd { position: relative; padding: 8px 16px 14px;
  border-bottom: 1px solid var(--hairline); background: var(--hero-grad); }
.drw-brand { font-size: 20px; font-weight: 700; letter-spacing: -.3px; color: var(--text); }
.drw-brand b { font-weight: 800; color: var(--cold); }
.drw-loc { margin-top: 6px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-dim); }
.drw-loc .mi { width: 15px; height: 15px; color: var(--cold); }
.drw-x { position: absolute; top: 10px; right: 12px; }
.drw-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 8px 10px calc(16px + env(safe-area-inset-bottom)); }
.drw-sec { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
  color: var(--text-faint); padding: 14px 8px 5px; }
.drw-i { width: 100%; display: flex; align-items: center; gap: 13px; padding: 11px 8px; border: 0; background: none;
  color: var(--text); font-size: 15px; text-align: left; cursor: pointer; border-radius: 12px; }
.drw-i:hover, .drw-i:active { background: var(--chip); }
.drw-ic { width: 22px; height: 22px; flex: 0 0 22px; color: var(--text-dim); }
.drw-t { flex: 1; }
.drw-chev { opacity: .35; transform: rotate(-90deg); display: inline-grid; }
.drw-chev svg { width: 15px; height: 15px; }
.drw-ext { opacity: .5; display: inline-grid; } .drw-ext svg { width: 16px; height: 16px; }
.drw-social { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 8px; }
.drw-social a { font-size: 12px; color: var(--cold); text-decoration: none; padding: 6px 11px;
  border: 1px solid var(--card-border); border-radius: 999px; background: var(--card); }
.drw-ver { margin: 16px 8px 4px; font-size: 11px; color: var(--text-faint); }

/* pannelli dati (news / sismi / community) */
.sw.sw-tall { max-height: 88vh; }
.feed { margin-top: 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.feed-i { display: flex; gap: 11px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--hairline);
  text-decoration: none; color: var(--text); }
.feed-img { width: 66px; height: 50px; object-fit: cover; border-radius: 10px; flex: 0 0 66px; background: var(--chip); }
.feed-b { flex: 1; min-width: 0; }
.feed-t { font-size: 14px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-d { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.qk-mag { width: 42px; height: 42px; flex: 0 0 42px; display: grid; place-items: center; border-radius: 11px;
  background: var(--chip); color: var(--bad); font-weight: 800; font-size: 15px; }
.seis-etna { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 14px; margin: 6px 0 4px;
  background: var(--card); border: 1px solid var(--card-border); }
.seis-etna .mi { width: 26px; height: 26px; }
.seis-etna b { display: block; font-size: 14px; } .seis-etna span { font-size: 12px; color: var(--text-dim); }
.seis-etna.good .mi { color: var(--good); } .seis-etna.warn .mi { color: var(--warn); } .seis-etna.bad .mi { color: var(--bad); }

/* impostazioni */
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 6px; border-bottom: 1px solid var(--hairline); font-size: 15px; }
.seg { display: inline-flex; background: var(--chip); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: none; color: var(--text-dim); font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ===== pannelli NATIVI full-screen ===== */
.pnl-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px; }
.pnl-list { display: flex; flex-direction: column; gap: 10px; }
.pnl-search { width: 100%; box-sizing: border-box; border: 1px solid var(--card-border); background: var(--card);
  color: var(--text); border-radius: 13px; padding: 12px 14px; font-size: 15px; outline: none; margin-bottom: 12px; }
.st-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 13px 14px; }
.st-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.st-top b { font-size: 15px; } .st-dist { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.st-metrics { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 8px; font-size: 14px; color: var(--text-dim); align-items: center; }
.st-metrics .mi { width: 16px; height: 16px; vertical-align: -3px; margin-right: 3px; }
.st-temp { font-weight: 800; font-size: 20px; }
.st-sub { margin-top: 7px; font-size: 12px; color: var(--text-faint); }
.st-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 11px 13px; cursor: pointer; text-align: left; color: var(--text); }
.st-rl b { font-size: 14px; display: block; } .st-rl span { font-size: 12px; color: var(--text-dim); }
.st-rr { text-align: right; } .st-rr .st-temp { font-size: 18px; display: block; } .st-rg { font-size: 11px; color: var(--text-faint); }
.st-hero { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 16px; }
.st-hero-t { font-size: 44px; font-weight: 800; line-height: 1; } .st-hero b { font-size: 16px; display: block; } .st-hero span { font-size: 12px; color: var(--text-dim); }
.kv { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; overflow: hidden; }
.kv-r { display: flex; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--hairline); font-size: 14px; }
.kv-r:last-child { border-bottom: 0; } .kv-r span { color: var(--text-dim); } .kv-r b { color: var(--text); }
/* webcam grid */
.wc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.wc-card { position: relative; background: var(--card); border: 1px solid var(--card-border); border-radius: 15px; overflow: hidden; text-decoration: none; color: var(--text); }
.wc-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; background: var(--chip); }
.wc-noimg { display: grid; place-items: center; color: var(--text-faint); } .wc-noimg svg { width: 36px; height: 36px; }
.wc-cap { padding: 8px 10px; } .wc-cap b { font-size: 13px; display: block; line-height: 1.2; }
.wc-cap span { font-size: 11px; color: var(--text-dim); }
.wc-badge { position: absolute; top: 8px; left: 8px; font-size: 10px; font-weight: 700; padding: 3px 7px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; }
.wc-badge.on { color: #4ade80; } .wc-vis { position: absolute; top: 8px; right: 8px; font-size: 10px; padding: 3px 7px; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff; }
/* clima */
.cl-card { background: var(--card); border: 1px solid var(--card-border); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.cl-h { font-size: 14px; font-weight: 700; margin-bottom: 10px; }
.cl-rec { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.cl-rec .rec { font-size: 13px; color: var(--text-dim); } .cl-rec .rec b { color: var(--text); margin: 0 4px; } .cl-rec .rec span { font-size: 11px; color: var(--text-faint); }
/* chart */
.chart-wrap { height: 380px; position: relative; }

/* ===== controlli select/segment (usati dallo Spaghetti) ===== */
.mv-ctrls { display: flex; gap: 8px; padding: 12px 14px 8px; flex-wrap: wrap; align-items: center; }
.mv-sel { flex: 1; min-width: 160px; border: 1px solid var(--card-border); background: var(--card); color: var(--text);
  border-radius: 12px; padding: 10px 12px; font-size: 14px; outline: none; }
.mv-zone { display: inline-flex; background: var(--chip); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.mv-zone button { border: 0; background: none; color: var(--text-dim); font-size: 12px; font-weight: 600; padding: 7px 10px; border-radius: 9px; cursor: pointer; }
.mv-zone button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }

/* ===== clima sicilia: warming stripes ===== */
.stripes { display: flex; height: 64px; border-radius: 10px; overflow: hidden; margin: 4px 0 10px; }
.stripe { flex: 1 1 0; min-width: 0; }
.cl-big { font-size: 24px; font-weight: 800; color: var(--hot); }
.cl-big small { font-size: 12px; font-weight: 500; color: var(--text-dim); display: block; margin-top: 2px; }
.kv-r small { color: var(--text-faint); font-weight: 500; }

/* dettaglio ora (popup) + vista oraria completa */
.hour { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hour:active { transform: scale(.96); }
.sec-h .more { border: 0; background: none; color: var(--cold); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }
.hd-hero { display: flex; align-items: center; gap: 14px; padding: 6px 2px 12px; }
.hd-ico { width: 64px; height: 64px; }
.hd-t { font-size: 40px; font-weight: 800; line-height: 1; }
.hd-c { font-size: 14px; color: var(--text-dim); margin-top: 4px; }
/* Dettaglio orario: ogni ora è una scheda grande con tutti i dati a vista */
.hd-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 2px 10px; }
.hd-row { background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; padding: 12px 14px 14px; margin: 0 0 10px; }
.hd-now { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.hd-head { display: flex; align-items: center; gap: 10px; }
.hd-h { font-weight: 800; font-size: 15px; min-width: 74px; white-space: nowrap; }
.hd-wico { width: 40px; height: 40px; object-fit: contain; flex: 0 0 auto; }
.hd-cond { flex: 1; min-width: 0; color: var(--text-dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hd-temp { display: flex; flex-direction: column; align-items: flex-end; font-weight: 800; font-size: 26px; line-height: 1; }
.hd-temp i { font-style: normal; font-weight: 600; font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.hd-wind { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--hairline); }
.hd-barb { width: 46px; height: 46px; flex: 0 0 auto; color: var(--cold); }
.hd-wx { display: flex; flex-direction: column; min-width: 0; }
.hd-wl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-faint); line-height: 1.3; }
.hd-wv { font-size: 15px; font-weight: 800; line-height: 1.35; }
.hd-ws { font-size: 11.5px; color: var(--text-dim); line-height: 1.35; }
.hd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 12px; }
.hd-chip { display: flex; align-items: center; gap: 9px; }
.hd-ci { width: 18px; height: 18px; flex: 0 0 auto; color: var(--cold); }
.hd-cx { display: flex; flex-direction: column; min-width: 0; }
.hd-cl { font-size: 10.5px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-faint); line-height: 1.2; }
.hd-cv { font-size: 14px; font-weight: 700; line-height: 1.25; }

/* scheda stazione profonda: griglia metriche */
.sd-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sd-m { background: var(--card); border: 1px solid var(--card-border); border-radius: 13px; padding: 11px 8px; text-align: center; }
.sd-m .mi { width: 19px; height: 19px; color: var(--text-dim); }
.sd-mv { display: block; font-weight: 700; font-size: 15px; margin-top: 4px; }
.sd-ml { display: block; font-size: 11px; color: var(--text-dim); margin-top: 1px; }

/* ===== Stazioni in diretta: filtri, estremi, preferiti ===== */
.mchip { border: 1px solid var(--card-border); background: var(--bg); color: var(--text-dim); font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.mchip.on { background: var(--cold); color: #fff; border-color: var(--cold); }
.st-ex { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 10px; }
.ex-card { text-align: left; background: var(--card); border: 1px solid var(--card-border); border-radius: 13px; padding: 9px 11px; cursor: pointer; color: var(--text); display: flex; flex-direction: column; gap: 1px; }
.ex-l { font-size: 11px; color: var(--text-dim); } .ex-v { font-size: 18px; font-weight: 800; }
.ex-n { font-size: 11px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-chips { display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 7px; }
.st-chips::-webkit-scrollbar { display: none; }
.st-chips .mchip { flex: 0 0 auto; }
.st-sortbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 1px 0 10px; }
.st-sortbar #stCount { font-size: 12px; color: var(--text-dim); }
.st-sort { flex: 0 0 auto; min-width: 118px; max-width: 150px; padding: 8px 10px; font-size: 13px; }
.st-row { display: flex; align-items: stretch; gap: 6px; margin-bottom: 8px; }
.st-fav { flex: 0 0 40px; border: 1px solid var(--card-border); background: var(--card); border-radius: 12px; color: var(--text-faint); cursor: pointer; display: grid; place-items: center; }
.st-fav svg { width: 18px; height: 18px; } .st-fav.on { color: var(--warn); } .st-fav.on svg path { fill: var(--warn); stroke: var(--warn); }
.st-main { flex: 1; display: flex; flex-direction: column; gap: 8px; background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 11px 13px; cursor: pointer; text-align: left; color: var(--text); }
.st-top2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.st-strip { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.st-strip span { font-size: 12px; color: var(--text-dim); display: inline-flex; align-items: center; white-space: nowrap; }
.msi { width: 13px; height: 13px; vertical-align: -2px; opacity: .65; margin-right: 3px; }
.st-stale { font-style: normal; color: var(--warn); }

/* ===== Adesso · Vicino a te: cruscotto locale ===== */
.nc-card .nc-head { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.nc-card .nc-head .mi { width: 20px; height: 20px; color: var(--cold); }
.nc-card.wet { border-color: var(--cold); }
.nc-headline { font-size: 13px; color: var(--text-dim); margin: 6px 0 10px; }
.nc-bars { display: flex; align-items: flex-end; gap: 6px; height: 54px; }
.nc-bar { flex: 1; background: var(--chip); border-radius: 4px 4px 0 0; min-height: 8px; }
.nc-bar.wet { background: var(--cold); }
.nc-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.env-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.env-chip { background: var(--card); border: 1px solid var(--card-border); border-radius: 13px; padding: 11px 6px; text-align: center; }
.env-chip .mi { width: 19px; height: 19px; color: var(--text-dim); }
.env-chip b { display: block; font-size: 18px; font-weight: 800; margin-top: 3px; }
.env-chip span { font-size: 11px; color: var(--text-dim); }
.env-chip.warn b, .env-chip.warn .mi { color: var(--warn); }
.env-chip.bad b, .env-chip.bad .mi { color: var(--bad); }
.sec-h2 .more { border: 0; background: none; color: var(--cold); font-size: 13px; font-weight: 600; cursor: pointer; padding: 0; }
.nc-cams { display: flex; flex-wrap: wrap; gap: 8px; }
.nc-cam { display: flex; align-items: center; gap: 7px; background: var(--card); border: 1px solid var(--card-border); border-radius: 999px; padding: 8px 13px; font-size: 13px; color: var(--text); text-decoration: none; }
.nc-cam .mi { width: 16px; height: 16px; color: var(--text-dim); }

/* ===== WS Cam: preferiti, toggle, vista ingrandita ===== */
.wc-card { position: relative; cursor: pointer; }
.wc-fav { position: absolute; top: 6px; right: 6px; z-index: 2; width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; display: grid; place-items: center; cursor: pointer; }
.wc-fav svg { width: 16px; height: 16px; } .wc-fav.on { color: var(--warn); } .wc-fav.on svg path { fill: var(--warn); stroke: var(--warn); }
.wc-vis { top: auto; bottom: 8px; }
.cam-toggle { font-size: 12px; color: var(--text-dim); display: flex; align-items: center; gap: 6px; cursor: pointer; white-space: nowrap; }
.cam-big { width: 100%; border-radius: 14px; display: block; background: var(--chip); }
.cam-meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.wc-vis2 { font-size: 12px; color: var(--text-dim); }
.cam-upd { font-size: 11px; color: var(--text-faint); margin-left: auto; }

/* ===== Sismi & vulcani ===== */
.etna-card.band-good { border-color: rgba(80,200,120,.4); }
.etna-card.band-warn { border-color: var(--warn); }
.etna-card.band-bad { border-color: var(--bad); }
.etna-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.etna-h .mi { width: 22px; height: 22px; color: #ff6b4d; } .etna-h b { font-size: 16px; }
.etna-hl { flex-basis: 100%; font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.etna-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.etna-cell { background: var(--bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 10px 8px; text-align: center; }
.ec-l { display: block; font-size: 11px; color: var(--text-faint); }
.ec-v { display: block; font-size: 15px; font-weight: 800; margin-top: 3px; } .ec-v.small { font-size: 11px; font-weight: 600; }
.ec-s { display: block; font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.c-good { color: #34c759; } .c-warn { color: var(--warn); } .c-bad { color: var(--bad); }
.avi-green { color: #16a34a; } .avi-yellow { color: #eab308; } .avi-orange { color: #f97316; } .avi-red { color: #dc2626; }
.qk-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--hairline); text-decoration: none; color: var(--text); }
.qk-row .qk-mag { color: #fff; flex: 0 0 42px; }
.qk-info { flex: 1; min-width: 0; } .qk-info b { font-size: 14px; display: block; line-height: 1.25; } .qk-info span { font-size: 12px; color: var(--text-dim); }
.qk-row .chev { opacity: .4; transform: rotate(-90deg); display: inline-grid; } .qk-row .chev svg { width: 16px; height: 16px; }

/* indici climatici (Macchina del tempo) */
.idx2-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.idx2 { background: var(--bg); border: 1px solid var(--card-border); border-radius: 12px; padding: 10px 11px; }
.idx2-l { display: block; font-size: 12px; color: var(--text-dim); }
.idx2-v { font-size: 20px; font-weight: 800; } .idx2-u { font-size: 11px; color: var(--text-faint); margin-left: 4px; }
.idx2-t { display: block; font-size: 11px; font-weight: 600; margin-top: 2px; color: var(--text-dim); }
.idx2-t.up { color: #f97316; } .idx2-t.down { color: #4a9bff; }

/* ===== Notifiche: soglie allerta (toggle switch) ===== */
.alert-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.alert-row:last-child { border-bottom: 0; }
.alert-l { display: flex; align-items: center; gap: 9px; font-size: 14px; } .alert-l .mi { width: 18px; height: 18px; color: var(--text-dim); }
.alert-c { display: flex; align-items: center; gap: 12px; }
.alert-th { font-size: 13px; color: var(--text-dim); white-space: nowrap; }
.alert-in { width: 48px; border: 1px solid var(--card-border); background: var(--bg); color: var(--text); border-radius: 8px; padding: 4px 6px; font-size: 13px; text-align: center; }
.sw-tg { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 42px; }
.sw-tg input { opacity: 0; width: 0; height: 0; }
.sw-tg span { position: absolute; inset: 0; background: var(--chip); border-radius: 999px; transition: .2s; cursor: pointer; }
.sw-tg span::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.sw-tg input:checked + span { background: var(--cold); }
.sw-tg input:checked + span::before { transform: translateX(18px); }
/* ===== Notizie: articolo in evidenza ===== */
.news-hero { position: relative; display: block; border-radius: 16px; overflow: hidden; margin-bottom: 12px; background: var(--chip); }
.news-hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.news-hero-ov { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 14px 12px; background: linear-gradient(transparent, rgba(0,0,0,.85)); }
.news-hero-t { color: #fff; font-weight: 700; font-size: 16px; line-height: 1.25; }
.news-hero-d { color: rgba(255,255,255,.8); font-size: 12px; margin-top: 4px; }

/* ===== SECONDO PASSAGGIO: micro-polish (animazioni, loading, tap feedback) ===== */
/* spinner di caricamento */
.ws-spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--card-border); border-top-color: var(--cold); border-radius: 50%; animation: ws-spin .7s linear infinite; vertical-align: -3px; margin-right: 9px; }
@keyframes ws-spin { to { transform: rotate(360deg); } }
.pnl-loading { padding: 28px 14px; text-align: center; color: var(--text-dim); font-size: 14px; }
/* ingresso pannello full-screen */
@keyframes panelIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.fr-ov { animation: panelIn .26s cubic-bezier(.22,.61,.36,1) both; }
.fr-bar { animation: none; }
/* fade-in a cascata delle card del pannello */
@keyframes fadeUp { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.pnl-list > *, .pnl-body > .pnl-list > * { animation: fadeUp .32s ease both; }
.pnl-list > *:nth-child(1) { animation-delay: .02s; }
.pnl-list > *:nth-child(2) { animation-delay: .06s; }
.pnl-list > *:nth-child(3) { animation-delay: .10s; }
.pnl-list > *:nth-child(4) { animation-delay: .14s; }
.pnl-list > *:nth-child(5) { animation-delay: .18s; }
.pnl-list > *:nth-child(n+6) { animation-delay: .22s; }
/* feedback al tap uniforme sugli elementi interattivi */
.st-main, .wc-card, .qk-row, .ex-card, .feed-i, .drw-i, .menu-i, .sd-m, .nc-cam, .mchip, .seg button, .map-seg button { transition: transform .12s ease, background .15s ease; }
.st-main:active, .wc-card:active, .qk-row:active, .ex-card:active, .feed-i:active, .drw-i:active, .menu-i:active, .nc-cam:active, .news-hero:active { transform: scale(.98); }
.mchip:active, .seg button:active, .dt:active, .tab:active { transform: scale(.94); }
/* loader skeleton per i grafici (mentre Chart.js monta) */
.chart-wrap { transition: opacity .3s ease; }

/* ===== Spaghetti: barra lettura + download ===== */
.sp-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sp-readout { font-size: 12px; color: var(--text-dim); flex: 1; min-width: 0; line-height: 1.3; }
.sp-readout b { color: var(--text); }
.sp-dl { flex: 0 0 auto; display: flex; align-items: center; gap: 5px; border: 1px solid var(--card-border); background: var(--bg); color: var(--cold); font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; cursor: pointer; }
.sp-dl svg { width: 14px; height: 14px; }

/* ===== Adesso: elementi interattivi ===== */
.nc-refresh-row { display: flex; justify-content: flex-end; margin-bottom: 2px; }
.st-hero-btn { width: 100%; cursor: pointer; text-align: left; color: var(--text); }
.st-hero-btn .st-hero-info { flex: 1; min-width: 0; }
.st-hero-btn .chev { margin-left: auto; opacity: .4; transform: rotate(-90deg); display: inline-grid; }
.st-hero-btn .chev svg { width: 18px; height: 18px; }
.st-card-btn { width: 100%; text-align: left; cursor: pointer; color: var(--text); display: block; }
.env-chip.clk { cursor: pointer; }
.nc-bar { cursor: pointer; }

/* ===== Radiosondaggio: stale badge ===== */
.sonde-stale { display: inline-block; font-size: 11px; font-weight: 600; color: #fff; background: var(--warn); border-radius: 6px; padding: 2px 7px; margin-left: 6px; vertical-align: 1px; }

/* ===== batch fix: DRPC alert / community CTA / segnalazioni contesto / conferma ===== */
.drpc-alert { border-radius: 14px; padding: 13px 14px; margin-bottom: 12px; border: 1px solid; }
.drpc-alert.band-bad { background: rgba(220,38,38,.12); border-color: var(--bad); }
.drpc-alert.band-warn { background: rgba(245,158,11,.12); border-color: var(--warn); }
.drpc-h { display: flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; }
.drpc-h .mi { width: 18px; height: 18px; } .drpc-alert.band-bad .drpc-h .mi { color: var(--bad); } .drpc-alert.band-warn .drpc-h .mi { color: var(--warn); }
.drpc-h b { color: var(--text); }
.drpc-t { font-size: 13px; color: var(--text); margin: 7px 0; line-height: 1.35; }
.drpc-f { font-size: 12px; color: var(--text-dim); } .drpc-f a { color: var(--cold); }
.comm-cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; border: 0; background: var(--cold); color: #fff; font-size: 15px; font-weight: 700; padding: 13px; border-radius: 14px; cursor: pointer; margin-bottom: 12px; }
.comm-cta svg { width: 18px; height: 18px; }
.rep-context:empty { display: none; }
.rep-ctx-head { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.rep-ctx-sub { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }
.menu-i.danger { color: var(--bad); }

/* età foto webcam + notifiche attive */
.cam-upd.stale { color: var(--warn); }
.comm-cta.on-ok { background: #34c759; }

.hr-dry { color: var(--text-dim); font-size: 11px; }

/* record cliccabili (top 10) */
.kv-btn { width: 100%; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.kv-btn:active { opacity: .6; }

.sonde-fresh { color: var(--text-dim); font-size: 12px; font-weight: 400; margin-left: 4px; }

/* Spaghetti: chip variabili scrollabili */
.sp-vars-wrap { padding: 0 14px 2px; overflow-x: auto; scrollbar-width: none; }
.sp-vars-wrap::-webkit-scrollbar { display: none; }
.sp-vars { display: inline-flex; flex-wrap: nowrap; gap: 6px; }
.sp-vars button { white-space: nowrap; }

/* Home: banner allerta Protezione Civile */
.pc-alert { margin-top: 12px; border-radius: 16px; padding: 12px 14px; border: 1px solid; }
.pc-alert.band-good { background: rgba(54,196,107,.10); border-color: rgba(54,196,107,.30); }
.pc-alert.band-warn { background: rgba(255,176,46,.12); border-color: var(--warn); }
.pc-alert.band-bad { background: rgba(255,90,95,.12); border-color: var(--bad); }
.pc-h { font-size: 14px; font-weight: 700; }
.pc-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; }
.pc-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pc-pill { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: var(--chip); }
.pc-pill.c-warn { color: var(--warn); } .pc-pill.c-bad { color: var(--bad); } .pc-pill.c-good { color: var(--good); }

/* card approfondimento tappabili (clima storico) */
.acard-tap { cursor: pointer; }
.acard-tap:active { transform: scale(.99); }
.acard-tap .ac-t { display: flex; align-items: center; }
.ac-chev { margin-left: auto; opacity: .4; display: inline-grid; }
.ac-chev svg { width: 16px; height: 16px; transform: rotate(-90deg); }

/* clima storico: anni estremi pioggia */
.ry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ry-h { font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.ry-r { display: flex; justify-content: space-between; font-size: 13px; padding: 2px 0; }
.ec-s.c-bad { color: var(--bad); } .ec-s.c-good { color: var(--good); }

/* ===== Sezioni parità menu nativo ===== */
/* Riserve idriche */
.rsv-row { padding: 9px 0; border-bottom: 1px solid var(--hairline); }
.rsv-row:last-child { border-bottom: 0; }
.rsv-top { display: flex; justify-content: space-between; font-weight: 700; font-size: 14px; }
.rsv-bar { height: 7px; border-radius: 4px; background: var(--chip); margin: 6px 0 4px; overflow: hidden; }
.rsv-bar span { display: block; height: 100%; border-radius: 4px; }
.rsv-sub { font-size: 11.5px; color: var(--text-dim); }
/* Satellite */
.sat-img { width: 100%; border-radius: 10px; display: block; background: var(--chip); min-height: 200px; }
/* Pollini */
.pol-grid { display: flex; flex-direction: column; gap: 3px; }
.pol-row { display: grid; grid-template-columns: 116px repeat(12, 1fr); align-items: center; gap: 2px; }
.pol-row > span { font-size: 11px; color: var(--text-dim); }
.pol-row > i { height: 16px; border-radius: 3px; background: var(--chip); display: block; font-style: normal; text-align: center; font-size: 9px; line-height: 16px; color: var(--text-dim); }
.pol-head > i { background: none; font-weight: 700; }
.pol-row > i.lv1 { background: rgba(54,196,107,.45); }
.pol-row > i.lv2 { background: rgba(54,196,107,.9); }
.pol-row > i.cur { outline: 2px solid var(--cold); outline-offset: -2px; }
.pol-leg { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-dim); margin-top: 10px; }
.pol-leg i { width: 16px; height: 12px; border-radius: 3px; display: inline-block; }
.pol-leg i.lv1 { background: rgba(54,196,107,.45); } .pol-leg i.lv2 { background: rgba(54,196,107,.9); }
/* Confronta */
.cmp-pick { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cmp-sel { flex: 1; background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 11px; font-weight: 700; color: var(--text); cursor: pointer; font-size: 14px; }
.cmp-vs { color: var(--text-dim); font-size: 12px; }
.cmp-grid { display: grid; grid-template-columns: 1.1fr 1fr 1fr; }
.cmp-h { font-weight: 700; font-size: 13px; padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--hairline); }
.cmp-h:first-child { text-align: left; }
.cmp-k { font-size: 13px; color: var(--text-dim); padding: 9px 4px; border-bottom: 1px solid var(--hairline); }
.cmp-v { font-size: 14px; font-weight: 700; text-align: center; padding: 9px 4px; border-bottom: 1px solid var(--hairline); }
.sw-i { display: flex; justify-content: space-between; align-items: center; width: 100%; background: none; border: 0; border-bottom: 1px solid var(--hairline); padding: 11px 4px; color: var(--text); cursor: pointer; text-align: left; }
.sw-i b { font-size: 14px; } .sw-i span { font-size: 12px; color: var(--text-dim); }

/* Livello fiume in evidenza (etichetta blu cliccabile, in cima) */
.river-badge { display: flex; align-items: center; gap: 9px; width: 100%; margin-top: 12px; padding: 12px 14px; border-radius: 16px; border: 1px solid rgba(74,163,255,.45); background: linear-gradient(90deg, rgba(74,163,255,.18), rgba(74,163,255,.06)); color: var(--text); cursor: pointer; text-align: left; }
.river-badge .mi { color: var(--cold); flex: 0 0 auto; width: 20px; height: 20px; }
.river-badge .rb-t { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; }
.river-badge .rb-v { font-size: 16px; font-weight: 800; color: var(--cold); white-space: nowrap; }
.river-badge .rb-chev { opacity: .5; display: inline-grid; } .river-badge .rb-chev svg { width: 16px; height: 16px; transform: rotate(-90deg); }
.river-badge:active { transform: scale(.99); }

/* Confronta: evidenziazione valore più estremo */
.cmp-v.cmp-win { font-weight: 800; }
.cmp-v.cmp-win.c-hot { color: var(--hot); }
.cmp-v.cmp-win.c-cold { color: var(--cold); }
.cmp-v.cmp-win.c-warn { color: var(--warn); }
.cmp-v.cmp-win.c-good { color: var(--good); }
.cmp-v i { font-style: normal; font-weight: 500; font-size: 11px; color: var(--text-faint); margin-left: 3px; }
/* Confronta: intestazione di sezione dentro la griglia */
.cmp-sec { grid-column: 1 / -1; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  color: var(--cold); padding: 12px 4px 5px; border-bottom: 1px solid var(--hairline); }
/* Confronta: sintesi in linguaggio naturale */
.cmp-sum { background: var(--chip); border: 1px solid var(--card-border); border-radius: 14px;
  padding: 11px 14px; margin-bottom: 12px; font-size: 13.5px; line-height: 1.5; color: var(--text); }
.cmp-sum b { color: var(--cold); }

/* fix audit-2: riserve stale + satellite wrap */
.rsv-stale { font-style: normal; font-size: 11px; font-weight: 600; color: var(--warn); }
.sat-wrap { min-height: 220px; display: grid; place-items: center; }
.sat-wrap .sat-img { width: 100%; border-radius: 10px; display: block; min-height: 0; }

.cmp-h small { display: block; font-size: 10.5px; font-weight: 400; color: var(--text-dim); margin-top: 1px; }

/* fix audit-2 wave: legenda spaghetti + badge aiuto + refresh */
.sp-legend { display: flex; flex-wrap: wrap; gap: 10px 14px; padding: 8px 0 0; font-size: 11px; color: var(--text-dim); }
.sp-legend .lg { display: inline-flex; align-items: center; }
.sp-legend .lg::before { content: ''; width: 14px; height: 3px; border-radius: 2px; margin-right: 5px; display: inline-block; }
.sp-legend .lg-off::before { background: #ff5a3c; }
.sp-legend .lg-med::before { background: #34c759; }
.sp-legend .lg-band::before { background: rgba(90,176,255,.55); height: 8px; }
.sp-legend .lg-clim::before { background: repeating-linear-gradient(90deg, #9aa, #9aa 3px, transparent 3px, transparent 6px); }
.ws-help { width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--card-border); background: var(--chip); color: var(--text-dim); font-size: 11px; font-weight: 700; cursor: help; padding: 0; line-height: 1; margin-left: 6px; vertical-align: 1px; }
.pnl-refresh { flex: 0 0 auto; }

/* fix audit-2 wave: home metric tappabile + loading/error giorno */
.metric { background: none; border: 0; border-right: 1px solid var(--hairline); font: inherit; color: inherit; cursor: pointer; }
.metric:last-child { border-right: 0; }
.metric:active { transform: scale(.96); }
.app-loading { opacity: .5; pointer-events: none; transition: opacity .12s; }
.load-err { background: var(--bad); color: #fff; padding: 8px 12px; border-radius: 10px; margin: 8px 0; font-size: 13px; display: flex; gap: 8px; align-items: center; justify-content: center; }
.load-err button { background: rgba(255,255,255,.25); border: 0; color: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-weight: 600; }

/* fix audit-2 wave: cam station tappabile + news hero senza img */
.cam-st-btn { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--card-border); border-radius: 14px; padding: 10px; cursor: pointer; color: var(--text); margin-top: 4px; }
.cam-st-btn:active { transform: scale(.99); }
.news-hero-noimg { min-height: 92px; background: linear-gradient(135deg, rgba(47,127,214,.25), rgba(47,127,214,.05)); }
.news-hero-noimg .news-hero-ov { position: static; background: none; }
.news-hero-noimg .news-hero-t { color: var(--text); }

/* fix audit-2 wave: idx2/riserve come bottoni */
.idx2-btn { font: inherit; color: inherit; cursor: pointer; text-align: left; width: 100%; }
.idx2-btn:active { transform: scale(.97); }
.rsv-row-btn { background: none; border: 0; border-bottom: 1px solid var(--hairline); font: inherit; color: inherit; cursor: pointer; text-align: left; width: 100%; }
.rsv-row-btn:last-child { border-bottom: 0; }
.rsv-row-btn:active { opacity: .7; }

/* fix audit-2 residui: confronta back + badge webcam stazione */
.cmp-pickbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; color: var(--text-dim); }
.cmp-back { background: var(--chip); border: 0; color: var(--cold); font-weight: 700; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 13px; }
.st-cam { color: var(--text-dim); font-size: 11px; font-weight: 600; display: inline-flex; align-items: center; gap: 1px; vertical-align: 1px; }
.st-cam svg { width: 13px; height: 13px; }

/* ---------- segnalazione con foto + invito periodico ---------- */
.rep-photo-btn { margin-top: 12px; }
.pr-cats { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.pr-cat { flex: 1 1 28%; display: flex; flex-direction: column; align-items: center; gap: 3px; border: 1px solid var(--card-border); background: var(--card); color: var(--text); border-radius: 12px; padding: 9px 4px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.pr-cat span { font-size: 20px; line-height: 1; }
.pr-cat.on { background: var(--cold); border-color: var(--cold); color: #fff; }
.pr-photo { display: block; margin-bottom: 10px; cursor: pointer; }
.pr-photo-in { display: flex; align-items: center; gap: 10px; border: 1.5px dashed var(--card-border); border-radius: 14px; padding: 14px; color: var(--text-dim); font-size: 13.5px; }
.pr-photo-in svg { width: 24px; height: 24px; flex: none; }
.pr-photo-in em { font-style: normal; opacity: .75; }
.pr-thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 10px; flex: none; }
.pr-note { width: 100%; box-sizing: border-box; border: 1px solid var(--card-border); background: var(--card); color: var(--text); border-radius: 12px; padding: 10px; font-size: 13.5px; font-family: inherit; resize: none; margin-bottom: 10px; }
.pr-consent { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text-dim); line-height: 1.35; margin-bottom: 12px; cursor: pointer; }
.pr-consent input { margin-top: 2px; flex: none; }
.pr-msg { font-size: 13px; margin-top: 4px; text-align: center; }
.pr-msg.err { color: #e5484d; }
.pr-msg.ok { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; color: var(--text); }
.pr-msg.ok b { font-size: 15px; }
.pr-msg.ok span { font-size: 12.5px; color: var(--text-dim); }
.pr-ok-ic { width: 46px; height: 46px; border-radius: 50%; background: #34c759; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 26px; font-weight: 800; margin-bottom: 2px; }
.pr-ok-stat { margin-top: 8px; font-size: 12px; color: var(--text-dim); background: var(--card); border: 1px solid var(--card-border); border-radius: 10px; padding: 8px 10px; }

.contrib-nudge { position: fixed; left: 10px; right: 10px; bottom: calc(74px + env(safe-area-inset-bottom)); max-width: 468px; margin: 0 auto; z-index: 45; background: #12294a; border: 1px solid var(--card-border); border-radius: 16px; box-shadow: 0 12px 38px rgba(2,8,20,.55); padding: 12px 12px 12px 14px; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "ic tx" "act act"; column-gap: 12px; transform: translateY(24px); opacity: 0; transition: transform .3s ease, opacity .3s ease; }
:root[data-theme="light"] .contrib-nudge { background: #ffffff; box-shadow: 0 12px 34px rgba(20,50,90,.22); }
.contrib-nudge.show { transform: none; opacity: 1; }
.cn-ic { grid-area: ic; width: 40px; height: 40px; border-radius: 12px; background: var(--cold); color: #fff; display: flex; align-items: center; justify-content: center; }
.cn-ic svg { width: 22px; height: 22px; }
.cn-tx { grid-area: tx; align-self: center; padding-right: 14px; }
.cn-tx b { display: block; font-size: 14.5px; font-weight: 800; }
.cn-tx span { display: block; font-size: 12.5px; color: var(--text-dim); line-height: 1.35; margin-top: 2px; }
.cn-act { grid-area: act; display: flex; gap: 8px; margin-top: 10px; }
.cn-go { flex: 1; border: 0; background: var(--cold); color: #fff; font-weight: 700; font-size: 13.5px; padding: 10px; border-radius: 11px; cursor: pointer; }
.cn-later { border: 0; background: transparent; color: var(--text-dim); font-weight: 600; font-size: 13.5px; padding: 10px 12px; cursor: pointer; }
.cn-x { position: absolute; top: 6px; right: 8px; border: 0; background: transparent; color: var(--text-dim); font-size: 20px; line-height: 1; cursor: pointer; }

/* ---------- archivio mappe + mappe riepilogo ---------- */
.arc-ctl { display: flex; flex-wrap: wrap; gap: 8px; }
.arc-ctl input, .arc-ctl select {
  flex: 1 1 130px; min-width: 0;
  background: var(--card); color: var(--text);
  border: 1px solid var(--card-border); border-radius: 10px;
  padding: 9px 10px; font: inherit; font-size: 13.5px;
}
.arc-ctl input[hidden] { display: none; }
.arc-img { width: 100%; border-radius: 12px; border: 1px solid var(--card-border); background: #fff; display: block; }

.sm-map { height: 62vh; min-height: 340px; border-radius: 16px; overflow: hidden; border: 1px solid var(--card-border); }
.sm-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }
.sm-leg { display: inline-flex; align-items: center; gap: 2px; }
.sm-leg i { width: 16px; height: 9px; display: inline-block; }
.sm-leg i:first-of-type { border-radius: 3px 0 0 3px; }
.sm-leg i:last-of-type { border-radius: 0 3px 3px 0; }
.sm-leg small { margin: 0 4px; font-size: 11px; }
.sm-heat { position: absolute; }
.sm-pop strong { font-size: 14px; }
.sm-pop p { margin: 2px 0; color: #64748b; font-size: 12px; }
.sm-pop-v { font-size: 20px; font-weight: 800; margin: 6px 0; }
.sm-pop-g { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12.5px; font-weight: 600; }
.sm-pop-g small { display: block; font-weight: 400; color: #64748b; font-size: 11px; }
.sm-pop-n { font-size: 11px; color: #64748b; margin-top: 6px; }

/* clear-X universale sui campi di ricerca (comune/stazione/webcam) */
.srch-wrap { position: relative; display: flex; align-items: center; flex: 1; width: 100%; box-sizing: border-box; }
.srch-wrap > input { flex: 1; width: 100%; margin: 0; padding-right: 40px; }
.srch-x { display: none; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: transparent;
  color: var(--text-faint); font-size: 20px; line-height: 1; cursor: pointer;
  align-items: center; justify-content: center; }
.srch-x:hover { background: var(--card-border); color: var(--text); }
