/* app.css - la webapp del tasto del nonno (1/10/2026).
 *
 * Stessa famiglia della pagina del portale Wi-Fi (firmware/telecomando_esp32/
 * rete_wifi.h): elenchi raggruppati stile iOS 17, la carta calda #f4f1ea, il
 * verde del progetto, il tema scuro automatico. Qui c'e' molto di piu': fogli
 * che salgono a molla, il pulsante "Premi" con l'anello, liste a cascata.
 * Tutto rispetta prefers-reduced-motion (in fondo al file).
 */

/* ------------------------------------------------------------ i colori */
:root {
  --bg: #f4f1ea; --bg-alto: #faf8f3; --card: #fff; --card2: #f6f3ec;
  --txt: #1d1d1b; --sub: #77736a; --ter: #a9a59b;
  --sep: rgba(60, 60, 50, .13); --dim: rgba(60, 60, 50, .2); --riempi: rgba(118, 112, 96, .11);
  --acc: #2f7d4f; --acc2: #45a56c; --acc-testo: #2f7d4f; --acc-tenue: rgba(47, 125, 79, .11);
  --rosso: #c9342c; --rosso-tenue: rgba(201, 52, 44, .1);
  --ambra: #9a5b00; --ambra-vivo: #e0901f; --ambra-tenue: rgba(224, 144, 31, .15);
  --blu: #2c64b8; --blu-tenue: rgba(44, 100, 184, .1);
  --viola: #7a4fc2; --viola-tenue: rgba(122, 79, 194, .11);
  --vetro: rgba(247, 245, 239, .74);
  --ombra: 0 1px 2px rgba(40, 35, 20, .05), 0 8px 24px -12px rgba(40, 35, 20, .16);
  --ombra-alta: 0 2px 6px rgba(40, 35, 20, .05), 0 22px 44px -20px rgba(40, 35, 20, .3);
  --foglio: #f4f1ea; --foglio-card: #fff;
  --seg: #fff;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-titolo: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI Variable Display", "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, "Cascadia Mono", Consolas, monospace;
  /* le molle: cubic-bezier per chi non conosce linear(), una molla vera per gli altri */
  --molla: cubic-bezier(.2, 1.08, .32, 1);
  --molla-viva: cubic-bezier(.3, 1.45, .45, 1);
  --su: env(safe-area-inset-top, 0px);
  --giu: env(safe-area-inset-bottom, 0px);
  --barra: 44px;
  color-scheme: light dark;
}
@supports (transition-timing-function: linear(0, 1)) {
  :root {
    --molla: linear(0, .0303, .1064, .2095, .3253, .4431, .5556, .6581, .7478, .8236, .8857, .9347, .972, .9992, 1.0179, 1.0296, 1.036, 1.0383, 1.0377, 1.0352, 1.0314, 1.027, 1.0225, 1.0181, 1.0141, 1.0105, 1.0074, 1.0049, 1.0029, 1.0014, 1.0003, .9995, 1);
    --molla-viva: linear(0, .0536, .1853, .3569, .5384, .7083, .8533, .9668, 1.0473, 1.0973, 1.1216, 1.1258, 1.1161, 1.0978, 1.0754, 1.0527, 1.0319, 1.0145, 1.0012, .9921, .9867, .9843, .9843, .9858, .9883, .9912, .994, .9966, .9986, 1.0002, 1.0012, 1.0018, 1);
  }
}
/* Il tema scuro non e' l'inverso del chiaro: fondo quasi nero caldo, carte
   che si staccano per luminosita' (le ombre al buio non si vedono), verdi
   piu' accesi perche' su fondo scuro il #2f7d4f sparisce. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0d0c; --bg-alto: #121211; --card: #1c1c1a; --card2: #242422;
    --txt: #f2f1ec; --sub: #9a978e; --ter: #67655f;
    --sep: rgba(255, 255, 240, .1); --dim: rgba(255, 255, 240, .2); --riempi: rgba(255, 255, 240, .085);
    --acc: #3f9e66; --acc2: #62c48b; --acc-testo: #6fd096; --acc-tenue: rgba(98, 196, 139, .14);
    --rosso: #ff6b62; --rosso-tenue: rgba(255, 107, 98, .14);
    --ambra: #f2b155; --ambra-vivo: #f0a640; --ambra-tenue: rgba(240, 166, 64, .15);
    --blu: #84b4ff; --blu-tenue: rgba(132, 180, 255, .13);
    --viola: #b99af0; --viola-tenue: rgba(185, 154, 240, .14);
    --vetro: rgba(24, 24, 22, .72);
    --ombra: 0 0 0 .5px rgba(255, 255, 240, .05);
    --ombra-alta: 0 0 0 .5px rgba(255, 255, 240, .06), 0 24px 48px -20px rgba(0, 0, 0, .8);
    --foglio: #161615; --foglio-card: #232321;
    --seg: #5d5c57;
  }
}

/* ------------------------------------------------------------ la base */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; color: var(--txt); background: var(--bg);
  font: 17px/1.35 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100vh; min-height: 100dvh;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
a { color: var(--acc-testo); }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--acc2); outline-offset: 2px; border-radius: 8px; }
.ic { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2;
      stroke-linecap: round; stroke-linejoin: round; }
.solo-lettori { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

#app { min-height: 100vh; min-height: 100dvh; background: var(--bg); overflow-x: clip; }
.vista {
  position: relative; max-width: 560px; margin: 0 auto;
  padding: 0 16px calc(96px + var(--giu));
}
html.senza-schede .vista { padding-bottom: calc(32px + var(--giu)); }

/* ------------------------------------------------------------ barra in alto */
.barra-su {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0;
  height: calc(var(--barra) + var(--su)); padding: var(--su) 8px 0;
  display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center;
  transition: opacity .25s, transform .25s;
}
.barra-su::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--vetro); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep); opacity: 0; transition: opacity .2s;
}
.barra-su.piena::before { opacity: 1; }
.barra-titolo {
  font-weight: 600; font-size: 17px; text-align: center; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; opacity: 0; transform: translateY(5px); transition: opacity .2s, transform .3s var(--molla);
}
.barra-su.piena .barra-titolo { opacity: 1; transform: none; }
.barra-sx { justify-self: start; display: flex; }
.barra-dx { justify-self: end; display: flex; gap: 6px; padding-right: 6px; }
.barra-indietro {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 8px 0 2px;
  color: var(--acc-testo); text-decoration: none; font-size: 17px; border-radius: 10px;
  transition: opacity .15s;
}
.barra-indietro:active { opacity: .45; }
.barra-indietro .ic { width: 24px; height: 24px; stroke-width: 2.6; }
.bottone-profilo {
  border: 0; padding: 6px; margin: 0; background: none; border-radius: 50%; display: grid; place-items: center;
  min-width: 44px; min-height: 44px; transition: transform .3s var(--molla);
}
.bottone-profilo:active { transform: scale(.9); }
.bottone-tondo {
  width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  background: var(--acc-tenue); color: var(--acc-testo); position: relative; transition: transform .3s var(--molla);
}
.bottone-tondo::after { content: ""; position: absolute; inset: -5px; }
.bottone-tondo:active { transform: scale(.88); }
.bottone-tondo .ic { width: 20px; height: 20px; stroke-width: 2.6; }

/* il titolo grande, che si rimpicciolisce e sfuma sotto la barra */
.grande { padding: calc(var(--barra) + var(--su) + 2px) 4px 6px; }
.eye {
  font-size: 13px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase;
  color: var(--acc-testo); margin: 0;
}
.grande .eye { margin: 0 0 2px; }
.grande-riga { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.grande h1 {
  font: 700 34px/1.12 var(--font-titolo); letter-spacing: -.035em; margin: 0;
  transform-origin: 0 100%; transform: scale(calc(1 - var(--p, 0) * .06)); opacity: calc(1 - var(--p, 0) * .9);
}

/* ------------------------------------------------------------ la barra delle schede */
.schede {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; padding: 5px 4px calc(var(--giu) + 3px);
  background: var(--vetro); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border-top: .5px solid var(--sep);
  transition: transform .45s var(--molla), opacity .25s;
}
html.senza-schede .schede { transform: translateY(110%); pointer-events: none; }
.schede a {
  flex: 1; max-width: 104px; min-height: 50px; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  text-decoration: none; color: var(--ter); font-size: 10.5px; font-weight: 600; letter-spacing: .01em;
  transition: color .2s;
}
.schede a .ic { width: 27px; height: 27px; }
.schede a[aria-current="page"] { color: var(--acc-testo); }
.schede a[aria-current="page"] .ic { animation: salta .55s var(--molla-viva); }
.schede a:active .ic { transform: scale(.86); transition: transform .1s; }
.schede .bollino {
  position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--rosso); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); animation: appare .5s var(--molla-viva);
}

/* la striscia "senza collegamento" sotto la barra */
.banda {
  position: fixed; z-index: 31; left: 50%; top: calc(var(--su) + 50px);
  transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  padding: 7px 8px 7px 14px; border-radius: 99px; font-size: 14px; font-weight: 600;
  background: var(--card); color: var(--rosso); box-shadow: var(--ombra-alta);
  animation: cala .5s var(--molla) both; white-space: nowrap;
}
.banda .ic { width: 18px; height: 18px; }
.banda button { border: 0; border-radius: 99px; background: var(--rosso-tenue); color: var(--rosso);
  font-size: 14px; font-weight: 600; padding: 6px 12px; min-height: 32px; }

/* ------------------------------------------------------------ sezioni e gruppi */
.sezione { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 4px 10px; }
.sezione h2 { font: 700 22px/1.2 var(--font-titolo); letter-spacing: -.025em; margin: 0; }
.sezione a, .sezione button.link { font-size: 15px; font-weight: 500; color: var(--acc-testo); text-decoration: none;
  border: 0; background: none; padding: 8px 0; }
.etich { font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; color: var(--sub); margin: 26px 16px 8px; }
.nota { font-size: 13px; line-height: 1.4; color: var(--sub); margin: 8px 16px 0; }
.nota.centro { text-align: center; }
.carta { background: var(--card); border-radius: 20px; box-shadow: var(--ombra); }
.grp { background: var(--card); border-radius: 14px; overflow: hidden; box-shadow: var(--ombra); }
.riga {
  display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px; margin: 0;
  position: relative; width: 100%; border: 0; background: none; text-align: left; color: inherit; text-decoration: none;
  transition: background .2s;
}
.riga + .riga::before, .riga + .scorrevole::before, .scorrevole + .riga::before {
  content: ""; position: absolute; top: 0; right: 0; left: var(--rientro, 16px); border-top: .5px solid var(--sep);
}
.grp.con-icone { --rientro: 60px; }
.grp.con-avatar { --rientro: 64px; }
.tocca { cursor: pointer; }
.riga.tocca:active { background: var(--riempi); transition: none; }
/* titolo sopra, sottotitolo sotto: vale per righe, modi delle app, opzioni e richieste */
.corpo { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.t1 { font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.t2 { font-size: 14px; line-height: 1.3; color: var(--sub); margin-top: 2px; overflow-wrap: anywhere; }
.chev { width: 9px; height: 15px; color: var(--ter); stroke-width: 2.6; flex: none; }
.valore { color: var(--sub); font-size: 15px; white-space: nowrap; flex: none; }
.riga .spunta-ok { color: var(--acc-testo); width: 20px; height: 20px; stroke-width: 2.8; animation: appare .45s var(--molla-viva); }
.ic-tondo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--acc-tenue); color: var(--acc-testo);
}
.ic-tondo .ic { width: 19px; height: 19px; }
.ic-tondo.no { background: var(--rosso-tenue); color: var(--rosso); }
.ic-tondo.ambra { background: var(--ambra-tenue); color: var(--ambra); }
.ic-tondo.blu { background: var(--blu-tenue); color: var(--blu); }

/* ------------------------------------------------------------ pulsanti, etichette, campi */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 54px;
  border: 0; border-radius: 15px; padding: 14px 18px; font-size: 17px; font-weight: 600; color: #fff;
  background: linear-gradient(180deg, var(--acc2), var(--acc));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 12px 26px -12px var(--acc);
  transition: transform .35s var(--molla), opacity .2s, filter .2s; position: relative; overflow: hidden;
}
.btn .ic { width: 20px; height: 20px; }
.btn:active { transform: scale(.97); transition-duration: .1s; }
.btn:disabled { opacity: .4; cursor: default; transform: none; box-shadow: none; }
.btn.secondario { background: var(--riempi); color: var(--acc-testo); box-shadow: none; }
.btn.pericolo { background: var(--rosso-tenue); color: var(--rosso); box-shadow: none; }
.btn.app { background: linear-gradient(180deg, var(--app-luce), var(--app)); color: var(--app-fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 12px 26px -14px var(--app); }
.btn.piccolo { width: auto; min-height: 44px; padding: 10px 16px; font-size: 15px; border-radius: 12px; }
.btn.in-corso { color: transparent !important; pointer-events: none; }
.btn.in-corso::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: gira .7s linear infinite;
}
.btn.secondario.in-corso::after, .btn.pericolo.in-corso::after { border-color: var(--dim); border-top-color: var(--acc-testo); }
.bottoni { display: grid; gap: 10px; margin-top: 22px; }
.btn-testo {
  border: 0; background: none; color: var(--acc-testo); font-size: 17px; padding: 10px 4px; min-height: 44px;
  display: inline-flex; align-items: center; gap: 4px; border-radius: 10px; transition: opacity .15s;
}
.btn-testo:active { opacity: .45; }
.btn-testo.rosso { color: var(--rosso); }
.btn-pillola {
  display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 99px; min-height: 36px;
  padding: 0 13px; font-size: 15px; font-weight: 600; background: var(--card); color: var(--app-testo, var(--acc-testo));
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08); flex: none; transition: transform .3s var(--molla); position: relative;
}
.btn-pillola::after { content: ""; position: absolute; inset: -4px; }
.btn-pillola:active { transform: scale(.94); }
.btn-pillola .ic { width: 17px; height: 17px; }

.etichetta {
  display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 600; line-height: 1.2;
  padding: 5px 10px 5px 8px; border-radius: 99px; background: var(--riempi); color: var(--sub); white-space: nowrap;
}
.etichetta .ic { width: 14px; height: 14px; stroke-width: 2.4; }
.etichetta.verde { background: var(--acc-tenue); color: var(--acc-testo); }
.etichetta.blu { background: var(--blu-tenue); color: var(--blu); }
.etichetta.ambra { background: var(--ambra-tenue); color: var(--ambra); }
.etichetta.rosso { background: var(--rosso-tenue); color: var(--rosso); }
.etichetta.viola { background: var(--viola-tenue); color: var(--viola); }
.etichette { display: flex; flex-wrap: wrap; gap: 6px; }

.campo {
  display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 6px 0 14px;
  background: var(--riempi); border-radius: 12px; transition: box-shadow .2s, background .2s;
}
.campo:focus-within { box-shadow: 0 0 0 2px var(--app-testo, var(--acc2)); background: var(--card); }
.campo input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; padding: 13px 0;
}
.campo input::placeholder { color: var(--sub); opacity: .75; }
.campo .ic { color: var(--sub); }
.campo .conta { font-size: 13px; color: var(--ter); font-variant-numeric: tabular-nums; padding-right: 8px; }
.grp .campo { background: none; border-radius: 0; box-shadow: none; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

.interruttore {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0; cursor: pointer;
  width: 51px; height: 31px; border-radius: 99px; background: var(--dim); position: relative; transition: background .25s;
}
.interruttore::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .16); transition: transform .35s var(--molla);
}
.interruttore:checked { background: var(--acc2); }
.interruttore:checked::after { transform: translateX(20px); }
.interruttore:active::after { width: 31px; }
.interruttore:checked:active::after { transform: translateX(16px); }

.segmenti {
  --n: 3; --k: 0; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: relative;
  background: var(--riempi); border-radius: 10px; padding: 2px;
}
.segmenti .cursore {
  position: absolute; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / var(--n)); border-radius: 8px;
  background: var(--seg); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04);
  transform: translateX(calc(var(--k) * 100%)); transition: transform .4s var(--molla);
}
.segmenti button {
  position: relative; z-index: 1; border: 0; background: none; min-height: 40px; padding: 4px 6px;
  font-size: 14px; font-weight: 500; border-radius: 8px; transition: transform .2s;
}
.segmenti button[aria-checked="true"] { font-weight: 600; }
.segmenti button:active { transform: scale(.95); }
.pillola-input {
  appearance: none; -webkit-appearance: none; border: 0; border-radius: 9px; background: var(--riempi);
  padding: 7px 11px; min-height: 38px; font-size: 17px; color: var(--txt); font-variant-numeric: tabular-nums;
}
.errore { color: var(--rosso); font-size: 15px; margin: 14px 4px 0; display: flex; gap: 8px; align-items: flex-start; }
.errore .ic { width: 19px; height: 19px; margin-top: 1px; }

/* ------------------------------------------------------------ tessere delle app, avatar */
.tessera {
  --d: 44px; --k: .46; --c: #6b6860;
  width: var(--d); height: var(--d); border-radius: calc(var(--d) * .235); flex: none;
  display: grid; place-items: center; overflow: hidden; position: relative;
  color: var(--fg, #fff); font: 800 calc(var(--d) * var(--k)) / 1 var(--font-titolo); letter-spacing: -.03em;
  background: var(--c);
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 76%, #fff), var(--c) 62%);
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .2), 0 6px 14px -8px var(--c);
}
.tessera::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: radial-gradient(120% 70% at 30% 0%, rgba(255, 255, 255, .22), transparent 60%);
}
.avatar {
  --d: 40px; --c: #8a867c; width: var(--d); height: var(--d); border-radius: 50%; flex: none;
  display: grid; place-items: center; color: #fff; font: 600 calc(var(--d) * .38) / 1 var(--font-titolo); letter-spacing: 0;
  background: var(--c);
  background: linear-gradient(150deg, color-mix(in srgb, var(--c) 64%, #fff), var(--c) 70%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 6px 16px -8px var(--c);
}
.avatar .ic { width: 52%; height: 52%; stroke-width: 2.2; }
.avatar.nonno { --c: #b7791f; }

/* ------------------------------------------------------------ casa: la carta protagonista */
.eroe {
  --tinta: var(--acc2);
  position: relative; isolation: isolate; overflow: hidden; margin-top: 10px; padding: 18px 18px 16px;
  background: var(--card); border-radius: 24px; box-shadow: var(--ombra-alta);
}
.eroe::before {
  content: ""; position: absolute; inset: 0; z-index: -1; transition: background .6s;
  background: radial-gradient(120% 95% at 100% 0%, color-mix(in srgb, var(--tinta) 22%, transparent), transparent 62%);
}
.eroe-cima { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.eroe-cima .eye { color: var(--sub); font-size: 12px; }
.eroe-dest { display: flex; gap: 14px; align-items: center; margin-top: 14px; }
.eroe-titolo { font: 700 25px/1.15 var(--font-titolo); letter-spacing: -.03em; margin: 0; overflow-wrap: anywhere; }
.eroe-sotto { margin: 4px 0 0; font-size: 15px; color: var(--sub); }
.eroe-note { display: grid; gap: 8px; margin-top: 16px; }
.riga-nota { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.35; color: var(--sub); }
.riga-nota .ic { width: 18px; height: 18px; margin-top: 1px; color: var(--sub); }
.riga-nota b { color: var(--txt); font-weight: 600; }
.avviso {
  display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; border-radius: 13px;
  font-size: 15px; line-height: 1.35; background: var(--ambra-tenue); color: var(--ambra);
}
.avviso .ic { width: 19px; height: 19px; margin-top: 1px; }
.avviso.verde { background: var(--acc-tenue); color: var(--acc-testo); }
.avviso.blu { background: var(--blu-tenue); color: var(--blu); }
.avviso.rosso { background: var(--rosso-tenue); color: var(--rosso); }
.eroe-azioni { margin-top: 10px; display: flex; justify-content: flex-start; }
.dal-vivo-punto {
  width: 9px; height: 9px; border-radius: 50%; background: var(--rosso); flex: none; margin: 5px 4px 0 4px;
  box-shadow: 0 0 0 0 var(--rosso); animation: pulsa 1.8s ease-out infinite;
}

/* ------------------------------------------------------------ il pulsante Premi */
.premi-carta { margin-top: 14px; padding: 20px 0 0; text-align: center; overflow: hidden; }
.premi-carta .eye { color: var(--sub); font-size: 12px; }
.premi {
  --C: 552.92; position: relative; display: block; width: 184px; height: 184px; margin: 14px auto 0;
  border: 0; padding: 0; background: none; border-radius: 50%; touch-action: manipulation;
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.premi:focus-visible { outline-offset: 4px; border-radius: 50%; }
.premi::before {
  content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--card2);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, .08), inset 0 -1px 0 rgba(255, 255, 255, .6);
}
.anello { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.anello circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.anello .traccia { stroke: var(--riempi); }
.anello .arco {
  stroke: var(--acc2); stroke-dasharray: var(--C); stroke-dashoffset: var(--C);
  transform-origin: 92px 92px; transition: stroke-dashoffset .35s ease, stroke .3s;
}
.cupola {
  position: absolute; inset: 17px; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px; color: #fff;
  background: radial-gradient(circle at 50% 28%, #63c88d, #3b9a62 46%, #2a7347 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .32), inset 0 -12px 26px rgba(0, 0, 0, .16),
              0 18px 34px -14px rgba(47, 125, 79, .8), 0 4px 10px -4px rgba(47, 125, 79, .45);
  transition: transform .45s var(--molla), box-shadow .35s, background .4s;
}
.cupola::before {
  content: ""; position: absolute; inset: 7% 18% auto; height: 34%; border-radius: 50%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .26), transparent); pointer-events: none;
}
.cupola-ic { display: grid; place-items: center; height: 34px; }
.cupola-ic .ic { width: 34px; height: 34px; stroke-width: 2.2; animation: appare .45s var(--molla-viva) both; }
.cupola-testo { font: 650 20px/1.1 var(--font-titolo); letter-spacing: -.01em; text-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.premi:active .cupola, [data-stato="carica"] .cupola {
  transform: scale(.94);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .25), inset 0 -8px 20px rgba(0, 0, 0, .2), 0 8px 16px -10px rgba(47, 125, 79, .8);
}
[data-stato="carica"] .arco { stroke-dashoffset: 0; transition: stroke-dashoffset .65s linear; }
[data-stato="attesa"] .arco, [data-stato="ricevuto"] .arco {
  stroke-dasharray: 150 403; stroke-dashoffset: 0; animation: gira 1.1s linear infinite;
}
[data-stato="ricevuto"] .arco { stroke-dasharray: 340 213; animation-duration: 1.6s; }
[data-stato="attesa"] .cupola, [data-stato="ricevuto"] .cupola { animation: respira 1.8s ease-in-out infinite; }
[data-stato="fatto"] .arco { stroke-dashoffset: 0; transition: stroke-dashoffset .5s var(--molla); }
[data-stato="fatto"] .cupola { animation: rimbalza .6s var(--molla-viva); }
[data-stato="errore"] .arco { stroke: var(--rosso); stroke-dashoffset: 0; transition: stroke-dashoffset .4s ease; }
[data-stato="errore"] .cupola {
  background: radial-gradient(circle at 50% 28%, #f08a80, #d4473d 50%, #a8302a 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .3), inset 0 -12px 26px rgba(0, 0, 0, .16), 0 18px 34px -14px rgba(201, 52, 44, .8);
  animation: scuoti .45s ease;
}
.premi-onda {
  position: absolute; inset: 17px; border-radius: 50%; pointer-events: none; opacity: 0;
  box-shadow: 0 0 0 0 rgba(69, 165, 108, .5);
}
[data-stato="attesa"] .premi-onda, [data-stato="ricevuto"] .premi-onda { animation: alone 1.8s ease-out infinite; opacity: 1; }
.premi-stato { margin: 16px 24px 0; min-height: 40px; font-size: 15px; line-height: 1.35; color: var(--sub); }
.premi-stato.bene { color: var(--acc-testo); }
.premi-stato.male { color: var(--rosso); }
.premi-stato b { color: var(--txt); font-weight: 600; }

/* i tre passi del comando: inviato, preso, in onda */
.passi-box { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .45s var(--molla); }
.passi-box.su { grid-template-rows: 1fr; }
.passi-box > div { overflow: hidden; }
.passi {
  list-style: none; margin: 18px auto 0; padding: 0; max-width: 290px; position: relative;
  display: grid; grid-template-columns: repeat(3, 1fr);
}
.passi::before, .passi::after {
  content: ""; position: absolute; top: 6px; left: 16.6%; right: 16.6%; height: 2px; border-radius: 2px; background: var(--riempi);
}
.passi::after { background: var(--acc2); right: auto; width: calc(66.8% * var(--avanza, 0)); transition: width .6s var(--molla); }
.passi li { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--ter); }
.passi i {
  width: 14px; height: 14px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 2px var(--dim);
  transition: background .3s, box-shadow .3s, transform .4s var(--molla-viva);
}
.passi li.fatto { color: var(--acc-testo); }
.passi li.fatto i { background: var(--acc2); box-shadow: inset 0 0 0 2px var(--acc2); }
.passi li.ora { color: var(--txt); }
.passi li.ora i { background: var(--card); box-shadow: inset 0 0 0 4px var(--acc2); transform: scale(1.25); animation: batte 1.2s ease-in-out infinite; }
.passi li.ko { color: var(--rosso); }
.passi li.ko i { background: var(--rosso); box-shadow: inset 0 0 0 2px var(--rosso); transform: scale(1.2); }
.premi-carta .riga { margin-top: 14px; border-top: .5px solid var(--sep); text-align: left; padding: 12px 16px 14px; }

/* telecomando collegato */
.punto-stato { width: 10px; height: 10px; border-radius: 50%; background: var(--ter); flex: none; }
.punto-stato.si { background: var(--acc2); box-shadow: 0 0 0 0 var(--acc2); animation: pulsa-verde 2.4s ease-out infinite; }
.punto-stato.no { background: var(--rosso); }
.quando-dx { font-size: 13px; color: var(--sub); white-space: nowrap; font-variant-numeric: tabular-nums; flex: none; align-self: flex-start; margin-top: 3px; }
.esito-bene { color: var(--acc-testo); }
.esito-male { color: var(--rosso); }

/* ------------------------------------------------------------ sfoglia */
.scaffale {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 6px;
  background: var(--card); border-radius: 22px; padding: 18px 8px 14px; box-shadow: var(--ombra);
}
.app-icona {
  border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 7px;
  min-width: 0; font-size: 12px; font-weight: 500; color: var(--txt); position: relative; transition: transform .35s var(--molla);
}
.app-icona:active { transform: scale(.9); }
.app-icona span.nome { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.app-icona .provare {
  /* una pillola a cavallo del bordo basso dell'icona: si legge, e non sposta la griglia */
  position: absolute; top: 47px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 2px 6px 2.5px; border-radius: 999px; background: var(--card); color: var(--ambra);
  font-size: 9.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.2;
  box-shadow: 0 0 0 1.5px var(--ambra-vivo), 0 2px 6px rgba(0, 0, 0, .18);
}
.legenda-provare { margin: 10px 8px 0; }
.scorri {
  display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 16px;
  margin: 0 -16px; padding: 2px 16px 14px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.scorri::-webkit-scrollbar { display: none; }
.canale {
  --h: 150; flex: none; width: 150px; height: 100px; border: 0; border-radius: 18px; padding: 11px 12px 12px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left;
  color: #fff; scroll-snap-align: start; position: relative; overflow: hidden;
  background: linear-gradient(150deg, hsl(var(--h) 38% 30%), hsl(var(--h) 46% 13%));
  box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .1), 0 10px 22px -14px hsl(var(--h) 40% 20%);
  transition: transform .35s var(--molla);
}
.canale::after { content: ""; position: absolute; inset: 0; background: radial-gradient(90% 70% at 100% 0%, rgba(255, 255, 255, .16), transparent 60%); }
.canale:active { transform: scale(.96); }
.canale b { position: relative; z-index: 1; font: 650 16px/1.2 var(--font-titolo); letter-spacing: -.01em; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.canale.scelto { box-shadow: inset 0 0 0 2.5px var(--acc2), 0 10px 22px -14px hsl(var(--h) 40% 20%); }
.in-onda {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px 3px 7px;
  border-radius: 99px; font-size: 10.5px; font-weight: 800; letter-spacing: .07em; background: rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.in-onda::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #ff5a4f; animation: lampeggia 1.6s ease-in-out infinite; }
.cerca-box { position: relative; margin: 0 0 10px; }
.cerca-box .ic { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--sub); pointer-events: none; }
.cerca {
  width: 100%; border: 0; outline: none; border-radius: 12px; background: var(--riempi); min-height: 44px;
  padding: 10px 12px 10px 36px; font-size: 17px; transition: background .2s, box-shadow .2s;
}
.cerca:focus { background: var(--card); box-shadow: 0 0 0 2px var(--acc2); }
.cerca::placeholder { color: var(--sub); opacity: .8; }
.filtri { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 14px; padding: 2px 16px; scrollbar-width: none; }
.filtri::-webkit-scrollbar { display: none; }
.chip {
  flex: none; border: 0; border-radius: 99px; min-height: 36px; padding: 0 14px; font-size: 15px; font-weight: 500;
  background: var(--card); color: var(--txt); box-shadow: var(--ombra); position: relative;
  transition: background .25s, color .25s, transform .35s var(--molla);
}
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip:active { transform: scale(.93); }
.chip[aria-pressed="true"] { background: var(--txt); color: var(--bg); }
.chip small { font-size: 12px; opacity: .6; margin-left: 4px; font-variant-numeric: tabular-nums; }
.giorno-testa { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--sub); margin: 18px 16px 8px; }
.giorno-testa:first-child { margin-top: 4px; }
.ora-ev { width: 50px; flex: none; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 1px; }
.ora-ev b { font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ora-ev small { font-size: 11px; color: var(--sub); text-transform: uppercase; letter-spacing: .03em; }
.dal-vivo {
  font-size: 10.5px; font-weight: 800; letter-spacing: .07em; color: #fff; background: var(--rosso);
  border-radius: 6px; padding: 4px 6px 3px; box-shadow: 0 4px 10px -4px var(--rosso);
}
.grp.eventi { --rientro: 78px; }
.vuoto { padding: 26px 20px; text-align: center; color: var(--sub); font-size: 15px; }
.vuoto .ic { display: block; margin: 0 auto 8px; width: 28px; height: 28px; color: var(--ter); }

/* la pagina di un'app: il suo colore fa da accento */
.pagina-app { --app: #6b6860; --app-luce: #8a867c; --app-fg: #fff; --app-testo: var(--app-chiaro); }
@media (prefers-color-scheme: dark) { .pagina-app { --app-testo: var(--app-scuro); } }
.pagina-app::before {
  content: ""; position: absolute; z-index: 0; top: 0; left: -16px; right: -16px; height: 460px; pointer-events: none;
  background: radial-gradient(110% 75% at 50% 0%, color-mix(in srgb, var(--app) 26%, transparent), transparent 72%);
}
.pagina-app > * { position: relative; }
.app-eroe { text-align: center; padding: calc(var(--barra) + var(--su) + 16px) 8px 6px; }
.foglio .app-eroe { padding-top: 6px; }
.app-eroe .tessera { margin: 0 auto; box-shadow: inset 0 0 0 .5px rgba(255, 255, 255, .14), inset 0 1px 0 rgba(255, 255, 255, .2), 0 22px 40px -16px var(--app); animation: appare .6s var(--molla-viva) both; }
.app-eroe h1 { font: 700 32px/1.1 var(--font-titolo); letter-spacing: -.035em; margin: 18px 0 8px; }
.app-eroe .etichette { justify-content: center; }
.da-sapere { margin-top: 14px; padding: 14px 16px 6px; border-radius: 20px; }
.da-sapere .eye { color: var(--sub); font-size: 12px; }
.da-sapere ul { list-style: none; margin: 8px 0 0; padding: 0; }
.da-sapere li { position: relative; padding: 0 0 10px 18px; font-size: 15px; line-height: 1.4; color: var(--sub); }
.da-sapere li::before { content: ""; position: absolute; left: 2px; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--app-testo); opacity: .8; }
.app-nota { margin-top: 18px; border-radius: 16px; font-size: 14px; color: var(--sub); line-height: 1.45; text-align: left; }
.app-nota summary {
  list-style: none; display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 0 14px; cursor: pointer;
  font-size: 15px; font-weight: 600; color: var(--app-testo);
}
.app-nota summary::-webkit-details-marker { display: none; }
.app-nota summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border: solid var(--ter); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .3s var(--molla); }
.app-nota[open] summary::after { transform: rotate(225deg); }
.app-nota .ic { width: 19px; height: 19px; }
.app-nota p { margin: 0; padding: 0 14px 14px 43px; overflow-wrap: anywhere; }
.app-nota[open] p { animation: sale .4s var(--molla) both; }
.modo { margin-top: 14px; border-radius: 20px; background: var(--card); box-shadow: var(--ombra); overflow: hidden; }
.modo-testa { display: flex; gap: 12px; align-items: center; padding: 14px 16px; width: 100%; border: 0; background: none; text-align: left; }
button.modo-testa { transition: background .2s; }
button.modo-testa:active { background: var(--riempi); transition: none; }
.modo-ic {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; color: var(--app-testo);
  background: color-mix(in srgb, var(--app) 14%, transparent);
}
.modo-ic .ic { width: 21px; height: 21px; }
.modo-testa .t1 { font-weight: 600; }
.modo-corpo { padding: 0 16px 16px; }
.riconosce {
  display: flex; gap: 9px; align-items: flex-start; min-height: 44px; padding: 10px 2px 0; font-size: 14px; line-height: 1.35; color: var(--sub);
}
.riconosce .ic { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.riconosce.ok { color: var(--acc-testo); }
.riconosce.ok .ic { animation: appare .45s var(--molla-viva); }
.riconosce.ko { color: var(--rosso); }
.riconosce.ko > div { animation: scuoti .4s ease; }
.mono { display: block; font-family: var(--mono); font-size: 12px; color: var(--sub); overflow-wrap: anywhere; margin-top: 3px; letter-spacing: 0; }
.riconosce b { font-weight: 600; }
.etich-campo { font-size: 13px; color: var(--sub); margin: 14px 2px 6px; font-weight: 500; }
.grp.dirette { --rientro: 64px; box-shadow: none; border-radius: 0; background: none; border-top: .5px solid var(--sep); }
.mini-diretta {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  font: 750 13px/1 var(--font-titolo); letter-spacing: -.02em; color: var(--app-fg);
  background: linear-gradient(160deg, var(--app-luce), var(--app));
}
.punto-vivo { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--rosso); margin-right: 6px; vertical-align: 1px; animation: lampeggia 1.6s ease-in-out infinite; }

/* ------------------------------------------------------------ il foglio di conferma */
.conferma-dest { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.conferma-dest > div > b { display: block; font: 650 19px/1.2 var(--font-titolo); letter-spacing: -.02em; overflow-wrap: anywhere; }
.conferma-dest > div > span { display: block; font-size: 14px; color: var(--sub); margin-top: 3px; }
.display-cornice {
  margin: 0 auto; max-width: 330px; padding: 9px; border-radius: 16px;
  background: linear-gradient(180deg, #3a3a38, #1f1f1e); box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .12);
}
.display-finto {
  position: relative; aspect-ratio: 320 / 170; border-radius: 6px; background: #000; color: #fff; overflow: hidden;
  display: flex; flex-direction: column; font-family: var(--mono); text-transform: uppercase;
}
.display-finto::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .035) 0 1px, transparent 1px 3px);
}
.df-testa { background: #fff; color: #000; font-weight: 800; font-size: 12.5px; letter-spacing: .12em; padding: 5px 10px 4px; }
.df-righe { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 12px; }
.df-riga { font-weight: 800; font-size: 25px; line-height: 1.12; letter-spacing: .02em; white-space: nowrap; overflow: hidden; }
.df-piede { font-size: 10.5px; letter-spacing: .14em; color: #aaa; padding: 0 12px 8px; }

.fatto-grande { text-align: center; padding: 26px 8px 18px; }
.cerchio-ok {
  width: 88px; height: 88px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center;
  background: linear-gradient(155deg, var(--acc2), var(--acc)); box-shadow: 0 16px 32px -14px var(--acc);
  animation: pop .6s var(--molla-viva) both;
}
.cerchio-ok .ic { width: 42px; height: 42px; color: #fff; stroke-width: 2.8; stroke-dasharray: 30; stroke-dashoffset: 30; animation: disegna .45s .25s ease-out forwards; }
.fatto-grande h2 { font: 700 26px/1.15 var(--font-titolo); letter-spacing: -.03em; margin: 0 0 6px; }
.fatto-grande p { margin: 0 auto; max-width: 300px; color: var(--sub); }

/* ------------------------------------------------------------ palinsesto */
.giorni { display: flex; gap: 6px; overflow-x: auto; margin: 6px -16px 0; padding: 6px 16px 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
.giorni::-webkit-scrollbar { display: none; }
.giorno {
  flex: none; width: 48px; height: 72px; border: 0; border-radius: 17px; background: none; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; scroll-snap-align: start;
  position: relative; transition: transform .35s var(--molla);
}
.giorno::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transform: scale(.6);
  background: linear-gradient(160deg, var(--acc2), var(--acc)); box-shadow: 0 10px 20px -10px var(--acc);
  transition: opacity .2s, transform .45s var(--molla-viva);
}
.giorno { isolation: isolate; }
.giorno:active { transform: scale(.92); }
.giorno small { font-size: 11px; font-weight: 600; color: var(--sub); text-transform: uppercase; letter-spacing: .03em; transition: color .2s; }
.giorno b { font: 600 21px/1.1 var(--font-titolo); font-variant-numeric: tabular-nums; transition: color .2s; }
.giorno.oggi b { color: var(--acc-testo); }
.giorno[aria-selected="true"]::before { opacity: 1; transform: none; }
.giorno[aria-selected="true"] small { color: rgba(255, 255, 255, .82); }
.giorno[aria-selected="true"] b { color: #fff; }
.puntini { display: flex; gap: 3px; height: 5px; margin-top: 2px; }
.puntini i { width: 5px; height: 5px; border-radius: 50%; background: var(--c); }
.giorno[aria-selected="true"] .puntini i { background: #fff; }
.giorno-titolo { font-size: 15px; font-weight: 600; color: var(--sub); margin: 14px 4px 12px; }
.giorno-titolo b { color: var(--txt); }
.linea { position: relative; }
.ev { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; margin-bottom: 10px; }
.ev-ora { padding-top: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.ev-ora b { display: block; font-size: 16px; font-weight: 650; }
.ev-ora small { font-size: 12px; color: var(--sub); }
.ev.passato .ev-ora, .ev.passato .ev-carta > * { opacity: .55; }
.scorrevole { position: relative; border-radius: 18px; overflow: hidden; box-shadow: var(--ombra); transition: height .35s ease, opacity .3s, margin .35s; }
.dietro {
  position: absolute; top: 0; right: 0; bottom: 0; width: 100px; border: 0; padding: 0 0 0 12px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: var(--rosso); color: #fff; font-size: 13px; font-weight: 600;
}
.dietro .ic { width: 22px; height: 22px; }
.ev-carta {
  --c: var(--acc); position: relative; display: block; width: 100%; text-align: left; border: 0; margin: 0;
  padding: 13px 14px 13px 19px; border-radius: 18px; touch-action: pan-y; color: inherit;
  background: var(--card);
  background: linear-gradient(100deg, color-mix(in srgb, var(--c) 9%, var(--card)), var(--card) 55%);
  transition: transform .4s var(--molla);
}
.ev-carta::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 4.5px; border-radius: 0 4px 4px 0; background: var(--c); }
.ev-carta:active { filter: brightness(.97); }
.ev-titolo { font: 650 17px/1.25 var(--font-titolo); letter-spacing: -.015em; overflow-wrap: anywhere; }
.ev-meta { display: flex; align-items: center; gap: 7px; font-size: 14px; color: var(--sub); margin: 5px 0 9px; flex-wrap: wrap; }
.ev-meta .tessera { --d: 20px; }
.ev-meta .ic { width: 14px; height: 14px; }
.ev-esito { display: flex; gap: 7px; align-items: flex-start; margin-top: 9px; font-size: 13.5px; line-height: 1.35; }
.ev-esito .ic { width: 16px; height: 16px; margin-top: 1px; }
.ev-esito.eseguito { color: var(--acc-testo); }
.ev-esito.saltato { color: var(--ambra); }
.ev-esito.fallito { color: var(--rosso); }
.adesso { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; align-items: center; margin: 0 0 10px; }
.adesso b { color: var(--rosso); font-size: 12px; font-weight: 750; text-align: right; font-variant-numeric: tabular-nums; }
.adesso i { position: relative; height: 2px; border-radius: 2px; background: var(--rosso); }
.adesso i::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--rosso); }
.vuoto-giorno { text-align: center; padding: 34px 20px 30px; }
.bolla {
  width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 14px; display: grid; place-items: center;
  background: var(--acc-tenue); color: var(--acc-testo);
}
.bolla .ic { width: 30px; height: 30px; }
.bolla.rossa { background: var(--rosso-tenue); color: var(--rosso); }
.vuoto-giorno h3 { font: 650 19px/1.2 var(--font-titolo); margin: 0 0 6px; }
.vuoto-giorno p { margin: 0 auto 18px; color: var(--sub); font-size: 15px; max-width: 280px; }

/* le opzioni del modo: due carte da scegliere */
.opzioni-modo { display: grid; gap: 10px; }
.opzione-modo {
  display: flex; gap: 13px; align-items: flex-start; padding: 14px 14px 14px 14px; border-radius: 16px; cursor: pointer;
  background: var(--card); box-shadow: inset 0 0 0 1.5px transparent, var(--ombra); transition: box-shadow .25s, transform .3s var(--molla);
}
.opzione-modo:active { transform: scale(.985); }
.opzione-modo input { position: absolute; opacity: 0; pointer-events: none; }
.opzione-modo .ic-tondo { width: 40px; height: 40px; border-radius: 12px; }
.opzione-modo .ic-tondo .ic { width: 22px; height: 22px; }
.opzione-modo .corpo { flex: 1; min-width: 0; }
.opzione-modo .t1 { font-weight: 600; }
.opzione-modo .t2 { font-size: 14px; line-height: 1.35; }
.opzione-modo .spunta {
  width: 24px; height: 24px; border-radius: 50%; flex: none; margin-top: 8px; box-shadow: inset 0 0 0 2px var(--dim);
  display: grid; place-items: center; transition: background .2s, box-shadow .2s;
}
.opzione-modo .spunta .ic { width: 14px; height: 14px; color: #fff; stroke-width: 3.2; transform: scale(0); transition: transform .35s var(--molla-viva); }
.opzione-modo:has(input:checked) { box-shadow: inset 0 0 0 2px var(--acc2), var(--ombra); }
.opzione-modo:has(input:checked) .spunta { background: var(--acc2); box-shadow: none; }
.opzione-modo:has(input:checked) .spunta .ic { transform: none; }
.opzione-modo:has(input:focus-visible) { outline: 2.5px solid var(--acc2); outline-offset: 2px; }
.riga-quando { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; padding: 7px 12px 7px 16px; position: relative; }
.riga-quando + .riga-quando::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: .5px solid var(--sep); }
.cosa-vuota { color: var(--acc-testo); font-weight: 500; }

/* ------------------------------------------------------------ attivita' */
.cifre { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.cifra-carta { background: var(--card); border-radius: 18px; padding: 14px 14px 12px; box-shadow: var(--ombra); }
.cifra-carta b { display: block; font: 700 28px/1.05 var(--font-titolo); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cifra-carta b small { font-size: 16px; color: var(--sub); font-weight: 600; letter-spacing: 0; }
.cifra-carta span { display: block; font-size: 13px; color: var(--sub); margin-top: 4px; line-height: 1.25; }
.cifra-carta.verde b { color: var(--acc-testo); }
.storia { margin-top: 4px; }
.fatto-voce { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 14px; }
.fatto-voce::before { content: ""; position: absolute; left: 21px; top: 50px; bottom: 4px; width: 2px; border-radius: 2px; background: var(--sep); }
.fatto-voce:last-child::before { display: none; }
.fatto-av { position: relative; height: 44px; }
.fatto-av .avatar { --d: 44px; }
.fatto-bollo {
  position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; background: var(--acc2); box-shadow: 0 0 0 2.5px var(--bg);
}
.fatto-bollo .ic { width: 12px; height: 12px; stroke-width: 3.2; }
.fatto-bollo.male { background: var(--rosso); }
.fatto-carta { background: var(--card); border-radius: 18px; padding: 12px 14px 13px; box-shadow: var(--ombra); min-width: 0; }
.fatto-cima { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.fatto-cima b { font-weight: 650; font-size: 16px; }
.fatto-cosa { font-size: 15px; margin-top: 3px; overflow-wrap: anywhere; }
.fatto-esito { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; margin-top: 6px; line-height: 1.35; }
.fatto-esito .ic { width: 16px; height: 16px; margin-top: 1px; }

/* ------------------------------------------------------------ profili (admin) */
.richiesta { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 20px; background: var(--card); box-shadow: var(--ombra-alta); }
.richiesta + .richiesta { margin-top: 10px; }
.richiesta .corpo { flex: 1; min-width: 0; }
.richiesta .t1 { font-weight: 650; }
.richiesta-bottoni { display: flex; gap: 8px; margin-top: 12px; }
.richiesta-bottoni .btn { min-height: 44px; padding: 8px 14px; font-size: 15px; border-radius: 12px; flex: 1; }
.ruolo { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--acc-testo); }

/* ------------------------------------------------------------ chi usa il tasto */
.profili { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: calc(var(--su) + 56px) 20px calc(var(--giu) + 28px); }
.profili::before {
  content: ""; position: absolute; left: -16px; right: -16px; top: 0; height: 560px; pointer-events: none; z-index: 0;
  background: radial-gradient(60% 50% at 50% 18%, rgba(69, 165, 108, .2), transparent 72%);
}
.profili > * { position: relative; }
/* il marchio e' l'icona della Home (3/10/2026): la stessa, a 72 px, con gli angoli di iOS */
.marchio {
  width: 72px; height: 72px; border-radius: 17px; display: block;
  box-shadow: 0 0 0 .5px rgba(0, 0, 0, .08), 0 14px 28px -12px rgba(40, 35, 20, .45);
  animation: appare .7s var(--molla-viva) both;
}
.profili h1 { font: 700 31px/1.12 var(--font-titolo); letter-spacing: -.035em; margin: 22px 0 6px; }
.profili .sotto { color: var(--sub); margin: 0 0 36px; font-size: 16px; }
.griglia-profili { display: grid; grid-template-columns: repeat(2, 132px); gap: 26px 30px; justify-content: center; }
.profilo {
  border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 10px;
  min-width: 0; color: var(--txt); transition: transform .4s var(--molla);
}
.profilo:active { transform: scale(.93); }
.profilo .avatar { --d: 100px; font-size: 38px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 18px 30px -16px var(--c); transition: box-shadow .3s; }
.profilo .nome { font-size: 16px; font-weight: 600; max-width: 132px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profilo .etichetta { margin-top: -4px; font-size: 12px; padding: 3px 9px 3px 7px; }
.profilo.tu .avatar { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5.5px var(--acc2), 0 18px 30px -16px var(--c); }
.profilo-nuovo .avatar { background: var(--riempi); color: var(--sub); box-shadow: inset 0 0 0 2px var(--dim); }
.profilo-nuovo .avatar .ic { width: 38%; height: 38%; }
.profili-piede { margin-top: auto; padding-top: 40px; font-size: 14px; color: var(--sub); display: grid; gap: 8px; justify-items: center; }

/* il profilo in attesa, e il servizio che non risponde */
.attesa, .schermo-centro { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: calc(var(--su) + 32px) 24px calc(var(--giu) + 32px); }
.onde { position: relative; width: 220px; height: 220px; display: grid; place-items: center; margin-bottom: 18px; }
.onde i { position: absolute; inset: 54px; border-radius: 50%; border: 1.5px solid var(--acc2); opacity: 0; animation: onda 3.6s cubic-bezier(.2, .6, .3, 1) infinite; }
.onde i:nth-child(2) { animation-delay: 1.2s; }
.onde i:nth-child(3) { animation-delay: 2.4s; }
.onde .avatar { --d: 112px; font-size: 42px; position: relative; animation: appare .7s var(--molla-viva) both; }
.onde .orologio {
  position: absolute; left: calc(50% + 26px); top: calc(50% + 26px); width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; background: var(--ambra-vivo); color: #fff; box-shadow: 0 0 0 4px var(--bg);
  animation: appare .6s .3s var(--molla-viva) both;
}
.onde .orologio .ic { width: 22px; height: 22px; stroke-width: 2.4; }
.onde .orologio .lancetta { transform-origin: 12px 12px; animation: gira 6s linear infinite; }
.attesa h1, .schermo-centro h1 { font: 700 30px/1.15 var(--font-titolo); letter-spacing: -.035em; margin: 0 0 10px; }
.attesa p, .schermo-centro p { color: var(--sub); max-width: 320px; margin: 0 auto; font-size: 16px; line-height: 1.45; }
.attesa .stato-pillola { margin: 22px 0 30px; }
.stato-pillola {
  display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 99px;
  background: var(--card); box-shadow: var(--ombra); font-size: 15px; font-weight: 600; color: var(--ambra);
}
.puntini-attesa { display: inline-flex; gap: 4px; }
.puntini-attesa i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: puntino 1.4s ease-in-out infinite; }
.puntini-attesa i:nth-child(2) { animation-delay: .18s; }
.puntini-attesa i:nth-child(3) { animation-delay: .36s; }
.attesa .btn, .schermo-centro .btn { max-width: 260px; }
.schermo-centro .bolla { width: 76px; height: 76px; border-radius: 24px; margin-bottom: 22px; animation: appare .6s var(--molla-viva) both; }
.schermo-centro .bolla .ic { width: 36px; height: 36px; }
.schermo-centro .btn { margin-top: 26px; }
.schermo-centro .nota { margin-top: 14px; }
.cifra { display: inline-block; font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------ fogli dal basso */
.velo { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .34); opacity: 0; transition: opacity .35s; }
.velo.su { opacity: 1; }
.foglio {
  --card: var(--foglio-card);
  position: fixed; z-index: 51; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto;
  max-height: calc(100% - var(--su) - 14px); display: flex; flex-direction: column;
  background: var(--foglio); border-radius: 16px 16px 0 0; padding-bottom: var(--giu);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .18); transform: translateY(105%);
  transition: transform .55s var(--molla), filter .3s; will-change: transform;
}
.foglio.su { transform: none; }
.foglio.alto { height: calc(100% - var(--su) - 14px); }
.foglio.dietro { transform: translateY(-8px) scale(.94); filter: brightness(.9); }
.maniglia { flex: none; width: 38px; height: 5px; border-radius: 3px; background: var(--dim); margin: 7px auto 0; }
.foglio-testa { flex: none; display: grid; grid-template-columns: 1fr minmax(0, auto) 1fr; align-items: center; min-height: 50px; padding: 0 12px; touch-action: none; }
.foglio-testa h2 { grid-column: 2; margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.foglio-sx { justify-self: start; }
.tondo {
  justify-self: end; width: 30px; height: 30px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  background: var(--riempi); color: var(--sub); position: relative; transition: transform .3s var(--molla);
}
.tondo::after { content: ""; position: absolute; inset: -7px; }
.tondo:active { transform: scale(.88); }
.tondo .ic { width: 15px; height: 15px; stroke-width: 3; }
.foglio-corpo { flex: 1; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 16px 24px; position: relative; }
.foglio .etich:first-child { margin-top: 6px; }
.foglio-saluto { text-align: center; padding: 4px 0 6px; }
.foglio-saluto .avatar { margin: 0 auto 14px; animation: appare .55s .1s var(--molla-viva) both; }
.foglio-saluto h3 { font: 700 24px/1.2 var(--font-titolo); letter-spacing: -.03em; margin: 0 0 6px; }
.foglio-saluto p { margin: 0 auto; color: var(--sub); font-size: 15px; max-width: 300px; }
.entra-destra { animation: da-destra .45s var(--molla) both; }
.entra-sinistra { animation: da-sinistra .45s var(--molla) both; }

/* la pagina dietro il foglio arretra, come su iPhone */
html.foglio-aperto, html.foglio-chiude { background: #000; }
html.foglio-aperto body, html.foglio-chiude body { background: #000; }
html.foglio-aperto #app, html.foglio-chiude #app {
  position: fixed; left: 0; right: 0; transform-origin: 50% calc(var(--y, 0px) + 50vh);
  clip-path: inset(var(--y, 0px) 0 0 0 round 14px);
  transition: transform .55s var(--molla), filter .4s;
}
html.foglio-aperto #app { transform: scale(.92); filter: brightness(.86); }
#app { transition: transform .5s var(--molla); }
html.foglio-aperto .barra-su, html.foglio-aperto .schede, html.foglio-aperto .banda { opacity: 0; pointer-events: none; }

/* il foglio delle domande (si/annulla), come l'action sheet di iOS */
.azioni {
  position: fixed; z-index: 61; left: 8px; right: 8px; bottom: calc(var(--giu) + 8px); max-width: 520px; margin: 0 auto;
  display: grid; gap: 8px; transform: translateY(120%); transition: transform .5s var(--molla);
}
.azioni.su { transform: none; }
.azioni-gruppo { border-radius: 14px; overflow: hidden; background: var(--vetro); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); }
.azioni-gruppo, .azioni .annulla { background-color: color-mix(in srgb, var(--card) 88%, transparent); }
.azioni-testa { padding: 14px 18px 13px; text-align: center; font-size: 13px; color: var(--sub); display: grid; gap: 4px; }
.azioni-testa b { font-size: 13px; font-weight: 600; color: var(--sub); }
.azioni-btn { width: 100%; min-height: 57px; border: 0; border-top: .5px solid var(--sep); background: none; font-size: 20px; color: var(--acc-testo); }
.azioni-btn:active { background: var(--riempi); }
.azioni-btn.pericolo { color: var(--rosso); }
.azioni .annulla { border: 0; border-radius: 14px; font-weight: 600; background: var(--card); }
.velo.alto { z-index: 60; }

/* l'isola: l'avviso che scende dall'alto */
#avvisi { position: fixed; z-index: 80; top: calc(var(--su) + 8px); left: 0; right: 0; display: flex; justify-content: center; pointer-events: none; padding: 0 16px; }
.isola {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 10px 18px 10px 10px; border-radius: 24px; background: #111110; color: #fff; font-size: 15px; font-weight: 600; line-height: 1.3;
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .55), inset 0 0 0 .5px rgba(255, 255, 255, .08);
  animation: isola .6s var(--molla-viva) both; transform-origin: 50% 0;
}
.isola.via { animation: isola-via .35s ease-in both; }
.isola-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; background: rgba(255, 255, 255, .14); }
.isola-ic .ic { width: 16px; height: 16px; stroke-width: 2.8; }
.isola.ok .isola-ic { background: #3f9e66; }
.isola.errore .isola-ic { background: #d9443a; }

/* ------------------------------------------------------------ caricamento */
.osso { position: relative; overflow: hidden; background: var(--riempi); border-radius: 8px; }
.osso::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent); animation: luccica 1.5s ease-in-out infinite;
}
@media (prefers-color-scheme: dark) { .osso::after { background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .06), transparent); } }
.riga-osso { display: flex; gap: 12px; align-items: center; padding: 12px 16px; }
.riga-osso + .riga-osso { border-top: .5px solid var(--sep); }

/* ------------------------------------------------------------ animazioni */
.cascata > * { animation: sale .55s var(--molla) both; animation-delay: calc(min(var(--i, 0), 12) * 38ms); }
.entra { animation: sale .45s var(--molla) both; }
.scuoti { animation: scuoti .42s ease; }
.cambia { animation: cambia .38s var(--molla) both; }
@keyframes cambia { from { opacity: 0; transform: translateY(6px); filter: blur(2px); } }
@keyframes sale { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes appare { from { opacity: 0; transform: scale(.5); } }
@keyframes pop { 0% { opacity: 0; transform: scale(.3); } }
@keyframes cala { from { opacity: 0; transform: translate(-50%, -16px) scale(.9); } }
@keyframes salta { 0% { transform: scale(1); } 30% { transform: scale(.8); } 100% { transform: scale(1); } }
@keyframes scuoti { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(2px); } }
@keyframes gira { to { transform: rotate(360deg); } }
@keyframes respira { 0%, 100% { transform: scale(1); } 50% { transform: scale(.965); } }
@keyframes rimbalza { 0% { transform: scale(.9); } 100% { transform: scale(1); } }
@keyframes alone { 0% { box-shadow: 0 0 0 0 rgba(69, 165, 108, .45); } 100% { box-shadow: 0 0 0 26px rgba(69, 165, 108, 0); } }
@keyframes pulsa { 0% { box-shadow: 0 0 0 0 rgba(201, 52, 44, .5); } 100% { box-shadow: 0 0 0 9px rgba(201, 52, 44, 0); } }
@keyframes pulsa-verde { 0% { box-shadow: 0 0 0 0 rgba(69, 165, 108, .55); } 70%, 100% { box-shadow: 0 0 0 8px rgba(69, 165, 108, 0); } }
@keyframes lampeggia { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes batte { 0%, 100% { box-shadow: inset 0 0 0 4px var(--acc2), 0 0 0 0 rgba(69, 165, 108, .4); } 50% { box-shadow: inset 0 0 0 4px var(--acc2), 0 0 0 6px rgba(69, 165, 108, 0); } }
@keyframes disegna { to { stroke-dashoffset: 0; } }
@keyframes onda { 0% { transform: scale(.85); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }
@keyframes puntino { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@keyframes luccica { to { transform: translateX(100%); } }
@keyframes isola { from { opacity: 0; transform: translateY(-24px) scale(.4, .6); } }
@keyframes isola-via { to { opacity: 0; transform: translateY(-20px) scale(.6, .7); } }
@keyframes da-destra { from { opacity: 0; transform: translateX(36px); } }
@keyframes da-sinistra { from { opacity: 0; transform: translateX(-36px); } }

/* il passaggio fra le schermate (View Transitions; senza, c'e' .entra) */
.barra-su { view-transition-name: barra; }
.schede { view-transition-name: schede; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .34s; animation-timing-function: cubic-bezier(.25, .8, .25, 1); }
::view-transition-old(root) { animation-name: vt-esce; }
::view-transition-new(root) { animation-name: vt-entra; }
html[data-dir="avanti"]::view-transition-old(root) { animation-name: vt-esce-sx; }
html[data-dir="avanti"]::view-transition-new(root) { animation-name: vt-entra-dx; }
html[data-dir="indietro"]::view-transition-old(root) { animation-name: vt-esce-dx; }
html[data-dir="indietro"]::view-transition-new(root) { animation-name: vt-entra-sx; }
@keyframes vt-esce { to { opacity: 0; transform: scale(.985); } }
@keyframes vt-entra { from { opacity: 0; transform: translateY(10px); } }
@keyframes vt-esce-sx { to { opacity: 0; transform: translateX(-22%); } }
@keyframes vt-entra-dx { from { transform: translateX(100%); } }
@keyframes vt-esce-dx { to { opacity: 0; transform: translateX(30%); } }
@keyframes vt-entra-sx { from { opacity: 0; transform: translateX(-22%); } }

/* chi ha chiesto meno movimento: niente molle ne' cascate, restano solo le dissolvenze */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .onde i { animation: none !important; opacity: .28; }
  .onde i:nth-child(1) { transform: scale(1.15); }
  .onde i:nth-child(2) { transform: scale(1.4); opacity: .18; }
  .onde i:nth-child(3) { transform: scale(1.65); opacity: .1; }
  [data-stato="attesa"] .arco, [data-stato="ricevuto"] .arco { animation: none !important; }
  .cerchio-ok .ic { stroke-dashoffset: 0; }
  html.foglio-aperto #app { transform: none; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

@media (min-width: 600px) {
  .grande h1 { font-size: 38px; }
}
