/* Meteopassione — foglio di stile unico.
   Parte pubblica: veste grafica 2026 (schede bianche su fondo chiaro, un valore in evidenza per scheda,
   grafici SVG leggeri disegnati dal server, blu #1E70B7 e giallo #FFC100 del marchio). Nessuna libreria
   CSS, caratteri di sistema per i testi; il solo font del marchio (Montserrat, quello del logo, licenza OFL)
   è servito dal sito, ridotto ai caratteri italiani, e usato per il nome e i titoli dell'app.
   Parte gestionale: impostazione del gestionale attuale (menu laterale chiaro, barra arancione). */
:root {
  --blu: #1e70b7; --blu-scuro: #1b3865; --navy: #1b3865; --giallo: #ffc100; --dark: #333; --grigio: #f3f3f3; --grigio2: #e6e4e4;
  --bg: #f4f6f9; --line: #e3e8ef; --soft: #eef3f9; --ink: #1f2937; --muted: #5b6875;
  --ok: #1f7a3a; --late: #b26a00; --stale: #b3261e; --maint: #5b4fb0; --arancio: #ff7a00;
  --t-cold: #1e70b7; --t-hot: #d84b2b;
  --card: #fff; --navy-bg: #1b3865;
  --ink2: #14213d; --txt: #3b4652; --txt2: #55606c; --txt3: #6b7682;
  --r: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-h: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
}
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/montserrat-500.woff2") format("woff2"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/montserrat-600.woff2") format("woff2"); }
:root { --font-brand: "Montserrat", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Arial, sans-serif; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.55; color: var(--ink); background: var(--card); }
a { color: var(--blu); text-decoration: none; }
a:hover { color: #155a96; }
h1, h2, h3, h4, h5 { font-family: var(--font-h); font-weight: 700; line-height: 1.2; margin: 0 0 16px; color: var(--navy); }
h1 { font-size: 2rem; } h2 { font-size: 1.5rem; } h3 { font-size: 1.25rem; } h4 { font-size: 1.1rem; }
p { margin: 0 0 16px; }
img { max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; }
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .container { padding: 0 16px; } }
.upp { text-transform: uppercase; } .center { text-align: center; } .right { text-align: right; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
.skip { position: absolute; left: -999px; } .skip:focus { left: 8px; top: 8px; background: var(--card); padding: 8px; z-index: 1000; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bckblu { background: var(--blu); } .bcklightgrey { background: var(--grigio); } .bckyellow { background: var(--giallo); }
.colr-blu { color: var(--blu); }
.nd { color: #98a2ad; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.site { background: var(--bg); min-height: 100vh; display: flex; flex-direction: column; }
.site > main { flex: 1; padding-bottom: 8px; }
:focus-visible { outline: 3px solid rgba(30, 112, 183, .45); outline-offset: 2px; }

/* Barra istituzionale e banner sponsor */
.topbar { background: var(--navy-bg); color: #c9d6e3; font-size: 13px; }
.topbar-in { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 34px; }
.topbar nav { display: flex; gap: 18px; flex-wrap: wrap; }
.topbar a { color: #dfe8f2; } .topbar a:hover, .topbar a.active { color: var(--giallo); }
.sponsor-band { background: #fff; border-bottom: 1px solid var(--line); display: flex; justify-content: center; align-items: center; gap: 14px; padding: 6px 16px; }
.sponsor-band img { display: block; max-height: 64px; width: auto; }
.sponsor-lbl { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
/* Fascia a rotazione con più sponsor (MPS-11) */
/* Altezza fissa: banner e loghi di altezze diverse non devono spostare la pagina a ogni cambio */
.sponsor-band { height: 77px; box-sizing: border-box; overflow: hidden; }
.sponsor-band .sb-item { display: none; align-items: center; height: 64px; }
.sponsor-band .sb-item.on { display: flex; }
.sponsor-band .sb-item img { max-height: 64px; }
.sponsor-band .sb-item img.logo { max-height: 56px; max-width: 260px; object-fit: contain; }
@media (max-width: 760px) { .sponsor-band { height: 61px; } .sponsor-band .sb-item { height: 48px; } .sponsor-band .sb-item img { max-height: 48px; } .sponsor-band .sb-item img.logo { max-height: 44px; } }
/* Sponsor del sito nelle pagine di stazione e webcam (MPS-11) */
.site-sponsors { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin: 4px 0 18px; padding: 10px 16px; background: var(--card); border: 1px solid #e3e8ee; border-radius: 14px; }
.site-sponsors.bottom { margin: 30px 0 10px; justify-content: center; }
.site-sponsors-logos { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.site-sponsors-logos img { height: 40px; width: auto; max-width: 180px; object-fit: contain; display: block; }
.site-sponsors-logos strong { color: var(--navy); }
/* Altri dispositivi dello stesso sito (MPS-9) */
.site-devices { margin-top: 34px; }
.site-dev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.site-dev { display: flex; flex-direction: column; overflow: hidden; color: var(--ink); }
.site-dev:hover strong { color: var(--blu); }
.site-dev img { width: 100%; aspect-ratio: 16 / 9; height: auto; object-fit: cover; display: block; background: #dfe5eb; }
.site-dev-ico { display: grid; place-items: center; aspect-ratio: 16 / 9; background: #eef3f7; color: var(--blu); }
.site-dev-txt { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px 12px; }
@media (max-width: 760px) { .topbar-claim, .sponsor-lbl { display: none; } .topbar nav { gap: 12px; } .sponsor-band img { max-height: 48px; } }

/* Testata */
.masthead { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 900; }
.masthead-in { display: flex; align-items: center; gap: 24px; min-height: 72px; }
.logo img { height: 46px; width: auto; display: block; }
.mainnav { display: flex; gap: 2px; flex: 1; }
.mainnav a { color: var(--navy); font-weight: 600; font-size: 15px; padding: 24px 10px 21px; border-bottom: 3px solid transparent; white-space: nowrap; }
.mainnav a:hover { color: var(--blu); }
.mainnav a.active { color: var(--blu); border-bottom-color: var(--giallo); }
.hsearch { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; height: 42px; width: 230px; }
.hsearch svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; flex: none; }
.hsearch input { border: 0; background: transparent; outline: none; width: 100%; font-size: 14px; }
.btn-assoc { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 18px; border-radius: 12px; background: var(--giallo); color: var(--navy); font-weight: 700; white-space: nowrap; }
.btn-assoc:hover { background: #ffcd33; color: var(--navy); }
@media (max-width: 1180px) {
  .masthead { position: static; }
  .masthead-in { flex-wrap: wrap; gap: 12px 20px; padding-top: 12px; }
  .mainnav { order: 3; flex: 1 0 100%; overflow-x: auto; scrollbar-width: none; margin: 0 -8px; }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav a { padding: 10px 10px 11px; }
  .hsearch { margin-left: auto; }
}
@media (max-width: 640px) { .hsearch { display: none; } .logo img { height: 38px; } .masthead-in .btn-assoc { margin-left: auto; min-height: 40px; } }
/* Testata dello smartphone: barra blu ridotta ai collegamenti principali, testata compatta che resta in alto
   e menu a pannello con sezioni, associazione, accesso e preferenze (dall'iPhone 6S, 375 px, in su). */
.mmenu { display: none; }
/* Tablet in verticale: la barra blu resta su una riga (Collaborazioni e Forum sono nel piè di pagina). */
@media (max-width: 1100px) { .topbar-claim, .topbar .tb-t { display: none; } }
@media (max-width: 760px) {
  .topbar .tb-x { display: none; }
  .topbar-in { min-height: 34px; }
  .topbar nav { flex-wrap: nowrap; gap: 14px; width: 100%; white-space: nowrap; }
  .topbar-login, .topbar-user { margin-left: auto; }
  .topbar-user a { max-width: 130px; overflow: hidden; text-overflow: ellipsis; }
  .masthead { position: sticky; top: 0; z-index: 1050; }
  .masthead-in { flex-wrap: nowrap; gap: 10px; min-height: 60px; padding-top: 0; }
  .mainnav, .hsearch { display: none; }
  .logo img { height: 36px; }
  .masthead-in .btn-assoc { margin-left: auto; min-height: 40px; padding: 0 14px; font-size: .92rem; }
  .mmenu { display: block; }
  .mmenu summary { list-style: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--soft); color: var(--navy); cursor: pointer; }
  .mmenu summary::-webkit-details-marker { display: none; }
  .mmenu summary svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
  .mmenu .mm-close, .mmenu[open] .mm-open { display: none; }
  .mmenu[open] .mm-close { display: block; }
  .mmenu[open] summary { background: var(--navy-bg); color: #fff; }
  .mmenu-panel { position: absolute; left: 0; right: 0; top: 100%; background: var(--card); border-bottom: 1px solid var(--line); box-shadow: 0 18px 30px rgba(20, 33, 61, .18);
    max-height: calc(100vh - 60px); max-height: calc(100dvh - 60px); overflow-y: auto; overscroll-behavior: contain; padding: 14px max(16px, env(safe-area-inset-right)) 20px max(16px, env(safe-area-inset-left)); }
  .mmenu-search { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
  .mmenu-search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
  .mmenu-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 12px 0; font-size: 16px; color: var(--ink); }
  .mmenu-main { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 14px 0 6px; }
  .mmenu-main a { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 12px; border-radius: 12px; background: var(--soft); color: var(--navy); font-weight: 600; font-size: .95rem; line-height: 1.2; }
  .mmenu-main a svg { flex: none; color: var(--blu); }
  .mmenu-main a.active { background: var(--blu); color: #fff; }
  .mmenu-main a.active svg { color: #fff; }
  .mmenu-assoc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; margin-top: 12px; }
  .mmenu-assoc strong { grid-column: 1 / -1; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 4px 0 2px; }
  .mmenu-assoc a { display: flex; align-items: center; min-height: 44px; color: var(--ink); border-bottom: 1px solid var(--line); }
  .mmenu-acct { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin-top: 16px; }
  .mmenu-acct a, .mmenu-acct button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-weight: 600; color: var(--blu); background: none; border: 0; padding: 0; cursor: pointer; font-size: 1rem; }
  .mmenu-acct form { margin: 0; }
  html.mmenu-on, html.mmenu-on body { overflow: hidden; }
  .mmenu-acct .mmenu-app { flex: 1 0 100%; justify-content: center; min-height: 46px; border-radius: 12px; background: var(--navy-bg); color: #fff; }
}

/* Fascia associazione e piè di pagina */
.assoc-band { margin-top: 40px; }
.assoc-band { display: flex; gap: 24px 32px; align-items: center; flex-wrap: wrap; background: var(--navy-bg); color: #fff; border-radius: 20px; padding: 28px 32px; max-width: 1232px; }
.assoc-band > div:first-child { flex: 1 1 420px; }
.assoc-band h2 { color: #fff; font-size: 1.5rem; margin: 0 0 8px; }
.assoc-band p { color: #d7e3f1; margin: 0; }
.assoc-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-ghost { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 1px solid rgba(255,255,255,.7); color: #fff; font-weight: 600; }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
@media (max-width: 1280px) { .assoc-band { margin-left: 24px; margin-right: 24px; width: auto; } }
@media (max-width: 640px) { .assoc-band { margin-left: 16px; margin-right: 16px; padding: 22px; } }
.sitefoot { background: #14213d; color: #c9d6e3; margin-top: 40px; padding: 40px 0 0; font-size: 14px; }
.foot-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 28px; }
.foot-grid img { height: 44px; width: auto; display: block; margin-bottom: 12px; }
.foot-grid nav { display: flex; flex-direction: column; gap: 8px; }
.foot-grid strong { color: #fff; }
.sitefoot a { color: #c9d6e3; } .sitefoot a:hover { color: var(--giallo); }
.foot-note { font-size: 12.5px; color: #93a4b8; border-top: 1px solid rgba(255,255,255,.1); margin-top: 32px; padding-top: 14px; padding-bottom: 18px; }
@media (max-width: 760px) { .foot-grid { grid-template-columns: 1fr 1fr; } .foot-grid > div:first-child { grid-column: 1 / -1; } }

/* Elementi comuni delle pagine pubbliche */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.pad { padding: 20px; }
.eyebrow { display: block; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-top: 28px; margin-bottom: 20px; }
.page-head h1 { font-size: 1.9rem; margin: 0; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; max-width: 780px; }
.crumbs { font-size: 13px; color: var(--muted); padding-top: 22px; }
.crumbs + .page-head { padding-top: 6px; }
.sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 36px 0 14px; }
.sec-head h2 { font-size: 1.35rem; margin: 0; }
.sec-head .more { font-weight: 600; font-size: 14px; }
.sec-head .note { color: var(--muted); font-size: 14px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; background: var(--soft); color: var(--navy); white-space: nowrap; border: 0; cursor: pointer; }
a.chip:hover { background: #e1eaf5; color: var(--navy); }
.chip.on { background: var(--blu); color: #fff; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; background: var(--soft); border-radius: 12px; padding: 4px; gap: 2px; }
.seg a, .seg label { padding: 7px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--navy); cursor: pointer; white-space: nowrap; }
.seg a.on, .seg input:checked + label { background: var(--card); box-shadow: 0 1px 2px rgba(16, 24, 40, .1); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.g2, .g3, .g4 { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }
.vmin { color: var(--t-cold); font-weight: 700; } .vmax { color: var(--t-hot); font-weight: 700; }
.wx { display: block; flex: none; }

/* Pulsanti */
.btn-blu, button.btn-blu { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; background: var(--blu); color: #fff; border: 1px solid var(--blu); border-radius: 12px; padding: 0 18px; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-align: center; }
.btn-blu:hover { background: #17609d; color: #fff; }
.btn-blu.outline { background: var(--card); color: var(--navy); border-color: var(--line); }
.btn-blu.outline:hover { background: var(--soft); }
.btn-blu.full { display: flex; width: 100%; }
.btn-blu.big { font-size: 1rem; }
.button-li { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 20px 0; }
.btn-sm { font-size: .8rem; padding: 6px 12px; }

/* Stato del dato */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #eef1f4; color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge.ok { color: var(--ok); background: #e7f4ea; } .badge.late { color: var(--late); background: #fdf1df; }
.badge.stale { color: var(--stale); background: #fbe9e7; } .badge.maint { color: var(--maint); background: #efedfa; }
.notice { background: #fff8e6; border: 1px solid #f2d79b; padding: 10px 14px; border-radius: 12px; margin-bottom: 14px; }
.notice.ok { background: #e8f5ec; border-color: #9fd3b0; }
.alert { background: #fbe9e7; color: #7a1a12; border: 1px solid #f3c2bc; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }
.success { background: #e7f4ea; border: 1px solid #b9dfc3; padding: 10px 12px; border-radius: 10px; margin-bottom: 12px; }

/* Campi dei moduli */
input.normale_form, select.normale_form, textarea.normale_form, .search-row input, .search-row select, .field {
  border: 1px solid var(--line); color: var(--ink); font-size: 15px; width: 100%; background: var(--card); padding: 0 12px; min-height: 44px; border-radius: 12px; }
textarea.normale_form { min-height: 140px; padding: 10px 12px; }
.search-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; margin: 10px 0 24px; }
@media (max-width: 767px) { .search-row { grid-template-columns: 1fr; } }
.search-row .btn-blu { width: 100%; }
label.lbl { display: block; font-size: .9rem; margin-bottom: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check input { width: 22px; height: 22px; accent-color: var(--blu-scuro); flex: 0 0 auto; }
.hp { position: absolute; left: -5000px; }

/* Tabelle */
.dt-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 0 0 12px; flex-wrap: wrap; font-size: .95rem; }
.dt-tools input, .dt-tools select { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--card); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.dt { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.dt th { text-align: left; padding: 12px 22px 12px 12px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; white-space: nowrap; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.dt th::after { content: "⇅"; position: absolute; right: 6px; opacity: .3; font-size: .9em; }
table.dt th.asc::after { content: "▲"; opacity: .7; } table.dt th.desc::after { content: "▼"; opacity: .7; }
table.dt td { padding: 10px 12px; border-top: 1px solid #eef1f5; }
table.dt tbody tr:hover { background: #f8fafc; }
table.dt td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.dt td a { font-weight: 600; }
.tchip { display: inline-block; min-width: 54px; text-align: center; border-radius: 8px; padding: 2px 6px; font-weight: 700; color: var(--ink2); }
tr.off td { color: #9aa5b1; }

/* Pagine con titolo centrato (pagine istituzionali, blog, archivio) */
.kicker { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; text-align: center; color: var(--muted); margin: 28px 0 6px; }
.page-title { text-align: center; font-size: 2rem; margin: 0 0 20px; }
.section-title { text-align: center; font-size: 1.35rem; margin: 32px 0 18px; }
@media (max-width: 767px) { .page-title { font-size: 1.6rem; } }

/* Riquadri dei valori (archivio della stazione) */
.val-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 991px) { .val-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 500px) { .val-grid { grid-template-columns: 1fr; } }
.val-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.val-card .hd { background: var(--soft); color: var(--navy); text-align: center; font-weight: 700; font-size: 14px; padding: 10px 6px; }
.val-card .top { display: flex; align-items: center; justify-content: space-around; padding: 18px 10px 6px; }
.val-card .top img { width: 48px; height: 48px; }
.val-card .top .v { font-size: 24px; font-weight: 700; color: var(--navy); }
.val-card .mm, .chart-side .mm { display: flex; justify-content: space-around; text-align: center; padding: 6px 4px 14px; }
.val-card .mm .lab { font-size: 11px; text-transform: uppercase; color: var(--muted); display: block; }
.val-card .mm .val, .val-card .mm .tm { font-size: 15px; display: block; }
.val-card .mm .at { font-size: 11px; color: var(--muted); display: block; }
.arrow-down, .arrow-up { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; display: inline-block; }
.arrow-down { border-top: 12px solid var(--t-cold); }
.arrow-up { border-bottom: 12px solid var(--t-hot); }
.chart-title { text-align: left; font-size: 1.2rem; margin: 32px 0 12px; }
.chart-row { display: grid; grid-template-columns: 1fr 150px; gap: 20px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.chart-side { text-align: center; }
.chart-side img { width: 56px; height: 56px; }
@media (max-width: 767px) { .chart-row { grid-template-columns: 1fr; } }
.status-note { text-align: center; color: var(--muted); font-size: .9rem; margin: -10px 0 20px; }

/* Grafici SVG */
.chart { margin: 0; }
.chart figcaption { font-size: .8rem; text-align: center; margin-bottom: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; color: var(--muted); }
.chart svg { width: 100%; height: auto; display: block; background: transparent; }
.chart .grid { stroke: #edf0f4; stroke-width: 1; } .chart .grid.strong { stroke: #d5dce4; }
.chart .ylab, .chart .xlab { font-size: 12px; fill: #7a8794; font-family: var(--font); }
/* Direzione del vento (MPS-2): punti sull'asse destro e fila di frecce sotto il grafico */
.chart .dirlab { fill: #1d3557; font-weight: 700; }
.chart .wdir circle { fill: #1d3557; opacity: .55; }
.chart .warrows path { filter: drop-shadow(0 0 1px rgba(255,255,255,.9)); }
figure.chart .legend.dir i { width: 7px; height: 7px; border-radius: 50%; opacity: .7; }
.chart-summary { font-size: .8rem; color: var(--muted); margin: 6px 0 0; text-align: center; }
.chart-empty { text-align: center; }
.period-tabs { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.period-tabs a { padding: 7px 14px; border-radius: 10px; font-size: .9rem; font-weight: 600; background: var(--soft); color: var(--navy); }
.period-tabs a.active { background: var(--blu); color: #fff; }

/* Blog */
.blog-hero-wrap { background: var(--card); border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.blog-hero { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 36px 24px; align-items: center; }
.blog-hero .img-box { height: 340px; overflow: hidden; border-radius: var(--r); }
.blog-hero .img-box img { width: 100%; height: 100%; object-fit: cover; }
.blog-hero h2 { font-size: 1.9rem; }
.data-blog-home { font-size: 13px; font-weight: 600; color: var(--blu); display: block; margin-bottom: 10px; }
.blog-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.blog-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; display: flex; flex-direction: column; }
.blog-card .img-box { display: block; order: -1; height: 200px; overflow: hidden; background: #dfe5eb; }
.blog-card .img-box img { width: 100%; height: 100%; object-fit: cover; }
.blog-card h3 { font-size: 1.05rem; margin: 14px 16px 6px; min-height: 2.4em; }
.blog-card h3 a { color: var(--navy); }
.blog-card .data-blog-home, .blog-card p { margin-left: 16px; margin-right: 16px; }
.blog-card p { font-size: 14px; color: var(--muted); margin-top: 0; flex: 1; }
.blog-card .btn-blu { margin: 0 16px 16px; width: auto; }
@media (max-width: 991px) { .blog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .blog-hero, .blog-grid { grid-template-columns: 1fr; } .blog-hero { padding: 20px 16px; } }
.post-hero { position: relative; height: 380px; overflow: hidden; background: #333; }
.post-hero img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.post-hero .tit-blog { position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 40px; background: linear-gradient(0deg, rgba(15,39,68,.8), rgba(15,39,68,0)); }
.tit-blog h1 { color: #fff; font-size: 2.1rem; margin: 0; }
.tit-blog span { color: #fff; font-size: .9rem; }
.prose { max-width: 820px; margin: 30px auto; line-height: 1.7; }
.prose img { max-width: 100%; border-radius: 12px; }
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 30px; align-items: center; }

/* Pagine istituzionali */
.page-cms { max-width: 1110px; margin: 30px auto; }
/* Collaborazioni (MPS-13) */
.partners { margin-top: 30px; }
.partner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; align-items: stretch; }
.partner-card { background: var(--card); border: 1px solid #e3e8ee; border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 1px 2px rgba(20,33,61,.05); transition: box-shadow .2s, transform .2s; }
.partner-card:hover { box-shadow: 0 8px 24px rgba(20,33,61,.1); transform: translateY(-2px); }
.partner-logo { height: 96px; display: grid; place-items: center; background: #f6f8fa; border-radius: 12px; padding: 14px 18px; }
.partner-logo img { max-width: 100%; max-height: 68px; object-fit: contain; display: block; }
.partner-logo img[style] { max-height: none; }
.partner-initials { font: 700 1.6rem/1 var(--font); color: #9aa7b4; letter-spacing: .04em; }
.partner-card h2 { margin: 0; font-size: 1.08rem; color: var(--navy); line-height: 1.3; }
.partner-card .eyebrow { margin-top: 4px; }
.partner-desc { color: var(--txt); font-size: 14px; line-height: 1.55; }
.partner-desc p { margin: 0 0 .5em; } .partner-desc p:last-child { margin: 0; }
.partner-link { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; }
.partners-cta { text-align: center; margin: 34px 0 10px; font-size: 1.05rem; }
.page-cms h1 { text-align: center; }
.duecol { column-count: 2; column-gap: 20px; text-align: justify; }
@media (max-width: 767px) { .duecol { column-count: 1; } }
.contact-imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; margin-bottom: 20px; }
.contact-imgs img { width: 100%; height: 300px; object-fit: cover; border-radius: var(--r); }
@media (max-width: 767px) { .contact-imgs { grid-template-columns: 1fr; } }

/* Il gestionale ha un foglio di stile proprio (admin.css). */

.post-hero { margin-top: 10px; }
.post-body { margin: 30px 0; font-size: .9rem; }
.post-body img { max-width: 100%; height: auto; }
.related-posts { background: var(--grigio); padding: 30px 0; }
.pager { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 40px 0; }
.pager a { padding: 6px 12px; border: 1px solid #dee2e6; border-radius: 4px; color: var(--blu); }
.pager a.active { background: var(--blu); color: #fff; border-color: var(--blu); }

/* Pagine istituzionali e moduli (contatti, come associarsi) */
.page-cms h1 { font-size: 2.2rem; margin-top: 10px; }
.page-body { max-width: 760px; margin: 0 auto 30px; font-size: .9rem; }
.page-body > p:first-child:has(> img + img) { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; max-width: none; margin: 0 -190px 40px; }
.page-body > p:first-child:has(> img + img) img { width: 100%; height: 300px; object-fit: cover; }
@media (max-width: 1140px) { .page-body > p:first-child:has(> img + img) { margin: 0 0 30px; } }
@media (max-width: 767px) { .page-body > p:first-child:has(> img + img) { grid-template-columns: 1fr; } }
.contact-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; max-width: 760px; margin: 0 auto; }
.contact-cols .page-body { margin: 0; font-size: .85rem; }
@media (max-width: 767px) { .contact-cols { grid-template-columns: 1fr; } }
.mp-form { display: grid; gap: 10px; }
.mp-form input:not([type=checkbox]):not([type=radio]), .mp-form textarea { width: 100%; border: 1px solid var(--blu-scuro); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: .85rem; }
.mp-form .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mp-form .check { font-size: .85rem; }
.btn-navy { background: var(--blu-scuro); color: #fff; border: 0; border-radius: 20px; padding: 8px 18px; font: inherit; font-weight: 600; font-size: .85rem; text-transform: uppercase; justify-self: start; cursor: pointer; }
.btn-yellow { background: var(--giallo); color: var(--blu-scuro); border: 0; padding: 10px; font: inherit; font-weight: 600; text-transform: uppercase; width: 100%; cursor: pointer; }
.notice.ok { background: #e8f5ec; border-color: #9fd3b0; }
.iscrizione { margin: 40px 0; }
.iscrizione h2 { text-align: center; text-transform: uppercase; font-size: 1.1rem; font-weight: 600; }
.mp-form.iscr label { display: block; font-size: .7rem; text-transform: uppercase; }
.mp-form.iscr input:not([type=checkbox]):not([type=radio]) { border-radius: 4px; border-color: #ced4da; margin-top: 4px; text-transform: uppercase; }
.mp-form.iscr .row { display: grid; gap: 10px; }
.mp-form.iscr .c2 { grid-template-columns: 1fr 1fr; } .mp-form.iscr .c3 { grid-template-columns: repeat(3, 1fr); } .mp-form.iscr .c4 { grid-template-columns: 3fr 1fr 1fr 1fr; }
@media (max-width: 767px) { .mp-form.iscr .c2, .mp-form.iscr .c3, .mp-form.iscr .c4, .mp-form .two { grid-template-columns: 1fr; } }
.qualita { border: 0; text-align: center; margin: 30px 0 10px; }
.qualita legend { text-transform: uppercase; font-size: .85rem; margin-bottom: 20px; width: 100%; }
.mp-form.iscr .qualita label { display: block; margin: 12px 0; font-size: .75rem; }
.dichiara { text-align: center; text-transform: uppercase; font-size: .8rem; }
.dichiara p { margin: 10px 0 4px; }
.dichiara ul { list-style: none; padding: 0; margin: 0 0 20px; }
.dichiara li::before { content: "✔ "; color: var(--blu); }
.mp-form.iscr .dichiara .check { text-transform: none; font-size: .85rem; justify-content: center; text-align: left; margin: 8px 0; }
/* Pagina con una sola immagine iniziale (come associarsi): immagine a sinistra e testo accanto, come nel sito attuale. */
.page-body:has(> p:first-child > img:only-child) { max-width: none; display: flow-root; }
.page-body > p:first-child:has(> img:only-child) { float: left; width: 50%; margin: 0 30px 20px 0; }
.page-body > p:first-child > img:only-child { width: 100%; }
@media (max-width: 767px) { .page-body > p:first-child:has(> img:only-child) { float: none; width: 100%; margin-right: 0; } }

/* Archivio pubblico della stazione */
.archive-sel { grid-template-columns: 1fr 1fr auto; max-width: 560px; margin: 10px auto 20px; }
.arch-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 10px 0 30px; }
.arch-kpis div { background: var(--grigio); padding: 12px 10px; text-align: center; }
.arch-kpis span { display: block; font-size: 11px; text-transform: uppercase; }
.arch-kpis strong { display: block; font-size: 1.35rem; font-weight: 500; }
.arch-kpis em { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
.arch-kpis .tmin, table.arch .tmin { color: #1e70b7; } .arch-kpis .tmax, table.arch .tmax { color: #d9480f; }
table.arch { width: 100%; font-size: .85rem; margin: 10px 0 20px; border-collapse: collapse; }
table.arch th { border-bottom: 1px solid #111; white-space: nowrap; }
table.arch td { border-top: 1px solid #ddd; }
table.arch tbody tr:nth-child(odd) { background: #f9f9f9; }
table.arch td, table.arch th { text-align: right; padding: 6px 8px; }
table.arch td:first-child, table.arch th:first-child { text-align: left; }
table.arch tfoot th { border-top: 2px solid #333; }
@media (max-width: 991px) { .arch-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .archive-sel { grid-template-columns: 1fr 1fr; } }

/* Statistiche climatiche (area riservata) */
table.data.stats td, table.data.stats th { padding: 6px 8px; font-size: .82rem; }
table.data.stats tr.strong td { font-weight: 600; background: #f7f8fb; }
table.data .anom-pos { color: #c92a2a; } table.data .anom-neg { color: #1864ab; }
table.data.normals input { width: 62px; padding: 4px 6px; font-size: .82rem; }
table.data.normals td, table.data.normals th { padding: 3px 4px; }

/* Legenda dei grafici SVG */
figure.chart figcaption { text-align: center; font-size: .78rem; }
figure.chart .legend { display: inline-flex; align-items: center; gap: 5px; margin: 0 8px; }
figure.chart .legend i { display: inline-block; width: 16px; height: 4px; border-radius: 2px; border: 0; }
figure.chart .legend.faint { opacity: .6; }

/* Streaming video delle webcam */
.cam-hero.stream { aspect-ratio: 16 / 9; background: #000; overflow: hidden; }
.cam-hero.stream img, .cam-hero.stream .stream-blank { width: 100%; height: 100%; object-fit: cover; }
.cam-hero.stream iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cam-hero.stream.playing img, .cam-hero.stream.playing .cap { display: none; }
.stream-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(30, 112, 183, .92); color: #fff; border: 0; border-radius: 40px; padding: 14px 26px; font: inherit; font-size: 1.1rem; font-weight: 600; text-transform: uppercase; cursor: pointer; box-shadow: 0 4px 18px rgba(0,0,0,.35); }
.stream-play span { margin-right: 8px; }
.stream-play:hover { background: var(--blu-scuro); }
.st-card .live { position: absolute; top: 8px; left: 8px; background: #d00; color: #fff; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 3px; text-transform: uppercase; }


/* Mappe con segnaposto (home, webcam): gruppi e pin della temperatura */
.mp-cluster { background: rgba(30, 112, 183, .25); border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.mp-cluster span { background: #1e70b7; color: #fff; border: 2px solid #fff; border-radius: 50%; width: calc(100% - 8px); height: calc(100% - 8px); display: flex; align-items: center; justify-content: center; font: 600 13px var(--font); box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.mp-cluster.cam { background: rgba(27, 56, 101, .25); } .mp-cluster.cam span { background: #1b3865; }
.mp-pin span { display: block; text-align: center; font: 600 12px/20px var(--font); color: var(--ink2); border: 1px solid rgba(0,0,0,.35); border-radius: 11px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.mp-pin.off span { background: #e5e7eb; color: var(--muted); }
.mp-pop { font: 13px var(--font); min-width: 180px; }
.mp-pop strong { display: block; text-transform: uppercase; margin-bottom: 4px; }
.mp-pop img { display: block; width: 100%; border-radius: 6px; margin: 4px 0; }
.mp-pop .go { display: block; margin-top: 6px; background: #1e70b7; color: #fff !important; text-align: center; border-radius: 6px; padding: 4px 8px; text-transform: uppercase; font-size: 12px; }
.mp-cluster.st { background: none; }
.mp-cluster.st span { border-radius: 15px; width: auto; height: auto; padding: 4px 8px; color: var(--ink2); border: 2px solid #fff; position: relative; font-size: 13px; }
.mp-cluster.st small { position: absolute; top: -9px; right: -9px; background: #1e70b7; color: #fff; border: 2px solid #fff; border-radius: 10px; font-size: 10px; line-height: 14px; min-width: 18px; padding: 0 3px; text-align: center; }

/* Mappa stazioni: radar e linea del tempo */
.map-tools { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin: 6px 0 8px; font-size: .9rem; }
.map-tools label { display: inline-flex; align-items: center; gap: 8px; }
.map-tools input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--blu); }
.timeline { display: flex; align-items: center; gap: 12px; background: var(--grigio); padding: 8px 12px; margin-top: 6px; border-radius: 0 0 6px 6px; }
/* Linea del tempo: istante mostrato sopra il cursore, tra i due estremi; «Adesso» compare solo nel passato */
.tl-track { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tl-meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tl-meta strong { font-size: 13.5px; color: var(--blu); white-space: nowrap; }
.timeline input[type=range] { width: 100%; margin: 0; accent-color: var(--blu); }
.tl-btn { background: var(--blu); color: #fff; border: 0; border-radius: 50%; width: 34px; height: 34px; cursor: pointer; font-size: 14px; }
.tl-btn.now { border-radius: 999px; width: auto; height: 34px; padding: 0 14px; font-size: 13px; font-weight: 600; }
.tl-btn.now:disabled { display: none; }
.tl-edge { font-size: 11px; color: var(--muted); }
#map.past { outline: 3px solid #f5a623; outline-offset: -3px; }
.radar-img { image-rendering: pixelated; }

/* ===================== Sito pubblico: componenti della veste grafica 2026 ===================== */
/* Scheda stazione */
.st-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-top: 8px; color: var(--muted); font-size: 14px; }
.st-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.st-actions svg, .btn-blu svg { flex: none; }
.st-hero { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 20px; align-items: stretch; }
.st-hero.no-fc { grid-template-columns: 1.25fr 1fr; }
@media (max-width: 1100px) { .st-hero, .st-hero.no-fc { grid-template-columns: 1fr 1fr; } .st-hero .now-card { grid-column: 1 / -1; } }
@media (max-width: 640px) { .st-hero, .st-hero.no-fc { grid-template-columns: 1fr; } }
.now-card { background: linear-gradient(155deg, #1e70b7 0%, #1b3865 100%); color: #fff; border-radius: var(--r); padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.now-top { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; color: #d7e3f1; }
.now-main { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.now-v { font-family: var(--font-h); font-size: 72px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.now-mm { display: flex; flex-direction: column; gap: 3px; font-size: 14px; color: #d7e3f1; }
.now-mm strong { color: #fff; }
.now-delta { color: var(--giallo); font-weight: 600; }
.now-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.now-grid div { background: rgba(255,255,255,.12); border-radius: 10px; padding: 8px 10px; font-size: 13px; min-width: 0; }
.now-grid span { display: block; color: #d7e3f1; }
.now-grid strong { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .now-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .now-v { font-size: 60px; } }
.st-visual { position: relative; display: block; border-radius: var(--r); overflow: hidden; background: #c9d6e3; min-height: 220px; color: #fff; }
.st-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.st-visual.map { z-index: 0; }
a.st-visual:hover { color: #fff; }
.vis-tag { position: absolute; top: 12px; left: 12px; display: inline-flex; gap: 6px; align-items: center; background: rgba(15,39,68,.72); border-radius: 999px; padding: 4px 10px; font-size: 13px; font-weight: 600; }
.vis-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px 14px 12px; background: linear-gradient(0deg, rgba(15,39,68,.85), rgba(15,39,68,0)); font-size: 13px; }
.fc-card { display: flex; flex-direction: column; gap: 12px; }
.fc-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-size: 13px; font-weight: 600; }
.fc-desc { font-size: 14px; color: var(--ink); margin: 0; line-height: 1.5; }
.fc-issued { font-size: 12px; color: var(--muted); margin-top: auto; }
.fc-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.fc-slot { background: var(--bg); border-radius: 12px; padding: 8px 4px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 13px; }
.fc-slot.morning { background: #fbf6de; } .fc-slot.afternoon { background: #fdefd0; } .fc-slot.evening { background: #e3eef6; }
.fc-lbl { font-weight: 600; color: var(--navy); }
.fc-txt { font-size: 11.5px; color: var(--muted); line-height: 1.2; }

/* Schede delle grandezze */
.mgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .mgrid { grid-template-columns: 1fr; } }
.mcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mc-h { display: flex; align-items: center; gap: 10px; }
.tile { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.t-temp { background: #fde7df; color: #d84b2b; } .t-hum { background: #e3f4ef; color: #1f7a63; } .t-rain { background: #e1eefa; color: #1e70b7; }
.t-pres { background: #eef0fa; color: #4b4fb0; } .t-wind { background: #eaf2f7; color: #2f6e8f; } .t-sun { background: #fff4d6; color: #8a6400; }
.t-air { background: #fff8c9; color: #8a6400; } .t-neutral { background: var(--soft); color: var(--navy); }
.mc-t { font-weight: 700; color: var(--navy); flex: 1; line-height: 1.25; }
.hint { width: 22px; height: 22px; border-radius: 50%; border: 1px solid #d5dce4; color: var(--muted); font-size: 12px; font-weight: 700; display: grid; place-items: center; cursor: help; flex: none; position: relative; }
.hint:hover::after, .hint:focus::after { content: attr(aria-label); position: absolute; right: -6px; top: 28px; width: 230px; background: var(--navy-bg); color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.45; padding: 8px 10px; border-radius: 10px; z-index: 20; box-shadow: 0 6px 18px rgba(16,24,40,.2); }
.mc-v { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.mc-v .num { font-family: var(--font-h); font-weight: 800; font-size: 34px; line-height: 1.05; letter-spacing: -.01em; }
.mc-v .unit { font-size: 17px; font-weight: 700; }
.mc-note { font-size: 13px; color: var(--muted); margin-left: 4px; }
.mc-chart { margin-top: auto; }
.spark { width: 100%; height: auto; display: block; overflow: visible; }
.mc-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: #9aa5b1; margin-top: 2px; }
.mc-foot { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 13px; border-top: 1px solid #eef1f5; padding-top: 10px; }
.mc-foot b { font-weight: 700; color: var(--navy); }
.mc-foot b.vmin { color: var(--t-cold); } .mc-foot b.vmax { color: var(--t-hot); }
.mc-rose { display: flex; justify-content: center; margin: auto 0; }
.mc-advice { font-size: 13px; color: var(--muted); margin: 0; line-height: 1.5; }
.aq-scale { display: flex; gap: 3px; }
.aq-scale span { flex: 1; height: 10px; border-radius: 5px; }
.aq-scale span.on { outline: 2px solid var(--navy); outline-offset: 2px; }
.deltas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.deltas li { display: flex; justify-content: space-between; gap: 8px; }

/* Calendario del mese e informazioni sulla stazione */
.st-lower { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-top: 32px; align-items: start; }
.st-lower.single { grid-template-columns: 1fr; max-width: 520px; }
@media (max-width: 991px) { .st-lower { grid-template-columns: 1fr; } }
.st-lower h2 { font-size: 1.2rem; margin: 0; }
.cal-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.cal { display: none; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; max-width: 620px; }
.st-lower:has(#calv-max:checked) .cal-max, .st-lower:has(#calv-min:checked) .cal-min, .st-lower:has(#calv-rain:checked) .cal-rain { display: grid; }
.cal-dn { font-size: 11px; font-weight: 600; text-transform: uppercase; color: var(--muted); text-align: center; }
.cal-day { aspect-ratio: 1 / .86; border-radius: 9px; display: flex; flex-direction: column; justify-content: space-between; padding: 4px 6px; font-size: 11px; color: var(--ink2); background: #eef1f5; min-width: 0; }
.cal-day i { font-style: normal; opacity: .75; }
.cal-day b { font-size: 13px; text-align: right; white-space: nowrap; }
.cal-day.dark { color: #fff; }
.cal-day.empty { color: #9aa5b1; background: #f4f6f9; }
.cal-day.today { outline: 2px solid var(--navy); outline-offset: 1px; }
a.cal-day:hover { filter: brightness(.95); color: var(--ink2); }
a.cal-day.dark:hover { color: #fff; }
.cal-sum { display: flex; gap: 8px 24px; flex-wrap: wrap; margin-top: 16px; font-size: 14px; }
@media (max-width: 560px) { .cal-day b { font-size: 11px; } .cal { gap: 4px; } }
.st-info-card { display: flex; flex-direction: column; gap: 14px; }
.st-map { height: 170px; border-radius: 12px; overflow: hidden; z-index: 0; }
.facts-pub { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0; font-size: 14px; }
.facts-pub dt { color: var(--muted); } .facts-pub dd { margin: 0; }
.near { padding: 16px; display: flex; flex-direction: column; gap: 4px; color: var(--ink); }
.near:hover { border-color: #c5d3e3; color: var(--ink); }
.near-n { font-weight: 700; color: var(--navy); }
.near-v { font-family: var(--font-h); font-weight: 800; font-size: 28px; line-height: 1.1; }
.charts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .charts { grid-template-columns: 1fr; } }
.chart-panel h3 { font-size: 1rem; margin: 0 0 6px; }
.chart-panel .chart figcaption strong { display: none; }

/* Preferite */
.js-fav.on { background: #fff8e1; border-color: #f3e2a9; }
.js-fav.on svg { fill: var(--giallo); stroke: #c99700; }

/* Home */
.home-top { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .home-top { grid-template-columns: 1fr; } }
.home-map { overflow: hidden; display: flex; flex-direction: column; }
.map-chips { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.home-map-canvas { height: 470px; background: #e9eef2; z-index: 0; }
@media (max-width: 640px) { .home-map-canvas { height: 360px; } }
.home-map-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; }
.home-side { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 1001px) { .home-top { align-items: stretch; } .home-map-canvas { flex: 1 0 470px; } }
/* Riquadro in evidenza (MPS-33): occupa lo spazio che resta fino al fondo della mappa */
.home-feature { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; color: var(--ink); min-height: 0; }
a.home-feature:hover strong { color: var(--blu); }
.hf-img { flex: 1 1 120px; min-height: 120px; max-height: 260px; background: #dfe5eb; overflow: hidden; }
.hf-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hf-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.hf-body strong { color: var(--navy); font-size: 1.05rem; line-height: 1.3; }
.hf-sum { color: var(--txt); font-size: 14px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hf-body .more-link { margin-top: 2px; }
.home-feature.net { justify-content: space-between; gap: 12px; }
.net-nums { display: flex; flex-direction: column; gap: 8px; color: var(--txt); }
.net-nums b { font-size: 1.5rem; color: var(--navy); margin-right: 6px; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .hf-img { flex: none; height: 180px; } }
.fc-select { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: var(--card); color: var(--blu); font-weight: 600; max-width: 60%; }
.more-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; margin-top: 4px; }
.extremes { list-style: none; margin: 12px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.extremes li { display: flex; align-items: center; gap: 12px; }
.tile.sm { width: 36px; height: 36px; border-radius: 10px; }
.ex-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; font-size: 13px; color: var(--muted); }
.ex-txt a { font-weight: 600; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.extremes b { font-weight: 700; color: var(--navy); white-space: nowrap; }
.extremes b.vmax { color: var(--t-hot); } .extremes b.vmin { color: var(--t-cold); }
.scard { padding: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.scard:hover { border-color: #c5d3e3; color: var(--ink); }
.scard-h { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.scard-h strong { color: var(--navy); }
.scard-v { font-family: var(--font-h); font-weight: 800; font-size: 40px; line-height: 1.05; }
.scard-mm { font-size: 13px; color: var(--muted); }
.scard-d { display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--muted); border-top: 1px solid #eef1f5; padding-top: 8px; margin-top: 4px; }
.scard-d b { color: var(--ink); font-weight: 600; }
.home-fc { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
@media (max-width: 1000px) { .home-fc { grid-template-columns: 1fr 1fr; } .bulletin-card { grid-column: 1 / -1; } }
@media (max-width: 640px) { .home-fc { grid-template-columns: 1fr; } }
.bulletin-card p { margin: 8px 0 10px; line-height: 1.6; }
.day-card { display: flex; gap: 14px; align-items: center; color: var(--ink); }
.day-card:hover { border-color: #c5d3e3; color: var(--ink); }
.day-card strong { display: block; color: var(--navy); margin: 2px 0; }
.home-bottom { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-top: 36px; }
.home-bottom.no-air { grid-template-columns: 1fr; }
@media (max-width: 900px) { .home-bottom { grid-template-columns: 1fr; } }
.sec-head.tight { margin: 0 0 12px; }
.sec-head.tight h2 { font-size: 1.2rem; }
.aq-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.aq-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.aq-chip { border-radius: 999px; padding: 4px 10px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.post-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.post-row { display: flex; gap: 14px; color: var(--ink); align-items: flex-start; }
.post-row:hover strong { color: var(--blu); }
.post-row strong { display: block; color: var(--navy); line-height: 1.35; margin-top: 2px; }
.post-img { width: 120px; height: 84px; flex: none; border-radius: 12px; overflow: hidden; background: #dfe5eb; }
.post-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.welcome { margin-top: 36px; }
.welcome h2 { font-size: 1.2rem; }
.welcome-body { columns: 2 320px; column-gap: 32px; color: var(--txt); font-size: 15px; }
.welcome-body p { break-inside: avoid; }

/* Riquadri delle webcam */
.cam-grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1100px) { .cam-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .cam-grid4 { grid-template-columns: 1fr; } }
.camtile { position: relative; display: block; border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 9; background: #c9d6e3; color: #fff; }
.camtile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.camtile:hover img { transform: scale(1.03); }
.camtile:hover { color: #fff; }
.cam-live { position: absolute; top: 10px; left: 10px; background: #d61f1f; color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 5px; text-transform: uppercase; letter-spacing: .03em; }
.cam-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--card); }
.cam-temp { position: absolute; top: 10px; right: 10px; color: var(--ink2); font-weight: 800; font-size: 13px; padding: 3px 8px; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.cam-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 12px 10px; background: linear-gradient(0deg, rgba(15,39,68,.88), rgba(15,39,68,0)); display: flex; justify-content: space-between; align-items: end; gap: 8px; font-size: 13px; }
.cam-cap strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.camtile.stale img { filter: grayscale(.7) brightness(.8); }
.cam-stale { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); background: rgba(15,39,68,.8); border-radius: 10px; padding: 6px 10px; font-size: 12.5px; text-align: center; width: max-content; max-width: 90%; }

/* Segnaposto delle mappe */
.mp-pin span { display: block; text-align: center; font: 700 12px/20px var(--font); border: 1px solid rgba(0,0,0,.22); border-radius: 11px; box-shadow: 0 1px 3px rgba(0,0,0,.25); white-space: nowrap; }
.mp-pin.off span { background: #e5e7eb; color: var(--muted); }
/* Stazione la cui etichetta non trova posto a questo zoom (MPS-32): pallino del colore del valore */
.mp-pin.dot span { width: 10px; height: 10px; margin: 6px auto 0; padding: 0; font-size: 0; line-height: 0; border: 0; border-radius: 50%; box-shadow: 0 0 0 1.5px #fff, 0 1px 2px rgba(0,0,0,.35); }
.mp-pin.off.dot span { width: 8px; height: 8px; margin-top: 7px; }
.mp-cluster.st span { white-space: nowrap; }
.leaflet-container { font-family: var(--font); }

/* Stazioni: mappa, schede, tabella */
.map-panel { overflow: hidden; }
.map-panel { position: relative; }
.map-bar { display: none; }
.map-vars { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.mv-group { display: inline-flex; padding-right: 14px; border-right: 1px solid var(--line); }
.mv-group:last-child { border-right: 0; }
.mv-opts { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.mv-gl, .map-vars .l-m { display: none; }
.map-panel .map-tools { padding: 8px 14px; margin: 0; border-bottom: 1px solid var(--line); }
.map-tools .radar-opacity[hidden] { display: none; }
.map-big { height: 640px; background: #e9eef2; z-index: 0; }
.map-panel .timeline { margin: 0; border-radius: 0; background: var(--card); border-top: 1px solid var(--line); padding: 10px 14px; }
/* Scale dei colori: una barra continua con i valori di soglia sotto (js/mappa.js dirada le etichette) */
.map-legends { padding: 4px 14px 14px; display: flex; flex-direction: column; gap: 10px; }
.map-legends > [hidden], .map-legends > :empty { display: none; }
.lg { display: flex; align-items: flex-start; gap: 10px; max-width: 720px; }
.lg-u { flex: none; min-width: 34px; font-size: 12px; font-weight: 700; color: var(--navy); line-height: 12px; padding-top: 1px; }
.lg-scale { flex: 1; min-width: 0; }
.lg-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.lg-bar span { flex: 1; }
.lg-ticks { position: relative; height: 16px; margin-top: 3px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lg-ticks span { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.lg-ticks span::before { content: ""; position: absolute; left: 50%; top: -5px; width: 1px; height: 4px; background: rgba(0, 0, 0, .25); }
.lg-ticks span.l { transform: none; }
.lg-ticks span.l::before { left: 0; }
.lg-ticks span.r { transform: translateX(-100%); }
.lg-ticks span.r::before { left: auto; right: 0; }
.lg-cap { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* Mappa su smartphone: due pulsanti al posto della fila di grandezze e delle opzioni; i pannelli si
   aprono sopra la mappa (solo con lo script attivo: senza, restano visibili in pagina) */
@media (max-width: 767px) {
  .map-bar { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .mb-btn { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--navy); font: inherit; cursor: pointer; text-align: left; }
  .mb-btn[aria-expanded=true] { border-color: var(--blu); box-shadow: 0 0 0 1px var(--blu); }
  .mb-var { flex: 1; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 0; }
  .mb-var .mb-k { grid-column: 1; font-size: 11px; line-height: 1.2; color: var(--muted); }
  .mb-var strong { grid-column: 1; font-size: 15px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .mb-chev { grid-column: 2; grid-row: 1 / 3; align-self: center; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
  .mb-btn[aria-expanded=true] .mb-chev { transform: rotate(180deg); }
  .mb-opt { flex: none; position: relative; font-weight: 600; font-size: 14px; }
  .mb-opt svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
  .mb-dot { position: absolute; top: 7px; right: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--blu); }
  .mb-dot[hidden] { display: none; }
  .js-mp .map-vars, .js-mp .map-tools { display: none; position: absolute; left: 10px; right: 10px; top: var(--mb-h, 67px); z-index: 1001; max-height: min(70vh, 470px); overflow-y: auto; overscroll-behavior: contain;
    background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 30px rgba(16, 24, 40, .22); padding: 12px 14px; }
  .js-mp .map-vars.open { display: flex; flex-direction: column; flex-wrap: nowrap; gap: 12px; }
  .js-mp .map-tools.open { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; gap: 4px; }
  .map-vars .mv-group { display: flex; flex-direction: column; gap: 6px; padding: 0; border: 0; }
  .map-vars .mv-gl { display: block; font-size: 12px; font-weight: 700; color: var(--muted); }
  .map-vars .mv-opts { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
  .map-vars .chip { justify-content: center; min-height: 40px; padding: 6px 8px; border-radius: 10px; }
  .map-vars .l-d { display: none; }
  .map-vars .l-m { display: inline; }
  .map-panel .map-tools label { min-height: 44px; font-size: 15px; }
  .map-tools .radar-opacity { flex-direction: column; align-items: stretch !important; gap: 2px !important; font-size: 13px !important; color: var(--muted); min-height: 0 !important; padding-bottom: 6px; }
  .map-tools .radar-opacity input { width: 100%; }
  .map-tools .map-help { padding: 10px 0 2px; border-top: 1px solid var(--line); margin-top: 4px; }
  .map-big { height: max(380px, calc(100svh - 330px)); }
}
.mlabel span { display: inline-block; transform: translate(-50%, -50%); padding: 2px 6px; border-radius: 7px; font: 700 12.5px/1.2 var(--font); color: var(--ink2); white-space: nowrap; box-shadow: 0 0 0 1px rgba(0,0,0,.14), 0 1px 3px rgba(0,0,0,.18); }
/* Dato in ritardo: bordo tratteggiato invece della trasparenza, che toglieva leggibilità (MPS-1). */
.mlabel.late span { box-shadow: none; outline: 1.5px dashed rgba(20,33,61,.6); outline-offset: 0; }
/* Etichetta diradata o stazione senza dato: pallino colorato, il valore resta nel titolo e nel popup (MPS-4). */
.mlabel.dot span, .mlabel.none span { width: 10px; height: 10px; padding: 0; font-size: 0; border-radius: 50%; outline: 0; box-shadow: 0 0 0 1.5px #fff, 0 1px 2px rgba(0,0,0,.35); }
.mlabel.none span { width: 8px; height: 8px; }
.leaflet-marker-icon.mlabel { cursor: pointer; }
.tl-btn { background: var(--blu); color: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; font-size: 14px; flex: none; }
.timeline strong { color: var(--blu); }
.filters { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px; margin-bottom: 12px; }
.fsearch { display: flex; align-items: center; gap: 8px; flex: 1 1 260px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; min-height: 44px; color: var(--muted); }
.fsearch input { border: 0; background: transparent; outline: none; width: 100%; font-size: 15px; color: var(--ink); }
.zone-chips { margin: 4px 0 14px; }
.st-cards .scard.off { opacity: .75; }
.st-cards .scard .badge { align-self: flex-start; margin-top: 8px; }
.dt-tools .chips label { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); }

/* Filtri combinati delle griglie */
.hide-q, .hide-z, .hide-p { display: none !important; }
/* Webcam a gruppi: «Mostra altre» sotto la griglia */
.cam-more { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: 18px; }
.cam-more[hidden] { display: none; }

/* Pagina webcam */
.cam-feature { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 1000px) { .cam-feature { grid-template-columns: 1fr; } }
.cam-big { position: relative; display: block; border-radius: var(--r); overflow: hidden; aspect-ratio: 16 / 9; background: #c9d6e3; color: #fff; }
.cam-big img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-big:hover { color: #fff; }
.cam-big-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 18px 14px; background: linear-gradient(0deg, rgba(15,39,68,.88), rgba(15,39,68,0)); display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.cam-big-cap strong { font-size: 18px; }
.cam-side { display: flex; flex-direction: column; gap: 16px; }
.cam-st { display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.cam-st:hover { border-color: #c5d3e3; color: var(--ink); }
.cam-st-row { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.cam-st-row strong { color: var(--navy); }
.host-card { background: #fff8e1; border-color: #f3e2a9; }
.host-card p { font-size: 14px; color: var(--muted); margin: 6px 0 8px; }

/* Scheda webcam */
.cam-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .cam-layout { grid-template-columns: 1fr; } }
.cam-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cam-aside { display: flex; flex-direction: column; gap: 16px; }
.cam-aside h2 { font-size: 1.15rem; margin: 0; }
.cam-hero { position: relative; border-radius: var(--r); overflow: hidden; background: #0f2744; margin: 0; }
.cam-hero img { width: 100%; display: block; }
.cam-hero .cap { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, rgba(15,39,68,.85), rgba(15,39,68,0)); color: #fff; display: flex; justify-content: space-between; gap: 10px; padding: 24px 14px 10px; font-size: .9rem; }
.cam-archive h2 { font-size: 1.15rem; margin: 0; }
.frames { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-top: 10px; max-height: 520px; overflow-y: auto; }
.frames a { display: block; font-size: .8rem; color: var(--muted); text-align: center; border-radius: 8px; padding-bottom: 2px; }
.frames a.on { background: var(--soft); color: var(--navy); font-weight: 700; }
.frames img { aspect-ratio: 16/9; object-fit: cover; width: 100%; border-radius: 8px; display: block; margin-bottom: 2px; }
.stream-play { border-radius: 999px; text-transform: none; }

/* Previsioni */
.day-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
@media (max-width: 760px) { .day-tabs { grid-template-columns: 1fr; } }
.dtab { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); color: var(--navy); }
.dtab:hover { border-color: #c5d3e3; color: var(--navy); }
.dtab.on { background: var(--navy-bg); border-color: var(--navy-bg); color: #fff; }
.dtab strong { display: block; }
.dtab-t { font-size: 13.5px; opacity: .8; }
.dtab-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--soft); color: var(--navy); display: grid; place-items: center; flex: none; }
.fc-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .fc-layout { grid-template-columns: 1fr; } }
.fc-mapbox { overflow: hidden; }
.fc-map-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.fc-maps .fcm { display: none; padding: 10px; }
.fc-layout:has(#fs-m:checked) .fcm-m, .fc-layout:has(#fs-p:checked) .fcm-p, .fc-layout:has(#fs-s:checked) .fcm-s { display: block; }
.fc-map { width: 100%; height: auto; display: block; }
.fc-map .prov { stroke: #1b3865; stroke-width: 2; }
.fc-map .prov.matt { fill: #fbf6de; } .fc-map .prov.pome { fill: #fdefd0; } .fc-map .prov.sera { fill: #e3eef6; }
.fc-map .lake { fill: #9cc7e6; stroke: #6fa3cc; stroke-width: 1.2; }
.fc-map .name { font: 600 13px var(--font); fill: #1b3865; }
.fc-map .temps { font: 700 13px var(--font); }
.fc-map .tmin { fill: var(--t-cold); } .fc-map .tmax { fill: var(--t-hot); }
.fc-right { display: flex; flex-direction: column; gap: 16px; }
.bulletin-full .prose-in { line-height: 1.7; margin-top: 8px; }
.bulletin-full .prose-in p:last-child { margin-bottom: 0; }
.author { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #eef1f5; font-size: 14px; }
.author-badge { width: 38px; height: 38px; border-radius: 50%; background: var(--blu); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.fc-facts .panel { text-align: center; padding: 14px; }
.fc-facts strong { display: block; font-family: var(--font-h); font-size: 1.15rem; color: var(--navy); margin-top: 4px; }
.fc-table td { vertical-align: middle; }
.fc-table th { cursor: default; } .fc-table th::after { content: none; }
.fc-table td.vmin, .fc-table td.vmax { font-size: 1rem; }

/* Qualità dell'aria */
.aq-summary { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; margin-bottom: 20px; }
.aq-summary h2 { font-size: 1.45rem; margin: 4px 0 6px; }
.aq-summary p { margin: 0; color: var(--txt); line-height: 1.55; }
.aq-sq { width: 76px; height: 76px; border-radius: 20px; display: grid; place-items: center; flex: none; }
.aq-sum-txt { flex: 1 1 420px; }
.aq-kpis { display: flex; gap: 10px; }
.aq-kpis div { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 10px 16px; text-align: center; }
.aq-kpis strong { display: block; font-family: var(--font-h); font-size: 1.6rem; color: var(--navy); }
.aq-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1000px) { .aq-layout { grid-template-columns: 1fr; } }
.aq-map { height: 480px; background: #e9eef2; z-index: 0; }
.aq-pin span { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.3); font: 800 13px var(--font); }
.aq-legend h2 { font-size: 1.15rem; margin: 0 0 4px; }
.aq-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.aq-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 6px 6px 8px; border-bottom: 1px solid var(--line); }
.aq-table td { padding: 8px 6px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.aq-table td:nth-child(3), .aq-table td:nth-child(4) { white-space: nowrap; color: var(--muted); }
.aq-sw { display: block; width: 22px; height: 22px; border-radius: 6px; }
.aq-adv { display: block; font-size: 12px; color: var(--muted); }
.aq-card { display: flex; flex-direction: column; gap: 12px; color: var(--ink); }
.aq-card:hover { border-color: #c5d3e3; color: var(--ink); }
.aq-card-h { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.aq-card-h > span:first-child { display: flex; flex-direction: column; }
.aq-card-h strong { color: var(--navy); }
.aq-vals { display: flex; gap: 22px; align-items: baseline; }
.aq-big { font-family: var(--font-h); font-weight: 800; font-size: 32px; color: var(--navy); }
.aq-mid { font-family: var(--font-h); font-weight: 800; font-size: 22px; color: var(--navy); }
.aq-info { margin-top: 32px; }
.aq-info h2 { font-size: 1.15rem; }
.aq-info p { color: var(--txt); line-height: 1.6; }

/* Ritocchi per smartphone */
@media (max-width: 640px) {
  .st-actions { gap: 8px; }
  .st-actions .btn-blu { min-height: 38px; padding: 0 12px; font-size: 14px; }
  .page-head h1 { font-size: 1.55rem; }
  .now-card { padding: 18px; }
  .sec-head { margin-top: 28px; }
}
@media (max-width: 640px) {
  .fav-grid, .st-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .scard { padding: 12px; }
  .scard-v { font-size: 30px; }
  .scard-h { flex-direction: column; gap: 0; }
  .scard-d, .scard-mm { font-size: 12px; }
}

/* Grafici interattivi (js/charts.js): cursore verticale, riquadro dei valori, vuoti nei dati. */
.chart svg[data-series] { touch-action: pan-y; cursor: crosshair; }
.chart svg[data-series]:focus-visible { outline: 2px solid var(--blu); outline-offset: 2px; border-radius: 4px; }
.chart .cursor { stroke: #14213d; stroke-width: 1; stroke-dasharray: 3 3; pointer-events: none; }
.chart .gapzone { fill: #f1f3f6; }
.chart-tip { position: absolute; z-index: 5; pointer-events: none; background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(20,33,61,.14); padding: 7px 10px; font-size: .78rem; line-height: 1.45; white-space: nowrap; display: flex; flex-direction: column; text-align: left; }
.chart-tip[hidden] { display: none; }
.chart-tip strong { font-size: .76rem; color: var(--muted); font-weight: 600; text-transform: capitalize; }
.chart-tip span { display: flex; align-items: center; gap: 6px; color: var(--ink2); }
.chart-tip i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.chart-tip b { margin-left: auto; padding-left: 10px; }

/* Webcam (MPS-40): immagine a tutto schermo nella pagina e player dell'archivio. */
.cam-hero a.js-viewer { display: block; cursor: zoom-in; }
.cam-expand { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(10,20,40,.55); color: #fff; pointer-events: none; opacity: .85; transition: opacity .15s; backdrop-filter: blur(4px); }
.cam-hero:hover .cam-expand { opacity: 1; }
.cam-player { margin: 12px 0 4px; }
.cp-stage { position: relative; border-radius: 12px; overflow: hidden; background: #0f2744; }
.cp-img { display: block; width: 100%; height: auto; cursor: zoom-in; }
.cp-full { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 10px; border: 0; display: grid; place-items: center;
  background: rgba(10,20,40,.6); color: #fff; cursor: pointer; backdrop-filter: blur(4px); }
.cp-full:hover { background: rgba(10,20,40,.8); }
.cp-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.cp-bar button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--navy); display: grid; place-items: center; cursor: pointer; flex: none; }
.cp-bar button.cp-play { width: 46px; height: 46px; background: var(--blu); border-color: var(--blu); color: #fff; }
.cp-bar button:disabled { opacity: .4; cursor: default; }
.cp-bar button:focus-visible { outline: 2px solid var(--blu); outline-offset: 2px; }
.cp-range { flex: 1 1 200px; min-width: 140px; accent-color: var(--blu); }
.cp-time { font-variant-numeric: tabular-nums; min-width: 3.2em; color: var(--navy); font-size: 1.05rem; }
.cp-speed-l { display: inline-flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }
.cp-speed { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: var(--card); font: inherit; color: var(--navy); }
.cp-hint { margin: 6px 0 0; }

dialog.viewer { position: fixed; inset: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: rgba(5,10,20,.94); color: #fff; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); overflow: hidden; }
dialog.viewer:not([open]) { display: none; }
dialog.viewer::backdrop { background: rgba(5,10,20,.94); }
html.vw-open { overflow: hidden; }
.vw-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.vw-cap { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .92; }
.vw-btn { width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; cursor: pointer; flex: none; }
.vw-btn:hover { background: rgba(255,255,255,.22); }
.vw-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.vw-stage { min-height: 0; min-width: 0; display: grid; place-items: center; padding: 0 12px; overflow: hidden; }
.vw-img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; border-radius: 6px; }
.vw-bar { padding: 10px 14px 16px; }
dialog.viewer.single .vw-bar { display: none; }
.vw-bar .cp-bar { max-width: 1100px; margin: 0 auto; }
.vw-bar .cp-bar button { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
.vw-bar .cp-bar button.cp-play { background: var(--blu); }
.vw-bar .cp-time { color: #fff; }
.vw-bar .cp-speed-l { color: rgba(255,255,255,.75); }
.vw-bar .cp-speed { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.2); }
.vw-bar .cp-speed option { color: var(--ink2); }
@media (max-width: 640px) { .cp-hint { display: none; } .cp-bar { gap: 8px; } }

/* Scheda della stazione sulle mappe (al posto del popup): angolo della mappa su schermo largo, dal basso su telefono */
.stc { position: absolute; right: 12px; width: 300px; z-index: 1100; overflow: auto; background: var(--card); border: 1px solid #dfe5eb; border-radius: 16px;
  box-shadow: 0 12px 32px rgba(20,33,61,.18); padding: 14px 16px 16px; font: 14px/1.4 var(--font); color: var(--ink, #26323f); }
.stc[hidden] { display: none; }
.stc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.stc-name { display: block; font-size: 16px; color: var(--navy); line-height: 1.25; }
.stc-sub { display: block; font-size: 12.5px; color: var(--txt3); margin-top: 2px; }
.stc-x { flex: none; border: 0; background: transparent; color: var(--txt3); padding: 2px; border-radius: 8px; cursor: pointer; line-height: 0; }
.stc-x:hover { background: #eef2f6; color: var(--navy); }
.stc-state { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; }
.stc-state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stc-state.ok { background: #e6f4ea; color: #1e7b3c; } .stc-state.late { background: #fdf3dc; color: #8a5a00; } .stc-state.off { background: #eef1f4; color: var(--muted); }
.stc-main { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.stc-big { font-size: 28px; font-weight: 700; line-height: 1; padding: 8px 12px; border-radius: 12px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stc-main-l { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.stc-main-l b { color: var(--navy); }
.stc-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.stc-tile { background: #f4f7fa; border-radius: 10px; padding: 7px 9px; min-width: 0; }
.stc-tile span { display: block; font-size: 11.5px; color: var(--txt3); }
.stc-tile b { display: block; font-size: 14px; color: var(--navy); }
.stc-tile small { display: block; font-size: 11px; color: var(--txt3); font-weight: 400; }
.stc-spark { margin-top: 12px; display: grid; grid-template-columns: 1fr auto; font-size: 11.5px; color: var(--txt3); }
.stc-spark svg { grid-column: 1 / -1; width: 100%; height: 46px; display: block; margin-bottom: 2px; }
.stc-spark.loading { height: 62px; border-radius: 8px; background: #f4f7fa; }
.stc-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.stc-actions { display: flex; gap: 8px; margin-top: 14px; }
.stc-go { flex: 1; text-align: center; background: var(--blu); color: #fff !important; border-radius: 10px; padding: 8px 12px; font-weight: 600; text-decoration: none; }
.stc-go:hover { background: var(--navy-bg); }
.stc-fav { flex: none; width: 40px; border: 1px solid #d5dce4; background: var(--card); border-radius: 10px; color: var(--txt3); cursor: pointer; display: grid; place-items: center; }
.stc-fav.on { color: #d99a00; border-color: #f0c64a; background: #fff8e1; }
.stc-fav.on svg { fill: currentColor; }
/* Etichetta al passaggio del mouse e stazione selezionata */
.leaflet-tooltip.mp-tip { font: 600 12.5px/1.3 var(--font); color: var(--navy); border: 1px solid #dfe5eb; border-radius: 8px; box-shadow: 0 4px 12px rgba(20,33,61,.15); padding: 4px 8px; }
.leaflet-tooltip.mp-tip b { font-weight: 700; } .leaflet-tooltip.mp-tip span { color: var(--txt3); font-weight: 400; }
.mlabel.sel span, .mp-pin.sel span { outline: 2.5px solid #14213d; outline-offset: 2px; }
.mlabel.sel, .mp-pin.sel { z-index: 900 !important; }
@media (max-width: 640px) {
  .stc { position: fixed; left: 0; right: 0; bottom: 0; top: auto !important; width: auto; max-height: 72vh !important; border-radius: 18px 18px 0 0; padding-bottom: 20px; }
  .stc::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 2px; background: #d5dce4; margin: -4px auto 10px; }
}

/* Pagina del sensore della qualità dell'aria (MPS-47). */
.aqh { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 20px; align-items: stretch; }
.aqh h2 { font-size: 1.15rem; margin: 0 0 10px; }
.aqh-now { padding: 22px; display: flex; flex-direction: column; gap: 14px; border-top: 6px solid var(--band); background: linear-gradient(180deg, color-mix(in srgb, var(--band) 12%, #fff) 0%, #fff 70%); }
.aqh-top { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--txt2); flex-wrap: wrap; }
.aqh-class { display: flex; gap: 16px; align-items: center; }
.aqh-class .aq-sq { width: 64px; height: 64px; border-radius: 18px; }
.aqh-class strong { font-family: var(--font-h); font-size: 1.45rem; color: var(--navy); line-height: 1.15; }
.aqh-class p { margin: 4px 0 0; color: var(--txt); line-height: 1.5; font-size: 14.5px; }
.aqh-vals { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; }
.aqh-v { display: grid; grid-template-columns: auto auto; column-gap: 6px; align-items: baseline; }
.aqh-v .aqh-l { grid-column: 1 / -1; font-size: 13px; font-weight: 700; color: var(--txt2); }
.aqh-v .aqh-n { font-family: var(--font-h); font-weight: 800; font-size: 44px; line-height: 1; }
.aqh-v.small .aqh-n { font-size: 28px; color: var(--navy); }
.aqh-v .aqh-u { font-size: 13px; color: var(--txt2); }
.aqh-v .aq-chip { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
.aqh-sensor { margin: 0; font-size: 12.5px; color: var(--txt3); border-top: 1px solid #eef1f5; padding-top: 10px; }
.aqh-avg, .aqh-bars { display: flex; flex-direction: column; gap: 12px; }
.aqh-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.aqh-table th, .aqh-table td { padding: 6px 4px; text-align: right; border-bottom: 1px solid #eef1f5; }
.aqh-table thead th { font-size: 12px; color: var(--txt3); font-weight: 600; }
.aqh-table tbody th { text-align: left; color: var(--navy); }
.aqh-table td { font-weight: 700; color: var(--navy); white-space: nowrap; }
.aqh-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.aqh-limit { display: flex; flex-direction: column; gap: 6px; }
.aqh-limit-h { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.aqh-bar { height: 10px; border-radius: 5px; background: #eef1f5; overflow: hidden; }
.aqh-bar span { display: block; height: 100%; border-radius: 5px; }
.aqh-exc { display: flex; gap: 12px; align-items: center; background: #f6f8fb; border-radius: 12px; padding: 10px 12px; font-size: 14px; line-height: 1.4; }
.aqh-exc strong { font-family: var(--font-h); font-size: 2rem; line-height: 1; }
.aqh-bars svg { width: 100%; height: auto; }
.aqh-ref td:first-child { white-space: normal; }
.aqh-meteo { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.aqh-wx { display: flex; flex-direction: column; gap: 4px; color: var(--ink); flex: 1 1 380px; }
.aqh-wx strong { color: var(--navy); font-size: 1.05rem; }
.aqh-wx-v { display: flex; gap: 18px; flex-wrap: wrap; font-size: 14px; color: var(--txt2); }
.aqh-wx-v b { color: var(--navy); font-size: 1.1rem; }
.aqh-tip { margin: 0; flex: 1 1 320px; color: var(--txt); line-height: 1.55; border-left: 4px solid #50ccaa; padding-left: 12px; }
.cal-day.exceed { box-shadow: inset 0 0 0 3px #d63a3a; }
.cal-day.partial { opacity: .6; }
.arch td.exc, .arch th.exc, .arch-kpis strong.exc { color: #d63a3a; font-weight: 800; }
.arch tr.partial td { color: #8a95a1; }
.aq-legend-row { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-top: 8px; }
.aq-legend-row i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.aq-stack { width: 100%; height: auto; }
@media (max-width: 1100px) { .aqh { grid-template-columns: 1fr 1fr; } .aqh-now { grid-column: 1 / -1; } }
@media (max-width: 700px) { .aqh { grid-template-columns: 1fr; } .aqh-v .aqh-n { font-size: 38px; } }
.aqh-ref td { white-space: nowrap; }
.aqh-ref td:first-child { white-space: normal; text-align: left; }
.cal-head h2::first-letter { text-transform: uppercase; }
/* Dati dell'associazione nel piè di pagina (MPS-34). */
.foot-org { font-style: normal; display: flex; flex-direction: column; gap: 3px; line-height: 1.5; margin-bottom: 10px; }
.foot-org strong { color: #fff; }
/* Guida «Come leggere i dati» (MPS-22). */
.guide { max-width: 980px; }
.guide-toc { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 20px; font-weight: 600; }
.guide-sec { margin-bottom: 20px; scroll-margin-top: 90px; line-height: 1.65; }
.guide-sec h2 { font-size: 1.3rem; margin: 0 0 10px; }
.guide-sec h3 { font-size: 1rem; margin: 16px 0 8px; }
.guide-sec ul { padding-left: 1.2em; margin: 0 0 8px; }
.guide-states { display: grid; grid-template-columns: max-content 1fr; gap: 10px 16px; align-items: center; margin: 0; }
.guide-states dd { margin: 0; }
.guide-scale { display: flex; flex-wrap: wrap; gap: 3px; }
.guide-scale span { flex: 1 0 38px; text-align: center; padding: 7px 2px; border-radius: 6px; font-size: 12.5px; font-weight: 700; }
.guide-scale.radar span { flex-basis: 64px; display: flex; flex-direction: column; }
.guide-scale small { font-weight: 500; font-size: 10.5px; opacity: .85; }
.guide-gloss dt { font-weight: 700; color: var(--navy); margin-top: 10px; }
.guide-gloss dd { margin: 2px 0 0; }
.map-help, .st-help { font-size: 13.5px; font-weight: 600; }
.st-help { margin-left: auto; }
@media (max-width: 600px) { .guide-states { grid-template-columns: 1fr; } }
/* Immagine nelle schede delle stazioni (MPS-17). */
.scard-img { display: none; margin: -18px -18px 8px; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--r) var(--r) 0 0; position: relative; background: #e9eef4; }
.with-img .scard-img { display: block; }
.scard-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scard-img i { position: absolute; left: 8px; bottom: 8px; font-style: normal; font-size: 11.5px; font-weight: 700; color: #fff; background: rgba(20,33,61,.62); border-radius: 999px; padding: 2px 8px; display: inline-flex; gap: 4px; align-items: center; }
.scard-img.plain { background: linear-gradient(135deg, var(--c) 0%, color-mix(in srgb, var(--c) 45%, #fff) 100%); }
.scard-img.plain::after { content: ""; position: absolute; inset: auto 0 0 0; height: 46%; background: rgba(255,255,255,.28); clip-path: polygon(0 70%, 14% 40%, 26% 58%, 40% 20%, 55% 52%, 68% 32%, 82% 60%, 100% 36%, 100% 100%, 0 100%); }
.scard-img.plain span { position: absolute; left: 10px; top: 8px; font-size: 12px; font-weight: 700; color: var(--ink2); opacity: .7; }
.img-toggle { margin-left: auto; align-self: center; }
/* Mappa delle webcam (MPS-18): elenco a sinistra sincronizzato con la mappa a destra. */
.cmx { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; max-width: 1600px; margin: 0 auto 28px; padding: 0 20px; height: calc(100vh - 150px); min-height: 560px; }
.cmx-side { display: flex; flex-direction: column; overflow-y: auto; padding: 0; min-height: 0; }
.cmx-tools { position: sticky; top: 0; z-index: 2; background: var(--card); padding: 12px 12px 8px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.cmx-q { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; font: 14px var(--font); background: var(--card); color: var(--ink); }
.cmx-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.cmx-chips .chip input { position: absolute; opacity: 0; pointer-events: none; }
.cmx-chips .chip:has(input:checked) { background: var(--blu); color: #fff; }
.cmx-chips .chip:has(input:focus-visible) { outline: 2px solid var(--blu); outline-offset: 2px; }
.cmx-count { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.cmx-count .linkbtn { background: none; border: 0; padding: 0; color: var(--blu); font: 600 12.5px var(--font); cursor: pointer; }
.cmx-cards { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.cmx-card { display: grid; grid-template-columns: 112px 1fr auto; gap: 10px; align-items: center; padding: 6px; border-radius: 12px; border: 1px solid transparent; }
.cmx-card[hidden] { display: none; }
.cmx-card:hover { background: var(--soft); }
.cmx-card.sel { background: var(--soft); border-color: var(--blu); }
.cmx-img { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #dfe6ee; }
.cmx-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cmx-card.off .cmx-img img { filter: grayscale(1); opacity: .7; }
.cmx-live { position: absolute; left: 4px; top: 4px; background: #e03131; color: #fff; font-size: 10px; font-weight: 700; border-radius: 4px; padding: 0 5px; }
.cmx-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cmx-name { font-weight: 700; color: var(--navy); font-size: 14px; line-height: 1.25; }
.cmx-place { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmx-meta { font-size: 12px; display: flex; gap: 8px; }
.cmx-meta .ok { color: var(--ok); font-weight: 600; } .cmx-meta .old { color: var(--muted); }
.cmx-meta b { color: var(--ink2); }
.cmx-locate { background: none; border: 1px solid var(--line); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer; }
.cmx-locate:hover { background: var(--card); border-color: var(--blu); }
.cmx-empty { padding: 14px; font-size: 13px; }
.cmx-map { display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.cmx-map .cam-map { flex: 1; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: #e9eef2; z-index: 0; }
.cmx-legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 0; }
.cmx-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cmx-legend img.gray { filter: grayscale(1); opacity: .6; }
.dot-live { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #e03131; border: 2px solid #fff; box-shadow: 0 0 0 1px #e03131; }
@media (max-width: 900px) {
  .cmx { grid-template-columns: 1fr; height: auto; min-height: 0; padding: 0 12px; }
  .cmx-map { order: -1; }
  .cmx-map .cam-map { height: 55vh; flex: none; }
  .cmx-side { overflow: visible; }
}
.cam-pin img { display: block; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); transition: transform .15s; transform-origin: 50% 100%; }
.cam-pin.off img { filter: grayscale(1) drop-shadow(0 1px 2px rgba(0,0,0,.3)); opacity: .7; }
.cam-pin i { position: absolute; right: -3px; top: -3px; width: 10px; height: 10px; border-radius: 50%; background: #e03131; border: 2px solid #fff; }
.cam-pin.hl img { transform: scale(1.35); }
.cam-pin.hl { z-index: 1000 !important; }
.cam-pop { display: flex; flex-direction: column; gap: 4px; font: 13px var(--font); }
.cam-pop img { width: 100%; border-radius: 8px; display: block; margin-bottom: 4px; }
.cam-pop strong { font-size: 14.5px; color: var(--navy); }
.cam-pop-at { font-size: 12.5px; color: #1f7a63; font-weight: 600; }
.cam-pop-at.off { color: #8a95a1; }
.cam-pop-st { font-size: 12.5px; }
.cam-pop-go { display: flex; gap: 6px; margin-top: 4px; }
.cam-pop-go .go { flex: 1; text-align: center; background: #1e70b7; color: #fff !important; border-radius: 6px; padding: 5px 8px; font-size: 12px; font-weight: 700; }
.cam-pop-go .go.live { background: #e03131; }
.cam-pop-go .go.alt { background: #eef3f9; color: var(--navy) !important; }
/* Dati in più della scheda della stazione (MPS-36). */
.stc-cam { position: relative; display: block; border-radius: 10px; overflow: hidden; margin: 8px 0 4px; aspect-ratio: 16 / 7; background: #e9eef4; }
.stc-cam img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stc-cam span { position: absolute; left: 8px; bottom: 6px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(20,33,61,.62); border-radius: 999px; padding: 1px 8px; }
.stc-trend { font-size: 12px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.stc-extra { margin: 8px 0 0; font-size: 12.5px; color: var(--txt2); line-height: 1.5; }
.stc-extra b { color: var(--navy); }
.stc-aq { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.stc-aq .aq-chip { font-size: 11.5px; padding: 2px 8px; }
/* Dispositivi a orario (MPS-39). */
.badge.sched { color: #2f5a8a; background: #e6eef8; }
.stc-state.sched { background: #e6eef8; color: #2f5a8a; }
.notice.sched { background: #eef4fb; border-color: #c9dbef; color: var(--navy); }
/* Verifica antispam dei moduli (MPS-14). */
.guard-status { font-size: 12.5px; color: var(--txt3); margin: 2px 0 0; min-height: 1.2em; }
.guard-status.ok { color: #1f7a63; }
.guard-status.bad { color: #b42318; }
/* Consenso alla diretta video (MPS-24). */
.stream-consent { position: absolute; inset: auto 12px 12px 12px; background: rgba(255,255,255,.97); color: var(--ink2); border-radius: 12px; padding: 14px 16px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: 14px; line-height: 1.5; z-index: 3; }
.stream-consent p { margin: 0 0 8px; }
.stream-consent-act { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cookie-table td:first-child { white-space: nowrap; }
.btn-link { background: none; border: 0; padding: 0; color: var(--blu, #1e70b7); text-decoration: underline; cursor: pointer; font: inherit; }
/* Pagina «Ospita» (MPS-15, MPS-19). */
.host-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; }
.host-tabs a { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); color: var(--navy); font-weight: 700; }
.host-tabs a.on { background: #1b3865; color: #fff; border-color: #1b3865; }
.host-tabs a svg { flex: none; }
.host-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; scroll-margin-top: 90px; }
.host-text h2, .host-form h2 { font-size: 1.3rem; margin: 0 0 10px; }
.host-fields fieldset { border: 0; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.host-fields legend { font-weight: 700; color: var(--navy); margin-bottom: 8px; padding: 0; }
.host-fields .three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.host-map { height: 260px; border-radius: 12px; border: 1px solid var(--line); }
.host-checks { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.host-file { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.host-invite { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 24px 0 20px; }
.host-invite h2 { font-size: 1.25rem; margin: 0 0 4px; }
.host-invite p { margin: 0; color: var(--txt); }
.host-invite > div { flex: 1 1 360px; }
@media (max-width: 900px) { .host-layout { grid-template-columns: 1fr; } .host-tabs { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .host-fields .three { grid-template-columns: 1fr; } }

/* Modulo «Richiesta dati» (MPS-23). */
.dr-form { margin-top: 24px; max-width: 860px; }
.dr-form h2 { font-size: 1.3rem; margin: 0 0 8px; }
.dr-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.dr-choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; line-height: 1.4; }
.dr-choice:has(input:checked) { border-color: #1e70b7; background: #eef5fc; }
.dr-choice strong { display: block; color: var(--navy); }
.dr-stations { max-height: 240px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 14px; }
.dr-group { grid-column: 1 / -1; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--txt3); margin-top: 6px; }
.dr-find { margin-bottom: 6px; }
@media (max-width: 640px) { .dr-kind { grid-template-columns: 1fr; } }
pre.code { background: #14213d; color: #e6edf5; border-radius: 10px; padding: 12px 14px; overflow-x: auto; font-size: 13px; line-height: 1.5; margin: 8px 0; }
pre.code code { background: none; color: inherit; padding: 0; }
.token-box { display: block; font-size: 15px; padding: 12px 14px; background: #eef3f9; border-radius: 10px; word-break: break-all; margin: 8px 0; user-select: all; }

/* Blog: categorie, evidenza, articolo (MPS-21). */
.blog-head { align-items: flex-end; }
.blog-search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; min-width: 260px; }
.blog-search input { border: 0; outline: 0; font: inherit; width: 100%; background: transparent; }
.blog-cats { margin-bottom: 18px; flex-wrap: wrap; }
.blog-cats .chip i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--cat); margin-right: 6px; }
.blog-cats .chip.rss { margin-left: auto; }
.cat-chip { display: inline-block; font-size: 12px; font-weight: 700; color: #fff; background: var(--cat, #5f6b7a); border-radius: 999px; padding: 2px 10px; letter-spacing: .02em; }
a.cat-chip:hover { color: #fff; filter: brightness(1.1); }
.blog-lead { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-bottom: 28px; }
.lead-main, .lead-small { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; color: var(--ink); }
.lead-main:hover, .lead-small:hover { border-color: #c5d3e3; color: var(--ink); }
.lead-main .img-box { aspect-ratio: 16 / 9; background: #dfe5eb; overflow: hidden; }
.lead-small .img-box { aspect-ratio: 16 / 7; background: #dfe5eb; overflow: hidden; }
.lead-main img, .lead-small img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lead-txt { display: flex; flex-direction: column; gap: 6px; padding: 14px 18px 16px; align-items: flex-start; }
.lead-main strong { font-family: var(--font-h); font-size: 1.6rem; line-height: 1.2; color: var(--navy); }
.lead-small strong { font-family: var(--font-h); font-size: 1.08rem; line-height: 1.25; color: var(--navy); }
.lead-sum { color: var(--txt); line-height: 1.55; }
.lead-meta, .post-meta { font-size: 13px; color: var(--txt3); }
.lead-side { display: grid; gap: 20px; }
.card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 16px 0; }
.card-meta .data-blog-home { margin: 0; }
.post-meta { display: block; margin-top: 6px; }
.post-body { max-width: 72ch; }
.post-body img { width: 100%; }
.post-toc { max-width: 72ch; margin: 18px auto 0; background: #f4f7fb; border-radius: 12px; padding: 12px 18px; font-size: 14.5px; }
.post-toc ol { margin: 6px 0 0; padding-left: 1.2em; }
.post-foot { border-top: 1px solid var(--line); margin-top: 24px; padding-top: 14px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.post-tags, .post-share { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.post-tags span, .post-share span { color: var(--txt3); }
.post-tags a { background: #eef3f9; border-radius: 999px; padding: 2px 10px; }
@media (max-width: 900px) { .blog-lead { grid-template-columns: 1fr; } .blog-search { min-width: 0; width: 100%; } }

/* Blocchi degli articoli scritti con l'editor visuale (MPS-21) */
.prose figure.art-fig { margin: 26px 0; }
.prose figure.art-fig img { display: block; width: 100%; height: auto; }
.prose figure.art-fig figcaption { margin-top: 8px; font-size: .88rem; line-height: 1.45; color: var(--muted); text-align: center; }
.prose .art-figura { margin: 26px 0; }
.prose .art-figura > p, .prose .art-figura > figure { margin: 0; }
.prose .art-figura.centro { max-width: 560px; margin-left: auto; margin-right: auto; }
.prose .art-figura.sinistra { float: left; width: min(45%, 360px); margin: 6px 26px 14px 0; }
.prose .art-figura.destra { float: right; width: min(45%, 360px); margin: 6px 0 14px 26px; }
.prose h2, .prose h3, .prose .art-galleria, .prose .art-video, .prose table { clear: both; }
.prose .art-galleria { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 26px 0; }
.prose .art-galleria > p, .prose .art-galleria > figure { margin: 0; }
.prose .art-galleria img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.prose .art-galleria figcaption { font-size: .8rem; margin-top: 4px; }
.prose .art-riquadro { display: block; margin: 26px 0; padding: 16px 22px; border-left: 4px solid var(--blu); border-radius: 0 12px 12px 0; background: var(--soft); }
.prose .art-riquadro.attenzione { border-left-color: var(--arancio); background: #fff4e6; }
.prose .art-riquadro > :first-child { margin-top: 0; }
.prose .art-riquadro > :last-child { margin-bottom: 0; }
.prose .art-video { position: relative; aspect-ratio: 16 / 9; margin: 26px 0; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #1b3865, #0b1a2e); }
.prose .art-video .stream-blank { position: absolute; inset: 0; }
.prose .art-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose .art-video-link { position: absolute; right: 12px; bottom: 10px; font-size: .82rem; color: #fff; opacity: .85; }
.prose .art-video.playing .art-video-link { display: none; }
.prose .art-station { margin: 26px 0; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 2px 10px rgba(27, 56, 101, .06); }
.prose .art-station .art-st-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; color: var(--navy); }
.prose .art-station .art-st-head strong { font-size: 1.1rem; }
.prose .art-station .art-st-head span, .prose .art-station .art-st-state { font-size: .85rem; color: var(--muted); }
.prose .art-station .art-st-state { display: block; margin-top: 2px; }
.prose .art-st-vals { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; }
.prose .art-st-vals div { padding: 8px 12px; border-radius: 10px; background: var(--soft); }
.prose .art-st-vals dt { font-size: .78rem; color: var(--muted); }
.prose .art-st-vals dd { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.prose .art-st-go { font-weight: 600; }
@media (max-width: 640px) {
  .prose .art-figura.sinistra, .prose .art-figura.destra { float: none; width: auto; margin: 26px 0; }
}

/* Accesso dei soci e contenuti riservati (MPS-5) */
.topbar-user { display: inline-flex; align-items: center; gap: 14px; }
.topbar-user a { display: inline-flex; align-items: center; gap: 5px; }
.topbar-out { display: inline; margin: 0; }
.topbar-out button { background: none; border: 0; padding: 0; font: inherit; color: #dfe8f2; cursor: pointer; }
.topbar-out button:hover { color: var(--giallo); }
.topbar-login { font-weight: 600; color: var(--giallo) !important; }
.invito-soci { display: flex; gap: 16px; align-items: flex-start; margin: 24px 0; padding: 18px 22px; border: 1px solid #f0d58a; border-radius: 14px; background: #fffaf0; }
.invito-soci .invito-ico { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: #ffc100; color: var(--navy); }
.invito-soci strong { display: block; font-size: 1.05rem; color: var(--navy); margin-bottom: 4px; }
.invito-soci p { margin: 0 0 8px; color: var(--txt); }
.invito-soci .invito-act { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0; }
.prose .art-soci { position: relative; margin: 26px 0; padding: 30px 22px 14px; border: 2px dashed #e0b84a; border-radius: 12px; background: #fffaf0; }
.prose .art-soci-l { position: absolute; top: 8px; left: 16px; font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #9a6f12; }
.seg a.locked { opacity: .6; display: inline-flex; align-items: center; gap: 4px; }
.badge.live { display: inline-flex; align-items: center; gap: 4px; background: #e7f7ee; color: #1f7a3a; }
.form-narrow { display: grid; gap: 12px; max-width: 420px; }
.form-narrow label { display: grid; gap: 4px; font-weight: 600; }
.form-narrow input { padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; }

/* Profilo termico verticale (MPS-59) */
.vprof { margin-top: 24px; }
.vprof .vp-text { font-size: .95rem; color: var(--ink); background: var(--soft); border-radius: 10px; padding: 10px 14px; }
.vp-chart svg { width: 100%; height: auto; display: block; }
.vp-grid { stroke: #e6ebf1; stroke-width: 1; }
.vp-zero { stroke: #7db4e6; stroke-width: 1.5; stroke-dasharray: 4 3; }
.vp-ax { font-size: 11px; fill: #5b6875; }
.vp-inv { fill: rgba(216, 75, 43, .10); }
.vp-dry { stroke: #b0b8c4; stroke-width: 1.2; stroke-dasharray: 6 4; }
.vp-std { stroke: #8f9aa8; stroke-width: 1.2; stroke-dasharray: 2 3; }
.vp-fl { stroke: #1e70b7; stroke-width: 1.2; stroke-dasharray: 8 4; }
.vp-fl-t { font-size: 11px; fill: #1e70b7; }
.vp-temp-l { fill: none; stroke: #d84b2b; stroke-width: 2.5; }
.vp-dew-l { fill: none; stroke: #1e70b7; stroke-width: 2; opacity: .8; }
.vp-temp { fill: #d84b2b; stroke: #fff; stroke-width: 1.5; }
.vp-temp.self { fill: #ffc100; stroke: #1b3865; stroke-width: 2; }
.vp-dew { fill: #1e70b7; stroke: #fff; stroke-width: 1.2; }
.vp-lab { font-size: 12px; fill: #1f2937; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.vp-lab.self { font-weight: 700; }
.vp-na { font-size: 11px; fill: #9aa4b2; }
.vp-ctl { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.vp-ctl input[type=range] { flex: 1; }
.vp-when { min-width: 60px; font-weight: 600; color: var(--navy); }

/* L'installazione (MPS-28) */
.inst { margin-top: 24px; }
.inst-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-bottom: 16px; }
.inst-gallery figure { margin: 0; }
.inst-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.inst-gallery figcaption { font-size: .8rem; color: var(--muted); margin-top: 4px; }
.inst-desc { margin: 0 0 12px; }
.inst-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 18px; margin: 0; }
.inst-facts dt { font-size: .78rem; color: var(--muted); }
.inst-facts dd { margin: 0; font-weight: 600; color: var(--navy); }
.inst-wmo { margin-top: 16px; padding: 12px 16px; border-radius: 10px; background: var(--soft); }
.inst-wmo strong { color: var(--navy); }
.inst-wmo p { margin: 4px 0 0; }

/* Trasparenza (MPS-26) */
.transp-org { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px 20px; margin: 0 0 10px; }
.transp-org dt { font-size: .8rem; color: var(--muted); }
.transp-org dd { margin: 0; font-weight: 600; color: var(--navy); }
.transp-docs li, .transp-board li { margin: 4px 0; }
.transp table td.num { text-align: right; white-space: nowrap; }
.transp table tr.tot td { border-top: 2px solid var(--line); }

/* Sostienici (MPS-27) */
.support-uses { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 10px 0 20px; }
.support-uses div { padding: 14px 16px; border-radius: 12px; background: var(--soft); }
.support-uses strong { display: block; color: var(--navy); }
.support-uses span { font-size: .9rem; color: var(--muted); }
.support-code code { font-size: 1.3rem; padding: 4px 10px; background: var(--soft); border-radius: 8px; }
.support-bank { display: grid; gap: 8px; margin: 0 0 14px; }
.support-bank dt { font-size: .8rem; color: var(--muted); }
.support-bank dd { margin: 0; font-weight: 600; color: var(--navy); }

/* Sensori aggiuntivi della stazione (MPS-49) */
.xsens { margin-top: 20px; }
.xs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 8px 0 0; }
.xs-item { border: 1px solid var(--line, #e3e8ef); border-radius: 10px; padding: 10px 12px; background: var(--card, #fff); }
.xs-item dt { font-size: .82rem; color: var(--muted, #5b6675); margin-bottom: 4px; }
.xs-item dd { margin: 0; }
.xs-item .num { font-size: 1.35rem; font-weight: 700; color: var(--brand, #1b3865); }
.xs-item .unit { margin-left: 3px; color: var(--muted, #5b6675); font-size: .9rem; }

/* ===== App installabile (MPS-8) =====
   La barra dell'app e la navigazione in basso compaiono nell'app installata (html.standalone, impostata da js/app-mode.js)
   e nelle pagine /app anche nel browser (.app-mode); nel sito restano nascoste. Misure pensate dall'iPhone 6S (375×667)
   all'iPad Pro 12,9" (1024×1366), con i margini di sicurezza dei telefoni senza tasto Home. */
.app-bar, .tabbar { display: none; }
:is(html.standalone .site, .site.app-mode) .topbar,
:is(html.standalone .site, .site.app-mode) .masthead,
:is(html.standalone .site, .site.app-mode) .assoc-band,
:is(html.standalone .site, .site.app-mode) .sitefoot { display: none; }
:is(html.standalone .site, .site.app-mode) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
:is(html.standalone .site, .site.app-mode) .app-bar {
  display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 1100;
  padding: calc(8px + env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 8px max(14px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: saturate(1.6) blur(12px); backdrop-filter: saturate(1.6) blur(12px);
  border-bottom: 1px solid var(--line);
}
/* Marchio sempre visibile: simbolo e nome come nel logo (Montserrat Medium maiuscolo su due righe);
   fuori dalla home, dopo un puntino, il nome della pagina */
.app-bar .app-brand { display: flex; align-items: center; gap: 8px; flex: none; color: #2D66A7; text-decoration: none; }
.app-bar .app-brand svg { display: block; width: auto; height: 30px; flex: none; }
.app-bar .bw { display: inline-flex; flex-direction: column; justify-content: center; font-family: var(--font-brand); font-weight: 500; font-size: 15px; line-height: 1; letter-spacing: .02em; text-transform: uppercase; color: #1d1d1b; }
.app-bar .bw span + span { margin-top: 2px; }
.app-bar .app-fill { flex: 1; }
.app-bar .app-sep { flex: none; margin: 0 -2px; font-size: 1.3rem; font-weight: 700; line-height: 1; color: var(--muted); }
.app-bar .app-sep:has(+ .app-title:empty) { display: none; }
.app-bar .app-title { flex: 1; min-width: 0; font-family: var(--font-brand); font-weight: 600; font-size: 1.02rem; letter-spacing: -.005em; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Schermi stretti con il pulsante Indietro: si toglie il simbolo e il nome si riduce, per lasciare posto al titolo */
@media (max-width: 400px) {
  :is(html.standalone .site, .site.app-mode) .app-bar { gap: 6px; padding-left: max(10px, env(safe-area-inset-left)); padding-right: max(10px, env(safe-area-inset-right)); }
  .app-bar .app-ic { width: 34px; height: 34px; }
  .app-bar .app-ic svg { width: 18px; height: 18px; }
  .app-bar .app-sep { margin: 0; }
  .app-bar .app-back ~ .app-brand svg { display: none; }
  .app-bar .bw { font-size: 13px; }
  .app-bar .app-title { font-size: .95rem; }
}
/* Titoli dell'app nel carattere del marchio */
:is(html.standalone .site, .site.app-mode) :is(h1, h2, h3) { font-family: var(--font-brand); font-weight: 600; letter-spacing: -.01em; }
.app-bar .app-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--card); border: 1px solid var(--line); color: var(--navy); flex: none; }
.app-bar .app-ic svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.app-bar .app-back { border: 0; background: var(--soft); }
:is(html.standalone .site, .site.app-mode) .tabbar {
  display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1100;
  height: calc(60px + env(safe-area-inset-bottom)); padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 600; min-width: 0; }
.tabbar a svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--blu); }
.tabbar a.on svg { stroke-width: 2.3; }
@media (min-width: 700px) { .tabbar a { flex-direction: row; gap: 8px; font-size: 13px; } }
/* Nell'app le pagine del sito si stringono un po' sul telefono: niente percorso, intestazioni più basse. */
@media (max-width: 640px) {
  :is(html.standalone .site, .site.app-mode) .page-hero { padding-top: 18px; padding-bottom: 18px; }
  :is(html.standalone .site, .site.app-mode) .crumbs { display: none; }
}
.app-offline { background: #fff4e6; color: #7a4b00; border-bottom: 1px solid #f2c27a; padding: 8px 16px; font-size: .88rem; text-align: center; }

/* Pagine dell'app */
.app-page [hidden], .app-bar [hidden] { display: none !important; }
.app-page { width: 100%; max-width: 1100px; margin: 0 auto; padding: 14px max(16px, env(safe-area-inset-right)) 24px max(16px, env(safe-area-inset-left)); }
.app-page h2, .app-sec-head h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0; }
.app-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 2px 10px; }
.app-page .app-h { margin: 24px 2px 8px; }
.app-h1 { font-size: 1.15rem; margin: 0 0 6px; }
.app-act { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0 6px; }
.app-foot { margin-top: 24px; text-align: center; }
.app-panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.app-panel h3 { font-size: 1rem; margin: 0 0 12px; }

.app-alert { display: flex; gap: 10px; align-items: flex-start; border-radius: 14px; padding: 10px 12px; margin-bottom: 10px; font-size: .9rem; line-height: 1.4; border: 1px solid; }
.app-alert svg { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; margin-top: 1px; }
.app-alert strong { display: block; }
.app-alert small { display: block; opacity: .8; margin-top: 2px; }
.app-alert.lv0 { background: #eef4fb; border-color: #c9dbef; color: var(--navy); }
.app-alert.lv1 { background: #fff8db; border-color: #f0d36b; color: #6b5200; }
.app-alert.lv2 { background: #fff0e0; border-color: #f2b878; color: #7a3d00; }
.app-alert.lv3 { background: #fde8e6; border-color: #eea59e; color: #8a1c13; }

/* Riquadro di apertura della home: identità di Meteopassione (simbolo in filigrana) e la rete adesso */
.app-hero { position: relative; overflow: hidden; isolation: isolate; background: linear-gradient(155deg, #1e70b7 0%, #1b3865 78%); color: #fff; border-radius: 20px; padding: 18px 18px 14px; }
.app-page > section:not([hidden]) ~ .app-hero { margin-top: 22px; }
.app-hero .ah-mark { position: absolute; z-index: -1; right: -46px; top: -34px; width: auto; height: 250px; color: #fff; opacity: .1; pointer-events: none; }
.app-hero .ah-date { margin: 0; font-size: .82rem; opacity: .85; }
.app-hero h1 { color: #fff; font-size: 1.45rem; margin: 2px 0 2px; }
.app-hero .ah-sub { margin: 0; font-size: .92rem; opacity: .92; }
.app-hero .ah-cap { margin: 14px 0 6px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; opacity: .8; }
.ah-ext { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .ah-ext { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ah-ext a { display: flex; flex-direction: column; min-width: 0; height: 100%; padding: 9px 11px; border-radius: 14px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16); color: #fff; }
.ah-ext a:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.ah-ext .ah-l { font-size: .74rem; opacity: .85; }
.ah-ext b { font-size: 1.32rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ah-ext .ah-s { font-size: .8rem; opacity: .92; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-hero .ah-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; min-height: 32px; color: #fff; font-weight: 600; font-size: .9rem; }
.app-hero .ah-more svg { width: 16px; height: 16px; }
/* Previsioni in breve */
.app-fc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.app-fc-day { display: flex; gap: 10px; align-items: center; min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; color: var(--ink); }
.app-fc-day:hover { color: var(--ink); border-color: #c9d6e6; }
.app-fc-day > svg { flex: none; width: 52px; height: 52px; }
.app-fc-day > span { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.app-fc-day small { color: var(--muted); font-size: .76rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.app-fc-day strong { color: var(--navy); font-size: .92rem; overflow-wrap: anywhere; }
.app-fc-note { display: block; margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; color: var(--ink); font-size: .92rem; line-height: 1.5; }
.app-fc-note:hover { color: var(--ink); border-color: #c9d6e6; }
.app-fc-note > span { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.app-fc-note small { display: block; margin-top: 6px; color: var(--muted); font-size: .8rem; }
@media (max-width: 359px) { .app-fc { grid-template-columns: 1fr; } }
/* Webcam e notizie */
.app-cams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 900px) { .app-cams { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 899px) { .app-cams > :nth-child(n+3) { display: none; } }
.app-cams .camtile { border-radius: 14px; }
.app-posts { display: grid; gap: 10px; }
@media (min-width: 700px) { .app-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.app-posts .post-row { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; align-items: center; }
.app-posts .post-img { width: 96px; height: 68px; border-radius: 10px; }
.app-posts .post-row strong { font-size: .95rem; }
/* Invito a seguire le proprie stazioni, in fondo alla home */
.app-follow { display: flex; gap: 14px; align-items: flex-start; margin-top: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.app-follow[hidden] { display: none; }
.app-follow .af-ico { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 14px; background: #fff4cc; color: #b88400; }
.app-follow .af-ico svg { width: 24px; height: 24px; fill: currentColor; }
.app-page .app-follow h2 { font-size: 1.12rem; text-transform: none; letter-spacing: 0; color: var(--navy); margin: 2px 0 6px; }
.app-follow p { margin: 0 0 8px; color: var(--ink); }
.app-follow p.muted { color: var(--muted); }
.app-about { margin: 28px 0 4px; text-align: center; }
.app-about img { display: block; margin: 0 auto 8px; width: 170px; height: auto; }
.app-about p { margin: 0; line-height: 1.5; }
/* Stazioni più consultate: tre schede, quattro quando la griglia ha due colonne (nessun vuoto) */
.app-cards.app-top { grid-template-columns: minmax(0, 1fr); }
.app-top > :nth-child(4) { display: none; }
@media (min-width: 640px) { .app-cards.app-top { grid-template-columns: repeat(2, minmax(0, 1fr)); } .app-top > :nth-child(4) { display: block; } }
@media (min-width: 960px) { .app-cards.app-top { grid-template-columns: repeat(3, minmax(0, 1fr)); } .app-top > :nth-child(4) { display: none; } }
.app-sec-acts { display: inline-flex; gap: 16px; }
.app-sec-acts .muted { color: var(--muted); }
@media (max-width: 420px) { .app-follow { flex-direction: column; gap: 10px; padding: 16px; } }

.app-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
@media (max-width: 400px) { .app-cards { grid-template-columns: 1fr; } }
.app-card-wrap { position: relative; }
.app-card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; color: var(--ink); height: 100%; }
.app-card:hover { color: var(--ink); border-color: #c9d6e6; }
.ac-top { display: flex; align-items: center; gap: 10px; }
.ac-t { font-size: 30px; font-weight: 700; line-height: 1; min-width: 74px; font-variant-numeric: tabular-nums; }
.ac-n { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ac-n strong { font-size: .95rem; color: var(--navy); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-n small { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-chip { flex: none; font-size: .68rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.ac-chip.live { background: #e7f7ee; color: var(--ok); }
.ac-chip.late { background: #fff2df; color: var(--late); }
.ac-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.ac-row > span { background: var(--soft); border-radius: 10px; padding: 6px 4px; text-align: center; font-size: .66rem; color: var(--muted); line-height: 1.3; }
.ac-row b { display: block; font-size: .88rem; color: var(--ink); }
.ac-foot { display: block; margin-top: 8px; font-size: .76rem; color: var(--muted); }
.ac-del { display: none; position: absolute; top: -8px; right: -6px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--stale); color: #fff; font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); }
.editing .ac-del { display: block; }
.editing .app-card { pointer-events: none; opacity: .85; }

.app-install { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; font-size: .9rem; }
.app-install[hidden] { display: none; }
.app-install img { flex: none; border-radius: 11px; box-shadow: 0 1px 4px rgba(16, 24, 40, .18); }
.app-install .ai-txt { display: flex; flex-direction: column; flex: 1 1 200px; min-width: 0; }
.app-install strong { color: var(--navy); }
.app-install .ai-txt span { color: var(--muted); }

.app-search { display: flex; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0 12px; scroll-margin-top: 80px; }
.app-search svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; }
.app-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; padding: 12px 0; font-size: 16px; /* 16px: niente zoom automatico su iOS */ }
.app-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.app-list li + li { border-top: 1px solid var(--line); }
.app-list li[hidden] { display: none; }
.app-list a, .app-list button, .app-list label, .app-list .app-rule { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; min-height: 48px; color: var(--ink); background: none; border: 0; text-align: left; font: inherit; cursor: pointer; }
.app-list a > span:first-child, .app-list button > span:first-child, .app-list label > span:first-child, .app-rule > span:first-child { display: flex; flex-direction: column; min-width: 0; }
.app-list small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.app-list a > span[aria-hidden] { color: var(--muted); font-size: 1.3rem; }
.app-list .app-rule button { width: auto; min-height: 0; padding: 0; }
.app-list .app-logout { width: 100%; margin: 0; }
.app-list .app-logout button { color: var(--stale); }
.app-results { margin: 12px 0 0; }
.app-rule form { flex: none; }
.app-rule-form { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.app-rule-form label { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; color: var(--navy); }
.app-rule-form select, .app-rule-form input { width: 100%; min-width: 0; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; font-size: 16px; background: var(--card); }
.app-rule-form .two { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; }
.app-rule-form label { min-width: 0; }
.app-rule-form button { align-self: flex-start; }

/* Interruttore delle notifiche */
input.switch { appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: 999px; background: #cfd8e3; position: relative; cursor: pointer; transition: background .15s; margin: 0; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .15s; }
input.switch:checked { background: var(--blu); }
input.switch:checked::after { transform: translateX(18px); }
input.switch:disabled { opacity: .5; cursor: default; }
input.switch:focus-visible { outline: 3px solid rgba(30, 112, 183, .35); outline-offset: 2px; }

/* Scelta del tema (MPS-8) */
.pref-form { max-width: 720px; }
.pref-group { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.pref-group legend { font-weight: 700; color: var(--navy); margin-bottom: 8px; padding: 0; }
.pref-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.pref-opt { position: relative; display: inline-flex; cursor: pointer; }
.pref-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pref-opt span { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: .92rem; line-height: 1.25; }
.pref-opt input:checked + span { background: var(--blu); border-color: var(--blu); color: #fff; font-weight: 600; }
.pref-opt input:focus-visible + span { outline: 3px solid rgba(30, 112, 183, .45); outline-offset: 2px; }
@media (max-width: 480px) { .pref-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .pref-opt span { width: 100%; } }

/* ===== Tema scuro (preferenze, MPS-8) =====
   Le superfici e i testi usano le variabili di :root: qui cambiano i valori; sotto, i pochi elementi
   con colori propri. La mappa resta con le tinte della cartografia, appena attenuate. */
:is(html[data-theme=dark], html[data-theme-now=dark]) {
  color-scheme: dark;
  --card: #18222f; --bg: #0e151e; --line: #2a3747; --soft: #213044; --ink: #e2e8ef; --muted: #9eabba;
  --navy: #dce7f4; --navy-bg: #12233d; --ink2: #e2e8ef; --txt: #c7d1dc; --txt2: #b3bfcc; --txt3: #9eabba;
  --ok: #5cc98a; --late: #f0a64a; --stale: #f07a70;
}
:is(html[data-theme=dark], html[data-theme-now=dark]) body { background: var(--bg); color: var(--ink); }
:where(html[data-theme=dark], html[data-theme-now=dark]) a { color: #74b4ee; }
:where(html[data-theme=dark], html[data-theme-now=dark]) a:hover { color: #9ccbf5; }
:where(html[data-theme=dark], html[data-theme-now=dark]) :is(h1, h2, h3, h4, h5) { color: var(--navy); }
:is(html[data-theme=dark], html[data-theme-now=dark]) :is(input, select, textarea) { color: var(--ink); background-color: var(--card); border-color: var(--line); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .masthead,
:is(html[data-theme=dark], html[data-theme-now=dark]) .mmenu-panel { background: var(--card); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .mmenu[open] summary { background: var(--blu); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .logo img { filter: brightness(0) invert(1); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .btn-assoc,
:is(html[data-theme=dark], html[data-theme-now=dark]) .btn-assoc:hover { color: #1b3865; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .site .app-bar { background: rgba(24, 34, 47, .94); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .site .tabbar { background: rgba(24, 34, 47, .97); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-bar .app-ic { background: var(--soft); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .tabbar a.on,
:is(html[data-theme=dark], html[data-theme-now=dark]) .mainnav a.active,
:is(html[data-theme=dark], html[data-theme-now=dark]) .mainnav a:hover { color: #74b4ee; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .leaflet-tile-pane { filter: brightness(.82) contrast(1.05); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .leaflet-bar a { background: var(--card); color: var(--ink); border-color: var(--line); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .notice { background: #3a2a14; color: #f6d9a8; border-color: #6b4c1f; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .notice.ok { background: #13321f; color: #b8ecc9; border-color: #24603a; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-alert.lv0 { background: #15273d; border-color: #2c4a6e; color: #cfe0f3; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-alert.lv1 { background: #33290b; border-color: #6b5714; color: #f5e2a0; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-alert.lv2 { background: #3a240e; border-color: #75461b; color: #f6c999; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-alert.lv3 { background: #3c1916; border-color: #7a2f28; color: #f6b8b1; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .ac-chip.live { background: #173a26; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .ac-chip.late { background: #3c2c12; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-offline { background: #3a2a14; color: #f6d9a8; border-color: #6b4c1f; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .chart-tip { background: rgba(24, 34, 47, .97); border-color: var(--line); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .chart-tip span { color: var(--ink); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .chart .gapzone { fill: #223044; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .sponsor-band { border-color: var(--line); }
/* Fondi tinti del tema chiaro, riportati a tinte scure */
:is(html[data-theme=dark], html[data-theme-now=dark]) :is(.site-dev-ico, a.chip:hover, .badge, table.dt tbody tr:hover, .mp-pin.off span, .cal-day, .stc-x:hover, .stc-tile, .stc-spark.loading,
  .aqh-bar, .aqh-exc, .scard-img, .cam-pop-go .go.alt, .stc-cam, .badge.sched, .stc-state.sched, .notice.sched, .dr-choice:has(input:checked), .token-box, .post-toc, .post-tags a) { background: var(--soft); color: var(--ink); border-color: var(--line); }
:is(html[data-theme=dark], html[data-theme-now=dark]) :is(table.arch tbody tr:nth-child(odd), table.data.stats tr.strong td, .cal-day.empty) { background: #141d29; }
:is(html[data-theme=dark], html[data-theme-now=dark]) :is(.home-map-canvas, .map-big, .aq-map) { background: #1c2633; }
:is(html[data-theme=dark], html[data-theme-now=dark]) :is(.badge.ok, .success, .stc-state.ok, .badge.live) { background: #173a26; color: #a6e6bd; border-color: #24603a; }
:is(html[data-theme=dark], html[data-theme-now=dark]) :is(.badge.stale, .alert) { background: #3c1916; color: #f6b8b1; border-color: #7a2f28; }
:is(html[data-theme=dark], html[data-theme-now=dark]) :is(.fc-slot.morning, .t-air, .js-fav.on, .host-card, .stc-fav.on, .prose .art-riquadro.attenzione, .invito-soci, .prose .art-soci) { background: #2b2412; border-color: #5c4a17; color: var(--ink); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .t-temp { background: #3a2019; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .t-pres { background: #222540; }
html.standalone .app-exit { display: none; }

/* Smartphone: selettori a segmenti a tutta larghezza e tabelle dei testi scorrevoli al loro interno */
@media (max-width: 640px) {
  .seg { display: flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg a, .seg label { flex: 1 0 auto; text-align: center; padding: 7px 10px; }
  .prose table, .page-body table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ===== Smartphone e app: revisione completa (MPS-8) =====
   Obiettivo: nessuno scorrimento orizzontale da 320 px in su (anche con i caratteri di sistema ingranditi),
   grafici leggibili, elenchi compatti come in un'app. Vale per il sito su smartphone e per l'app. */
@supports (overflow-x: clip) { html, body { overflow-x: clip; } }
.chart svg.cn { display: none; }
@media (max-width: 640px) {
  /* Grafici: il disegno stretto preparato dal server */
  .chart svg.cw { display: none; }
  .chart svg.cn { display: block; }
  .chart figcaption { font-size: .9rem; }
  /* Campi dei moduli a 16 px: iOS non ingrandisce la pagina quando si tocca un campo */
  input:not([type=checkbox]):not([type=radio]):not([type=range]), select, textarea { font-size: 16px !important; }
  .mp-form select { width: 100%; min-height: 44px; border: 1px solid var(--blu-scuro); border-radius: 10px; padding: 8px 10px; background-color: var(--card); color: var(--ink); }
  .mp-form input:not([type=checkbox]):not([type=radio]) { min-height: 44px; }
  .btn-navy { min-height: 44px; padding: 10px 22px; }
  /* Titoli delle pagine dei testi */
  .page-cms h1 { font-size: 1.6rem; }

  /* Schede delle stazioni: una colonna, valore principale a destra */
  .st-cards { grid-template-columns: minmax(0, 1fr) !important; gap: 8px; }
  .st-cards .scard { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 12px 14px; align-items: center; }
  .st-cards .scard > * { grid-column: 1; min-width: 0; }
  .st-cards .scard-img.plain { display: none !important; }
  .st-cards .scard-img { grid-column: 1 / -1; margin: -12px -14px 8px; }
  .st-cards .scard-h { flex-direction: row; align-items: baseline; gap: 8px; }
  .st-cards .scard-h strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .st-cards .scard-h .small { flex: none; }
  .st-cards .scard-v { grid-column: 2; grid-row: 1 / span 3; font-size: 32px; text-align: right; }
  .st-cards .scard:has(.scard-img:not(.plain)) .scard-v { grid-row: 2 / span 3; }
  .st-cards .scard-d { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; gap: 2px 14px; }

  /* Articoli: riga con miniatura, titolo e data */
  .blog-grid { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }
  .blog-card { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 12px; padding: 10px; }
  .blog-card .img-box { grid-column: 1; grid-row: 1 / span 2; height: 96px; border-radius: 10px; order: 0; }
  .blog-card h3 { grid-column: 2; grid-row: 1; margin: 0 0 6px; min-height: 0; font-size: .98rem; line-height: 1.3; }
  .blog-card .card-meta { grid-column: 2; grid-row: 2; align-self: start; margin: 0; flex-wrap: wrap; }
  .blog-card .data-blog-home { margin: 0; }
  .blog-card p, .blog-card .btn-blu { display: none; }

  /* Webcam: due colonne */
  .cam-grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 10px; }
  .cam-cap { padding: 18px 8px 6px; }
  .cam-cap strong { font-size: 12.5px; }
  .cam-cap span, .cam-cap time { font-size: 11px; }
  .cam-temp { top: 6px; right: 6px; font-size: 11.5px; padding: 2px 6px; }

  /* Previsioni: i tre giorni affiancati */
  .day-tabs { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; gap: 6px; }
  .dtab { flex-direction: column; align-items: flex-start; gap: 0; padding: 9px 10px; }
  .dtab-ico { display: none; }
  .dtab strong { font-size: .88rem; line-height: 1.25; }
  .dtab-t { font-size: 12px; line-height: 1.3; }


  /* Tabelle dei testi impilate (js/app.js aggiunge data-label alle celle) */
  table.t-stack, table.t-stack thead, table.t-stack tbody, table.t-stack tr, table.t-stack th, table.t-stack td { display: block; width: auto; }
  table.t-stack { overflow: visible; border: 0; }
  table.t-stack thead { display: none; }
  table.t-stack tr { padding: 10px 0; border-bottom: 1px solid var(--line); background: none !important; }
  table.t-stack td, table.t-stack th { padding: 2px 0 !important; border: 0 !important; text-align: left !important; white-space: normal; }
  table.t-stack td[data-label]::before { content: attr(data-label); display: block; font-size: .74rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-top: 4px; }

  /* Home dell'app */
  .app-install .ai-txt { flex: 1 1 0; }
  .app-install .btn-blu { flex: 1 0 100%; }
}
.app-cards { grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); }
.app-card, .ac-n, .ac-row > span { min-width: 0; }
.ac-row > span { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 360px) { .ac-t { font-size: 26px; min-width: 62px; } .ac-row { gap: 4px; } .ac-row b { font-size: .8rem; } }

/* App: la fascia degli sponsor scende in fondo al contenuto, sopra la barra di navigazione */
:is(html.standalone .site, .site.app-mode) > .sponsor-band { order: 10; margin: 12px max(16px, env(safe-area-inset-left)) 16px; border: 1px solid var(--line); border-radius: 14px; }
:is(html.standalone .site, .site.app-mode) > .tabbar { order: 11; }
@media (max-width: 640px) {
  /* App: niente intestazioni di pagina ridondanti con la barra dell'app */
  :is(html.standalone .site, .site.app-mode) .page-head .sub,
  :is(html.standalone .site, .site.app-mode) .page-hero p { font-size: .92rem; }
  :is(html.standalone .site, .site.app-mode) main h1 { font-size: 1.45rem; }
  :is(html.standalone .site, .site.app-mode) .page-cms h1 { text-align: left; }
  :is(html.standalone .site, .site.app-mode) .map-big { height: max(360px, calc(100svh - 250px)); }
}
@media (max-width: 640px) {
  /* Filtri a pastiglie (zone, categorie): una riga scorrevole invece di molte righe */
  nav.chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
  nav.chips::-webkit-scrollbar { display: none; }
  nav.chips > * { flex: none; }
  /* Testi lunghi (indirizzi, collegamenti) non escono dallo schermo */
  .prose, .page-body, .art-body { overflow-wrap: break-word; }
}

/* Tema scuro: riquadri con fondi propri */
:is(html[data-theme=dark], html[data-theme-now=dark]) .aqh-now { background: linear-gradient(180deg, color-mix(in srgb, var(--band) 16%, var(--card)) 0%, var(--card) 70%); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-bar .app-brand { color: #7fb2e8; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-bar .bw { color: #e8eef5; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-hero { background: linear-gradient(155deg, #1d5f9c 0%, #142b4d 78%); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .post-img { background: #223044; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-about img { filter: brightness(0) invert(1); opacity: .9; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .app-follow .af-ico { background: #3a2f0e; color: #f0c64a; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .blog-card .img-box, :is(html[data-theme=dark], html[data-theme-now=dark]) .camtile { background: #223044; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .invito-soci .invito-ico { color: #1b3865; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .dtab.on { background: var(--blu); border-color: var(--blu); }

/* ===== Ricerca con suggerimenti (MPS-8): menu del sito, app e pagina /cerca ===== */
.has-sugg { position: relative; }
.sugg { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 1200; min-width: min(360px, calc(100vw - 32px)); max-height: min(60vh, 440px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 24, 40, .18); padding: 6px; text-align: left; }
.sugg[hidden] { display: none; }
.hsearch .sugg { left: auto; width: 380px; }
.sg-item { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 7px 10px; border-radius: 10px; color: var(--ink); text-decoration: none; }
.sg-item:hover, .sg-item.on, .sg-all:hover, .sg-all.on { background: var(--soft); color: var(--ink); text-decoration: none; }
.sg-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: #e6f0fa; color: var(--blu); }
.sg-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sg-ico.k-w { background: #f0eaf8; color: #6b46a8; }
.sg-ico.k-l { background: #e5f4ee; color: #1f7a5c; }
.sg-ico.k-a { background: #fcf0de; color: #9a5a00; }
.sg-ico.k-p { background: var(--bg); color: var(--muted); }
.sg-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.sg-t strong { font-weight: 600; font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-t mark { background: none; color: var(--blu); font-weight: 800; }
.sg-t small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-none { margin: 0; padding: 10px 12px; font-size: 14px; color: var(--muted); }
.sg-all { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--blu); text-align: left; cursor: pointer; }
/* Nel menu dello smartphone l'elenco si apre sotto la casella, dentro il pannello */
.mmenu-search.has-sugg { flex-wrap: wrap; }
.mmenu-search .sugg { position: static; flex: 1 0 100%; min-width: 0; max-height: none; margin: 0 -12px; border: 0; border-top: 1px solid var(--line); border-radius: 0 0 12px 12px; box-shadow: none; }
/* Pagina dei risultati */
.search-page .app-search { max-width: 680px; }
.search-page .app-list { max-width: 760px; }
.search-page .app-h { margin: 22px 2px 8px; font-size: 1.05rem; }
.search-page .app-h .muted { font-weight: 400; font-size: .9rem; }
.search-count, .search-none { margin: 14px 2px 0; }
/* Località cercata nella tabella delle previsioni */
.fc-table tr:target td { background: #fff6d6; }
.fc-table tr { scroll-margin-top: 90px; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .sg-ico { background: #1d2f45; color: #8ec2f2; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .sg-ico.k-w { background: #2b2340; color: #c4a8f0; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .sg-ico.k-l { background: #16332a; color: #8fd8bb; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .sg-ico.k-a { background: #3a2a14; color: #f2c47e; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .sg-ico.k-p { background: #223044; color: var(--muted); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .sg-t mark { color: #8ec2f2; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .sugg { box-shadow: 0 12px 32px rgba(0, 0, 0, .5); }
:is(html[data-theme=dark], html[data-theme-now=dark]) .fc-table tr:target td { background: #3a3214; }

/* ===== Accesso (MPS-8): veste del sito pubblico ===== */
.login-page { display: grid; grid-template-columns: minmax(0, 440px) minmax(0, 380px); justify-content: center; align-items: start; gap: 28px; padding-top: 40px; padding-bottom: 48px; }
.login-card { padding: 28px 28px 22px; }
.login-mark { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--soft); color: #2D66A7; margin-bottom: 14px; }
.login-card h1 { font-size: 1.6rem; margin: 0; }
.login-card .sub { color: var(--muted); margin: 6px 0 18px; }
.login-form { display: flex; flex-direction: column; gap: 6px; }
.login-form label { font-weight: 600; font-size: .92rem; color: var(--navy); margin-top: 8px; }
.login-form input:not([type=hidden]) { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font: inherit; font-size: 16px; }
.login-form input:focus-visible { outline: 3px solid rgba(30, 112, 183, .3); border-color: var(--blu); }
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 52px !important; }
.pw-show { position: absolute; top: 4px; right: 4px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; }
.pw-show:hover, .pw-show[aria-pressed=true] { background: var(--soft); color: var(--navy); }
.pw-show svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-form button[type=submit] { margin-top: 18px; }
.login-help { margin: 16px 0 0; }
.login-side { padding: 24px 26px; border-radius: var(--r); background: var(--navy-bg); color: #e8eef5; }
.login-side h2 { color: #fff; font-size: 1.25rem; margin: 0 0 8px; }
.login-side p { margin: 0 0 14px; color: #c9d6e6; }
.login-perks { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.login-perks li { display: grid; gap: 2px; padding-left: 26px; position: relative; }
.login-perks li::before { content: ""; position: absolute; left: 0; top: 4px; width: 16px; height: 16px; border-radius: 50%; background: var(--giallo); box-shadow: inset 0 0 0 4px var(--navy-bg); }
.login-perks strong { color: #fff; }
.login-perks span { font-size: .9rem; color: #c9d6e6; }
@media (max-width: 860px) {
  .login-page { grid-template-columns: minmax(0, 520px); gap: 18px; padding-top: 24px; }
}
@media (max-width: 480px) {
  .login-card { padding: 22px 18px 18px; }
  .login-side { padding: 20px 18px; }
}
:is(html.standalone .site, .site.app-mode) .login-page { padding-top: 16px; }
:is(html[data-theme=dark], html[data-theme-now=dark]) .login-mark { color: #7fb2e8; }
