/* MeteoAllerta — redesign "Meteo-Instrument".
   Fusione Apple Weather × Samsung One UI: gerarchia netta, tanto respiro,
   card morbide, atmosfera dinamica legata al rischio, curve morbide.
   Tutte le icone/grafici sono SVG. Nessuna emoji. Mobile-first. */

/* ============================================================
   TOKENS
   ============================================================ */
:root {
  /* --- tema chiaro (default) --- */
  --bg: #f4f6fb;
  --bg-2: #eef1f8;
  --panel: #ffffff;
  --panel-2: #f7f9fd;
  --panel-brd: #e7ebf3;
  --hairline: #eef1f7;
  --ink: #16202e;
  --ink-2: #4a586b;
  --ink-3: #8994a5;
  --accent: #2f6fed;
  --accent-2: #6ea8ff;
  --accent-soft: #e9f0ff;
  --grid-line: #eef1f7;

  /* atmosfera dinamica (sfondo "Oggi" reattivo al rischio) */
  --atmo-1: #eaf2ff;
  --atmo-2: #f4f6fb;

  /* ombre morbide, multi-livello (One UI style) */
  --sh-1: 0 1px 2px rgba(20,30,55,.04);
  --sh-2: 0 2px 6px rgba(20,30,55,.05), 0 12px 28px -14px rgba(20,30,55,.12);
  --sh-3: 0 8px 20px -6px rgba(20,30,55,.10), 0 30px 60px -30px rgba(20,30,55,.22);
  --sh-accent: 0 10px 30px -12px rgba(47,111,237,.45);

  --focus: #1f5fd6;

  /* scala rischio (usata da JS via LV_COLORS anche) */
  --lv0: #38a56e;
  --lv1: #d99a2b;
  --lv2: #e0762f;
  --lv3: #d94848;
  --lv4: #9d4fd0;

  --display: "Manrope", system-ui, sans-serif;
  --body: "Manrope", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;

  --r-sm: 14px;
  --r: 20px;
  --r-lg: 26px;
  --r-xl: 32px;

  --tr: .32s cubic-bezier(.22,.68,.24,1);
  --tr-fast: .18s cubic-bezier(.22,.68,.24,1);

  --maxw: 1280px;
  --sidebar-w: 250px;
}

:root[data-theme="dark"] {
  --bg: #0a0e16;
  --bg-2: #0e131d;
  --panel: #141a26;
  --panel-2: #1a2130;
  --panel-brd: #232c3c;
  --hairline: #202838;
  --ink: #eaf0fa;
  --ink-2: #a4b2c8;
  --ink-3: #6b7a92;
  --accent: #6ea8ff;
  --accent-2: #9cc4ff;
  --accent-soft: #16273f;
  --grid-line: #1e2634;

  --atmo-1: #12203a;
  --atmo-2: #0a0e16;

  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 2px 8px rgba(0,0,0,.45), 0 14px 34px -16px rgba(0,0,0,.8);
  --sh-3: 0 10px 30px -8px rgba(0,0,0,.5), 0 40px 80px -40px rgba(0,0,0,.9);
  --sh-accent: 0 12px 34px -14px rgba(110,168,255,.5);
  --focus: #9cc4ff;

  --lv0: #45c185;
  --lv1: #e6b955;
  --lv2: #ec9463;
  --lv3: #ea6a6a;
  --lv4: #b877e0;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0e16; --bg-2: #0e131d; --panel: #141a26; --panel-2: #1a2130;
    --panel-brd: #232c3c; --hairline: #202838;
    --ink: #eaf0fa; --ink-2: #a4b2c8; --ink-3: #6b7a92;
    --accent: #6ea8ff; --accent-2: #9cc4ff; --accent-soft: #16273f; --grid-line: #1e2634;
    --atmo-1: #12203a; --atmo-2: #0a0e16;
    --sh-1: 0 1px 2px rgba(0,0,0,.4);
    --sh-2: 0 2px 8px rgba(0,0,0,.45), 0 14px 34px -16px rgba(0,0,0,.8);
    --sh-3: 0 10px 30px -8px rgba(0,0,0,.5), 0 40px 80px -40px rgba(0,0,0,.9);
    --sh-accent: 0 12px 34px -14px rgba(110,168,255,.5); --focus: #9cc4ff;
    --lv0: #45c185; --lv1: #e6b955; --lv2: #ec9463; --lv3: #ea6a6a; --lv4: #b877e0;
  }
}

* { box-sizing: border-box; }
html { transition: background-color var(--tr); }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  font-weight: 500;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color var(--tr), color var(--tr);
}
body {
  font-size: 15px;
  letter-spacing: -0.006em;
}

/* atmosfera dinamica di fondo, dietro tutto — cambia col rischio ADESSO.
   Le variabili --atmo-* sono aggiornate da JS su :root. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(120% 80% at 80% -10%, var(--atmo-1) 0%, transparent 60%),
    radial-gradient(100% 70% at 0% 0%, var(--atmo-2) 0%, transparent 55%),
    var(--bg);
  transition: background 1.2s cubic-bezier(.22,.68,.24,1);
}

/* legacy hooks disattivati */
.grid-bg, .scanlines { display: none; }

/* ============================================================
   ACCESSIBILITA
   ============================================================ */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
:focus:not(:focus-visible) { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link {
  position: fixed; top: -60px; left: 12px; z-index: 400;
  background: var(--accent); color: #fff; padding: 11px 18px; border-radius: 12px;
  font-weight: 700; font-size: 14px; text-decoration: none; transition: top .2s;
}
.skip-link:focus { top: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
@media (pointer: coarse) {
  .nav-item, .menu-btn, .theme-btn, .icon-btn, .seg-btn { min-height: 46px; }
}

/* ============================================================
   APP SHELL — sidebar + contenuto
   ============================================================ */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-w); z-index: 40;
  background: color-mix(in srgb, var(--panel) 82%, transparent);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  border-right: 1px solid var(--hairline);
  display: flex; flex-direction: column; padding: 26px 16px;
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; }
.side-brand svg { filter: drop-shadow(0 4px 10px rgba(240,160,32,.28)); }
.side-brand-name { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--ink); }
.side-nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 13px 14px; border-radius: var(--r-sm); border: none; background: none;
  font-family: var(--body); font-size: 14.5px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; text-align: left; transition: background var(--tr-fast), color var(--tr-fast), transform var(--tr-fast);
}
.nav-item svg { width: 21px; height: 21px; flex: none; transition: transform var(--tr); }
.nav-item:hover { background: var(--panel-2); color: var(--ink); }
.nav-item:hover svg { transform: scale(1.08); }
.nav-item.active {
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
}
.side-foot { margin-top: auto; font-size: 11px; color: var(--ink-3); font-weight: 600; padding: 0 8px; }
.side-scrim { display: none; }

.app { margin-left: var(--sidebar-w); min-height: 100vh; }

.view { display: none; }
.view.active { display: block; }
.view.active > * { animation: viewrise .5s cubic-bezier(.22,.68,.24,1) both; }
@keyframes viewrise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============================================================
   TOPBAR
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 20px;
  padding: 16px 30px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  border-bottom: 1px solid var(--hairline);
}
.menu-btn { display: none; background: none; border: none; color: var(--ink); cursor: pointer; padding: 8px; border-radius: 12px; }
.menu-btn:hover { background: var(--panel-2); }

.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { filter: drop-shadow(0 6px 14px rgba(240,160,32,.28)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--display); font-weight: 800; letter-spacing: -.02em; font-size: 20px; color: var(--ink); }
.brand-name b { color: var(--accent); }
.brand-sub { font-size: 11.5px; color: var(--ink-3); font-weight: 600; margin-top: 3px; letter-spacing: 0; }

.loc { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 700; cursor: pointer; padding: 7px 12px; border-radius: 999px; transition: background var(--tr-fast); }
.loc:hover { background: var(--panel-2); }
.loc svg { color: var(--accent); }
.loc .coords { color: var(--ink-3); font-size: 12px; font-weight: 500; }

.clock { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.1; }
.clock-time { font-family: var(--mono); font-size: 17px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; font-variant-numeric: tabular-nums; min-width: 8ch; text-align: right; }
.clock-date { font-size: 11px; color: var(--ink-3); font-weight: 700; letter-spacing: .4px; text-transform: uppercase; }

.theme-btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 999px; border: 1px solid var(--hairline);
  background: var(--panel); color: var(--ink-2); cursor: pointer; flex: none;
  transition: background var(--tr-fast), color var(--tr-fast), transform var(--tr-fast);
}
.theme-btn:hover, .icon-btn:hover { background: var(--panel-2); color: var(--ink); transform: translateY(-1px); }
.theme-btn svg, .icon-btn svg { width: 20px; height: 20px; }
.theme-btn .moon { display: none; }
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .theme-btn .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .theme-btn .moon { display: inline; }
}

/* ============================================================
   CARD di base
   ============================================================ */
.card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--panel-brd);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}
.card-pad { padding: 22px 24px; }

.section-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.section-title { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -.01em; color: var(--ink); }
.section-sub { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin-left: auto; }

/* legacy .panel/.tag ancora usati in poche viste — mappa allo stile card */
.panel { position: relative; background: var(--panel); border: 1px solid var(--panel-brd); border-radius: var(--r-lg); padding: 22px 24px; box-shadow: var(--sh-2); }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.tag { font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: -.01em; color: var(--ink); text-transform: none; }
.sub { font-size: 12.5px; color: var(--ink-3); margin-left: auto; font-weight: 600; }

/* ============================================================
   VISTA OGGI — nuova composizione
   ============================================================ */
.today-wrap { max-width: var(--maxw); margin: 0 auto; padding: 24px 30px 40px; }

/* HERO: condizioni attuali grandi (Apple Weather) */
.hero {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 20px;
  padding: 30px 30px 26px;
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, color-mix(in srgb, var(--atmo-1) 60%, var(--panel)) 0%, var(--panel) 62%);
  border: 1px solid var(--panel-brd);
  box-shadow: var(--sh-2);
  overflow: hidden;
}
.hero-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hero-place { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.hero-place svg { width: 15px; height: 15px; color: var(--accent); }
.hero-temp { font-family: var(--display); font-weight: 800; font-size: clamp(64px, 13vw, 104px); line-height: .9; letter-spacing: -.04em; color: var(--ink); }
.hero-temp::after { content: "°"; color: var(--accent); font-weight: 700; }
.hero-desc { font-size: 18px; font-weight: 700; color: var(--ink); margin-top: 8px; }
.hero-feels { font-size: 14px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.hero-icon { width: clamp(90px, 22vw, 150px); height: clamp(90px, 22vw, 150px); flex: none; filter: drop-shadow(0 10px 26px rgba(20,30,55,.14)); }

/* riga metriche condizioni attuali (chip orizzontali scrollabili) */
.metrics-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; }
.metric {
  display: flex; flex-direction: column; gap: 3px;
  padding: 13px 15px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--panel-2) 70%, transparent);
  border: 1px solid var(--hairline);
}
.metric-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .3px; }
.metric-lbl svg { width: 14px; height: 14px; color: var(--accent); }
.metric-val { font-family: var(--display); font-weight: 700; font-size: 19px; color: var(--ink); }
.metric-val small { font-size: 12px; color: var(--ink-3); font-weight: 600; }

/* STATUS: rischio adesso + picco — card larga, gerarchica */
.status {
  display: grid; grid-template-columns: 168px 1fr; gap: 24px; align-items: center;
  padding: 24px 26px;
}
.status-ringwrap { position: relative; display: grid; place-items: center; }
.risk-ring { width: 168px; height: 168px; }
.ring-track { fill: none; stroke: var(--bg-2); stroke-width: 13; }
.ring-value {
  fill: none; stroke: var(--lv0); stroke-width: 13; stroke-linecap: round;
  transform: rotate(-90deg); transform-origin: 100px 100px;
  stroke-dasharray: 540; stroke-dashoffset: 540;
  transition: stroke-dashoffset 1.2s cubic-bezier(.22,.68,.24,1), stroke .6s;
  filter: drop-shadow(0 3px 8px color-mix(in srgb, var(--lv0) 40%, transparent));
}
#ringTicks line { stroke: var(--grid-line); stroke-width: 1.5; }
.ring-center { position: absolute; display: flex; flex-direction: column; align-items: center; text-align: center; }
.ring-now { font-size: 10px; letter-spacing: 2px; font-weight: 800; color: var(--ink-3); }
.ring-level { font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -.02em; margin-top: 3px; }
.status-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.status-word { font-size: 15px; font-weight: 700; color: var(--ink); }
.status-peak {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13.5px; font-weight: 600; color: var(--ink-2); line-height: 1.4;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--hairline);
}
.status-peak svg { width: 17px; height: 17px; flex: none; }
.status-action {
  font-size: 13.5px; color: #fff; font-weight: 700; line-height: 1.5;
  padding: 13px 16px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--lv3), #b83636);
  box-shadow: 0 10px 26px -12px rgba(200,60,60,.7);
  display: none; align-items: center; gap: 10px;
}
.status-action.show { display: flex; }
.status-action svg { width: 20px; height: 20px; flex: none; }

/* NOWCAST 0-2h */
.nowcast-head { display: flex; align-items: center; gap: 13px; margin: 4px 0 16px; }
.nc-pulse { width: 34px; height: 34px; flex: none; color: var(--lv0); }
.nc-core { fill: currentColor; }
.nc-wave { fill: none; stroke: currentColor; stroke-width: 2; transform-origin: 20px 20px; animation: ncwave 2.6s ease-out infinite; }
@keyframes ncwave { 0% { transform: scale(1); opacity: .55; } 100% { transform: scale(3); opacity: 0; } }
.nowcast-headline { font-family: var(--display); font-weight: 700; font-size: 16px; color: var(--ink); }
.nc-strip { width: 100%; height: 54px; display: block; }
.nc-axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); padding: 6px 2px 0; font-weight: 700; }
#nowcastEta { color: var(--accent); font-weight: 700; }

/* GRIGLIA OGGI */
.today-grid {
  display: grid; gap: 16px; margin-top: 16px;
  grid-template-columns: 1.15fr 1fr;
  grid-template-areas:
    "status  nowcast"
    "windows windows"
    "gauges  wind"
    "timeline timeline"
    "official official";
}
.a-status { grid-area: status; }
.a-nowcast { grid-area: nowcast; }
.a-windows { grid-area: windows; }
.a-gauges { grid-area: gauges; }
.a-wind { grid-area: wind; }
.a-timeline { grid-area: timeline; }
.a-official { grid-area: official; }

/* FINESTRE DI RISCHIO */
.windows { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.windows .empty {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink-2); font-size: 14px; font-weight: 600;
  padding: 16px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--hairline);
}
.windows .empty svg { width: 22px; height: 22px; color: var(--lv0); flex: none; }
.win {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 15px 16px; border-radius: var(--r-sm);
  background: var(--panel-2); border: 1px solid var(--hairline);
  border-left: 4px solid var(--lv0);
  transition: box-shadow var(--tr-fast), transform var(--tr-fast);
}
.win:hover { box-shadow: var(--sh-2); transform: translateY(-1px); }
.win-cat { display: flex; align-items: center; gap: 9px; font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: -.01em; text-transform: capitalize; }
.win-cat svg { width: 20px; height: 20px; flex: none; }
.win-mid { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.win-reason { font-size: 13px; color: var(--ink-2); line-height: 1.4; font-weight: 600; }
.win-time { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.win-lvl { font-size: 11px; font-weight: 800; letter-spacing: .2px; padding: 5px 11px; border-radius: 999px; text-transform: uppercase; white-space: nowrap; }

/* GAUGES */
.gauges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px 12px; margin-top: 14px; }
.gauge { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.gauge svg { width: 100%; max-width: 104px; }
.gauge-val { font-family: var(--display); font-weight: 800; font-size: 17px; letter-spacing: -.02em; }
.gauge-name { font-size: 10.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .3px; text-align: center; }
.gauge-arc-bg { fill: none; stroke: var(--bg-2); stroke-width: 9; stroke-linecap: round; }
.gauge-arc { fill: none; stroke-width: 9; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.22,.68,.24,1); }

/* WIND ROSE */
.wind-wrap { display: flex; gap: 18px; align-items: center; margin-top: 8px; }
.windrose { width: 200px; height: 200px; flex: none; }
.wr-ring { fill: none; stroke: var(--grid-line); stroke-width: 1; }
.wr-spoke { stroke: var(--grid-line); stroke-width: 1; }
.wr-label { fill: var(--ink-3); font-family: var(--body); font-size: 10px; font-weight: 800; }
.wind-legend { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; font-weight: 600; flex: 1; }
.wl-row { display: flex; align-items: center; gap: 9px; color: var(--ink-2); }
.wl-dot { width: 11px; height: 11px; border-radius: 50%; flex: none; }
.wl-row b { color: var(--ink); font-weight: 800; margin-left: auto; font-family: var(--mono); font-size: 13px; }

/* TIMELINE ORARIA */
.tl-block { margin: 14px 0 18px; }
.tl-row-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.tl-title { font-family: var(--display); font-weight: 700; font-size: 13.5px; color: var(--ink); }
.tl-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-left: auto; font-size: 11px; font-weight: 700; color: var(--ink-2); }
.tl-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tl-legend i { width: 11px; height: 11px; border-radius: 4px; display: inline-block; }
.tl-riskstrip { width: 100%; height: 44px; display: block; }
.tl-multiples { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tl-mini { background: var(--panel-2); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 14px 15px; }
.tl-mini-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.tl-mini-name { font-family: var(--display); font-weight: 700; font-size: 13px; }
.tl-mini-unit { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }
.tl-mini-peak { font-size: 11px; color: var(--ink-2); font-weight: 700; margin-bottom: 4px; }
.tl-mini svg { width: 100%; height: 82px; display: block; }
.tl-mini .grid { stroke: var(--grid-line); stroke-width: 1; }
.tl-mini .axlabel { fill: var(--ink-3); font-family: var(--mono); font-size: 8.5px; font-weight: 500; }
.tl-mini .area { opacity: .14; }
.tl-mini .line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.tl-axis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); padding: 10px 2px 0; font-weight: 500; }
.tl-axis span { flex: 1; text-align: center; }

/* OFFICIAL */
.official { font-size: 14px; color: var(--ink-2); line-height: 1.6; font-weight: 600; margin-top: 12px; }
.official .off-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .2px; text-transform: uppercase; margin-right: 8px; }
.official .off-note { color: var(--ink-3); font-weight: 500; }

/* ============================================================
   PAGINE INTERNE — header comune
   ============================================================ */
.page-wrap { max-width: var(--maxw); margin: 0 auto; padding: 24px 30px 40px; }
.page-head { margin-bottom: 20px; }
.page-title { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 5vw, 34px); letter-spacing: -.03em; color: var(--ink); margin: 0; }
.page-sub { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }

/* ============================================================
   PREVISIONI 14 GIORNI
   ============================================================ */
.fc-overview { margin-bottom: 18px; }
.fc-tempchart { width: 100%; height: 210px; display: block; }
.fc-tempchart .tmax { fill: none; stroke: #e8823f; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.fc-tempchart .tmin { fill: none; stroke: #4a8fd6; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.fc-tempchart .band { fill: color-mix(in srgb, #e8823f 9%, transparent); }
.fc-tempchart .grid { stroke: var(--grid-line); stroke-width: 1; }
.fc-tempchart .axlabel { fill: var(--ink-3); font-family: var(--mono); font-size: 10px; font-weight: 500; }
.fc-tempaxis { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); padding: 8px 2px 0; font-weight: 500; }
.fc-tempaxis span { flex: 1; text-align: center; }

.fc-days { display: flex; flex-direction: column; gap: 8px; }
.fc-day {
  display: grid; grid-template-columns: 88px 40px 1fr 150px 88px 92px; align-items: center; gap: 14px;
  background: var(--panel); border: 1px solid var(--panel-brd); border-radius: var(--r);
  padding: 14px 20px; box-shadow: var(--sh-1);
  transition: transform var(--tr-fast), box-shadow var(--tr-fast);
}
.fc-day:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.fc-day.today { box-shadow: inset 0 0 0 1.5px var(--accent), var(--sh-1); }
.fc-day-date { display: flex; flex-direction: column; }
.fc-day-dow { font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--ink); text-transform: capitalize; }
.fc-day-num { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.fc-day-icon { width: 38px; height: 38px; }
.fc-day-desc { font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.fc-day-temps { display: flex; align-items: baseline; gap: 8px; font-family: var(--display); font-weight: 800; justify-content: flex-end; }
.fc-day-max { font-size: 19px; color: var(--ink); }
.fc-day-min { font-size: 15px; color: var(--ink-3); }
.fc-day-extra { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.fc-day-extra span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.fc-day-extra svg { width: 13px; height: 13px; color: var(--accent); flex: none; }
.fc-day-risk { display: flex; justify-content: flex-end; }
.fc-risk-badge { font-size: 10.5px; font-weight: 800; letter-spacing: .2px; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; }

/* ============================================================
   DETTAGLIO 48 ORE — timeline per giorno (redesign)
   ============================================================ */
.hr-chart { width: 100%; height: 210px; display: block; }
.hr-chart .grid { stroke: var(--grid-line); stroke-width: 1; }
.hr-chart .axlabel { fill: var(--ink-3); font-family: var(--mono); font-size: 10px; font-weight: 500; }
.hr-chart .tline { fill: none; stroke: #e8823f; stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.hr-chart .tarea { fill: color-mix(in srgb, #e8823f 8%, transparent); }
.hr-chart .pbar { fill: color-mix(in srgb, #4a8fd6 42%, transparent); }
.hr-chart .nowline { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 3 3; }

/* gruppo giorno */
.hr-day-group { margin-top: 22px; }
.hr-day-label {
  position: sticky; left: 0;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--display); font-weight: 800; font-size: 15px; color: var(--ink);
  margin-bottom: 12px; text-transform: capitalize;
}
.hr-day-label .badge { font-size: 10.5px; font-weight: 800; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; }
/* strip oraria scorrevole orizzontale (Apple Weather style) */
.hr-strip {
  display: flex; gap: 10px; overflow-x: auto; padding: 4px 4px 14px;
  scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.hr-strip::-webkit-scrollbar { height: 6px; }
.hr-strip::-webkit-scrollbar-thumb { background: var(--panel-brd); border-radius: 3px; }
.hr-tile {
  flex: 0 0 auto; width: 76px; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  padding: 14px 8px 12px; border-radius: var(--r);
  background: var(--panel); border: 1px solid var(--panel-brd); box-shadow: var(--sh-1);
  position: relative; transition: transform var(--tr-fast), box-shadow var(--tr-fast);
}
.hr-tile:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.hr-tile.now { box-shadow: inset 0 0 0 1.5px var(--accent), var(--sh-1); }
.hr-tile.now::before { content: "ORA"; position: absolute; top: -9px; font-size: 8.5px; font-weight: 800; letter-spacing: .5px; color: #fff; background: var(--accent); padding: 2px 7px; border-radius: 999px; }
.hr-tile-time { font-family: var(--mono); font-size: 11.5px; color: var(--ink-2); font-weight: 600; }
.hr-tile-icon { width: 32px; height: 32px; }
.hr-tile-temp { font-family: var(--display); font-weight: 800; font-size: 19px; color: var(--ink); letter-spacing: -.02em; }
.hr-tile-rain { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; color: #4a8fd6; min-height: 14px; }
.hr-tile-rain svg { width: 11px; height: 11px; }
.hr-tile-risk { width: 20px; height: 4px; border-radius: 2px; margin-top: 2px; }
.hr-tile-gust { font-family: var(--mono); font-size: 10px; color: var(--ink-3); font-weight: 500; }

/* ============================================================
   FINESTRE DI RISCHIO — pagina visual-first
   ============================================================ */
.risk-summary { margin-bottom: 18px; }

/* verdetto sintetico in cima */
.rk-verdict { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; }
.rk-verdict-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 5px color-mix(in srgb, var(--ink) 6%, transparent); }
.rk-verdict-txt { display: flex; flex-direction: column; gap: 2px; }
.rk-verdict-txt b { font-family: var(--display); font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.rk-verdict-txt small { font-size: 13px; color: var(--ink-2); font-weight: 600; }

.rk-status { font-weight: 800; }
.rk-status-off { color: var(--lv0); }
.rk-status-off::before { content: "● "; }
.rk-status-on::before { content: "● "; }

/* timeline sinottica */
.rk-timeline { position: relative; margin-top: 4px; }
.rk-tl-legend { display: flex; gap: 18px; margin-bottom: 14px; font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.rk-tl-legend span { display: inline-flex; align-items: center; gap: 7px; }
.rk-tl-legend i { width: 22px; height: 8px; border-radius: 999px; display: inline-block; }
.rk-tl-legend .lg-soft { background: repeating-linear-gradient(90deg, var(--ink-3) 0 4px, transparent 4px 8px); opacity: .5; }
.rk-tl-legend .lg-hot { background: var(--ink-2); }

.rk-tl-rows { position: relative; display: flex; flex-direction: column; gap: 16px; padding-top: 4px; }
.rk-row { display: grid; grid-template-columns: 30px 1fr; align-items: center; gap: 12px; }
.rk-row-ic { display: grid; place-items: center; }
.rk-row-ic svg { width: 22px; height: 22px; }
.rk-track { position: relative; height: 16px; }
/* fase di sorveglianza: barra tenue tratteggiata */
.rk-bar-soft { position: absolute; top: 50%; transform: translateY(-50%); height: 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--rc) 22%, transparent);
  border: 1.5px dashed color-mix(in srgb, var(--rc) 55%, transparent); }
/* attorno al picco: barra piena accesa con glow */
.rk-bar-hot { position: absolute; top: 50%; transform: translateY(-50%); height: 12px; border-radius: 999px; opacity: .95;
  box-shadow: 0 0 12px -2px currentColor; transition: width 1s cubic-bezier(.22,.68,.24,1); }
.rk-peak { position: absolute; top: 50%; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; }
.rk-peak i { width: 15px; height: 15px; border-radius: 50%; background: currentColor; border: 3px solid var(--panel); box-shadow: var(--sh-2); }
.rk-peak b { position: absolute; top: 15px; font-family: var(--mono); font-size: 10px; font-weight: 500; color: currentColor; white-space: nowrap; }
.rk-now-line { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--ink); opacity: .45; transform: translateX(-1px); border-radius: 2px; }
.rk-axis { position: relative; height: 18px; margin-top: 22px; }
.rk-tick { position: absolute; transform: translateX(-50%); font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); font-weight: 500; top: 0; }
.rk-now { position: absolute; transform: translateX(-50%); top: -2px; }
.rk-now b { font-size: 9px; font-weight: 800; letter-spacing: .5px; color: #fff; background: var(--ink); padding: 2px 7px; border-radius: 999px; }

/* card compatte */
.risk-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.rk-card { padding: 18px 20px; border-top: 4px solid var(--rc, var(--accent)); transition: transform var(--tr-fast), box-shadow var(--tr-fast); }
.rk-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.rk-card-head { display: flex; align-items: center; gap: 13px; }
.rk-card-ic { flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; }
.rk-card-ic svg { width: 26px; height: 26px; }
.rk-card-title { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.rk-card-title b { font-family: var(--display); font-weight: 800; font-size: 18px; letter-spacing: -.02em; color: var(--ink); }
.rk-card-title small { font-size: 12px; color: var(--ink-3); font-weight: 600; }

.rk-when { display: flex; align-items: baseline; gap: 8px; margin: 16px 0 6px; }
.rk-when-eta { font-family: var(--display); font-weight: 800; font-size: 26px; letter-spacing: -.03em; }
.rk-when-lbl { font-size: 12.5px; color: var(--ink-3); font-weight: 600; }

/* barra inizio→picco→fine dentro la card (tenue = possibilità, pallino = picco) */
.rk-mini { position: relative; height: 8px; border-radius: 999px; margin: 14px 0 30px;
  background: color-mix(in srgb, var(--rc) 14%, transparent);
  border: 1.5px dashed color-mix(in srgb, var(--rc) 45%, transparent); }
.rk-mini-fill { display: none; }
.rk-mini-peak { position: absolute; top: 50%; transform: translate(-50%,-50%); width: 14px; height: 14px; border-radius: 50%; background: var(--rc); border: 3px solid var(--panel); box-shadow: var(--sh-1); }
.rk-mini-lbl { position: absolute; top: 15px; font-family: var(--mono); font-size: 10px; color: var(--ink-3); font-weight: 500; }
.rk-mini-l { left: 0; } .rk-mini-r { right: 0; }

.rk-tip { display: flex; align-items: center; gap: 9px; padding: 10px 13px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 700; line-height: 1.4; margin-bottom: 4px; }
.rk-tip svg { width: 18px; height: 18px; flex: none; }

/* progressive disclosure */
.rk-why { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 12px;
  border: 1px solid var(--hairline); background: var(--panel-2); cursor: pointer;
  padding: 9px; border-radius: var(--r-sm); font-family: var(--body); font-weight: 700; font-size: 12.5px; color: var(--ink-2);
  transition: background var(--tr-fast), color var(--tr-fast); }
.rk-why:hover { background: var(--accent-soft); color: var(--accent); }
.rk-why svg { width: 16px; height: 16px; transition: transform var(--tr-fast); }
.rk-why[aria-expanded="true"] svg { transform: rotate(180deg); }
.rk-detail { animation: rkexpand .3s cubic-bezier(.22,.68,.24,1); overflow: hidden; }
@keyframes rkexpand { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.rk-detail-desc { font-size: 13px; color: var(--ink-2); line-height: 1.6; font-weight: 500; margin: 14px 0 12px; }
.rk-detail-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.rk-detail-list li { position: relative; padding-left: 18px; font-size: 12.5px; color: var(--ink-2); font-weight: 600; line-height: 1.5; }
.rk-detail-list li::before { content: ""; position: absolute; left: 3px; top: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--rc, var(--accent)); }

/* link "Dettagli" nell'header della card in home */
.section-link {
  margin-left: auto; display: inline-flex; align-items: center; gap: 10px;
  border: none; background: none; cursor: pointer; padding: 4px 6px; border-radius: 999px;
  font-size: 12.5px; color: var(--ink-3); font-weight: 600; transition: color var(--tr-fast), background var(--tr-fast);
}
.section-link:hover { color: var(--accent); background: var(--accent-soft); }
.section-link-cta { display: inline-flex; align-items: center; gap: 3px; font-weight: 800; color: var(--accent); }
.section-link-cta svg { width: 14px; height: 14px; }

/* ============================================================
   RICHIAMI RAPIDI (quicknav) in home
   ============================================================ */
.quicknav { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 16px; }
.qn {
  display: flex; align-items: center; gap: 14px; text-align: left; cursor: pointer;
  padding: 16px 18px; border-radius: var(--r); border: 1px solid var(--panel-brd);
  background: var(--panel); box-shadow: var(--sh-1);
  transition: transform var(--tr-fast), box-shadow var(--tr-fast), border-color var(--tr-fast);
}
.qn:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: color-mix(in srgb, var(--accent) 40%, var(--panel-brd)); }
.qn:hover .qn-arr { transform: translateX(3px); color: var(--accent); }
.qn-ic { flex: none; width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.qn-ic svg { width: 22px; height: 22px; }
.qn-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.qn-txt b { font-family: var(--display); font-weight: 800; font-size: 14.5px; letter-spacing: -.01em; color: var(--ink); }
.qn-txt small { font-size: 11.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qn-arr { width: 18px; height: 18px; flex: none; color: var(--ink-3); transition: transform var(--tr-fast), color var(--tr-fast); }

/* ============================================================
   QUALITA ARIA
   ============================================================ */
.air-aqi-main { display: flex; align-items: center; gap: 22px; margin-top: 14px; }
.air-aqi-value { font-family: var(--display); font-weight: 800; font-size: 60px; line-height: 1; letter-spacing: -.03em; }
.air-aqi-band { font-family: var(--display); font-weight: 800; font-size: 19px; padding: 8px 18px; border-radius: 999px; }
.air-pollutants { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-top: 14px; }
.air-poll { background: var(--panel-2); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 14px 16px; }
.air-poll-name { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.air-poll-val { font-family: var(--display); font-weight: 800; font-size: 23px; color: var(--ink); margin: 3px 0 8px; letter-spacing: -.02em; }
.air-poll-val small { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.air-poll-track { height: 7px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.air-poll-fill { height: 100%; border-radius: 4px; transition: width 1s cubic-bezier(.22,.68,.24,1); }
.air-pollen { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-top: 14px; }
.pollen-item { display: flex; align-items: center; justify-content: space-between; background: var(--panel-2); border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 14px 16px; }
.pollen-name { font-size: 13.5px; font-weight: 800; color: var(--ink); }
.pollen-peak { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.pollen-badge { font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 999px; }

/* ============================================================
   SOLE E LUNA — scena ad arco animata
   ============================================================ */
.sky-card {
  position: relative; overflow: hidden; margin-bottom: 16px;
  padding: 20px 22px 22px;
  --sky-top: #bfe0ff; --sky-bot: #eaf4ff;
  --sky-horizon: #9fb6cf; --sky-arcbase: #d6e4f5;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 78%);
  border: 1px solid var(--panel-brd);
  transition: background 1s cubic-bezier(.22,.68,.24,1), border-color var(--tr);
}
.sky-card[data-scene="night"] {
  --sky-top: #0b1330; --sky-bot: #1a2350;
  --sky-horizon: #3a4a78; --sky-arcbase: #2b3763;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 88%);
}
/* in dark theme, il giorno resta un filo più tenue */
:root[data-theme="dark"] .sky-card[data-scene="day"] {
  --sky-top: #24446b; --sky-bot: #2f5578; --sky-horizon: #5b7a9c; --sky-arcbase: #3a5a7e;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bot) 82%);
}

.sky-toggle { position: relative; z-index: 2; display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(255,255,255,.5); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,.4); }
.sky-card[data-scene="night"] .sky-toggle { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.12); }
.seg-btn {
  display: inline-flex; align-items: center; gap: 7px; border: none; cursor: pointer;
  padding: 8px 15px; border-radius: 999px; font-family: var(--display); font-weight: 700; font-size: 13px;
  background: transparent; color: #33465e; transition: background var(--tr-fast), color var(--tr-fast);
}
.seg-btn svg { width: 17px; height: 17px; }
.sky-card[data-scene="night"] .seg-btn { color: #b9c6e8; }
.seg-btn[aria-pressed="true"] { background: #ffffff; color: #1c2b3e; box-shadow: 0 2px 8px rgba(20,30,55,.16); }
.sky-card[data-scene="night"] .seg-btn[aria-pressed="true"] { background: #2b3763; color: #eef3fb; }

.sky-arc { width: 100%; max-width: 520px; height: auto; display: block; margin: 6px auto 2px; }
.sky-body { transition: none; }
.sky-sun { filter: drop-shadow(0 0 10px rgba(255,180,62,.6)); animation: sunbob 6s ease-in-out infinite; }
.sky-moon { filter: drop-shadow(0 0 8px rgba(150,175,255,.5)); animation: sunbob 7s ease-in-out infinite; }
@keyframes sunbob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
.sky-star { animation: twinkle 3.5s ease-in-out infinite; }
@keyframes twinkle { 0%,100% { opacity: .25; } 50% { opacity: .7; } }

.sky-status { position: relative; z-index: 2; text-align: center; margin-top: 2px; }
.sky-phase { display: block; font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: -.02em; color: #1c2b3e; }
.sky-detail { display: block; font-size: 13px; font-weight: 600; margin-top: 2px; color: #46586f; }
.sky-card[data-scene="night"] .sky-phase { color: #eef3fb; }
.sky-card[data-scene="night"] .sky-detail { color: #a9b7d8; }

.sky-endpoints { position: relative; z-index: 2; display: flex; justify-content: space-between; margin-top: 14px; padding: 0 6px; }
.sky-ep { display: flex; flex-direction: column; }
.sky-ep-r { align-items: flex-end; }
.sky-ep-lbl { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: #5a6d85; }
.sky-ep-val { font-family: var(--mono); font-size: 16px; font-weight: 500; color: #1c2b3e; }
.sky-card[data-scene="night"] .sky-ep-lbl { color: #8b9bc0; }
.sky-card[data-scene="night"] .sky-ep-val { color: #eef3fb; }
@media (prefers-reduced-motion: reduce) { .sky-sun, .sky-moon, .sky-star { animation: none; } }

.astro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.astro-card { background: var(--panel); border: 1px solid var(--panel-brd); border-radius: var(--r-lg); padding: 24px 22px; box-shadow: var(--sh-2); text-align: center; transition: transform var(--tr-fast), box-shadow var(--tr-fast); }
.astro-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }
.astro-card svg { width: 54px; height: 54px; margin-bottom: 10px; }
.astro-label { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .4px; }
.astro-value { font-family: var(--display); font-weight: 800; font-size: 30px; color: var(--ink); margin: 5px 0; letter-spacing: -.02em; }
.astro-note { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }

/* ============================================================
   GUIDA & INDICI
   ============================================================ */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.info-card { background: var(--panel); border: 1px solid var(--panel-brd); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--sh-1); transition: transform var(--tr-fast), box-shadow var(--tr-fast); }
.info-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.info-card h3 { font-family: var(--display); font-weight: 800; font-size: 15.5px; letter-spacing: -.01em; margin: 0 0 7px; }
.info-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.6; margin: 0; font-weight: 500; }
.info-card .chip { display: inline-block; font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: 999px; margin: 8px 4px 0 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.footbar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  max-width: var(--maxw); margin: 0 auto; padding: 18px 30px 30px;
  font-size: 12px; color: var(--ink-3); font-weight: 600;
}
#footStatus::before { content: "● "; color: var(--lv0); }
#footStatus.stale::before { color: var(--lv1); }
#footStatus.err::before { color: var(--lv3); }

/* ============================================================
   TOAST / ONBOARDING / STATE (invariati nello scopo, ristilizzati)
   ============================================================ */
.toast-wrap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--panel-brd); box-shadow: var(--sh-3); border-radius: 16px; padding: 13px 16px; font-size: 14px; font-weight: 600; color: var(--ink); animation: toastin .32s cubic-bezier(.22,.68,.24,1); max-width: 92vw; }
@keyframes toastin { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.toast button { border: none; background: var(--accent); color: #fff; font-weight: 700; padding: 8px 14px; border-radius: 11px; cursor: pointer; font-size: 13px; box-shadow: var(--sh-accent); }
.toast .toast-close { background: none; color: var(--ink-3); padding: 4px 8px; box-shadow: none; }

.onboard { position: fixed; inset: 0; z-index: 350; display: none; align-items: center; justify-content: center; padding: 20px; background: color-mix(in srgb, var(--bg) 40%, rgba(6,10,18,.6)); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.onboard.show { display: flex; animation: toastin .3s ease; }
.onboard-card { background: var(--panel); border: 1px solid var(--panel-brd); border-radius: var(--r-xl); max-width: 440px; width: 100%; padding: 34px 30px; box-shadow: var(--sh-3); text-align: center; }
.onboard-card svg.hero-mark { width: 66px; height: 66px; margin-bottom: 14px; filter: drop-shadow(0 8px 18px rgba(240,160,32,.3)); }
.onboard-card h2 { font-family: var(--display); font-weight: 800; font-size: 23px; letter-spacing: -.02em; margin: 0 0 8px; }
.onboard-card > p { font-size: 14.5px; color: var(--ink-2); line-height: 1.6; font-weight: 500; margin: 0 0 12px; }
.onboard-feats { text-align: left; margin: 18px 0 22px; display: flex; flex-direction: column; gap: 12px; }
.onboard-feat { display: flex; gap: 12px; align-items: flex-start; font-size: 13.5px; color: var(--ink-2); font-weight: 600; }
.onboard-feat svg { width: 22px; height: 22px; color: var(--accent); flex: none; margin-top: 1px; }
.onboard-btn { width: 100%; border: none; background: var(--accent); color: #fff; font-family: var(--display); font-weight: 800; font-size: 15.5px; padding: 15px; border-radius: 15px; cursor: pointer; box-shadow: var(--sh-accent); }

.state-box { text-align: center; padding: 44px 20px; color: var(--ink-2); }
.state-box svg { width: 48px; height: 48px; color: var(--ink-3); margin-bottom: 14px; }
.state-box .state-title { font-family: var(--display); font-weight: 800; font-size: 17px; color: var(--ink); margin-bottom: 5px; }
.state-box .state-msg { font-size: 13.5px; margin-bottom: 16px; }
.state-box button { border: none; background: var(--accent); color: #fff; font-weight: 700; padding: 10px 20px; border-radius: 12px; cursor: pointer; font-size: 13.5px; box-shadow: var(--sh-accent); }

.skeleton { background: linear-gradient(90deg, var(--panel-2) 25%, var(--panel-brd) 37%, var(--panel-2) 63%); background-size: 400% 100%; border-radius: 10px; animation: shimmer 1.5s ease infinite; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .today-grid { grid-template-columns: 1fr; grid-template-areas: "status" "nowcast" "windows" "gauges" "wind" "timeline" "official"; }
  .tl-multiples { grid-template-columns: repeat(3, 1fr); }
}

/* sidebar off-canvas su mobile/tablet stretto (hamburger + drawer) */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-102%); transition: transform var(--tr); box-shadow: var(--sh-3); background: var(--panel); }
  body.nav-open .sidebar { transform: translateX(0); }
  .side-scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(6,10,18,.4); opacity: 0; pointer-events: none; transition: opacity var(--tr); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
  body.nav-open .side-scrim { opacity: 1; pointer-events: auto; }
  .app { margin-left: 0; }
  .menu-btn { display: inline-flex; }
  .brand-sub { display: none; }
}

@media (max-width: 720px) {
  body { font-size: 14.5px; }
  .topbar { padding: 12px 16px; gap: 12px; }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: 17px; }
  .loc { display: none; }
  .clock { margin-left: auto; }
  .clock-time { font-size: 15px; }
  .today-wrap, .page-wrap { padding: 16px 16px 40px; }
  .hero { grid-template-columns: 1fr; padding: 24px 22px; }
  .hero-icon { position: absolute; top: 20px; right: 18px; width: 84px; height: 84px; }
  .hero-temp { font-size: clamp(72px, 26vw, 96px); }
  .metrics-row { grid-template-columns: repeat(2, 1fr); }
  .status { grid-template-columns: 128px 1fr; gap: 16px; padding: 20px; }
  .risk-ring { width: 128px; height: 128px; }
  .tl-multiples { grid-template-columns: 1fr; }
  .tl-mini svg { height: 96px; }
  .tl-legend { width: 100%; margin-left: 0; }
  .wind-wrap { flex-direction: column; align-items: stretch; }
  .windrose { align-self: center; }
  .fc-day { grid-template-columns: 60px 32px 1fr auto; gap: 12px; padding: 13px 16px; }
  .fc-day-desc, .fc-day-extra { display: none; }
  .footbar { padding: 16px; }
  .footbar .foot-src { display: none; }
}

@media (max-width: 420px) {
  .metrics-row { grid-template-columns: 1fr; }
  .gauges { grid-template-columns: repeat(2, 1fr); }
  .clock-date { display: none; }
  .ring-level { font-size: 22px; }
  .status { grid-template-columns: 112px 1fr; }
  .risk-ring { width: 112px; height: 112px; }
}

/* ============================================================
   LOC caret in topbar
   ============================================================ */
.loc { border: none; font-family: var(--body); }
.loc-caret { color: var(--ink-3); margin-left: 2px; }

/* ============================================================
   SHEET (modale bottom su mobile, centrato su desktop)
   ============================================================ */
.sheet-scrim { position: fixed; inset: 0; z-index: 360; background: color-mix(in srgb, var(--bg) 30%, rgba(6,10,18,.55)); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); opacity: 0; pointer-events: none; transition: opacity var(--tr); }
.sheet-scrim.show { opacity: 1; pointer-events: auto; }
.sheet { position: fixed; z-index: 370; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; pointer-events: none; }
.sheet.show { pointer-events: auto; }
.sheet-card {
  background: var(--panel); border: 1px solid var(--panel-brd); border-radius: var(--r-xl);
  box-shadow: var(--sh-3); width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto;
  padding: 22px 22px 24px; opacity: 0; transform: translateY(16px) scale(.98); transition: opacity var(--tr), transform var(--tr);
}
.sheet.show .sheet-card { opacity: 1; transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-head h2 { font-family: var(--display); font-weight: 800; font-size: 21px; letter-spacing: -.02em; margin: 0; }
.sheet-close { width: 38px; height: 38px; border-radius: 50%; border: none; background: var(--panel-2); color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.sheet-close:hover { background: var(--accent-soft); color: var(--accent); }
.sheet-close svg { width: 20px; height: 20px; }

/* ricerca località */
.loc-search { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--hairline); margin-bottom: 10px; }
.loc-search svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.loc-search input { flex: 1; border: none; background: none; outline: none; font-family: var(--body); font-size: 15px; font-weight: 600; color: var(--ink); }
.loc-search input::placeholder { color: var(--ink-3); font-weight: 500; }
.loc-gps { display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 15px; border-radius: var(--r-sm); border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-family: var(--body); font-weight: 700; font-size: 14px; cursor: pointer; margin-bottom: 8px; transition: background var(--tr-fast); }
.loc-gps:hover { background: color-mix(in srgb, var(--accent) 16%, var(--panel)); }
.loc-gps svg { width: 20px; height: 20px; flex: none; }
.loc-gps.busy { opacity: .6; pointer-events: none; }
.loc-gps.busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.loc-results, .loc-saved { display: flex; flex-direction: column; gap: 4px; }
.loc-saved-title, .loc-hint { font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .3px; padding: 12px 4px 6px; }
.loc-hint { text-transform: none; font-weight: 600; letter-spacing: 0; }
.loc-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: var(--r-sm); border: 1px solid transparent; background: none; transition: background var(--tr-fast); }
.loc-item:hover { background: var(--panel-2); }
.loc-item.active { background: var(--accent-soft); }
.loc-item > svg:first-child { width: 20px; height: 20px; color: var(--accent); flex: none; }
.loc-item-txt { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }
.loc-item-txt b { font-family: var(--display); font-weight: 700; font-size: 14.5px; color: var(--ink); }
.loc-item-txt small { font-size: 12px; color: var(--ink-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loc-check { width: 20px; height: 20px; color: var(--accent); flex: none; }

/* ============================================================
   IMPOSTAZIONI NOTIFICHE
   ============================================================ */
.set-master { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--hairline); margin-bottom: 8px; }
.set-master-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.set-master-txt b { font-family: var(--display); font-weight: 800; font-size: 15.5px; color: var(--ink); }
.set-master-txt small { font-size: 12.5px; color: var(--ink-2); font-weight: 600; }

.switch { flex: none; width: 52px; height: 30px; border-radius: 999px; border: none; cursor: pointer; background: var(--panel-brd); position: relative; transition: background var(--tr); }
.switch[aria-checked="true"] { background: var(--accent); }
.switch-knob { position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform var(--tr); }
.switch[aria-checked="true"] .switch-knob { transform: translateX(22px); }

.set-body { margin-top: 12px; transition: opacity var(--tr); }
.set-body.disabled { opacity: .4; pointer-events: none; }
.set-group-title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-3); margin: 16px 0 8px; }
.set-types { display: flex; flex-direction: column; gap: 6px; }
.set-type { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--hairline); cursor: pointer; }
.set-type-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.set-type-ic svg { width: 20px; height: 20px; }
.set-type-txt { flex: 1; font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--ink); }
.set-type .switch { width: 46px; height: 27px; }
.set-type .switch-knob { width: 21px; height: 21px; }
.set-type .switch[aria-checked="true"] .switch-knob { transform: translateX(19px); }

.set-threshold { display: flex; gap: 6px; }
.set-th-btn { flex: 1; padding: 11px 8px; border-radius: var(--r-sm); border: 1.5px solid var(--hairline); background: var(--panel-2); color: var(--ink-2); font-family: var(--body); font-weight: 700; font-size: 13px; cursor: pointer; transition: all var(--tr-fast); }
.set-th-btn.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.set-note { font-size: 12.5px; color: var(--ink-3); font-weight: 500; line-height: 1.5; margin: 16px 0 12px; }
.set-test { width: 100%; padding: 13px; border-radius: var(--r-sm); border: 1px solid var(--panel-brd); background: var(--panel-2); color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 14px; cursor: pointer; transition: background var(--tr-fast); }
.set-test:hover { background: var(--accent-soft); color: var(--accent); }

@media (max-width: 560px) {
  .sheet { align-items: flex-end; padding: 0; }
  .sheet-card { max-width: 100%; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 90vh; }
  .sheet.show .sheet-card { transform: none; }
}

/* ============================================================
   LOC ITEM con stella (modale) + set-loc rows
   ============================================================ */
.loc-item { display: flex; align-items: center; gap: 4px; padding: 0; border: 1px solid transparent; }
.loc-item-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; text-align: left; cursor: pointer;
  padding: 12px 14px; border-radius: var(--r-sm); border: none; background: none; transition: background var(--tr-fast); }
.loc-item-main:hover { background: var(--panel-2); }
.loc-item.active .loc-item-main { background: var(--accent-soft); }
.loc-item-main > svg:first-child { width: 20px; height: 20px; color: var(--accent); flex: none; }
.loc-star { flex: none; width: 40px; height: 40px; border-radius: 50%; border: none; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink-3); transition: color var(--tr-fast), background var(--tr-fast); }
.loc-star:hover { background: var(--panel-2); }
.loc-star svg { width: 20px; height: 20px; }
.loc-star.on { color: #f0a81c; }

.set-empty { font-size: 13px; color: var(--ink-2); font-weight: 600; line-height: 1.55; padding: 14px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--hairline); }
.set-empty b { color: var(--ink); }
.set-loc-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--panel-2); border: 1px solid var(--hairline); cursor: pointer; margin-bottom: 6px; }
.set-loc-row:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--hairline)); }
.set-loc-ic { color: var(--accent); flex: none; display: grid; place-items: center; }
.set-loc-ic svg { width: 18px; height: 18px; }
.set-loc-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.set-loc-txt b { font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--ink); }
.set-loc-txt small { font-size: 11.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-manage { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; padding: 13px 15px; border-radius: var(--r-sm); border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent); font-family: var(--body); font-weight: 700; font-size: 14px; cursor: pointer; }
.set-manage svg { width: 19px; height: 19px; flex: none; }
.set-manage-arr { margin-left: auto; }

/* ============================================================
   PAGINA PREFERITI
   ============================================================ */
.fav-add { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 16px; padding: 11px 18px; border-radius: 999px;
  border: 1px dashed var(--panel-brd); background: var(--panel); color: var(--ink-2); font-family: var(--display); font-weight: 700; font-size: 14px; cursor: pointer; transition: all var(--tr-fast); }
.fav-add:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.fav-add svg { width: 18px; height: 18px; }

.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.fav-card { padding: 18px 20px; }
.fav-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.fav-place { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fav-place > svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.fav-place-txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.fav-place-txt b { font-family: var(--display); font-weight: 800; font-size: 16.5px; letter-spacing: -.01em; color: var(--ink); }
.fav-coords { font-family: var(--mono); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.fav-remove { flex: none; width: 32px; height: 32px; border-radius: 50%; border: none; background: var(--panel-2); color: var(--ink-3); cursor: pointer; display: grid; place-items: center; transition: all var(--tr-fast); }
.fav-remove:hover { background: color-mix(in srgb, var(--lv3) 14%, transparent); color: var(--lv3); }
.fav-remove svg { width: 16px; height: 16px; }

.fav-summary { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; cursor: pointer; margin: 14px 0;
  padding: 14px; border-radius: var(--r); border: 1px solid var(--hairline); background: var(--panel-2); transition: all var(--tr-fast); }
.fav-summary:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--hairline)); transform: translateY(-1px); }
.fav-ico { width: 44px; height: 44px; flex: none; }
.fav-temp { font-family: var(--display); font-weight: 800; font-size: 30px; letter-spacing: -.03em; color: var(--ink); }
.fav-mid { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.fav-desc { font-size: 13.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav-risk { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.fav-risk-dot { width: 9px; height: 9px; border-radius: 50%; }
.fav-open { font-size: 12px; font-weight: 800; color: var(--accent); white-space: nowrap; }
.fav-active-badge { font-size: 10.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; color: var(--accent); background: var(--accent-soft); padding: 4px 9px; border-radius: 999px; white-space: nowrap; }

.fav-notify { border-top: 1px solid var(--hairline); padding-top: 14px; }
.fav-notify-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.fav-notify-lbl { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 13.5px; color: var(--ink); }
.fav-notify-lbl svg { width: 18px; height: 18px; color: var(--ink-2); }
.fav-notify-body { margin-top: 14px; }
.fav-types { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.fav-type-chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px;
  border: 1.5px solid var(--hairline); background: var(--panel-2); color: var(--ink-3); font-family: var(--body); font-weight: 700; font-size: 12.5px; cursor: pointer; transition: all var(--tr-fast); }
.fav-type-chip svg { width: 15px; height: 15px; }
.fav-type-chip.on { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 12%, transparent); color: var(--tc); }
.fav-th-lbl { font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .3px; color: var(--ink-3); margin-bottom: 7px; }
.fav-th-btns { display: flex; gap: 6px; }
.fav-th-btns .set-th-btn { flex: 1; }
