/* Drittabox · stile «Il viaggio del pacco». Palette: Cielo, Sole, Arancio, Prato, Blu, Notte. Illustrazioni in assets/img/. */

/* Font ospitati sul sito, gli stessi file della pagina principale (../../../assets/fonts/, cioè assets/fonts/ nella radice), nessuna richiesta a Google o ad altri siti: Bricolage Grotesque (titoli)
   e Inter (testo), entrambi sotto SIL Open Font License 1.1 (licenze in assets/fonts/OFL-*.txt). Sono gli stessi
   file WOFF2 che serviva Google Fonts (sottoinsiemi latin e latin-ext; sono font variabili: Bricolage con gli assi
   opsz 12–96 e wght 200–800, Inter con wght 100–900) e le stesse regole, con gli stessi pesi dichiarati
   (Bricolage 600, 700, 800; Inter 400, 500, 600) e lo stesso unicode-range: il browser scarica latin-ext solo se
   nella pagina c'è un carattere di quel gruppo. font-display: swap: finché il font non arriva si vede quello di
   sistema. */
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('../../../assets/fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url('../../../assets/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('../../../assets/fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url('../../../assets/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('../../../assets/fonts/bricolage-grotesque-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 800;
  font-stretch: 100%;
  font-display: swap;
  src: url('../../../assets/fonts/bricolage-grotesque-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../../../assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../../../assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../../../assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../../../assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../../../assets/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../../../assets/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Colori. Contrasto del testo almeno 4,5:1 (WCAG AA) in chiaro e in scuro: i colori vivaci (cielo, sole, arancio,
   prato) fanno da sfondo o da decorazione, il testo usa sempre --ink, --text, --muted o le varianti "scure". */
:root {
  --cielo: #2AA8FF;
  --cielo-chiaro: #DDF1FF;
  --blu: #0A5FB4;
  --sole: #FFD23F;
  --sole-chiaro: #FFF4C7;
  --arancio: #FF7A1A;
  --arancio-scuro: #B93A06;
  --prato: #2BC86B;
  --prato-chiaro: #DDF8E7;
  --prato-scuro: #0B6E36;
  --notte: #0D1530;

  --bg: #F3F9FF;
  --bg-tint: #E8F3FD;
  --surface: #FFFFFF;
  --surface-2: #EEF5FC;
  --ink: #14213D;
  --text: #33405C;
  --muted: #55627E;
  --line: #D5E2EF;
  --line-strong: #AFC3D8;
  --accent: var(--blu);
  --link: var(--blu);
  --btn: var(--arancio);
  --btn-ink: #14213D;
  --save: var(--prato-scuro);
  --save-bg: var(--prato-chiaro);
  --warn-bg: #FFEDE3;
  --warn-ink: var(--arancio-scuro);
  --tip-bg: var(--prato-chiaro);
  --tip-ink: var(--prato-scuro);
  --focus: #0A5FB4;
  --hero-a: #2AA8FF;
  --hero-b: #8FD3FF;
  --hero-ink: #14213D;
  --hl: var(--sole);
  --tile-on: var(--cielo-chiaro);
  --asfalto: #3A4A70;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 10px 30px rgba(20, 33, 61, .10);

  --lg-bolla: #0A5FB4;
  --lg-cella: #2E86D6;
  --lg-maniglia: #8ED6FF;
  --lg-word: #14213D;

  --radius: 22px;
  --radius-sm: 14px;
  --font-head: 'Bricolage Grotesque', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-body: 'Inter', system-ui, 'Segoe UI', Roboto, Arial, sans-serif;
  color-scheme: light;
}

/* Tema scuro: solo se lo sceglie chi visita, col pulsante sole/luna in alto (assets/tema.js). Il sito parte sempre
   in chiaro, anche con il sistema in scuro: i colori vivaci rendono meglio su fondo chiaro. La scelta resta nel
   browser (localStorage, chiave "drittabox-tema") e uno script nel <head> la applica prima che la pagina si veda. */
:root[data-theme="scuro"] {
  --bg: #0D1530;
  --bg-tint: #111B3B;
  --surface: #17224A;
  --surface-2: #1E2C5A;
  --ink: #F4F7FF;
  --text: #CDD6EE;
  --muted: #A6B3D4;
  --line: #2B3B6E;
  --line-strong: #44589A;
  --accent: #7CCBFF;
  --link: #8FD3FF;
  --btn: #FF8A3D;
  --btn-ink: #14213D;
  --save: #5BE394;
  --save-bg: #123A2A;
  --warn-bg: #3A2214;
  --warn-ink: #FFB38A;
  --tip-bg: #123A2A;
  --tip-ink: #8CF0B5;
  --focus: #8FD3FF;
  --hero-a: #0E4C9A;
  --hero-b: #1B2F6B;
  --hero-ink: #FFFFFF;
  --tile-on: #1D3B78;
  --asfalto: #2C3A63;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px rgba(0, 0, 0, .35);
  --lg-bolla: #2AA8FF;
  --lg-cella: #0A5FB4;
  --lg-maniglia: #8ED6FF;
  --lg-word: #F4F7FF;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font-body);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: var(--font-head); color: var(--ink); line-height: 1.05; margin: 0; letter-spacing: -0.015em; }
p { margin: 0; }
a { color: var(--link); text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; } /* titoli che ricevono il focus via script dopo il calcolo */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--surface); color: var(--ink); padding: 8px 14px; border-radius: 10px; z-index: 50; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 860px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* Logo */
.lg-bolla { fill: var(--lg-bolla); stroke: var(--lg-bolla); }
.lg-cella { fill: var(--lg-cella); }
.lg-maniglia { fill: var(--lg-maniglia); }
.lg-word { stroke: var(--lg-word); }
.logo { display: block; height: 32px; width: auto; aspect-ratio: 448 / 96; }
.logo--footer { height: 30px; }

/* Barra in alto */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 16px; }
.brand { display: inline-flex; border-radius: 8px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav > a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: 999px; }
.nav > a:hover { background: var(--surface-2); }
.nav > a:not(.nav__cta) { display: none; }
@media (min-width: 860px) { .nav > a:not(.nav__cta) { display: inline-block; } }
.nav__cta { background: var(--btn); color: var(--btn-ink) !important; font-weight: 700 !important; }
.nav__cta:hover { background: var(--btn) !important; filter: brightness(1.05); }

/* Pulsante tema (sole/luna): visibile anche sul telefono, area da toccare 44×44 */
.tema { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0; margin: 0;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); color: var(--ink); cursor: pointer; }
.tema:hover { background: var(--surface-2); }
/* selettore «Stile» (../../assets/stile.css): stesso bordo del pulsante del tema */
:root { --stile-bordo: 1px solid var(--line-strong); }
/* Telefono: logo, selettore «Stile», tema e «Calcola» in una riga. Sotto i 400 px «Calcola» lascia il posto al
   selettore: il calcolatore è subito sotto la testata (e c'è il link «Vai al calcolatore» per la tastiera). */
@media (max-width: 420px) {
  .topbar__in { gap: 8px; }
  .topbar .logo { height: 26px; }
  .nav { gap: 4px; }
  .tema { width: 40px; height: 40px; }
  .nav__cta { padding: 8px 10px; font-size: 14px; }
}
@media (max-width: 399px) { .nav__cta { display: none !important; } }
.tema:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tema svg { width: 22px; height: 22px; display: block; }
/* l'icona mostra dove si va: la luna in chiaro (passa allo scuro), il sole in scuro (torna al chiaro) */
.tema .tema__sole { display: none; }
:root[data-theme="scuro"] .tema .tema__luna { display: none; }
:root[data-theme="scuro"] .tema .tema__sole { display: block; }

/* Testata: cielo, sole e una scena illustrata */
.hero { background: linear-gradient(160deg, var(--hero-a) 0%, var(--hero-b) 100%); color: var(--hero-ink); padding: 20px 0 60px; position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 26px; background: radial-gradient(60% 26px at 50% 100%, color-mix(in srgb, var(--bg) 70%, transparent), transparent); pointer-events: none; }
.hero__in { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "title title" "copy art"; gap: 10px 12px; align-items: end; }
.hero__title { grid-area: title; color: var(--hero-ink); font-size: clamp(32px, 8.4vw, 56px); font-weight: 800; }
.hl { background: var(--hl); color: #14213D; padding: 0 .14em; border-radius: .18em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.hero__copy { grid-area: copy; min-width: 0; }
/* aprendo un link a un risultato, il modulo vuoto non si vede per un attimo prima di essere riempito (index.html, data-apre) */
:root[data-apre] body > :not(.topbar) { visibility: hidden; }
.hero__art { grid-area: art; width: clamp(110px, 30vw, 270px); height: auto; justify-self: end; margin-bottom: -14px; }
/* La scena (disegnata in index.html): il sole respira, le nuvole scorrono, chi spedisce respira piano e il pacco gli
   dondola in mano,
   ogni tanto lo sportello del locker si chiude e si riapre. Il primo fotogramma è il disegno com'è. Gira solo mentre si
   vede e la scheda è in primo piano (../../assets/animazioni.js, classe is-ferma). */
[data-scena].is-ferma, [data-scena].is-ferma * { animation-play-state: paused !important; }
.vg-sole { transform-box: fill-box; transform-origin: center; animation: vg-sole 5s ease-in-out infinite; }
.vg-nuvola { animation: vg-nuvola 13s ease-in-out infinite; }
.vg-nuvola--2 { animation-duration: 17s; animation-direction: reverse; }
.vg-persona { animation: vg-respira 3.4s ease-in-out infinite; }
.vg-pacco { transform-box: fill-box; transform-origin: 85% 55%; animation: vg-dondola 3.4s ease-in-out infinite; } /* il pacco dondola piano nella mano */
.vg-sportello { transform-box: fill-box; transform-origin: right center; animation: vg-sportello 10s ease-in-out infinite; }
.vg-anta { transform-box: fill-box; transform-origin: left center; transform: scaleX(0); animation: vg-anta 10s ease-in-out infinite; }
@keyframes vg-sole { 0%, 100% { transform: none; } 50% { transform: scale(1.06); } }
@keyframes vg-nuvola { 0%, 100% { transform: none; } 50% { transform: translateX(16px); } }
@keyframes vg-dondola { 0%, 100% { transform: none; } 30% { transform: rotate(-3deg); } 70% { transform: rotate(2deg); } }
@keyframes vg-respira { 0%, 100% { transform: none; } 50% { transform: translateY(-1.5px); } }
@keyframes vg-sportello { 0%, 56%, 92%, 100% { transform: none; } 62%, 86% { transform: scaleX(0); } }
@keyframes vg-anta { 0%, 58%, 90%, 100% { transform: scaleX(0); } 64%, 84% { transform: none; } }
.lede { font-size: clamp(16px, 4.2vw, 18px); font-weight: 600; color: var(--hero-ink); }
.pills { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pills li { display: inline-flex; align-items: center; gap: 5px; background: color-mix(in srgb, var(--surface) 88%, transparent); color: var(--ink); font-size: 13.5px; font-weight: 600; padding: 5px 11px 5px 7px; border-radius: 999px; }
.pills svg { width: 18px; height: 18px; color: #fff; background: var(--prato-scuro); border-radius: 50%; padding: 2px; }
@media (min-width: 760px) {
  .hero { padding: 22px 0 70px; }
  .hero__in { grid-template-areas: "title art" "copy art"; column-gap: 32px; }
  .hero__title { align-self: end; }
  .hero__copy { align-self: start; }
  .hero__art { margin-bottom: -24px; }
}

/* Il modulo: due tappe (il pacco, il viaggio), poi il pulsante */
.calc-wrap { position: relative; z-index: 2; margin-top: -44px; }
.calc { padding: 18px 14px 20px; display: grid; gap: 20px; border: 0; }
@media (min-width: 640px) { .calc { padding: 22px 28px 24px; } }
.tappa { display: grid; gap: 12px; min-width: 0; }
.tappa__top { display: flex; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.tappa__head { display: flex; align-items: center; gap: 10px; font: 800 20px/1 var(--font-head); color: var(--ink); }
.tappa__n { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--sole); color: #14213D; font-size: 16px; }

.presets { border: 0; padding: 0; margin: 0; display: flex; align-items: center; gap: 10px; min-width: 0; }
.presets__img { width: 40px; height: auto; flex: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; min-width: 0; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--surface-2); color: var(--ink); font: 600 14px/1 var(--font-body); padding: 9px 14px; border-radius: 999px; cursor: pointer; }
.chip:hover { border-color: var(--line-strong); }
.chip[aria-pressed="true"] { background: var(--sole); color: #14213D; border-color: #E0AE00; }
.chip { transition: transform .18s cubic-bezier(.2, .8, .2, 1); }
.chip:active { transform: scale(.95); transition-duration: .15s; }

.dims { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
@media (min-width: 560px) { .dims { gap: 10px; } }
/* sul telefono, con un errore, due caselle per riga: il messaggio ha spazio per leggersi */
@media (max-width: 559px) { .dims:has(.has-err) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.field { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 5px; min-width: 0; } /* start: un errore lungo in un campo non allunga le caselle degli altri */
.field__label { font-size: 12.5px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.field__box { display: flex; align-items: center; min-width: 0; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); padding: 0 8px; transition: border-color .15s, background .15s; }
.field__box:focus-within { border-color: var(--focus); background: var(--surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.field__box input { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font: 700 19px/1 var(--font-body); padding: 12px 0; font-variant-numeric: tabular-nums; }
.field__box input::placeholder { color: var(--muted); opacity: .55; font-weight: 500; }
.unit { color: var(--muted); font-size: 13px; font-weight: 600; }
@media (min-width: 560px) { .field__box { padding: 0 12px; } .field__label { font-size: 13px; } }
.field.has-err .field__box { border-color: var(--warn-ink); background: var(--warn-bg); animation: vibra .32s ease both; }
@keyframes vibra { 20% { transform: translateX(-4px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.field__err { font-size: 12.5px; color: var(--warn-ink); font-weight: 600; }
.field__err:empty { display: none; }
.hint { font-size: 13.5px; color: var(--muted); }
/* 16px: sotto questa misura Safari su iPhone ingrandisce la pagina quando si tocca il menu. */
select { width: 100%; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); font: 500 16px var(--font-body); padding: 10px 12px; }

/* Il viaggio: partenza → strada col furgone → arrivo */
.trip { display: grid; gap: 4px; }
@media (min-width: 900px) { .trip { grid-template-columns: minmax(0, 1fr) minmax(150px, 220px) minmax(0, 1fr); gap: 10px; align-items: end; } }
.stop { border: 0; padding: 0; margin: 0; min-width: 0; }
.stop legend { font: 700 14px var(--font-body); color: var(--ink); margin-bottom: 8px; padding: 0; text-transform: uppercase; letter-spacing: .06em; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg label { position: relative; min-width: 0; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label > span { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; height: 100%; padding: 10px 6px 10px; border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; line-height: 1.2; text-align: center; cursor: pointer; transition: border-color .15s, background .15s, transform .18s cubic-bezier(.2, .8, .2, 1); }
.seg label > span img { width: 100%; max-width: 84px; height: auto; transition: transform .2s; }
.seg label > span:hover { border-color: var(--line-strong); }
.seg label > span:hover img { transform: translateY(-2px); }
@media (hover: hover) { .seg label > span:hover { transform: translateY(-2px); } }
.seg label:active > span { transform: scale(.97); transition-duration: .15s; } /* al tocco si schiaccia */
.seg input:checked + span { border-color: var(--cielo); background: var(--tile-on); box-shadow: 0 0 0 2px var(--cielo) inset; }
.seg input:checked + span::after { content: ''; position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--prato-scuro) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat; animation: scatta .32s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes scatta { from { opacity: 0; transform: scale(.2) rotate(-25deg); } } /* la spunta della scelta «scatta» */
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.road { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 6px 0 2px; min-width: 0; }
.road__van { width: 104px; height: auto; position: relative; z-index: 1; margin-bottom: -8px; }
.road__lane { position: relative; width: 100%; height: 20px; border-radius: 999px; background: repeating-linear-gradient(90deg, var(--sole) 0 14px, transparent 14px 26px) center / calc(100% - 28px) 3px no-repeat, var(--asfalto); }
.road__lane::before, .road__lane::after { content: ''; position: absolute; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--surface); border: 3px solid var(--cielo); }
.road__lane::before { left: 3px; }
.road__lane::after { right: 3px; }
@media (min-width: 900px) { .road { padding-bottom: 46px; } }

/* Quando c'è la dritta, la strada "si accende" (come una luce: si spegne un attimo e si riaccende), il furgone la
   percorre fino a metà e il fumetto dice corriere e prezzo */
.road__bubble { position: relative; display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin-bottom: 8px; padding: 8px 12px; border: 0; border-radius: 14px; background: var(--prato-scuro); color: #fff; font: 600 13px/1.2 var(--font-body); cursor: pointer; text-align: left; box-shadow: 0 6px 18px rgba(11, 110, 54, .3); animation: pop .35s ease-out both; }
.road__bubble::after { content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -8px; border: 8px solid transparent; border-bottom: 0; border-top-color: var(--prato-scuro); }
.road__bubble[hidden] { display: none; }
.road__bubble b { font: 800 18px/1 var(--font-head); white-space: nowrap; }
.road__bubble svg { width: 16px; height: 16px; }
.road__bubble span { min-width: 0; }
.trip.is-lit .road__lane { background: repeating-linear-gradient(90deg, #fff 0 14px, transparent 14px 26px) center / calc(100% - 28px) 3px no-repeat, var(--prato); box-shadow: 0 0 0 4px color-mix(in srgb, var(--prato) 30%, transparent); animation: accende .7s ease both; }
.trip.is-lit .road__lane::before, .trip.is-lit .road__lane::after { border-color: var(--prato-scuro); }
.trip.is-lit .road__van { animation: drive .8s cubic-bezier(.25, .7, .2, 1) both; }
.trip.is-stale .road__bubble { background: #55627E; box-shadow: none; }
.trip.is-stale .road__bubble::after { border-top-color: #55627E; }
.trip.is-stale .road__lane { background: repeating-linear-gradient(90deg, var(--sole) 0 14px, transparent 14px 26px) center / calc(100% - 28px) 3px no-repeat, var(--asfalto); box-shadow: none; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
@keyframes drive { from { transform: translateX(-40%); opacity: .3; } }
@keyframes accende { 0% { opacity: .35; } 30% { opacity: 1; } 45% { opacity: .65; } 100% { opacity: 1; } }

.calc__end { display: grid; gap: 12px; }
@media (min-width: 900px) { .calc__end { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 20px; } }
.more { border: 2px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.more summary { cursor: pointer; padding: 13px 14px; font-weight: 700; color: var(--ink); font-size: 15px; display: flex; gap: 8px; align-items: center; list-style: none; min-height: 52px; }
.more summary::-webkit-details-marker { display: none; }
.more summary svg { width: 20px; height: 20px; color: var(--accent); }
.more summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--muted); }
.more[open] summary::after { content: '–'; }
.more__sum { margin-left: auto; font-weight: 500; color: var(--muted); font-size: 13px; text-align: right; }
.more__grid { display: grid; gap: 12px; padding: 2px 14px 14px; }
@media (min-width: 560px) { .more__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.calc__go { display: grid; gap: 6px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 0; cursor: pointer; font: 800 18px/1 var(--font-head); padding: 17px 24px; border-radius: 16px; text-decoration: none; transition: transform .15s, filter .15s, box-shadow .15s; }
.btn svg { width: 22px; height: 22px; }
.btn:active { transform: translateY(2px); }
.btn--primary { background: var(--btn); color: var(--btn-ink); box-shadow: 0 4px 0 #C2410C; }
.btn--primary:active { box-shadow: 0 2px 0 #C2410C; }
.btn--primary:hover { filter: brightness(1.05); }
.btn--ghost { background: transparent; color: var(--ink); border: 2px solid var(--line-strong); font: 700 15px/1 var(--font-body); padding: 12px 16px; }
.btn--ghost:hover { background: var(--surface-2); }
.btn--block { width: 100%; }
.calc__foot { display: flex; justify-content: center; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 4px; }
.calc__foot svg { width: 15px; height: 15px; }

/* Risultato */
.results { padding: 28px 0 40px; scroll-margin-top: 68px; }
.results__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 14px; }
.results__head h2 { font-size: clamp(26px, 4vw, 34px); font-weight: 800; }
.results__meta { color: var(--muted); font-size: 14px; }
.res-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 980px) { .res-grid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: start; } }
.col { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }

.win { overflow: hidden; border: 3px solid var(--prato); }
.win__trip { display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; align-items: end; gap: 8px; padding: 16px 18px 14px; background: linear-gradient(160deg, var(--hero-a), var(--hero-b)); }
.win__trip > img { width: 72px; height: auto; }
.win__lane { position: relative; display: flex; justify-content: center; align-items: flex-end; height: 64px; }
.win__lane::after { content: ''; position: absolute; left: 0; right: 0; bottom: 6px; height: 12px; border-radius: 999px; background: repeating-linear-gradient(90deg, #fff 0 10px, transparent 10px 18px) center / calc(100% - 12px) 2px no-repeat, var(--prato); }
.win__lane img { position: relative; z-index: 1; width: 92px; height: auto; margin-bottom: 10px; }
.win__body { padding: 18px 18px 20px; }
@media (min-width: 520px) { .win__body { padding: 22px 26px 24px; } .win__trip { padding: 18px 26px 14px; grid-template-columns: 88px minmax(0, 1fr) 88px; } .win__trip > img { width: 88px; } }
.badge { display: inline-flex; align-items: center; gap: 6px; background: var(--sole); color: #14213D; font: 800 13px/1 var(--font-head); text-transform: uppercase; letter-spacing: .08em; padding: 7px 11px; border-radius: 999px; }
.badge svg { width: 15px; height: 15px; }
.win__top { display: flex; justify-content: space-between; gap: 8px 16px; align-items: flex-end; margin-top: 12px; flex-wrap: wrap; }
.win__top > div { flex: 1 1 220px; min-width: 0; }
.win__name { font-size: clamp(24px, 4vw, 32px); font-weight: 800; }
.win__via { color: var(--muted); font-size: 14px; margin-top: 4px; }
.dritta__price { font-family: var(--font-head); font-weight: 800; font-size: clamp(46px, 9vw, 64px); color: var(--ink); line-height: .95; white-space: nowrap; }
.dritta__price small { display: block; font: 600 13px var(--font-body); color: var(--muted); text-align: right; margin-top: 6px; }
.win__from { font-size: .42em; }
@media (max-width: 519px) { .dritta__price small { text-align: left; } }
.legs { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 16px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.legs__k { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.legs__k svg { width: 16px; height: 16px; }
.legs__v { color: var(--ink); font-weight: 600; font-size: 14.5px; margin-top: 2px; overflow-wrap: anywhere; }
.legs__arrow { width: 22px; height: 22px; color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--ink); background: var(--surface-2); padding: 6px 10px; border-radius: 999px; }
.tag svg { width: 16px; height: 16px; color: var(--accent); }
.tag--save { background: var(--save-bg); color: var(--save); }
.tag--save svg { color: var(--save); }
.notes { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.note { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; padding: 10px 12px; border-radius: 12px; }
.note svg { width: 18px; height: 18px; margin-top: 1px; }
.note--tip { background: var(--tip-bg); color: var(--tip-ink); }
.note--warn { background: var(--warn-bg); color: var(--warn-ink); }
.note--info { background: var(--surface-2); color: var(--text); }
.win__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.win__actions .btn--primary { flex: 1 1 220px; }
.verifica { display: flex; gap: 6px; align-items: flex-start; margin: 12px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.verifica svg { flex: none; width: 15px; height: 15px; margin-top: 1px; }
.verifica--check { color: var(--warn-ink); font-weight: 600; }
.why-box { margin-top: 12px; }
.why-box summary, .drawer summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; }
.why-box summary::-webkit-details-marker, .drawer summary::-webkit-details-marker { display: none; }
.why-box summary { color: var(--link); font-weight: 700; font-size: 14.5px; padding: 6px 0; }
.why-box summary::after, .drawer summary::after { content: '+'; font-size: 22px; line-height: 1; color: var(--muted); margin-left: auto; }
.why-box summary::after { margin-left: 0; font-size: 18px; color: inherit; }
.why-box[open] summary::after, .drawer[open] summary::after { content: '–'; }
.why { font-size: 15px; color: var(--ink); margin-top: 4px; }

.panel { padding: 20px 18px; }
@media (min-width: 520px) { .panel { padding: 22px 24px; } }
.panel h3 { font-size: 21px; font-weight: 800; }
.panel__sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.saving { border-top: 6px solid var(--prato); }
.saving__big { font-family: var(--font-head); font-weight: 800; font-size: clamp(40px, 6vw, 52px); color: var(--save); line-height: 1; margin-top: 12px; }
.saving__big small { font-size: .42em; font-weight: 700; }
.saving__msg { color: var(--ink); margin-top: 8px; font-size: 15px; }
.bars { display: grid; gap: 12px; margin-top: 16px; }
.bar__top { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); font-weight: 600; }
.bar__lbl { display: inline-flex; align-items: center; gap: 4px; }
.bar__lbl svg { width: 18px; height: 18px; color: var(--accent); }
.bar__top b { white-space: nowrap; font-size: 15px; }
.bar__sub { font-size: 12.5px; color: var(--muted); }
.bar__track { height: 14px; border-radius: 999px; background: var(--surface-2); margin-top: 6px; overflow: hidden; }
.bar__fill { height: 100%; border-radius: 999px; background: var(--line-strong); transform-origin: left; animation: grow .6s ease-out both; }
.bar--win .bar__fill { background: var(--prato); }
@keyframes grow { from { transform: scaleX(0); } }

.market { border-left: 6px solid var(--sole); }
.market p + p { margin-top: 8px; }
.counter { display: flex; gap: 12px; align-items: flex-start; background: var(--sole-chiaro); border-color: transparent; color: #14213D; }
.counter svg { width: 26px; height: 26px; color: #8A5A00; }
.counter p, .counter b { color: #14213D; }
.share { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.share p { color: var(--ink); font-weight: 600; }
.toast { font-size: 13.5px; color: var(--save); font-weight: 700; }

/* Cassetti del risultato: si aprono a richiesta */
.drawers { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 16px; }
.drawer { padding: 0; min-width: 0; }
.drawer > summary { padding: 16px 18px; min-height: 60px; }
.drawer__ic { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; flex: none; }
.drawer__ic svg { width: 20px; height: 20px; }
.drawer__t { flex: 1; min-width: 0; font: 800 18px/1.15 var(--font-head); color: var(--ink); }
.drawer__s { font-size: 13.5px; color: var(--muted); font-weight: 600; text-align: right; }
.drawer__body { padding: 0 18px 18px; }
@media (min-width: 520px) { .drawer > summary { padding: 16px 22px; } .drawer__body { padding: 0 22px 22px; } }

.fit { list-style: none; padding: 0; margin: 4px 0 0; display: grid; gap: 8px; }
@media (min-width: 620px) { .fit { grid-template-columns: 1fr 1fr; } }
.fit li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); font-size: 14px; }
.fit svg { width: 22px; height: 22px; padding: 3px; border-radius: 50%; }
.fit .yes svg { color: #fff; background: var(--prato-scuro); }
.fit .no svg { color: var(--warn-ink); background: var(--warn-bg); }
.fit b { color: var(--ink); display: block; font-weight: 600; }
.fit small { color: var(--muted); font-size: 12.5px; }
.fit__vol { margin-top: 12px; font-size: 13.5px; color: var(--muted); }

.alts { display: grid; gap: 10px; }
.alt { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 14px; border-radius: var(--radius-sm); border: 2px solid var(--line); background: var(--surface); text-decoration: none; color: inherit; }
.alt:hover { border-color: var(--cielo); }
.alt__name { font-weight: 700; color: var(--ink); }
.alt__price { font-family: var(--font-head); font-weight: 800; font-size: 21px; color: var(--ink); text-align: right; white-space: nowrap; }
.alt__sub { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.alt__tag { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--warn-bg); color: var(--warn-ink); margin-left: 6px; vertical-align: 1px; }

.table-wrap { margin-top: 12px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 560px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: var(--surface-2); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-weight: 700; color: var(--ink); white-space: nowrap; }
tr.is-best td { background: var(--tip-bg); }
tr.is-off td { color: var(--muted); }
.svc { font-weight: 600; color: var(--ink); }
.svc small { display: block; font-weight: 400; color: var(--muted); }
/* Telefono: la tabella di «Tutte le opzioni» diventa un elenco di schede (servizio e prezzo in alto, poi percorso e
   tempi), come nello stile principale: niente prezzi nascosti a destra da far scorrere di lato. I ruoli nel codice
   (role="table", "row", "cell") la tengono una tabella per i lettori di schermo; le intestazioni restano per loro. */
@media (max-width: 599px) {
  .table-wrap { overflow: visible; border: 0; border-radius: 0; }
  table.opts { min-width: 0; display: block; }
  table.opts thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  table.opts tbody { display: grid; gap: 8px; }
  table.opts tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
  table.opts tr[hidden] { display: none; }
  table.opts td { display: block; padding: 0; border: 0; min-width: 0; background: none; }
  table.opts td:nth-child(1) { grid-column: 1; grid-row: 1; }
  table.opts td.num { grid-column: 2; grid-row: 1; font: 800 19px/1.1 var(--font-head); align-self: start; }
  table.opts td:nth-child(2), table.opts td:nth-child(3) { grid-column: 1 / -1; font-size: 14px; }
  table.opts td:nth-child(2)::before, table.opts td:nth-child(3)::before { content: attr(data-label) " "; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-right: 4px; }
  table.opts tr.is-best { border: 2px solid var(--accent); background: var(--tip-bg); }
}
.filters { display: flex; flex-wrap: wrap; gap: 8px; }
.excluded { margin-top: 12px; font-size: 13.5px; }
.excluded summary { cursor: pointer; color: var(--link); font-weight: 600; }
.excluded ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); display: grid; gap: 4px; }

.empty { padding: 26px 20px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.empty img { width: 96px; }
.empty h3 { font-size: 22px; }

/* Buono a sapersi: le spiegazioni lunghe, chiuse finché non servono */
.info { padding: 40px 0 56px; }
.info__title { font-size: clamp(26px, 4.4vw, 36px); font-weight: 800; }
.acc { display: grid; gap: 10px; margin-top: 18px; }
.acc__item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); scroll-margin-top: 76px; }
.acc__item > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 12px; padding: 12px 16px; min-height: 60px; font: 800 18px/1.15 var(--font-head); color: var(--ink); }
.acc__item > summary::-webkit-details-marker { display: none; }
.acc__item > summary::after { content: '+'; margin-left: auto; font-size: 24px; line-height: 1; color: var(--muted); font-family: var(--font-body); font-weight: 400; }
.acc__item[open] > summary::after { content: '–'; }
.acc__ic, .drawer__ic { color: #14213D; }
.acc__ic { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex: none; }
.acc__ic svg { width: 22px; height: 22px; }
.acc__ic--cielo, .drawer__ic--cielo { background: #8FD3FF; }
.acc__ic--sole, .drawer__ic--sole { background: var(--sole); }
.acc__ic--prato, .drawer__ic--prato { background: #7EE2A6; }
.acc__ic--arancio, .drawer__ic--arancio { background: #FFB37A; }
.acc__ic--blu { background: #B9D6FF; }
.acc__body { padding: 0 16px 18px; display: grid; gap: 12px; }
@media (min-width: 600px) { .acc__body { padding: 0 22px 22px; } .acc__item > summary { padding: 12px 22px; } }
.howto { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 600px) { .howto { grid-template-columns: repeat(3, 1fr); } }
.howto li { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); }
.howto img { height: 64px; width: auto; margin-bottom: 4px; }
.howto b { color: var(--ink); font-family: var(--font-head); font-size: 17px; }
.howto span { font-size: 14px; }
.facts { display: grid; gap: 10px; }
@media (min-width: 600px) { .facts { grid-template-columns: repeat(2, 1fr); } }
.fact { padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); display: flex; flex-direction: column; gap: 6px; }
.fact__big { font: 800 34px/1 var(--font-head); color: var(--save); }
.fact h3 { font-size: 17px; }
.fact p:not(.fact__big) { font-size: 14.5px; }
.src { font-size: 13px; margin-top: auto; padding-top: 4px; }
.money { font-size: 15.5px; }
.money b { color: var(--ink); }
.faq { gap: 8px; }
.faq details { background: var(--surface-2); border-radius: 12px; padding: 0 14px; }
.faq summary { cursor: pointer; padding: 13px 0; font-weight: 600; color: var(--ink); list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; color: var(--muted); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq p { padding: 0 0 14px; font-size: 15px; }

.sources { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.sources li { display: flex; justify-content: space-between; gap: 6px 12px; padding: 11px 14px; background: var(--surface-2); border-radius: 12px; font-size: 14.5px; flex-wrap: wrap; }
.legal .sources li { background: var(--surface); border: 1px solid var(--line); }
.sources b { color: var(--ink); }
.sources__svc { display: grid; gap: 3px; min-width: 0; flex: 1 1 220px; }
.sources small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.sources small.is-check { color: var(--warn-ink); }
.sources a { align-self: flex-start; overflow-wrap: anywhere; }
/* Storico dei prezzi: discreto, sotto l'elenco delle fonti (lo scrive app.js da assets/storico-prezzi.js) */
.storico { font-size: 14px; color: var(--muted); }
.storico summary { cursor: pointer; color: var(--link); font-weight: 600; }
.storico p { margin: 8px 0 0; line-height: 1.5; }
.storico ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 6px; line-height: 1.45; }
.storico b { color: var(--ink); font-weight: 600; }
.storico small { display: block; font-size: 13px; }
.storico a { overflow-wrap: anywhere; }

.footer { border-top: 1px solid var(--line); padding: 32px 0; background: var(--surface); }
.footer__in { display: grid; gap: 18px; }
@media (min-width: 820px) { .footer__in { grid-template-columns: auto 1fr; gap: 48px; align-items: center; } }
.footer__tag { margin-top: 8px; color: var(--ink); font-weight: 600; }
.footer__small { font-size: 13px; color: var(--muted); max-width: 640px; }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 10px; font-size: 14px; }
.footer__links a { color: var(--ink); font-weight: 600; }

/* Pagine di testo (privacy.html, note-legali.html): una colonna leggibile, stessi titoli e card della pagina */
.legal { padding: 40px 0 64px; }
@media (min-width: 720px) { .legal { padding: 56px 0 80px; } }
.legal h1 { font-size: clamp(34px, 7vw, 52px); font-weight: 800; }
.legal__meta { margin-top: 10px; color: var(--muted); font-size: 14px; }
.legal__brief { padding: 20px 22px; margin-top: 24px; display: grid; gap: 10px; border-top: 6px solid var(--cielo); }
.legal__brief ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.legal__brief b, .legal b { color: var(--ink); }
.legal h2 { font-size: clamp(22px, 4vw, 28px); font-weight: 700; margin-top: 40px; scroll-margin-top: 80px; }
.legal h3 { font-size: 18px; font-weight: 700; margin-top: 22px; }
.legal p, .legal ul, .legal ol { margin: 12px 0 0; }
.legal ul, .legal ol { padding-left: 22px; display: grid; gap: 6px; }
.legal .sources { padding-left: 0; }
.legal a { overflow-wrap: anywhere; }
.legal__toc { margin-top: 20px; font-size: 15px; }
.legal__toc ol { margin-top: 6px; }

/* Animazioni del risultato (solo transform e opacity): la scheda della dritta sale, il furgone percorre la strada
   in cima alla scheda, il badge e il risparmio compaiono con un piccolo rimbalzo, poi le altre sezioni una dopo
   l'altra. Il prezzo conta (../../assets/animazioni.js). Con prefers-reduced-motion: reduce le spegne la regola in cima. */
.results__head { animation: appare .3s ease both; }
.win, .results .empty { animation: sale .45s cubic-bezier(.2, .8, .2, 1) both; }
.win__lane img { animation: attraversa 1s cubic-bezier(.25, .7, .2, 1) .15s both; }
.win .badge { transform-origin: left center; animation: rimbalzo .45s cubic-bezier(.3, 1.5, .5, 1) .3s both; }
.tag--save, .saving__big { transform-origin: left center; animation: rimbalzo .5s cubic-bezier(.3, 1.5, .5, 1) .55s both; }
.res-grid > .col:last-child > *, .drawers > * { animation: sale .4s cubic-bezier(.2, .8, .2, 1) both; animation-delay: calc(.12s + var(--n, 0) * .07s); }
.res-grid > .col:last-child > :nth-child(2) { --n: 1; }
.res-grid > .col:last-child > :nth-child(3) { --n: 2; }
.res-grid > .col:last-child > :nth-child(n+4) { --n: 3; }
.drawers > * { --n: 4; }
.drawers > :nth-child(2) { --n: 5; }
.drawers > :nth-child(n+3) { --n: 6; }
.drawer[open] > .drawer__body, .acc__item[open] > .acc__body, .more[open] > .more__grid { animation: appare .25s ease both; }
@keyframes appare { from { opacity: 0; } }
@keyframes sale { from { opacity: 0; transform: translateY(14px); } }
@keyframes rimbalzo { 0% { opacity: 0; transform: scale(.6); } 60% { opacity: 1; transform: scale(1.08); } 100% { opacity: 1; transform: none; } }
@keyframes attraversa { 0% { opacity: 0; transform: translateX(-150%); } 30% { opacity: 1; } 100% { opacity: 1; transform: none; } }
/* il prezzo che conta: il numero vero resta al suo posto (invisibile durante il conteggio, ma letto, copiato e
   stampato), sopra c'è la copia che conta, sulla stessa riga */
.conta { position: relative; display: inline-block; }
.conta__finto { position: absolute; top: 0; left: 0; right: 0; text-align: right; white-space: nowrap; pointer-events: none; -webkit-user-select: none; user-select: none; }
.conta.is-conta > .conta__vero { opacity: 0; }

/* Stampa: la dritta su carta, senza menu, modulo e pulsanti. Sempre in chiaro. app.js apre i cassetti prima di stampare. */
@media print {
  :root, :root[data-theme="scuro"] {
    --bg: #fff; --bg-tint: #fff; --surface: #fff; --surface-2: #F1F5FA; --ink: #14213D; --text: #222; --muted: #555;
    --line: #ccc; --line-strong: #999; --accent: #0A5FB4; --link: #0A5FB4; --save: #0B6E36; --save-bg: #fff;
    --warn-bg: #fff; --warn-ink: #8A2F06; --tip-bg: #fff; --tip-ink: #0B6E36; --shadow: none;
    --hero-a: #fff; --hero-b: #fff; --hero-ink: #14213D;
    --lg-bolla: #0A5FB4; --lg-cella: #2E86D6; --lg-maniglia: #8ED6FF; --lg-word: #14213D;
    color-scheme: light;
  }
  body { font-size: 11pt; background: #fff; }
  /* niente animazioni sulla carta: tutto al suo posto, il prezzo vero e non quello che conta */
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .conta__finto { display: none !important; }
  .conta.is-conta > .conta__vero { opacity: 1; }
  .topbar, .skip, .chips, .filters, .share, .btn, .footer .logo, .road__bubble, .hero__art, .win__trip, .why-box > summary, .drawer > summary::after { display: none !important; }
  body.has-result .hero, body.has-result .calc-wrap, body.has-result .info { display: none; }
  .results { padding: 0; }
  .res-grid { grid-template-columns: 1fr !important; }
  .card { box-shadow: none; break-inside: avoid; }
  .drawer:has(table) { break-inside: auto; } /* la tabella è più lunga di una pagina: niente pagine quasi vuote */
  .table-wrap { overflow: visible; border: 0; }
  table { min-width: 0; }
  th { position: static; }
  a { color: inherit; text-decoration: none; }
}
