/* MANGIA BENE — sistema di design v2 (vedi DESIGN.md). Carattere di sistema, griglia di 4 px, un solo colore d'azione. */
/* Fraunces (SIL OFL 1.1, pwa/font/OFL.txt): solo per titoli e nomi dei piatti, da 22 px in su. In casa, niente CDN. */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 500 700; font-display: swap; src: url("/font/fraunces.woff2") format("woff2"); }
@font-face { font-family: "Fraunces ripiego"; src: local("Georgia"); size-adjust: 104%; ascent-override: 92%; }

/* v3 (DESIGN.md "Sistema v3"): neutri caldi (carta, farina), verde basilico per l'azione, zafferano solo per offerte e
   risparmio, rosso solo per allergie ed errori (sempre con icona e testo). Contrasti verificati WCAG 2.2 AA e APCA. */
:root {
  --fondo: #fbfaf6; --gruppo: #f2efe8; --superficie: #fff; --testo: #1d1b16; --sec: #6b6559; --terz: #8c877d; --linea: #e6e1d6;
  --azione: #1f6b3f; --su-azione: #fff; --azione-tenue: #e5f0e6;
  --offerta: #6a4300; --offerta-tenue: #fce7a8;
  --attenzione: #99560a; --attenzione-tenue: #fdf1e3; --problema: #b3261e; --problema-tenue: #fcebe8;
  --velo: rgba(29, 27, 22, .42);
  --display: "Fraunces", "Fraunces ripiego", Georgia, serif;
  --gutter: 20px; --r-btn: 999px; --r-campo: 12px; --r-gruppo: 16px; --r-carta: 24px; --r-foglio: 28px; --r-mini: 8px;
  --e1: 0 1px 2px rgba(29, 27, 22, .06); --e2: 0 8px 24px rgba(29, 27, 22, .10); --e3: 0 18px 40px -10px rgba(29, 27, 22, .28);
  --dur-1: 120ms; --dur-2: 200ms; --dur-3: 320ms; --dur-4: 480ms;
  --ease: cubic-bezier(.2, 0, 0, 1); --ease-entra: cubic-bezier(.05, .7, .1, 1); --ease-esce: cubic-bezier(.3, 0, .8, .15);
  --molla: linear(0, .22 8%, .6 18%, .92 30%, 1.03 42%, 1.04 50%, 1.01 64%, 1);
  --barra: 56px; /* altezza della barra in basso, senza l'area sicura */
  color-scheme: light dark;
}
/* Scuro: dal sistema (se non si è scelto "Chiaro") o scelto in Impostazioni (data-tema sull'html). */
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="chiaro"]) {
    --fondo: #0e0e0c; --gruppo: #1c1b18; --superficie: #262520; --testo: #f3f1ea; --sec: #b3aea3; --terz: #6e6a62; --linea: #34322d;
    --azione: #5cc383; --su-azione: #0e0e0c; --azione-tenue: #14271b;
    --offerta: #f7c948; --offerta-tenue: #2a2414;
    --attenzione: #f0a43a; --attenzione-tenue: #2b1d08; --problema: #ff6b5e; --problema-tenue: #2c0f0d;
    --velo: rgba(0, 0, 0, .6);
    /* Al buio niente ombre: le superfici rialzate sono più chiare, con un filo. */
    --e1: 0 0 0 .5px var(--linea); --e2: 0 0 0 .5px var(--linea); --e3: 0 0 0 .5px var(--linea);
  }
}
:root[data-tema="scuro"] {
    --fondo: #0e0e0c; --gruppo: #1c1b18; --superficie: #262520; --testo: #f3f1ea; --sec: #b3aea3; --terz: #6e6a62; --linea: #34322d;
    --azione: #5cc383; --su-azione: #0e0e0c; --azione-tenue: #14271b;
    --offerta: #f7c948; --offerta-tenue: #2a2414;
    --attenzione: #f0a43a; --attenzione-tenue: #2b1d08; --problema: #ff6b5e; --problema-tenue: #2c0f0d;
    --velo: rgba(0, 0, 0, .6);
    /* Al buio niente ombre: le superfici rialzate sono più chiare, con un filo. */
    --e1: 0 0 0 .5px var(--linea); --e2: 0 0 0 .5px var(--linea); --e3: 0 0 0 .5px var(--linea);
  }
:root[data-tema="chiaro"] { color-scheme: light; }
:root[data-tema="scuro"] { color-scheme: dark; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font: -apple-system-body; -webkit-text-size-adjust: 100%; background: var(--fondo); overscroll-behavior: none; }
@supports not (font: -apple-system-body) { html { font-size: 17px; } }
body {
  margin: 0; min-height: 100dvh; background: var(--fondo); color: var(--testo);
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, sans-serif; font-size: 1rem; line-height: 1.3;
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
  padding-bottom: calc(var(--barra) + env(safe-area-inset-bottom) + 24px);
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--azione); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
/* Riduci movimento: via spostamenti e rimbalzi, restano le dissolvenze brevi (servono a capire cosa è cambiato). */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition-property: opacity, background-color, color !important; transition-duration: var(--dur-1) !important; } }

/* ---- Struttura ---- */
main { max-width: 600px; margin: 0 auto; padding: max(16px, env(safe-area-inset-top)) var(--gutter) 0; outline: none; }
.titolo { font-family: var(--display); font-size: 2rem; line-height: 1.12; font-weight: 600; font-variation-settings: "SOFT" 50, "opsz" 72; letter-spacing: -.015em; margin: 8px 0 4px; text-wrap: balance; }
.sottotitolo { color: var(--sec); font-size: .875rem; }
.sez { margin-top: 32px; }
.sez-t { font-family: var(--display); font-size: 1.3rem; line-height: 1.25; font-weight: 600; font-variation-settings: "SOFT" 50; letter-spacing: -.01em; margin-bottom: 8px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sez-t a, .sez-t button { font-size: .875rem; font-weight: 400; }
.etichetta { font-size: .8125rem; color: var(--sec); margin: 0 16px 6px; }
.nota { font-size: .8125rem; color: var(--sec); margin: 8px 16px 0; line-height: 1.35; }
.sec { color: var(--sec); }
.indietro { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; font-size: 1rem; background: none; border: 0; padding: 0; color: var(--azione); }
.indietro svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

#offline { position: sticky; top: 0; z-index: 6; background: var(--gruppo); color: var(--sec); font-size: .8125rem; text-align: center; padding: 6px var(--gutter); padding-top: max(6px, env(safe-area-inset-top)); }

/* ---- Barra in basso ---- */
nav#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: flex; justify-content: center;
  background: color-mix(in srgb, var(--fondo) 88%, transparent); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--linea); padding-bottom: env(safe-area-inset-bottom);
}
nav#tabs a { flex: 0 1 140px; height: var(--barra); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--sec); font-size: .6875rem; font-weight: 500; letter-spacing: 0; }
nav#tabs svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
nav#tabs a[aria-current="page"] { color: var(--azione); }
body.accesso nav#tabs, body.in-spesa nav#tabs { display: none; }

/* ---- Bottoni ---- */
.btn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 20px; border: 0; border-radius: var(--r-btn); font-weight: 600; font-size: 1rem; background: var(--gruppo); color: var(--testo); text-align: center; width: 100%; transition: opacity var(--dur-2) var(--ease), transform var(--dur-1) var(--ease); }
.btn:active { transform: scale(.98); }
.btn.primario { background: var(--azione); color: var(--su-azione); }
.btn.piccolo { min-height: 44px; width: auto; padding: 0 16px; font-size: .9375rem; }
.btn.testo { background: none; color: var(--azione); font-weight: 400; min-height: 44px; }
.btn.rischio { background: none; color: var(--problema); font-weight: 400; }
.btn:disabled { opacity: .4; }
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.bottoni { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.bottoni.riga { flex-direction: row; }

/* ---- Righe ed elenchi ---- */
.elenco { border-top: .5px solid var(--linea); }
.riga { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 12px 0; border-bottom: .5px solid var(--linea); width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; text-align: left; color: inherit; font-size: 1rem; }
button.riga, a.riga { cursor: pointer; }
.riga .c { flex: 1; min-width: 0; }
.riga .t { overflow-wrap: anywhere; }
.riga .s { display: block; color: var(--sec); font-size: .875rem; margin-top: 2px; }
.riga .v { flex: none; text-align: right; white-space: nowrap; }
.riga .v small { display: block; color: var(--sec); font-size: .8125rem; }
.riga .freccia { flex: none; width: 8px; height: 13px; stroke: var(--terz); stroke-width: 2; fill: none; }
.riga.attenzione .s { color: var(--attenzione); }
.riga.problema .s { color: var(--problema); }
.punto { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--terz); }
.punto.attenzione { background: var(--attenzione); }
.punto.problema { background: var(--problema); }
.punto.ok { background: var(--azione); }

/* Gruppi in stile impostazioni iOS */
.gruppo { background: var(--gruppo); border-radius: var(--r-gruppo); padding: 0 16px; }
.gruppo > .riga:last-child, .gruppo > :last-child .riga:last-child { border-bottom: 0; }
.gruppo + .etichetta, .nota + .etichetta { margin-top: 24px; }
.gruppo .campo { background: var(--fondo); }

/* ---- Campi ---- */
.campo, input[type=text], input[type=number], input[type=password], input[type=email], input[type=time], select, textarea {
  width: 100%; min-height: 48px; border: 0; border-radius: var(--r-campo); padding: 12px 14px; background: var(--gruppo); font-size: max(1rem, 16px); outline: none;
}
textarea { min-height: 120px; resize: none; line-height: 1.4; display: block; }
input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 2px var(--azione); }
::placeholder { color: var(--terz); }
label.campo-l { display: block; margin-top: 16px; }
label.campo-l > span { display: block; font-size: .8125rem; color: var(--sec); margin: 0 0 6px 4px; }
.errore { color: var(--problema); font-size: .875rem; margin-top: 12px; }

/* Interruttore */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 52px; padding: 10px 0; }
.switch input { appearance: none; -webkit-appearance: none; width: 51px; height: 31px; border-radius: 16px; background: var(--linea); position: relative; flex: none; margin: 0; transition: background .2s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: left .2s; }
.switch input:checked { background: var(--azione); }
.switch input:checked::after { left: 22px; }
.switch input:disabled { opacity: .4; }

/* Scelte a pillola (una o più) */
.scelte { display: flex; flex-wrap: wrap; gap: 8px; }
.scelte button { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 0; background: var(--gruppo); font-size: .9375rem; }
.scelte button[aria-pressed="true"] { background: var(--azione); color: var(--su-azione); }
.scelte button { transition: background-color var(--dur-2) var(--ease), color var(--dur-2) var(--ease); }
.scelte.piene button { flex: 1; padding: 0 8px; white-space: nowrap; }

/* Contatore − n + */
.contatore { display: flex; align-items: center; gap: 4px; flex: none; }
.contatore button { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--gruppo); font-size: 1.25rem; line-height: 1; display: grid; place-items: center; }
.gruppo .contatore button { background: var(--fondo); }
.contatore span { min-width: 40px; text-align: center; font-weight: 600; }
.contatore.piccolo { gap: 2px; }
.contatore.piccolo button { width: 36px; height: 36px; font-size: 1.125rem; }
.contatore.piccolo span { min-width: 52px; font-weight: 400; font-size: .9375rem; white-space: nowrap; }

/* ---- Spesa (schermata principale) ---- */
.prossima { padding: 24px 0 8px; }
.prossima .stato { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--sec); }
.prossima .quando { font-family: var(--display); font-size: 1.5rem; line-height: 1.2; font-weight: 600; font-variation-settings: "SOFT" 50; letter-spacing: -.01em; margin-top: 4px; }
.cifra { font-size: 3.25rem; line-height: 1; font-weight: 600; letter-spacing: -.035em; margin: 16px 0 8px; }
.cifra small { font-size: .5em; letter-spacing: -.02em; color: var(--sec); font-weight: 500; }
.contesto { color: var(--sec); font-size: .9375rem; line-height: 1.45; }
.domanda { background: var(--gruppo); border-radius: var(--r-gruppo); padding: 16px; }
.domanda > p:first-child { font-weight: 600; margin-bottom: 12px; text-wrap: balance; }
.domanda .scelte { display: grid; grid-template-columns: 1fr 1fr; }
.domanda .scelte button { background: var(--fondo); padding: 0 8px; white-space: nowrap; }
.domanda .nota { margin: 10px 0 0; }

/* Barra fissa con il gesto principale, sopra la barra in basso */
.azione-fissa { position: sticky; bottom: calc(var(--barra) + env(safe-area-inset-bottom)); padding: 16px 0 12px; background: linear-gradient(transparent, var(--fondo) 24px); margin-top: 24px; }
.azione-fissa .nota { text-align: center; margin: 8px 0 0; }

/* ---- Aggiungi: scrivi, detta, fotografa ---- */
.modi { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.modi button, .modi label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 72px; border-radius: var(--r-btn); background: var(--gruppo); border: 0; font-size: .875rem; color: var(--testo); cursor: pointer; }
.modi [aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--azione); color: var(--azione); }
.modi svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.dettato { position: relative; margin-top: 12px; }
.dettato textarea { padding-right: 60px; }
.dettato .mic { position: absolute; right: 8px; bottom: 8px; width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--fondo); display: grid; place-items: center; color: var(--azione); }
.dettato .mic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.dettato .mic.on { background: var(--problema); color: #fff; animation: ascolto 1.2s ease-in-out infinite; }
@keyframes ascolto { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--problema) 25%, transparent); } }
.letti .riga { padding: 8px 0; }
.letti .riga input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--azione); flex: none; margin: 0; }
.letti .q { width: 76px; min-height: 40px; padding: 8px 10px; text-align: right; flex: none; }
.letti .u { width: 28px; color: var(--sec); font-size: .875rem; flex: none; }
.caricamento { display: flex; align-items: center; gap: 10px; color: var(--sec); font-size: .9375rem; padding: 16px 0; }
.caricamento::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--linea); border-top-color: var(--azione); animation: gira .8s linear infinite; flex: none; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---- Foglio dal basso ---- */
dialog#sheet { border: 0; padding: 8px var(--gutter) max(20px, env(safe-area-inset-bottom)); width: 100%; max-width: 600px; margin: auto auto 0; max-height: 92dvh; overflow-y: auto; border-radius: var(--r-foglio) var(--r-foglio) 0 0; background: var(--fondo); color: var(--testo); }
dialog#sheet::before { content: ""; display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--linea); margin: 0 auto 16px; }
dialog#sheet::backdrop { background: var(--velo); }
dialog#sheet h2 { font-family: var(--display); font-size: 1.3rem; line-height: 1.25; font-weight: 600; font-variation-settings: "SOFT" 50; letter-spacing: -.01em; margin-bottom: 4px; }
dialog#sheet .sottotitolo { margin-bottom: 16px; }

/* Avvisi in alto, come le notifiche di iOS: non coprono mai il gesto principale in basso. */
#toast { position: fixed; left: 50%; top: max(10px, env(safe-area-inset-top)); z-index: 30; width: max-content; max-width: calc(100% - 2 * var(--gutter)); background: color-mix(in srgb, var(--testo) 92%, transparent); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: var(--fondo); border-radius: 22px; min-height: 44px; padding: 10px 18px; font-size: .875rem; line-height: 1.3; display: flex; align-items: center; gap: 14px; opacity: 0; transform: translate(-50%, -12px) scale(.96); transition: opacity var(--dur-2) var(--ease), transform var(--dur-3) var(--molla); pointer-events: none; box-shadow: var(--e2); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast button { background: none; border: 0; color: #7fd8a2; font-weight: 600; pointer-events: auto; margin-left: auto; padding: 4px 0; }
@media (prefers-color-scheme: dark) { :root:not([data-tema="chiaro"]) #toast { background: color-mix(in srgb, #3a3a3c 92%, transparent); color: var(--testo); } }
:root[data-tema="scuro"] #toast { background: color-mix(in srgb, #3a3a3c 92%, transparent); color: var(--testo); }

.codice { font: 600 1.5rem/1.2 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .12em; text-align: center; padding: 14px 0; user-select: all; }
code { font: .8125rem ui-monospace, "SF Mono", Menlo, monospace; overflow-wrap: anywhere; }
ol.passi { margin: 0; padding-left: 20px; font-size: .9375rem; } ol.passi li { margin-bottom: 8px; }
.marchio { display: flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -.02em; }
.marchio svg { width: 32px; height: 32px; flex: none; }

/* ---- Primo avvio ---- */
#benvenuto, #giro { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: var(--fondo); }
.b-testa { padding: max(8px, env(safe-area-inset-top)) var(--gutter) 0; max-width: 600px; width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 16px; min-height: 52px; }
.b-avanzamento { flex: 1; height: 4px; border-radius: 2px; background: var(--gruppo); overflow: hidden; }
.b-avanzamento div { height: 100%; background: var(--azione); border-radius: 2px; transition: width .3s ease-out; }
.b-testa .indietro { width: 44px; }
.b-testa .salta { background: none; border: 0; color: var(--sec); font-size: .9375rem; min-height: 44px; min-width: 44px; padding: 0; }
.b-corpo { flex: 1; overflow-y: auto; padding: 24px var(--gutter); max-width: 600px; width: 100%; margin: 0 auto; }
.b-corpo .titolo { margin-top: 0; }
.perche { color: var(--sec); font-size: .9375rem; margin: 8px 0 24px; line-height: 1.45; }
.b-piede { padding: 12px var(--gutter) max(16px, env(safe-area-inset-bottom)); max-width: 600px; width: 100%; margin: 0 auto; }

/* ---- Vista in diretta ---- */
#diretta { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; background: var(--fondo); }
@media (min-width: 560px) and (max-width: 799px) { #diretta { max-width: 460px; margin-inline: auto; box-shadow: 0 0 0 100vmax var(--velo); } }
/* Computer: Pesto naviga dentro un iPhone al centro (390 × 844, come lo vedresti sul telefono). Testata e messaggi
   stanno fuori dalla cornice, sopra e sotto: il sito si vede intero e niente gli passa sopra. */
@media (min-width: 800px) and (min-height: 640px) {
  #diretta { background: var(--gruppo); align-items: center; }
  #diretta .d-head, #diretta .d-progress, #diretta .d-ask, #diretta .d-bar, #diretta .d-scrivi, #diretta .d-actions { width: min(560px, 100%); border: 0; }
  #diretta .d-progress { border-radius: 2px; margin-bottom: 12px; }
  /* Lo schermo resta fra 320 e 500 px di larghezza (limiti della vista remota): l'altezza riempie lo spazio. */
  #diretta .d-main { flex: none; height: max(380px, calc(100dvh - 200px)); width: clamp(342px, calc((100dvh - 200px) * 390 / 844 + 22px), 412px); border: 11px solid #1d1b16; border-radius: 52px;
    box-shadow: 0 0 0 1.5px #4a4740, var(--e3); overflow: hidden; margin: 4px 0 12px; position: relative; }
  #diretta .d-main::after { content: ""; position: absolute; top: 9px; left: 50%; transform: translateX(-50%); width: 30%; height: 26px; border-radius: 13px; background: #1d1b16; z-index: 4; pointer-events: none; }
  #diretta .d-main { padding-top: 40px; background: #fff; } /* fascia di stato: la pillola non copre il sito */
  #diretta .d-screen { border-radius: 0 0 41px 41px; }
  #diretta .d-ask { border-radius: var(--r-gruppo); margin-bottom: 4px; }
  #diretta .d-bar { padding-bottom: 20px; }
  #diretta .d-actions { position: static; background: none; }
}
body.in-spesa { overflow: hidden; }
.d-head { display: flex; align-items: center; gap: 12px; padding: max(8px, env(safe-area-inset-top)) var(--gutter) 8px; min-height: 52px; border-bottom: .5px solid var(--linea); }
.d-head b { font-weight: 600; display: block; line-height: 1.2; }
.d-tit { flex: 1; min-width: 0; }
.d-passo { display: block; color: var(--sec); font-size: .8125rem; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pesto-mini { width: 34px; flex: none; display: block; }
.pesto-mini svg { width: 100%; height: auto; display: block; overflow: visible; }
.pesto-mini[data-stato="lente"] .g-lente { display: block; }
.pesto-mini[data-stato="pensa"] .g-pupilla { transform: translate(2px, -3px); }
.d-progress { height: 3px; background: var(--gruppo); overflow: hidden; }
.d-progress div { height: 100%; width: 0; background: var(--azione); transition: width var(--dur-4) var(--ease); }
.d-annulla { border: 0; background: none; color: var(--azione); font-size: 1rem; min-height: 44px; padding: 0; }
.d-main { flex: 1; position: relative; overflow: hidden; background: #fff; }
.d-screen { display: block; width: 100%; height: 100%; object-fit: contain; object-position: top; touch-action: none; }
.d-tocco { position: absolute; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: color-mix(in srgb, var(--azione) 25%, transparent); border: 2px solid var(--azione); pointer-events: none; animation: tocco .45s ease-out forwards; }
@keyframes tocco { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.d-ask { display: none; gap: 12px; align-items: flex-start; padding: 12px var(--gutter); background: var(--attenzione-tenue); font-size: .9375rem; line-height: 1.4; }
.d-ask b { display: block; color: var(--attenzione); font-weight: 600; margin-bottom: 2px; }
.d-ask-t { flex: 1; }
#diretta.user .d-ask { display: flex; }
.d-bar { display: flex; align-items: center; gap: 12px; padding: 12px var(--gutter) max(12px, env(safe-area-inset-bottom)); min-height: 64px; border-top: .5px solid var(--linea); font-size: .9375rem; }
.d-nuvola { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: var(--gruppo); border-radius: 16px 16px 16px 6px; padding: 10px 14px; }
.d-text { flex: 1; color: var(--testo); line-height: 1.35; }
.d-foto { flex: none; }
.d-foto .miniatura { width: 48px; height: 48px; box-shadow: var(--e1); }
.d-bar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--azione); animation: pulsa 1.2s ease-in-out infinite; flex: none; }
@keyframes pulsa { 50% { opacity: .25; } }
#diretta.user .d-nuvola, #diretta.user .d-foto { display: none; }
.d-done { display: none; min-height: 52px; border: 0; border-radius: var(--r-btn); font-weight: 600; font-size: 1rem; padding: 0 16px; }
#diretta.user .d-done { display: block; flex: 1; background: var(--azione); color: var(--su-azione); }
.d-scrivi { display: none; padding: 8px var(--gutter) 0; border-top: .5px solid var(--linea); }
#diretta.user.kbd .d-scrivi { display: block; }
.d-scrivi span { display: block; font-size: .8125rem; color: var(--sec); margin: 0 0 6px 4px; }
#diretta.user.kbd .d-bar { border-top: 0; }
#diretta.review .d-bar, #diretta.done .d-bar, #diretta.errore .d-bar, #diretta.pronta .d-bar { display: none; }
.d-sheet { display: none; position: absolute; inset: 0; background: var(--fondo); overflow-y: auto; padding: 8px var(--gutter) 140px; }
#diretta.review .d-sheet, #diretta.done .d-sheet, #diretta.errore .d-sheet, #diretta.pronta .d-sheet { display: block; }
#diretta.peek .d-sheet { display: none; }
.d-actions { display: none; position: absolute; left: 0; right: 0; bottom: 0; gap: 8px; padding: 16px var(--gutter) max(16px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--fondo) 20px); }
#diretta.review .d-actions { display: flex; }
.d-actions .btn { flex: 1; }
#diretta.peek .d-actions { background: none; }
.d-fine { margin-top: 24px; }
.d-fine p { margin-bottom: 16px; color: var(--sec); }
.d-fine.errore p { color: var(--problema); }
.d-conferma { position: absolute; inset: 0; z-index: 3; background: var(--velo); display: flex; align-items: flex-end; }
.d-conferma-card { background: var(--fondo); width: 100%; border-radius: 16px 16px 0 0; padding: 20px var(--gutter) max(20px, env(safe-area-inset-bottom)); }
.d-conferma-card h2 { font-size: 1.25rem; font-weight: 600; }
.d-conferma .cifra { margin: 12px 0 4px; }
.conferma-oltre { display: flex; gap: 12px; align-items: center; color: var(--problema); font-size: .9375rem; margin-top: 16px; }
.conferma-oltre input { width: 22px; height: 22px; accent-color: var(--problema); flex: none; }
/* Righe del carrello nella conferma */
.prod { padding: 12px 0; border-bottom: .5px solid var(--linea); }
.prod.tolto .su, .prod.tolto details { opacity: .45; }
.prod .su { display: flex; gap: 12px; align-items: baseline; }
.prod .n { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.prod .n small { display: block; color: var(--sec); font-size: .875rem; margin-top: 2px; }
.prod .p { font-weight: 600; white-space: nowrap; }
.prod .giu { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.prod details { flex: 1; font-size: .875rem; color: var(--azione); }
.prod details[open] { color: var(--sec); }
.prod summary { list-style: none; min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.prod summary::-webkit-details-marker { display: none; }
.prod ul { margin: 0 0 8px; padding-left: 18px; }
.prod .scelte { margin-top: 8px; }
.prod .scelte button { min-height: 36px; font-size: .875rem; padding: 0 12px; }
.segno { font-style: normal; font-size: .75rem; font-weight: 600; color: var(--azione); margin-left: 4px; }
.segno.attenzione { color: var(--attenzione); }
.eccezione { display: flex; gap: 12px; padding: 12px 0; border-bottom: .5px solid var(--linea); }
.eccezione .punto { margin-top: 7px; }
.eccezione b { font-weight: 600; display: block; }
.eccezione small { display: block; color: var(--sec); font-size: .875rem; margin-top: 2px; }
.totale-riga { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0; font-size: 1.25rem; font-weight: 600; }

/* Voci della proposta: il perché si apre sotto la riga */
details.voce > summary { list-style: none; cursor: pointer; }
details.voce > summary::-webkit-details-marker { display: none; }
details.voce > ul { margin: 0; padding: 4px 0 12px 18px; color: var(--sec); font-size: .875rem; border-bottom: .5px solid var(--linea); }
details.voce > ul li + li { margin-top: 4px; }
details.voce[open] > summary { border-bottom: 0; }
details.come { margin-top: 12px; font-size: .875rem; color: var(--sec); }
details.come summary { color: var(--azione); cursor: pointer; min-height: 32px; display: inline-flex; align-items: center; }
details.come ul { margin: 4px 0 0; padding-left: 18px; }
.sez-t .btn.testo { width: auto; min-height: 0; padding: 0; font-size: .9375rem; }
.riga.problema .t { color: var(--problema); }
#diretta.peek .d-approve { display: none; }
body.in-spesa #toast { display: none; } /* nella vista in diretta parla la barra di stato */
.scelte button:disabled { opacity: .45; }

/* Immagini dei prodotti dal sito del supermercato e risparmio con le offerte */
.miniatura { width: 44px; height: 44px; flex: none; border-radius: var(--r-mini); object-fit: contain; background: #fff; border: .5px solid var(--linea); }
.miniatura.vuota { display: grid; place-items: center; background: var(--gruppo); border: 0; color: var(--sec); font-size: 1.0625rem; font-weight: 600; }
.prod .su { align-items: flex-start; }
.prod .n a { color: inherit; }
.prod .p s { display: block; color: var(--sec); font-weight: 400; font-size: .8125rem; text-align: right; }
/* Offerte e risparmio: zafferano, mai il verde dell'azione (non devono sembrare bottoni). */
.prod small.risparmio { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: var(--r-mini); background: var(--offerta-tenue); color: var(--offerta); font-weight: 600; font-size: .8125rem; }
.risparmio-tot { display: inline-block; padding: 4px 10px; border-radius: var(--r-mini); background: var(--offerta-tenue); color: var(--offerta); font-weight: 600; font-size: .9375rem; margin-bottom: 8px; }
.contatore.piccolo button { position: relative; }
.contatore.piccolo button::after { content: ""; position: absolute; inset: -4px; } /* area di tocco di 44 px */

/* Elenco a spunta: scelta multipla fra voci lunghe (punti di ritiro) */
.spunte .riga svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--azione); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .15s; }
.spunte .riga[aria-pressed="true"] svg { opacity: 1; }
.spunte .riga .s { color: var(--azione); }
.riga.stretta { min-height: 40px; padding: 9px 0; }
.spunta-on svg { width: 22px; height: 22px; display: block; fill: none; stroke: var(--azione); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; }
.scelte.griglia { display: grid; grid-template-columns: 1fr 1fr; }
.scelte.griglia button { padding: 0 8px; }
.mini-t { font-size: 1rem; font-weight: 600; letter-spacing: -.01em; margin: 28px 0 10px; }
.eccezione small.tipo { margin: 0 0 2px; font-size: .8125rem; font-weight: 600; }
.eccezione small.tipo.problema { color: var(--problema); }
.eccezione small.tipo.attenzione { color: var(--attenzione); }
.eccezione .punto { margin-top: 6px; }

/* ---- Pesto (ADR-018 §2): mascotte e nuvolette ---- */
.pesto { position: fixed; z-index: 30; pointer-events: none; --g-colore: var(--azione); display: flex; align-items: flex-start; justify-content: flex-end; gap: 8px;
  left: 50%; top: 0; width: min(100vw, 600px); padding: 0 var(--gutter); --g-y: calc(max(8px, env(safe-area-inset-top)) + 52px);
  transform: translate(-50%, var(--g-y)); transition: transform var(--dur-4) var(--molla); }
.pesto[data-pos="basso"] { justify-content: flex-start; --g-y: calc(100dvh - 210px - env(safe-area-inset-bottom)); }
.pesto[data-pos="centro"] { flex-direction: column; align-items: center; justify-content: flex-start; --g-y: calc(max(8px, env(safe-area-inset-top)) + 60px); }
.g-figura { width: 64px; flex: none; order: 2; }
.pesto[data-pos="centro"] .g-figura { order: 0; }
.pesto[data-pos="centro"] .g-figura { width: 96px; }
.pesto[data-pos="basso"] .g-figura { order: 0; }
.g-figura svg { width: 100%; height: auto; overflow: visible; display: block; }
.g-sacco { fill: #2f7d4c; }
.g-bordo { fill: #245f3a; }
.g-gambo { fill: none; stroke: #245f3a; stroke-width: 3; stroke-linecap: round; }
.g-foglia { fill: #6fbf7f; }
.g-braccio path { fill: none; stroke: #2f7d4c; stroke-width: 6; stroke-linecap: round; }
.g-bianco { fill: #fff; } .g-pupilla { fill: #1c1c1e; }
.g-felici path, .g-bocca { fill: none; stroke: #1c1c1e; stroke-width: 3; stroke-linecap: round; }
.g-bocca-aperta { fill: #1c1c1e; display: none; }
.g-guance { display: none; }
.g-felici, .g-schiena, .g-lente { display: none; }
.g-schiena path { stroke: #245f3a; stroke-width: 2.5; stroke-linecap: round; }
.g-schiena text { font: 700 13px -apple-system, system-ui, sans-serif; fill: #fff; opacity: .9; letter-spacing: .04em; }
.g-lente circle { fill: rgba(255, 255, 255, .5); stroke: #1c1c1e; stroke-width: 3; } .g-lente path { stroke: #1c1c1e; stroke-width: 4; stroke-linecap: round; }
.g-ombra ellipse { fill: var(--testo); opacity: .08; }
.g-corpo { transform-origin: 48px 104px; }
.g-occhi { transform-origin: 48px 61px; transition: transform 90ms var(--ease); }
.pesto.batte .g-occhi { transform: scaleY(.1); } /* battito di ciglia ogni 4–8 s, a caso (pesto.js) */
.pesto[data-stato="felice"] .g-occhi { display: none; } .pesto[data-stato="felice"] .g-felici { display: block; }
.pesto[data-stato="felice"] .g-corpo { animation: g-salta var(--dur-4) var(--ease) 1; }
@keyframes g-salta { 45% { transform: translateY(-6px); } }
.pesto[data-stato="felice"] .g-dx { transform-origin: 79px 58px; animation: g-saluta var(--dur-4) var(--ease) 1; }
@keyframes g-saluta { 50% { transform: rotate(-55deg); } }
.pesto[data-stato="pensa"] .g-pupilla { transform: translate(2px, -3px); }
.pesto[data-stato="pensa"] .g-corpo { transform: rotate(-3deg); transition: transform var(--dur-3) var(--ease); }
.pesto[data-stato="triste"] .g-bocca { transform: rotate(180deg); transform-origin: 48px 78px; }
.pesto[data-stato="lente"] .g-lente { display: block; } .pesto[data-stato="lente"] .g-pupilla { transform: translate(3px, 0); }
/* Di spalle: niente faccia, si vede il retro del sacchetto. Gira come una trottola lenta. */
.pesto[data-stato="spalle"] .g-faccia { display: none; } .pesto[data-stato="spalle"] .g-schiena { display: block; }
.pesto[data-stato="spalle"] .g-corpo { animation: g-gira var(--dur-3) var(--ease); }
@keyframes g-gira { 50% { transform: scaleX(.05); } }
.g-nuvola { position: relative; max-width: min(280px, calc(100% - 72px)); background: var(--superficie); color: var(--testo); border-radius: 18px 18px 6px 18px; padding: 10px 14px;
  font-size: .9375rem; line-height: 1.35; box-shadow: var(--e2); margin-top: 6px; pointer-events: auto; }
.pesto[data-pos="basso"] .g-nuvola { border-radius: 18px 18px 18px 6px; }
.pesto[data-pos="centro"] .g-nuvola { width: 100%; max-width: 340px; text-align: center; margin-top: 4px; border-radius: 18px; }
.g-nuvola.entra { animation: g-nuvola var(--dur-3) var(--molla); }
@keyframes g-nuvola { from { opacity: 0; transform: scale(.94) translateY(4px); } }

/* ---- Match con i piatti (ADR-018 L2) ---- */
.match { display: flex; flex-direction: column; gap: 16px; }
.m-conosco { display: flex; align-items: center; gap: 12px; font-size: .8125rem; color: var(--sec); }
.m-perc { flex: none; min-width: 128px; font-variant-numeric: tabular-nums; }
.m-barra { flex: 1; height: 6px; border-radius: 3px; background: var(--gruppo); overflow: hidden; }
.m-barra div { height: 100%; background: var(--azione); border-radius: 3px; transition: width .5s ease-out; }
.m-mazzo { position: relative; height: min(58dvh, 480px); }
.m-dietro { position: absolute; inset: 10px 12px -8px; border-radius: var(--r-carta); background: var(--gruppo); }
.m-carta-box { position: absolute; inset: 0; }
.m-carta { position: absolute; inset: 0; border-radius: var(--r-carta); overflow: hidden; background: var(--gruppo); touch-action: none; user-select: none; -webkit-user-select: none;
  box-shadow: var(--e3); transition: transform var(--dur-3) var(--molla); outline: none; animation: m-entra var(--dur-3) var(--ease-entra); }
@keyframes m-entra { from { transform: scale(.96) translateY(8px); opacity: .5; } }
.m-carta.presa { transition: none; cursor: grabbing; }
.m-carta.via { transition: transform var(--dur-3) var(--ease-esce); }
.m-carta img, .m-foto-vuota { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.m-foto-vuota { display: flex; align-items: center; justify-content: center; font-size: 4rem; font-weight: 600; color: var(--azione); background: var(--azione-tenue); letter-spacing: .02em; }
.m-info { position: absolute; left: 0; right: 0; bottom: 0; padding: 96px 20px 18px; color: #fff;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, .15) 30%, rgba(0, 0, 0, .45) 60%, rgba(0, 0, 0, .72)); }
.m-info h2 { font-family: var(--display); font-size: 1.6rem; line-height: 1.15; font-weight: 600; font-variation-settings: "SOFT" 50, "opsz" 48; letter-spacing: -.01em; text-wrap: balance; }
.m-info p { margin-top: 6px; font-size: .9375rem; opacity: .9; }
.m-momento { display: inline-block; margin-bottom: 8px; padding: 3px 10px; border-radius: var(--r-btn); background: rgba(255, 255, 255, .92); color: #1d1b16; font-size: .75rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.m-credito { display: inline-block; margin-top: 8px; font-size: .6875rem; color: rgba(255, 255, 255, .7); }
.m-origine { position: absolute; top: 14px; left: 14px; right: 14px; width: fit-content; background: rgba(0, 0, 0, .55); color: #fff; font-size: .8125rem; padding: 6px 10px; border-radius: 10px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.m-segno { position: absolute; inset: 0; opacity: 0; pointer-events: none; display: flex; padding: 22px; transition: opacity var(--dur-1) linear; }
.m-segno[data-v="si"] { background: linear-gradient(to left, color-mix(in srgb, var(--azione) 55%, transparent), transparent 65%); justify-content: flex-end; align-items: center; }
.m-segno[data-v="no"] { background: linear-gradient(to right, color-mix(in srgb, var(--problema) 50%, transparent), transparent 65%); justify-content: flex-start; align-items: center; }
.m-segno[data-v="adoro"] { background: linear-gradient(to bottom, rgba(232, 168, 32, .55), transparent 60%); justify-content: center; align-items: flex-start; }
.m-segno[data-v="mai"] { background: linear-gradient(to top, rgba(29, 27, 22, .7), transparent 60%); justify-content: center; align-items: flex-end; }
.m-badge { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: var(--e2); }
.m-badge svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.m-segno[data-v="si"] .m-badge { color: #1f6b3f; } .m-segno[data-v="si"] .m-badge svg, .m-segno[data-v="adoro"] .m-badge svg { fill: currentColor; stroke-width: 0; }
.m-segno[data-v="no"] .m-badge { color: #b3261e; } .m-segno[data-v="adoro"] .m-badge { color: #b7791f; } .m-segno[data-v="mai"] .m-badge { color: #1d1b16; }
.m-azioni { display: flex; justify-content: center; align-items: center; gap: 18px; }
.m-tasto { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--superficie); box-shadow: var(--e2); display: grid; place-items: center; color: var(--problema); transition: transform var(--dur-1) var(--ease); }
.m-tasto:active { transform: scale(.9); }
.m-tasto svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.m-tasto.si { color: var(--azione); } .m-tasto.si svg { fill: currentColor; stroke-width: 0; }
.m-tasto.adoro { width: 52px; height: 52px; color: #b7791f; } .m-tasto.adoro svg { fill: currentColor; stroke-width: 0; width: 24px; height: 24px; }
.m-tasto.piccolo { width: 44px; height: 44px; color: var(--sec); } .m-tasto.piccolo svg { width: 20px; height: 20px; }
.m-sotto { display: flex; justify-content: center; gap: 8px; min-height: 44px; margin-top: -6px; }
.m-sotto .btn { width: auto; padding: 0 12px; }
.m-annulla { color: var(--sec) !important; }
.m-aiuto { position: absolute; inset: 0; z-index: 2; border-radius: var(--r-carta); background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; text-align: center; padding: 24px; pointer-events: none; }
.m-aiuto .mano { width: 56px; height: 56px; margin: 0 auto 12px; animation: m-mano 1.6s ease-in-out infinite; }
@keyframes m-mano { 0%, 100% { transform: translateX(-40px) rotate(-10deg); } 50% { transform: translateX(40px) rotate(10deg); } }

/* ---- Primo avvio a livelli con Pesto ---- */
#benvenuto, #giro { --g-spazio: 0px; }
.b-titoletto { flex: 1; font-weight: 600; }
.b-corpo { padding-top: calc(16px + var(--g-spazio)); }
.b-ciao p, .b-testo { font-size: 1.0625rem; line-height: 1.45; margin-bottom: 20px; }
.b-livelli { margin: 0; padding: 0; list-style: none; counter-reset: l; display: grid; gap: 2px; background: var(--gruppo); border-radius: var(--r-gruppo); overflow: hidden; }
.b-livelli li { counter-increment: l; display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--gruppo); font-size: .9375rem; }
.b-livelli li::before { content: counter(l); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--azione-tenue); color: var(--azione); font-weight: 600; font-size: .8125rem; flex: none; }
.b-livelli li + li { border-top: .5px solid var(--linea); }
.b-centro .titolo { text-align: center; }
.b-match { display: flex; flex-direction: column; overflow: hidden; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
.b-match .titolo { font-size: 1.5rem; margin-bottom: 12px; }
.b-match .match { flex: 1; min-height: 0; }
.b-match .m-mazzo { flex: 1; height: auto; min-height: 280px; }
.b-promesse { margin-top: 20px; }
.b-promesse .riga .t { font-size: .9375rem; }
.b-premio .gruppo .s { white-space: normal; }
.b-chiavi { margin-top: 16px; }
.b-auto { display: flex; align-items: center; gap: 12px; margin: 16px 4px 0; font-size: .9375rem; }
.b-auto input { width: 22px; height: 22px; accent-color: var(--azione); flex: none; }

.forma { margin-top: 12px; }
.forma p { font-size: .9375rem; color: var(--sec); margin: 0 0 8px 4px; }
.b-cifra { text-align: center; margin: 4px 0 16px; }
.b-cifra .cifra { margin: 0 0 6px; }

/* ---- Lista della spesa: modifiche e spunte in negozio ---- */
.modo-spesa { margin-top: 16px; }
.voce-piano { flex-wrap: wrap; }
.perche-apri { flex: 1; min-width: 0; background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.perche-apri .t { display: block; }
.voce-piano .perche { flex-basis: 100%; margin: 4px 0 0 56px; padding-left: 16px; color: var(--sec); font-size: .875rem; }
.spunta-riga { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 0; background: none; margin-left: -10px; }
.spunta-riga svg { width: 26px; height: 26px; border-radius: 50%; padding: 4px; box-shadow: inset 0 0 0 2px var(--terz); fill: none; stroke: transparent; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: background-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease); }
.spunta-riga[aria-checked="true"] svg { background: var(--azione); box-shadow: none; stroke: var(--su-azione); }
.riga.presa .t { color: var(--sec); text-decoration: line-through; text-decoration-color: var(--terz); }
.riga.presa .miniatura { opacity: .5; }
.azione-fissa .btn.testo { margin-top: 4px; }
.nota.attenzione { color: var(--attenzione); }

/* Duello di marca nel match: due prodotti grandi e leggibili, il gesto è toccarne uno. */
.m-duello { position: absolute; inset: 0; border-radius: var(--r-carta); background: var(--superficie); box-shadow: var(--e3); padding: 18px 14px 14px; display: flex; flex-direction: column; gap: 14px; animation: m-entra var(--dur-3) var(--ease-entra); }
.m-duello .m-momento { align-self: flex-start; margin: 0; background: var(--offerta-tenue); color: var(--offerta); }
.m-duello h2 { font-family: var(--display); font-size: 1.35rem; line-height: 1.2; font-weight: 600; font-variation-settings: "SOFT" 50; text-wrap: balance; padding: 0 2px; }
.m-due { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; min-height: 0; }
.m-prodotto { display: flex; flex-direction: column; align-items: stretch; gap: 2px; border: 0; border-radius: var(--r-gruppo); background: var(--gruppo); padding: 8px 8px 12px; text-align: left; min-height: 0;
  transition: transform var(--dur-1) var(--ease), box-shadow var(--dur-2) var(--ease); }
.m-prodotto:active { transform: scale(.97); box-shadow: inset 0 0 0 2px var(--azione); }
.m-img { flex: 1; min-height: 0; display: grid; place-items: center; background: #fff; border-radius: 12px; padding: 10px; margin-bottom: 8px; }
.m-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.m-prodotto b { font-size: 1rem; line-height: 1.25; padding: 0 4px; }
.m-dati { font-size: .875rem; color: var(--sec); padding: 0 4px; font-variant-numeric: tabular-nums; }
.m-kg { align-self: flex-start; margin: 6px 4px 0; font-size: .8125rem; font-weight: 600; padding: 2px 8px; border-radius: var(--r-btn); background: var(--fondo); font-variant-numeric: tabular-nums; }
.m-uguale { min-height: 44px; }

/* ---- Oggi ---- */
.testata { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin-top: 4px; font-size: .9375rem; }
.testata .sec::first-letter { text-transform: uppercase; }
.icona-tasto { width: 44px; height: 44px; display: grid; place-items: center; margin-right: -10px; color: var(--testo); border-radius: 50%; }
.icona-tasto svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pesto-card { margin-top: 16px; background: var(--superficie); border-radius: var(--r-gruppo); padding: 16px 16px 16px; box-shadow: var(--e1), 0 0 0 .5px var(--linea); }
.pesto-card-su { display: flex; align-items: center; gap: 12px; }
.pesto-card .pesto-mini { width: 40px; }
.pesto-frase { font-weight: 600; font-size: 1.0625rem; line-height: 1.3; }
.pesto-frase::first-letter { text-transform: uppercase; }
.pesto-card .cifra { margin: 14px 0 6px; }
.pesto-card .bottoni { margin-top: 16px; }

/* Tag delle carte: minuti con l'orologio e caratteristiche come chip (si vede che contano) */
.m-tag { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px !important; opacity: 1 !important; }
.m-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: var(--r-btn); background: rgba(255, 255, 255, .2); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); font-size: .8125rem; font-weight: 600; color: #fff; }
.m-chip svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.riga .s svg.orologio, .s .orologio svg { width: 13px; height: 13px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Suggerimenti della spesa: due azioni brevi accanto alla riga */
.riga.suggerito { align-items: center; }
.sug-azioni { display: flex; gap: 4px; flex-shrink: 0; }
.sug-azioni .btn.piccolo { padding: 0 12px; }

/* Fase di partenza: avanzamento degli scontrini (3 pallini) */
.pallini { display: flex; gap: 6px; margin: 8px 0 0; }
.pallini i { width: 10px; height: 10px; border-radius: 50%; background: var(--linea); }
.pallini i.on { background: var(--azione); }
