/* =====================================================================
   Atmos — Cyber Weather PWA
   Stylesheet unico: reset, layout responsive, glassmorphism, temi
   dinamici, animazioni leggere, accessibilita'.
   ===================================================================== */

:root {
  --bg-main: #070A12;
  --bg-panel: rgba(255, 255, 255, 0.08);
  --bg-panel-strong: rgba(255, 255, 255, 0.14);
  --border-panel: rgba(255, 255, 255, 0.12);
  --text-main: #F4F7FB;
  --text-muted: #9AA7BD;
  --accent-cyan: #00E5FF;
  --accent-violet: #8A2BFF;
  --accent-green: #39FF88;
  --accent-yellow: #FFD84D;
  --rain-blue: #3DA9FC;
  --danger-red: #FF4D6D;

  --theme-a: var(--accent-cyan);
  --theme-b: var(--accent-violet);
  --theme-glow: rgba(0, 229, 255, 0.25);
  --theme-bg-1: #0a0f1c;
  --theme-bg-2: #070A12;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --gap: 1rem;
  --header-h: 64px;
  --bottom-bar-h: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);

  --ease: cubic-bezier(.22, .9, .32, 1);
  --dur-fast: 160ms;
  --dur-med: 320ms;
}

/* ---------------------------------------------------------------------
   Reset
   --------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, "Inter", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, p { margin: 0; }
a { color: inherit; }
[hidden] { display: none !important; }

::selection { background: var(--accent-cyan); color: #041016; }

/* Scrollbar sottile e coerente col tema */
* { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.25) transparent; }
*::-webkit-scrollbar { height: 6px; width: 6px; }
*::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.25); border-radius: 6px; }

/* ---------------------------------------------------------------------
   Accessibilita'
   --------------------------------------------------------------------- */
.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: absolute; top: -100px; left: 1rem; z-index: 999;
  background: var(--accent-cyan); color: #041016; padding: .6rem 1rem;
  border-radius: var(--radius-sm); font-weight: 600; transition: top var(--dur-fast) var(--ease);
}
.skip-link:focus { top: 1rem; }

:focus-visible {
  outline: 2px solid var(--accent-cyan);
  outline-offset: 2px;
  border-radius: 6px;
}

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

/* ---------------------------------------------------------------------
   Shell + sfondo dinamico
   --------------------------------------------------------------------- */
.app-shell {
  position: relative;
  min-height: 100%;
  isolation: isolate;
  padding-bottom: calc(var(--bottom-bar-h) + var(--safe-bottom));
  transition: background var(--dur-med) var(--ease);
}

.bg-fx {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-fx-layer { position: absolute; inset: -10%; }

.bg-fx-glow {
  background:
    radial-gradient(60% 45% at 18% 8%, var(--theme-glow), transparent 60%),
    radial-gradient(50% 40% at 85% 85%, rgba(138,43,255,0.16), transparent 65%),
    linear-gradient(180deg, var(--theme-bg-1), var(--theme-bg-2));
  transition: background var(--dur-med) var(--ease);
}

.bg-fx-particles { opacity: 0.55; }

/* Sole */
[data-theme="sun"] { --theme-a: var(--accent-yellow); --theme-b: var(--accent-cyan); --theme-glow: rgba(255,216,77,0.28); --theme-bg-1: #14150f; --theme-bg-2: #070A12; }
/* Pioggia */
[data-theme="rain"] { --theme-a: var(--rain-blue); --theme-b: var(--accent-violet); --theme-glow: rgba(61,169,252,0.22); --theme-bg-1: #0a1420; --theme-bg-2: #060910; }
/* Temporale */
[data-theme="storm"] { --theme-a: var(--accent-violet); --theme-b: var(--accent-green); --theme-glow: rgba(138,43,255,0.30); --theme-bg-1: #10081c; --theme-bg-2: #050308; }
/* Neve */
[data-theme="snow"] { --theme-a: #EAF6FF; --theme-b: var(--accent-cyan); --theme-glow: rgba(234,246,255,0.20); --theme-bg-1: #0d151c; --theme-bg-2: #070b10; }
/* Notte */
[data-theme="night"] { --theme-a: var(--accent-cyan); --theme-b: var(--accent-violet); --theme-glow: rgba(0,229,255,0.14); --theme-bg-1: #05070f; --theme-bg-2: #03040a; }
/* Nebbia */
[data-theme="fog"] { --theme-a: #B9C6D6; --theme-b: var(--rain-blue); --theme-glow: rgba(185,198,214,0.16); --theme-bg-1: #0c0f14; --theme-bg-2: #070A12; }

/* Pioggia: linee animate */
[data-theme="rain"] .bg-fx-particles,
[data-theme="storm"] .bg-fx-particles {
  background-image: repeating-linear-gradient(112deg, rgba(61,169,252,0.30) 0 2px, transparent 2px 46px);
  background-size: 220% 220%;
  animation: rainFall 0.7s linear infinite;
}
@keyframes rainFall { from { background-position: 0 0; } to { background-position: -60px 170px; } }

/* Temporale: flash leggero */
[data-theme="storm"]::after {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: rgba(190, 255, 220, 0.9);
  opacity: 0;
  pointer-events: none;
  animation: stormFlash 7s ease-in-out infinite;
}
@keyframes stormFlash {
  0%, 96%, 100% { opacity: 0; }
  96.4% { opacity: 0.05; }
  96.7% { opacity: 0; }
  97% { opacity: 0.08; }
  97.3% { opacity: 0; }
}

/* Neve: particelle */
[data-theme="snow"] .bg-fx-particles {
  background-image:
    radial-gradient(2.5px 2.5px at 10% 20%, #fff, transparent),
    radial-gradient(2px 2px at 70% 60%, #fff, transparent),
    radial-gradient(1.8px 1.8px at 40% 80%, #fff, transparent),
    radial-gradient(2.2px 2.2px at 85% 15%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 25% 50%, #fff, transparent);
  background-size: 220px 220px;
  animation: snowFall 9s linear infinite;
  opacity: 0.5;
}
@keyframes snowFall { from { background-position: 0 -40px; } to { background-position: 40px 260px; } }

/* Notte: stelle */
[data-theme="night"] .bg-fx-particles {
  background-image:
    radial-gradient(1.4px 1.4px at 15% 25%, #fff, transparent),
    radial-gradient(1.2px 1.2px at 60% 15%, #fff, transparent),
    radial-gradient(1.6px 1.6px at 80% 45%, #fff, transparent),
    radial-gradient(1.1px 1.1px at 35% 70%, #fff, transparent),
    radial-gradient(1.3px 1.3px at 90% 80%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 10% 90%, #fff, transparent);
  background-size: 260px 260px;
  animation: starTwinkle 4s ease-in-out infinite alternate;
  opacity: 0.5;
}
@keyframes starTwinkle { from { opacity: 0.25; } to { opacity: 0.65; } }

/* Nebbia: bande morbide in movimento */
[data-theme="fog"] .bg-fx-particles {
  background-image: linear-gradient(100deg, transparent, rgba(185,198,214,0.18), transparent);
  background-size: 60% 100%;
  filter: blur(6px);
  animation: fogDrift 16s linear infinite;
}
@keyframes fogDrift { from { background-position: -20% 0; } to { background-position: 120% 0; } }

@media (prefers-reduced-motion: reduce) {
  [data-theme="storm"]::after { animation: none; opacity: 0.02; }
  [data-theme="night"] .bg-fx-particles { animation: none; opacity: 0.45; }
  .bg-fx-particles { animation: none !important; }
}

/* ---------------------------------------------------------------------
   Glass panel (componente base)
   --------------------------------------------------------------------- */
.glass-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  padding: 1.25rem;
}

.panel-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.9rem;
}

/* ---------------------------------------------------------------------
   Header
   --------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: var(--safe-top);
  background: rgba(7, 10, 18, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-panel);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  max-width: 1600px;
  margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.brand-logo { border-radius: 8px; }
.brand-name {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.search-form { position: relative; flex: 1 1 auto; min-width: 0; max-width: 420px; }
.search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; fill: none; stroke: var(--text-muted); stroke-width: 2;
  pointer-events: none;
}
#citySearchInput {
  width: 100%;
  height: 44px;
  padding: 0 0.9rem 0 2.5rem;
  border-radius: 999px;
  border: 1px solid var(--border-panel);
  background: var(--bg-panel);
  color: var(--text-main);
}
#citySearchInput::placeholder { color: var(--text-muted); }
#citySearchInput:focus { background: var(--bg-panel-strong); }

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0; right: 0;
  background: #0c1220;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  max-height: 320px;
  overflow-y: auto;
  z-index: 60;
}
.suggestion-item {
  display: flex; justify-content: space-between; gap: 0.75rem;
  padding: 0.75rem 1rem;
  min-height: 44px;
  align-items: center;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover, .suggestion-item:focus-visible, .suggestion-item[aria-selected="true"] {
  background: rgba(0,229,255,0.10);
}
.suggestion-name { font-weight: 600; }
.suggestion-country { color: var(--text-muted); font-size: 0.85rem; }

.header-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }

.icon-btn {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border-panel);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--text-main); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:hover { background: var(--bg-panel-strong); }
.icon-btn:active { transform: scale(0.94); }
.icon-btn[aria-pressed="true"], .icon-btn.active {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 1px var(--accent-cyan), 0 0 16px rgba(0,229,255,0.35);
}
.fav-btn[aria-pressed="true"] svg { fill: var(--danger-red); stroke: var(--danger-red); }

.pill-btn {
  height: 44px;
  padding: 0 1rem;
  border-radius: 999px;
  background: var(--bg-panel);
  border: 1px solid var(--border-panel);
  font-weight: 600;
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.pill-btn:hover { background: var(--bg-panel-strong); }
.pill-btn:active { transform: scale(0.96); }
.pill-btn.accent {
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-violet));
  color: #04101a;
  border: none;
}

.theme-picker-wrap { position: relative; }
.theme-picker {
  position: absolute; top: calc(100% + 8px); right: 0;
  background: #0c1220;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 0.4rem;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 150px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  z-index: 60;
}
.theme-option {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius-sm);
  min-height: 40px;
}
.theme-option:hover, .theme-option:focus-visible { background: rgba(0,229,255,0.10); }
.theme-option[aria-current="true"] { color: var(--accent-cyan); font-weight: 700; }

.status-bar { padding: 0.4rem 1rem 0.6rem; max-width: 1600px; margin: 0 auto; }
.badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  border: 1px solid currentColor;
}
.badge::before { content: "●"; font-size: 0.6rem; }
.badge-warning { color: var(--accent-yellow); background: rgba(255,216,77,0.10); }
.badge-info { color: var(--accent-cyan); background: rgba(0,229,255,0.10); }
.badge-danger { color: var(--danger-red); background: rgba(255,77,109,0.10); }

/* ---------------------------------------------------------------------
   Dashboard layout
   --------------------------------------------------------------------- */
.dashboard {
  display: grid;
  gap: var(--gap);
  padding: 1rem;
  max-width: 1600px;
  margin: 0 auto;
  grid-template-columns: 1fr;
  grid-template-areas:
    "primary"
    "center"
    "side";
}
.col-primary { grid-area: primary; }
.col-center  { grid-area: center; display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.col-side    { grid-area: side; display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

@media (min-width: 640px) and (max-width: 1023.98px) {
  .dashboard {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "primary primary"
      "center side";
  }
}

@media (min-width: 1024px) {
  .dashboard {
    grid-template-columns: 360px minmax(0, 1fr) 320px;
    grid-template-areas: "primary center side";
    align-items: start;
    padding: 1.5rem;
  }
}

@media (min-width: 1440px) {
  .dashboard {
    grid-template-columns: 400px minmax(0, 1fr) 360px;
    gap: 1.5rem;
    padding: 2rem;
  }
}

/* ---------------------------------------------------------------------
   Colonna primaria (hero)
   --------------------------------------------------------------------- */
.primary-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.city-name { font-size: 1.5rem; font-weight: 700; }
.date-line { color: var(--text-muted); font-size: 0.9rem; margin-top: 0.15rem; text-transform: capitalize; }

.hero-weather {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0 0.25rem;
}
.hero-icon { width: 96px; height: 96px; flex-shrink: 0; }
.hero-icon svg { width: 100%; height: 100%; filter: drop-shadow(0 0 14px var(--theme-glow)); }
.hero-temp {
  font-size: clamp(3.2rem, 10vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  text-shadow: 0 0 26px var(--theme-glow);
}
.hero-temp .deg { font-size: 0.5em; font-weight: 400; vertical-align: top; }

.hero-condition { text-align: center; font-size: 1.15rem; font-weight: 600; margin-top: 0.25rem; }
.hero-feels { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-top: 0.15rem; }

.smart-message {
  margin-top: 1.1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
  border-left: 3px solid var(--theme-a);
  font-size: 0.92rem;
  line-height: 1.5;
}

.atmos-index {
  margin-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
}
.atmos-index-label { color: var(--text-muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.04em; }
.atmos-index-value { font-weight: 700; font-size: 1rem; padding: 0.25rem 0.75rem; border-radius: 999px; }
.atmos-index[data-level="Ottima"]   .atmos-index-value { color: var(--accent-green); background: rgba(57,255,136,0.12); }
.atmos-index[data-level="Buona"]    .atmos-index-value { color: var(--accent-cyan); background: rgba(0,229,255,0.12); }
.atmos-index[data-level="Variabile"] .atmos-index-value { color: var(--accent-yellow); background: rgba(255,216,77,0.12); }
.atmos-index[data-level="Scomoda"]  .atmos-index-value { color: #ffb15e; background: rgba(255,177,94,0.12); }
.atmos-index[data-level="Critica"]  .atmos-index-value { color: var(--danger-red); background: rgba(255,77,109,0.14); }

.badges { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.badge-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.45rem 0.8rem;
  min-height: 36px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border-panel);
  font-size: 0.82rem;
  font-weight: 600;
}
.badge-chip svg { width: 16px; height: 16px; stroke: var(--theme-a); fill: none; stroke-width: 2; }

/* ---------------------------------------------------------------------
   Colonna centrale
   --------------------------------------------------------------------- */
.hourly-scroll {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 0.4rem;
  -webkit-overflow-scrolling: touch;
}
.hourly-item {
  scroll-snap-align: start;
  flex: 0 0 auto;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 0.4rem;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-panel);
}
.hourly-time { font-size: 0.78rem; color: var(--text-muted); }
.hourly-icon { width: 30px; height: 30px; }
.hourly-icon svg { width: 100%; height: 100%; }
.hourly-temp { font-weight: 700; }
.hourly-rain { font-size: 0.75rem; color: var(--rain-blue); }

.chart-panel { min-width: 0; }
.temp-chart { width: 100%; height: 200px; display: block; }

.daily-list { display: flex; flex-direction: column; gap: 0.5rem; }
.daily-item {
  display: grid;
  grid-template-columns: 3.2rem 2rem 1fr auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.5rem;
  border-radius: var(--radius-sm);
  min-height: 48px;
}
.daily-item:hover { background: rgba(255,255,255,0.04); }
.daily-day { font-weight: 600; text-transform: capitalize; }
.daily-icon svg { width: 24px; height: 24px; }
.daily-rain { color: var(--rain-blue); font-size: 0.82rem; justify-self: start; }
.daily-temps { display: flex; gap: 0.5rem; font-variant-numeric: tabular-nums; }
.daily-max { font-weight: 700; }
.daily-min { color: var(--text-muted); }

/* ---------------------------------------------------------------------
   Colonna laterale
   --------------------------------------------------------------------- */
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.detail-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  border: 1px solid var(--border-panel);
  min-height: 96px;
}
.detail-icon svg { width: 22px; height: 22px; stroke: var(--theme-a); fill: none; stroke-width: 1.8; }
.detail-label { color: var(--text-muted); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; }
.detail-value { font-size: 1.25rem; font-weight: 700; }
.detail-sub { font-size: 0.78rem; color: var(--text-muted); }

.favorites-list { display: flex; flex-direction: column; gap: 0.4rem; }
.favorites-empty { color: var(--text-muted); font-size: 0.88rem; padding: 0.5rem 0; }
.favorite-item {
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
}
.favorite-select {
  flex: 1;
  text-align: left;
  padding: 0.65rem 0.75rem;
  min-height: 44px;
  border-radius: var(--radius-sm);
}
.favorite-select:hover { background: rgba(255,255,255,0.05); }
.favorite-remove {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 999px;
  flex-shrink: 0;
}
.favorite-remove svg { width: 16px; height: 16px; stroke: var(--text-muted); stroke-width: 2; }
.favorite-remove:hover { background: rgba(255,77,109,0.12); }
.favorite-remove:hover svg { stroke: var(--danger-red); }

/* ---------------------------------------------------------------------
   Bottom bar mobile
   --------------------------------------------------------------------- */
.mobile-bottom-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: space-around;
  background: rgba(7,10,18,0.75);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-panel);
  padding: 0.4rem 0.5rem calc(0.4rem + var(--safe-bottom));
}
.bottom-bar-btn {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  min-width: 60px; min-height: 48px;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 600;
}
.bottom-bar-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bottom-bar-btn:hover, .bottom-bar-btn:active { color: var(--text-main); background: rgba(255,255,255,0.06); }

@media (min-width: 1024px) {
  .mobile-bottom-bar { display: none; }
  .app-shell { padding-bottom: 0; }
}

/* ---------------------------------------------------------------------
   Toast + iOS hint
   --------------------------------------------------------------------- */
.toast {
  position: fixed;
  left: 50%; bottom: calc(var(--bottom-bar-h) + var(--safe-bottom) + 1rem);
  transform: translateX(-50%);
  background: #10141f;
  border: 1px solid var(--border-panel);
  color: var(--text-main);
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  z-index: 80;
  max-width: min(90vw, 420px);
  font-size: 0.9rem;
  animation: toastIn var(--dur-med) var(--ease);
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

@media (min-width: 1024px) {
  .toast { bottom: 1.5rem; }
}

.ios-hint {
  position: fixed;
  left: 1rem; right: 1rem; bottom: calc(var(--bottom-bar-h) + var(--safe-bottom) + 1rem);
  z-index: 90;
  background: #10141f;
  border: 1px solid var(--border-panel);
  border-radius: var(--radius-md);
  padding: 1rem 1.1rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  display: flex; flex-direction: column; gap: 0.75rem;
}
.ios-hint p { font-size: 0.9rem; }

/* ---------------------------------------------------------------------
   Icone meteo neon (colori per tipo)
   --------------------------------------------------------------------- */
.w-icon { width: 100%; height: 100%; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.w-icon--sun   { stroke: var(--accent-yellow); filter: drop-shadow(0 0 8px rgba(255,216,77,0.55)); }
.w-icon--moon  { stroke: var(--accent-cyan); filter: drop-shadow(0 0 8px rgba(0,229,255,0.5)); }
.w-icon--cloud { stroke: #C9D4E5; filter: drop-shadow(0 0 6px rgba(201,212,229,0.35)); }
.w-icon--rain  { stroke: var(--rain-blue); filter: drop-shadow(0 0 8px rgba(61,169,252,0.5)); }
.w-icon--storm { stroke: var(--accent-violet); filter: drop-shadow(0 0 9px rgba(138,43,255,0.55)); }
.w-icon--snow  { stroke: #EAF6FF; filter: drop-shadow(0 0 8px rgba(234,246,255,0.5)); }
.w-icon--fog   { stroke: #B9C6D6; filter: drop-shadow(0 0 6px rgba(185,198,214,0.4)); }
.w-icon--wind  { stroke: var(--accent-cyan); filter: drop-shadow(0 0 6px rgba(0,229,255,0.4)); }

/* ---------------------------------------------------------------------
   Utility responsive minori
   --------------------------------------------------------------------- */
@media (max-width: 639.98px) {
  .header-inner { flex-wrap: wrap; }
  .search-form { order: 3; flex: 1 1 100%; max-width: none; }
  #unitToggle { order: 1; }
}

@media (min-width: 1024px) {
  .col-primary { position: sticky; top: calc(var(--header-h) + 1.5rem); }
}
