/* Layout: app a schermo unico. Tab "Città": colonna scorrevole di righe-cielo + pannello previsioni
   (a tutto schermo su iPhone, colonna destra su iPad orizzontale e Mac). Tab "Mappamondo": globo a tutta pagina. */

@font-face { font-family: "Saira Condensed"; src: url("fonts/saira-condensed-200.woff") format("woff"); font-weight: 200; font-display: swap; }
@font-face { font-family: "Saira Condensed"; src: url("fonts/saira-condensed-300.woff") format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Saira Condensed"; src: url("fonts/saira-condensed-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Saira Condensed"; src: url("fonts/saira-condensed-500.woff") format("woff"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Saira Condensed"; src: url("fonts/saira-condensed-600.woff") format("woff"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans-var.woff") format("woff"); font-weight: 400 700; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-400.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/ibm-plex-mono-500.woff") format("woff"); font-weight: 500; font-display: swap; }

:root {
  /* colore */
  --bg: #edf1f6;            /* grigio-azzurro di cielo pallido */
  --surface: #ffffff;
  --surface-2: #e2e8f0;
  --fg: #0e1b2c;
  --muted: #56677c;
  --line: #d2dbe6;
  --accent: #1b5db5;        /* azzurro aeronautica */
  --accent-soft: #dbe7f7;
  --accent-fg: #ffffff;
  --danger: #c93434;
  --warm: #d9700f;
  --rain: #2a78d6;
  --wind: #1f8a72;
  --hum: #4b6fd1;
  --press: #7655a8;
  --tabbar-bg: rgba(255, 255, 255, 0.84);
  --glass: rgba(255, 255, 255, 0.8);
  --glass-line: rgba(14, 27, 44, 0.08);
  --shadow: 0 1px 2px rgba(14, 27, 44, 0.06), 0 10px 28px rgba(14, 27, 44, 0.1);
  --sky-dim: rgba(0, 0, 0, 0);
  /* icone meteo sulla pagina */
  --ic-sun: #f2a90c;
  --ic-sun-core: #ffc83a;
  --ic-moon: #c9d5ea;
  --ic-moon-on-page: #8ea2c2;
  --ic-cloud: #e6ecf3;
  --ic-cloud-back: #c7d2df;
  --ic-cloud-edge: #94a6bb;
  --ic-cloud-dark: #7f8ea2;
  --ic-rain: #2f86ea;
  --ic-snow: #8fb4e0;
  --ic-bolt: #f5b700;
  --ic-fog: #9aa8b8;
  --ic-dust: #b98b4a;
  /* globo */
  --globe-bg-1: #dce7f3;
  --globe-bg-2: #b7cbe1;
  --ocean-1: #2f6aa3;
  --ocean-2: #163f69;
  --land: #e9eef3;
  --land-line: rgba(22, 63, 105, 0.35);
  --grat: rgba(255, 255, 255, 0.14);
  --atmo: rgba(120, 175, 235, 0.55);
  --night: rgba(6, 14, 38, 0.38);
  --label: #0e1b2c;
  --label-halo: rgba(255, 255, 255, 0.85);
  /* tipografia */
  --font-display: "Saira Condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  --font-body: "Instrument Sans", -apple-system, system-ui, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --panel-w: 100%;
  --tabbar-h: 64px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a111d;
    --surface: #111a29;
    --surface-2: #19253a;
    --fg: #e7edf6;
    --muted: #93a3b8;
    --line: #233149;
    --accent: #63a6ff;
    --accent-soft: #19304f;
    --accent-fg: #06101f;
    --danger: #ff6b6b;
    --warm: #ffa04a;
    --rain: #5aa8ff;
    --wind: #45c2a3;
    --hum: #8aa8ff;
    --press: #b597ea;
    --tabbar-bg: rgba(14, 22, 35, 0.84);
    --glass: rgba(17, 26, 41, 0.82);
    --glass-line: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.35);
    --sky-dim: rgba(2, 6, 16, 0.22);
    --ic-cloud: #d6dee9;
    --ic-cloud-back: #8e9cb0;
    --ic-cloud-edge: rgba(0, 0, 0, 0);
    --ic-cloud-dark: #6f7d91;
    --ic-moon-on-page: #c9d5ea;
    --ic-snow: #e9f2ff;
    --ic-fog: #8796a8;
    --globe-bg-1: #0d1a2e;
    --globe-bg-2: #04080f;
    --ocean-1: #15406d;
    --ocean-2: #081d36;
    --land: #3c536d;
    --land-line: rgba(200, 220, 245, 0.28);
    --grat: rgba(160, 200, 255, 0.1);
    --atmo: rgba(90, 160, 255, 0.45);
    --night: rgba(0, 4, 18, 0.45);
    --label: #e7edf6;
    --label-halo: rgba(6, 12, 24, 0.85);
    color-scheme: dark;
  }
}

@media (min-width: 1000px) {
  :root { --panel-w: clamp(460px, 46vw, 700px); }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; -webkit-user-select: none; user-select: none; }
button:disabled { cursor: default; opacity: 0.5; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
svg { display: block; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- guscio ---------- */
.app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.views { position: relative; flex: 1; min-height: 0; }
.view { position: absolute; inset: 0; }

.tabbar {
  position: relative; z-index: 40; flex: none;
  display: flex; justify-content: center; gap: 4px;
  padding-top: 6px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: var(--tabbar-bg);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  backdrop-filter: blur(20px) saturate(1.5);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 0 1 168px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 5px 12px 3px; border-radius: 12px;
  color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: 0.03em;
  transition: color 0.2s;
}
.tab svg { width: 26px; height: 26px; }
.tab[aria-selected="true"] { color: var(--accent); }
.tab .tab-ic { transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
.tab[aria-selected="true"] .tab-ic { transform: translateY(-1px) scale(1.06); }

/* ---------- tab Città ---------- */
.cities-pane {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-top: calc(env(safe-area-inset-top, 0px) + 14px);
  padding-bottom: 28px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  transition: right 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.app.has-panel .cities-pane { right: var(--panel-w); }
.cities-inner { max-width: 620px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; transition: transform 0.25s; }

.pane-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 12px; padding-top: 6px; }
.eyebrow {
  grid-column: 1 / -1;
  font: 500 11px/1.2 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.pane-title { font: 600 38px/1.02 var(--font-display); letter-spacing: 0.005em; }
.head-actions { display: flex; gap: 8px; align-items: center; padding-bottom: 4px; }
.pill-btn {
  height: 34px; padding: 0 14px; border-radius: 17px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--accent);
  display: inline-flex; align-items: center; gap: 6px;
}
.pill-btn.primary { background: var(--accent); color: var(--accent-fg); border-color: transparent; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 17px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); color: var(--accent);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.spinning svg { animation: spin 0.9s linear infinite; }
.updated { grid-column: 1 / -1; font-size: 13px; color: var(--muted); min-height: 1.45em; }
.updated.warn { color: var(--danger); }

.ptr {
  height: 0; overflow: visible; display: flex; justify-content: center;
  pointer-events: none;
}
.ptr-ring {
  width: 30px; height: 30px; margin-top: -42px; border-radius: 50%;
  border: 2.5px solid var(--line); border-top-color: var(--accent);
  opacity: 0; transition: opacity 0.15s;
}
.ptr.active .ptr-ring { opacity: 1; }
.ptr.loading .ptr-ring { opacity: 1; animation: spin 0.8s linear infinite; }

.city-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.city {
  position: relative; border-radius: 22px; color: #fff; overflow: hidden;
  box-shadow: var(--shadow);
  animation: rise 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  transition: transform 0.2s, box-shadow 0.2s;
}
.city.dragging { z-index: 5; transform: scale(1.02); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3); transition: none; }
.city.selected { outline: 3px solid var(--accent); outline-offset: 2px; }
.city-open {
  display: grid; width: 100%; text-align: left;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "name now" "cond range" "spark spark";
  gap: 2px 12px; padding: 16px 18px 12px; min-height: 148px;
  position: relative;
}
.city-open:active { transform: scale(0.99); }
.city-name-block { grid-area: name; min-width: 0; }
.city-name { font: 600 27px/1.05 var(--font-display); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-sub { font-size: 13px; opacity: 0.88; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.city-sub .clock { font-family: var(--font-mono); font-size: 12px; }
.city-now { grid-area: now; display: flex; align-items: center; gap: 4px; margin-top: -4px; }
.city-now .wx { width: 46px; height: 46px; }
.city-temp { font: 300 54px/0.95 var(--font-display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.city-cond { grid-area: cond; font-size: 15px; font-weight: 600; align-self: end; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-range { grid-area: range; font-size: 14px; align-self: end; text-align: right; font-variant-numeric: tabular-nums; opacity: 0.95; }
.city-spark { grid-area: spark; height: 52px; width: 100%; margin-top: 6px; }
.city-spark text { font: 500 10px var(--font-mono); fill: rgba(255, 255, 255, 0.82); }
.city-msg { grid-area: cond / cond / range / range; font-size: 14px; opacity: 0.92; align-self: center; }
.city-loading .city-temp { opacity: 0.5; }
.city .stale-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #ffd27a; margin-left: 6px; vertical-align: middle; }

.row-edit { display: none; }
.editing .city-open { pointer-events: none; padding-left: 58px; padding-right: 58px; }
.editing .row-edit { display: block; }
.del-btn, .drag-handle {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 44px; height: 44px; display: grid; place-items: center; color: #fff;
}
.del-btn { left: 8px; }
.del-btn span { width: 26px; height: 26px; border-radius: 50%; background: #e5484d; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(0,0,0,.25); }
.del-btn span::before { content: ""; width: 12px; height: 2.5px; border-radius: 2px; background: #fff; }
.drag-handle { right: 8px; cursor: grab; touch-action: none; }
.drag-handle svg { width: 22px; height: 22px; }
.confirm-del {
  position: absolute; right: 60px; top: 50%; transform: translateY(-50%); z-index: 3;
  height: 36px; padding: 0 14px; border-radius: 18px; background: #e5484d; color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
}

.empty {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 22px; border-radius: 22px; background: var(--surface); border: 1px dashed var(--line);
}
.empty h2 { font: 600 24px/1.1 var(--font-display); }
.empty p { color: var(--muted); max-width: 46ch; }

.edit-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.credit { font: 400 11.5px/1.5 var(--font-mono); color: var(--muted); letter-spacing: 0.02em; max-width: 62ch; }
.credit a { color: inherit; }

/* ---------- cieli ---------- */
.sky {
  background-image: linear-gradient(var(--sky-dim), var(--sky-dim)), linear-gradient(165deg, var(--s1), var(--s2));
  text-shadow: 0 1px 2px rgba(0, 10, 30, 0.22);
  /* icone sopra il cielo */
  --ic-cloud: #f7f9fc;
  --ic-cloud-back: #cfd9e6;
  --ic-cloud-edge: rgba(0, 0, 0, 0);
  --ic-cloud-dark: #aab5c4;
  --ic-moon-on-page: #eef2fb;
  --ic-rain: #9fd0ff;
  --ic-snow: #ffffff;
  --ic-fog: #e5ebf2;
}
.sky-clear-d    { --s1: #1f68c0; --s2: #5ea4e8; }
.sky-thin-d     { --s1: #2e6bb0; --s2: #79a6d4; }
.sky-few-d      { --s1: #2f69aa; --s2: #7aa2cb; }
.sky-cloudy-d   { --s1: #46648a; --s2: #8299b2; }
.sky-overcast-d { --s1: #4f6074; --s2: #7f8fa1; }
.sky-rain-d     { --s1: #394a60; --s2: #66798f; }
.sky-storm-d    { --s1: #262a40; --s2: #4c5472; }
.sky-snow-d     { --s1: #4f6987; --s2: #7f96b0; }
.sky-fog-d      { --s1: #5f6b79; --s2: #8d98a5; }
.sky-dust-d     { --s1: #7b6043; --s2: #a88a5f; }
.sky-clear-n    { --s1: #08122b; --s2: #22386b; }
.sky-thin-n     { --s1: #0d1832; --s2: #2c3f6a; }
.sky-few-n      { --s1: #111c35; --s2: #33445f; }
.sky-cloudy-n   { --s1: #141d31; --s2: #3a475d; }
.sky-overcast-n { --s1: #151b27; --s2: #39424f; }
.sky-rain-n     { --s1: #121a27; --s2: #2f3b4d; }
.sky-storm-n    { --s1: #0e0f1b; --s2: #2c2f46; }
.sky-snow-n     { --s1: #1a2539; --s2: #44546d; }
.sky-fog-n      { --s1: #1c232d; --s2: #424c58; }
.sky-dust-n     { --s1: #2a2118; --s2: #5a4a35; }

/* ---------- pannello previsioni ---------- */
.detail {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: 100%;
  background: var(--bg); display: flex; flex-direction: column;
  transform: translateX(102%); visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.4s;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.18);
}
.detail.open { transform: none; visibility: visible; transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s; }
@media (min-width: 1000px) {
  .detail { width: var(--panel-w); bottom: var(--tabbar-h); z-index: 30; border-left: 1px solid var(--line); box-shadow: none; }
}
.detail-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; }

.hero {
  position: relative; overflow: hidden; color: #fff;
  padding-top: calc(env(safe-area-inset-top, 0px) + 6px);
  padding-bottom: 22px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-bar { position: relative; display: flex; justify-content: space-between; align-items: center; min-height: 48px; gap: 8px; }
.hero-btn {
  height: 36px; padding: 0 14px 0 10px; border-radius: 18px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255, 255, 255, 0.16); border: 1px solid rgba(255, 255, 255, 0.22);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  font-weight: 600; font-size: 15px; color: #fff; text-shadow: none;
}
.hero-btn svg { width: 18px; height: 18px; }
.hero-btn.solid { background: #fff; color: #10233d; border-color: #fff; padding: 0 14px; }
.hero-btn.added { background: rgba(255, 255, 255, 0.16); color: #fff; }
.hero-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; align-items: start; margin-top: 6px; }
.hero-coords { font: 500 11px/1.4 var(--font-mono); letter-spacing: 0.06em; opacity: 0.85; }
.hero-name { font: 600 40px/1.02 var(--font-display); margin-top: 4px; overflow-wrap: anywhere; }
.hero-sub { font-size: 14px; opacity: 0.9; margin-top: 2px; }
.hero-temp { font: 200 118px/0.9 var(--font-display); letter-spacing: -0.02em; margin-top: 14px; font-variant-numeric: tabular-nums; }
/* simbolo del grado per i numeri grandi */
.dg { font-family: var(--font-body); font-weight: 300; font-size: 0.4em; vertical-align: top; position: relative; top: 0.1em; margin-left: 0.04em; letter-spacing: 0; }
.hero-cond { font: 600 20px/1.2 var(--font-body); margin-top: 6px; }
.hero-range { font-size: 15px; margin-top: 4px; font-variant-numeric: tabular-nums; opacity: 0.95; }
.hero-valid { font: 400 11.5px/1.4 var(--font-mono); margin-top: 12px; opacity: 0.85; letter-spacing: 0.02em; }
.hero-icon { width: 128px; height: 128px; margin-top: 18px; margin-right: -6px; }
.hero-icon .wx { width: 100%; height: 100%; }

.detail-body {
  display: flex; flex-direction: column; gap: 22px;
  padding-top: 18px; padding-bottom: 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.sec-title {
  font: 500 11px/1.2 var(--font-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 10px; display: flex; justify-content: space-between; gap: 8px;
}
.sec-title .aside { letter-spacing: 0.04em; text-transform: none; }

.instruments { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .instruments { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.gauge {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.gauge-label { font: 500 10.5px/1.3 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.gauge-value { font: 500 30px/1.1 var(--font-display); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 6px; }
.gauge-value small { font: 500 15px var(--font-display); color: var(--muted); }
.gauge-sub { font-size: 12.5px; color: var(--muted); }
.wind-arrow { width: 26px; height: 26px; color: var(--wind); transition: transform 0.6s cubic-bezier(0.3, 1.4, 0.5, 1); }

.obs {
  display: flex; gap: 12px; align-items: center;
  background: var(--accent-soft); border-radius: 16px; padding: 12px 14px; font-size: 13.5px;
}
.obs b { font-weight: 600; }
.obs .obs-tag { font: 500 10.5px var(--font-mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); flex: none; }

.days { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; scroll-padding: 16px; }
.days::-webkit-scrollbar { display: none; }
.day {
  flex: none; min-width: 84px; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 10px 8px 9px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.day:active { transform: scale(0.97); }
.day-name { font-size: 13px; font-weight: 600; }
.day .wx { width: 36px; height: 36px; }
.day-temps { font: 500 15px var(--font-display); font-variant-numeric: tabular-nums; }
.day-temps .lo { color: var(--muted); margin-left: 4px; }
.day-pp { font: 400 10.5px var(--font-mono); color: var(--rain); min-height: 1.3em; }
.day[aria-selected="true"] { background: var(--accent); color: var(--accent-fg); border-color: transparent; --ic-cloud-edge: rgba(0,0,0,0); }
.day[aria-selected="true"] .lo, .day[aria-selected="true"] .day-pp { color: inherit; opacity: 0.8; }

.fasce { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .fasce { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.fascia {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 6px; align-items: center;
  text-align: left; transition: border-color 0.2s, background 0.2s;
}
.fascia.now { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.fascia.past { opacity: 0.55; }
.fascia-name { font-weight: 600; font-size: 14px; }
.fascia-hours { font: 400 11px var(--font-mono); color: var(--muted); grid-column: 1; }
.fascia .wx { width: 44px; height: 44px; grid-row: 1 / span 2; grid-column: 2; }
.fascia-temp { grid-column: 1 / -1; font: 500 24px/1.1 var(--font-display); margin-top: 6px; font-variant-numeric: tabular-nums; }
.fascia-cond { grid-column: 1 / -1; font-size: 13px; color: var(--muted); min-height: 2.6em; }
.fascia-meta { grid-column: 1 / -1; display: flex; gap: 10px; font: 400 11px var(--font-mono); color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.fascia-meta .pp { color: var(--rain); }

.hourly { display: flex; overflow-x: auto; gap: 2px; margin: 0 -16px; padding: 0 16px 6px; scroll-padding: 16px; scrollbar-width: thin; }
.hour {
  flex: none; width: 58px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 10px 2px 8px; border-radius: 16px; transition: background 0.2s;
}
.hour.sel { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.hour.now .hour-t { color: var(--accent); font-weight: 600; }
.hour.past { opacity: 0.5; }
.hour-t { font: 400 12px var(--font-mono); color: var(--muted); }
.hour .wx { width: 34px; height: 34px; }
.hour-temp { font: 500 19px var(--font-display); font-variant-numeric: tabular-nums; }
.hour-pp { font: 400 10.5px var(--font-mono); color: var(--rain); min-height: 1.3em; }
.hour-w { font: 400 10.5px var(--font-mono); color: var(--muted); display: flex; align-items: center; gap: 2px; }
.hour-w svg { width: 11px; height: 11px; color: var(--wind); }

.charts { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.chart-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 12px 12px 6px; min-width: 0; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 0 4px 4px; }
.chart-title { font-weight: 600; font-size: 14px; }
.chart-title small { font: 400 11px var(--font-mono); color: var(--muted); margin-left: 6px; }
.chart-read { font: 500 20px var(--font-display); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.chart-read small { font: 400 11px var(--font-mono); color: var(--muted); margin-right: 6px; }
.chart { width: 100%; height: 150px; touch-action: pan-y; cursor: crosshair; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { font: 400 10px var(--font-mono); fill: var(--muted); }
.chart .cursor { stroke: var(--fg); stroke-opacity: 0.35; stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .val-label { font: 500 11px var(--font-mono); fill: var(--fg); }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 0.9s cubic-bezier(0.3, 0.7, 0.2, 1) forwards; }
.chart .grow { transform-box: fill-box; transform-origin: bottom; animation: grow 0.6s cubic-bezier(0.3, 0.7, 0.2, 1) both; }

.detail-foot { font: 400 11.5px/1.6 var(--font-mono); color: var(--muted); display: flex; flex-direction: column; gap: 4px; letter-spacing: 0.01em; }
.detail-foot a { color: var(--accent); }
.detail-err { padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 18px; }

/* ---------- mappamondo ---------- */
.view-globe { background: radial-gradient(120% 90% at 50% 40%, var(--globe-bg-1), var(--globe-bg-2)); overflow: hidden; }
#globe { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#globe.grabbing { cursor: grabbing; }
.globe-top {
  position: absolute; z-index: 5; left: 0; right: 0;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  pointer-events: none;
}
.globe-top-inner { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; pointer-events: auto; }
.search {
  display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 8px 0 14px;
  border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow);
}
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; outline: none; }
.search input::placeholder { color: var(--muted); }
.search .clear { width: 32px; height: 32px; border-radius: 16px; display: grid; place-items: center; color: var(--muted); }
.results {
  list-style: none; margin: 0; padding: 6px; border-radius: 16px;
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: var(--shadow); max-height: min(52vh, 420px); overflow-y: auto;
}
.results button { width: 100%; text-align: left; padding: 10px 10px; border-radius: 10px; display: flex; flex-direction: column; gap: 1px; }
.results button:hover, .results button.kb { background: var(--accent-soft); }
.results .r-name { font-weight: 600; }
.results .r-sub { font-size: 13px; color: var(--muted); }
.results .r-note { padding: 10px; font-size: 13px; color: var(--muted); }
.globe-hint {
  align-self: center; font: 500 10.5px/1.3 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); padding: 6px 12px; border-radius: 12px; background: var(--glass);
  transition: opacity 0.6s;
}
.globe-hint.gone { opacity: 0; }
.globe-controls {
  position: absolute; z-index: 5;
  right: max(16px, env(safe-area-inset-right, 0px)); bottom: 20px;
  display: flex; flex-direction: column; gap: 8px; transition: bottom 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.gbtn {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--fg);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); box-shadow: var(--shadow);
}
.gbtn svg { width: 20px; height: 20px; }
.globe-legend {
  position: absolute; z-index: 4; left: max(16px, env(safe-area-inset-left, 0px)); bottom: 20px;
  font: 400 10.5px/1.5 var(--font-mono); color: var(--muted); letter-spacing: 0.04em;
  padding: 4px 10px; border-radius: 10px; background: var(--glass);
  transition: opacity 0.3s;
}

.sheet {
  position: absolute; z-index: 10;
  left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); bottom: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  transform: translateY(calc(100% + 30px)); transition: transform 0.42s cubic-bezier(0.2, 0.9, 0.25, 1);
  max-height: calc(100% - 90px); overflow-y: auto;
}
.sheet.open { transform: none; }
@media (min-width: 700px) { .sheet { right: auto; width: 400px; left: max(20px, env(safe-area-inset-left, 0px)); bottom: 20px; } }
.sheet-in { padding: 16px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.sheet-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.sheet-name { font: 600 28px/1.05 var(--font-display); overflow-wrap: anywhere; }
.sheet-sub { font-size: 13px; color: var(--muted); }
.sheet-coords { font: 400 11px var(--font-mono); color: var(--muted); margin-top: 2px; letter-spacing: 0.04em; }
.sheet-close { width: 32px; height: 32px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.sheet-close svg { width: 14px; height: 14px; }
.sheet-now { display: flex; align-items: center; gap: 12px; border-radius: 18px; padding: 10px 14px; color: #fff; }
.sheet-now .wx { width: 56px; height: 56px; flex: none; }
.sheet-temp { font: 300 48px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.sheet-cond { font-weight: 600; }
.sheet-range { font-size: 13px; opacity: 0.92; }
.sheet-days { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
.sd { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 12px; }
.sd .wx { width: 30px; height: 30px; }
.sd b { font: 500 14px var(--font-display); }
.sd span { color: var(--muted); }
.sheet-actions { display: flex; gap: 8px; }
.sheet-actions .pill-btn { flex: 1; justify-content: center; height: 44px; border-radius: 14px; font-size: 15px; }
.sheet-msg { color: var(--muted); font-size: 14px; }

/* ---------- toast & finestre ---------- */
.toast {
  position: fixed; z-index: 90; left: 50%; bottom: calc(var(--tabbar-h) + 14px);
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 14px; font-size: 14px; font-weight: 600;
  transition: opacity 0.25s, transform 0.25s; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.modal { position: fixed; z-index: 95; inset: 0; display: grid; place-items: center; padding: 16px; background: rgba(5, 10, 20, 0.45); animation: fade 0.2s both; }
.modal-card { width: min(440px, 100%); background: var(--surface); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.modal-card h2 { font: 600 26px/1.1 var(--font-display); }
.modal-card p { color: var(--muted); font-size: 14px; }
.modal-card .linkbox { font: 400 12px/1.4 var(--font-mono); background: var(--surface-2); border-radius: 12px; padding: 10px; word-break: break-all; user-select: all; -webkit-user-select: all; max-height: 7.5em; overflow: auto; }
.modal-card ul { margin: 0; padding-left: 18px; font-size: 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- icone meteo animate ---------- */
.wx { display: block; overflow: visible; }
.wx .sunrays { transform-box: fill-box; transform-origin: center; animation: spin 26s linear infinite; }
.wx .sundisc { transform-box: fill-box; transform-origin: center; animation: breathe 4s ease-in-out infinite alternate; }
.wx .cl { animation: drift 5.5s ease-in-out infinite alternate; }
.wx .cl.back { animation-duration: 7s; animation-direction: alternate-reverse; }
.wx .drop { animation: fall 1.15s linear infinite; }
.wx .flake { animation: flake 2.6s linear infinite; }
.wx .hail { animation: hail 0.9s cubic-bezier(0.5, 0, 1, 0.5) infinite; }
.wx .bolt { animation: flash 3.2s linear infinite; }
.wx .fogline { animation: slide 4s ease-in-out infinite alternate; }
.wx .fogline:nth-child(2n) { animation-direction: alternate-reverse; animation-duration: 5s; }
.wx .star { animation: twinkle 2.4s ease-in-out infinite; }
.wx .funnel { transform-box: fill-box; transform-origin: top; animation: sway 1.6s ease-in-out infinite alternate; }
.wx .puff { animation: rise-puff 3s ease-in-out infinite; }
.wx.still *, .still .wx * { animation: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { from { transform: scale(0.96); } to { transform: scale(1.04); } }
@keyframes drift { from { transform: translateX(-1.6px); } to { transform: translateX(1.6px); } }
@keyframes fall { 0% { transform: translateY(-5px); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(9px); opacity: 0; } }
@keyframes flake { 0% { transform: translate(0, -5px); opacity: 0; } 20% { opacity: 1; } 50% { transform: translate(1.8px, 2px); } 100% { transform: translate(-1px, 9px); opacity: 0; } }
@keyframes hail { 0% { transform: translateY(-5px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(10px); opacity: 0; } }
@keyframes flash { 0%, 70%, 100% { opacity: 0.25; } 72%, 78% { opacity: 1; } 75% { opacity: 0.4; } }
@keyframes slide { from { transform: translateX(-3px); } to { transform: translateX(3px); } }
@keyframes twinkle { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
@keyframes sway { from { transform: skewX(-6deg); } to { transform: skewX(6deg); } }
@keyframes rise-puff { 0% { transform: translateY(3px); opacity: 0; } 30% { opacity: 1; } 100% { transform: translateY(-6px); opacity: 0; } }
@keyframes rise { from { transform: translateY(14px); opacity: 0.001; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes fade { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
  .wx * { animation: none !important; }
}
