/* ==========================================================================
   Occhio commerciale · il foglio di stile del sito (grafica definitiva «elettrico»)
   Token: design/finale/tokens.css, uguali. Componenti: design/finale/sorgenti/componenti.css,
   adattati al sito vero (barra larga quanto lo schermo, colonna a sinistra da 900 px, fogli e messaggi).
   Regole: design/finale/linee-guida.md. I contrasti li controlla test/unit/contrasti.test.ts.
   Con la CSP del sito gli attributi style scritti nell'HTML non funzionano: le misure che cambiano si mettono da JS
   con el.style.setProperty().
   ========================================================================== */

/* --- Caratteri (OFL, testo della licenza in /fonts/OFL.txt) --------------- */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-grotesque-var-latin.woff2') format('woff2');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-2019, U+201C-201D, U+2026, U+2039-203A, U+20AC, U+2192;
}
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree-var-latin.woff2') format('woff2');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0020-007E, U+00A0-00FF, U+2013-2014, U+2018-2019, U+201C-201D, U+2026, U+2039-203A, U+20AC, U+2192;
}

/* --- Tema chiaro (quello di base) ----------------------------------------- */
:root {
  color-scheme: light;

  /* superfici e testo */
  --fondo: #F3F3FA;
  --carta: #FFFFFF;
  --carta-2: #F6F5FB;
  --tasto-chiaro: #EFEEF6;
  --testo: #0F0D2A;
  --testo-2: #565672;
  --linea: #E6E6F0;
  --bordo-campo: #807F9A;     /* il bordo dei campi da scrivere: sopra 3:1 su carta e fondo */

  /* marca: indaco elettrico */
  --marca: #4A2CF5;
  --marca-testo: #3A1FD1;
  --marca-tenue: #ECE8FF;
  --su-marca: #FFFFFF;
  --gradiente: linear-gradient(135deg, #6A2BFF 0%, #4B1FFF 52%, #2D5BFF 100%);

  /* il pulsante scuro «Segna un contatto» (al buio diventa lime) */
  --scuro: #0F0D2A;
  --su-scuro: #FFFFFF;
  --segna-tondo: #C5F23A;
  --segna-piu: #0F0D2A;

  /* corallo = caldo. Mai scritte bianche piccole sul corallo pieno */
  --caldo: #FF5B3A;
  --caldo-testo: #B3341B;
  --caldo-tenue: #FFEBE5;
  --caldo-pieno: #C93A20;
  --gradiente-caldo: linear-gradient(140deg, #F0582F 0%, #C93A20 100%);

  /* lime = firmato. Sempre fondo con scritta scura, o sopra indaco e scuro */
  --firma: #C5F23A;
  --su-firma: #0F0D2A;
  --firma-testo: #3B6E00;
  --firma-tenue: #EEFAD0;

  /* esiti e avvisi */
  --ok: #3B6E00;
  --attenzione: #8A5300;
  --attenzione-tenue: #FFF1D6;
  --errore: #B42318;
  --errore-tenue: #FDECEA;

  /* colori degli stati: fondo e testo della pastiglia, punto */
  --stato-nuova-fondo: #EEEEF4;      --stato-nuova-testo: #4A4A63;      --stato-nuova-punto: #85859E;
  --stato-contatto-fondo: #E1F3FD;   --stato-contatto-testo: #08608F;   --stato-contatto-punto: #0B8BCB;
  --stato-calda-fondo: #FFEBE5;      --stato-calda-testo: #B3341B;      --stato-calda-punto: #FF5B3A;
  --stato-fuori-fondo: #ECE8FF;      --stato-fuori-testo: #3A1FD1;      --stato-fuori-punto: #4A2CF5;
  --stato-cliente-fondo: #EEFAD0;    --stato-cliente-testo: #3B6E00;    --stato-cliente-punto: #5E9E00;
  --stato-persa-fondo: #2E2E40;      --stato-persa-testo: #FFFFFF;      --stato-persa-punto: #2E2E40;

  /* pezzi dei componenti */
  --barra-fondo: rgba(255, 255, 255, .92);
  --velo-saldo: rgba(18, 10, 74, .28);
  --velo-foglio: rgba(15, 13, 42, .35);
  --serie-fondo: #0F0D2A;
  --serie-testo: #FFFFFF;
  --serie-lampo: #C5F23A;
  --avviso-fondo: #0F0D2A;
  --avviso-testo: #FFFFFF;
  --avviso-anello: rgba(255, 255, 255, 0);
  --tacca-vuota: #FFDDD5;
  --anello: #FFFFFF;
  --maniglia: #D5D4E2;

  /* raggi */
  --r-saldo: 28px;
  --r-scheda: 24px;
  --r-foglio: 24px;
  --r-riquadro: 20px;
  --r-pulsante: 18px;
  --r-riga: 14px;
  --r-tessera: 14px;
  --r-tondo: 999px;

  /* ombre */
  --ombra: 0 1px 2px rgba(18, 10, 74, .05), 0 10px 28px rgba(18, 10, 74, .07);
  --ombra-saldo: 0 18px 36px -14px rgba(75, 31, 255, .55);
  --ombra-piu: 0 8px 20px rgba(74, 44, 245, .35);
  --ombra-pulsante: 0 10px 22px -10px rgba(15, 13, 42, .55);
  --ombra-foglio: 0 -8px 40px rgba(15, 13, 42, .18);

  /* caratteri */
  --font-titoli: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
  --font-testo: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* movimento */
  --curva: cubic-bezier(.2, .8, .2, 1);
  --curva-rimbalzo: cubic-bezier(.34, 1.56, .64, 1);
  --dur-entra: 260ms;
  --passo-entra: 40ms;
  --dur-foglio: 220ms;
  --dur-conta: 900ms;
  --dur-onda: 700ms;
  --dur-spunta: 250ms;
  --dur-chiudi-riga: 300ms;
  --dur-rimbalzo: 420ms;
  --dur-coriandoli: 1200ms;
  --dur-avviso: 3000ms;
  --dur-traguardo: 4000ms;

  /* misure dell'impaginazione */
  --alta-barra: 64px;
  --larga-colonna: 240px;
  --larga-pagina: 760px;
  --margine: 16px;
}

/* --- Tema scuro: automatico, ma la scelta a mano vince -------------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fondo: #0B0A1A; --carta: #16142B; --carta-2: #1E1B38; --tasto-chiaro: #24213F;
    --testo: #F2F1FA; --testo-2: #A9A7C4; --linea: #2A2745; --bordo-campo: #6E6C8A;
    --marca: #5B3FFF; --marca-testo: #9C8CFF; --marca-tenue: #262056; --su-marca: #FFFFFF;
    --scuro: #C5F23A; --su-scuro: #0B0A1A; --segna-tondo: #0B0A1A; --segna-piu: #C5F23A;
    --caldo: #FF8A6B; --caldo-testo: #FF8A6B; --caldo-tenue: #3A1A14;
    --firma-testo: #C5F23A; --firma-tenue: #1F2A0A;
    --ok: #C5F23A; --attenzione: #FFC46B; --attenzione-tenue: #33240A; --errore: #FF8A80; --errore-tenue: #3A1414;
    --stato-nuova-fondo: #24233A;    --stato-nuova-testo: #D1D0E0;    --stato-nuova-punto: #CFCDE0;
    --stato-contatto-fondo: #0C2A3D; --stato-contatto-testo: #7DD3FC; --stato-contatto-punto: #38BDF8;
    --stato-calda-fondo: #3A1A14;    --stato-calda-testo: #FF8A6B;    --stato-calda-punto: #FF8A6B;
    --stato-fuori-fondo: #262056;    --stato-fuori-testo: #C9BEFF;    --stato-fuori-punto: #9C8CFF;
    --stato-cliente-fondo: #1F2A0A;  --stato-cliente-testo: #C5F23A;  --stato-cliente-punto: #C5F23A;
    --stato-persa-fondo: #4B4A60;    --stato-persa-testo: #F9F9FB;    --stato-persa-punto: #6E6C8A;
    --barra-fondo: rgba(22, 20, 43, .92);
    --velo-foglio: rgba(0, 0, 0, .6);
    --serie-fondo: #24213F; --serie-testo: #F2F1FA; --serie-lampo: #C5F23A;
    --avviso-fondo: #2A2650; --avviso-testo: #F2F1FA; --avviso-anello: rgba(197, 242, 58, .45);
    --tacca-vuota: #4A2A22;
    --anello: #16142B; --maniglia: #3A3660;
    --ombra: 0 0 0 1px #2A2745;
    --ombra-saldo: 0 18px 36px -16px rgba(75, 31, 255, .6);
    --ombra-piu: 0 8px 20px rgba(91, 63, 255, .45);
    --ombra-pulsante: none;
    --ombra-foglio: 0 0 0 1px #2A2745;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fondo: #0B0A1A; --carta: #16142B; --carta-2: #1E1B38; --tasto-chiaro: #24213F;
  --testo: #F2F1FA; --testo-2: #A9A7C4; --linea: #2A2745; --bordo-campo: #6E6C8A;
  --marca: #5B3FFF; --marca-testo: #9C8CFF; --marca-tenue: #262056; --su-marca: #FFFFFF;
  --scuro: #C5F23A; --su-scuro: #0B0A1A; --segna-tondo: #0B0A1A; --segna-piu: #C5F23A;
  --caldo: #FF8A6B; --caldo-testo: #FF8A6B; --caldo-tenue: #3A1A14;
  --firma-testo: #C5F23A; --firma-tenue: #1F2A0A;
  --ok: #C5F23A; --attenzione: #FFC46B; --attenzione-tenue: #33240A; --errore: #FF8A80; --errore-tenue: #3A1414;
  --stato-nuova-fondo: #24233A;    --stato-nuova-testo: #D1D0E0;    --stato-nuova-punto: #CFCDE0;
  --stato-contatto-fondo: #0C2A3D; --stato-contatto-testo: #7DD3FC; --stato-contatto-punto: #38BDF8;
  --stato-calda-fondo: #3A1A14;    --stato-calda-testo: #FF8A6B;    --stato-calda-punto: #FF8A6B;
  --stato-fuori-fondo: #262056;    --stato-fuori-testo: #C9BEFF;    --stato-fuori-punto: #9C8CFF;
  --stato-cliente-fondo: #1F2A0A;  --stato-cliente-testo: #C5F23A;  --stato-cliente-punto: #C5F23A;
  --stato-persa-fondo: #4B4A60;    --stato-persa-testo: #F9F9FB;    --stato-persa-punto: #6E6C8A;
  --barra-fondo: rgba(22, 20, 43, .92);
  --velo-foglio: rgba(0, 0, 0, .6);
  --serie-fondo: #24213F; --serie-testo: #F2F1FA; --serie-lampo: #C5F23A;
  --avviso-fondo: #2A2650; --avviso-testo: #F2F1FA; --avviso-anello: rgba(197, 242, 58, .45);
  --tacca-vuota: #4A2A22;
  --anello: #16142B; --maniglia: #3A3660;
  --ombra: 0 0 0 1px #2A2745;
  --ombra-saldo: 0 18px 36px -16px rgba(75, 31, 255, .6);
  --ombra-piu: 0 8px 20px rgba(91, 63, 255, .45);
  --ombra-pulsante: none;
  --ombra-foglio: 0 0 0 1px #2A2745;
}

/* --- Basi ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--fondo); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--fondo);
  color: var(--testo);
  font-family: var(--font-testo);
  font-size: 16px;
  line-height: 22px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { background: var(--marca-tenue); color: var(--testo); }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--marca); outline-offset: 2px; border-radius: 6px; }
.cifra, .cifre {
  font-family: var(--font-titoli);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.i { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.nascosto { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.senza-js { padding: 24px 16px; font-size: 17px; line-height: 24px; }

/* il logo: la versione chiara e quella bianca, si vede quella giusta per il tema */
.logo-scuro { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-chiaro { display: none; }
  :root:not([data-theme="light"]) .logo-scuro { display: block; }
}
:root[data-theme="dark"] .logo-chiaro { display: none; }
:root[data-theme="dark"] .logo-scuro { display: block; }

/* --- Avvio: l'occhio al centro finché l'app non è pronta ------------------- */
.avvio { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; }
.avvio img { width: 64px; height: 64px; border-radius: 15px; box-shadow: var(--ombra-saldo); }

/* --- Impaginazione: guscio, pagina, barra in basso, colonna a sinistra ------ */
.app { min-height: 100vh; min-height: 100dvh; }
.pagina {
  width: 100%;
  max-width: var(--larga-pagina);
  margin: 0 auto;
  padding: env(safe-area-inset-top) max(var(--margine), env(safe-area-inset-right)) 0 max(var(--margine), env(safe-area-inset-left));
}
.con-barra .pagina { padding-bottom: calc(var(--alta-barra) + env(safe-area-inset-bottom) + 32px); }
.fasce:empty { display: none; }
.fasce { display: grid; gap: 8px; padding-top: 10px; }

.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--alta-barra) + env(safe-area-inset-bottom));
  padding: 0 max(6px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(6px, env(safe-area-inset-left));
  display: grid; grid-template-columns: repeat(5, minmax(0, 112px)); justify-content: center; align-items: center;
  background: var(--barra-fondo);
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  border-top: 1px solid var(--linea);
}
.barra .solo-colonna { display: none; }
.voce {
  position: relative; height: 56px; min-width: 44px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: 12px; line-height: 14px; font-weight: 600; color: var(--testo-2); white-space: nowrap;
}
.voce.attiva { color: var(--marca-testo); }
.voce.attiva .i { stroke-width: 2.4; }
.voce .pallino { position: absolute; top: 7px; left: 50%; margin-left: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--caldo); box-shadow: 0 0 0 2px var(--anello); }
.piu {
  position: relative; justify-self: center; width: 60px; height: 60px; border-radius: 50%;
  transform: translateY(-14px); background: var(--gradiente); color: #FFFFFF;
  display: grid; place-items: center; box-shadow: var(--ombra-piu);
  transition: transform 160ms var(--curva);
}
.piu:active { transform: translateY(-14px) scale(.94); }
.piu .i { width: 30px; height: 30px; stroke-width: 2.6; }
/* un'onda sola alla prima apertura del giorno */
.piu.onda::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--marca); animation: onda var(--dur-onda) var(--curva) 1 both; z-index: -1; pointer-events: none; }
@keyframes onda { from { transform: scale(1); opacity: .5; } to { transform: scale(1.35); opacity: 0; } }

@media (min-width: 900px) {
  .con-barra { padding-left: var(--larga-colonna); }
  .pagina { padding-left: 24px; padding-right: 24px; }
  .con-barra .pagina { padding-bottom: 48px; padding-top: 12px; }
  .barra {
    top: 0; right: auto; width: var(--larga-colonna); height: auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px;
    background: var(--carta); -webkit-backdrop-filter: none; backdrop-filter: none;
    border-top: 0; border-right: 1px solid var(--linea);
    overflow-y: auto;
  }
  .barra .solo-colonna { display: flex; }
  .barra .piu { display: none; }
  .voce {
    flex-direction: row; justify-content: flex-start; height: 48px; padding: 0 14px; gap: 14px;
    border-radius: var(--r-riga); font-size: 16px; line-height: 20px;
  }
  .voce:hover { background: var(--carta-2); }
  .voce.attiva { background: var(--marca-tenue); }
  .voce .pallino { position: static; margin-left: auto; box-shadow: none; }
  .colonna-logo { align-items: center; height: 52px; padding: 0 8px 8px; }
  .colonna-logo img { height: 34px; width: auto; }
  .barra .segna { margin: 6px 0 14px; }
  /* al computer «Segna un contatto» sta già nella colonna: in Oggi non si ripete */
  #vista > .segna { display: none; }
  .colonna-profilo { margin-top: auto; align-items: center; gap: 12px; min-height: 56px; padding: 6px 8px; border-radius: var(--r-riga); font-weight: 700; }
  .colonna-profilo:hover { background: var(--carta-2); }
  .colonna-profilo .tondo-profilo { width: 40px; height: 40px; font-size: 16px; box-shadow: none; }
  .colonna-profilo .nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* --- Comparsa all'apertura: solo la prima volta nella sessione ----------- */
.entra { animation: entra var(--dur-entra) var(--curva) both; }
.entra:nth-child(2) { animation-delay: calc(var(--passo-entra) * 1); }
.entra:nth-child(3) { animation-delay: calc(var(--passo-entra) * 2); }
.entra:nth-child(4) { animation-delay: calc(var(--passo-entra) * 3); }
.entra:nth-child(5) { animation-delay: calc(var(--passo-entra) * 4); }
.entra:nth-child(n+6) { animation-delay: calc(var(--passo-entra) * 5); }
@keyframes entra { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* --- Titoli e testate ------------------------------------------------------ */
.titolo-xl { font: 800 30px/34px var(--font-titoli); letter-spacing: -.02em; }
.titolo-l { font: 700 22px/28px var(--font-titoli); letter-spacing: -.01em; }
.testo-2 { color: var(--testo-2); }
.sotto-titolo { font-size: 15px; line-height: 20px; color: var(--testo-2); }
.testata { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 14px; }
.testata > div:first-child { min-width: 0; }
.testata .data { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--testo-2); }
.testata .titolo-xl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.testata .dx { display: flex; align-items: center; gap: 8px; flex: none; }
.titolo-pagina { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0 4px; min-height: 52px; }
.serie { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px 0 8px; border-radius: 18px; background: var(--serie-fondo); color: var(--serie-testo); font-size: 13px; font-weight: 700; white-space: nowrap; }
.serie .i { width: 18px; height: 18px; color: var(--serie-lampo); fill: var(--serie-lampo); stroke-width: 1.5; }
.serie .n { display: inline-block; font-variant-numeric: tabular-nums; }
.tondo-profilo { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--gradiente); color: #FFFFFF; font: 800 18px/1 var(--font-titoli); box-shadow: 0 0 0 3px var(--fondo), 0 0 0 5px rgba(106, 43, 255, .28); }

/* --- Scheda del saldo ------------------------------------------------------ */
.saldo { position: relative; display: block; overflow: hidden; isolation: isolate; border-radius: var(--r-saldo); padding: 20px; background: var(--gradiente); color: #FFFFFF; box-shadow: var(--ombra-saldo); }
/* riflesso corallo in alto a destra: lì sopra c'è solo la pastiglia lime, piena. Mai una scritta sul riflesso */
.saldo::before { content: ""; position: absolute; z-index: -1; width: 240px; height: 240px; right: -128px; top: -132px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 91, 58, .78) 0%, rgba(255, 91, 58, 0) 68%); }
.saldo::after { content: ""; position: absolute; z-index: -1; width: 280px; height: 280px; left: -140px; bottom: -170px; border-radius: 50%; background: radial-gradient(circle, rgba(166, 139, 255, .5) 0%, rgba(166, 139, 255, 0) 70%); }
.saldo .riga { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; }
.saldo .etichetta { font-size: 15px; line-height: 20px; font-weight: 600; }
.pastiglia-lime { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 15px; background: var(--firma); color: var(--su-firma); font-size: 13px; font-weight: 800; white-space: nowrap; box-shadow: 0 6px 16px rgba(18, 10, 74, .22); }
.saldo .importo { font: 800 48px/52px var(--font-titoli); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 8px; white-space: nowrap; }
.euro { font-size: .6em; letter-spacing: 0; }
.saldo .sotto { display: flex; align-items: center; gap: 2px; font-size: 15px; line-height: 20px; font-weight: 600; margin-top: 4px; }
.saldo .sotto .i { width: 18px; height: 18px; stroke-width: 2.4; }
.mese { margin-top: 16px; border-radius: var(--r-riquadro); background: var(--velo-saldo); padding: 12px 4px; }
.mese .tit { font-size: 13px; line-height: 16px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 0 12px 6px; }
.mese .col { display: grid; grid-template-columns: repeat(3, 1fr); }
.mese .c { padding: 0 12px; min-width: 0; }
.mese .c + .c { border-left: 1px solid rgba(255, 255, 255, .2); }
.mese .n { display: flex; align-items: center; gap: 6px; font: 800 28px/32px var(--font-titoli); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.mese .l { font-size: 15px; line-height: 20px; font-weight: 600; }
.mese .firmate .n { color: var(--firma); }
.spunta-lime { width: 22px; height: 22px; border-radius: 50%; background: var(--firma); color: var(--su-firma); display: grid; place-items: center; flex: none; }
.spunta-lime .i { width: 14px; height: 14px; stroke-width: 3.4; }
.spunta-lime.grande { width: 32px; height: 32px; }
.spunta-lime.grande .i { width: 18px; height: 18px; }
.eroe-offerte { margin-top: 10px; padding-bottom: 18px; }

/* --- Pulsanti -------------------------------------------------------------- */
.segna { width: 100%; height: 56px; margin-top: 12px; border-radius: var(--r-pulsante); background: var(--scuro); color: var(--su-scuro); display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 17px; line-height: 22px; font-weight: 700; box-shadow: var(--ombra-pulsante); transition: transform 120ms var(--curva); }
.segna:active { transform: scale(.98); }
.segna .tondo { width: 32px; height: 32px; border-radius: 50%; background: var(--segna-tondo); color: var(--segna-piu); display: grid; place-items: center; }
.segna .tondo .i { width: 20px; height: 20px; stroke-width: 3; }
.btn-gradiente { width: 100%; height: 56px; border-radius: var(--r-pulsante); background: var(--gradiente); color: #FFFFFF; display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; font-weight: 700; box-shadow: 0 12px 24px -12px rgba(75, 31, 255, .7); transition: transform 120ms var(--curva); }
.btn-gradiente .i { width: 22px; height: 22px; }
.btn-grande { width: 100%; height: 56px; border-radius: var(--r-pulsante); background: var(--scuro); color: var(--su-scuro); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; font-weight: 700; transition: transform 120ms var(--curva); }
.btn-chiaro { width: 100%; height: 56px; border-radius: var(--r-pulsante); background: var(--tasto-chiaro); color: var(--testo); display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 17px; font-weight: 700; }
.btn-gradiente:active, .btn-grande:active, .btn-chiaro:active { transform: scale(.98); }
.btn { height: 44px; padding: 0 14px; border-radius: var(--r-riga); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 15px; line-height: 20px; font-weight: 700; background: var(--tasto-chiaro); color: var(--testo); white-space: nowrap; }
.btn .i { width: 18px; height: 18px; stroke-width: 2.2; }
.btn.chiama, .btn.primario { background: var(--marca); color: var(--su-marca); }
.btn-testo { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 8px; color: var(--marca-testo); font-size: 16px; font-weight: 700; }
.btn-gradiente:disabled, .btn-grande:disabled, .btn-chiaro:disabled, .btn:disabled, .segna:disabled { opacity: .55; transform: none; }
.pulsanti { display: grid; gap: 10px; margin-top: 20px; }
.tondo-44 { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--carta); color: var(--testo); box-shadow: var(--ombra); }

/* --- Riquadro della direzione (solo se c'è una novità) ------------------- */
.direzione { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 12px 12px 14px; border-radius: var(--r-riquadro); background: var(--carta); box-shadow: var(--ombra); }
.direzione .tessera { position: relative; }
.direzione .tessera::after { content: ""; position: absolute; top: -3px; right: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--caldo); box-shadow: 0 0 0 2px var(--anello); }
.direzione .testi { flex: 1; min-width: 0; }
.direzione .t1 { font-size: 16px; line-height: 20px; font-weight: 700; }
.direzione .t2 { font-size: 15px; line-height: 20px; color: var(--testo-2); margin-top: 2px; }

/* --- Sezioni e schede ------------------------------------------------------ */
.sez { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 6px; min-height: 44px; }
.sez h2 { display: flex; align-items: center; gap: 8px; font: 700 22px/28px var(--font-titoli); letter-spacing: -.01em; }
.conta { display: inline-block; min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--testo); color: var(--fondo); font: 700 14px/26px var(--font-testo); text-align: center; font-variant-numeric: tabular-nums; letter-spacing: 0; }
.tutto { display: inline-flex; align-items: center; justify-content: flex-end; min-width: 44px; min-height: 44px; padding: 0 2px 0 14px; color: var(--marca-testo); font-size: 16px; font-weight: 700; }
.scheda { background: var(--carta); border-radius: var(--r-scheda); box-shadow: var(--ombra); }
.scheda.dentro { padding: 16px; }
.riquadro { background: var(--carta); border-radius: var(--r-riquadro); box-shadow: var(--ombra); padding: 14px; }
.vuoto { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 28px 20px; }
.vuoto .t1 { font: 700 20px/26px var(--font-titoli); letter-spacing: -.01em; }
.vuoto .t2 { font-size: 15px; line-height: 20px; color: var(--testo-2); max-width: 34ch; }
.vuoto .btn-grande, .vuoto .segna { margin-top: 8px; max-width: 360px; }

/* --- Righe «Da fare oggi» ------------------------------------------------ */
.riga-fare { padding: 14px; overflow: hidden; }
.riga-fare + .riga-fare { border-top: 1px solid var(--linea); }
.riga-fare .capo { display: flex; align-items: center; gap: 12px; }
.riga-fare .testi { flex: 1; min-width: 0; }
.tessera { width: 48px; height: 48px; border-radius: var(--r-tessera); display: grid; place-items: center; flex: none; }
.tessera.richiamo { background: var(--marca-tenue); color: var(--marca-testo); }
.tessera.sollecito { background: var(--attenzione-tenue); color: var(--attenzione); }
.tessera.pronto { background: var(--firma-tenue); color: var(--firma-testo); }
.tessera.raffredda { background: var(--caldo-tenue); color: var(--caldo-testo); }
.t-riga { font-size: 17px; line-height: 22px; font-weight: 700; }
.t-sotto { font-size: 15px; line-height: 20px; color: var(--testo-2); margin-top: 2px; }
.azioni { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.azioni.due { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.azioni .btn { min-width: 0; }
.riga-fare .solo { margin-left: auto; }
/* «Fatto»: la spunta si disegna, la riga si chiude, il contatore scende */
.spunta-disegno { stroke-dasharray: 24; stroke-dashoffset: 0; }
.riga-fare.fatta .btn.fatto { background: var(--firma); color: var(--su-firma); }
.riga-fare.fatta .btn.fatto .spunta-disegno { animation: disegna var(--dur-spunta) var(--curva) both; }
.riga-fare.chiude { transition: height var(--dur-chiudi-riga) var(--curva), padding var(--dur-chiudi-riga) var(--curva), opacity var(--dur-chiudi-riga) var(--curva); opacity: 0; padding-top: 0; padding-bottom: 0; }
@keyframes disegna { from { stroke-dashoffset: 24; } to { stroke-dashoffset: 0; } }
.vuoto-fare { display: flex; align-items: center; gap: 12px; padding: 18px; font-size: 16px; font-weight: 600; }

/* --- Caldi da proporre: schede che scorrono ------------------------------ */
.caldi { display: flex; gap: 10px; overflow-x: auto; margin: 0 calc(-1 * var(--margine)); padding: 4px var(--margine) 10px; scroll-snap-type: x mandatory; scroll-padding: 0 var(--margine); scrollbar-width: none; }
.caldi::-webkit-scrollbar { display: none; }
.caldo { flex: none; width: 220px; scroll-snap-align: start; padding: 14px; border-radius: var(--r-riquadro); background: var(--carta); box-shadow: var(--ombra); }
.caldo .capo { display: flex; align-items: center; gap: 12px; }
.caldo .testi { min-width: 0; }
.caldo .nome { font-size: 16px; line-height: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caldo .da { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--caldo-testo); margin-top: 2px; }
.tacche { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-top: 14px; }
.tacche i { height: 6px; border-radius: 3px; background: var(--tacca-vuota); }
.tacche i.piena { background: var(--caldo); }

/* --- Monogrammi delle aziende --------------------------------------------- */
.mono { position: relative; width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 800 15px/1 var(--font-titoli); letter-spacing: .01em; background: var(--stato-nuova-fondo); color: var(--stato-nuova-testo); }
.mono.nuova { background: var(--stato-nuova-fondo); color: var(--stato-nuova-testo); }
.mono.contatto { background: var(--stato-contatto-fondo); color: var(--stato-contatto-testo); }
.mono.calda { background: var(--caldo-pieno); color: #FFFFFF; }
.mono.fuori { background: var(--stato-fuori-fondo); color: var(--stato-fuori-testo); }
.mono.cliente { background: var(--stato-cliente-fondo); color: var(--stato-cliente-testo); }
.mono.persa { background: var(--stato-persa-fondo); color: var(--stato-persa-testo); }
.mono .punto-stato { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px var(--anello); }
.mono .fiammella { position: absolute; right: -7px; bottom: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--carta); color: var(--caldo); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--anello); }
.mono .fiammella .i { width: 13px; height: 13px; fill: currentColor; stroke-width: 1.4; }
.mono-xl { position: relative; width: 64px; height: 64px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 800 25px/1 var(--font-titoli); letter-spacing: -.01em; background: var(--stato-nuova-fondo); color: var(--stato-nuova-testo); }
.mono-xl.calda { color: #FFFFFF; background: var(--gradiente-caldo); box-shadow: 0 10px 22px -10px rgba(201, 58, 32, .8); }
.mono-xl.contatto { background: var(--stato-contatto-fondo); color: var(--stato-contatto-testo); }
.mono-xl.fuori { background: var(--stato-fuori-fondo); color: var(--stato-fuori-testo); }
.mono-xl.cliente { background: var(--stato-cliente-fondo); color: var(--stato-cliente-testo); }
.mono-xl.persa { background: var(--stato-persa-fondo); color: var(--stato-persa-testo); }
.mono-xl .fiammella { position: absolute; right: -3px; bottom: -3px; width: 26px; height: 26px; border-radius: 50%; background: var(--carta); color: var(--caldo); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--anello); }
.mono-xl .fiammella .i { width: 16px; height: 16px; fill: currentColor; stroke-width: 1.4; }

/* --- Stati: pastiglie e punti --------------------------------------------- */
.stato { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px 0 14px; border-radius: 18px; font-size: 15px; font-weight: 700; white-space: nowrap; }
.stato .i { width: 18px; height: 18px; stroke-width: 2.4; margin-left: -2px; }
.tocco-stato { display: inline-flex; align-items: center; min-height: 44px; }
.pas { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 14px; font-size: 14px; line-height: 1; font-weight: 700; white-space: nowrap; }
.punto { width: 9px; height: 9px; border-radius: 50%; flex: none; background: currentColor; }
.pas .punto { width: 8px; height: 8px; }
.st-nuova { background: var(--stato-nuova-fondo); color: var(--stato-nuova-testo); } .st-nuova .punto { background: var(--stato-nuova-punto); }
.st-contatto { background: var(--stato-contatto-fondo); color: var(--stato-contatto-testo); } .st-contatto .punto { background: var(--stato-contatto-punto); }
.st-calda { background: var(--stato-calda-fondo); color: var(--stato-calda-testo); } .st-calda .punto { background: var(--stato-calda-punto); }
.st-fuori { background: var(--stato-fuori-fondo); color: var(--stato-fuori-testo); } .st-fuori .punto { background: var(--stato-fuori-punto); }
.st-cliente { background: var(--stato-cliente-fondo); color: var(--stato-cliente-testo); } .st-cliente .punto { background: var(--stato-cliente-punto); }
.st-persa { background: var(--stato-persa-fondo); color: var(--stato-persa-testo); } .st-persa .punto { background: var(--stato-persa-testo); }
.st-attenzione { background: var(--attenzione-tenue); color: var(--attenzione); }
.st-firma { background: var(--firma-tenue); color: var(--firma-testo); }
.pas-calda-piena { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 12px 0 9px; border-radius: 15px; background: var(--caldo-pieno); color: #FFFFFF; font-size: 14px; font-weight: 700; white-space: nowrap; }
.pas-calda-piena .i { width: 16px; height: 16px; fill: currentColor; stroke-width: 1.4; }
.maiuscole { font-size: 13px; line-height: 16px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--caldo-testo); }

/* --- Scheda dell'azienda: pezzi comuni ------------------------------------ */
.barra-alta { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.indietro { display: inline-flex; align-items: center; height: 44px; padding: 0 12px 0 0; margin-left: -6px; color: var(--marca-testo); font-size: 17px; font-weight: 700; }
.indietro .i { width: 26px; height: 26px; stroke-width: 2.4; }
.testa-azienda { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.testa-azienda > div { min-width: 0; }
.testa-azienda .luogo { display: flex; align-items: center; gap: 4px; font-size: 15px; line-height: 20px; color: var(--testo-2); margin-top: 2px; }
.riga-stato { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; }
.vede { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 20px; color: var(--testo-2); }
.vede img { width: 20px; height: 20px; flex: none; }
.azioni-tonde { display: grid; grid-template-columns: repeat(6, 1fr); margin: 14px 0 0; }
.azione { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: -.01em; color: var(--testo); white-space: nowrap; }
.azione .cerchio { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--carta); color: var(--marca-testo); box-shadow: var(--ombra); }
.azione .cerchio .i { width: 23px; height: 23px; }
.azione.primaria .cerchio { background: var(--marca); color: var(--su-marca); box-shadow: 0 10px 20px -8px rgba(74, 44, 245, .6); }
.azione.spenta .cerchio { background: var(--tasto-chiaro); color: var(--testo-2); box-shadow: none; }
.segna-piu { position: absolute; top: -2px; right: -4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--firma); color: var(--su-firma); box-shadow: 0 0 0 2px var(--fondo); }
.segna-piu .i { width: 13px; height: 13px; stroke-width: 3.4; }
.passo { margin-top: 18px; padding: 18px; border-radius: var(--r-scheda); background: linear-gradient(165deg, var(--carta) 0%, var(--carta) 35%, var(--caldo-tenue) 100%); box-shadow: inset 0 0 0 1px rgba(255, 91, 58, .22), var(--ombra); }
.passo .capo { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.passo h3 { font: 700 22px/28px var(--font-titoli); letter-spacing: -.01em; margin-top: 10px; }
.passo .sotto { font-size: 15px; line-height: 20px; color: var(--testo-2); margin-top: 2px; }
.passo .tacche { margin: 12px 0 16px; }
.storia { padding: 4px 16px; }
.evento { position: relative; display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 14px 0; }
.evento + .evento { border-top: 1px solid var(--linea); }
.evento .ico { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--marca-tenue); color: var(--marca-testo); }
.evento .ico .i { width: 20px; height: 20px; }
.evento .tit { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 17px; line-height: 22px; font-weight: 700; }
.evento .quando { font-size: 15px; line-height: 20px; color: var(--testo-2); margin-top: 2px; }
.cambio { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.cambio .i { width: 18px; height: 18px; color: var(--testo-2); }
.nota { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: var(--carta-2); font-size: 16px; line-height: 22px; overflow-wrap: anywhere; }

/* --- Offerte: pezzi comuni ------------------------------------------------ */
.pastiglie { display: flex; gap: 8px; overflow-x: auto; margin: 10px calc(-1 * var(--margine)) 6px; padding: 4px var(--margine) 8px; scrollbar-width: none; }
.pastiglie::-webkit-scrollbar { display: none; }
.scelta { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; border-radius: 22px; background: var(--carta); color: var(--testo); box-shadow: var(--ombra); font-size: 15px; font-weight: 700; white-space: nowrap; }
.scelta .n { font-variant-numeric: tabular-nums; color: var(--testo-2); font-weight: 700; }
.scelta.attiva, .scelta[aria-pressed="true"], .scelta[aria-checked="true"] { background: var(--marca); color: var(--su-marca); box-shadow: 0 8px 18px -8px rgba(74, 44, 245, .6); }
.scelta.attiva .n, .scelta[aria-pressed="true"] .n, .scelta[aria-checked="true"] .n { color: var(--su-marca); opacity: .85; }
.scelte { display: flex; flex-wrap: wrap; gap: 8px; }
.offerta { display: flex; align-items: flex-start; gap: 12px; padding: 16px 14px; }
.offerta + .offerta { border-top: 1px solid var(--linea); }
.offerta .testi { flex: 1; min-width: 0; }
.offerta .riga1 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.offerta .nome { font-size: 17px; line-height: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.soldi { font: 700 20px/22px var(--font-titoli); font-variant-numeric: tabular-nums; letter-spacing: -.01em; white-space: nowrap; }
.soldi .euro { font-size: .7em; }
.offerta .pas { margin-top: 8px; }
.firmate-mese { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; padding: 14px; border-radius: var(--r-riquadro); background: var(--firma-tenue); }
.firmate-mese .tessera { background: var(--firma); color: var(--su-firma); }
.firmate-mese .t1 { font-size: 17px; line-height: 22px; font-weight: 700; }
.firmate-mese .t2 { font-size: 15px; line-height: 20px; color: var(--firma-testo); font-weight: 600; margin-top: 2px; }
.firmate-mese .testi { flex: 1; min-width: 0; padding-top: 2px; }
.firmate-mese .riga1 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.firmate-mese .soldi { font-weight: 800; }

/* --- Fogli dal basso (al computer finestre al centro) --------------------- */
.foglio-aperto { overflow: hidden; }
.velo { position: fixed; inset: 0; z-index: 40; background: var(--velo-foglio); animation: velo var(--dur-foglio) var(--curva) backwards; }
.velo.via { animation: velo-via var(--dur-foglio) var(--curva) forwards; }
.foglio {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  width: 100%; max-width: 600px; margin: 0 auto;
  max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column;
  border-radius: var(--r-foglio) var(--r-foglio) 0 0;
  background: var(--carta); color: var(--testo); box-shadow: var(--ombra-foglio);
  transform: translateY(var(--trascina, 0px));
  animation: sale var(--dur-foglio) var(--curva) backwards;
}
.foglio.trascina { transition: none; }
.foglio.torna { transition: transform var(--dur-foglio) var(--curva); }
.foglio.via { animation: scende var(--dur-foglio) var(--curva) forwards; }
.foglio-testa { flex: none; padding: 8px var(--margine) 0; touch-action: none; }
.maniglia { width: 36px; height: 4px; border-radius: 2px; background: var(--maniglia); margin: 0 auto 10px; }
.foglio .capo { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.foglio h2 { font: 700 22px/28px var(--font-titoli); letter-spacing: -.01em; min-width: 0; }
.foglio-corpo { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px var(--margine) calc(24px + env(safe-area-inset-bottom)); }
.chiudi { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--tasto-chiaro); color: var(--testo); }
.chiudi .i { width: 20px; height: 20px; stroke-width: 2.4; }
@keyframes sale { from { transform: translateY(100%); } }
@keyframes scende { to { transform: translateY(100%); } }
@keyframes velo { from { opacity: 0; } }
@keyframes velo-via { to { opacity: 0; } }
@media (min-width: 900px) {
  .foglio {
    top: 50%; left: 50%; right: auto; bottom: auto; width: 520px; max-width: calc(100vw - 48px); margin: 0;
    max-height: 86vh; max-height: 86dvh; border-radius: var(--r-foglio);
    transform: translate(-50%, -50%);
    animation-name: appare;
  }
  .foglio.via { animation-name: scompare; }
  .foglio .maniglia { visibility: hidden; height: 0; margin-bottom: 8px; }
  .foglio-testa { padding-top: 16px; touch-action: auto; }
  .foglio-corpo { padding-bottom: 24px; }
}
@keyframes appare { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } }
@keyframes scompare { to { opacity: 0; transform: translate(-50%, -46%) scale(.98); } }

/* foglio «Cosa vuoi segnare?» */
.grandi { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; }
.grandi .grande { display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; gap: 18px; height: 132px; padding: 16px; border-radius: var(--r-riquadro); background: var(--carta-2); box-shadow: inset 0 0 0 1px var(--linea); text-align: left; transition: transform 120ms var(--curva); }
.grandi .grande:active { transform: scale(.98); }
.grandi .grande .cerchio { position: relative; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--marca); color: var(--su-marca); box-shadow: 0 10px 20px -8px rgba(74, 44, 245, .6); }
.grandi .grande .cerchio .i { width: 24px; height: 24px; }
.grandi .grande .segna-piu { width: 22px; height: 22px; box-shadow: 0 0 0 2px var(--carta-2); }
.grandi .grande .segna-piu .i { width: 14px; height: 14px; }
.grandi .grande .t1 { font: 700 20px/24px var(--font-titoli); }
.elenco { margin-top: 12px; }
.voce-elenco { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 8px 4px; text-align: left; font-size: 17px; font-weight: 600; }
.voce-elenco + .voce-elenco { border-top: 1px solid var(--linea); }
.voce-elenco .tessera { width: 44px; height: 44px; background: var(--tasto-chiaro); color: var(--testo); border-radius: 14px; }
.voce-elenco .tessera .i { width: 22px; height: 22px; }
.voce-elenco .dopo { margin-left: auto; color: var(--testo-2); }

/* foglio della firma: tondo lime e coriandoli */
.festa { position: relative; text-align: center; padding: 6px 0 0; }
.tondo-firma { position: relative; z-index: 2; width: 96px; height: 96px; margin: 10px auto 0; border-radius: 50%; display: grid; place-items: center; background: var(--firma); color: var(--su-firma); box-shadow: 0 0 0 10px rgba(197, 242, 58, .22), 0 18px 30px -12px rgba(94, 158, 0, .55); animation: rimbalzo var(--dur-rimbalzo) var(--curva-rimbalzo) both; }
.tondo-firma .i { width: 50px; height: 50px; stroke-width: 3.2; }
.tondo-firma .spunta-disegno { animation: disegna var(--dur-spunta) var(--curva) 180ms both; }
@keyframes rimbalzo { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.festa h2 { font: 800 30px/34px var(--font-titoli); letter-spacing: -.02em; margin-top: 20px; }
.festa .chi { font-size: 17px; line-height: 24px; margin-top: 6px; }
.festa .pastiglia-lime { height: 40px; padding: 0 16px; border-radius: 20px; font-size: 17px; margin-top: 16px; box-shadow: none; }
.festa .btn-grande { margin-top: 26px; }
.coriandoli { position: absolute; left: 50%; top: 62px; width: 0; height: 0; z-index: 1; pointer-events: none; }
.coriandoli i { position: absolute; left: -4px; top: -6px; width: var(--w, 8px); height: var(--h, 12px); border-radius: var(--rad, 2px); background: var(--c); opacity: 0; animation: coriandolo var(--dur-coriandoli) cubic-bezier(.15, .7, .3, 1) var(--ritardo, 0ms) both; }
@keyframes coriandolo {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(.6); }
  60% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); }
}

/* --- Messaggi a comparsa e traguardi (sopra la barra) -------------------- */
.avvisi {
  position: fixed; z-index: 60; left: max(var(--margine), env(safe-area-inset-left)); right: max(var(--margine), env(safe-area-inset-right));
  bottom: calc(var(--alta-barra) + env(safe-area-inset-bottom) + 14px);
  max-width: 520px; margin: 0 auto; display: grid; gap: 8px; pointer-events: none;
}
.senza-barra .avvisi, body:not(:has(.con-barra)) .avvisi { bottom: calc(16px + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .avvisi { left: calc(var(--larga-colonna) + 24px); right: 24px; bottom: 24px; margin: 0 auto 0 0; }
  .senza-barra .avvisi, body:not(:has(.con-barra)) .avvisi { left: 24px; margin: 0 auto; }
}
.avviso { pointer-events: auto; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r-riquadro); background: var(--avviso-fondo); color: var(--avviso-testo); box-shadow: 0 0 0 1px var(--avviso-anello), 0 14px 30px -12px rgba(15, 13, 42, .55); animation: avviso var(--dur-entra) var(--curva) backwards; }
.avviso.via { animation: avviso-via 200ms var(--curva) forwards; }
.avviso .testi { flex: 1; min-width: 0; }
.avviso .t1 { font-size: 16px; line-height: 20px; font-weight: 700; }
.avviso .t2 { font-size: 15px; line-height: 20px; opacity: .92; margin-top: 2px; }
.avviso .stella { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--firma); color: var(--su-firma); }
.avviso .stella .i { width: 22px; height: 22px; stroke-width: 2.6; }
.avviso .stella.piena .i { fill: currentColor; stroke-width: 1.2; }
.avviso .stella.errore { background: var(--errore-tenue); color: var(--errore); }
.avviso .stella.info { background: var(--marca-tenue); color: var(--marca-testo); }
.avviso .azione-avviso { flex: none; height: 44px; padding: 0 14px; border-radius: var(--r-riga); background: var(--firma); color: var(--su-firma); font-size: 15px; font-weight: 800; }
@keyframes avviso { from { opacity: 0; transform: translateY(12px); } }
@keyframes avviso-via { to { opacity: 0; transform: translateY(8px); } }

/* --- Campi da scrivere --------------------------------------------------- */
.modulo { display: grid; gap: 16px; }
.campo { display: grid; gap: 6px; }
.campo > label, .etichetta-campo { font-size: 15px; line-height: 20px; font-weight: 700; color: var(--testo); }
.ingresso {
  width: 100%; height: 52px; padding: 0 14px; border-radius: var(--r-riga);
  border: 1.5px solid var(--bordo-campo); background: var(--carta); color: var(--testo);
  font: 400 17px/22px var(--font-testo); -webkit-appearance: none; appearance: none;
  transition: border-color 120ms var(--curva), box-shadow 120ms var(--curva);
}
.ingresso::placeholder { color: var(--testo-2); opacity: 1; }
.ingresso:focus { outline: none; border-color: var(--marca); box-shadow: 0 0 0 4px var(--marca-tenue); }
.ingresso[aria-invalid="true"] { border-color: var(--errore); }
.ingresso[aria-invalid="true"]:focus { box-shadow: 0 0 0 4px var(--errore-tenue); }
textarea.ingresso { height: auto; min-height: 104px; padding: 12px 14px; resize: vertical; }
.aiuto { font-size: 15px; line-height: 20px; color: var(--testo-2); }
.errore-campo { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--errore); }
.con-tasto { position: relative; }
.con-tasto .ingresso { padding-right: 112px; }
.tasto-dentro { position: absolute; right: 4px; top: 4px; height: 44px; min-width: 44px; padding: 0 12px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--marca-testo); font-size: 15px; font-weight: 700; }
.tasto-dentro .i { width: 20px; height: 20px; }
.box { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--r-riga); font-size: 15px; line-height: 20px; font-weight: 600; }
.box .i { width: 20px; height: 20px; margin-top: 0; }
.box.errore { background: var(--errore-tenue); color: var(--errore); }
.box.info { background: var(--marca-tenue); color: var(--marca-testo); }
.box.attenzione { background: var(--attenzione-tenue); color: var(--attenzione); }
.box.ok { background: var(--firma-tenue); color: var(--firma-testo); }

/* --- Fasce in cima: senza rete, cose da inviare, dati di prima ----------- */
.fascia { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 10px 14px; border-radius: var(--r-riquadro); font-size: 15px; line-height: 20px; font-weight: 600; }
.fascia .i { width: 20px; height: 20px; }
.fascia.rete { background: var(--attenzione-tenue); color: var(--attenzione); }
.fascia.copia { background: var(--tasto-chiaro); color: var(--testo-2); }
.pas-coda { display: inline-flex; align-items: center; gap: 8px; align-self: start; justify-self: start; min-height: 44px; padding: 0 14px; border-radius: 22px; background: var(--carta); color: var(--testo); box-shadow: var(--ombra); font-size: 15px; font-weight: 700; }
.pas-coda .i { width: 18px; height: 18px; color: var(--marca-testo); }
.pas-coda.sistemare .i { color: var(--errore); }

/* --- Scheletri mentre carica (l'unica animazione che si ripete) ----------- */
.scheletro { display: block; border-radius: var(--r-riga); background: linear-gradient(90deg, var(--tasto-chiaro) 0%, var(--carta-2) 50%, var(--tasto-chiaro) 100%); background-size: 200% 100%; animation: luccica 1.2s linear infinite; }
.scheletro.riga { height: 18px; margin: 10px 0; }
.scheletro.riga.corta { width: 55%; }
.scheletro.blocco { height: 120px; border-radius: var(--r-scheda); margin-top: 12px; }
.scheletro.saldo-finto { height: 236px; border-radius: var(--r-saldo); margin-top: 12px; }
@keyframes luccica { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* --- Accesso -------------------------------------------------------------- */
.accesso {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100dvh;
  display: grid; place-items: center;
  padding: calc(24px + env(safe-area-inset-top)) max(var(--margine), env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(var(--margine), env(safe-area-inset-left));
}
/* luce indaco e lime dietro il simbolo: solo decorazione, sotto non c'è testo */
.accesso::before { content: ""; position: absolute; z-index: -1; width: 520px; height: 520px; left: 50%; top: -300px; margin-left: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(106, 43, 255, .22) 0%, rgba(106, 43, 255, 0) 66%); }
.accesso::after { content: ""; position: absolute; z-index: -1; width: 360px; height: 360px; right: -180px; top: 40px; border-radius: 50%; background: radial-gradient(circle, rgba(197, 242, 58, .22) 0%, rgba(197, 242, 58, 0) 66%); }
.accesso-dentro { width: 100%; max-width: 420px; }
.accesso-testa { display: flex; flex-direction: column; align-items: center; text-align: center; }
.accesso-simbolo { width: 72px; height: 72px; border-radius: 17px; box-shadow: 0 16px 30px -14px rgba(75, 31, 255, .65); }
.accesso-testa .titolo-xl { margin-top: 18px; }
.accesso-testa .sotto-titolo { margin-top: 6px; font-size: 16px; line-height: 22px; }
.accesso .modulo { margin-top: 24px; padding: 20px 16px; }
.accesso .btn-gradiente { margin-top: 4px; }
.accesso-piede { margin-top: 20px; text-align: center; font-size: 15px; line-height: 20px; color: var(--testo-2); }

/* --- Benvenuto ------------------------------------------------------------ */
.benvenuto {
  min-height: 100vh; min-height: 100dvh; max-width: 520px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: calc(8px + env(safe-area-inset-top)) max(var(--margine), env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(var(--margine), env(safe-area-inset-left));
}
.benv-testa { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.benv-testa .logo { height: 40px; width: auto; }
.benv-punti { display: flex; gap: 6px; margin-top: 8px; }
.benv-punti i { height: 6px; flex: 1; border-radius: 3px; background: var(--tasto-chiaro); transition: background-color 260ms var(--curva); }
.benv-punti i.fatto { background: var(--marca); }
.benv-passo { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 28px 0 20px; }
.benv-figura { position: relative; width: 112px; height: 112px; border-radius: 32px; display: grid; place-items: center; background: var(--gradiente); color: #FFFFFF; box-shadow: var(--ombra-saldo); }
.benv-figura .i { width: 52px; height: 52px; stroke-width: 1.8; }
.benv-figura .segna-piu { top: -6px; right: -6px; width: 34px; height: 34px; box-shadow: 0 0 0 3px var(--fondo); }
.benv-figura .segna-piu .i { width: 20px; height: 20px; stroke-width: 3; }
.benv-figura.lime { background: var(--firma); color: var(--su-firma); box-shadow: 0 18px 30px -14px rgba(94, 158, 0, .55); }
.benv-figura.simbolo { background: none; box-shadow: none; }
.benv-figura.simbolo img { width: 112px; height: 112px; border-radius: 26px; box-shadow: var(--ombra-saldo); }
.benv-figura .pallino-caldo { position: absolute; top: 18px; right: 22px; width: 18px; height: 18px; border-radius: 50%; background: var(--caldo); box-shadow: 0 0 0 3px #4B1FFF; }
.benv-passo h1 { font: 800 30px/34px var(--font-titoli); letter-spacing: -.02em; margin-top: 28px; }
.benv-passo .testo { font-size: 17px; line-height: 24px; color: var(--testo-2); margin-top: 10px; max-width: 34ch; }
.benv-passo .modulo { margin-top: 20px; }
.benv-piede { display: grid; gap: 10px; }

/* --- Pezzi comuni delle pagine (passo 10) --------------------------------- */
.centrato { text-align: center; }
.etichetta-piccola { display: block; font-size: 13px; line-height: 16px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--testo-2); }
.pastigline { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pastigline .pas .i { width: 14px; height: 14px; }
.titolo-xl.a-capo { white-space: normal; overflow-wrap: anywhere; }
.titolo-xl a { color: inherit; }
.sotto-sez { font: 700 17px/22px var(--font-testo); margin: 18px 0 8px; }
.testo-note { white-space: pre-line; overflow-wrap: anywhere; font-size: 16px; line-height: 22px; }
.riquadro.vuoto-piccolo { padding: 16px; }
.tutto { background: none; }

/* pastiglie di scelta dentro i fogli: tasto chiaro, la scelta in indaco */
.foglio .scelta { background: var(--tasto-chiaro); box-shadow: none; }
.foglio .scelta[aria-checked="true"] { background: var(--marca); color: var(--su-marca); box-shadow: 0 8px 18px -8px rgba(74, 44, 245, .6); }
.foglio .modulo { padding-top: 4px; }
.foglio .modulo > .btn-grande, .foglio .modulo > .btn-gradiente { margin-top: 4px; }
.foglio .sotto-titolo { margin-top: -4px; }
.due-campi { display: grid; gap: 16px; }
@media (min-width: 420px) { .due-campi { grid-template-columns: 1fr 1fr; } }

/* ricerca con la lente */
.cerca-box { position: relative; }
.cerca-box > .i { position: absolute; left: 14px; top: 50%; margin-top: -11px; width: 22px; height: 22px; color: var(--testo-2); pointer-events: none; }
.cerca-box .ingresso { padding-left: 46px; }
.cerca-box.grande { margin-top: 6px; }
.cerca-box.grande .ingresso { border-color: transparent; background: var(--carta); box-shadow: var(--ombra); }
.cerca-box.grande .ingresso:focus { border-color: var(--marca); }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

/* il campo «Azienda» dei fogli */
.esiti-azienda:empty { display: none; }
.esiti-azienda { margin-top: 10px; }
.recenti { display: grid; gap: 8px; }
/* le ultime 5 su una riga che scorre: il foglio resta corto e si sceglie con un tocco */
.recenti .scelte { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--margine)); padding: 2px var(--margine) 6px; scrollbar-width: none; }
.recenti .scelte::-webkit-scrollbar { display: none; }
.recenti .scelta { flex: none; }
.risultati { display: grid; border-radius: var(--r-riquadro); background: var(--carta-2); overflow: hidden; }
.riga-azienda { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; text-align: left; }
.riga-azienda + .riga-azienda { border-top: 1px solid var(--linea); }
.riga-azienda .testi, .azienda-scelta .testi { display: grid; min-width: 0; }
.riga-azienda .t-riga, .azienda-scelta .t-riga { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.azienda-scelta { display: flex; align-items: center; gap: 12px; padding: 8px 4px 8px 12px; border-radius: var(--r-riquadro); background: var(--carta-2); box-shadow: inset 0 0 0 1px var(--linea); }
.azienda-scelta .testi { flex: 1; }
.crea-azienda { height: 52px; font-size: 16px; }

/* interruttore (posizione nelle visite) */
.interruttore { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.interruttore input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.interruttore .levetta { position: relative; flex: none; width: 52px; height: 32px; margin-top: 2px; border-radius: 16px; background: var(--tasto-chiaro); box-shadow: inset 0 0 0 1.5px var(--bordo-campo); transition: background-color 160ms var(--curva); }
.interruttore .levetta::after { content: ""; position: absolute; left: 4px; top: 4px; width: 24px; height: 24px; border-radius: 50%; background: var(--carta); box-shadow: 0 1px 3px rgba(15, 13, 42, .3); transition: transform 160ms var(--curva); }
.interruttore input:checked + .levetta { background: var(--marca); box-shadow: none; }
.interruttore input:checked + .levetta::after { transform: translateX(20px); }
.interruttore input:focus-visible + .levetta { outline: 3px solid var(--marca); outline-offset: 2px; }
.interruttore .testi { display: grid; gap: 2px; }
.interruttore .t1 { font-weight: 700; }

/* allegati e file */
.allegati:empty { display: none; }
.allegati { display: grid; gap: 6px; margin-bottom: 8px; }
.allegato { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 4px 4px 4px 12px; border-radius: var(--r-riga); background: var(--carta-2); font-size: 15px; }
.allegato .i { width: 20px; height: 20px; color: var(--marca-testo); }
.allegato .nome { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.allegato .peso { color: var(--testo-2); }
.chiudi.piccolo { width: 44px; height: 44px; background: transparent; }
.scegli-file { cursor: pointer; }
.scegli-file:focus-within { outline: 3px solid var(--marca); outline-offset: 2px; }

/* doppioni mentre si scrive */
.doppioni:empty { display: none; }
.box.doppione { align-items: flex-start; }
.box.doppione p { color: var(--testo); font-weight: 600; }
.box.doppione .azioni { margin-top: 10px; }
.box.doppione .btn { background: var(--carta); }

/* --- Oggi: pezzi in più ----------------------------------------------------- */
.riga-fare .t-riga { display: block; color: var(--testo); }
.riga-fare a.tessera { color: inherit; }
.azioni.una { grid-template-columns: 1fr; }
.serie.sale .i { animation: rimbalzo var(--dur-rimbalzo) var(--curva-rimbalzo) both; }
.serie.sale .n { animation: gira 300ms var(--curva) both; }
@keyframes gira { from { transform: translateY(70%); opacity: 0; } to { transform: none; opacity: 1; } }
.primo-giorno { margin-top: 18px; }
.benv-figura.piccola { width: 80px; height: 80px; border-radius: 24px; }
.benv-figura.piccola .i { width: 38px; height: 38px; }
.benv-figura.piccola .segna-piu { width: 28px; height: 28px; top: -6px; right: -6px; }
.benv-figura.piccola .segna-piu .i { width: 16px; height: 16px; }
.caldo .mono { width: 44px; height: 44px; }

/* --- Aziende: elenco -------------------------------------------------------- */
.titolo-pagina .tondo-44 { flex: none; }
.elenco-aziende { overflow: hidden; }
.riga-lista { display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px; }
.riga-lista + .riga-lista { border-top: 1px solid var(--linea); }
.riga-lista:hover { background: var(--carta-2); }
.riga-lista.scelta-ora { background: var(--marca-tenue); }
.riga-lista .testi { flex: 1; min-width: 0; display: grid; gap: 3px; }
.riga-lista .riga1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.riga-lista .nome { font-size: 17px; line-height: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.riga-lista .t-sotto { margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.riga-lista .pas { flex: none; }
.mono-punto { position: relative; flex: none; }
.punto-stato { position: absolute; right: -3px; bottom: -3px; width: 16px; height: 16px; border-radius: 50%; display: grid; place-items: center; background: var(--carta); box-shadow: 0 0 0 2px var(--anello); }
.punto-stato .punto { width: 10px; height: 10px; }
.punto-stato.st-nuova .punto { background: var(--stato-nuova-punto); }
.punto-stato.st-contatto .punto { background: var(--stato-contatto-punto); }
.punto-stato.st-fuori .punto { background: var(--stato-fuori-punto); }
.punto-stato.st-cliente .punto { background: var(--stato-cliente-punto); }
.punto-stato.st-persa .punto { background: var(--stato-persa-punto); }
.pastiglie .scelta { cursor: pointer; }

/* computer da 1200 px: elenco e scheda affiancati */
.pagina:has(.affiancate) { max-width: 1240px; }
@media (min-width: 1200px) {
  .affiancate { display: grid; grid-template-columns: minmax(340px, 400px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .affiancate .colonna-elenco { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; padding: 0 4px 16px; scrollbar-width: thin; }
  .affiancate .colonna-elenco .pastiglie { flex-wrap: wrap; overflow: visible; margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
  .affiancate .colonna-scheda { min-width: 0; }
}

/* --- Scheda dell'azienda: pezzi in più ------------------------------------- */
.passo.neutro { background: var(--carta); box-shadow: var(--ombra); }
.passo.neutro .maiuscole { color: var(--marca-testo); }
.passo.neutro .pulsanti { margin-top: 14px; }
.passo .spunte { margin-top: 12px; }
.richiesta-riga { padding: 14px; }
.richiesta-riga + .richiesta-riga { border-top: 1px solid var(--linea); }
.richiesta-riga .riga1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.testo-breve { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.spunte { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 15px; line-height: 20px; font-weight: 600; color: var(--testo-2); }
.spunte li { display: inline-flex; align-items: center; gap: 6px; }
.spunte .tondino { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px var(--bordo-campo); }
.spunte .tondino .i { width: 14px; height: 14px; stroke-width: 3.2; }
.spunte li.fatta { color: var(--testo); }
.spunte li.fatta .tondino { background: var(--firma); color: var(--su-firma); box-shadow: none; }
.spunte.piccole { margin-top: 6px; gap: 4px 12px; font-size: 14px; }
.spunte.piccole .tondino { width: 18px; height: 18px; }
.spunte.piccole .tondino .i { width: 12px; height: 12px; }
.referenti { display: grid; gap: 10px; }
@media (min-width: 560px) { .referenti { grid-template-columns: 1fr 1fr; } }
.referente { display: grid; gap: 2px; width: 100%; text-align: left; }
.referente .t-sotto { display: flex; align-items: center; gap: 6px; }
.referente .t-sotto .i { width: 16px; height: 16px; }
.referente .nota { margin-top: 8px; font-size: 15px; line-height: 20px; }
.note-azienda { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; width: 100%; min-height: 56px; text-align: left; }
.note-azienda > .i { flex: none; width: 20px; height: 20px; color: var(--marca-testo); margin-top: 1px; }
.evento .tit a { color: var(--testo); text-decoration: underline; text-decoration-color: var(--linea); text-underline-offset: 3px; }
.evento.dalla-direzione .ico { background: var(--firma-tenue); color: var(--firma-testo); }
.pagina-azienda .offerta .riga1 { align-items: center; }
.pagina-azienda .testa-azienda .luogo { margin-top: 4px; }

/* --- Offerta ----------------------------------------------------------------- */
.testa-azienda .luogo .pas { margin-right: 6px; }
.importo-offerta { margin-top: 16px; display: grid; gap: 6px; }
.importo-riga { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
.cifra.grande { font: 800 40px/44px var(--font-titoli); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.importo-riga .periodo { font-size: 17px; font-weight: 600; color: var(--testo-2); }
.importo-offerta .t-sotto { margin-top: 4px; }
.provvigione { color: var(--firma-testo); font-weight: 700; }
.solo-per-te { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; padding: 14px; border-radius: var(--r-riquadro); background: var(--attenzione-tenue); color: var(--attenzione); }
.solo-per-te > .i { width: 22px; height: 22px; flex: none; margin-top: 1px; }
.solo-per-te .t1 { font-weight: 800; }
.solo-per-te .t2 { color: var(--testo); margin-top: 2px; white-space: pre-line; overflow-wrap: anywhere; }
.pdf-offerta { margin-top: 12px; }
.pdf-offerta .riga1, .firmata-box .riga1 { display: flex; align-items: center; gap: 12px; }
.pdf-offerta .riga1 > div { min-width: 0; }
.pdf-offerta .t-sotto { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-offerta .azioni { grid-template-columns: 1fr 1fr 1fr; }
.righe-prezzi { overflow: hidden; }
.riga-prezzo { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 14px; }
.riga-prezzo + .riga-prezzo { border-top: 1px solid var(--linea); }
.riga-prezzo .testi { min-width: 0; flex: 1; }
.riga-prezzo .t-riga { overflow-wrap: anywhere; }
.riga-prezzo .pas { margin-top: 6px; }
.riga-prezzo .btn { flex: none; }
.firmata-box { margin-top: 16px; display: grid; gap: 14px; }
.azioni.larghe { margin-top: 0; }
.azioni.larghe .btn { height: 52px; }

/* --- Direzione: la chat ---------------------------------------------------- */
.dalla-direzione { margin-top: 10px; }
.dalla-direzione .capo { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.dalla-direzione .tessera { width: 44px; height: 44px; }
.chat { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; padding-bottom: 12px; }
.chat .vuoto .tessera { width: 56px; height: 56px; }
.giorno-chat { align-self: center; margin: 10px 0 4px; padding: 4px 12px; border-radius: 12px; background: var(--tasto-chiaro); font-size: 13px; line-height: 16px; font-weight: 700; color: var(--testo-2); }
.fumetto { max-width: min(82%, 520px); padding: 10px 14px 8px; border-radius: 20px; font-size: 16px; line-height: 22px; overflow-wrap: anywhere; }
.fumetto p { white-space: pre-line; }
.fumetto.loro { align-self: flex-start; background: var(--carta); color: var(--testo); border-bottom-left-radius: 6px; box-shadow: var(--ombra); }
.fumetto.mio { align-self: flex-end; background: var(--marca); color: var(--su-marca); border-bottom-right-radius: 6px; }
.fumetto.annuncio { box-shadow: inset 0 0 0 2px var(--firma), var(--ombra); }
.fumetto .etichetta-piccola { margin-bottom: 4px; }
.fumetto.mio .etichetta-piccola { color: var(--su-marca); }
.fumetto .ora { display: block; margin-top: 4px; font-size: 13px; line-height: 16px; opacity: .9; text-align: right; }
.fumetto.loro .ora { color: var(--testo-2); opacity: 1; }
.pas-azienda { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-top: 8px; padding: 0 12px; border-radius: 16px; background: var(--marca-tenue); color: var(--marca-testo); font-size: 14px; font-weight: 700; max-width: 100%; }
.pas-azienda .i { width: 16px; height: 16px; flex: none; }
.fumetto.mio .pas-azienda { background: rgba(255, 255, 255, .18); color: var(--su-marca); }
.allegati-fumetto { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.allegati-fumetto .pas { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.allegati-fumetto .i { width: 14px; height: 14px; }
.scrivi {
  position: sticky; z-index: 5; bottom: calc(var(--alta-barra) + env(safe-area-inset-bottom) + 8px);
  margin-top: 8px; padding: 8px; border-radius: 26px; background: var(--carta); box-shadow: var(--ombra), 0 10px 30px -18px rgba(15, 13, 42, .45);
}
.riga-scrivi { display: flex; align-items: flex-end; gap: 6px; }
.riga-scrivi .tondo-44 { box-shadow: none; background: var(--tasto-chiaro); color: var(--testo-2); cursor: pointer; }
.riga-scrivi .ingresso { flex: 1; min-width: 0; height: 44px; min-height: 44px; padding: 10px 14px; border-radius: 22px; border-color: transparent; background: var(--carta-2); resize: none; line-height: 22px; }
.riga-scrivi .ingresso:focus { border-color: var(--marca); }
.tondo-invia { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--marca); color: var(--su-marca); }
.tondo-invia .i { width: 20px; height: 20px; }
.legata:empty { display: none; }
.legata { padding: 0 4px 8px; }
.legata .pas-azienda { margin-top: 0; padding-right: 0; }
.legata .togli { width: 32px; height: 32px; display: grid; place-items: center; color: inherit; }
.legata .togli .i { width: 14px; height: 14px; }
.domanda .fumetto { max-width: 100%; }
@media (min-width: 900px) { .scrivi { bottom: 16px; } }

/* --- Profilo --------------------------------------------------------------- */
.chi-sono { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.tondo-profilo.grande { width: 56px; height: 56px; font-size: 22px; box-shadow: none; }
.mandato { display: grid; gap: 10px; }
.servizi-mandato { display: grid; gap: 8px; }
.servizi-mandato li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: var(--r-riga); background: var(--carta-2); }
.servizi-mandato .nome { font-weight: 700; }
.date-mandato { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.date-mandato div { padding: 10px 12px; border-radius: var(--r-riga); background: var(--carta-2); }
.date-mandato dt { font-size: 13px; line-height: 16px; color: var(--testo-2); font-weight: 700; }
.date-mandato dd { margin: 2px 0 0; font-weight: 700; }
.cifre-provvigioni { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.cifra.media { font: 800 24px/30px var(--font-titoli); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.riga-notifiche { display: flex; align-items: center; gap: 12px; }
.riga-notifiche .t-riga { flex: 1; min-width: 0; }
.riga-notifiche .tessera { width: 44px; height: 44px; }
.pulsanti.stretti { margin-top: 0; }
.piede-profilo { margin: 24px 0 8px; text-align: center; font-size: 15px; line-height: 20px; color: var(--testo-2); }

/* --- Foglio della festa ------------------------------------------------------ */
.foglio-festa .foglio-corpo { overflow: visible; }
.foglio-festa .festa { padding-bottom: 4px; }

/* --- Schermi stretti (da 320 px) ------------------------------------------ */
@media (max-width: 359px) {
  :root { --margine: 12px; }
  .titolo-xl { font-size: 26px; line-height: 30px; }
  .saldo .importo { font-size: 40px; line-height: 44px; }
  .serie { display: none; }
  .azioni { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr); }
  .azioni .btn { padding: 0 8px; white-space: normal; text-align: center; line-height: 17px; }
  .azioni.larghe .btn .i, .pdf-offerta .azioni .btn .i { display: none; }
  .azione { font-size: 12px; }
  .azione .cerchio { width: 46px; height: 46px; }
  .grandi .grande { height: 120px; padding: 14px; }
}

/* Con «riduci movimento» attivo è tutto fermo. I numeri vanno già scritti al valore finale (lo fa il JS). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
  .piu.onda::after { display: none; }
}
