/* Assistente Commerciale — v22.2 «pulita e minimale»
   Token brand 2026 (verde #68F840, Sora + IBM Plex Mono) su superfici piatte:
   niente aloni, niente grana, bordi sottili, un solo accento. */

:root {
  --bg: #0C1117; --panno: #121A23; --card: #121A23; --card2: #18222D;
  --linea: rgba(232,238,243,.08); --linea2: rgba(232,238,243,.15); --velo: rgba(232,238,243,.045);
  --ink: #E8EEF3; --ink-soft: #C3CEDA; --muted: #8C9BAB; --muted2: #5E6E7E;
  --verde: #68F840; --verde2: #4FD92A; --su-verde: #07200A; --azzurro: #3EC9F5; --oro: #F5C33B; --rosso: #FF6B6B;
  --verde-dim: rgba(104,248,64,.11); --rosso-dim: rgba(255,107,107,.11); --azzurro-dim: rgba(62,201,245,.11); --oro-dim: rgba(245,195,59,.12);
  --punta1: #E8EEF3;
  --r: 14px; --r-sm: 10px;
  --ombra: 0 18px 50px rgba(0,0,0,.45);
  --nav-bg: rgba(12,17,23,.92);
  --sans: "Sora", system-ui, -apple-system, sans-serif;
  --mono: "IBM Plex Mono", Consolas, Menlo, monospace;
  --ease: cubic-bezier(.2,.8,.2,1);
  --t-fast: 140ms var(--ease); --t-med: 240ms var(--ease);
}
html[data-tema="chiaro"] {
  --bg: #F5F6F8; --panno: #FFFFFF; --card: #FFFFFF; --card2: #F2F4F7;
  --linea: rgba(20,27,34,.09); --linea2: rgba(20,27,34,.18); --velo: rgba(20,27,34,.04);
  --ink: #141B22; --ink-soft: #35414D; --muted: #5E6B78; --muted2: #8E9AA6;
  --verde: #1C9E3B; --verde2: #157F2F; --su-verde: #FFFFFF; --azzurro: #0B8EC4; --oro: #C98F00; --rosso: #D64545;
  --verde-dim: rgba(28,158,59,.1); --rosso-dim: rgba(214,69,69,.09); --azzurro-dim: rgba(11,142,196,.09); --oro-dim: rgba(201,143,0,.11);
  --punta1: #141B22;
  --ombra: 0 18px 50px rgba(20,27,34,.14);
  --nav-bg: rgba(245,246,248,.92);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; width: 100%; overflow-x: hidden; }
body { font-family: var(--sans); color: var(--ink); font-size: 15px; line-height: 1.5; background: var(--bg); overscroll-behavior: none; position: fixed; inset: 0; -webkit-font-smoothing: antialiased; transition: background .25s, color .25s; }
.nome, .azione, .msg, .scad, .chi, .cosa { overflow-wrap: anywhere; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
a { color: inherit; }
h1, h2, h3 { letter-spacing: -.015em; }
::selection { background: rgba(104,248,64,.3); }
:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; border-radius: 6px; }
#app { display: flex; flex-direction: column; height: 100dvh; }
.nascosto { display: none !important; }
.mut { color: var(--muted); }

/* simbolo Due Punte */
.punta-sx { fill: var(--punta1); stroke: var(--punta1); }
.punta-dx { fill: var(--verde); stroke: var(--verde); }
@keyframes punta { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* icone */
.ic { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ic.lg { width: 22px; height: 22px; }
.ic.sm { width: 16px; height: 16px; }

/* ---------- Header ---------- */
header { padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; border-bottom: 1px solid var(--linea); background: var(--bg); }
header .riga { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { width: 30px; height: 30px; flex: none; }
header h1 { font-size: 18px; font-weight: 700; letter-spacing: -.02em; line-height: 1.15; }
header .sub { color: var(--muted); font-family: var(--mono); font-size: 10px; margin-top: 1px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; }
.azioni-testata { display: flex; gap: 6px; }
.azioni-testata button { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid var(--linea); border-radius: 10px; color: var(--muted); background: var(--card); transition: color var(--t-fast), border-color var(--t-fast); }
.azioni-testata button:active { color: var(--ink); border-color: var(--linea2); }
#btnRefresh.gira .ic { animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

.statistiche { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.stat { background: var(--card); border: 1px solid var(--linea); border-radius: var(--r-sm); padding: 8px 4px 7px; text-align: center; transition: border-color var(--t-fast), background var(--t-fast); }
.stat b { display: block; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.3px; line-height: 1.2; }
.stat span { font-family: var(--mono); font-size: 9.5px; color: var(--muted2); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; }
.stat small { display: block; font-family: var(--mono); font-size: 9px; color: var(--muted); margin-top: 1px; line-height: 1.3; }
.stat.verde b { color: var(--verde); }
.stat.rosso b { color: var(--rosso); }
.stat.attiva { border-color: var(--verde); background: var(--verde-dim); }
.stat.rosso.attiva { border-color: var(--rosso); background: var(--rosso-dim); }

main { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 4px 16px calc(env(safe-area-inset-bottom) + 110px); -webkit-overflow-scrolling: touch; }
.vista { animation: entra 200ms var(--ease) both; }
@keyframes entra { from { transform: translateY(4px); } to { transform: none; } }

/* ---------- Sezioni e card ---------- */
.sez { display: flex; align-items: center; gap: 8px; margin: 16px 2px 8px; }
.sez .tit { font-size: 13px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.sez .num { font-family: var(--mono); font-size: 10.5px; font-weight: 500; color: var(--muted); background: var(--velo); border-radius: 999px; padding: 1px 8px; }
.sez.fuoco .tit, .sez.fuoco .num { color: var(--rosso); }
.sez.fuoco .num { background: var(--rosso-dim); }
.sez::after { content: ''; order: 1; flex: 1; height: 1px; background: var(--linea); margin-left: 4px; }
.sez .viste { order: 2; margin-left: 6px; }

.card { background: var(--card); border: 1px solid var(--linea); border-left: 3px solid var(--linea2); border-radius: var(--r); padding: 11px 12px 10px; margin-bottom: 8px; transition: border-color var(--t-fast), background var(--t-fast); }
.card.linea-ai { border-left-color: var(--verde); }
.card.linea-mm { border-left-color: var(--azzurro); }
.card.linea-dg { border-left-color: var(--oro); }
.card.linea-pers { border-left-color: var(--muted2); }
.card.urgente { border-color: rgba(255,107,107,.45); }
.card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.card .nome { font-weight: 600; font-size: 14px; line-height: 1.3; }
.card .id { color: var(--muted2); font-family: var(--mono); font-size: 10px; margin-left: 6px; font-weight: 500; }
.contatti { display: flex; gap: 6px; }
.contatti a { display: grid; place-items: center; width: 34px; height: 34px; color: var(--muted); border: 1px solid var(--linea); border-radius: 9px; transition: color var(--t-fast), border-color var(--t-fast); }
.contatti a:active { color: var(--verde); border-color: var(--verde); }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; align-items: center; }
.chip { font-size: 10.5px; font-weight: 500; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--linea); color: var(--muted); }
.chip.ai { color: var(--verde); border-color: transparent; background: var(--verde-dim); }
.chip.mm { color: var(--azzurro); border-color: transparent; background: var(--azzurro-dim); }
.chip.dg { color: var(--oro); border-color: transparent; background: var(--oro-dim); }
.chip.tizi { color: var(--oro); }
.chip.val { color: var(--ink); font-family: var(--mono); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chip.val small { color: var(--muted); }

.azione { margin-top: 9px; font-size: 13.5px; line-height: 1.45; color: var(--ink-soft); }
.scad { display: flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; margin-top: 7px; color: var(--muted); }
.scad.rossa { color: var(--rosso); }
.scad.gialla { color: var(--oro); }
.scad .sep { color: var(--muted2); margin: 0 2px; }

.bottoni { display: flex; gap: 6px; margin-top: 11px; }
.bottoni button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 36px; border: 1px solid var(--linea); color: var(--muted); border-radius: 9px; font-size: 12px; font-weight: 600; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.bottoni button:active, .bottoni .b-ok:active { color: var(--verde); border-color: var(--verde); }
.bottoni .b-no:active { color: var(--rosso); border-color: var(--rosso); }

/* qualifica: 4 pallini P D B T (pieni = sì, cerchiati rossi = no, grigi = da chiarire) */
.qual { display: inline-flex; gap: 3px; align-items: center; vertical-align: middle; }
.qual i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--muted2); display: inline-block; }
.qual i.si { background: var(--verde); border-color: var(--verde); }
.qual i.no { border-color: var(--rosso); }
.qual.lg i { width: 11px; height: 11px; }
.qual-lbl { font-family: var(--mono); font-size: 10px; color: var(--muted); margin-left: 4px; }
.qualGrid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 12px; }
.qrow { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--linea); border-radius: var(--r-sm); background: var(--card); }
.qrow b { font-size: 13.5px; font-weight: 600; display: block; }
.qrow span { color: var(--muted); font-size: 12px; display: block; margin-top: 1px; }
.qrow .tre { display: inline-flex; border: 1px solid var(--linea); border-radius: 999px; padding: 2px; }
.qrow .tre button { width: 36px; height: 30px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.qrow .tre button.on.si { background: var(--verde-dim); color: var(--verde); }
.qrow .tre button.on.no { background: var(--rosso-dim); color: var(--rosso); }
.qrow .tre button.on.na { background: var(--velo); color: var(--ink); }

/* ---------- Skeleton / vuoto ---------- */
.skel { height: 120px; border-radius: var(--r); margin-bottom: 10px; border: 1px solid var(--linea); background: linear-gradient(100deg, var(--card) 40%, var(--card2) 50%, var(--card) 60%); background-size: 200% 100%; animation: brilla 1.3s infinite linear; }
@keyframes brilla { to { background-position: -200% 0; } }
.vuoto { text-align: center; color: var(--muted); padding: 46px 20px; font-size: 14px; line-height: 1.6; }

/* ---------- Dashboard ---------- */
.dashDue { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.dashTile { background: var(--card); border: 1px solid var(--linea); border-left: 3px solid var(--linea2); border-radius: var(--r); padding: 12px 13px 11px; text-align: left; transition: background var(--t-fast), border-color var(--t-fast); }
.dashTile.ai { border-left-color: var(--verde); }
.dashTile.mm { border-left-color: var(--azzurro); }
.dashTile.dg { border-left-color: var(--oro); }
.dashTile.pers { border-left-color: var(--muted2); }
.dashTile b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.5px; line-height: 1.1; }
.dashTile span { display: block; font-size: 12px; color: var(--muted); font-weight: 500; margin-top: 3px; }
.dashTile i { display: block; font-style: normal; color: var(--ink-soft); font-size: 11.5px; font-variant-numeric: tabular-nums; font-family: var(--mono); margin-top: 4px; }
.dashTile i small { color: var(--muted2); }
.dashTile em { display: block; height: 3px; border-radius: 2px; background: var(--velo); margin-top: 9px; overflow: hidden; }
.dashTile em u { display: block; height: 100%; border-radius: 2px; background: var(--muted2); }
.dashTile.ai em u { background: var(--verde); }
.dashTile.mm em u { background: var(--azzurro); }
.dashTile.dg em u { background: var(--oro); }

.dashCard { background: var(--card); border: 1px solid var(--linea); border-radius: var(--r); padding: 2px 13px; margin-bottom: 10px; }
.dashCard.vuota { padding: 16px 14px; color: var(--muted); font-size: 13.5px; text-align: center; }
.dashCard.scorri { max-height: 280px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--linea2) transparent; }
.riga7 { display: flex; width: calc(100% + 26px); gap: 10px; padding: 9px 13px 9px 10px; margin-left: -13px; border-left: 3px solid transparent; border-bottom: 1px solid var(--linea); align-items: center; text-align: left; transition: background var(--t-fast); }
.riga7.linea-ai { border-left-color: var(--verde); }
.riga7.linea-mm { border-left-color: var(--azzurro); }
.riga7.linea-dg { border-left-color: var(--oro); }
.riga7.linea-pers { border-left-color: var(--muted2); }
.dashCard .riga7:last-child { border-bottom: none; }
.riga7 .quando { flex-shrink: 0; width: 54px; font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.riga7.rossa .quando { color: var(--rosso); }
.riga7.gialla .quando { color: var(--oro); }
.riga7 .corpo { flex: 1; min-width: 0; }
.riga7 .chi { display: block; font-weight: 600; font-size: 13px; }
.riga7 .cosa { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.riga7 .pers { color: var(--oro); font-weight: 500; font-size: 12px; }
.riga7 .valMini { flex-shrink: 0; color: var(--ink-soft); font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums; }
.lineaDot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; vertical-align: 1px; }
.lineaDot.ai { background: var(--verde); }
.lineaDot.mm { background: var(--azzurro); }
.lineaDot.dg { background: var(--oro); }
.lineaDot.pers { background: var(--muted2); }
.agenda2 > div { min-width: 0; }
.collega-pill { flex-shrink: 0; align-self: center; font-family: var(--mono); font-size: 10px; font-weight: 500; color: var(--verde); border: 1px solid var(--verde); border-radius: 999px; padding: 3px 9px; }
.riga7 .collega-btn { width: 30px; height: 30px; border-radius: 8px; align-self: center; margin-top: 0; }
.manLink { color: var(--verde); font-size: 11px; }
.azioni .pericolo { color: var(--rosso); border-color: rgba(255,107,107,.4); }
#cercaColl, .campo { width: 100%; margin: 12px 0 0; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--linea2); background: var(--card); color: var(--ink); font-size: 16px; font-family: inherit; }
#listaColl .cerca-riga { gap: 9px; padding: 9px 12px; font-size: 13px; }
#listaColl .cerca-riga .lineaDot { margin: 0; }
.dashVinte { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--card); border: 1px solid var(--linea); color: var(--ink); border-radius: var(--r); padding: 12px; font-weight: 600; font-size: 13.5px; margin: 2px 0 10px; }
.dashVinte b { color: var(--verde); font-weight: 700; }

/* brief del giorno e revisione del lunedì */
.nota { background: var(--card); border: 1px solid var(--linea); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; }
.nota summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.nota summary::-webkit-details-marker { display: none; }
.nota summary .quando { margin-left: auto; font-family: var(--mono); font-size: 10.5px; color: var(--muted); font-weight: 500; }
.nota summary .freccia { color: var(--muted2); transition: transform var(--t-fast); }
.nota[open] summary .freccia { transform: rotate(90deg); }
.nota .testo { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); margin-top: 10px; padding-top: 6px; border-top: 1px solid var(--linea); }
.nota .nh { font-weight: 600; color: var(--ink); font-size: 12.5px; letter-spacing: .02em; margin: 12px 0 4px; }
.nota .nh:first-child { margin-top: 4px; }
.nota .nl { margin: 1px 0; padding-left: 10px; border-left: 2px solid var(--linea); }
.nota .nsp { height: 2px; }
.nota .testo a { color: var(--verde); text-decoration: none; border-bottom: 1px solid var(--verde-dim); font-variant-numeric: tabular-nums; }
.nota.oggi { border-color: rgba(104,248,64,.35); }
.nota .vuotaNota { color: var(--muted); font-size: 13px; margin-top: 8px; }

/* ---------- Flusso trattative ---------- */
.stepper { display: flex; gap: 3px; margin-top: 8px; }
.stepper i { flex: 1; height: 5px; border-radius: 3px; background: var(--linea2); }
.stepper.small { margin-top: 9px; }
.stepper.small i { height: 4px; }
.stepper i.fatto { background: var(--muted); }
.stepper i.attuale { background: var(--verde); }
.stepper.linea-mm i.attuale { background: var(--azzurro); }
.stepper.linea-dg i.attuale { background: var(--oro); }
.stepper.linea-pers i.attuale { background: var(--ink-soft); }
.funnel { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin: 0 0 10px; }
.fstep { position: relative; background: var(--card); border: 1px solid var(--linea); border-radius: var(--r-sm); padding: 8px 2px 7px; text-align: center; transition: border-color var(--t-fast), background var(--t-fast); }
.fstep b { display: block; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.fstep span { display: block; font-family: var(--mono); font-size: 8px; color: var(--muted2); text-transform: uppercase; letter-spacing: .03em; margin-top: 1px; white-space: nowrap; }
.fstep i { display: block; font-style: normal; font-family: var(--mono); font-size: 8.5px; color: var(--muted); margin-top: 2px; font-variant-numeric: tabular-nums; }
.fstep.vuoto b, .fstep.vuoto i { color: var(--muted2); }
.fstep.attivo { border-color: var(--verde); background: var(--verde-dim); }
.rigaFlusso { align-items: flex-start; }
.rigaFlusso .corpo .stepper { margin: 6px 0 5px; }
.rigaFlusso .cosa .stepLbl { color: var(--ink-soft); font-weight: 600; }
.stepList { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.stepOpt { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 13px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--linea); color: var(--ink); font-size: 14px; font-weight: 500; transition: border-color var(--t-fast), background var(--t-fast); }
.stepOpt .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: 11.5px; font-weight: 600; background: var(--velo); color: var(--muted); flex-shrink: 0; }
.stepOpt.fatto .n { background: var(--muted2); color: var(--bg); }
.stepOpt.attuale { border-color: var(--verde); background: var(--verde-dim); }
.stepOpt.attuale .n { background: var(--verde); color: var(--su-verde); }
.stepOpt .qui { margin-left: auto; font-family: var(--mono); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--verde); }
.linkMod { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 10px; color: var(--muted); font-size: 13px; font-weight: 500; padding: 10px; }

/* ---------- Bacheca (kanban) ---------- */
.viste { display: inline-flex; background: var(--velo); border: 1px solid var(--linea); border-radius: 999px; padding: 2px; gap: 2px; }
.vista-btn { padding: 5px 11px; border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--muted); transition: all .15s; }
.vista-btn.attiva { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.riga7.rigaFlusso { cursor: pointer; }
.riga7 .avanza { flex-shrink: 0; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--linea); color: var(--muted); margin-top: 2px; transition: color var(--t-fast), border-color var(--t-fast); }
.riga7 .avanza:active { color: var(--verde); border-color: var(--verde); }
.ferma { color: var(--oro); }
.board { display: flex; gap: 10px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; margin: 0 -16px 6px; padding: 2px 16px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.board::-webkit-scrollbar { display: none; }
.col { flex: 0 0 78vw; max-width: 340px; scroll-snap-align: start; background: var(--card); border: 1px solid var(--linea); border-radius: var(--r); padding: 11px 10px 6px; }
.col-top { display: flex; align-items: baseline; gap: 7px; margin-bottom: 9px; }
.col-top .n { font-family: var(--mono); font-size: 9.5px; color: var(--muted2); }
.col-top .nome { font-weight: 600; font-size: 13.5px; }
.col-top .tot { margin-left: auto; font-family: var(--mono); font-size: 10px; color: var(--muted); white-space: nowrap; }
.col-top .tot b { color: var(--ink); font-weight: 600; }
.col .vuota { color: var(--muted2); font-size: 11px; text-align: center; padding: 20px 6px; font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.kcard { background: var(--bg); border: 1px solid var(--linea); border-left: 3px solid var(--linea2); border-radius: var(--r-sm); padding: 8px 9px 7px 10px; margin-bottom: 6px; cursor: pointer; transition: border-color var(--t-fast); }
html[data-tema="chiaro"] .kcard { background: var(--card2); }
.kcard.linea-ai { border-left-color: var(--verde); }
.kcard.linea-mm { border-left-color: var(--azzurro); }
.kcard.linea-dg { border-left-color: var(--oro); }
.kcard.linea-pers { border-left-color: var(--muted2); }
.kcard .kt { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.kcard .kn { font-weight: 600; font-size: 12.5px; line-height: 1.3; overflow-wrap: anywhere; }
.kcard .kn .pers { color: var(--oro); font-weight: 500; font-size: 11.5px; }
.kcard .kv { font-family: var(--mono); font-size: 11px; color: var(--ink-soft); white-space: nowrap; }
.kcard .kb { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.kcard .kb .info { flex: 1; font-family: var(--mono); font-size: 10px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kcard .kb .info.rossa { color: var(--rosso); }
.kcard .kb .info.gialla { color: var(--oro); }
.kcard .kb button { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; border: 1px solid var(--linea); color: var(--muted); transition: color var(--t-fast), border-color var(--t-fast); }
.kcard .kb button:active { color: var(--verde); border-color: var(--verde); }
.kcard .kb button.lose:active { color: var(--rosso); border-color: var(--rosso); }
.festa { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.festa i { position: absolute; top: -14px; width: 8px; height: 14px; border-radius: 2px; animation: cade 1.6s ease-in forwards; }
@keyframes cade { to { transform: translateY(110vh) rotate(720deg); opacity: .15; } }

/* ---------- Bottom nav ---------- */
nav { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--nav-bg); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--linea); padding-bottom: env(safe-area-inset-bottom); z-index: 10; }
nav button { flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted2); font-size: 10px; font-weight: 600; padding: 10px 0 8px; min-height: 54px; transition: color var(--t-med); }
nav button.attivo { color: var(--verde); }

/* ---------- Chat ---------- */
#vChat { display: flex; flex-direction: column; height: 100%; }
#chatLista { flex: 1; overflow-y: auto; padding: 12px 2px; }
.msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; margin-bottom: 8px; font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; animation: msgIn 200ms var(--ease) both; }
@keyframes msgIn { from { transform: translateY(4px); } to { transform: none; } }
.msg.utente { background: var(--verde); color: var(--su-verde); font-weight: 500; margin-left: auto; border-bottom-right-radius: 5px; }
.msg.bot { background: var(--card); border: 1px solid var(--linea); border-bottom-left-radius: 5px; }
.digitando { display: inline-flex; gap: 4px; padding: 14px 16px; }
.digitando i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: salta 1.2s infinite; }
.digitando i:nth-child(2) { animation-delay: .15s; }
.digitando i:nth-child(3) { animation-delay: .3s; }
@keyframes salta { 0%, 60%, 100% { transform: none; opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
#chatInput { display: flex; gap: 8px; padding: 8px 0 6px; }
#chatInput textarea { flex: 1; background: var(--card); border: 1px solid var(--linea2); color: var(--ink); border-radius: 14px; padding: 11px 15px; font-size: 16px; font-family: inherit; resize: none; height: 46px; transition: border-color var(--t-fast); }
#chatInput textarea:focus { outline: none; border-color: var(--verde); }
#chatInput button { width: 46px; height: 46px; display: grid; place-items: center; background: var(--verde); color: var(--su-verde); border-radius: 13px; transition: opacity var(--t-fast); }
#chatInput button:active { opacity: .8; }
.suggerimenti { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.suggerimenti::-webkit-scrollbar { display: none; }
.suggerimenti button { flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--muted); border: 1px solid var(--linea); border-radius: 999px; padding: 7px 12px; transition: color var(--t-fast), border-color var(--t-fast); }
.suggerimenti button:active { color: var(--ink); border-color: var(--linea2); }

/* ---------- WhatsApp ---------- */
#app.inWa .testata-stats { display: none; }
main#vWhatsApp.vista { animation: none; } /* un'animazione su transform renderebbe la chat a tutto schermo prigioniera della pagina */
.navBadge { position: absolute; top: 5px; left: calc(50% + 7px); min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--verde); color: var(--su-verde); font-family: var(--mono); font-size: 9.5px; font-weight: 600; font-style: normal; line-height: 16px; text-align: center; }
.navBadge:empty { display: none; }
.viste-nav .navBadge { position: static; display: inline-block; margin-left: 6px; vertical-align: 1px; }
.waRiassunto { font-size: 12px; color: var(--muted); margin: 12px 2px 10px; }
.waCerca { width: 100%; background: var(--card); border: 1px solid var(--linea2); color: var(--ink); border-radius: var(--r-sm); padding: 10px 12px; font-size: 16px; font-family: inherit; }
.waCerca:focus { outline: none; border-color: var(--verde); }
.waFiltri { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; }
.waFiltri button { flex-shrink: 0; font-size: 12.5px; font-weight: 600; color: var(--muted); border: 1px solid var(--linea); border-radius: 999px; padding: 7px 12px; transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.waFiltri button b { font-family: var(--mono); font-weight: 500; font-size: 11px; margin-left: 6px; color: var(--muted2); }
.waFiltri button.attivo { color: var(--ink); border-color: var(--verde); background: var(--verde-dim); }
.waFiltri button.ns.attivo { border-color: var(--rosso); background: var(--rosso-dim); }
.waRighe { background: var(--card); border: 1px solid var(--linea); border-radius: var(--r); overflow: hidden; }
.waRiga { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1px 10px; width: 100%; text-align: left; padding: 11px 14px 10px; border-bottom: 1px solid var(--linea); transition: background var(--t-fast); }
.waRiga:last-child { border-bottom: none; }
.waRiga .chi { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waRiga time { font-family: var(--mono); font-size: 10.5px; color: var(--muted); align-self: center; }
.waRiga .az { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 1; }
.waRiga .ult { font-size: 13px; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; grid-column: 1; }
.waRiga > i { grid-column: 2; grid-row: 2 / 4; align-self: center; justify-self: end; font-style: normal; }
.waRiga .num { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--verde); color: var(--su-verde); font-family: var(--mono); font-size: 11px; font-weight: 600; line-height: 20px; text-align: center; }
.waRiga .bz { font-size: 10.5px; font-weight: 600; color: var(--verde); }
.waRiga.nuovo .chi::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--verde); margin-right: 7px; vertical-align: 2px; }
.waRiga.nuovo .ult { color: var(--ink); font-weight: 500; }
.waRiga.attiva { background: var(--velo); }
.nsTag { font-style: normal; font-size: 11px; font-weight: 600; color: var(--rosso); }
.waChat { display: none; flex-direction: column; background: var(--bg); position: fixed; inset: 0; z-index: 15; padding-top: env(safe-area-inset-top); }
.wa.conChat .waChat { display: flex; }
.waTesta { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--linea); }
.waIndietro { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border: 1px solid var(--linea); border-radius: 10px; color: var(--muted); }
.waChi { flex: 1; min-width: 0; }
.waChi b { display: block; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waChi span { display: block; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.waChi a { font-family: var(--mono); text-decoration: none; }
.waNsBtn { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--linea); border-radius: 999px; padding: 7px 11px; white-space: nowrap; transition: color var(--t-fast), border-color var(--t-fast); }
.waNsBtn.on { color: var(--rosso); border-color: transparent; background: var(--rosso-dim); }
.waNsBtn .lungo { display: none; }
.waAvviso { margin: 10px 14px 0; padding: 9px 12px; border-radius: var(--r-sm); background: var(--rosso-dim); color: var(--rosso); font-size: 13px; line-height: 1.45; }
.waInfo { padding: 0 14px; margin-top: 10px; }
.waMsgs { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 14px 12px; }
.waGiorno { text-align: center; font-size: 11px; color: var(--muted); margin: 12px 0 8px; }
.waM { max-width: 82%; width: fit-content; padding: 8px 12px 5px; border-radius: 14px; margin-bottom: 6px; font-size: 14.5px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; border: 1px solid var(--linea); background: var(--card); border-bottom-left-radius: 4px; }
.waM.out { margin-left: auto; background: var(--verde-dim); border-color: transparent; border-radius: 14px 14px 4px 14px; }
.waM.fallito { border-color: var(--rosso); }
.waM .meta { display: block; text-align: right; font-family: var(--mono); font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.waM .meta .letto { color: var(--azzurro); }
.waM .meta .err { color: var(--rosso); font-family: var(--sans); font-weight: 600; }
.waComp { border-top: 1px solid var(--linea); padding: 0 14px calc(env(safe-area-inset-bottom) + 10px); }
.waFin { height: 3px; background: var(--linea); margin: 0 -14px 8px; }
.waFin i { display: block; height: 100%; background: var(--verde); transition: width .6s var(--ease); }
.waFinTesto { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: var(--muted); margin-bottom: 7px; }
.waFinTesto .bz { color: var(--verde); font-weight: 600; }
.waResta { margin-left: auto; text-align: right; }
.waInput { display: flex; gap: 8px; align-items: flex-end; }
.waInput textarea { flex: 1; min-height: 46px; background: var(--card); border: 1px solid var(--linea2); color: var(--ink); border-radius: 14px; padding: 11px 14px; font-family: inherit; font-size: 16px; line-height: 1.45; resize: none; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.waInput textarea.conBozza { border-color: var(--verde); box-shadow: inset 3px 0 0 var(--verde); }
.waInput textarea:focus { outline: none; border-color: var(--verde); }
.waInput button { width: 46px; height: 46px; flex: none; display: grid; place-items: center; background: var(--verde); color: var(--su-verde); border-radius: 13px; transition: opacity var(--t-fast); }
.waInput button:disabled { opacity: .45; }
.waChiusa { font-size: 13px; color: var(--muted); line-height: 1.5; padding: 12px 0 2px; }
.waVuotoChat { margin: auto; text-align: center; color: var(--muted); padding: 40px 20px; font-size: 14px; line-height: 1.6; }
.waVuotoChat .waNsBtn { margin-top: 12px; }

/* ---------- Form ---------- */
.form label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin: 13px 0 5px; }
.form input, .form select, .form textarea { width: 100%; background: var(--card); border: 1px solid var(--linea2); color: var(--ink); border-radius: var(--r-sm); padding: 11px 12px; font-size: 16px; font-family: inherit; transition: border-color var(--t-fast); }
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--verde); }
.form textarea { min-height: 140px; resize: vertical; }
.form select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%238C9BAB' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.form .due { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
input[type="date"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 46px; text-align: left; color-scheme: dark; }
html[data-tema="chiaro"] input[type="date"] { color-scheme: light; }
input::-webkit-date-and-time-value { text-align: left; margin: 0; }
.form .invia { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; background: var(--verde); color: var(--su-verde); border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 700; transition: opacity var(--t-fast); }
.form .invia:disabled { opacity: .5; }
.chipsScelta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.chipsScelta button { padding: 9px 14px; border-radius: 999px; border: 1px solid var(--linea2); font-size: 13px; font-weight: 600; color: var(--ink); transition: border-color var(--t-fast), background var(--t-fast); }
.chipsScelta button:active { background: var(--verde-dim); border-color: var(--verde); }

/* ---------- Modale ---------- */
#modale { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; z-index: 20; opacity: 0; pointer-events: none; transition: opacity var(--t-med); }
#modale.aperta { opacity: 1; pointer-events: auto; }
#modale .box { background: var(--panno); border: 1px solid var(--linea); border-bottom: none; border-radius: 20px 20px 0 0; width: 100%; padding: 10px 18px calc(env(safe-area-inset-bottom) + 20px); max-height: 86dvh; overflow-y: auto; box-shadow: var(--ombra); transform: translateY(100%); transition: transform 280ms cubic-bezier(.32,.72,.28,1); }
#modale.aperta .box { transform: none; }
#modale .manico { width: 36px; height: 4px; border-radius: 3px; background: var(--linea2); margin: 4px auto 14px; }
#modale .box { position: relative; }
#modale .chiudi-x { display: none; position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--linea); color: var(--muted); font-size: 20px; line-height: 1; }
#modale .chiudi-x:hover { color: var(--ink); border-color: var(--linea2); }
#modale h3 { font-size: 17px; font-weight: 600; letter-spacing: -.3px; margin-bottom: 4px; }
#modale .mut { color: var(--muted); font-size: 13px; line-height: 1.5; }
#modale .azioni { display: flex; gap: 8px; margin-top: 18px; }
#modale .azioni button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r-sm); padding: 12px 10px; font-size: 14px; font-weight: 600; min-height: 46px; transition: opacity var(--t-fast); }
#modale .azioni button:active { opacity: .8; }
#modale .conferma { background: var(--verde); color: var(--su-verde); }
#modale .conferma.rossa { background: var(--rosso); color: #fff; }
#modale .annulla { border: 1px solid var(--linea2); color: var(--ink); }
#modale .vinta { padding: 11px 2px; border-bottom: 1px solid var(--linea); }
#modale .vinta:last-of-type { border-bottom: none; }
#modale .vinta .r1 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
#modale .vinta .r1 b { font-size: 14px; overflow-wrap: anywhere; font-weight: 600; }
#modale .vinta .r1 .val { color: var(--verde); font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
#modale .vinta .r1 .val.persa { color: var(--muted); }
#modale .vinta .r2 { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.45; overflow-wrap: anywhere; }
.tabs { display: inline-flex; background: var(--velo); border: 1px solid var(--linea); border-radius: 999px; padding: 2px; margin: 10px 0 4px; }
.tabs button { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tabs button.attiva { background: var(--card); color: var(--ink); }
.barre { margin-top: 8px; }
.barra { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 5px 0; }
.barra .riempi { height: 6px; border-radius: 3px; background: var(--velo); overflow: hidden; margin-top: 4px; }
.barra .riempi i { display: block; height: 100%; background: var(--muted); border-radius: 3px; }
.barra.vinta .riempi i { background: var(--verde); }
.barra b { font-family: var(--mono); font-weight: 500; color: var(--muted); font-size: 11.5px; }
.kpi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.kpi div { border: 1px solid var(--linea); border-radius: var(--r-sm); padding: 9px 6px; text-align: center; }
.kpi b { display: block; font-size: 18px; font-weight: 700; }
.kpi span { font-family: var(--mono); font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 76px); transform: translate(-50%, 16px); background: var(--panno); border: 1px solid var(--linea2); color: var(--ink); font-size: 13.5px; font-weight: 500; padding: 10px 16px; border-radius: 999px; z-index: 30; opacity: 0; pointer-events: none; transition: opacity var(--t-med), transform var(--t-med); max-width: 88vw; text-align: center; box-shadow: var(--ombra); }
#toast.vivo { opacity: 1; transform: translate(-50%, 0); }
#toast.ok { border-color: var(--verde); }
#toast.errore { border-color: var(--rosso); color: var(--rosso); }

/* ---------- Login ---------- */
#login { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; justify-content: center; padding: 24px; overflow-y: auto; background: var(--bg); }
#login .login-card { width: 100%; max-width: 400px; margin: 0 auto; padding: 34px 28px 28px; border-radius: 20px; background: var(--panno); border: 1px solid var(--linea); animation: sali .5s var(--ease); }
@keyframes sali { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
#login .login-logo { width: 46px; height: 46px; margin-bottom: 14px; }
#login .login-logo .punta-sx { transform-box: fill-box; transform-origin: bottom; animation: punta .7s .1s var(--ease) both; }
#login .login-logo .punta-dx { transform-box: fill-box; transform-origin: bottom; animation: punta .7s .3s var(--ease) both; }
#login .kicker { font-family: var(--mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#login h2 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 2px; }
#login p { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
#login input { width: 100%; background: var(--card); border: 1px solid var(--linea2); color: var(--ink); border-radius: var(--r-sm); padding: 13px; font-size: 16px; text-align: center; font-family: inherit; transition: border-color var(--t-fast); }
#login input:focus { outline: none; border-color: var(--verde); }
#login input#codiceInput { font-family: var(--mono); letter-spacing: .4em; font-weight: 600; font-size: 24px; }
#login button { width: 100%; margin-top: 12px; background: var(--verde); color: var(--su-verde); border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 700; transition: opacity var(--t-fast); }
#login button.ghost { background: none; color: var(--muted); font-size: 13px; font-weight: 500; padding: 8px; margin-top: 8px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--linea2); }
#login .err { color: var(--rosso); text-align: center; font-size: 13px; margin-top: 12px; min-height: 18px; font-weight: 500; }
#login .err.info { color: var(--muted); }

/* ---------- Desktop (≥ 900px) ---------- */
.viste-nav { display: none; }
.griglia { display: block; }
@media (min-width: 900px) {
  body { font-size: 14px; }
  header { padding: 14px 28px 12px; }
  header .riga { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; max-width: 1320px; margin: 0 auto; }
  .azioni-testata { justify-self: end; }
  .azioni-testata button:hover { color: var(--ink); border-color: var(--linea2); }
  .viste-nav { display: inline-flex; justify-self: center; background: var(--velo); border: 1px solid var(--linea); border-radius: 999px; padding: 3px; gap: 2px; }
  .viste-nav button { padding: 7px 16px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--muted); white-space: nowrap; transition: all .15s; }
  .viste-nav button:hover { color: var(--ink); }
  .viste-nav button.attiva { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.2); }
  .testata-stats { max-width: 1320px; margin: 0 auto; }
  .statistiche { width: calc(100% - 424px); min-width: 560px; max-width: 896px; margin: 12px 0 0; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 8px 6px 7px; }
  nav { display: none; }
  main { width: 100%; max-width: 1376px; margin: 0 auto; padding: 8px 28px 40px; }
  main#vChat { max-width: 900px; }
  main#vWhatsApp { overflow: hidden; display: flex; flex-direction: column; padding-bottom: 20px; }
  .wa { flex: 1; min-height: 0; display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 20px; }
  .waLista { min-height: 0; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; scrollbar-color: var(--linea2) transparent; }
  .waChat, .wa.conChat .waChat { display: flex; position: static; z-index: auto; padding-top: 0; background: var(--card); border: 1px solid var(--linea); border-radius: var(--r); min-height: 0; overflow: hidden; margin-top: 12px; }
  .waIndietro { display: none; }
  .waRiga { cursor: pointer; }
  .waRiga:hover { background: var(--velo); }
  .waNsBtn .lungo { display: inline; }
  .waNsBtn:hover { color: var(--ink); border-color: var(--linea2); }
  .waNsBtn.on:hover { color: var(--rosso); border-color: var(--rosso); }
  .waInput textarea { background: var(--bg); }
  .waM { max-width: 68%; }
  .waM.in { background: var(--card2); }
  .dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-areas: "a c" "b b"; gap: 0 24px; align-items: start; }
  .dash-a { grid-area: a; } .dash-b { grid-area: b; } .dash-c { grid-area: c; }
  .dashDue { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
  .dashTile { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "num lab" "num val" "bar bar"; column-gap: 12px; align-items: center; padding: 9px 14px 10px; }
  .dashTile em { grid-area: bar; margin-top: 8px; }
  .dashTile b { grid-area: num; font-size: 22px; line-height: 1; }
  .dashTile span { grid-area: lab; margin: 0; align-self: end; }
  .dashTile i { grid-area: val; align-self: start; margin-top: 2px; }
  .board { overflow: visible; margin: 0 0 10px; padding: 0; gap: 10px; }
  .col { flex: 1 1 0; min-width: 0; max-width: none; max-height: calc(100vh - 250px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--linea2) transparent; }
  .col .col-top { position: sticky; top: -11px; margin: -11px -10px 9px; padding: 11px 10px 8px; background: var(--card); border-bottom: 1px solid var(--linea); border-radius: var(--r) var(--r) 0 0; z-index: 1; }
  .dash-c .dashCard { max-height: 320px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--linea2) transparent; }
  .dashCard.scorri { max-height: 220px; }
  .agenda2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 16px; align-items: start; }
  .griglia { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
  .griglia .card { margin-bottom: 0; }
  .card, .kcard, .dashTile, .stat, .fstep, .riga7, .stepOpt, .bottoni button, .contatti a, .suggerimenti button, .vista-btn, .nota summary { cursor: pointer; }
  .card, .kcard { transition: border-color var(--t-fast), transform var(--t-fast); }
  .card:hover, .kcard:hover, .dashTile:hover, .stat:hover, .fstep:hover, .dashVinte:hover { border-color: var(--linea2); }
  .card:hover, .kcard:hover { transform: translateY(-1px); }
  #modale .chiudi-x { display: grid; place-items: center; }
  .dashTile:hover, .stat:hover { background: var(--card2); }
  .riga7:hover { background: var(--velo); }
  .bottoni button:hover, .contatti a:hover, .kcard .kb button:hover, .riga7 .avanza:hover, .suggerimenti button:hover, .chipsScelta button:hover { color: var(--ink); border-color: var(--linea2); }
  .stepOpt:hover { border-color: var(--linea2); }
  .stepOpt.attuale:hover { border-color: var(--verde); }
  #modale { align-items: center; justify-content: center; padding: 24px; }
  #modale .box { max-width: 560px; border-radius: 18px; border-bottom: 1px solid var(--linea); max-height: 86vh; padding: 12px 24px 24px; transform: translateY(14px); }
  #modale.aperta .box { transform: none; }
  #modale .manico { display: none; }
  #toast { bottom: 36px; }
  .msg { max-width: 72%; font-size: 15px; }
  #chatLista { padding: 18px 4px; }
  .funnel { gap: 8px; }
  .fstep { padding: 8px 6px 7px; }
  .fstep b { font-size: 18px; }
  .fstep span { font-size: 8.5px; margin-top: 2px; }
  .fstep i { font-size: 9px; }
  .dash-b .dashCard { padding: 2px 16px; overflow: hidden; }
  .riga7.rigaFlusso { padding: 8px 16px 8px 12px; gap: 12px; margin-left: -16px; width: calc(100% + 32px); }
  .rigaFlusso .corpo .stepper { margin: 5px 0 4px; gap: 4px; }
  .rigaFlusso .stepper i { height: 6px; }
  .riga7.rigaFlusso .avanza { width: 30px; height: 30px; margin-top: 0; }
  .qualGrid { grid-template-columns: 1fr 1fr; }
  .nota .testo { max-height: 46vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--linea2) transparent; padding-right: 6px; }
}

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