/**
 * Insurek — foglio di stile.
 *
 * Stesso sistema visivo di lucalevi.com e di lucalevi's way: gli stessi token
 * HSL a saturazione zero, la stessa scala tipografica, EB Garamond per i
 * titoli e Inter per il resto, raggio 2px. Nessun colore, mai: la gerarchia
 * la fanno il nero, il grigio e lo spazio.
 *
 * Quello che qui e' diverso, e deve esserlo: Insurek non e' una pagina che si
 * legge, e' uno strumento che si usa. Quindi c'e' una parte che negli altri
 * due siti non serve — campi, tabelle, un grafico — e il ritmo verticale e'
 * piu' stretto: chi arriva vuole una risposta, non una passeggiata.
 *
 * Il segno grafico e' suo: due linee di costo che si incrociano. Sulla stessa
 * famiglia degli altri (una linea sola, tratto sottile, grigio) ma figura
 * diversa: i cerchi concentrici restano di way, il meandro di lucalevi.com.
 */

/* ------------------------------------------------------------------ token */
:root {
  --background: 0 0% 100%;
  --foreground: 0 0% 8%;
  --muted: 0 0% 96%;
  --muted-foreground: 0 0% 42%;
  --border: 0 0% 88%;
  --hairline: 0 0% 80%;
  --ink: 0 0% 6%;
  --ink-foreground: 0 0% 96%;
  --ink-muted: 0 0% 62%;
  --accent-surface: 0 0% 93%;
  --ring: 0 0% 20%;
  /* Bordi dei controlli (campi, tessere): 3,3:1 sul bianco, il minimo che
     WCAG 1.4.11 chiede perche' un campo si riconosca come campo. --border e
     --hairline restano per le linee decorative. */
  --control-border: 0 0% 56%;
  --radius: 2px;

  --font-display: "EB Garamond", "EB Garamond Riserva", "EB Garamond Riserva Android", Georgia, "Times New Roman", serif;
  --font-sans: Inter, "Inter Riserva", "Inter Riserva Android", system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --ease-editorial: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* La testata resta ferma in cima: senza questo spazio, l'elemento raggiunto
   col tasto Tab puo' finirci sotto (WCAG 2.4.11). */
html { scroll-padding-top: 5.5rem; scroll-padding-bottom: 1.5rem; }

body {
  margin: 0;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  font-family: var(--font-sans);
  overflow-x: clip;
  font-feature-settings: "ss01" 1, "cv11" 1;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}


h1, h2, h3 { font-family: var(--font-display); font-weight: 400; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2.25rem, 7vw, 4.5rem); line-height: 0.95; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.75rem, 4.5vw, 2.75rem); line-height: 1.06; letter-spacing: -0.02em; }
h3 { font-size: clamp(1.1rem, 2.4vw, 1.4rem); line-height: 1.25; letter-spacing: -0.01em; }

p { margin: 0; }
img, svg { max-width: 100%; }
ul { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }

:where(a, button, input, select, [tabindex]):focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: var(--radius);
}
.section-ink :where(a, button, [tabindex]):focus-visible { outline-color: hsl(var(--ink-foreground)); }

::selection { background: hsl(var(--foreground)); color: hsl(var(--background)); }
.section-ink ::selection { background: hsl(var(--ink-foreground)); color: hsl(var(--ink)); }

[hidden] { display: none !important; }

/* -------------------------------------------------------------- primitive */
.container-editorial {
  margin-inline: auto;
  width: 100%;
  max-width: 72rem;
  padding-inline: 1.25rem;
}
@media (min-width: 640px)  { .container-editorial { padding-inline: 2rem; } }
@media (min-width: 1024px) { .container-editorial { padding-inline: 3rem; } }

.container-stretto { max-width: 46rem; }

.section-rhythm { padding-block: 3rem; }
@media (min-width: 640px)  { .section-rhythm { padding-block: 3.75rem; } }
@media (min-width: 1024px) { .section-rhythm { padding-block: 4.5rem; } }

.section-ink { background: hsl(var(--ink)); color: hsl(var(--ink-foreground)); position: relative; }

.eyebrow {
  font-family: var(--font-sans);
  text-transform: uppercase;
  font-size: 0.8125rem;
  letter-spacing: 0.22em;
  line-height: 1;
}
/* line-height: 1 va bene finche' l'occhiello sta su una riga, ed e' voluto:
   e' un'etichetta, non un paragrafo. Ma quando va a capo le due righe si
   toccano — succede nei risultati a 390 px, dove «La combinazione che costa
   meno nella tua zona» sta su due righe. Sotto i 640 px si da' aria: dove
   l'occhiello resta su una riga il riquadro cresce di 4 px e non si vede,
   dove va a capo si legge. */
@media (max-width: 40rem) {
  .eyebrow { line-height: 1.45; }
}
.eyebrow.muted { color: hsl(var(--muted-foreground)); }
.eyebrow.ink-muted { color: hsl(var(--ink-muted)); }

.numeral { font-family: var(--font-display); line-height: 1; font-variant-numeric: tabular-nums; }
.cifra { font-variant-numeric: tabular-nums; }

.link-underline {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  text-decoration-color: hsl(var(--hairline));
  transition: text-decoration-color 180ms var(--ease-editorial);
}
.link-underline:hover { text-decoration-color: currentColor; }

.testo-secondario { color: hsl(var(--muted-foreground)); font-size: 0.9375rem; line-height: 1.6; }
.prosa { font-size: 1rem; line-height: 1.7; max-width: 42rem; }
.prosa + .prosa { margin-top: 1rem; }
.prosa p + p { margin-top: 1rem; }

.skip-link { position: absolute; left: -9999px; z-index: 100; }
.skip-link:focus {
  left: 1rem; top: 1rem;
  background: hsl(var(--ink)); color: hsl(var(--ink-foreground));
  padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.875rem;
}

.grain {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0.04; mix-blend-mode: overlay; pointer-events: none;
}

/* ----------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 50; width: 100%; height: 4rem;
  background: hsl(var(--background) / 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 180ms var(--ease-editorial);
}
.site-header[data-bordered="true"] { border-bottom-color: hsl(var(--hairline)); }
.header-row { display: flex; height: 100%; align-items: center; justify-content: space-between; gap: 0.75rem; }

.wordmark-link { display: flex; align-items: baseline; gap: 0.5rem; min-height: 44px; text-decoration: none; }
.wordmark { font-family: var(--font-display); letter-spacing: -0.02em; font-size: 1.25rem; }
.wordmark-nota { font-size: 0.8125rem; letter-spacing: 0.18em; text-transform: uppercase; color: hsl(var(--muted-foreground)); }
@media (max-width: 30rem) { .wordmark-nota { display: none; } }

.header-nav { display: none; gap: 1.5rem; }
@media (min-width: 700px) { .header-nav { display: flex; } }
.header-nav a {
  font-size: 0.8125rem; letter-spacing: 0.02em;
  color: hsl(var(--muted-foreground)); text-decoration: none;
  min-height: 44px; display: inline-flex; align-items: center;
  transition: color 180ms var(--ease-editorial);
}
.header-nav a:hover { color: hsl(var(--foreground)); }

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

/* Ritorno al sito padre. Sempre visibile, anche sul telefono: e' l'unica via
   da insurek.lucalevi.com verso www.lucalevi.com. */
.risali {
  display: inline-flex; align-items: center; gap: 0.35rem;
  min-height: 44px; flex-shrink: 0;
  font-size: 0.8125rem; letter-spacing: 0.02em; white-space: nowrap;
  color: hsl(var(--muted-foreground)); text-decoration: none;
  transition: color 180ms var(--ease-editorial);
}
.risali:hover { color: hsl(var(--foreground)); text-decoration: underline; text-underline-offset: 3px; }
.risali .freccia { font-size: 0.95em; line-height: 1; }
/* Sotto i 24rem restano soltanto Insurek, la freccia e i quattro bottoni della
   lingua: il dominio si accorcia invece di mandare la riga a capo. */
@media (max-width: 24rem) {
  .header-side { gap: 0.5rem; }
  .risali { font-size: 0.8125rem; gap: 0.2rem; }
}

/* ------------------------------------------------------------ lingue */
/* I quattro dell'interruttore sono <a>, non <button>: da settembre 2026 ogni
   lingua ha un indirizzo suo (/ /de/ /fr/ /en/), cosi' si possono condividere
   e i motori di ricerca li seguono. */
.lang-switch { display: flex; align-items: center; gap: 0.125rem; }
.lang-switch a { text-decoration: none; display: inline-flex; align-items: center; }
.lang-switch button,
.lang-switch a {
  appearance: none; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 0.8125rem; letter-spacing: 0.08em;
  color: hsl(var(--muted-foreground));
  padding: 0.5rem 0.375rem; min-height: 44px; min-width: 24px; justify-content: center;
  transition: color 180ms var(--ease-editorial);
}
.lang-switch button:hover,
.lang-switch a:hover { color: hsl(var(--foreground)); }
.lang-switch button[aria-pressed="true"],
.lang-switch a[aria-current="true"] { color: hsl(var(--foreground)); text-decoration: underline; text-underline-offset: 4px; }

/* ------------------------------------------------------------------- hero */
.hero { overflow: hidden; }
.hero-inner { position: relative; z-index: 2; padding-block: 4rem 3.5rem; }
@media (min-width: 1024px) { .hero-inner { padding-block: 5.5rem 5rem; } }
.hero h1 { margin-top: 1.25rem; max-width: 20ch; }
.hero h1 em { font-style: italic; color: hsl(var(--ink-muted)); }
.hero-sommario { margin-top: 1.75rem; max-width: 46ch; color: hsl(var(--ink-muted)); font-size: 1.0625rem; line-height: 1.65; }
/* Collegamenti da soli, fuori da una frase: alti 44 px, da prendere col dito. */
.link-tocco { display: inline-flex; align-items: center; min-height: 44px; }

.hero-azioni { margin-top: 2.25rem; display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }

/* Il segno: due curve di costo che si incrociano. */
.hero-incrocio {
  position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 2rem; opacity: 0.5; pointer-events: none;
}
.hero-incrocio svg { width: min(46rem, 78%); height: auto; }
@media (max-width: 900px) { .hero-incrocio { opacity: 0.22; justify-content: center; padding: 0; } }

/* ---------------------------------------------------------------- bottoni */
.btn {
  appearance: none; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 46px; padding: 0.75rem 1.5rem;
  font-size: 0.9375rem; letter-spacing: 0.01em;
  border-radius: var(--radius);
  border: 1px solid hsl(var(--foreground));
  background: hsl(var(--foreground)); color: hsl(var(--background));
  transition: opacity 180ms var(--ease-editorial);
  text-decoration: none;
}
.btn:hover { opacity: 0.82; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-chiaro { background: hsl(var(--ink-foreground)); color: hsl(var(--ink)); border-color: hsl(var(--ink-foreground)); }
.btn-fantasma { background: none; color: inherit; border-color: hsl(var(--hairline)); }

/* ------------------------------------------------------------------ campi */
.campi { display: grid; gap: 2.25rem; }

.campo > label,
.campo > .campo-titolo {
  display: block;
  font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.16em;
  color: hsl(var(--muted-foreground)); margin-bottom: 0.75rem;
}
.campo-aiuto:empty { margin: 0; }
.campo-aiuto { margin-top: 0.625rem; font-size: 0.875rem; line-height: 1.55; color: hsl(var(--muted-foreground)); }

input[type="text"], input[type="number"], input[type="search"], select {
  appearance: none; font-family: inherit; font-size: 1rem;
  width: 100%; max-width: 26rem;
  padding: 0.75rem 0.875rem; min-height: 48px;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--control-border));
  border-radius: var(--radius);
  transition: border-color 180ms var(--ease-editorial);
}
input:hover, select:hover { border-color: hsl(var(--foreground)); }
input[aria-invalid="true"] { border-color: hsl(var(--foreground)); border-width: 2px; }
/* L'esempio nel campo si deve poter leggere: 4,6:1 */
input::placeholder { color: hsl(var(--muted-foreground)); opacity: 1; }
/* La crocetta nativa dei campi di ricerca e' azzurra: qui non ci sono colori,
   e a svuotare il campo c'e' gia' il bottone «cambia». */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }
/* Anche le frecce dei campi numerici sono rumore su una cifra che si scrive. */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
select {
  background-image: linear-gradient(45deg, transparent 50%, hsl(var(--muted-foreground)) 50%),
                    linear-gradient(135deg, hsl(var(--muted-foreground)) 50%, transparent 50%);
  background-position: right 1.05rem center, right 0.75rem center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.25rem;
}

/* Ricerca del NPA con i suggerimenti */
.cerca { position: relative; max-width: 26rem; }
.suggerimenti {
  position: absolute; z-index: 30; inset-inline: 0; top: calc(100% + 2px);
  background: hsl(var(--background));
  border: 1px solid hsl(var(--hairline));
  border-radius: var(--radius);
  max-height: 17rem; overflow-y: auto;
  box-shadow: 0 12px 28px hsl(0 0% 0% / 0.08);
}
.suggerimenti li { border-top: 1px solid hsl(var(--border)); }
.suggerimenti li:first-child { border-top: 0; }
.suggerimenti [role="option"] {
  cursor: pointer;
  font-size: 0.9375rem;
  padding: 0.6875rem 0.875rem;
  display: flex; justify-content: space-between; gap: 1rem; align-items: baseline;
}
.suggerimenti [role="option"]:hover { background: hsl(var(--muted)); }
/* La voce scelta con le frecce: sfondo e una barra a sinistra, che si vede
   anche senza distinguere i grigi. */
.suggerimenti [role="option"][aria-selected="true"] {
  background: hsl(var(--muted));
  box-shadow: inset 3px 0 0 hsl(var(--foreground));
}
.suggerimenti .luogo-npa { font-variant-numeric: tabular-nums; color: hsl(var(--muted-foreground)); font-size: 0.8125rem; }
.suggerimenti .luogo-regione { color: hsl(var(--muted-foreground)); font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase; }

.scelto {
  display: inline-flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border: 1px solid hsl(var(--control-border));
  background: hsl(var(--muted));
  border-radius: var(--radius);
  font-size: 0.9375rem;
}
.scelto button {
  appearance: none; border: 0; background: none; cursor: pointer;
  font-family: inherit; font-size: 0.8125rem; color: hsl(var(--muted-foreground));
  text-decoration: underline; text-underline-offset: 3px; padding: 0.25rem 0.375rem;
  min-height: 24px; min-width: 24px;
}
.scelto button:hover { color: hsl(var(--foreground)); }

/* Scelte a tessere: le fasce di spesa, la copertura infortuni */
.tessere { display: grid; gap: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tessere { grid-template-columns: repeat(3, 1fr); } }
.tessere.due { grid-template-columns: 1fr; }
@media (min-width: 640px) { .tessere.due { grid-template-columns: repeat(2, 1fr); max-width: 40rem; } }

.tessera {
  appearance: none; cursor: pointer; font-family: inherit; text-align: left;
  display: flex; flex-direction: column; gap: 0.375rem;
  padding: 1rem 1.125rem;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--control-border));
  border-radius: var(--radius);
  position: relative;
  transition: border-color 180ms var(--ease-editorial), background 180ms var(--ease-editorial);
}
.tessera:hover { border-color: hsl(var(--foreground)); }
/* La tessera scelta si riconosce da tre cose, non dal solo grigio: bordo nero
   di 2 px (il secondo pixel e' un'ombra interna, cosi' il testo non si sposta),
   sfondo, e il segno di spunta in alto a destra. */
.tessera[aria-pressed="true"] {
  border-color: hsl(var(--foreground));
  box-shadow: inset 0 0 0 1px hsl(var(--foreground));
  background: hsl(var(--accent-surface));
  padding-right: 2.5rem;
}
.tessera[aria-pressed="true"]::after {
  content: "\2713";
  content: "\2713" / "";   /* il segno si vede, ma non si legge: lo stato lo dice aria-pressed */
  position: absolute; top: 0.75rem; right: 0.875rem;
  font-size: 1rem; line-height: 1; color: hsl(var(--foreground));
}
.tessera-titolo { font-size: 0.9375rem; letter-spacing: -0.005em; }
.tessera-nota { font-size: 0.875rem; line-height: 1.5; color: hsl(var(--muted-foreground)); }

/* Le opzioni avanzate, chiuse per default */
.dettagli { border-top: 1px solid hsl(var(--border)); padding-top: 1.5rem; }
.dettagli > summary {
  cursor: pointer; list-style: none;
  font-size: 0.8125rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: hsl(var(--muted-foreground));
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px;
}
.dettagli > summary::-webkit-details-marker { display: none; }
.dettagli > summary::after { content: "+"; font-size: 1rem; }
.dettagli[open] > summary::after { content: "\2212"; }
.dettagli > summary:hover { color: hsl(var(--foreground)); }
.dettagli-corpo { padding-top: 1.5rem; display: grid; gap: 1.75rem; }

.caselle { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.casella { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.9375rem; cursor: pointer; min-height: 44px; }
.casella input { width: 1.25rem; height: 1.25rem; min-height: 0; accent-color: hsl(var(--foreground)); cursor: pointer; }

/* --------------------------------------------------------------- risposta */
.risposta { border: 1px solid hsl(var(--foreground)); border-radius: var(--radius); overflow: hidden; }
.risposta-testa { background: hsl(var(--ink)); color: hsl(var(--ink-foreground)); padding: 1.75rem 1.5rem 1.5rem; }
@media (min-width: 640px) { .risposta-testa { padding: 2.25rem 2rem 2rem; } }
.risposta-etichetta { font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.2em; color: hsl(var(--ink-muted)); }
.risposta-franchigia { margin-top: 1rem; font-family: var(--font-display); font-size: clamp(2rem, 6vw, 3.25rem); line-height: 1; letter-spacing: -0.03em; }
.risposta-perche { margin-top: 1rem; color: hsl(var(--ink-muted)); font-size: 0.9375rem; line-height: 1.6; max-width: 48ch; }

.risposta-corpo { padding: 1.5rem; display: grid; gap: 1.5rem; }
@media (min-width: 640px) { .risposta-corpo { padding: 2rem; } }

.combinazione { display: grid; gap: 0.375rem; }
.combinazione-nome { font-family: var(--font-display); font-size: clamp(1.35rem, 3.2vw, 1.9rem); line-height: 1.15; letter-spacing: -0.02em; }
.combinazione-riga { font-size: 0.9375rem; color: hsl(var(--muted-foreground)); }

.conti { display: grid; gap: 0; border-top: 1px solid hsl(var(--border)); }
.conto { display: flex; justify-content: space-between; gap: 1rem; padding: 0.6875rem 0; border-bottom: 1px solid hsl(var(--border)); font-size: 0.9375rem; }
.conto-etichetta { color: hsl(var(--muted-foreground)); }
.conto-valore { font-variant-numeric: tabular-nums; white-space: nowrap; }
.conto.totale { font-size: 1.0625rem; border-bottom: 0; padding-top: 0.9375rem; align-items: baseline; }
/* Su schermo stretto la cifra grande e l'etichetta si contendono la riga e
   vanno a capo tutte e due: meglio metterle una sotto l'altra. */
@media (max-width: 26rem) {
  .conto.totale { flex-direction: column; gap: 0.25rem; }
}
.conto.totale .conto-etichetta { color: hsl(var(--foreground)); }
.conto.totale .conto-valore { font-family: var(--font-display); font-size: 1.5rem; }

.risparmio { padding: 1rem 1.125rem; background: hsl(var(--muted)); border-radius: var(--radius); font-size: 0.9375rem; line-height: 1.6; }
.risparmio strong { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- classifica */
.tabella-guscio { overflow-x: auto; border: 1px solid hsl(var(--border)); border-radius: var(--radius); }
table.classifica { width: 100%; border-collapse: collapse; font-size: 0.875rem; min-width: 40rem; }
table.classifica th {
  text-align: left; font-weight: 400;
  font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.14em;
  color: hsl(var(--muted-foreground));
  padding: 0.875rem 1rem; border-bottom: 1px solid hsl(var(--hairline));
  white-space: nowrap; background: hsl(var(--background));
}
table.classifica td { padding: 0.8125rem 1rem; border-bottom: 1px solid hsl(var(--border)); vertical-align: baseline; }
table.classifica tr:last-child td { border-bottom: 0; }
table.classifica tbody tr:hover { background: hsl(var(--muted)); }
table.classifica tr[data-vincente="true"] td { background: hsl(var(--accent-surface)); }
.col-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* L'etichetta dentro la cella serve solo alla versione a schede: su schermo
   largo c'e' l'intestazione di colonna. */
.et-mobile { display: none; }

/* Sotto i 700 px la tabella non ci sta: a 390 px era larga 883 px e il totale,
   che e' la colonna che si guarda, restava fuori. Ogni riga diventa allora una
   scheda: sopra la cassa con il suo numero di posizione e il modello, sotto i
   quattro numeri come coppie etichetta-valore. I ruoli scritti nell'HTML
   tengono in piedi la tabella per chi legge con un lettore di schermo. */
@media (max-width: 700px) {
  .tabella-guscio { overflow-x: visible; border: 0; border-radius: 0; }
  table.classifica { display: block; min-width: 0; font-size: 0.9375rem; }
  table.classifica thead {
    position: absolute; width: 1px; height: 1px;
    margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
  }
  table.classifica tbody { display: block; }
  table.classifica tr {
    display: block;
    border: 1px solid hsl(var(--border));
    border-radius: var(--radius);
    padding: 0.875rem 1rem 0.8125rem;
    margin-bottom: 0.75rem;
  }
  table.classifica tr:last-child { margin-bottom: 0; }
  table.classifica tbody tr:hover { background: none; }
  table.classifica tr[data-vincente="true"],
  table.classifica tr[data-vincente="true"]:hover { background: hsl(var(--accent-surface)); }
  table.classifica tr[data-vincente="true"] td { background: none; }
  table.classifica td { display: block; padding: 0; border-bottom: 0; }

  /* il numero di posizione sta davanti al nome, non in una colonna sua */
  table.classifica td.posizione { display: none; }
  table.classifica td.nome-assicuratore { font-weight: 500; }
  table.classifica td.nome-assicuratore::before {
    content: attr(data-posizione) ". ";
    color: hsl(var(--muted-foreground));
    font-variant-numeric: tabular-nums;
  }
  table.classifica td.col-modello { color: hsl(var(--muted-foreground)); line-height: 1.4; }
  table.classifica td.col-modello .tipo-modello { display: inline; }

  /* i quattro numeri: etichetta a sinistra, valore a destra */
  table.classifica td.col-num {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 1rem; padding: 0.25rem 0; white-space: normal;
  }
  table.classifica td.col-num:nth-child(4) {
    margin-top: 0.75rem; padding-top: 0.6875rem;
    border-top: 1px solid hsl(var(--border));
  }
  table.classifica td.col-num:last-child { font-weight: 500; }
  table.classifica .et-mobile {
    display: inline; color: hsl(var(--muted-foreground)); font-weight: 400; text-align: left;
  }
  table.classifica .va-mobile { white-space: nowrap; }
}
.posizione { color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; width: 2.5rem; }
.nome-assicuratore { letter-spacing: -0.005em; }
.nome-modello { color: hsl(var(--muted-foreground)); font-size: 0.8125rem; }
.tipo-modello {
  display: inline-block; font-size: 0.8125rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: hsl(var(--muted-foreground)); border: 1px solid hsl(var(--border));
  padding: 0.125rem 0.375rem; border-radius: var(--radius); white-space: nowrap;
}

/* ------------------------------------------------------------------ grafico */
.grafico-guscio { border: 1px solid hsl(var(--border)); border-radius: var(--radius); padding: 1.25rem; }
@media (min-width: 640px) { .grafico-guscio { padding: 1.75rem; } }
/* Il grafico ha sei curve e delle etichette: sotto una certa larghezza non si
   rimpicciolisce, scorre. Schiacciarlo a 340 pixel renderebbe illeggibili le
   scritte, che sono la meta' dell'informazione. */
.grafico-scorrevole { overflow-x: auto; }
.grafico { width: 100%; min-width: 34rem; height: auto; display: block; }
.grafico .asse { stroke: hsl(var(--hairline)); stroke-width: 1; }
.grafico .griglia { stroke: hsl(var(--border)); stroke-width: 1; }
.grafico .curva { fill: none; stroke: hsl(0 0% 74%); stroke-width: 1.25; }
.grafico .curva.viva { stroke: hsl(var(--foreground)); stroke-width: 2; }
.grafico .marcatore { stroke: hsl(var(--foreground)); stroke-width: 1; stroke-dasharray: 3 3; }
.grafico text { font-family: var(--font-sans); font-size: 11px; fill: hsl(var(--muted-foreground)); }
.grafico text.etichetta-curva { font-size: 10.5px; }
.grafico text.viva { fill: hsl(var(--foreground)); }

.legenda-grafico { margin-top: 1rem; font-size: 0.8125rem; line-height: 1.6; color: hsl(var(--muted-foreground)); }

/* ------------------------------------------------------------------ stati */
.avviso {
  padding: 1rem 1.125rem; border: 1px solid hsl(var(--hairline));
  border-radius: var(--radius); font-size: 0.9375rem; line-height: 1.6;
  background: hsl(var(--muted));
}
.caricamento { font-size: 0.875rem; color: hsl(var(--muted-foreground)); }

/* --------------------------------------------------------------- contenuto */
.blocchi { display: grid; gap: 2rem; }
@media (min-width: 800px) { .blocchi { grid-template-columns: repeat(3, 1fr); gap: 2.5rem; } }
.blocco h3 { margin-bottom: 0.625rem; }
.blocco p { font-size: 0.9375rem; line-height: 1.65; color: hsl(var(--muted-foreground)); }

.regola { border: 0; border-top: 1px solid hsl(var(--border)); margin: 0; }

/* ------------------------------------------------------------------ footer */
.site-footer { border-top: 1px solid hsl(var(--border)); padding-block: 2.5rem 3rem; }
.footer-righe { display: grid; gap: 1.25rem; }
@media (min-width: 700px) { .footer-righe { grid-template-columns: 1fr auto; align-items: end; } }
.footer-nota { font-size: 0.8125rem; line-height: 1.7; color: hsl(var(--muted-foreground)); max-width: 52ch; }
.footer-link { display: flex; flex-wrap: wrap; gap: 1.25rem; font-size: 0.8125rem; }
.footer-link a { color: hsl(var(--muted-foreground)); text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
.footer-link a:hover { color: hsl(var(--foreground)); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------- comparsa dolce */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms var(--ease-editorial), transform 600ms var(--ease-editorial); }
.reveal.visibile { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* Testo che sta nella pagina solo per chi la ascolta. */
.solo-voce {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------- in parole semplici */
.semplice { border-bottom: 1px solid hsl(var(--border)); padding-block: 2.25rem; }
.semplice-righe { margin-top: 1.25rem; display: grid; gap: 0.75rem; }
@media (min-width: 900px) { .semplice-righe { grid-template-columns: repeat(3, 1fr); gap: 2rem; } }
.semplice-righe li { display: flex; gap: 0.75rem; font-size: 1rem; line-height: 1.6; }
.semplice-righe li::before { content: "\2014"; content: "\2014" / ""; color: hsl(var(--muted-foreground)); flex-shrink: 0; }

/* ------------------------------------------------------------ alto contrasto */
/* Con i colori forzati (Windows, «Contrasto elevato») sfondi e ombre spariscono:
   quello che distingue uno stato deve passare da bordi e contorni, che il
   sistema ridisegna con i suoi colori. */
@media (forced-colors: active) {
  .tessera[aria-pressed="true"] { outline: 3px solid Highlight; outline-offset: -3px; }
  .tessera[aria-pressed="true"]::after { color: Highlight; }
  .suggerimenti [role="option"][aria-selected="true"] { outline: 2px solid Highlight; outline-offset: -2px; }
  table.classifica tr[data-vincente="true"] td { font-weight: 600; }
  .skip-link:focus, .btn { border: 1px solid ButtonText; }
}
