/* LocaFast — identità grafica.
 * Un solo carattere per tutta l'interfaccia (Plus Jakarta Sans). I documenti (contratto, attestazione,
 * fogli del calcolo) usano il Times, lo stesso del PDF, così l'anteprima è identica a ciò che si stampa.
 * Blu intenso per le azioni, arancio "fast" come accento, fondo chiaro e pulito.
 * Layout: tre colonne su desktop (passi | area di lavoro | riepilogo pratica);
 * su telefono una colonna con barra di avanzamento in alto, riepilogo a scomparsa e azioni in basso.
 */
:root {
  --bg: #f3f5fa;
  --sup: #ffffff;
  --sup-2: #f7f8fc;
  --linea: #e2e7f0;
  --linea-forte: #c6cfdf;
  --testo: #0b1430;
  --tenue: #566079;
  --primario: #2148d8;
  --primario-forte: #1636b0;
  --primario-velo: #e9eeff;
  --primario-testo: #ffffff;
  --accento: #c2410c;          /* arancio per testi piccoli (contrasto AA) */
  --accento-vivo: #ff6b2c;     /* arancio decorativo */
  --marchio: #e4570f;          /* "Fast" nel logo */
  --accento-velo: #fff0e7;
  --ok: #157347; --ok-velo: #e3f5ea;
  --att: #995a00; --att-velo: #fdf1dc;
  --ko: #c0261b; --ko-velo: #fdeceb;
  --inf: #a65800; --inf-velo: #fdf0df; --media: #1d4fd0; --media-velo: #e7eeff; --super: #03704d; --super-velo: #def4ea;
  --carta: #ffffff;
  --hero-1: #08113a; --hero-2: #1530a0; --hero-3: #2b5cff;
  --ombra: 0 1px 2px rgb(11 20 48 / .04), 0 6px 22px -10px rgb(11 20 48 / .14);
  --ombra-alta: 0 2px 6px rgb(11 20 48 / .06), 0 26px 56px -20px rgb(11 20 48 / .38);
  --ombra-foglio: 0 1px 3px rgb(11 20 48 / .10), 0 18px 44px -16px rgb(11 20 48 / .32);
  --ombra-btn: 0 10px 22px -12px rgb(33 72 216 / .75);

  --f-ui: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-doc: "Times New Roman", Times, "Liberation Serif", Georgia, serif;
  --r: 12px;
  --r-l: 18px;
  --topbar: 66px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070c1b; --sup: #0f1730; --sup-2: #141e3a; --linea: #222d4c; --linea-forte: #344263;
    --testo: #e8ecf8; --tenue: #9ca7c4; --primario: #8aa4ff; --primario-forte: #b2c2ff; --primario-velo: #19244f; --primario-testo: #08102a;
    --accento: #ff9a66; --accento-vivo: #ff7a3d; --marchio: #ff8a4c; --accento-velo: #3a1d10;
    --ok: #5fd39a; --ok-velo: #0f2e20; --att: #f2bb63; --att-velo: #33260d; --ko: #ff8a80; --ko-velo: #3a1513;
    --inf: #f4b468; --inf-velo: #33240f; --media: #a3bcff; --media-velo: #18244e; --super: #72deb0; --super-velo: #0f2e22;
    --carta: #fbfbf9; --hero-1: #040820; --hero-2: #0d1d66; --hero-3: #2148d8;
    --ombra: 0 1px 2px rgb(0 0 0 / .4), 0 6px 22px -10px rgb(0 0 0 / .55); --ombra-alta: 0 26px 56px -20px rgb(0 0 0 / .85); --ombra-foglio: 0 18px 44px -16px rgb(0 0 0 / .75);
    --ombra-btn: 0 10px 22px -12px rgb(0 0 0 / .8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070c1b; --sup: #0f1730; --sup-2: #141e3a; --linea: #222d4c; --linea-forte: #344263;
  --testo: #e8ecf8; --tenue: #9ca7c4; --primario: #8aa4ff; --primario-forte: #b2c2ff; --primario-velo: #19244f; --primario-testo: #08102a;
  --accento: #ff9a66; --accento-vivo: #ff7a3d; --marchio: #ff8a4c; --accento-velo: #3a1d10;
  --ok: #5fd39a; --ok-velo: #0f2e20; --att: #f2bb63; --att-velo: #33260d; --ko: #ff8a80; --ko-velo: #3a1513;
  --inf: #f4b468; --inf-velo: #33240f; --media: #a3bcff; --media-velo: #18244e; --super: #72deb0; --super-velo: #0f2e22;
  --carta: #fbfbf9; --hero-1: #040820; --hero-2: #0d1d66; --hero-3: #2148d8;
  --ombra: 0 1px 2px rgb(0 0 0 / .4), 0 6px 22px -10px rgb(0 0 0 / .55); --ombra-alta: 0 26px 56px -20px rgb(0 0 0 / .85); --ombra-foglio: 0 18px 44px -16px rgb(0 0 0 / .75);
  --ombra-btn: 0 10px 22px -12px rgb(0 0 0 / .8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
/* Pagina ferma: spazio della barra di scorrimento sempre riservato, nessuna animazione che sposti il contenuto. */
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; scrollbar-gutter: stable; overflow-anchor: none; }
body { margin: 0; background: var(--bg); color: var(--testo); font-family: var(--f-ui); font-size: 15.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 40; background: var(--sup); }
h1, h2, h3 { margin: 0; line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.35rem); font-weight: 800; letter-spacing: -.028em; }
h2 { font-size: 1.08rem; font-weight: 750; letter-spacing: -.012em; }
h3 { font-size: .96rem; font-weight: 700; }
h2 small, h1 small { font-size: .72em; font-weight: 600; color: var(--tenue); letter-spacing: 0; }
p { margin: 0; }
a { color: var(--primario); }
button { font: inherit; color: inherit; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.num { font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2.5px solid var(--primario); outline-offset: 2px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.etichetta { font-size: .7rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; color: var(--tenue); }
.tenue { color: var(--tenue); }
.piccolo { font-size: .85rem; color: var(--tenue); }
.ico { width: 18px; height: 18px; flex: none; }

/* ---------- Barra superiore ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: color-mix(in srgb, var(--sup) 90%, transparent); backdrop-filter: saturate(1.5) blur(12px); border-bottom: 1px solid var(--linea); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--topbar);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); max-width: 1440px; margin-inline: auto; }
.brand { display: flex; align-items: center; gap: 11px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; min-width: 0; }
.brand-mark { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(145deg, var(--hero-3), var(--hero-2)); flex: none; box-shadow: 0 8px 18px -10px var(--hero-2), inset 0 1px 0 rgb(255 255 255 / .25); }
.brand-mark svg { width: 30px; height: 30px; }
.brand-mark .mark-ok { stroke: #ff7a3d; }
.brand-testo { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-testo b { font-size: 1.28rem; font-weight: 800; letter-spacing: -.035em; color: var(--testo); }
.brand-testo b i { font-style: italic; font-weight: 800; color: var(--marchio); padding-right: .06em; }
.brand-testo small { font-size: .7rem; color: var(--tenue); font-weight: 600; letter-spacing: .01em; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-dx { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pratica { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; font-size: .72rem; color: var(--tenue); white-space: nowrap; margin-right: 6px; min-width: 0; }
.pratica b { color: var(--testo); font-weight: 700; font-size: .78rem; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.pratica .salvato { display: inline-flex; align-items: center; gap: 5px; }
.pratica .salvato::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.pratica .salvato.in-corso::before { background: var(--att); }
.btn-ghost { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--linea); background: var(--sup); border-radius: 11px; min-height: 40px; padding: 6px 13px; cursor: pointer; font-size: .85rem; font-weight: 650; transition: border-color .15s, background-color .15s; }
.btn-ghost:hover { border-color: var(--linea-forte); background: var(--sup-2); }
.btn-ghost.icona { padding: 6px; width: 40px; justify-content: center; }
.btn-ghost .ico { width: 17px; height: 17px; color: var(--tenue); }
.progress-mobile { display: none; }

/* ---------- Struttura a tre colonne ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr) 300px; gap: 30px; max-width: 1440px; margin-inline: auto;
  padding: clamp(14px, 3vh, 30px) max(16px, env(safe-area-inset-right, 0px)) 40px max(16px, env(safe-area-inset-left, 0px)); align-items: start; }
.sidebar, .rail { position: sticky; top: calc(var(--topbar) + 26px); }
.main { min-width: 0; display: flex; flex-direction: column; }
.piede { max-width: 1440px; margin: 0 auto; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 34px max(16px, env(safe-area-inset-left, 0px)); font-size: .78rem; color: var(--tenue); }
.piede .copy { margin-top: 8px; font-size: .74rem; }
.piede .copy b { color: var(--testo); font-weight: 750; }
.solo-mobile { display: none; }
.solo-largo { display: inline-flex; }

@media (max-width: 1180px) {
  .shell { grid-template-columns: 224px minmax(0, 1fr); }
  .rail { position: fixed; z-index: 50; inset: 0 0 0 auto; width: min(360px, 92vw); top: 0; background: var(--bg); box-shadow: -12px 0 30px rgb(0 0 0 / .2);
    padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 16px 16px; overflow-y: auto; transform: translateX(105%); transition: transform .25s ease, visibility .25s; visibility: hidden; }
  .rail.aperto { transform: none; visibility: visible; }
  .solo-mobile { display: inline-flex; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); padding-top: 16px; gap: 0; }
  .sidebar { display: none; }
  .progress-mobile { display: block; padding: 0 max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
  .pratica { display: none; }
  .solo-largo { display: none; }
}
@media (max-width: 420px) { .brand-testo small { display: none; } .brand-mark { width: 36px; height: 36px; } }

/* Passi (sidebar) */
.passi { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.passo { position: relative; }
.passo > button, .passo > div { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 1px 12px; width: 100%; padding: 10px 10px; border: 0; background: none; text-align: left; border-radius: 14px; }
.passo > button { cursor: pointer; transition: background-color .15s; }
.passo > button:hover { background: color-mix(in srgb, var(--sup) 75%, transparent); }
.passo:not(:last-child)::after { content: ""; position: absolute; left: 25px; top: 46px; bottom: -8px; width: 2px; border-radius: 1px; background: var(--linea); }
.passo.fatto:not(:last-child)::after { background: var(--primario); }
.p-num { grid-row: span 2; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--linea-forte); background: var(--bg); font-size: .8rem; font-weight: 800; color: var(--tenue); position: relative; z-index: 1; }
.passo.fatto .p-num { background: var(--primario); border-color: var(--primario); color: var(--primario-testo); }
.passo.corrente .p-num { border-color: transparent; color: #fff; background: linear-gradient(145deg, var(--hero-3), var(--hero-2)); box-shadow: 0 0 0 4px var(--primario-velo); }
.p-tit { font-weight: 750; font-size: .9rem; }
.passo:not(.corrente):not(.fatto) .p-tit { color: var(--tenue); }
.p-sub { font-size: .77rem; color: var(--tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.passo.corrente > div { background: var(--sup); box-shadow: var(--ombra); }
.lucchetto { display: inline-block; width: 10px; height: 8px; border: 1.5px solid currentColor; border-radius: 2px; margin-left: 6px; position: relative; vertical-align: 0; }
.lucchetto::before { content: ""; position: absolute; left: 1px; right: 1px; top: -6px; height: 6px; border: 1.5px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }
.sidebar-nota { margin-top: 18px; padding: 14px; border-radius: 14px; background: var(--sup); border: 1px solid var(--linea); font-size: .8rem; color: var(--tenue); display: flex; flex-direction: column; gap: 10px; }
.sidebar-nota .link { font-size: .8rem; align-self: flex-start; }

/* Barra di avanzamento su telefono */
.pm-riga { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .82rem; }
.pm-riga b { font-weight: 750; }
.pm-riga > span:first-child { white-space: nowrap; flex: none; }
.pm-riga > span:last-child { color: var(--tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; text-align: right; }
.pm-barra { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin-top: 7px; }
.pm-barra i { display: block; height: 5px; border-radius: 3px; background: var(--linea); transition: background-color .3s; }
.pm-barra i.on { background: linear-gradient(90deg, var(--hero-3), var(--primario)); }

/* Riepilogo pratica (rail) */
.riep { background: var(--sup); border: 1px solid var(--linea); border-radius: var(--r-l); overflow: hidden; box-shadow: var(--ombra); }
.riep-testa { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--linea); }
.riep-testa h2 { font-size: .96rem; }
.riep-avanz { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--linea); background: var(--sup-2); }
.anello { --p: 0; width: 48px; height: 48px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: radial-gradient(closest-side, var(--sup-2) 76%, transparent 78% 100%), conic-gradient(var(--primario) calc(var(--p) * 1%), var(--linea) 0); }
.anello span { font-size: .74rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.riep-avanz p { font-size: .8rem; color: var(--tenue); line-height: 1.35; }
.riep-avanz p b { display: block; color: var(--testo); font-size: .87rem; }
.riep dl { margin: 0; padding: 6px 16px 12px; }
.riep dl div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dashed var(--linea); font-size: .84rem; }
.riep dl div:last-child { border-bottom: 0; }
.riep dt { color: var(--tenue); }
.riep dd { margin: 0; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; }
.riep dd.vuoto-r { color: var(--linea-forte); font-weight: 400; }
.riep-prezzo { margin-top: 14px; border: 1px solid var(--linea); border-radius: var(--r-l); background: var(--sup); padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.riep-prezzo .prezzo { font-size: 1.55rem; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.riep-azioni { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.chiudi-rail { display: none; }
@media (max-width: 1180px) { .chiudi-rail { display: inline-flex; } }
.velo { position: fixed; inset: 0; background: rgb(5 9 25 / .5); z-index: 45; animation: appare .2s ease; }
@keyframes appare { from { opacity: 0; } }

/* ---------- Area di lavoro ---------- */
.vista { display: flex; flex-direction: column; gap: 18px; }
.intest { display: flex; flex-direction: column; gap: 8px; padding-bottom: 4px; }
.intest .etichetta { display: inline-flex; align-self: flex-start; padding: 4px 10px; border-radius: 999px; background: var(--primario-velo); color: var(--primario); letter-spacing: .07em; }
.intest .lead { color: var(--tenue); max-width: 64ch; font-size: 1.02rem; }
.card { background: var(--sup); border: 1px solid var(--linea); border-radius: var(--r-l); box-shadow: 0 1px 2px rgb(11 20 48 / .03); }
.card-testa { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--linea); flex-wrap: wrap; }
.card-testa h2 { display: flex; align-items: center; gap: 10px; }
.card-corpo { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.card-piede { padding: 12px 20px; border-top: 1px solid var(--linea); background: var(--sup-2); border-radius: 0 0 var(--r-l) var(--r-l); }
.n-tondo { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--primario-velo); color: var(--primario); font-size: .82rem; font-weight: 800; }
.azioni-riga { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.barra-azioni { position: sticky; bottom: 0; z-index: 20; margin-top: 24px; padding: 10px 0 calc(10px + env(safe-area-inset-bottom, 0px)); }
.barra-in { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 9px 10px 9px 12px; background: color-mix(in srgb, var(--sup) 94%, transparent); backdrop-filter: blur(12px);
  border: 1px solid var(--linea); border-radius: 18px; box-shadow: var(--ombra-alta); }
.barra-in .spazio { flex: 1; min-width: 0; font-size: .86rem; color: var(--tenue); }
.barra-in .spazio b { color: var(--testo); font-weight: 750; }
.barra-in .btn { flex: none; }
@media (max-width: 560px) {
  .barra-in { gap: 8px; padding: 8px; border-radius: 16px; }
  .barra-in .spazio { font-size: .78rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
  .barra-in .btn { padding-inline: 14px; }
}

/* Pulsanti */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 19px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 750; font-size: .93rem; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s, border-color .15s, box-shadow .15s, filter .15s; }
.btn.primario { background: linear-gradient(180deg, color-mix(in srgb, var(--primario) 88%, #fff), var(--primario)); color: var(--primario-testo); box-shadow: inset 0 1px 0 rgb(255 255 255 / .18), var(--ombra-btn); }
.btn.primario:hover { background: var(--primario-forte); }
.btn.primario:disabled { background: var(--linea); color: var(--tenue); cursor: not-allowed; box-shadow: none; }
.btn.secondario { background: var(--sup); border-color: var(--linea-forte); color: var(--testo); }
.btn.secondario:hover { border-color: var(--testo); }
.btn.pericolo { background: var(--sup); border-color: color-mix(in srgb, var(--ko) 45%, var(--linea)); color: var(--ko); }
.btn.pericolo:hover { background: var(--ko-velo); }
.btn.testo { background: none; color: var(--primario); padding-inline: 8px; }
.btn.testo:hover { background: var(--primario-velo); }
.btn.grande { min-height: 54px; padding: 13px 26px; font-size: 1.02rem; border-radius: 14px; }
.btn.piccolo-btn { min-height: 36px; padding: 6px 13px; font-size: .83rem; border-radius: 10px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.link { border: 0; background: none; padding: 0; color: var(--primario); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 650; text-align: left; }
.link.pericolo { color: var(--ko); }

/* Campi */
.griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px 16px; }
.griglia .largo { grid-column: 1 / -1; }
.griglia.stretta { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
.griglia.tre { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 12px; }
.campo { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.campo-testa { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.campo label, .campo .lab, .lab { font-size: .82rem; font-weight: 750; color: var(--testo); }
.facolt { font-weight: 500; color: var(--tenue); }
.rapido { border: 0; background: var(--primario-velo); color: var(--primario); font-size: .72rem; font-weight: 750; padding: 3px 9px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.rapido:hover { background: color-mix(in srgb, var(--primario) 18%, var(--sup)); }
input, select, textarea { width: 100%; min-height: 44px; padding: 9px 13px; border: 1px solid var(--linea-forte); border-radius: 11px; background: var(--sup); color: var(--testo); font: inherit; font-size: .95rem; transition: border-color .15s, box-shadow .15s; }
input:hover, select:hover, textarea:hover { border-color: var(--tenue); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primario); box-shadow: 0 0 0 4px var(--primario-velo); }
input:disabled { background: var(--sup-2); color: var(--tenue); }
input::placeholder, textarea::placeholder { color: color-mix(in srgb, var(--tenue) 75%, transparent); }
input.mono { font-variant-numeric: tabular-nums; letter-spacing: .04em; }
textarea { resize: vertical; }
.aiuto { font-size: .82rem; color: var(--tenue); }
.verifica { font-size: .78rem; font-weight: 650; min-height: 1.4em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.verifica.ok { color: var(--ok); } .verifica.ko { color: var(--ko); }
.derivato { min-height: 44px; display: flex; align-items: center; padding: 0 13px; border-radius: 11px; background: var(--sup-2); border: 1px dashed var(--linea-forte); font-variant-numeric: tabular-nums; font-size: .92rem; }
.campo.evidenzia input, .campo.evidenzia select, .campo.evidenzia textarea { border-color: var(--accento-vivo); box-shadow: 0 0 0 4px var(--accento-velo); }

.seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding: 3px; border: 1px solid var(--linea); border-radius: 12px; background: var(--sup-2); max-width: 100%; }
.seg label { position: relative; cursor: pointer; min-width: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; min-height: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 38px; padding: 6px 12px; font-size: .86rem; font-weight: 650; text-align: center; height: 100%; line-height: 1.25; border-radius: 9px; color: var(--tenue); transition: background-color .15s, color .15s; }
.seg label:hover span { color: var(--testo); }
.seg input:checked + span { background: var(--sup); color: var(--primario); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--linea); }
.seg input:focus-visible + span { outline: 2px solid var(--primario); outline-offset: -2px; }

.interr { display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-size: .9rem; font-weight: 650; position: relative; }
.interr input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.interr i { width: 42px; height: 25px; border-radius: 999px; background: var(--linea-forte); position: relative; transition: background-color .2s; flex: none; }
.interr i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 2px rgb(0 0 0 / .2); }
.interr input:checked + i { background: var(--primario); }
.interr input:checked + i::after { transform: translateX(17px); }
.interr input:focus-visible + i { outline: 2px solid var(--primario); outline-offset: 2px; }
.interr.grande { display: flex; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--sup-2); border: 1px solid var(--linea); }
.interr.grande i { margin-top: 1px; }
.interr.grande span { display: flex; flex-direction: column; gap: 2px; }
.interr.grande b { font-weight: 750; }
.interr.grande small { font-weight: 500; color: var(--tenue); font-size: .82rem; line-height: 1.4; }
.interr.grande:has(input:checked) { border-color: color-mix(in srgb, var(--primario) 50%, var(--linea)); background: color-mix(in srgb, var(--primario-velo) 55%, var(--sup)); }

.tag { display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; background: var(--sup-2); color: var(--tenue); border: 1px solid var(--linea); white-space: nowrap; vertical-align: 1px; }
.tag.ok { background: var(--ok-velo); color: var(--ok); border-color: transparent; }
.tag.att { background: var(--att-velo); color: var(--att); border-color: transparent; }
.tag.ko { background: var(--ko-velo); color: var(--ko); border-color: transparent; }
.tag.pri { background: var(--primario-velo); color: var(--primario); border-color: transparent; }
.tag.acc { background: var(--accento-velo); color: var(--accento); border-color: transparent; }
.tag:empty { display: none; }
.avviso { display: flex; gap: 10px; padding: 13px 15px; border-radius: 14px; font-size: .88rem; border: 1px solid transparent; }
.avviso::before { content: "i"; flex: none; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; font-size: .74rem; font-weight: 800; margin-top: 1px; }
.avviso.info { background: var(--primario-velo); color: var(--testo); } .avviso.info::before { background: var(--primario); color: var(--primario-testo); }
.avviso.att { background: var(--att-velo); color: var(--testo); } .avviso.att::before { content: "!"; background: var(--att); color: #fff; }
.avviso.ok { background: var(--ok-velo); color: var(--testo); } .avviso.ok::before { content: "✓"; background: var(--ok); color: #fff; }
.avviso.ko { background: var(--ko-velo); color: var(--testo); } .avviso.ko::before { content: "!"; background: var(--ko); color: #fff; }

/* ---------- 1 · Comune ---------- */
.hero { container-type: inline-size; position: relative; border-radius: 26px; padding: clamp(18px, min(3.2vw, 4.2vh), 40px) clamp(20px, 3.2vw, 42px); color: #fff; overflow: visible;
  background:
    radial-gradient(60% 80% at 100% 0%, color-mix(in srgb, var(--hero-3) 80%, transparent) 0%, transparent 60%),
    radial-gradient(45% 60% at 0% 100%, rgb(255 107 44 / .28) 0%, transparent 65%),
    linear-gradient(140deg, var(--hero-1) 0%, var(--hero-2) 100%);
  box-shadow: var(--ombra-alta); display: flex; flex-direction: column; gap: clamp(8px, 1.5vh, 13px); }
.hero > * { position: relative; z-index: 1; }
.hero .etichetta { color: rgb(255 255 255 / .78); display: inline-flex; align-self: flex-start; padding: 5px 11px; border-radius: 999px; background: rgb(255 255 255 / .1); border: 1px solid rgb(255 255 255 / .18); }
.hero h1 { font-size: clamp(1.55rem, min(4.6cqi, 5.2vh), 2.5rem); max-width: min(30ch, calc(100% - 170px)); line-height: 1.08; }
.hero h1 em { font-style: normal; background: linear-gradient(90deg, #ffb38a, #ff7a3d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .lead { color: rgb(255 255 255 / .84); max-width: 64ch; font-size: clamp(.92rem, 1.9vh, 1.02rem); line-height: 1.5; }
.hero > .hero-sfondo { position: absolute; inset: 0; z-index: 0; overflow: hidden; border-radius: inherit; pointer-events: none; }
.hero-sfondo::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgb(255 255 255 / .14) 1px, transparent 1.4px); background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(115deg, transparent 30%, #000 75%); mask-image: linear-gradient(115deg, transparent 30%, #000 75%); }
.hero-deco { position: absolute; z-index: 0; right: clamp(14px, 2.2vw, 28px); top: clamp(14px, 2.2vw, 26px); width: min(150px, 20%); pointer-events: none; }
/* Riquadro blu stretto: l'illustrazione resta sullo sfondo e il titolo usa tutta la larghezza. */
@container (max-width: 760px) { .hero h1 { max-width: none; } .hero-deco { width: min(170px, 40%); opacity: .16; right: -14px; } }
@container (max-width: 520px) {
  .hero .lead { font-size: .9rem; line-height: 1.45; }
  .hero .esempi > span { display: none; }
  .vantaggi { font-size: .8rem; gap: 4px 14px; }
}
.hero > .ricerca { position: relative; z-index: 25; margin-top: 2px; max-width: 640px; display: flex; flex-direction: column; gap: 8px; }
.hero-lab { font-weight: 750; font-size: 1rem; color: #fff; }
.ricerca-campo { display: flex; align-items: center; gap: 10px; border: 0; border-radius: 16px; background: var(--sup); color: var(--testo); padding: 6px 6px 6px 17px; box-shadow: 0 18px 40px -16px rgb(0 0 0 / .6); transition: box-shadow .15s; }
.ricerca-campo:focus-within { box-shadow: 0 0 0 4px rgb(255 255 255 / .35), 0 18px 40px -16px rgb(0 0 0 / .6); }
.ricerca-campo svg { width: 22px; height: 22px; color: var(--primario); flex: none; }
.ricerca-campo input { border: 0; box-shadow: none !important; padding: 8px 0; font-size: 1.1rem; font-weight: 600; min-height: clamp(44px, 6vh, 52px); background: transparent; }
.suggerimenti { position: absolute; left: 0; right: 0; top: calc(100% + 8px); list-style: none; margin: 0; padding: 6px; background: var(--sup); color: var(--testo); border: 1px solid var(--linea); border-radius: 16px; box-shadow: var(--ombra-alta); max-height: 340px; overflow: auto; }
.suggerimenti li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 10px; cursor: pointer; }
.suggerimenti li[aria-selected="true"], .suggerimenti li:hover { background: var(--primario-velo); }
.suggerimenti .s-nome { font-weight: 750; }
.suggerimenti .s-nome mark { background: none; color: var(--primario); text-decoration: underline; text-underline-offset: 3px; }
.suggerimenti .s-meta { font-size: .78rem; color: var(--tenue); font-variant-numeric: tabular-nums; white-space: nowrap; }
.esempi { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; color: var(--tenue); }
.esempi button { border: 1px solid var(--linea); background: var(--sup); border-radius: 999px; padding: 5px 12px; cursor: pointer; font-size: .78rem; font-weight: 650; }
.esempi button:hover { border-color: var(--primario); color: var(--primario); }
.hero .esempi { color: rgb(255 255 255 / .78); }
.hero .esempi button { background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .26); color: #fff; }
.hero .esempi button:hover { background: rgb(255 255 255 / .22); border-color: #fff; color: #fff; }
.hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; max-width: 640px; }
.hero-cta:empty { display: none; }
.hero-scelto { font-size: .92rem; color: rgb(255 255 255 / .9); }
.hero-scelto span { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #22c55e; color: #fff; font-size: .7rem; font-weight: 800; margin-right: 4px; }
.btn.btn-hero { background: #fff; color: #1530a0; box-shadow: 0 14px 30px -14px rgb(0 0 0 / .6); }
.btn.btn-hero:hover { background: #eef2ff; }
.btn.btn-hero span { color: #e4570f; font-weight: 800; }
@media (max-width: 520px) { .btn.btn-hero { width: 100%; } }
.vantaggi { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; margin: 0; padding: 0; font-size: .86rem; font-weight: 650; color: rgb(255 255 255 / .92); }
.vantaggi li { display: inline-flex; align-items: center; gap: 8px; }
.vantaggi li::before { content: "✓"; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgb(255 122 61 / .95); color: #fff; font-size: .7rem; font-weight: 800; flex: none; }
.come { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 1000px) { .come { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .come { grid-template-columns: 1fr; } }
.come-voce { position: relative; background: var(--sup); border: 1px solid var(--linea); border-radius: var(--r-l); padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.come-voce .ico-tondo { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--primario-velo); color: var(--primario); }
.come-voce:nth-child(2) .ico-tondo { background: var(--accento-velo); color: var(--accento); }
.come-voce .ico-tondo svg { width: 22px; height: 22px; }
.come-voce .n-passo { position: absolute; top: 16px; right: 16px; font-size: .72rem; font-weight: 800; color: var(--tenue); letter-spacing: .06em; }
.come-voce h3 { font-size: .95rem; }
.come-voce p { font-size: .83rem; color: var(--tenue); }
.scheda-comune .card-testa h2 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; }
.sc-cap { font-size: .82rem; color: var(--tenue); font-variant-numeric: tabular-nums; margin-top: 3px; }
.indicatori { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--linea); }
.indicatore { padding: 16px 20px; border-right: 1px solid var(--linea); display: flex; flex-direction: column; gap: 6px; }
.indicatore:last-child { border-right: 0; }
.indicatore .val { font-weight: 800; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.pallino { width: 10px; height: 10px; border-radius: 50%; background: var(--linea-forte); flex: none; }
.pallino.si { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-velo); }
.pallino.forse { background: var(--att); box-shadow: 0 0 0 3px var(--att-velo); }
.indicatore p { font-size: .82rem; color: var(--tenue); }
@media (max-width: 640px) { .indicatori { grid-template-columns: 1fr; } .indicatore { border-right: 0; border-bottom: 1px solid var(--linea); } .indicatore:last-child { border-bottom: 0; } }
.chi-sei .card-corpo { padding-block: 16px; }

/* ---------- 2 · Contratto: schede di scelta ---------- */
.scelte { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 700px) { .scelte { grid-template-columns: 1fr; gap: 12px; } }
.scelta { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; width: 100%; text-align: left; padding: 20px; border: 1.5px solid var(--linea); border-radius: 20px;
  background: var(--sup); cursor: pointer; box-shadow: 0 1px 2px rgb(11 20 48 / .03); transition: border-color .15s, box-shadow .15s, background-color .15s; }
.scelta:hover { border-color: var(--linea-forte); box-shadow: var(--ombra); }
.scelta.sel { border-color: var(--primario); background: color-mix(in srgb, var(--primario-velo) 45%, var(--sup)); box-shadow: 0 0 0 1px var(--primario), var(--ombra); }
.scelta.sug:not(.sel) { border-color: color-mix(in srgb, var(--accento-vivo) 45%, var(--linea)); }
.sc-testa { display: flex; align-items: center; gap: 8px; width: 100%; flex-wrap: wrap; }
.sc-durata { font-size: 1.6rem; font-weight: 800; letter-spacing: -.035em; line-height: 1.1; color: var(--primario); margin-right: auto; }
.sc-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--linea-forte); display: grid; place-items: center; flex: none; background: var(--sup); transition: background-color .15s, border-color .15s; }
.scelta.sel .sc-check { background: var(--primario); border-color: var(--primario); }
.scelta.sel .sc-check::after { content: ""; width: 11px; height: 6px; border-left: 2.2px solid var(--primario-testo); border-bottom: 2.2px solid var(--primario-testo); transform: rotate(-45deg) translate(1px, -1px); }
.sc-nome { font-size: 1.1rem; font-weight: 750; }
.sc-desc { font-size: .88rem; color: var(--tenue); }
.sc-quando { width: 100%; font-size: .86rem; padding: 10px 12px; border-radius: 12px; background: var(--sup-2); border: 1px solid var(--linea); }
.sc-quando b { color: var(--testo); }
.scelta.sel .sc-quando { background: var(--sup); }
.sc-fatti { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 2px; }
.sc-fatti span { font-size: .74rem; font-weight: 750; padding: 4px 10px; border-radius: 999px; background: var(--primario-velo); color: var(--primario); }
.dettaglio-contr .card-testa h2 { font-size: 1.12rem; margin-top: 2px; }
.dettaglio-contr ul { margin: 0; padding-left: 1.1em; display: flex; flex-direction: column; gap: 5px; font-size: .9rem; }
details.acc { border-top: 1px solid var(--linea); }
details.acc > summary { list-style: none; cursor: pointer; padding: 14px 20px; font-weight: 750; font-size: .9rem; display: flex; justify-content: space-between; gap: 12px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "+"; color: var(--tenue); font-weight: 400; font-size: 1.2rem; line-height: 1; }
details.acc[open] > summary::after { content: "−"; }
details.acc > div { padding: 0 20px 16px; display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
details.acc.acc-interna { margin: 0 -20px -20px; }
details.acc.acc-interna > summary { color: var(--tenue); font-weight: 650; }

/* ---------- 3 · Canone e tasse ---------- */
.canone-voluto { display: flex; align-items: flex-end; gap: 10px; }
.canone-voluto .campo { flex: 0 1 260px; min-width: 0; }
.canone-voluto input { font-size: 1.85rem; font-weight: 800; letter-spacing: -.02em; min-height: 60px; font-variant-numeric: tabular-nums; }
.canone-voluto > .tenue { white-space: nowrap; padding-bottom: 17px; font-weight: 650; }
.card.evidenzia { border-color: var(--accento-vivo); box-shadow: 0 0 0 4px var(--accento-velo); transition: box-shadow .2s; }
.calcolo-card { border-color: color-mix(in srgb, var(--primario) 30%, var(--linea)); }
.fascia { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--primario-velo) 80%, var(--sup)), var(--sup)); border: 1px solid color-mix(in srgb, var(--primario) 22%, var(--linea)); }
.fascia-val { font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fascia-val b { font-weight: 800; color: var(--primario); }
.fascia-val small { font-size: .62em; color: var(--tenue); font-weight: 600; letter-spacing: 0; }
.fascia-meta { font-size: .83rem; color: var(--tenue); }
.regimi { display: flex; flex-direction: column; gap: 8px; }
.regime { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 12px; align-items: center; padding: 14px 16px; border: 1px solid var(--linea); border-radius: 14px; cursor: pointer; background: var(--sup); text-align: left; width: 100%; transition: border-color .15s, background-color .15s; }
.regime:hover { border-color: var(--linea-forte); }
.regime.sel { border-color: var(--primario); background: var(--primario-velo); box-shadow: inset 0 0 0 1px var(--primario); }
.r-radio { width: 19px; height: 19px; border-radius: 50%; border: 2px solid var(--linea-forte); display: grid; place-items: center; grid-row: span 2; align-self: start; margin-top: 2px; }
.regime.sel .r-radio { border-color: var(--primario); }
.regime.sel .r-radio::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--primario); }
.r-nome { font-weight: 750; font-size: .93rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.r-nota { font-size: .8rem; color: var(--tenue); }

/* Verifica del canone dentro la fascia */
.verifica-box { min-height: 74px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.rb-track { position: relative; height: 12px; border-radius: 999px; background: var(--sup-2); border: 1px solid var(--linea); }
.rb-fill { position: absolute; top: -1px; bottom: -1px; border-radius: 999px; background: linear-gradient(90deg, color-mix(in srgb, var(--ok) 70%, var(--sup)), var(--ok)); }
.rb.fuori .rb-fill { background: linear-gradient(90deg, color-mix(in srgb, var(--primario) 50%, var(--sup)), var(--primario)); }
.rb-mark { position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; background: var(--sup); border: 3px solid var(--testo); box-shadow: 0 2px 6px rgb(0 0 0 / .25); }
.rb.fuori .rb-mark { border-color: var(--ko); }
.rb-l { display: flex; justify-content: space-between; margin-top: 6px; font-size: .78rem; color: var(--tenue); font-weight: 650; font-variant-numeric: tabular-nums; }
.rb-msg { font-size: .86rem; font-weight: 650; color: var(--tenue); }
.rb-msg.ok { color: var(--ok); } .rb-msg.ko { color: var(--ko); }

/* ---------- 3b · Calcolo del canone concordato ---------- */
.calc-strumenti { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.calc-strumenti .spazio { flex: 1; }
.calc-strumenti .btn.testo { margin-left: -8px; }
.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 1100px) {
  .calc-layout { grid-template-columns: minmax(0, 1fr) 360px; }
  .calc-ris { position: sticky; top: calc(var(--topbar) + 22px); }
}
.calc-sezioni { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.calc-sez { scroll-margin-top: 90px; }
.ricerca-mini { display: flex; align-items: center; gap: 8px; border: 1px solid var(--linea-forte); border-radius: 12px; padding-left: 13px; background: var(--sup); }
.ricerca-mini:focus-within { border-color: var(--primario); box-shadow: 0 0 0 4px var(--primario-velo); }
.ricerca-mini svg { width: 18px; height: 18px; color: var(--tenue); flex: none; }
.ricerca-mini input { border: 0; box-shadow: none !important; padding-left: 0; }
.zone { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.zona-opt { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--linea); border-radius: 14px; cursor: pointer; background: var(--sup); transition: border-color .15s, background-color .15s; }
.zona-opt:hover { border-color: var(--linea-forte); }
.zona-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.zona-opt:has(input:checked) { border-color: var(--primario); background: color-mix(in srgb, var(--primario-velo) 60%, var(--sup)); box-shadow: inset 0 0 0 1px var(--primario); }
.zona-opt:has(input:focus-visible) { outline: 2.5px solid var(--primario); outline-offset: 2px; }
.zn { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 10px; background: var(--sup-2); border: 1px solid var(--linea); font-weight: 800; font-variant-numeric: tabular-nums; }
.zona-opt:has(input:checked) .zn { background: var(--primario); border-color: var(--primario); color: var(--primario-testo); }
.zb { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zb b { font-size: .9rem; font-weight: 750; line-height: 1.25; }
.zb small { font-size: .78rem; color: var(--tenue); line-height: 1.35; }
.mq-tab { display: flex; flex-direction: column; }
.mq-h, .mqr { display: grid; grid-template-columns: minmax(0, 1fr) 138px 84px; gap: 12px; align-items: center; }
.mq-h { font-size: .7rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; color: var(--tenue); padding: 0 0 8px; border-bottom: 1px solid var(--linea); }
.mq-h span:nth-child(n+2) { text-align: right; }
.mqr { padding: 10px 0; border-bottom: 1px dashed var(--linea); }
.mqr label { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .9rem; cursor: pointer; }
.mqr label small { flex-basis: 100%; font-size: .78rem; color: var(--tenue); line-height: 1.35; }
.mqr.base label b { color: var(--primario); }
.coef { font-size: .7rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: var(--sup-2); border: 1px solid var(--linea); color: var(--tenue); }
.mqr-w { text-align: right; font-weight: 700; color: var(--tenue); font-size: .9rem; }
@media (max-width: 520px) { .mq-h, .mqr { grid-template-columns: minmax(0, 1fr) 112px 64px; gap: 8px; } }
.inp-suf { display: flex; align-items: center; border: 1px solid var(--linea-forte); border-radius: 11px; background: var(--sup); overflow: hidden; }
.inp-suf:focus-within { border-color: var(--primario); box-shadow: 0 0 0 4px var(--primario-velo); }
.inp-suf input { border: 0; box-shadow: none !important; text-align: right; min-width: 0; padding-right: 6px; font-variant-numeric: tabular-nums; font-weight: 650; }
.inp-suf > span { padding: 0 11px 0 2px; font-size: .82rem; color: var(--tenue); font-weight: 650; }
.inp-suf.corto { max-width: 150px; }
.mq-tot { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--primario-velo); }
.mq-tot span { font-weight: 750; }
.mq-tot b { font-size: 1.25rem; font-weight: 800; color: var(--primario); }
.grp { display: flex; flex-direction: column; gap: 9px; padding-bottom: 16px; border-bottom: 1px solid var(--linea); }
.grp-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grp-h b { font-size: .95rem; font-weight: 750; margin-right: auto; }
.gn { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--testo); color: var(--sup); font-size: .74rem; font-weight: 800; }
.conta { font-size: .76rem; color: var(--tenue); font-weight: 650; }
.regola { font-size: .79rem; color: var(--tenue); }
.star { color: var(--accento); font-weight: 800; }
.opts { display: flex; flex-direction: column; gap: 6px; }
.opts.due { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.opt { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border: 1px solid var(--linea); border-radius: 12px; cursor: pointer; background: var(--sup); font-size: .9rem; transition: border-color .15s, background-color .15s; }
.opt:hover { border-color: var(--linea-forte); }
.opt input { width: 19px; height: 19px; min-height: 0; margin: 0; flex: none; accent-color: var(--primario); }
.opt:has(input:checked) { border-color: var(--primario); background: color-mix(in srgb, var(--primario-velo) 60%, var(--sup)); }
.opt.off { opacity: .5; cursor: not-allowed; text-decoration: line-through; }
.opt-t { flex: 1; min-width: 0; line-height: 1.35; }
.opt .pct { font-size: .78rem; font-weight: 800; color: var(--tenue); font-variant-numeric: tabular-nums; }
.ct, .pill { display: inline-flex; align-items: center; font-size: .68rem; font-weight: 800; letter-spacing: .03em; padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex: none; }
.c-inf { background: var(--inf-velo); color: var(--inf); }
.c-media { background: var(--media-velo); color: var(--media); }
.c-super { background: var(--super-velo); color: var(--super); }
.pill { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.auto-h { font-size: .8rem; color: var(--tenue); padding: 8px 12px; border-radius: 10px; background: var(--sup-2); }
.auto-h.ok { color: var(--ok); background: var(--ok-velo); font-weight: 650; }
.auto-h.att { color: var(--testo); background: var(--att-velo); }
.riass { display: flex; flex-direction: column; gap: 14px; }
.glob { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; background: var(--sup-2); border: 1px solid var(--linea); flex-wrap: wrap; }
.glob.g-inf { background: var(--inf-velo); border-color: transparent; }
.glob.g-media { background: var(--media-velo); border-color: transparent; }
.glob.g-super { background: var(--super-velo); border-color: transparent; }
.glob-v { font-size: 1.5rem; font-weight: 800; letter-spacing: .01em; }
.g-inf .glob-v { color: var(--inf); } .g-media .glob-v { color: var(--media); } .g-super .glob-v { color: var(--super); }
.glob-why { font-size: .8rem; color: var(--tenue); }
.glob-cnt { display: flex; gap: 6px; flex-wrap: wrap; }
.glob-cnt span { font-size: .74rem; font-weight: 750; padding: 4px 9px; border-radius: 999px; background: var(--sup); }
.schema { border: 1px solid var(--linea); border-radius: 14px; overflow: hidden; }
.schema .sh, .sch-r { display: grid; grid-template-columns: minmax(0, 1fr) 50px 50px 50px; align-items: center; }
.schema .sh { font-size: .68rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--tenue); background: var(--sup-2); padding: 8px 12px; }
.schema .sh span:nth-child(n+2) { text-align: center; }
.sch-r { padding: 7px 12px; border-top: 1px solid var(--linea); font-size: .84rem; }
.sn { display: flex; gap: 8px; align-items: center; }
.sn em { font-style: normal; font-weight: 800; color: var(--tenue); width: 14px; }
.sd { justify-self: center; width: 12px; height: 12px; border-radius: 50%; background: var(--linea); }
.sd.d-inf { background: var(--inf); box-shadow: 0 0 0 3px var(--inf-velo); }
.sd.d-media { background: var(--media); box-shadow: 0 0 0 3px var(--media-velo); }
.sd.d-super { background: var(--super); box-shadow: 0 0 0 3px var(--super-velo); }
.bande-h { display: flex; justify-content: space-between; gap: 10px; font-size: .8rem; margin-bottom: 8px; flex-wrap: wrap; }
.bande { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 8px; }
.banda { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--linea); background: var(--sup); font-size: .76rem; color: var(--tenue); font-weight: 650; }
.banda b { font-size: .9rem; color: var(--testo); font-weight: 750; }
.banda.on { border-color: var(--primario); background: var(--primario-velo); box-shadow: inset 0 0 0 1px var(--primario); }
.banda.on b { color: var(--primario); }
@media (max-width: 480px) { .banda b { font-size: .8rem; } }
.pstat { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pc { display: flex; align-items: center; gap: 10px; }
.pc b { font-size: 2rem; font-weight: 800; color: var(--primario); line-height: 1; }
.pc span { font-size: .76rem; color: var(--tenue); line-height: 1.2; font-weight: 650; }
.scala { display: flex; gap: 6px; flex: 1; min-width: 220px; }
.scala .sc { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 6px; border-radius: 12px; border: 1px solid var(--linea); background: var(--sup); }
.scala .sc b { font-size: .82rem; } .scala .sc em { font-style: normal; font-size: .74rem; color: var(--tenue); font-weight: 650; }
.scala .sc.on { border-color: var(--primario); background: var(--primario-velo); }
.scala .sc.on em, .scala .sc.on b { color: var(--primario); }
.sotto-interr { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; margin-top: -8px; border: 1px solid var(--linea); border-top: 0; border-radius: 0 0 14px 14px; background: var(--sup); }
.fraz-riga { display: flex; flex-wrap: wrap; gap: 16px 24px; }
.fraz-riga > div { display: flex; flex-direction: column; gap: 6px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--linea-forte); border-radius: 12px; overflow: hidden; background: var(--sup); }
.stepper button { width: 44px; height: 44px; border: 0; background: var(--sup-2); font-size: 1.2rem; font-weight: 700; cursor: pointer; }
.stepper button:hover { background: var(--primario-velo); color: var(--primario); }
.stepper input { width: 56px; border: 0; border-radius: 0; text-align: center; font-weight: 800; box-shadow: none !important; padding: 0; }
.stanze { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stanza { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; font-weight: 700; }
.ris-card { border-color: color-mix(in srgb, var(--primario) 30%, var(--linea)); box-shadow: var(--ombra); overflow: hidden; }
.ris-card .card-testa { background: linear-gradient(135deg, var(--hero-1), var(--hero-2)); color: #fff; border-bottom: 0; }
.ris-card .card-testa .tag { background: rgb(255 255 255 / .14); color: #fff; border-color: transparent; }
.ris-vuoto { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 10px 0; color: var(--tenue); font-size: .88rem; }
.ris-vuoto svg { width: 40px; height: 40px; color: var(--primario); opacity: .7; }
.kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpi > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--sup-2); border: 1px solid var(--linea); min-width: 0; }
.kpi > div.max { background: var(--primario-velo); border-color: transparent; }
.kpi span { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--tenue); }
.kpi b { font-size: clamp(1.15rem, 2.2vw, 1.4rem); font-weight: 800; letter-spacing: -.02em; white-space: nowrap; }
.kpi .max b { color: var(--primario); }
.kpi-sub { font-size: .8rem; color: var(--tenue); text-align: center; }
.kpi-sub b { color: var(--testo); }
.canone-ris input { font-size: 1.2rem; font-weight: 800; }
.tbl { width: 100%; border-collapse: collapse; font-size: .8rem; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; color: var(--tenue); font-weight: 800; padding: 6px 4px; border-bottom: 1px solid var(--linea); }
.tbl td { padding: 7px 4px; border-bottom: 1px dashed var(--linea); vertical-align: top; }
.tbl td:nth-child(n+2), .tbl th:nth-child(n+2) { text-align: right; white-space: nowrap; }
.tbl td small { color: var(--tenue); }
.tbl tr.tot td { font-weight: 800; border-top: 1.5px solid var(--testo); border-bottom: 0; }
details.acc-mini { border: 1px solid var(--linea); border-radius: 12px; }
details.acc-mini > summary { list-style: none; cursor: pointer; padding: 10px 13px; font-size: .84rem; font-weight: 750; display: flex; justify-content: space-between; }
details.acc-mini > summary::-webkit-details-marker { display: none; }
details.acc-mini > summary::after { content: "+"; color: var(--tenue); }
details.acc-mini[open] > summary::after { content: "−"; }
details.acc-mini > div { padding: 0 13px 10px; }
.ris-azioni { display: flex; flex-direction: column; gap: 8px; }
.due-btn { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }

/* ---------- 4 · Documenti ---------- */
.filtri { display: flex; gap: 6px; flex-wrap: wrap; }
.filtri button { border: 1px solid var(--linea); background: var(--sup); border-radius: 999px; padding: 6px 14px; font-size: .8rem; font-weight: 650; cursor: pointer; }
.filtri button[aria-pressed="true"] { background: var(--testo); color: var(--sup); border-color: var(--testo); }
.lista-doc { list-style: none; margin: 0; padding: 0; }
.lista-doc > li { border-bottom: 1px solid var(--linea); transition: background-color .2s; }
.lista-doc > li:last-child { border-bottom: 0; }
.doc-riga { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 20px; }
.doc-check { width: 26px; height: 26px; border-radius: 8px; border: 1.5px solid var(--linea-forte); background: var(--sup); cursor: pointer; display: grid; place-items: center; padding: 0; transition: background-color .15s, border-color .15s; }
.doc-check:hover { border-color: var(--ok); }
.doc-check[aria-checked="true"] { background: var(--ok); border-color: var(--ok); }
.doc-check[aria-checked="true"]::after { content: ""; width: 11px; height: 6px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: rotate(-45deg) translate(1px, -1px); }
.doc-nome { font-weight: 750; font-size: .91rem; }
.doc-nome small { display: block; font-weight: 500; color: var(--tenue); font-size: .78rem; }
li.pronto .doc-nome { color: var(--tenue); text-decoration: line-through; text-decoration-color: var(--linea-forte); }
li.pronto .doc-nome small { text-decoration: none; }
.doc-info { border: 0; background: none; color: var(--primario); cursor: pointer; font-size: .8rem; font-weight: 650; padding: 4px; }
.doc-dett { padding: 0 20px 14px 58px; font-size: .86rem; display: flex; flex-direction: column; gap: 4px; }
.prog { display: flex; align-items: center; gap: 12px; }
.prog-barra { flex: 1; height: 9px; border-radius: 5px; background: var(--linea); overflow: hidden; }
.prog-barra i { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--ok) 70%, #fff), var(--ok)); transition: width .3s; border-radius: 5px; }
@media (max-width: 560px) { .doc-riga { grid-template-columns: auto minmax(0, 1fr) auto; padding-inline: 16px; } .doc-riga .tag { display: none; } .doc-dett { padding-left: 54px; } }

/* ---------- Sblocco (pagamento) ---------- */
.paywall { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 0; overflow: hidden; }
@media (max-width: 900px) { .paywall { grid-template-columns: 1fr; } }
.pw-anteprima { position: relative; background: var(--sup-2); padding: 24px; overflow: hidden; max-height: 560px; border-right: 1px solid var(--linea); }
.pw-anteprima .foglio { transform: scale(.82); transform-origin: top center; filter: blur(1.4px); pointer-events: none; user-select: none; }
.pw-anteprima::after { content: ""; position: absolute; inset: auto 0 0 0; height: 55%; background: linear-gradient(transparent, var(--sup-2)); }
@media (max-width: 900px) { .pw-anteprima { max-height: 240px; border-right: 0; border-bottom: 1px solid var(--linea); } }
.pw-offerta { padding: 26px; display: flex; flex-direction: column; gap: 16px; }
.pw-prezzo { font-size: 2.8rem; font-weight: 800; letter-spacing: -.04em; font-variant-numeric: tabular-nums; line-height: 1; }
.pw-prezzo small { display: inline-block; white-space: nowrap; font-size: .85rem; font-weight: 600; color: var(--tenue); letter-spacing: 0; }
.pw-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: .9rem; }
.pw-lista li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 9px; }
.pw-lista li::before { content: "✓"; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--ok-velo); color: var(--ok); font-size: .72rem; font-weight: 800; margin-top: 1px; }
.pp-bottoni { min-height: 48px; }
.pp-bottoni:empty { border-radius: 10px; background: linear-gradient(90deg, var(--sup-2), var(--linea), var(--sup-2)); background-size: 200% 100%; animation: pp-luce 1.4s linear infinite; }
@keyframes pp-luce { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .pp-bottoni:empty { animation: none; } }
.pw-finto .pw-titolo { font-size: 1.15rem; text-align: center; text-transform: uppercase; margin: 0 0 18px; }
.pw-finto .pw-tit { font-size: .95rem; margin: 18px 0 8px; }
.pw-finto .pw-riga { display: block; height: 9px; margin: 0 0 8px; border-radius: 4px; background: currentColor; opacity: .16; }
.attesa-modulo .card-corpo { padding: 32px 26px; }
.attesa-testo { display: flex; align-items: center; gap: 12px; margin: 0; font-weight: 600; }
.rotella { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--linea); border-top-color: var(--primario); animation: rotella .8s linear infinite; }
@keyframes rotella { to { transform: rotate(360deg); } }
.pw-codice-box { display: flex; flex-direction: column; gap: 7px; padding-top: 14px; border-top: 1px solid var(--linea); }
.pw-codice { display: flex; gap: 8px; }
.pw-codice input { text-transform: uppercase; letter-spacing: .06em; }
.pw-sicuro { display: flex; align-items: center; gap: 8px; font-size: .78rem; color: var(--tenue); }

/* ---------- Dati: modulo + anteprima ---------- */
.dati-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
/* Nei passi larghi (dati, calcolo) il riepilogo diventa un pannello a scomparsa per lasciare spazio. */
@media (min-width: 1181px) {
  body.largo .shell { grid-template-columns: 252px minmax(0, 1fr); }
  body.largo .rail { position: fixed; z-index: 50; inset: 0 0 0 auto; width: 360px; top: 0; background: var(--bg); box-shadow: -12px 0 30px rgb(0 0 0 / .2);
    padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 16px 16px; overflow-y: auto; transform: translateX(105%); transition: transform .25s ease, visibility .25s; visibility: hidden; }
  body.largo .rail.aperto { transform: none; visibility: visible; }
  body.largo .solo-mobile, body.largo .chiudi-rail { display: inline-flex; }
}
@media (min-width: 1280px) {
  body.largo .dati-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  body.largo .anteprima { position: sticky; top: calc(var(--topbar) + 26px); }
  body.largo .ant-corpo { max-height: calc(100vh - 260px); }
}
.capitolo { background: var(--sup); border: 1px solid var(--linea); border-radius: var(--r-l); scroll-margin-top: 96px; transition: border-color .2s; }
.capitolo[open] { box-shadow: var(--ombra); }
.capitolo > summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 16px 20px; cursor: pointer; }
.capitolo > summary::-webkit-details-marker { display: none; }
.capitolo > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--tenue); border-bottom: 2px solid var(--tenue); transform: rotate(45deg); transition: transform .2s; margin-right: 4px; }
.capitolo[open] > summary::after { transform: rotate(-135deg); }
.capitolo[open] > summary { border-bottom: 1px solid var(--linea); }
.cap-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--linea-forte); font-size: .76rem; font-weight: 800; color: var(--tenue); transition: background-color .2s, border-color .2s; }
.capitolo.completo .cap-num { background: var(--ok); border-color: var(--ok); color: #fff; }
.cap-conta { font-size: .75rem; font-weight: 700; color: var(--tenue); padding: 3px 9px; border-radius: 999px; background: var(--sup-2); border: 1px solid var(--linea); font-variant-numeric: tabular-nums; }
.capitolo.completo .cap-conta { color: var(--ok); background: var(--ok-velo); border-color: transparent; }
.cap-corpo { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
fieldset.persona { border: 1px solid var(--linea); border-radius: 14px; padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 12px; min-width: 0; background: var(--sup-2); }
fieldset.persona legend { font-weight: 750; font-size: .86rem; padding: 0 6px; }
.capitoli { display: flex; flex-direction: column; gap: 10px; }
.anteprima { background: var(--sup); border: 1px solid var(--linea); border-radius: var(--r-l); overflow: hidden; }
.anteprima > summary::-webkit-details-marker { display: none; }
.anteprima:not([open]) .ant-testa { border-bottom: 0; }
.ant-testa { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--linea); background: var(--sup-2); }
.ant-corpo { overflow: auto; padding: 18px; background: var(--sup-2); position: relative; max-height: 75vh; }
.vivo { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: var(--tenue); }
.vivo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }

/* Schede (tabs) */
.tabs { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--linea); border-radius: 12px; background: var(--sup-2); max-width: 100%; }
.tabs button { border: 0; background: none; padding: 7px 13px; font-size: .82rem; font-weight: 650; cursor: pointer; border-radius: 9px; color: var(--tenue); white-space: nowrap; }
@media (max-width: 420px) { .tabs button { padding: 7px 10px; } }
.tabs button[aria-selected="true"] { background: var(--sup); color: var(--primario); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 0 0 1px var(--linea); }

/* ---------- Documento (foglio A4): stesso carattere del PDF ---------- */
.foglio { background: var(--carta); color: #121a26; box-shadow: var(--ombra-foglio); border-radius: 3px; max-width: 760px; margin: 0 auto; width: 100%; }
.documento { font-family: var(--f-doc); font-size: .98rem; line-height: 1.55; padding: clamp(22px, 6vw, 64px) clamp(18px, 6vw, 68px); display: flex; flex-direction: column; gap: 10px; overflow-wrap: anywhere; color: #121a26; }
.documento h3 { font-family: var(--f-doc); font-size: 1rem; font-weight: 700; margin-top: 10px; text-align: center; color: #121a26; }
.documento p { text-align: left; hyphens: auto; }
@media (min-width: 760px) { .documento p { text-align: justify; } }
.doc-testa { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 6px; }
.doc-titolo { align-self: stretch; text-align: center; font-family: var(--f-doc); font-weight: 700; font-size: 1.12rem; letter-spacing: .02em; color: #121a26; }
.doc-titolo small { display: block; font-weight: 400; font-size: .86rem; letter-spacing: 0; color: #121a26; margin-top: 4px; }
.documento .mono { font-family: var(--f-doc); }
.vuoto { background: #fff3d9; color: #8a5a0a; border-radius: 2px; letter-spacing: .05em; }
.val { border-radius: 3px; transition: background-color .9s; }
.val.lampo { background: #d9e3ff; transition: none; }
.firme { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 22px; }
.firme div { border-top: 1px solid #121a26; padding-top: 4px; text-align: center; font-family: var(--f-doc); font-size: .86rem; color: #121a26; }
.firma-luogo { margin-top: 12px; }
.firma-riga { margin-top: 14px; }
.documento h3 em { font-weight: 400; }
.documento .piccolo { font-size: .8rem; color: #5a6577; }
.documento table { width: 100%; border-collapse: collapse; font-size: .82rem; line-height: 1.3; margin: 2px 0 6px; }
.documento th, .documento td { border: 1px solid #8a93a6; padding: 4px 7px; text-align: left; vertical-align: top; }
.documento th { background: #eef0f5; font-weight: 700; }
.documento td:nth-child(n+2), .documento th:nth-child(n+2) { text-align: center; white-space: nowrap; }
.documento ul { margin: 0; padding-left: 1.3em; }
.documento .elenco-doc { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 24px; }
@media (max-width: 520px) { .documento .elenco-doc { columns: 1; } }

/* ---------- Documenti finali ---------- */
.barra-doc { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--linea); background: var(--sup); position: sticky; top: var(--topbar); z-index: 5; border-radius: var(--r-l) var(--r-l) 0 0; }
.barra-doc .azioni-doc { display: flex; gap: 8px; flex-wrap: wrap; }
.visore { background: var(--sup-2); padding: 24px 16px; border-radius: 0 0 var(--r-l) var(--r-l); }
.nota-doc { margin: 0; padding: 10px 14px; min-height: 3.6em; font-size: .82rem; color: var(--tenue); background: var(--sup); }
.scadenze { list-style: none; margin: 0; padding: 0; }
.scadenze li { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 14px; padding: 14px 20px; border-bottom: 1px solid var(--linea); font-size: .88rem; }
.scadenze li:last-child { border-bottom: 0; }
.scadenze .quando { font-size: .72rem; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--primario); padding-top: 2px; display: flex; flex-direction: column; gap: 2px; }
.scadenze .quando b { font-size: .9rem; text-transform: none; letter-spacing: 0; color: var(--testo); font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) { .scadenze li { grid-template-columns: 1fr; gap: 2px; padding-inline: 16px; } }
.mancanti { margin: 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; font-size: .86rem; }
.mancanti button { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; border: 0; background: none; padding: 7px 8px; margin-left: -8px; border-radius: 9px; cursor: pointer; color: var(--testo); }
.mancanti button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--att); flex: none; }
.mancanti button::after { content: "→"; margin-left: auto; color: var(--primario); opacity: 0; transition: opacity .15s; }
.mancanti button:hover { background: var(--att-velo); }
.mancanti button:hover::after, .mancanti button:focus-visible::after { opacity: 1; }

/* ---------- Finestre (archivio pratiche, fogli del calcolo) ---------- */
dialog.finestra { border: 0; padding: 0; border-radius: 22px; width: min(760px, calc(100vw - 32px)); max-height: min(86vh, 900px); background: var(--bg); color: var(--testo); box-shadow: var(--ombra-alta); overflow: hidden; }
dialog.finestra[open] { display: flex; flex-direction: column; animation: sale .22s ease; }
dialog.finestra::backdrop { background: rgb(5 9 25 / .55); backdrop-filter: blur(3px); }
dialog.fogli-dlg { width: min(1040px, calc(100vw - 32px)); max-height: 92vh; }
@keyframes sale { from { opacity: 0; } }
@media (max-width: 640px) {
  dialog.finestra { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
}
.fin-testa { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--linea); background: var(--sup); flex-wrap: wrap; }
.fin-testa h2 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.025em; }
.fin-testa-az { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.fin-azioni { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px; border-bottom: 1px solid var(--linea); background: var(--sup); }
.fin-corpo { overflow: auto; padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 10px; }
.fin-piede { padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--linea); font-size: .78rem; color: var(--tenue); background: var(--sup); }
.pratica-voce { background: var(--sup); border: 1px solid var(--linea); border-radius: 16px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; align-items: center; }
.pratica-voce.corrente { border-color: var(--primario); box-shadow: 0 0 0 1px var(--primario); }
.pv-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pv-titolo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-weight: 750; }
.pv-sub { font-size: .8rem; color: var(--tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-id { font-size: .74rem; color: var(--tenue); font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.pv-azioni { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
@media (max-width: 560px) { .pratica-voce { grid-template-columns: 1fr; } .pv-azioni { justify-content: flex-start; } }
.vuoto-archivio { text-align: center; padding: 30px 10px; color: var(--tenue); font-size: .9rem; }

/* ---------- Fogli del calcolo (conteggio e Allegato B) ----------
 * Stile identico ai fogli del calcolatore originale (Times, Courier, Arial; blu #00308f, verde #008a00).
 * Il PDF li ricostruisce misurando queste stesse regole, quindi anteprima, stampa e PDF coincidono. */
.fogli { background: var(--sup-2); gap: 18px; }
.fogli .sheet { background: #fff; color: #000; border-radius: 4px; box-shadow: 0 2px 14px rgba(0,0,0,.14); padding: 22px 20px; margin: 0 auto; overflow-x: auto; width: 100%; max-width: 900px; }
.area-stampa { display: none; }
@media screen { .ufsheet > * { min-width: 620px; } .absheet > * { min-width: 840px; } }
.ufsheet { font-family: "Times New Roman", Georgia, serif; color: #000; font-size: 12pt; line-height: 1.28; max-width: 760px; margin: 0 auto; }
.ufsheet .lr { display: flex; align-items: flex-end; margin-bottom: 5px; white-space: nowrap; }
.ufsheet .lr .lbl { font-weight: bold; flex: 0 0 auto; display: inline; font-size: inherit; color: #000; margin: 0; }
.ufsheet .lr .fill { flex: 1 1 auto; border-bottom: 1.2px dotted #000; margin: 0 6px 3px; text-align: center; font-family: "Courier New", monospace; font-weight: bold; font-size: 11pt; color: #00308f; min-width: 16px; }
.ufsheet .lr .pct { font-weight: bold; flex: 0 0 auto; }
.ufsheet ol.f { list-style: none; margin: 7px 0 0; padding: 0; }
.ufsheet ol.f li { display: flex; align-items: flex-end; margin-bottom: 3.5px; white-space: nowrap; }
.ufsheet ol.f li .t { flex: 0 0 auto; }
.ufsheet ol.f li .fl { flex: 1 1 auto; border-bottom: 1.2px dotted #000; margin: 0 0 3px 8px; position: relative; }
.ufsheet ol.f li .ck { position: absolute; left: 8px; bottom: 0; color: #008a00; font-weight: bold; font-size: 13pt; font-family: Arial, sans-serif; }
.ufsheet .cb2 { margin-top: 12px; border: 1.4px solid #00308f; border-radius: 4px; padding: 8px 10px; }
.ufsheet .cb2 .t { font-weight: bold; color: #00308f; font-family: Arial, sans-serif; margin-bottom: 5px; font-size: 10.5pt; }
.ufsheet .cb2 .r { font-family: "Courier New", monospace; font-size: 9.5pt; margin: 2px 0; white-space: normal; }
.ufsheet .cb2 .r b { color: #00308f; }
.absheet { font-family: Arial, Helvetica, sans-serif; color: #000; font-size: 8.3pt; line-height: 1.12; }
.absheet .atitle { text-align: center; font-size: 15pt; letter-spacing: 1px; margin: 0 0 2px; }
.absheet .atitle .al { font-size: 11pt; margin-left: 24px; }
.absheet .aimmo { text-align: center; font-size: 8.6pt; margin: 0 0 7px; }
.absheet .cols { display: flex; gap: 10px; align-items: flex-start; }
.absheet .col { flex: 1 1 50%; }
.absheet table { border-collapse: collapse; width: 100%; margin-bottom: 7px; table-layout: fixed; }
.absheet td, .absheet th { border: .8px solid #000; padding: 2px 4px; vertical-align: middle; }
.absheet .cb { width: 34px; text-align: center; }
.absheet .nc { width: 20px; text-align: center; font-weight: bold; }
.absheet tr.sec td { font-weight: bold; }
.absheet th.cb { font-weight: bold; font-size: 6.6pt; padding: 2px 1px; letter-spacing: -.2px; }
.absheet .xx { color: #00308f; font-weight: bold; font-size: 10pt; }
.absheet .nb { border: 0; padding: 3px 2px 6px; font-style: italic; font-size: 7.3pt; line-height: 1.22; }
.absheet .nb b { font-style: normal; }
.absheet .gt { font-size: 7.7pt; line-height: 1.3; padding: 4px 2px; }
.absheet .gt .lista { margin: 3px 0; }
.absheet .gt .li { position: relative; padding-left: 15px; }
.absheet .gt .bul { position: absolute; left: 4px; }
.absheet .gres { margin-top: 4px; font-size: 8.8pt; }
.absheet .gres b { color: #00308f; font-size: 11pt; letter-spacing: .4px; }
/* Area nascosta in cui il PDF misura i fogli alla larghezza della pagina stampata. */
.misura-fogli { position: absolute; left: -12000px; top: 0; background: #fff; pointer-events: none; }
.misura-fogli .sheet { padding: 0; margin: 0; box-shadow: none; border-radius: 0; overflow: visible; max-width: none; }
.misura-fogli .ufsheet > *, .misura-fogli .absheet > * { min-width: 0 !important; }
/* Nei documenti finali la scheda "Conteggio" mostra i 2 fogli. */
.foglio.foglio-conteggio { background: none; box-shadow: none; max-width: 900px; display: flex; flex-direction: column; gap: 18px; }

/* ---------- Guida "Cosa fare adesso" (ultima pagina del PDF) ----------
 * Solo Arial e colori pieni: il PDF la ricostruisce misurandone l'impaginazione (come i fogli del calcolo). */
.guida { font-family: Arial, Helvetica, sans-serif; color: #0b1430; background: #fff; font-size: 11.5px; line-height: 1.42; width: 100%; max-width: 688px; margin: 0 auto; }
.guida p { margin: 0 0 4px; }
.guida .g-testa { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; border-bottom: 2.5px solid #2148d8; padding-bottom: 9px; margin-bottom: 12px; }
.guida h2 { font-family: Arial, Helvetica, sans-serif; font-size: 23px; font-weight: bold; letter-spacing: .5px; margin: 0 0 2px; color: #0b1430; }
.guida .g-sub { font-size: 10.5px; color: #566079; margin: 0; }
.guida .g-logo { font-size: 17px; font-weight: bold; color: #0b1430; white-space: nowrap; }
.guida .g-logo i { font-style: normal; color: #e4570f; }
.guida .g-passo { display: flex; gap: 11px; padding: 10px 12px; margin-bottom: 9px; border: 1px solid #dde3ee; border-radius: 10px; }
.guida .g-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #2148d8; color: #fff; font-weight: bold; font-size: 13.5px; display: flex; align-items: center; justify-content: center; }
.guida .g-corpo { flex: 1; min-width: 0; }
.guida h3 { font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; margin: 3px 0 5px; color: #0b1430; text-align: left; }
.guida b { font-weight: bold; }
.guida .g-piccolo { font-size: 10px; color: #566079; }
.guida .g-uppi { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px; margin: 6px 0 2px; align-items: stretch; }
.guida .mappa { position: relative; aspect-ratio: 400 / 230; border-radius: 8px; overflow: hidden; border: 1px solid #dde3ee; }
.guida .mappa svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.guida .m-et { position: absolute; transform: translate(-50%, -50%); font-size: 9.5px; color: #3c465e; white-space: nowrap; }
.guida .m-et.sx { transform: translate(0, -50%); }
.guida .m-et.dx { transform: translate(-100%, -50%); }
.guida .g-nb { white-space: nowrap; }
.guida .m-et.forte { font-size: 12px; font-weight: bold; color: #5a3410; letter-spacing: 1px; }
.guida .m-et.piccola { font-size: 8.5px; color: #566079; }
.guida .m-et.corsivo { font-style: italic; color: #8a6a35; }
.guida .m-uppi { position: absolute; background: #fff; border: 1.5px solid #e4570f; border-radius: 6px; padding: 3px 6px; font-size: 9px; line-height: 1.25; color: #0b1430; white-space: nowrap; }
.guida .m-uppi b { color: #e4570f; font-size: 10.5px; }
.guida .g-info { background: #f1f4fb; border-radius: 8px; padding: 9px 11px; font-size: 10.5px; }
.guida .g-info-tit { font-weight: bold; font-size: 11px; color: #1636b0; }
.guida .g-soldi { display: flex; align-items: center; gap: 14px; }
.guida .g-euro { font-size: 30px; font-weight: bold; color: #e4570f; background: #fff0e7; border-radius: 10px; padding: 4px 12px; }
.guida .g-data { display: inline-block; font-weight: bold; color: #c2410c; background: #fff0e7; border-radius: 999px; padding: 1px 9px; margin-right: 4px; }
.guida .g-opz { border-left: 3px solid #2148d8; padding: 2px 0 2px 10px; margin: 6px 0; }
.guida .g-opz-tit { font-weight: bold; color: #1636b0; margin-bottom: 2px; }
.guida .g-voce { position: relative; padding-left: 12px; margin-bottom: 1px; }
.guida .g-pt { position: absolute; left: 2px; }
.guida .g-tasse { background: #f1f4fb; border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.guida .g-dopo { background: #eaf7ee; border-radius: 10px; padding: 9px 12px; margin-bottom: 8px; }
.guida .g-nota { font-size: 9.5px; color: #566079; }
.misura-fogli .guida { max-width: none; margin: 0; }
/* Nei documenti finali la scheda "Cosa fare dopo" mostra la guida come un foglio. */
.foglio.foglio-guida { padding: clamp(16px, 4vw, 40px); }
.foglio.foglio-guida .guida { max-width: 688px; }
@media (max-width: 560px) { .foglio.foglio-guida .g-uppi { grid-template-columns: 1fr; } }

/* ---------- Notifiche ---------- */
.toast-zona { position: fixed; left: 16px; right: 16px; bottom: calc(104px + env(safe-area-inset-bottom, 0px)); height: 0; z-index: 80; pointer-events: none; }
.toast { position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: max-content; max-width: 100%; background: var(--testo); color: var(--sup); padding: 11px 17px; border-radius: 14px; font-size: .87rem; font-weight: 650; box-shadow: var(--ombra-alta); animation: toast-in .25s ease; display: flex; align-items: center; gap: 9px; }
.toast::before { content: "✓"; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--ok); color: #fff; font-size: .68rem; flex: none; }
.toast.errore::before { content: "!"; background: var(--ko); }
.toast.esce { opacity: 0; transition: opacity .25s; }
@keyframes toast-in { from { opacity: 0; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }

/* ---------- Stampa: solo il documento visibile, oppure solo i fogli del calcolo ---------- */
@media print {
  @page { margin: 18mm 16mm; }
  @page sched { size: A4 portrait; margin: 9mm 14mm; }
  @page alleg { size: A4 landscape; margin: 9mm 10mm; }
  body { background: #fff; }
  body::before, .topbar, .sidebar, .rail, .piede, .barra-azioni, .toast-zona, dialog, .vista > *:not(.card-doc), .card-doc > *:not(.visore) { display: none !important; }
  .shell { display: block; padding: 0; }
  .visore { background: #fff; padding: 0; }
  .foglio { box-shadow: none; max-width: none; }
  .documento { padding: 0; font-size: 11pt; }
  .vuoto { background: none; color: #000; }
  body.stampa-fogli > *:not(.area-stampa) { display: none !important; }
  body.stampa-fogli .area-stampa { display: block !important; }
  .area-stampa .sheet { padding: 0; box-shadow: none; }
  .ufsheet > *, .absheet > * { min-width: 0 !important; }
  .area-stampa .ufsheet { page: sched; max-width: 720px; }
  .area-stampa .absheet { page: alleg; break-before: page; }
  .area-stampa .guida { page: sched; max-width: none; }
}
