/* ============================================================
   Soldi Chiari — Design System
   Palette scelta per trasmettere calma e affidabilità:
   teal profondo (marca), blu notte (superfici scure) e un fondo
   caldo che toglie la freddezza tipica dello schermo.
   Contrasti verificati WCAG: testo 8.0:1, marca 6.3:1, titoli 14.9:1.
   ============================================================ */
:root {
  --bg: #f8f7f4;
  --surface: #ffffff;
  --ink: #12242b;
  --text: #3d4f56;
  --muted: #6e8189;
  --line: #e4e7e4;
  --brand: #1f6470;
  --brand-dark: #17505c;
  --brand-soft: #e3eef0;
  --navy: #12303a;
  --navy-2: #1b4653;
  --green: #2c8c4a;
  --green-soft: #e5f1e8;
  --amber: #c2691a;
  --amber-soft: #f9eee1;
  --red: #be3a34;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(18, 36, 43, 0.06);
  --shadow-md: 0 6px 24px -8px rgba(18, 36, 43, 0.14);
  --shadow-lg: 0 18px 48px -16px rgba(18, 48, 58, 0.28);
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; font-weight: 700; }
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.015em; }
h3 { font-size: 1.2rem; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg { max-width: 100%; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

.section { padding: 72px 0; }
.section--tight { padding: 48px 0; }
.section--alt { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.section-head { max-width: 640px; margin-bottom: 40px; }
.section-head p { margin-top: 10px; color: var(--muted); }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-soft);
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.28rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo .logo-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #2f8b99);
  border-radius: 10px;
  color: #fff;
  flex-shrink: 0;
}
.logo b { color: var(--brand); font-weight: 800; }

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
}
.main-nav a:hover { color: var(--brand); text-decoration: none; }
.main-nav a.active,
.main-nav .nav-gruppo.active > .nav-apri { color: var(--brand); font-weight: 600; }

/* ---------- Sottomenu ----------
   Quattro voci in cima, due delle quali aprono un gruppo. Il pannello
   si apre al passaggio del mouse e con la tastiera; sul telefono
   diventa una fisarmonica dentro il menu (vedi più sotto), perché lì
   il passaggio del mouse non esiste. */
.nav-voce {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--text); font: 500 0.95rem var(--font);
  background: transparent; border: 0; cursor: pointer;
  white-space: nowrap;
}
button.nav-voce:hover { color: var(--brand); }
.nav-gruppo { position: relative; }
.nav-freccia { font-size: 0.7rem; color: var(--muted); transition: transform 0.15s ease; }
.nav-gruppo.aperto .nav-freccia { transform: rotate(180deg); }

.nav-sub {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 316px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  z-index: 60;
}
.nav-gruppo:hover > .nav-sub,
.nav-gruppo.aperto > .nav-sub { display: block; }
/* ponte invisibile fra voce e pannello: senza, il menu si chiude
   nel millimetro di vuoto che il puntatore attraversa */
.nav-gruppo::after {
  content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 10px;
}
.nav-sub a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
}
.nav-sub a b { display: block; color: var(--ink); font-size: 0.94rem; font-weight: 600; }
.nav-sub a span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; line-height: 1.4; }
.nav-sub a:hover { background: var(--bg); text-decoration: none; }
.nav-sub a.active { background: var(--brand-soft); }
.nav-sub a.active b { color: var(--brand); }

/* Primo elemento della pagina: invisibile finché non lo si raggiunge
   col tasto Tab, e allora scavalca il menu per andare al contenuto. */
.skip-link {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--brand); color: #fff;
  padding: 10px 18px; border-radius: 0 0 10px 10px;
  font-weight: 600; font-size: 0.9rem;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0; text-decoration: none; }

/* Un bottone con la parola "Menu": la sola icona ☰ su mobile
   non viene riconosciuta da tutti come menu di navigazione. */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 7px;
  background: var(--brand-soft);
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  color: var(--brand-dark);
  font: 600 0.88rem var(--font);
}
.nav-toggle span { font-size: 1.05rem; line-height: 1; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.98rem;
  font-family: var(--font);
  border: none;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  text-decoration: none !important;
}
.btn--primary {
  background: var(--brand);
  color: #fff !important;
  box-shadow: 0 6px 16px -6px rgba(31, 100, 112, 0.55);
}
.btn--primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink) !important;
  border: 1.5px solid var(--line);
}
.btn--ghost:hover { border-color: var(--brand); color: var(--brand) !important; }
.btn--light {
  background: #fff;
  color: var(--navy) !important;
}
.btn--light:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn--lg { padding: 15px 30px; font-size: 1.05rem; border-radius: 14px; }
.btn--sm { padding: 8px 16px; font-size: 0.88rem; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(900px 420px at 82% -10%, rgba(77, 139, 255, 0.35), transparent 60%),
    radial-gradient(700px 380px at -8% 110%, rgba(44, 140, 74, 0.18), transparent 55%),
    linear-gradient(150deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #cddcdf;
  padding: 84px 0 96px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 56px;
  align-items: center;
}
.hero h1 { color: #fff; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: #7fc4cf; }
.hero .lead { font-size: 1.14rem; max-width: 520px; color: #b3c6cb; }
.hero-ctas { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }

.hero-stats {
  display: flex;
  gap: 36px;
  margin-top: 44px;
  flex-wrap: wrap;
}
.hero-stat b { display: block; font-size: 1.5rem; color: #fff; letter-spacing: -0.02em; }
.hero-stat span { font-size: 0.86rem; color: #8ba3aa; }

/* Mock quote card in hero */
.hero-card {
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  color: var(--text);
  max-width: 400px;
  justify-self: end;
  width: 100%;
}
.hero-card .hc-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.hero-card .hc-head span { font-weight: 700; color: var(--ink); font-size: 0.95rem; }
.hero-card .hc-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-soft);
  padding: 3px 10px;
  border-radius: 999px;
}
.hc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}
.hc-row + .hc-row { border-top: 1px dashed var(--line); }
.hc-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 800;
  color: #fff;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.hc-row .hc-name { flex: 1; }
.hc-row .hc-name b { display: block; color: var(--ink); font-size: 0.92rem; }
.hc-row .hc-name span { font-size: 0.76rem; color: var(--muted); }
.hc-price { font-weight: 800; color: var(--ink); font-size: 1.02rem; white-space: nowrap; }
.hc-price small { display: block; font-weight: 500; color: var(--muted); font-size: 0.72rem; text-align: right; }

/* ---------- Tool cards ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 20px;
}
.tool-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: #bcd6da;
  text-decoration: none;
}
.tool-card .tool-icon {
  width: 46px; height: 46px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
}
.tool-card h3 { font-size: 1.06rem; }
.tool-card p { font-size: 0.9rem; color: var(--muted); flex: 1; }
.tool-card .tool-link { font-weight: 600; font-size: 0.92rem; color: var(--brand); }

/* ---------- Ranking table ---------- */
.rank-list { display: flex; flex-direction: column; gap: 12px; }
.rank-item {
  display: grid;
  grid-template-columns: 44px 48px 1fr auto auto;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.rank-pos {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--muted);
  text-align: center;
}
.rank-item:first-child { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-sm); }
.rank-item:first-child .rank-pos { color: var(--brand); }
.rank-info b { display: block; color: var(--ink); }
.rank-info span { font-size: 0.82rem; color: var(--muted); }
.rank-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}
.tag--green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.tag--blue { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.tag--amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.rank-price { text-align: right; }
.rank-price b { font-size: 1.18rem; color: var(--ink); letter-spacing: -0.01em; }
.rank-price span { display: block; font-size: 0.74rem; color: var(--muted); }

/* ---------- Steps ---------- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 24px;
  counter-reset: step;
}
.step { position: relative; padding-top: 8px; }
.step::before {
  counter-increment: step;
  content: counter(step, decimal-leading-zero);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--brand-soft);
  -webkit-text-stroke: 1.5px var(--brand);
  display: block;
  line-height: 1;
  margin-bottom: 12px;
}
.step h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p { font-size: 0.92rem; color: var(--muted); }

/* ---------- Guide cards ---------- */
.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.guide-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); text-decoration: none; }
.guide-card .guide-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand);
}
.guide-card h3 { font-size: 1.02rem; }
.guide-card p { font-size: 0.88rem; color: var(--muted); flex: 1; }
.guide-card .guide-meta { font-size: 0.78rem; color: var(--muted); }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  border-radius: 24px;
  padding: 56px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
  color: #b3c6cb;
  position: relative;
  overflow: hidden;
}
.cta-band::after {
  content: "";
  position: absolute;
  right: -80px; top: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(77,139,255,.35), transparent 70%);
}
.cta-band h2 { color: #fff; margin-bottom: 8px; }
.cta-band p { max-width: 480px; }

/* ---------- Forms / Wizard ---------- */
.wizard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-md);
  max-width: 760px;
  margin: 0 auto;
  overflow: hidden;
}
.wizard-progress {
  display: flex;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
}
.wizard-progress .wp-step {
  flex: 1;
  padding: 16px 12px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.wizard-progress .wp-step .wp-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--line);
  color: var(--muted);
  display: grid; place-items: center;
  font-size: 0.74rem;
  font-weight: 700;
}
.wizard-progress .wp-step.active { color: var(--brand); border-bottom-color: var(--brand); }
.wizard-progress .wp-step.active .wp-num { background: var(--brand); color: #fff; }
.wizard-progress .wp-step.done .wp-num { background: var(--green); color: #fff; }

.wizard-body { padding: 36px; }
.wizard-body h2 { font-size: 1.35rem; margin-bottom: 4px; }
.wizard-body .wizard-sub { color: var(--muted); font-size: 0.94rem; margin-bottom: 26px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 0.88rem; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 0.78rem; color: var(--muted); font-weight: 400; }
.field input, .field select {
  font-family: var(--font);
  font-size: 0.96rem;
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
  width: 100%;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.field.invalid input, .field.invalid select { border-color: var(--red); }
.field .error-msg { display: none; font-size: 0.78rem; color: var(--red); }
.field.invalid .error-msg { display: block; }

.check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.check-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
  background: #fff;
}
.check-card:hover { border-color: #b9cdf7; }
.check-card input { accent-color: var(--brand); width: 17px; height: 17px; margin-top: 3px; flex-shrink: 0; }
.check-card.checked { border-color: var(--brand); background: #f6f9ff; }
.check-card b { display: block; font-size: 0.9rem; color: var(--ink); }
.check-card span { font-size: 0.78rem; color: var(--muted); display: block; }
.check-card .check-price { margin-left: auto; font-size: 0.8rem; font-weight: 700; color: var(--brand); white-space: nowrap; }

.wizard-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

/* ---------- Results ---------- */
.results-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}
.results-summary .rs-text b { color: var(--ink); }
.results-summary .rs-text span { color: var(--muted); font-size: 0.9rem; display: block; }

.quote-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px 26px;
  display: grid;
  grid-template-columns: 52px 1fr auto auto;
  gap: 18px;
  align-items: center;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  position: relative;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.quote-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.quote-card.best { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft), var(--shadow-sm); }
.quote-badge {
  position: absolute;
  top: -11px; left: 22px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}
.quote-badge--value { background: var(--green); }
.q-logo {
  width: 52px; height: 52px;
  border-radius: 13px;
  display: grid; place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 1.05rem;
}
.q-info b { display: block; color: var(--ink); font-size: 1.05rem; }
.q-info .q-rating { font-size: 0.8rem; color: var(--muted); }
.q-info .q-rating .stars { color: var(--amber); letter-spacing: 1px; }
.q-features { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.q-price { text-align: right; }
.q-price .q-amount { font-size: 1.55rem; font-weight: 800; color: var(--ink); letter-spacing: -0.02em; }
.q-price .q-amount small { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.q-price .q-monthly { font-size: 0.78rem; color: var(--muted); }
.q-price .q-save { font-size: 0.78rem; font-weight: 700; color: var(--green); }

.quote-detail {
  grid-column: 1 / -1;
  border-top: 1px dashed var(--line);
  padding-top: 14px;
  display: none;
  font-size: 0.86rem;
}
.quote-card.open .quote-detail { display: block; }
.quote-detail table { width: 100%; border-collapse: collapse; }
.quote-detail td { padding: 5px 0; color: var(--muted); }
.quote-detail td:last-child { text-align: right; color: var(--ink); font-weight: 600; }
.quote-detail tr.total td { border-top: 1px solid var(--line); padding-top: 9px; font-weight: 700; color: var(--ink); }

/* ---------- Calculator result panels ---------- */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 28px;
  align-items: start;
}
.calc-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.calc-result { position: sticky; top: 92px; }
.calc-result .cr-big {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.calc-result .cr-big small { font-size: 1rem; font-weight: 500; color: var(--muted); }
.cr-range { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.cr-bars { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }
.cr-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-bottom: 5px;
}
.cr-bar-label b { color: var(--ink); }
.cr-track { height: 9px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.cr-fill { height: 100%; border-radius: 99px; background: var(--brand); transition: width 0.5s ease; }
.cr-note {
  margin-top: 22px;
  font-size: 0.8rem;
  color: var(--muted);
  background: var(--bg);
  border-radius: 10px;
  padding: 12px 14px;
}

/* ---------- Simulation table ---------- */
.sim-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.sim-table th {
  text-align: left;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
}
.sim-table td { padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--text); }
.sim-table td b { color: var(--ink); }
.sim-table tr:last-child td { border-bottom: none; }
.pill {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
.pill--green { background: var(--green-soft); color: var(--green); }
.pill--red { background: #f8e9e8; color: var(--red); }
.pill--blue { background: var(--brand-soft); color: var(--brand); }

/* ---------- Article ---------- */
.article-hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 56px 0 40px; }
.article-hero .crumbs { font-size: 0.84rem; color: var(--muted); margin-bottom: 14px; }
.article-hero h1 { max-width: 760px; }
.article-hero .art-meta { margin-top: 14px; color: var(--muted); font-size: 0.88rem; }

.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}
.article-body { max-width: 720px; }
.article-body h2 { margin: 40px 0 14px; scroll-margin-top: 90px; }
.article-body h3 { margin: 28px 0 10px; }
.article-body p { margin-bottom: 16px; }
.article-body ul, .article-body ol { margin: 0 0 16px 22px; }
.article-body li { margin-bottom: 7px; }
.article-body table { width: 100%; border-collapse: collapse; margin: 18px 0 24px; font-size: 0.92rem; }
.article-body th { background: var(--bg); text-align: left; padding: 10px 14px; color: var(--ink); font-size: 0.84rem; }
.article-body td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.callout {
  border-left: 4px solid var(--brand);
  background: var(--brand-soft);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 0.94rem;
}
.callout--warn { border-color: var(--amber); background: var(--amber-soft); }
.toc {
  position: sticky;
  top: 92px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
}
.toc b { display: block; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 12px; }
.toc a { display: block; font-size: 0.88rem; padding: 5px 0; color: var(--text); }
.toc a:hover { color: var(--brand); text-decoration: none; }

/* ---------- FAQ ---------- */
.faq-list { max-width: 780px; margin: 0 auto; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-item summary {
  padding: 18px 22px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--brand);
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item .faq-answer { padding: 0 22px 20px; color: var(--text); font-size: 0.95rem; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: #8ba3aa;
  padding: 56px 0 32px;
  margin-top: 72px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}
.footer-grid .f-brand p { font-size: 0.88rem; margin-top: 12px; max-width: 280px; }
.site-footer h4 { color: #fff; font-size: 0.86rem; text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 16px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 9px; }
.site-footer a { color: #a6bcc2; font-size: 0.92rem; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.82rem;
}
.footer-disclaimer {
  margin-top: 18px;
  font-size: 0.76rem;
  color: #6b8288;
  line-height: 1.6;
}

/* ---------- Page hero (interne) ---------- */
.page-hero {
  background: linear-gradient(150deg, var(--navy), var(--navy-2));
  color: #b3c6cb;
  padding: 56px 0;
  text-align: center;
}
.page-hero h1 { color: #fff; font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
.page-hero p { max-width: 620px; margin: 12px auto 0; }

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.small-note { font-size: 0.8rem; color: var(--muted); }

.demo-banner {
  background: var(--amber-soft);
  color: #8a5518;
  text-align: center;
  font-size: 0.8rem;
  padding: 7px 16px;
  font-weight: 500;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { justify-self: start; }
  .calc-layout { grid-template-columns: 1fr; }
  .calc-result { position: static; }
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .rank-item { grid-template-columns: 36px 44px 1fr auto; }
  .rank-tags { display: none; }
}

@media (max-width: 720px) {
  .main-nav {
    display: none;
    position: absolute;
    top: 68px; left: 0; right: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    padding: 18px 24px;
    gap: 4px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
  }
  .main-nav.open { display: flex; }
  .main-nav > a, .main-nav .nav-voce { padding: 12px 0; font-size: 1rem; }
  .main-nav {
    max-height: calc(100vh - 68px);
    max-height: calc(100dvh - 68px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .nav-toggle { display: inline-flex; min-height: 40px; }

  /* Sul telefono i gruppi diventano una fisarmonica: si apre quello
     che serve, gli altri restano chiusi, e il menu non diventa un
     elenco di quindici voci da scorrere. */
  .nav-gruppo { position: static; }
  .nav-gruppo::after { content: none; }
  .nav-voce {
    display: flex; width: 100%; justify-content: space-between;
    padding: 12px 0; border-radius: 0;
  }
  .nav-gruppo:hover > .nav-sub { display: none; }
  .nav-gruppo.aperto > .nav-sub { display: block; }
  .nav-sub {
    position: static; min-width: 0; box-shadow: none;
    border: 0; border-left: 2px solid var(--brand-soft);
    border-radius: 0; padding: 2px 0 8px 12px; margin-bottom: 6px;
  }
  .nav-sub a { padding: 11px 10px; }
  .nav-sub a span { font-size: 0.78rem; }
  /* !important: vince sugli style inline dei form a più colonne
     (classe-merito, investimenti), che su un telefono non ci stanno. */
  .form-grid, .check-grid { grid-template-columns: 1fr !important; }
  .wizard-body { padding: 26px 20px; }
  .quote-card { grid-template-columns: 44px 1fr; }
  .q-price { grid-column: 1 / -1; text-align: left; display: flex; align-items: baseline; gap: 12px; }
  .wizard-progress .wp-step span.wp-label { display: none; }
  .section { padding: 52px 0; }
  .cta-band { padding: 40px 28px; }
}

/* ============================================================
   Soldi Chiari — palette dei grafici
   Serie categoriche, validate con il validator dataviz (light):
   #2c8c4a · #1268a3 · #c2691a · #7b4fa8 · #be3a34
   Tutti i controlli superati: banda di luminosità, cromia minima,
   separazione per daltonismo (verde e ocra tenuti non adiacenti)
   e contrasto sul fondo. L'ordine è fisso: la serie i-esima ha
   sempre lo stesso colore, non si ricicla né si riassegna.
   ============================================================ */
:root {
  --c1: #2c8c4a; --c2: #1268a3; --c3: #c2691a; --c4: #7b4fa8; --c5: #be3a34;
  --ink-2: #4a5d64;
}

/* ---------- indicatore dati live ---------- */
.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .74rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: var(--green);
}
.live-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--green);
  box-shadow: 0 0 0 0 rgba(44,140,74,.6); animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(44,140,74,.55); }
  70%  { box-shadow: 0 0 0 7px rgba(44,140,74,0); }
  100% { box-shadow: 0 0 0 0 rgba(44,140,74,0); }
}

/* ---------- KPI ---------- */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 16px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px 22px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 4px; min-height: 132px;
  transition: box-shadow .15s ease, transform .15s ease;
}
a.kpi:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-md); }
.kpi-label {
  font-size: .76rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted);
}
.kpi-value {
  font-size: 1.95rem; font-weight: 800; color: var(--ink);
  letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.kpi-value small { font-size: .92rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.kpi-sub { font-size: .8rem; color: var(--muted); margin-top: auto; }
.kpi-delta { font-size: .82rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.kpi-delta.up { color: var(--red); }
.kpi-delta.down { color: var(--green); }
.kpi-delta.flat { color: var(--muted); }
.kpi-spark { margin-top: 6px; height: 34px; }
.kpi-spark svg { display: block; width: 100%; height: 34px; overflow: visible; }

/* ---------- moduli hub ---------- */
.hub-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(272px, 1fr)); gap: 18px;
}
.hub-card {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 24px 22px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.hub-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--accent, var(--c1));
}
.hub-card:hover {
  text-decoration: none; transform: translateY(-4px);
  box-shadow: var(--shadow-md); border-color: #bcd6da;
}
.hub-ico {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  font-size: 1.35rem; background: var(--accent-soft, var(--brand-soft));
}
.hub-card h3 { font-size: 1.08rem; }
.hub-card p { font-size: .89rem; color: var(--muted); flex: 1; }
.hub-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .76rem; color: var(--muted);
}
.hub-src {
  font-weight: 700; color: var(--ink-2); background: var(--bg);
  border-radius: 6px; padding: 2px 8px; font-size: .71rem;
}

/* ---------- barra composizione (stacked) ---------- */
.stack {
  display: flex; width: 100%; height: 42px; border-radius: 10px; overflow: hidden;
  background: var(--bg); gap: 2px; /* 2px di superficie tra i segmenti */
}
.stack-seg { height: 100%; min-width: 3px; transition: opacity .12s ease; }
.stack-seg:hover { opacity: .82; }
.stack-legend { margin-top: 16px; display: flex; flex-direction: column; gap: 2px; }
.leg-row {
  display: grid; grid-template-columns: 14px 1fr auto auto; gap: 12px; align-items: center;
  padding: 9px 6px; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.leg-row:last-child { border-bottom: none; }
.leg-swatch { width: 12px; height: 12px; border-radius: 3px; }
.leg-name { color: var(--text); }
.leg-val { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.leg-pct { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }
.leg-row .leg-help {
  grid-column: 2 / -1; font-size: .81rem; color: var(--muted); margin-top: 2px;
  display: none;
}
.leg-row.open .leg-help { display: block; }
.leg-row[data-help] { cursor: pointer; }

/* ---------- ricerca ---------- */
.searchbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px 18px; box-shadow: var(--shadow-sm);
}
.searchbar .field { flex: 1 1 170px; min-width: 0; gap: 5px; }
.searchbar .field label { font-size: .78rem; }
.searchbar .btn { flex: 0 0 auto; }

.autolist {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin-top: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-md); max-height: 260px; overflow-y: auto;
}
.autolist div { padding: 10px 14px; cursor: pointer; font-size: .92rem; }
.autolist div:hover, .autolist div.sel { background: var(--brand-soft); color: var(--brand); }
.autowrap { position: relative; }

/* ---------- lista distributori ---------- */
.stations { display: flex; flex-direction: column; gap: 8px; }
.station {
  display: grid; grid-template-columns: 34px 1fr 130px auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 16px; box-shadow: var(--shadow-sm);
}
.station.best { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft), var(--shadow-sm); }
.station-rank { font-weight: 800; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.station.best .station-rank { color: var(--green); }
.station-info b { display: block; color: var(--ink); font-size: .95rem; }
.station-info span { font-size: .8rem; color: var(--muted); }
.station-bar { height: 7px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.station-bar i { display: block; height: 100%; border-radius: 99px; background: var(--c1); }
.station-price { text-align: right; }
.station-price b { font-size: 1.2rem; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.station-price span { display: block; font-size: .74rem; color: var(--muted); }

/* ---------- stati ---------- */
.skel {
  background: linear-gradient(90deg, var(--bg) 25%, #eef1ee 50%, var(--bg) 75%);
  background-size: 200% 100%; animation: shimmer 1.3s infinite; border-radius: 8px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty {
  text-align: center; padding: 44px 20px; color: var(--muted);
  background: var(--surface); border: 1px dashed var(--line); border-radius: 14px;
}
.err {
  background: #f8e9e8; border: 1px solid #eecfcd; color: #8f2f2a;
  border-radius: 12px; padding: 14px 18px; font-size: .9rem;
}

/* ---------- tabella dati ---------- */
.dtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dtable th {
  text-align: left; font-size: .74rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); padding: 9px 12px; border-bottom: 2px solid var(--line); font-weight: 700;
}
.dtable td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.dtable td:first-child { font-variant-numeric: normal; }
.dtable tr:last-child td { border-bottom: none; }
.dtable td b { color: var(--ink); }

/* ---------- piano di risparmio ---------- */
.plan-total {
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  color: #fff; border-radius: 20px; padding: 32px 36px; text-align: center;
  box-shadow: var(--shadow-lg);
}
.plan-total .pt-num {
  font-size: 3.2rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.plan-total .pt-lab { color: #a6bcc2; font-size: .95rem; margin-top: 6px; }
.plan-item {
  display: grid; grid-template-columns: 26px 1fr auto; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 8px;
}
.plan-item input { width: 18px; height: 18px; accent-color: var(--brand); }
.plan-item b { display: block; color: var(--ink); font-size: .95rem; }
.plan-item span { font-size: .81rem; color: var(--muted); }
.plan-item .pi-eur { font-weight: 800; color: var(--green); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- confronto fra metodi (cambio valuta) ----------
   Nome del metodo a sinistra, quanto arriva a destinazione a destra.
   Due colonne e basta: il numero deve stare sulla stessa riga del
   nome anche su uno schermo da 360px, altrimenti il confronto —
   che è l'unico motivo per cui la tabella esiste — si perde. */
.metodo-riga {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  align-items: start;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.metodo-riga:last-of-type { border-bottom: none; }
.metodo-riga > span:last-child { text-align: right; white-space: nowrap; }
.metodo-riga b { color: var(--ink); }
.metodo-riga .small-note { line-height: 1.35; }

@media (max-width: 460px) {
  .metodo-riga { font-size: 0.88rem; gap: 10px; }
  .metodo-riga .small-note { font-size: 0.74rem; }
}

/* ---------- sommario della pagina ----------
   Barra delle sezioni, subito sotto il titolo. Resta appiccicata sotto
   l'intestazione mentre si scorre e segna dove ci si trova: sulle
   pagine lunghe è ciò che evita di scorrere alla cieca. Su schermo
   stretto scorre di lato invece di andare a capo, così non ruba
   mezzo schermo al contenuto. */
.sommario-pagina {
  position: sticky;
  top: 68px;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.sp-scroll {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.sp-scroll::-webkit-scrollbar { display: none; }
.sommario-pagina a {
  flex: 0 0 auto;
  padding: 13px 14px;
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  scroll-snap-align: center;
}
.sommario-pagina a:hover { color: var(--ink); text-decoration: none; }
.sommario-pagina a.attivo { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }

/* Le ancore non devono finire sotto le due barre appiccicate. */
section[id] { scroll-margin-top: 118px; }

@media (max-width: 720px) {
  .sommario-pagina { top: 68px; }
  .sommario-pagina a { padding: 12px 12px; font-size: 0.82rem; }
}

/* ---------- grafico a linea ----------
   Serie unica: nessuna legenda, il titolo la nomina già. Griglia e assi
   in tratto sottile un tono sopra la superficie; il valore puntuale lo
   dà il crosshair al passaggio, non un'etichetta su ogni punto. */
.chartbox {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px 24px 16px;
  box-shadow: var(--shadow-sm);
}
.chart-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; flex-wrap: wrap; margin-bottom: 14px;
}
.chart-head b { display: block; color: var(--ink); font-size: 1rem; }
.chart-head .small-note { display: block; margin-top: 3px; }
.chart-range {
  display: flex; gap: 4px; background: var(--bg);
  border: 1px solid var(--line); border-radius: 99px; padding: 3px;
}
.chart-range button {
  border: 0; background: transparent; font: inherit; font-size: 0.82rem;
  font-weight: 600; color: var(--muted); padding: 7px 14px;
  border-radius: 99px; cursor: pointer; white-space: nowrap;
}
.chart-range button:hover { color: var(--ink); }
.chart-range button.attivo {
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm);
}
#oro-grafico { position: relative; }
.chart-svg { display: block; width: 100%; height: auto; }
.chart-tip {
  position: absolute; top: 4px; background: var(--navy); color: #fff;
  border-radius: 10px; padding: 7px 12px; font-size: 0.82rem;
  pointer-events: none; white-space: nowrap; box-shadow: var(--shadow-md); z-index: 3;
}
.chart-tip b { display: block; font-size: 1rem; font-weight: 700; }
.chart-tip span { color: #a6bcc2; font-size: 0.74rem; }

/* Tabella di dettaglio richiudibile: la versione leggibile del grafico,
   utile a chi usa uno screen reader e a chi vuole i numeri esatti. */
.dettaglio-tabella {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 0 20px;
}
.dettaglio-tabella summary {
  cursor: pointer; padding: 16px 0; font-weight: 600; font-size: 0.92rem;
  color: var(--brand); list-style: none;
}
.dettaglio-tabella summary::-webkit-details-marker { display: none; }
.dettaglio-tabella summary::before { content: "▸ "; }
.dettaglio-tabella[open] summary::before { content: "▾ "; }
.dettaglio-tabella[open] summary { border-bottom: 1px solid var(--line); }
.dettaglio-tabella > *:last-child { margin-bottom: 18px; }

/* ---------- utility ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.mono-num { font-variant-numeric: tabular-nums; }
.src-note {
  font-size: .76rem; color: var(--muted); margin-top: 14px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.src-note a { color: var(--ink-2); text-decoration: underline; }

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .station { grid-template-columns: 28px 1fr auto; }
  .station-bar { display: none; }
}

/* ---------- mappa distributori (Leaflet + tile OpenStreetMap) ---------- */
.mapbox {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px; box-shadow: var(--shadow-sm); margin-bottom: 16px;
}
.map-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
#mappa {
  height: 440px; border-radius: 10px; z-index: 1;
  background: #eef1ee; border: 1px solid var(--line);
}

/* segnaposto: il prezzo è scritto sul marker, mai affidato al solo colore */
.pin {
  display: inline-block; min-width: 54px; text-align: center;
  font: 700 12px/1 var(--font); font-variant-numeric: tabular-nums;
  color: #fff; padding: 5px 7px; border-radius: 7px;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(18,36,43,.32);
  text-shadow: 0 1px 2px rgba(0,0,0,.35); white-space: nowrap;
  position: relative; cursor: pointer;
}
.pin::after {
  content: ""; position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: #fff;
}
.pin--best {
  min-width: 60px; font-size: 13px; padding: 6px 9px;
  box-shadow: 0 0 0 3px rgba(44,140,74,.35), 0 3px 8px rgba(18,36,43,.35);
  z-index: 500 !important;
}
.leaflet-marker-icon:hover .pin { filter: brightness(1.08); }

/* popup */
.leaflet-popup-content-wrapper { border-radius: 12px; box-shadow: var(--shadow-md); }
.leaflet-popup-content { margin: 14px 16px; font-family: var(--font); line-height: 1.5; }
.pop { display: flex; flex-direction: column; gap: 2px; font-size: .86rem; color: var(--text); }
.pop-price {
  font-size: 1.45rem; font-weight: 800; color: var(--ink);
  letter-spacing: -.02em; font-variant-numeric: tabular-nums;
}
.pop b { color: var(--ink); font-size: .95rem; }
.pop-meta { color: var(--muted); font-size: .8rem; margin-top: 4px; }
.pop-link { margin-top: 8px; font-weight: 600; font-size: .85rem; }
.leaflet-container { font-family: var(--font); }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }

.map-legend {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; font-size: .78rem; color: var(--muted);
}
.map-ramp { display: flex; height: 9px; width: 150px; border-radius: 99px; overflow: hidden; }
.map-ramp i { flex: 1; height: 100%; }

/* Sul telefono la mappa merita più schermo e pin più piccoli:
   40 etichette da 58px si sovrapponevano fino a essere illeggibili. */
@media (max-width: 720px) {
  #mappa { height: min(58vh, 430px); }
  .mapbox { padding: 10px; }
  .pin { min-width: 44px; font-size: 11px; padding: 4px 5px; }
  .pin--best { min-width: 52px; font-size: 12px; padding: 5px 6px; }
}

/* ---------- freschezza del dato ---------- */
.fresh {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .74rem; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  white-space: nowrap;
}
.fresh--oggi { background: var(--green-soft); color: #1f6b39; }
.fresh--recente { background: var(--brand-soft); color: var(--brand-dark); }
.fresh--vecchio { background: var(--amber-soft); color: #8a5518; }
.station-info .fresh { margin-left: 6px; }

.databar {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 18px; margin-bottom: 16px; font-size: .84rem;
  color: var(--muted);
}
.databar b { color: var(--ink); }

/* toggle vista lista/mappa */
.viewtabs { display: inline-flex; background: var(--bg); border-radius: 10px; padding: 3px; gap: 3px; }
.viewtabs button {
  border: none; background: none; font-family: var(--font); font-size: .86rem; font-weight: 600;
  color: var(--muted); padding: 7px 16px; border-radius: 8px; cursor: pointer;
}
.viewtabs button.on { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

/* Il tocco prolungato su iOS non deve "selezionare" le tile della
   mappa: la selezione le copre con un velo bianco semitrasparente. */
#mappa, #mappa-neg {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.autolist .auto-sep {
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: var(--bg); padding: 7px 14px; cursor: default;
}
.autolist .auto-sep:hover { background: var(--bg); color: var(--muted); }

/* segnaposto negozi */
.pin-shop {
  display: grid; place-items: center; width: 28px; height: 28px; font-size: 15px;
  background: #fff; border: 2px solid var(--c1); border-radius: 50%;
  box-shadow: 0 2px 6px rgba(18,36,43,.3); cursor: pointer;
}
.pin-shop--disc { border-color: var(--green); box-shadow: 0 0 0 3px rgba(44,140,74,.25), 0 2px 6px rgba(18,36,43,.3); }
#mappa-neg { height: 420px; border-radius: 10px; z-index: 1; background: #eef1ee; border: 1px solid var(--line); }
@media (max-width: 720px) { #mappa-neg { height: min(50vh, 380px); } }

/* ============================================================
   Chiedi a Bob — assistente conversazionale
   ============================================================ */
.bob-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 900;
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, var(--brand), #2f8b99);
  color: #fff; border: none; border-radius: 999px;
  padding: 13px 22px 13px 16px; cursor: pointer;
  font: 600 .96rem var(--font);
  box-shadow: 0 8px 26px -6px rgba(31,100,112,.6);
  transition: transform .16s ease, box-shadow .16s ease;
}
.bob-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 32px -6px rgba(31,100,112,.7); }
.bob-fab.hide { display: none; }
.bob-fab .bob-face { font-size: 1.3rem; line-height: 1; }
.bob-fab .bob-ping {
  position: absolute; top: 8px; right: 14px; width: 9px; height: 9px;
  background: var(--green); border-radius: 50%; border: 2px solid #fff;
}

.bob-panel {
  position: fixed; right: 22px; bottom: 22px; z-index: 950;
  width: min(430px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 44px));
  height: min(640px, calc(100dvh - 44px));
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  box-shadow: 0 24px 64px -18px rgba(18,48,58,.45);
  display: none; flex-direction: column; overflow: hidden;
}
.bob-panel.open { display: flex; animation: bobIn .22s ease; }
@keyframes bobIn { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.bob-head {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #fff;
  flex-shrink: 0;
}
.bob-avatar {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #2f8b99); font-size: 1.4rem; flex-shrink: 0;
}
.bob-head .bob-who { flex: 1; min-width: 0; }
.bob-head b { display: block; font-size: 1rem; color: #fff; }
.bob-head span { font-size: .78rem; color: #9db4ba; display: flex; align-items: center; gap: 6px; }
.bob-close {
  background: rgba(255,255,255,.12); border: none; color: #fff; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; font-size: 1.1rem; line-height: 1;
}
.bob-close:hover { background: rgba(255,255,255,.22); }

.bob-body {
  flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 12px;
  background: var(--bg); scroll-behavior: smooth;
}
.bob-msg { display: flex; gap: 9px; align-items: flex-end; max-width: 100%; }
.bob-msg.me { flex-direction: row-reverse; }
.bob-msg .bob-mini {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), #2f8b99); font-size: .9rem; flex-shrink: 0;
}
.bob-bubble {
  background: #fff; border: 1px solid var(--line); border-radius: 16px 16px 16px 4px;
  padding: 12px 15px; font-size: .92rem; line-height: 1.55; color: var(--text);
  box-shadow: var(--shadow-sm); max-width: 320px; overflow-wrap: anywhere;
}
.bob-msg.me .bob-bubble {
  background: var(--brand); color: #fff; border-color: var(--brand);
  border-radius: 16px 16px 4px 16px;
}
.bob-bubble b { color: var(--ink); }
.bob-msg.me .bob-bubble b { color: #fff; }
.bob-bubble a { font-weight: 600; }
.bob-bubble.wide { max-width: 100%; }

/* carte dati dentro la chat */
.bob-card {
  background: var(--bg); border-radius: 11px; padding: 11px 13px; margin-top: 9px;
  border: 1px solid var(--line);
}
.bob-card + .bob-card { margin-top: 7px; }
.bob-card .bc-top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
}
.bob-card b { color: var(--ink); font-size: .9rem; }
.bob-card .bc-num {
  font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.bob-card .bc-sub { font-size: .78rem; color: var(--muted); display: block; margin-top: 2px; }
.bob-card.best { border-color: var(--green); background: var(--green-soft); }
.bob-big {
  font-size: 1.75rem; font-weight: 800; color: var(--ink); letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; line-height: 1.15; margin: 4px 0 2px;
}
.bob-src { font-size: .74rem; color: var(--muted); margin-top: 9px; padding-top: 8px;
  border-top: 1px dashed var(--line); }

/* suggerimenti rapidi */
.bob-chips { display: flex; flex-wrap: wrap; gap: 7px; padding-left: 35px; }
.bob-msg.me + .bob-chips { padding-left: 0; }
.bob-chip {
  background: #fff; border: 1.5px solid #bcd6da; color: var(--brand);
  border-radius: 999px; padding: 7px 14px; font: 600 .83rem var(--font);
  cursor: pointer; transition: background .12s ease, transform .12s ease;
}
.bob-chip:hover { background: var(--brand-soft); transform: translateY(-1px); }

/* scrittura */
.bob-typing { display: flex; gap: 4px; padding: 13px 16px; }
.bob-typing i {
  width: 7px; height: 7px; border-radius: 50%; background: var(--muted);
  animation: bobDot 1.3s infinite;
}
.bob-typing i:nth-child(2) { animation-delay: .18s; }
.bob-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes bobDot { 0%,60%,100% { opacity: .3; transform: translateY(0); }
                    30% { opacity: 1; transform: translateY(-4px); } }

.bob-foot {
  display: flex; gap: 9px; padding: 13px 15px; border-top: 1px solid var(--line);
  background: var(--surface); flex-shrink: 0;
}
.bob-foot input {
  flex: 1; min-width: 0; font: .94rem var(--font); padding: 11px 15px;
  border: 1.5px solid var(--line); border-radius: 999px; color: var(--ink); background: var(--bg);
}
.bob-foot input:focus { outline: none; border-color: var(--brand); background: #fff; }
.bob-send {
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--brand); color: #fff; font-size: 1.05rem; flex-shrink: 0;
}
.bob-send:hover { background: var(--brand-dark); }
.bob-send:disabled { opacity: .45; cursor: default; }

.bob-privacy {
  font-size: .7rem; color: var(--muted); text-align: center; padding: 0 15px 10px;
  background: var(--surface);
}

/* Sul telefono la chat diventa un foglio a tutto schermo: niente
   cornici, altezza in dvh (il vecchio 100vh finiva sotto la barra
   degli indirizzi) e rispetto del notch. Il JS blocca lo scroll
   della pagina sottostante e adatta l'altezza alla tastiera. */
@media (max-width: 560px) {
  .bob-panel {
    inset: 0; width: auto; border-radius: 0; border: none;
    height: 100vh; height: 100dvh;
  }
  .bob-head { padding-top: max(15px, env(safe-area-inset-top)); }
  .bob-fab { right: 14px; bottom: 14px; padding: 12px 18px 12px 14px; }
  .bob-bubble { max-width: 85%; }
  .bob-close, .bob-restart { width: 44px; height: 44px; font-size: 1.25rem; background: rgba(255,255,255,.16); }
  .bob-privacy { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
}
/* Blocco scroll "vero" per iOS: overflow:hidden da solo non basta,
   Safari scorre comunque la pagina quando si apre la tastiera e
   porta fuori schermo la testata della chat (con la ✕). */
body.bob-open { position: fixed; left: 0; right: 0; overflow: hidden; }

.bob-restart {
  background: rgba(255,255,255,.12); border: none; color: #fff; cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; font-size: 1rem; line-height: 1;
  margin-right: 4px;
}
.bob-restart:hover { background: rgba(255,255,255,.22); }
.bob-chip:focus-visible, .bob-restart:focus-visible, .bob-close:focus-visible {
  outline: 2px solid #fff; outline-offset: 2px;
}

/* ============================================================
   Carburanti — ricerca e verifica del prezzo (mobile-first)
   ============================================================ */
.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;
}

.cerca-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.cerca-riga { display: flex; gap: 10px; flex-wrap: wrap; }
.cerca-form { display: flex; gap: 10px; flex: 1 1 260px; min-width: 0; }
.cerca-form input {
  width: 100%; font-family: var(--font); font-size: 1rem; padding: 13px 16px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink);
}
.cerca-form input:focus { outline: none; border-color: var(--brand); background: #fff; }
.cerca-gps { flex: 0 0 auto; white-space: nowrap; }

/* filtri a chip: comodi col pollice, compatti sul desktop */
.filtri {
  border: none; padding: 16px 0 0; margin: 16px 0 0;
  border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 14px;
}
.filtro-riga { display: flex; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.filtro-gruppo { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.filtro-lab {
  font-size: .74rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.chip-set { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input {
  position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer;
}
.chip span {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1.5px solid var(--line); background: var(--bg); color: var(--text);
  border-radius: 999px; padding: 10px 16px; font-size: .92rem; font-weight: 600;
  cursor: pointer; user-select: none; transition: border-color .12s, background .12s, color .12s;
  min-height: 42px;
}
.chip span::before {
  content: ""; width: 15px; height: 15px; border-radius: 5px; flex-shrink: 0;
  border: 2px solid var(--muted); background: #fff; transition: all .12s;
}
.chip input[type="radio"] + span::before { border-radius: 50%; }
.chip input:checked + span {
  border-color: var(--c, var(--brand)); background: #fff;
  color: var(--c, var(--brand-dark));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--c, var(--brand)) 18%, transparent);
}
.chip input:checked + span::before {
  border-color: var(--c, var(--brand)); background: var(--c, var(--brand));
  box-shadow: inset 0 0 0 2px #fff;
}
.chip input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.chip span:hover { border-color: #b8ccd0; }

.filtro-select {
  font-family: var(--font); font-size: .92rem; font-weight: 600; padding: 10px 14px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--bg);
  color: var(--ink); min-height: 42px; cursor: pointer;
}
.filtro-select:focus { outline: none; border-color: var(--brand); background: #fff; }

@media (max-width: 560px) {
  .cerca-gps { width: 100%; }
  .filtro-riga { gap: 14px; }
  .filtro-gruppo { flex: 1 1 100%; }
  .filtro-select { width: 100%; }
}

/* riepilogo di zona */
.sommario {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow-sm);
}
.sommario-top { margin-bottom: 14px; }
.sommario-top b { display: block; color: var(--ink); font-size: 1.1rem; }
.sommario-top span { font-size: .86rem; color: var(--muted); }
.sommario-carb { display: grid; gap: 10px; }
.sc-item {
  display: grid; grid-template-columns: auto auto; align-items: baseline; gap: 4px 12px;
  border-left: 4px solid var(--c); border-radius: 0 10px 10px 0;
  background: var(--bg); padding: 12px 14px;
}
.sc-nome { font-weight: 700; color: var(--ink); font-size: .95rem; }
.sc-min {
  font-size: 1.5rem; font-weight: 800; color: var(--c);
  letter-spacing: -.02em; text-align: right; font-variant-numeric: tabular-nums;
}
.sc-range { grid-column: 1/-1; font-size: .8rem; color: var(--muted); }
.sc-range b { color: var(--green); }

/* scheda distributore con più carburanti */
.station2 {
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.station2.best { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft), var(--shadow-sm); }
.st-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.st-nome b { display: block; color: var(--ink); font-size: .98rem; line-height: 1.3; }
.st-nome span { font-size: .82rem; color: var(--muted); }
.st-prezzi {
  display: grid; gap: 8px; margin-top: 12px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.st-p {
  border: 1.5px solid var(--line); border-radius: 10px; padding: 9px 12px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
}
.st-p span { font-size: .8rem; color: var(--muted); }
.st-p b {
  font-size: 1.15rem; font-weight: 800; color: var(--c, var(--ink));
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.st-p--top { border-color: var(--green); background: var(--green-soft); }
.st-p--vuoto { opacity: .45; }
.st-p--vuoto b { color: var(--muted); }

/* verdetto "sto risparmiando?" */
.check-wrap { display: grid; gap: 20px; max-width: 720px; margin: 0 auto; }
.verdetto {
  display: flex; gap: 14px; align-items: flex-start;
  border-radius: 16px; padding: 18px 20px; border: 2px solid;
}
.verdetto b { display: block; font-size: 1.05rem; margin-bottom: 3px; }
.verdetto span { font-size: .92rem; }
.vd-emoji { font-size: 1.9rem; line-height: 1; flex-shrink: 0; }
.verdetto--ottimo { background: var(--green-soft); border-color: var(--green); color: #1a5c33; }
.verdetto--ottimo b { color: #14512c; }
.verdetto--bene   { background: var(--brand-soft); border-color: var(--brand); color: #16454e; }
.verdetto--bene b { color: var(--brand-dark); }
.verdetto--cosi   { background: var(--amber-soft); border-color: var(--amber); color: #7a4310; }
.verdetto--cosi b { color: #6b3a0e; }
.verdetto--male   { background: #f8e9e8; border-color: var(--red); color: #8f2f2a; }
.verdetto--male b { color: #7d2926; }
.verdetto--attesa { background: var(--bg); border-color: var(--line); color: var(--muted); }
.verdetto--attesa b { color: var(--ink); }

/* scala di posizionamento */
.scala { margin-bottom: 18px; }
.scala-barra {
  position: relative; height: 12px; border-radius: 99px; margin: 34px 0 10px;
  background: linear-gradient(90deg, var(--green) 0%, #c9b23a 50%, var(--red) 100%);
}
.scala-tu { position: absolute; top: -32px; transform: translateX(-50%); text-align: center; }
.scala-tu span {
  display: inline-block; background: var(--ink); color: #fff; font-size: .74rem; font-weight: 700;
  padding: 4px 9px; border-radius: 7px; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.scala-tu::after {
  content: ""; display: block; width: 3px; height: 20px; background: var(--ink);
  margin: 2px auto 0; border-radius: 2px;
}
.scala-etichette {
  display: grid; grid-template-columns: 1fr 1fr 1fr; font-size: .74rem; color: var(--muted);
}
.scala-etichette b { color: var(--ink); font-variant-numeric: tabular-nums; }

.risparmio-box {
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: #b3c6cb;
  border-radius: 14px; padding: 22px; text-align: center;
}
.rb-num {
  font-size: 2.4rem; font-weight: 800; color: #fff; letter-spacing: -.03em;
  line-height: 1.1; font-variant-numeric: tabular-nums;
}
.rb-lab { font-size: .9rem; margin-top: 4px; }
.rb-det { font-size: .82rem; margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.14); }
.rb-det b { color: #fff; }

@media (min-width: 700px) {
  .sommario-carb { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Revisione responsive — attenzione particolare al mobile
   ============================================================ */

/* Nessun elemento deve poter far scorrere la pagina in orizzontale. */
html, body { overflow-x: hidden; max-width: 100%; }
img, svg, table, pre { max-width: 100%; }

/* ------------------------------------------------------------------
   La regola che tiene in piedi tutto il mobile.

   Per impostazione predefinita un elemento dentro una griglia ha
   min-width:auto: non può restringersi sotto il contenuto più largo
   che ospita. Basta quindi UNA tabella fitta, o un <select> con
   un'opzione lunga, perché l'intera colonna — e con essa il pannello,
   e con esso la pagina — diventi più larga dello schermo. Il testo
   finisce fuori dal telefono e, dato che il corpo pagina nasconde lo
   scorrimento orizzontale, diventa semplicemente irraggiungibile.

   min-width:0 restituisce alla colonna il permesso di stringersi: da
   lì in poi sono i contenuti larghi a doversi arrangiare (scorrendo
   nel proprio riquadro o andando a capo), non la pagina ad allargarsi.
   ------------------------------------------------------------------ */
.calc-layout > *, .article-layout > *, .grid-2 > *, .form-grid > *,
.hub-grid > *, .guides-grid > *, .tools-grid > *, .steps-grid > *,
.kpi-grid > *, .footer-grid > *, .sommario-carb > * { min-width: 0; }

/* Un campo non deve mai essere più largo del suo contenitore: i <select>
   si dimensionano sull'opzione più lunga, e le opzioni qui sono frasi. */
input, select, textarea, button { max-width: 100%; }
select { width: 100%; }

/* ------------------------------------------------------------------
   Tabelle.

   Due casi diversi, che prima erano trattati allo stesso modo:

   · tabelle di NUMERI (.dtable, .sim-table) — le cifre non vanno
     spezzate, quindi restano su una riga e la tabella scorre da sola
     dentro il suo riquadro;

   · tabelle di TESTO (quelle degli articoli) — mandarle a capo è
     l'unico modo per leggerle sul telefono. Prima ereditavano il
     nowrap delle altre e costringevano a trascinare di lato una
     frase per volta.
   ------------------------------------------------------------------ */
.dtable, .sim-table { display: block; overflow-x: auto; white-space: nowrap; }
.dtable thead, .sim-table thead { white-space: nowrap; }
@media (min-width: 700px) {
  .dtable, .sim-table { display: table; white-space: normal; }
}

/* Contenitore che scorre: avvolge le tabelle larghe senza toccarne il
   markup, così la tabella resta una tabella per lettori di schermo e
   motori di ricerca. Lo applica il server a tutte le tabelle di testo. */
.table-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
.table-scroll > table { margin: 0; }
.article-body .table-scroll { margin: 18px 0 24px; }
/* break-word e non anywhere: spezza una parola solo quando davvero non
   ci sta, invece di sillabare "sponsorizzati" in una colonna stretta. */
.article-body th, .article-body td { overflow-wrap: break-word; }

@media (max-width: 699px) {
  /* Sotto i 700px le tabelle di testo vanno a capo dentro lo schermo. */
  .article-body table { font-size: 0.86rem; }
  .article-body th, .article-body td { padding: 9px 10px; }
  /* Le tabelle con più di due colonne non stanno in 390px senza diventare
     illeggibili: mantengono una larghezza minima e scorrono nel riquadro,
     con una sfumatura che segnala che c'è dell'altro a destra. */
  .table-scroll--larga > table { min-width: 460px; }
  .table-scroll--larga {
    background:
      linear-gradient(to right, var(--surface) 30%, rgba(255, 255, 255, 0)),
      linear-gradient(to left, var(--surface) 30%, rgba(255, 255, 255, 0)) 100% 0,
      radial-gradient(farthest-side at 0 50%, rgba(18, 36, 43, 0.14), transparent),
      radial-gradient(farthest-side at 100% 50%, rgba(18, 36, 43, 0.14), transparent) 100% 0;
    background-repeat: no-repeat;
    background-size: 32px 100%, 32px 100%, 12px 100%, 12px 100%;
    background-attachment: local, local, scroll, scroll;
  }
}

/* Bersagli tattili: nessun comando sotto i 44px. */
@media (hover: none) {
  .btn, .filtro-select, .field select, .field input,
  .bob-chip, .bob-send, .nav-toggle { min-height: 44px; }
  .main-nav a { padding: 12px 0; }
  .leg-row { padding: 12px 6px; }
}

/* Su iOS un font sotto i 16px fa zoomare la pagina all'apertura della tastiera. */
@media (max-width: 720px) {
  .field input, .field select, .cerca-form input, .bob-foot input,
  .filtro-select { font-size: 16px; }
}

@media (max-width: 720px) {
  .container { padding: 0 16px; }
  .section { padding: 40px 0; }
  .section--tight { padding: 28px 0; }
  .page-hero { padding: 36px 0; }
  .hero { padding: 52px 0 60px; }

  h1 { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  h2 { font-size: clamp(1.35rem, 5.5vw, 1.7rem); }

  /* tutto a colonna singola */
  .calc-layout, .grid-2, .article-layout,
  .hub-grid, .guides-grid, .tools-grid, .steps-grid {
    grid-template-columns: 1fr !important;
  }

  /* I KPI restano a due colonne, compatti: più numeri nel primo
     schermo, che sul telefono è quello che conta. */
  .kpi-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  .kpi { padding: 13px 14px; }
  .kpi-label { font-size: 0.66rem; }
  .kpi-value { font-size: 1.32rem !important; }
  .kpi-value small { font-size: 0.76rem; }
  .kpi-sub, .kpi-delta { font-size: 0.72rem; }
  .kpi-spark, .kpi-spark svg { height: 26px; }

  /* Il footer a 4 colonne impilate diventava un serpentone:
     due colonne di link, marchio a tutta larghezza. */
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .footer-grid .f-brand { grid-column: 1 / -1; }

  /* Le card degli strumenti in verticale occupavano uno schermo
     l'una: icona a sinistra e testo a fianco, si scorrono a colpo d'occhio. */
  .hub-grid { gap: 12px; }
  .hub-card {
    display: grid;
    grid-template-columns: 44px 1fr;
    column-gap: 14px;
    row-gap: 4px;
    padding: 16px 16px 14px;
  }
  .hub-ico { grid-row: 1 / 4; width: 44px; height: 44px; font-size: 1.2rem; margin-top: 2px; }
  .hub-card h3 { font-size: 1rem; }
  .hub-card p { font-size: 0.84rem; }
  .calc-panel { padding: 20px 18px; }
  .calc-result { position: static !important; }
  .toc { position: static; order: -1; margin-bottom: 20px; }

  /* Sul telefono il primo schermo deve consegnare subito i numeri:
     testo più compatto, CTA a tutta larghezza, statistiche in griglia 2×2. */
  .hero .lead { font-size: 1.02rem; }
  .hero-ctas { margin-top: 22px; }
  .hero-ctas .btn { flex: 1 1 100%; }
  .hero-stats {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 14px 20px; margin-top: 30px;
  }
  .hero-stat b { font-size: 1.3rem; }

  .cta-band { padding: 30px 22px; text-align: center; flex-direction: column; }
  .cta-band .btn { width: 100%; }

  .section-head { margin-bottom: 26px; }
  .kpi { min-height: 0; }

  /* Il pulsante della chat non deve coprire i link del footer. */
  .site-footer { padding-bottom: 104px; }

  /* i pannelli sticky perdono senso su schermi corti */
  [style*="position:sticky"] { position: static !important; }
}

/* Griglie a due colonne su tablet, tre su desktop ampio. */
@media (min-width: 721px) and (max-width: 1023px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .hub-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Rispetta chi ha chiesto meno animazioni. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
}

/* Notch e barre di sistema sui telefoni moderni. */
@supports (padding: max(0px)) {
  .container { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
  .bob-fab { bottom: max(14px, env(safe-area-inset-bottom)); }
  /* Solo sopra i 560px: sul telefono il pannello è a tutto schermo
     (inset: 0) e un bottom qui aprirebbe una fessura sotto la chat. */
  @media (min-width: 561px) {
    .bob-panel { bottom: max(8px, env(safe-area-inset-bottom)); }
  }
}

/* comando presente ma non utilizzabile nel contesto attuale */
.btn--disabilitato { opacity: .5; }

/* ============================================================
   Il tuo piano — colonna del totale
   Desktop: pannello che accompagna lo scroll a fianco della lista.
   Mobile: il totale diventa una barra compatta incollata sotto
   l'header (il numero deve aggiornarsi SOTTO GLI OCCHI mentre
   spunti le voci), il dettaglio scivola in fondo alla pagina.
   ============================================================ */
.piano-lato { position: sticky; top: 92px; }

@media (max-width: 720px) {
  .piano-lato { display: contents; }   /* i figli diventano elementi della griglia */
  #totale {
    order: -1;                         /* il totale sale in cima… */
    position: sticky; top: 74px;       /* …e resta visibile mentre scorri */
    z-index: 15;
    padding: 12px 18px;
    border-radius: 14px;
    box-shadow: var(--shadow-md);
  }
  #totale .pt-num { font-size: 1.8rem; }
  #totale .pt-lab { font-size: .78rem; margin-top: 2px; }
  #totale .pt-lab br { display: none; }
  #dettaglio { order: 2; }             /* il dettaglio chiude la pagina */

  /* la tabella "da dove arriva" deve andare a capo, non scorrere di lato */
  #dettaglio .dtable { display: table; white-space: normal; }

  .plan-item { padding: 12px 14px; gap: 10px; }
  .plan-item .pi-eur { font-size: .9rem; }
}
