/* BiP per telefono.
   Linguaggio visivo: struttura e tipografia in stile Apple (DESIGN.md), palette scelta dall'utente:
   crema e caramello. In chiaro tutto è crema (niente crema chiaro), in scuro il crema diventa testo e pulsanti
   su fondo cacao. Il colore vivo resta solo agli stati che servono (ritardo, attesa, fatto).
   Un solo raggio per famiglia: comandi a pillola, schede 14px, campi 22px. */

:root {
  --sfondo: #f3e7d2;             /* crema */
  --superficie: #eedec2;         /* crema appena più pieno: schede ed elenchi */
  --superficie-2: #e5d2b2;
  --inchiostro: #2a1f17;
  --tenue: #685444;              /* 5:1 sulle etichette, 5,9:1 sul crema */
  --filo: #dcc7a4;
  --accento: #7a4a26;            /* caramello scuro: testo e icone attive */
  --accento-pieno: #8a5530;      /* caramello: pulsanti con testo crema 5:1 */
  --accento-velo: #e5d2b2;
  --su-accento: #f3e7d2;
  --bolla-io: #8a5530;
  --su-bolla-io: #f3e7d2;
  --rosso: #a3392a;
  --rosso-velo: #f0d6c8;
  --ambra: #7e5300;
  --ambra-velo: #eedcb8;
  --verde: #3f6b3a;
  --verde-velo: #dde3c6;
  --ombra: 0 8px 28px rgba(60, 35, 15, .14), 0 1px 3px rgba(60, 35, 15, .10);
  --vetro: rgba(243, 231, 210, .88);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --esce: cubic-bezier(.16, 1, .3, 1);
  --sicuro-su: env(safe-area-inset-top, 0px);
  --sicuro-giu: env(safe-area-inset-bottom, 0px);
  --sicuro-sx: env(safe-area-inset-left, 0px);
  --sicuro-dx: env(safe-area-inset-right, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --sfondo: #1b140f;             /* cacao */
    --superficie: #281d16;
    --superficie-2: #35281d;
    --inchiostro: #f1e4cc;         /* crema */
    --tenue: #b39d88;
    --filo: #36291f;
    --accento: #e9d6b5;            /* crema: testo e icone attive */
    --accento-pieno: #e9d6b5;      /* pulsanti crema con testo cacao */
    --accento-velo: #35281d;
    --su-accento: #2a1f17;
    --bolla-io: #7a4a2a;
    --su-bolla-io: #f3e7d2;
    --rosso: #f0907f;
    --rosso-velo: #3a211b;
    --ambra: #e8b86a;
    --ambra-velo: #33281a;
    --verde: #a9c98f;
    --verde-velo: #232a1b;
    --ombra: 0 10px 30px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4);
    --vetro: rgba(27, 20, 15, .86);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  background: var(--sfondo);
  color: var(--inchiostro);
  font: 17px/1.47 var(--font);
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
::selection { background: color-mix(in srgb, var(--accento-pieno) 30%, transparent); }
textarea, input { caret-color: var(--accento); }
button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accento); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.nascosto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ico { width: 24px; height: 24px; fill: currentColor; flex: none; }
h1, h2, h3, p { margin: 0; }

/* ---------------------------------------------------------------- impalcatura */
.app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  padding-left: var(--sicuro-sx);
  padding-right: var(--sicuro-dx);
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}
.contenuto { overflow: hidden; position: relative; min-height: 0; }
.vista { height: 100%; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.app:not([data-vista="chat"]) .scrivi { display: none; }

.testata {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(var(--sicuro-su) + 8px) 12px 8px 16px;
  background: var(--vetro);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--filo);
  position: relative; z-index: 2;
}
.testata-titolo { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { border-radius: 50%; }
.testata h1 { font-size: 17px; font-weight: 600; line-height: 1.2; }
.stato { font-size: 13px; color: var(--tenue); line-height: 1.3; display: flex; align-items: center; gap: 6px; }
.stato::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--tenue); flex: none; }
.stato[data-stato="pronto"]::before { background: var(--verde); }
.stato[data-stato="lavora"]::before { background: var(--accento-pieno); }
.stato[data-stato="spento"]::before { background: var(--rosso); }

.tasto-icona {
  width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; color: var(--accento);
  transition: background-color .2s var(--esce), transform .2s var(--esce);
}
.tasto-icona:active { background: var(--superficie-2); transform: scale(.94); }
.tasto-icona-piccolo { width: 36px; height: 36px; }
.tasto-icona-piccolo .ico { width: 18px; height: 18px; }

/* menu */
.menu {
  position: absolute; z-index: 5; right: 12px; top: calc(var(--sicuro-su) + 58px);
  min-width: 260px; padding: 6px;
  background: var(--superficie); border-radius: 14px; box-shadow: var(--ombra);
  transform-origin: top right; animation: apri-menu .22s var(--esce);
}
.menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  min-height: 46px; padding: 10px 12px; border-radius: 10px; font-size: 16px;
}
.menu button:active { background: var(--superficie-2); }
.menu .ico { color: var(--accento); width: 22px; height: 22px; }
.menu button[aria-checked="true"] span::after { content: " (attivo)"; color: var(--tenue); }
.menu .pericolo, .menu .pericolo .ico { color: var(--rosso); }
@keyframes apri-menu { from { opacity: 0; transform: scale(.96) translateY(-4px); } }

/* ---------------------------------------------------------------- strisce di stato */
.striscia {
  margin: 12px 16px 0; padding: 12px 14px; border-radius: 14px;
  display: flex; align-items: center; gap: 12px;
  background: var(--rosso-velo); color: var(--rosso); font-size: 15px; line-height: 1.35;
}
.striscia p { flex: 1; }
.striscia-info { background: var(--accento-velo); color: var(--inchiostro); }
.striscia-info .tasto-icona { color: var(--tenue); }

/* ---------------------------------------------------------------- chat */
.messaggi { padding: 16px 16px 8px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 100%; animation: entra .38s var(--esce) both; }
.msg-io {
  align-self: flex-end; max-width: 84%;
  background: var(--bolla-io); color: var(--su-bolla-io);
  padding: 9px 15px; border-radius: 20px 20px 6px 20px;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.msg-bip { align-self: stretch; overflow-wrap: anywhere; }
.msg-bip .testo > * + * { margin-top: .6em; }
.msg-bip ul, .msg-bip ol { padding-left: 1.25em; margin: 0; }
.msg-bip li + li { margin-top: .25em; }
.msg-bip strong { font-weight: 600; }
.msg-bip a { color: var(--accento); text-underline-offset: 3px; }
.msg-bip .wl { font-weight: 600; }
.msg-bip code { font: .88em var(--mono); background: var(--superficie-2); padding: .1em .35em; border-radius: 5px; }
.msg-bip pre {
  font: 13px/1.5 var(--mono); background: var(--superficie); border: 1px solid var(--filo);
  padding: 10px 12px; border-radius: 12px; overflow-x: auto; margin: 0;
}
.msg-bip pre code { background: none; padding: 0; font-size: inherit; }
.msg-bip h4 { font-size: 17px; font-weight: 600; margin: .9em 0 0; }
.tabella { overflow-x: auto; border: 1px solid var(--filo); border-radius: 12px; background: var(--superficie); }
.tabella table { border-collapse: collapse; font-size: 14px; min-width: 100%; font-variant-numeric: tabular-nums; }
.tabella th, .tabella td { padding: 8px 10px; text-align: left; vertical-align: top; }
.tabella th { font-weight: 600; background: var(--superficie-2); white-space: nowrap; }
.tabella tr + tr td { border-top: 1px solid var(--filo); }

.azioni-msg { display: flex; gap: 4px; margin-top: 6px; margin-left: -10px; }
.azione-msg {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border-radius: 999px;
  color: var(--tenue); font-size: 14px;
}
.azione-msg .ico { width: 18px; height: 18px; }
.azione-msg:active, .azione-msg[aria-pressed="true"] { color: var(--accento); background: var(--accento-velo); }

.lavoro { display: flex; align-items: center; gap: 10px; color: var(--tenue); font-size: 15px; min-height: 28px; }
.lavoro .punti { display: inline-flex; gap: 4px; }
.lavoro .punti i { width: 6px; height: 6px; border-radius: 50%; background: var(--accento-pieno); animation: punto 1.2s infinite var(--esce); }
.lavoro .punti i:nth-child(2) { animation-delay: .15s; }
.lavoro .punti i:nth-child(3) { animation-delay: .3s; }
.lavoro span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes punto { 0%, 70%, 100% { opacity: .25; transform: translateY(0); } 35% { opacity: 1; transform: translateY(-3px); } }

.nota-sistema { align-self: center; font-size: 13px; color: var(--tenue); text-align: center; max-width: 34ch; }
.nota-errore { align-self: stretch; display: flex; gap: 10px; color: var(--rosso); background: var(--rosso-velo); padding: 10px 14px; border-radius: 14px; font-size: 15px; }
.nota-errore .ico { width: 20px; height: 20px; margin-top: 1px; }

.permesso {
  align-self: stretch; background: var(--superficie); border-radius: 14px; padding: 14px; box-shadow: var(--ombra);
}
.permesso h3 { font-size: 16px; font-weight: 600; display: flex; gap: 8px; align-items: center; }
.permesso h3 .ico { color: var(--ambra); width: 22px; height: 22px; }
.permesso pre {
  font: 13px/1.45 var(--mono); background: var(--sfondo); border-radius: 10px; padding: 10px 12px;
  margin: 10px 0 12px; max-height: 180px; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
}
.permesso-tasti { display: flex; flex-wrap: wrap; gap: 8px; }
.permesso-tasti .tasto { flex: 1 1 auto; }
.permesso-esito { font-size: 14px; color: var(--tenue); }

.vuoto-chat { padding: 18vh 24px 24px; }
.saluto { font-size: 30px; font-weight: 600; letter-spacing: -0.03em; line-height: 1.15; }
.sotto { color: var(--tenue); margin-top: 8px; max-width: 34ch; }
.spunti { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 24px; }
.spunto {
  min-height: 44px; padding: 10px 16px; border-radius: 999px; text-align: left;
  background: var(--superficie); border: 1px solid var(--filo); font-size: 16px;
  transition: transform .2s var(--esce), border-color .2s;
}
.spunto:active { transform: scale(.97); border-color: var(--accento); }

@keyframes entra { from { opacity: 0; transform: translateY(8px); } }

/* ---------------------------------------------------------------- composizione */
.scrivi { padding: 8px 12px 8px; background: var(--sfondo); }
.scrivi-riga {
  display: flex; align-items: flex-end; gap: 6px;
  background: var(--superficie); border: 1px solid var(--filo); border-radius: 24px;
  padding: 5px 5px 5px 16px;
  transition: border-color .2s;
}
.scrivi-riga:focus-within { border-color: color-mix(in srgb, var(--accento) 55%, var(--filo)); }
#testo {
  flex: 1; border: 0; outline: 0; resize: none; background: transparent;
  font-size: 17px; line-height: 1.4; padding: 7px 0; max-height: 9.8em; min-height: 38px;
}
#testo::placeholder { color: var(--tenue); opacity: 1; }
.tasto-tondo {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  transition: transform .18s var(--esce), background-color .2s;
}
.tasto-tondo:active { transform: scale(.9); }
.tasto-tondo .ico { width: 20px; height: 20px; }
.tasto-mic { color: var(--accento); }
.tasto-mic:active { background: var(--accento-velo); }
.tasto-invia { background: var(--accento-pieno); color: var(--su-accento); }
.tasto-ferma { background: var(--inchiostro); color: var(--superficie); }
.tasto-ferma .ico { width: 16px; height: 16px; }
.registra { padding-left: 4px; align-items: center; }
.registra .tasto-icona { color: var(--rosso); width: 38px; height: 38px; }
.onda { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; height: 38px; }
.onda span { width: 4px; height: 10px; border-radius: 2px; background: var(--accento-pieno); animation: onda 1s infinite ease-in-out; }
.onda span:nth-child(2) { animation-delay: .1s; } .onda span:nth-child(3) { animation-delay: .2s; }
.onda span:nth-child(4) { animation-delay: .3s; } .onda span:nth-child(5) { animation-delay: .4s; }
@keyframes onda { 50% { height: 26px; } }
.tempo { font-variant-numeric: tabular-nums; color: var(--tenue); font-size: 15px; min-width: 3.2em; }

/* ---------------------------------------------------------------- schede in basso */
/* una pillola staccata dai bordi, con la scheda attiva in una pillola più piccola */
.schede {
  position: relative;
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px;
  margin: 2px 14px calc(var(--sicuro-giu) + 10px);
  padding: 5px;
  background: var(--superficie);
  border: 1px solid var(--filo);
  border-radius: 30px;
  box-shadow: var(--ombra);
}
.scheda {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-height: 52px; border-radius: 24px; color: var(--tenue); font-size: 11px; font-weight: 500; letter-spacing: 0;
  transition: background-color .25s var(--esce), color .25s var(--esce);
}
.scheda:active { transform: scale(.96); }
.scheda .piena { display: none; }
.scheda[aria-current="page"] { color: var(--accento); }
/* la pillola evidenziata scorre fino alla voce toccata (posizione e larghezza le calcola app.js) */
.indicatore {
  position: absolute; top: 5px; bottom: 5px; left: 0; width: 0; z-index: 0; pointer-events: none;
  border-radius: 24px; background: var(--accento-velo);
  box-shadow: 0 2px 8px rgba(60, 35, 15, .12);
  opacity: 0;
}
.indicatore.pronto { opacity: 1; transition: transform .45s cubic-bezier(.32, .72, 0, 1), width .3s var(--esce); }
.scheda { z-index: 1; }
.scheda[aria-current="page"] .vuota { display: none; }
.scheda[aria-current="page"] .piena { display: block; }
.bollino {
  position: absolute; top: 3px; left: calc(50% + 5px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: #b8402f; color: #fff; font-size: 11px; font-weight: 600; line-height: 18px;
  text-align: center; font-variant-numeric: tabular-nums;
}
@media (prefers-color-scheme: dark) { .bollino { background: #b8402f; } }

/* ---------------------------------------------------------------- elenchi (scadenze, posta, persone) */
.vista-elenco { padding: 0 16px 24px; }
.intestazione-vista { display: flex; align-items: center; justify-content: space-between; padding: 18px 0 6px; }
.intestazione-vista h2 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
.nota-vista { color: var(--tenue); font-size: 14px; margin-bottom: 8px; }
.gruppo { margin-top: 22px; }
.gruppo h3 { font-size: 15px; font-weight: 600; color: var(--tenue); margin: 0 4px 8px; display: flex; gap: 8px; align-items: baseline; }
.gruppo h3 .conta { font-weight: 400; font-variant-numeric: tabular-nums; }
.gruppo.ritardo h3 { color: var(--rosso); }
.lista { background: var(--superficie); border-radius: 14px; overflow: hidden; }
.voce {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 12px 14px; min-height: 60px; position: relative;
}
.voce + .voce::before { content: ""; position: absolute; top: 0; left: 72px; right: 0; border-top: 1px solid var(--filo); }
.lista-semplice .voce + .voce::before { left: 14px; }
button.voce:active, .voce-tocca:active { background: var(--superficie-2); }
.data {
  width: 44px; flex: none; text-align: center; line-height: 1.05; font-variant-numeric: tabular-nums;
}
.data b { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.data small { font-size: 12px; color: var(--tenue); text-transform: lowercase; }
.ritardo .data b { color: var(--rosso); }
.voce-testo { flex: 1; min-width: 0; }
.voce-titolo { display: block; font-size: 16px; font-weight: 500; line-height: 1.3; }
.voce-sotto { display: block; font-size: 14px; color: var(--tenue); line-height: 1.35; margin-top: 1px; overflow-wrap: anywhere; }
.riga-meta .voce-sotto { display: inline; margin: 0; }
.voce .avanti { width: 16px; height: 16px; color: var(--tenue); opacity: .6; }
.etichetta-stato {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: 0; padding: 2px 8px; border-radius: 999px;
  background: var(--superficie-2); color: var(--tenue); white-space: nowrap;
}
.etichetta-stato.alta { background: var(--rosso-velo); color: var(--rosso); }
.etichetta-stato.attesa { background: var(--ambra-velo); color: var(--ambra); }
.etichetta-stato.ok { background: var(--verde-velo); color: var(--verde); }
.etichetta-stato.corso { background: transparent; color: var(--inchiostro); box-shadow: inset 0 0 0 1px var(--tenue); }
.riga-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 5px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: var(--accento-velo); color: var(--accento); font-weight: 600; font-size: 17px;
}
.vuoto-elenco { text-align: center; color: var(--tenue); padding: 48px 24px; }
.vuoto-elenco .ico { width: 40px; height: 40px; color: var(--accento); opacity: .8; margin-bottom: 8px; }
.vuoto-elenco p + p { margin-top: 4px; font-size: 15px; }
.mostra-tutto { color: var(--accento); font-size: 15px; min-height: 44px; padding: 0 4px; margin-top: 8px; }

/* scheletri di caricamento */
.scheletro { background: var(--superficie); border-radius: 14px; padding: 4px 0; margin-top: 22px; }
.scheletro div { display: flex; gap: 14px; padding: 12px 14px; }
.scheletro i { display: block; border-radius: 8px; background: var(--superficie-2); animation: luccica 1.4s infinite ease-in-out; }
.scheletro i:first-child { width: 44px; height: 40px; }
.scheletro i:last-child { flex: 1; height: 40px; }
@keyframes luccica { 50% { opacity: .45; } }

/* ---------------------------------------------------------------- pulsanti e campi */
.tasto {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 999px;
  background: var(--accento-pieno); color: var(--su-accento); font-weight: 500; font-size: 17px; white-space: nowrap;
  transition: transform .18s var(--esce), opacity .2s;
}
.tasto:active { transform: scale(.97); }
.tasto:disabled { opacity: .45; cursor: default; }
.tasto .ico { width: 20px; height: 20px; }
.tasto-largo { width: 100%; }
.tasto-piccolo { min-height: 36px; padding: 0 14px; font-size: 15px; }
.tasto-secondario { background: var(--superficie-2); color: var(--accento); }
.tasto-no { background: var(--superficie-2); color: var(--inchiostro); }
.tasto-pericolo { background: var(--rosso-velo); color: var(--rosso); }
#btn-invita { margin-top: 10px; }
.etichetta { display: block; font-size: 15px; font-weight: 500; margin: 20px 0 6px; }
.campo {
  width: 100%; min-height: 50px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--filo); background: var(--superficie); font-size: 17px; outline: 0;
}
.campo:focus { border-color: var(--accento); }
.campo::placeholder { color: var(--tenue); opacity: 1; }
.errore { color: var(--rosso); font-size: 15px; margin-top: 8px; }

/* ---------------------------------------------------------------- accesso */
.accesso {
  position: absolute; inset: 0; z-index: 20; background: var(--sfondo);
  display: grid; place-items: center; padding: calc(var(--sicuro-su) + 24px) 24px calc(var(--sicuro-giu) + 24px);
  overflow-y: auto;
}
.accesso-corpo { width: 100%; max-width: 380px; }
.accesso-logo { border-radius: 22px; display: block; margin-bottom: 24px; box-shadow: 0 10px 30px rgba(60, 35, 15, .30); }
.accesso h2 { font-size: 28px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.accesso-testo { color: var(--tenue); margin-top: 10px; }
.accesso .tasto-largo, .accesso .tasto-secondario { margin-top: 24px; }
.riga-carica { height: 3px; border-radius: 2px; background: var(--superficie-2); overflow: hidden; margin-top: 28px; }
.riga-carica span { display: block; height: 100%; width: 40%; border-radius: 2px; background: var(--accento-pieno); animation: carica 1.3s infinite var(--esce); }
@keyframes carica { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------------------------------------------------------------- foglio a comparsa */
.velo { position: absolute; inset: 0; z-index: 30; background: rgba(27, 20, 15, .45); animation: compare .25s ease-out; }
.foglio {
  position: absolute; z-index: 31; left: 0; right: 0; bottom: 0;
  background: var(--superficie); border-radius: 18px 18px 0 0; box-shadow: var(--ombra);
  padding: 8px 20px calc(var(--sicuro-giu) + 20px); max-height: 86dvh; overflow-y: auto;
  animation: sale .34s var(--esce);
}
.foglio-maniglia { width: 36px; height: 5px; border-radius: 3px; background: var(--filo); margin: 0 auto 14px; }
.foglio h3 { font-size: 20px; font-weight: 600; letter-spacing: -0.02em; margin-bottom: 6px; }
.foglio p { color: var(--tenue); font-size: 15px; }
.scelte { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.scelta {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; min-height: 56px;
  border-radius: 14px; border: 1px solid var(--filo);
}
.scelta[aria-checked="true"] { border-color: var(--accento); background: var(--accento-velo); }
.scelta b { display: block; font-weight: 600; font-size: 16px; }
.scelta small { display: block; color: var(--tenue); font-size: 14px; line-height: 1.35; }
.link-invito {
  margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--sfondo);
  font: 14px/1.45 var(--mono); overflow-wrap: anywhere; user-select: all;
}
.tasti-foglio { display: flex; gap: 8px; margin-top: 16px; }
.tasti-foglio .tasto { flex: 1; }
@keyframes sale { from { transform: translateY(100%); } }
@keyframes compare { from { opacity: 0; } }

/* ---------------------------------------------------------------- avviso breve */
.toast {
  position: absolute; z-index: 40; left: 50%; bottom: calc(var(--sicuro-giu) + 140px); transform: translateX(-50%);
  max-width: calc(100% - 32px); width: max-content;
  background: var(--inchiostro); color: var(--superficie); padding: 10px 16px; border-radius: 14px; font-size: 15px;
  box-shadow: var(--ombra); animation: entra .3s var(--esce);
}

@media (min-width: 761px) {
  .app { border-left: 1px solid var(--filo); border-right: 1px solid var(--filo); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .testata { background: var(--sfondo); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
