* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --verde: #0c6b60; --verde2: #13a184; --verde3: #3cc8a0; --verdechiaro: #dcf5ee;
  --arancio1: #ff9f5a; --arancio2: #ff6b5e; --blu1: #5b8cff; --blu2: #3f63e0; --viola1: #a77bff; --viola2: #7b52e8; --rosa: #e85d9a;
  --oro1: #ffd166; --oro2: #ffb03b;
  --testo: #18212b; --tenue: #6f7b88; --sfondo: #f4f6fa; --linea: #e6eaf0; --rosso: #c23b3b;
  --ombra: 0 6px 18px rgba(20,40,60,0.07);
}
html, body { background: #e9eef3; }
body { font-family: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--testo); font-size: 15px; line-height: 1.4; }
button, input, select, textarea { font: inherit; color: inherit; }
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--sfondo); position: relative; display: flex; flex-direction: column; box-shadow: 0 0 40px rgba(20,40,60,0.08); }
.caricamento { padding: 40px; text-align: center; color: var(--tenue); }

/* testata */
.hero { background: linear-gradient(140deg, var(--verde) 0%, var(--verde2) 60%, var(--verde3) 100%); color: #fff; padding: 14px 0 22px; border-radius: 0 0 28px 28px; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -60px; top: -40px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,0.09); pointer-events: none; }
.hero::before { content: ""; position: absolute; left: -50px; bottom: -70px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.07); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.testa { padding: 4px 20px 0; display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.logo { font-size: 24px; font-weight: 700; letter-spacing: -0.3px; display: flex; align-items: baseline; }
.logo .ri { font-family: "Roboto Slab", Georgia, serif; font-weight: 700; letter-spacing: 0.5px; }
.logo .parto { opacity: 0.8; font-weight: 600; }
.indietro { background: none; border: none; color: #fff; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 0; }
.icona-btn { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.2); border: 1.5px solid rgba(255,255,255,0.45); color: #fff; font-size: 17px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.hh { font-size: 25px; font-weight: 700; padding: 6px 20px 0; }
.sub { font-size: 13.5px; opacity: 0.88; padding: 2px 20px 0; }

/* corpo */
.corpo { flex: 1; padding: 16px 16px 110px; }
.card { background: #fff; border-radius: 20px; padding: 16px; margin-bottom: 14px; box-shadow: var(--ombra); }
.tit { font-size: 12px; font-weight: 700; color: var(--tenue); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.tit a, .tit button { text-transform: none; letter-spacing: 0; color: var(--verde2); background: none; border: none; font-weight: 700; font-size: 13px; cursor: pointer; text-decoration: none; }
.nota { font-size: 13px; color: var(--tenue); line-height: 1.45; }
.vuoto { text-align: center; padding: 18px 8px; color: var(--tenue); font-size: 14px; }
.vuoto .grande { font-size: 40px; display: block; margin-bottom: 6px; }
h3 { font-size: 16px; margin-bottom: 6px; }
p + p { margin-top: 8px; }

/* bottoni */
.bottone { display: block; width: 100%; border: none; cursor: pointer; background: linear-gradient(140deg, var(--verde), var(--verde2)); color: #fff; text-align: center; font-weight: 700; font-size: 16px; border-radius: 16px; padding: 15px; margin-top: 12px; box-shadow: 0 8px 18px rgba(19,161,132,0.3); text-decoration: none; }
.bottone.ar { background: linear-gradient(140deg, #ff8a4c, #ff5e62); box-shadow: 0 8px 18px rgba(255,94,98,0.3); }
.bottone.chiaro { background: #fff; color: var(--verde); border: 2px solid var(--verde2); box-shadow: none; }
.bottone.piccolo { font-size: 14px; padding: 11px; border-radius: 13px; }
.bottone.pericolo { background: #fff; color: var(--rosso); border: 2px solid #f1c4c4; box-shadow: none; }
.bottone:disabled { opacity: 0.45; cursor: default; }
.riga-btn { display: flex; gap: 10px; }
.riga-btn .bottone { flex: 1; }

/* campi */
.campo { margin-bottom: 12px; }
.campo label { display: block; font-size: 12.5px; font-weight: 700; color: var(--tenue); margin-bottom: 5px; }
.campo input, .campo select, .campo textarea { width: 100%; border: 1.5px solid #d7dee6; border-radius: 13px; padding: 12px 13px; font-size: 16px; background: #fff; outline: none; }
.campo input:focus, .campo select:focus, .campo textarea:focus { border-color: var(--verde2); }
.campo textarea { min-height: 90px; resize: vertical; }
.campi2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.spunta { display: flex; align-items: center; gap: 10px; padding: 10px 0; font-size: 15px; cursor: pointer; }
.spunta input { width: 22px; height: 22px; accent-color: var(--verde2); }

/* segmentato */
.seg { display: flex; background: #e9edf3; border-radius: 14px; padding: 4px; margin-bottom: 14px; }
.seg button { flex: 1; text-align: center; font-size: 13.5px; font-weight: 700; padding: 9px 4px; border-radius: 11px; color: var(--tenue); border: none; background: none; cursor: pointer; }
.seg button.on { background: #fff; color: var(--verde); box-shadow: 0 2px 8px rgba(20,40,60,0.1); }
.seg button .lucch { font-size: 11px; }

/* primo accesso */
.illu { height: 170px; display: flex; align-items: center; justify-content: center; position: relative; }
.casa { font-size: 82px; filter: drop-shadow(0 10px 14px rgba(0,0,0,0.18)); }
.bolla { position: absolute; background: #fff; border-radius: 14px; padding: 6px 10px; font-size: 12px; font-weight: 700; color: var(--testo); box-shadow: 0 6px 14px rgba(0,0,0,0.15); }
.b1 { left: 22px; top: 22px; } .b2 { right: 20px; top: 52px; } .b3 { left: 40px; bottom: 12px; }
.scelte { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sc { background: #fff; border-radius: 18px; padding: 14px 12px; box-shadow: var(--ombra); border: 2px solid transparent; position: relative; cursor: pointer; text-align: left; }
.sc.on { border-color: var(--verde2); }
.sc .ic { width: 44px; height: 44px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 10px; }
.sc .t { font-size: 14.5px; font-weight: 700; line-height: 1.2; }
.sc .d { font-size: 12px; color: var(--tenue); margin-top: 4px; line-height: 1.3; }
.sc .ok { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; border-radius: 50%; background: var(--verde2); color: #fff; font-size: 13px; font-weight: 700; display: none; align-items: center; justify-content: center; }
.sc.on .ok { display: flex; }
.rass { text-align: center; font-size: 12.5px; color: var(--tenue); margin-top: 10px; }

/* home */
.saldo { display: flex; align-items: center; gap: 16px; padding: 14px 20px 0; }
.anello { width: 86px; height: 86px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.anello div { width: 66px; height: 66px; border-radius: 50%; background: #11907a; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 700; }
.saldo .l { font-size: 12.5px; opacity: 0.88; }
.saldo .v { font-size: 28px; font-weight: 700; letter-spacing: -0.5px; }
.saldo .x { font-size: 12.5px; margin-top: 2px; }
.pill { display: inline-block; white-space: nowrap; background: #ffe1e1; color: var(--rosso); font-size: 11px; font-weight: 700; border-radius: 20px; padding: 3px 9px; }
.pill.ok { background: var(--verdechiaro); color: var(--verde); }
.pill.oro { background: #fff1d6; color: #a36a00; }
.voce { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--linea); cursor: pointer; text-decoration: none; color: inherit; }
.voce:first-of-type { border-top: none; }
.data { width: 48px; height: 48px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.data .g { font-size: 18px; font-weight: 700; line-height: 1; }
.data .m { font-size: 10px; font-weight: 700; opacity: 0.92; }
.c-arancio { background: linear-gradient(140deg, var(--arancio1), var(--arancio2)); }
.c-blu { background: linear-gradient(140deg, var(--blu1), var(--blu2)); }
.c-viola { background: linear-gradient(140deg, var(--viola1), var(--viola2)); }
.c-verde { background: linear-gradient(140deg, var(--verde2), var(--verde)); }
.c-grigio { background: linear-gradient(140deg, #9aa5b1, #7a8592); }
.voce .t { font-size: 14.5px; font-weight: 700; }
.voce .d { font-size: 12.5px; color: var(--tenue); }
.voce .fr { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--tenue); text-align: right; white-space: nowrap; }
.voce .imp { margin-left: auto; font-size: 15px; font-weight: 700; white-space: nowrap; }
.icona-q { width: 42px; height: 42px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0; background: #eef2f7; }

/* persone e quote */
.pers { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.ini { width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.pers .info { flex: 1; min-width: 0; }
.pers .n { font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pers .s { font-size: 12px; color: var(--tenue); }
.pers .bar { height: 6px; background: #eef1f5; border-radius: 4px; margin-top: 5px; overflow: hidden; }
.pers .bar div { height: 100%; border-radius: 4px; }
.pers .q { font-size: 14.5px; font-weight: 700; text-align: right; white-space: nowrap; }
.tag { white-space: nowrap; font-size: 10.5px; font-weight: 700; background: #fff1d6; color: #a36a00; border-radius: 6px; padding: 1px 6px; margin-left: 4px; }
.pagato { border: none; cursor: pointer; font-size: 11.5px; font-weight: 700; border-radius: 20px; padding: 5px 10px; background: #ffe1e1; color: var(--rosso); white-space: nowrap; }
.pagato.si { background: var(--verdechiaro); color: var(--verde); }
.totale { display: flex; justify-content: space-between; font-weight: 700; border-top: 2px solid var(--testo); padding-top: 10px; margin-top: 6px; }

/* importo grande */
.importo { text-align: center; padding: 8px 20px 0; }
.importo .l { font-size: 13.5px; opacity: 0.88; }
.importo .v { font-size: 42px; font-weight: 700; letter-spacing: -1px; }
.chip { display: inline-block; background: rgba(255,255,255,0.2); border-radius: 20px; padding: 5px 12px; font-size: 12.5px; font-weight: 700; margin-top: 2px; }

/* strumenti */
.griglia { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool { border-radius: 20px; padding: 14px 12px; color: #fff; min-height: 122px; position: relative; overflow: hidden; cursor: pointer; text-decoration: none; display: block; }
.tool .ic { font-size: 26px; }
.tool .t { font-size: 14.5px; font-weight: 700; margin-top: 8px; line-height: 1.2; }
.tool .d { font-size: 11.5px; opacity: 0.92; margin-top: 3px; line-height: 1.3; }
.tool .lab { position: absolute; top: 12px; right: 10px; font-size: 9.5px; font-weight: 700; background: rgba(255,255,255,0.25); border-radius: 6px; padding: 2px 6px; }
.t1 { background: linear-gradient(140deg, var(--verde2), var(--verde)); }
.t2 { background: linear-gradient(140deg, var(--blu1), var(--blu2)); }
.t3 { background: linear-gradient(140deg, var(--viola1), var(--viola2)); }
.t4 { background: linear-gradient(140deg, var(--arancio1), var(--arancio2)); }
.t5 { background: linear-gradient(140deg, #f07aa8, #d9467f); }
.t6 { background: linear-gradient(140deg, #3fb5d8, #1f84b5); }
.premium { margin-top: 14px; border-radius: 20px; padding: 16px; background: linear-gradient(140deg, #1c2633, #2d3b4f); color: #fff; position: relative; overflow: hidden; }
.premium .stella { position: absolute; right: 14px; top: 10px; font-size: 30px; }
.premium .t { font-size: 16px; font-weight: 700; }
.premium .d { font-size: 12.5px; color: #c3ccd7; margin: 5px 0 10px; line-height: 1.4; padding-right: 30px; }
.premium .presto { display: inline-block; background: linear-gradient(140deg, var(--oro1), var(--oro2)); color: #3a2a00; font-weight: 700; font-size: 12.5px; border-radius: 10px; padding: 7px 12px; }
.blocco-pro { border: 2px dashed #e2c98f; background: #fffaf0; border-radius: 16px; padding: 12px 14px; font-size: 13px; color: #7a5600; margin: 10px 0; }

/* esiti */
.esito { border-radius: 16px; padding: 14px; margin: 10px 0; }
.esito.si { background: var(--verdechiaro); color: #0b4f46; }
.esito.no { background: #ffe9e9; color: #8e2222; }
.esito.forse { background: #fff3dc; color: #7a5600; }
.esito .t { font-weight: 700; font-size: 15.5px; margin-bottom: 4px; }
.esito ul { margin: 6px 0 0 0; font-size: 13.5px; list-style: none; }
.esito li { margin: 3px 0; }
.lista { margin: 4px 0 0 18px; }
.lista li { margin: 4px 0; font-size: 14px; }

/* lettere */
.lettera { background: #fff; border: 1.5px solid #d7dee6; border-radius: 14px; padding: 14px; font-size: 14px; white-space: pre-wrap; line-height: 1.5; font-family: inherit; }

/* firma condivisione */
.firma { margin-top: 6px; border-radius: 18px; padding: 12px 14px; background: linear-gradient(140deg, #e3f6f1, #e6ecff); display: flex; align-items: center; gap: 10px; }
.firma .t { font-size: 13px; font-weight: 700; color: var(--verde); }
.firma .d { font-size: 12px; color: #55606c; }

/* barra in basso */
.nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 74px; background: #fff; display: flex; justify-content: space-around; align-items: center; font-size: 11px; color: #8b95a1; box-shadow: 0 -4px 16px rgba(20,40,60,0.08); z-index: 20; padding-bottom: env(safe-area-inset-bottom); }
.nav a { text-align: center; color: inherit; text-decoration: none; min-width: 58px; }
.nav .ic { font-size: 20px; display: block; filter: grayscale(1); opacity: 0.55; }
.nav .on { color: var(--verde); font-weight: 700; }
.nav .on .ic { filter: none; opacity: 1; }
.fab { width: 56px; height: 56px; border-radius: 18px; background: linear-gradient(140deg, #ff8a4c, #ff5e62); color: #fff !important; font-size: 30px; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(255,94,98,0.45); margin-top: -28px; min-width: 56px !important; }

/* avviso in basso */
.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); background: #18212b; color: #fff; padding: 11px 16px; border-radius: 14px; font-size: 14px; z-index: 50; max-width: 90%; box-shadow: 0 8px 20px rgba(0,0,0,0.25); }
.sotto-nota { font-size: 11.5px; color: var(--tenue); text-align: center; margin-top: 14px; line-height: 1.4; }
.sep { height: 1px; background: var(--linea); margin: 12px 0; }
.dx { text-align: right; }
.piccolo { font-size: 12.5px; }
.forte { font-weight: 700; }
details.guida { background: #fff; border-radius: 16px; box-shadow: var(--ombra); margin-bottom: 10px; padding: 4px 16px; }
details.guida summary { font-weight: 700; padding: 12px 0; cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
details.guida summary::after { content: "＋"; color: var(--verde2); }
details.guida[open] summary::after { content: "－"; }
details.guida > div { padding-bottom: 14px; font-size: 14px; line-height: 1.5; }
.esempio-doc { background: #fbfcfe; border: 1.5px solid var(--linea); border-radius: 12px; padding: 10px; font-size: 12.5px; margin-top: 8px; overflow-x: auto; }
.esempio-doc table { border-collapse: collapse; width: 100%; }
.esempio-doc td, .esempio-doc th { padding: 5px 6px; border-bottom: 1px solid var(--linea); text-align: right; white-space: nowrap; }
.esempio-doc td:first-child, .esempio-doc th:first-child { text-align: left; }
.evid { background: #fff1b8; outline: 2px solid #ffb03b; border-radius: 4px; }

.velo { position: fixed; inset: 0; background: rgba(15,25,35,0.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.finestra { background: #fff; border-radius: 22px; padding: 18px; width: 100%; max-width: 448px; box-shadow: 0 -8px 30px rgba(0,0,0,0.2); }
.finestra p { font-size: 15.5px; font-weight: 500; margin-bottom: 4px; }
