/* Binnellometro — stile "Aurora" (rifatto sul modello delle app di banca curate: un numero protagonista, tanto respiro,
   azioni tonde, elenchi come movimenti; niente marchi né colori altrui).

   SPECIFICA (ogni regola nuova la segue; i valori stanno nei token qui sotto)
   Font      Albert Sans variabile (grottesca geometrica, la più vicina al font della banca, che è a pagamento), ospitato in
             /fonts/albert-sans.woff2 (latino, ~32 KB, OFL in /fonts/OFL.txt). Uno solo per testo e numeri.
   Tipi      gradino      misura / interlinea / peso      dove
             --fs-hero    46 / 1.0  / 700   il numero protagonista (52 nell'anello di Oggi), tracking -0.02em
             --fs-title   28 / 1.05 / 700   titolo della pagina, numeri grandi dei fogli e dei riquadri
             --fs-big     21 / 1.2  / 600   numeri a destra delle righe della roba
             --fs-h2      17 / 1.2  / 650   titoli delle card e dei fogli, valori quieti sotto il numero
             --fs-body    15 / 1.45 / 400   testo
             --fs-ui      14 / 1.3  / 600   pulsanti, segmenti, chip
             --fs-cap     13 / 1.35 / 500   testo secondario, didascalie, nomi sotto le azioni tonde
             --fs-micro   11 / 1.2  / 500   nomi della barra in basso, assi dei grafici
             Pochi pesi: 400 testo, 500 secondario, 600 pulsanti e valori, 650–700 titoli e numeri grandi. Tracking:
             titoli e numeri grandi -0.02em, numeri -0.01em, il resto 0; interlinea compatta nei titoli (1.05–1.2). Niente maiuscolo spaziato. Gerarchia netta: un solo numero grande per pagina.
   Numeri    grandi: cifre proporzionali, decimali al 62% (.dec) e unità al 52% più quiete (.unit), li mette bigNumerals();
             in colonna (tabelle, orari, valori a destra delle righe): cifre tabellari (.tnum).
   Pagina    Oggi: in alto, senza card, il numero della settimana nell'anello, centrato, col pallino dello stato e una riga
             quieta sotto; poi una riga di quattro azioni tonde (cerchio 56 px, icona 24, nome sotto: Canna, Tiro, Voto,
             Pausa; la quantità della canna col tocco lungo o «Quanta?» nell'avviso); poi al massimo una o due card
             (la roba, i suggerimenti chiudibili) e le ultime sessioni come movimenti (tondo a sinistra, titolo e
             data, valore a destra; «Tutto il diario» centrato in fondo alla card). La roba è un carosello di card
             (.roba-track: scorre di lato, la pagina no). Le altre pagine: stesso linguaggio, card di vetro scuro senza
             bordo evidente (--card), elenchi a righe da 56 px. Voto e Pausa sono tondi di vetro, Canna e Tiro del loro colore.
   Spazi     griglia di 4 px: 4, 8, 12, 16, 20, 24, 32. Card: 16 dentro, 12 fra una e l'altra; 24 sopra i blocchi nuovi.
   Raggi     tre: --radius 24 (card, fogli), --r-md 16 (blocchi dentro le card, campi, avvisi), 999 (capsule, tondi).
             Sotto i 6 px solo per dettagli (barre, quadratini).
   Profondità tre livelli: --depth-1 card, --depth-2 cose che galleggiano (barra, avvisi), --depth-3 fogli e finestre.
             Bordi a filo (--hair: 0,5 px sugli schermi densi).
   Fondo     scuro e pulito (#0b0a14), di giorno chiaro (#eef0fb). Dietro tutta la pagina il nastro della scheda
             (.aura, quarto giro in fondo): un livello fisso con un nastro lucido in 3D in cima e uno più quieto che
             scende fino in fondo, viola Oggi, verde Andamento, blu Insieme, rosa Pet; WebP opache disegnate da
             tools/make-aura.cjs (1560×3840, 31–61 KB l'una, -dark e -light) con la trama del dithering sopra. Il WebGL
             anima le superfici e i riflessi a 60 fps, la riserva statica sale solo mentre scorri; fermo con «riduci movimento». Un velo (--aura-scrim) lo quieta
             dietro il numero protagonista: i testi sopra il nastro restano ≥ 4,5:1 (lo misura qa/contrasto.cjs nel giro).
             Niente grana, niente altre luci.
   Intestaz. una barra in cima alla pagina che scorre via col contenuto: le iniziali tonde (impostazioni) a sinistra,
             una capsula di vetro col giorno o la sezione in piccolo e il nome della pagina, un tondo di vetro a destra
             che apre il Diario, uguale in ogni scheda; tondi e capsule 44 px, --glass-btn. Sotto
             l'orologio la striscia fissa body::before.
   Colori    sobri: --ink testo, --ink-2 secondario, --muted didascalie (≥ 4,5:1 su vetro), --accent riempimenti viola,
             --accent-text testo viola, --s1/--s2 canne/tiri (anche le azioni tonde Canna e Tiro).
   Neon      solo al buio e sobrio: un alone morbido del suo colore su anello e numero di Oggi, sulle azioni tonde Canna e
             Tiro, sul pallino dello stato e sul bordo delle card importanti (.card.neon:
             voto in sospeso, pausa, resoconto del mese). Mai su testo, chip, grafici normali o pulsanti piccoli.
   Barra     una capsula di vetro sfocato (--bar-glass) che galleggia 8 px sopra lo spazio sicuro in basso (--sab), con dietro una
             sfumatura fissa del fondo (html::before) così quello che scorre sparisce piano. Tutte le schede con l'icona
             e il nome piccolo sempre visibile; la scelta è una pastiglia piena (--tab-on) che contiene icona e nome,
             uguale per tutte, senza alone né colore. I segmenti di Andamento: vaschetta piena e quieta, la scelta in rilievo leggero, niente ombre.
   Sezioni   Andamento e Insieme: in cima, senza card, UN numero protagonista centrato (.sec-hero > .fig: .fig-k cosa,
             .fig-v 56 px, .fig-s una riga quieta) e al massimo una pastiglia di stato (.pill ok/warn). Card corte: titolo,
             un numero (.fig, 28 px) o una frase quieta (.answer), grafico senza assi (bare), e in fondo sulla stessa riga
             «Vedi i numeri» e «Come si legge» (.q-foot, details.info: i testi lunghi stanno lì). Le righe che aprono i fogli
             in un solo gruppo con i separatori sottili (.more-list); i valori come righe (.rows: tondo, titolo, grigio, valore).
   Elenchi   come movimenti in tutte le pagine (Oggi, Diario): tondo colorato a sinistra (canna/tiro), cosa e voto in
             mezzo, valore o ora a destra in piccolo; i giorni sono intestazioni piccole fuori dalle card. Le parti che si
             aprono (details) hanno una freccina a destra, mai il triangolo.
   Icone     icons.js, a tratto (viewBox 24, tratto 1.9, niente riempimenti): 20 px nel testo e nelle righe, 22 nella
             barra, 24 nelle azioni tonde; i gradini sono levelIcon(), le facce vibeIcon(), le conchiglie SHELL.
   Emoji     quasi mai: niente emoji in pulsanti, titoli, chip, fumetti del pet, avvisi (toast() le toglie da sé) e
             notifiche. Restano solo dove sono contenuto: le reazioni fra amici, il mondo e gli oggetti del pet e dell'isola.
   Movimento curve: solo --ease-out (niente molle: --spring vale lo stesso). Cambio di pagina: dissolvenza di 160 ms con
             6 px di salita (main.enter), niente ingressi di lato né cascate. Tocco: scala 0.97 su :active, subito.
             Tutto fermo con prefers-reduced-motion.
   Tocchi    almeno 44 px di altezza per ogni cosa che si tocca. */
:root {
  color-scheme: light;
  --bg: #eef0fb;
  /* il vetro delle card (traslucido sopra le luci) e la superficie piena dei fogli e dei menu */
  --card: rgba(255, 255, 255, 0.64);
  --surface: #fafaff;
  --glass-edge: rgba(255, 255, 255, 0.92);
  --glass-strong: rgba(255, 255, 255, 0.8);
  --inset: rgba(40, 40, 110, 0.065);   /* vaschette dentro le card: segmenti, riquadri, campi */
  --ink: #121230;
  --ink-2: #3c3c64;
  --muted: #5b5b84;
  --line: rgba(40, 40, 110, 0.12);
  --accent: #6a3fe0;       /* riempimenti: pulsanti, barre */
  --accent-text: #5730cf;  /* testo e icone in viola */
  --accent-ink: #ffffff;
  --accent-soft: rgba(106, 63, 224, 0.12);
  --neon-g: #0e9a5b;       /* accenti: canne, "sotto il limite" */
  --neon-v: #6a3fe0;       /* accenti: tiri, viola */
  --glow: 0;               /* quanto brillano linee e anelli (al buio 1) */
  --sage: #74c486;
  --canna-btn: linear-gradient(165deg, #17a566, #0e8350);
  --tiro-btn: linear-gradient(165deg, #7650ec, #5b33d6);
  --danger: #c4284e;
  --warn: #a35c00;
  --press: rgba(18, 18, 48, 0.06);
  /* luci sfocate dietro a tutto */
  --orb1: rgba(150, 128, 255, 0.22);
  --shadow: var(--depth-1);
  --shadow-float: var(--depth-2);
  --edge: inset 0 0 0 1px var(--glass-edge);
  --glass: var(--glass-strong);
  /* grafici: palette validata (skill dataviz) su #f4f5fc in chiaro e #141327 al buio; canne/tiri e tu/amica sono coppie separate */
  --s1: #2e9b57;  /* canne */
  --s2: #7b55e0;  /* tiri */
  --p1: #2a78d6;  /* tu */
  --p2: #eb6834;  /* l'amica */
  --f1: #6250d6;  /* sonno e umore: dopo i giorni con */
  --f2: #16946a;  /* … e dopo quelli senza (coppia validata a parte) */
  --grid: rgba(40, 40, 110, 0.09);
  --axis: rgba(40, 40, 110, 0.2);
  --tick: #5b5b84;
  --hover: rgba(18, 18, 48, 0.05);
  --h0: rgba(40, 40, 110, 0.07); --h1: #b6a0f6; --h2: #977bef; --h3: #7a58e3; --h4: #5f3dcd; --h5: #3f2293;
  --warn-soft: #fff0d8;
  --warn-text: #8a4e00;
  /* momenti della giornata */
  --m1: #eda100; --m2: #e87ba4; --m3: #6250d6; --m4: #1baf7a;
  /* gradini del voto: una barra che va dal verde al rosa passando per l'azzurro e il viola */
  --sky-x: linear-gradient(90deg, #36d08a, #43b6f0 30%, #7f62f5 55%, #c25cf2 78%, #f0558f);
  /* grafici illustrati (vivid.js): cielo, orologio, pianta */
  --sky-a: #ece7fe; --sky-b: #f8f7ff; --sky-free: #a07400;
  --leaf-on: #5cb874; --leaf-ink: #2f7a48; --leaf-off: #ddd3c4; --leaf-off-ink: #b4a690; --pot: #d98a62; --pot-rim: #c27650; --stem: #4f9a63;
  --radius: 24px;
  --r-md: 16px;
  --r-sm: 16px;      /* vecchio nome: uguale a --r-md */
  --fs-hero: 46px; --fs-title: 28px; --fs-big: 21px; --fs-h2: 17px; --fs-body: 15px; --fs-ui: 14px; --fs-cap: 13px; --fs-micro: 11px;
  --hair: 1px;
  --depth-1: 0 1px 2px rgba(30, 30, 90, 0.05), 0 6px 20px -10px rgba(30, 30, 100, 0.16);
  --depth-2: 0 1px 2px rgba(30, 25, 90, 0.08), 0 4px 10px -4px rgba(30, 25, 100, 0.1), 0 18px 36px -16px rgba(30, 25, 100, 0.3);
  --depth-3: 0 -1px 0 var(--glass-edge), 0 -20px 50px -18px rgba(10, 5, 30, 0.35);
  --top-h: 66px;     /* intestazione che resta in alto */
  /* spazio sopra l'intestazione: un po' più della barra di stato, perché da iOS 26 il sistema sfuma e sfoca la
     striscia appena sotto l'orologio (la data finiva lì e usciva sfocata) */
  --top-safe: calc(env(safe-area-inset-top) * 1.4);
  --tabs-h: 64px;
  --tabs-w: 360px;   /* la barra a capsula */
  --tabs-gap: 14px;  /* la barra galleggia: distanza dal fondo */
  /* Albert Sans (scelto dall'utente fra Figtree, Albert Sans e Instrument Sans): ospitato da noi, così le prove vedono
     quello che vede il telefono */
  --font: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--font);
  /* curve: solo un'uscita morbida; niente molle che rimbalzano (--spring resta come nome e vale lo stesso) */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: var(--ease-out);
  font-family: var(--font);
}
/* bordi a filo sugli schermi densi (iPhone: 3x) */
@media (min-resolution: 2dppx) { :root { --hair: 0.5px; } }
@font-face {
  font-family: "Albert Sans"; src: url("/fonts/albert-sans.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0b0a14;
    --card: rgba(255, 255, 255, 0.058);
    --surface: #15132c;
    --glass-edge: rgba(255, 255, 255, 0.11);
    --glass-strong: rgba(24, 20, 52, 0.72);
    --inset: rgba(255, 255, 255, 0.065);
    --ink: #f2f0ff;
    --ink-2: #cbc6ee;
    --muted: #a19bcb;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #7d58f2;
    --accent-text: #bba3ff;
    --accent-soft: rgba(177, 140, 255, 0.16);
    --neon-g: #3dffa2;
    --neon-v: #b18cff;
    --glow: 1;
    --canna-btn: linear-gradient(165deg, rgba(61, 255, 162, 0.24), rgba(61, 255, 162, 0.08));
    --tiro-btn: linear-gradient(165deg, rgba(177, 140, 255, 0.28), rgba(177, 140, 255, 0.09));
    --danger: #ff7b9a;
    --warn: #f3b443;
    --press: rgba(255, 255, 255, 0.07);
    --orb1: rgba(110, 80, 240, 0.2);
    --depth-1: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 24px -14px rgba(0, 0, 0, 0.7);
    --depth-2: 0 1px 2px rgba(0, 0, 0, 0.4), 0 6px 14px -6px rgba(0, 0, 0, 0.5), 0 20px 44px -14px rgba(0, 0, 0, 0.8);
    --depth-3: 0 -1px 0 var(--glass-edge), 0 -20px 50px -16px rgba(0, 0, 0, 0.75);
    --s1: #34ab6a;
    --s2: #9a7cf2;
    --p1: #3987e5;
    --p2: #d95926;
    --f1: #9085e9;
    --f2: #199e70;
    --grid: rgba(255, 255, 255, 0.08);
    --axis: rgba(255, 255, 255, 0.18);
    --tick: #a19bcb;
    --hover: rgba(255, 255, 255, 0.07);
    --h0: rgba(255, 255, 255, 0.06); --h1: #5640b6; --h2: #7356de; --h3: #9476f7; --h4: #bba5ff; --h5: #ece4ff;
    --warn-soft: rgba(243, 180, 67, 0.14);
    --warn-text: #f5c060;
    --m1: #c98500; --m2: #d55181; --m3: #9085e9; --m4: #199e70;
    --sky-x: linear-gradient(90deg, #2fc77f, #2f9ee0 30%, #7a5cf0 55%, #b84ee6 78%, #e2467f);
    --sky-a: #120c2a; --sky-b: #251a48; --sky-free: #f4c542;
    --leaf-on: #5fc27b; --leaf-ink: #8be0a2; --leaf-off: #4a4058; --leaf-off-ink: #6c6080; --pot: #b8714f; --pot-rim: #9c5d40; --stem: #5fae74;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  color: var(--ink);
  font-size: var(--fs-body);
  line-height: 1.45;
  font-optical-sizing: auto; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  -webkit-tap-highlight-color: transparent;
}
/* niente barra di scorrimento grigia sul lato (sul telefono si scorre col dito) */
html { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; width: 0; height: 0; }
/* una sola luce ampia e morbida in alto, ferma mentre la pagina scorre (niente grana, niente altre luci) */
body::after {
  /* alto quanto lo schermo intero (100lvh), non quanto lo spazio calcolato: con la tastiera appena chiusa iOS lo
     accorcia e lo sfondo si tagliava a metà */
  content: ""; position: fixed; top: 0; left: 0; right: 0; height: max(100%, 100lvh); z-index: -1; pointer-events: none;
  background: radial-gradient(120vmax 70vmax at 50% -22%, var(--orb1), transparent 60%);
}
/* la pagina che entra di lato non fa mai scorrere di lato */
html, body { overflow-x: clip; }
body.noscroll { overflow: hidden; }
/* Striscia scura sotto la barra di stato (che nell'app installata ha il testo bianco); al buio è il colore del fondo
   che sfuma, così la pagina che ci scorre sotto sparisce piano */
body::before {
  content: ""; position: fixed; left: 0; right: 0; top: 0; z-index: 44; height: env(safe-area-inset-top);
  background: linear-gradient(90deg, #1a0f40, #07061a 50%, #0c2a3a); pointer-events: none;
}
/* al buio la striscia è alta poco più dell'orologio (1,3 volte lo spazio sicuro) e sfuma nel fondo: la pagina che
   scorre sotto sparisce piano, e in cima la barra (che parte da 1,4 volte) non ne viene coperta */
@media (prefers-color-scheme: dark) { body::before { height: calc(env(safe-area-inset-top) * 1.3); background: linear-gradient(var(--bg) 70%, transparent); } }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; }
h2 { font-size: var(--fs-h2); line-height: 1.2; font-weight: 650; margin: 0 0 4px; }
h3 { font-size: var(--fs-body); line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin: 20px 0 8px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
/* i numeri. Grandi (anello, card in alto, riquadri): cifre proporzionali, quasi senza tracking negativo, decimali
   e unità più piccoli (.dec al 62%, .unit al 52% e più quieta: li mette bigNumerals()). Cifre tabellari solo dove
   i numeri stanno in colonna (tabelle, orari, il valore a destra delle righe del diario). */
.num, .tile-value, .big-stat b, .stat-row b, .cart-pct, .st-big, .recap-row b, .ps b, .pause-day b,
.stepper b, .kv-v { font-family: var(--display); font-variant-numeric: proportional-nums lining-nums; letter-spacing: -0.01em; }
.versus td, .entry-time, .feed-eq, .tnum { font-family: var(--display); font-variant-numeric: tabular-nums lining-nums; letter-spacing: 0; }
.dec { font-size: 0.62em; font-weight: inherit; letter-spacing: 0; }
.unit { font-size: 0.52em; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.vivid .dec { font-size: 0.6em; }

/* --- struttura --- */
/* intestazione: in piccolo il giorno o la sezione, in grande il nome della pagina; vetro che resta in alto */
.top {
  /* resta in cima alla pagina e se ne va quando scorri: non ti segue */
  position: relative; z-index: 20;
  display: flex; align-items: center; gap: 8px; height: calc(var(--top-h) + var(--top-safe));
  padding: calc(8px + var(--top-safe)) max(18px, calc((100% - 524px) / 2)) 6px;
}
.top .brand { margin-right: auto; min-width: 0; }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand small { font-size: var(--fs-cap); font-weight: 500; letter-spacing: 0; color: var(--ink-2); white-space: nowrap; }
.brand h1 { margin: 0; font-size: var(--fs-title); line-height: 1.05; font-weight: 700; letter-spacing: -0.02em; white-space: nowrap; }
.top .icon { width: 44px; height: 44px; background: var(--card); box-shadow: inset 0 0 0 var(--hair) var(--glass-edge), var(--depth-1); }
.top .icon svg { width: 22px; height: 22px; }
main {
  max-width: 560px; margin: 0 auto;
  padding: 6px 16px calc(var(--tabs-h) + var(--tabs-gap) + var(--sab) + 28px);
}
/* la barra delle schede: una capsula di vetro che galleggia; la scheda scelta si allarga e mostra il nome */
.tabs {
  position: fixed; left: 50%; bottom: calc(var(--sab) + var(--tabs-gap)); z-index: 10;
  width: min(var(--tabs-w), calc(100% - 28px)); height: var(--tabs-h); transform: translateX(-50%);
  padding: 6px; display: flex; gap: 4px; contain: layout style;
  background: var(--glass-strong); border-radius: 999px; border: var(--hair) solid var(--glass-edge);
  backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7);
  box-shadow: var(--shadow-float);
}
.tabs::before { content: none; }
/* piena quanto basta perché sotto non si leggano le righe che scorrono */
.tabs { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
/* tutte le icone col nome piccolo sempre sotto; la scheda scelta è una pastiglia piena con icona e nome (vedi il terzo giro in fondo; niente
   che si allarghi o rimbalzi: cambia solo il colore, subito) */
.tabs button {
  flex: 1 1 0; position: relative; min-width: 0; height: 100%; border: 0; border-radius: 999px; padding: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: none; color: var(--muted); font-size: var(--fs-micro); font-weight: 500; letter-spacing: 0; line-height: 1.2;
}
.tabs button span { white-space: nowrap; }
.tabs svg {
  width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
  box-sizing: content-box; padding: 3px 16px; border-radius: 999px;
}
.tabs button:active svg { transform: scale(0.97); }
.tabs button[aria-current="page"] { color: var(--ink); font-weight: 600; }
.tabs button[aria-current="page"] svg { background: var(--accent-soft); color: var(--accent-text); }

/* le card sono vetro: traslucide sopra le luci, un filo di luce sul bordo */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--depth-1);
  border: var(--hair) solid var(--glass-edge); padding: 16px; margin: 12px 0;
}
.sub { color: var(--muted); font-size: var(--fs-cap); line-height: 1.35; margin: 0 0 12px; }

/* --- pulsanti --- */
.icon {
  width: 40px; height: 40px; border-radius: 50%; border: 0; background: none;
  display: inline-grid; place-items: center; font-size: 1rem; color: var(--ink-2); flex: none;
}
.icon svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.icon .ic { width: 20px; height: 20px; }
/* un'icona davanti a una frase, alta come il testo */
.ic.lv-ic, .ic.vb-ic, .ic.shell-ic, .entry-al .ic, .entry-with .ic, .share-q > span > .ic { width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: 0.3em; color: var(--accent-text); }
.ic.shell-ic { margin: 0 0.1em 0 0.25em; color: inherit; }
.feed-ic em .ic.lv-ic { width: 14px; height: 14px; margin: 0; color: var(--ink); }
.dose-ladder .ic.lv-ic { margin: 0; width: 20px; height: 20px; }
.ic.lead { width: 1.15em; height: 1.15em; vertical-align: -0.2em; margin-right: 0.35em; color: var(--accent-text); }
.warn-text .ic.lead { color: inherit; }
.chips-label .ic, .btn .ic { width: 18px; height: 18px; flex: none; }
.icon { transition: transform 0.15s var(--ease-out), background-color 0.2s; }
.icon:active { background: var(--press); transform: scale(0.97); transition-duration: 0.1s; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 0;
  background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-ui); font-weight: 600;
  transition: transform 0.15s var(--ease-out), filter 0.2s, background-color 0.2s;
}
/* si schiaccia sotto il dito e rimbalza quando lo lasci */
.btn:active { filter: brightness(0.95); transform: scale(0.97); transition-duration: 0.1s; }
.btn.primary { background: var(--ink); color: var(--bg); }
@media (prefers-color-scheme: dark) {
  .btn.primary { background: #ece6ff; color: #0b0820; }
}
.btn.ghost { background: none; color: var(--ink-2); }
.btn.danger { background: none; color: var(--danger); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: var(--fs-ui); }
.btn.wide { width: 100%; margin: 8px 0; }
.btn.round { width: 44px; padding: 0; border-radius: 50%; font-size: 1.3rem; }
.link {
  display: block; margin: 4px auto 0; padding: 10px; background: none; border: 0;
  color: var(--accent-text); font-size: var(--fs-ui); font-weight: 600; min-height: 44px;
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }

/* segmenti: una vaschetta con la scelta in rilievo */
.seg { display: flex; background: var(--inset); border-radius: 999px; padding: 4px; gap: 3px; margin: 8px 0; }
.seg button { transition: background-color 0.25s var(--ease-out), box-shadow 0.25s, transform 0.15s var(--ease-out); }
.seg button:active { transform: scale(0.97); }
.seg button {
  flex: 1; min-height: 36px; border: 0; border-radius: 999px; background: none;
  font-size: var(--fs-ui); font-weight: 600; color: var(--ink-2); padding: 4px 8px;
}
.seg button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(30, 20, 90, 0.1), 0 3px 8px -3px rgba(30, 20, 90, 0.16); }
@media (prefers-color-scheme: dark) { .seg button[aria-checked="true"] { background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 0 0 var(--hair) rgba(255, 255, 255, 0.2); } }
.seg.wide button { display: flex; flex-direction: column; line-height: 1.2; padding: 6px; border-radius: 16px; }
.seg.wide { border-radius: var(--r-md); }
.seg small { font-weight: 500; font-size: var(--fs-micro); color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; align-items: center; }
.chips-label { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-cap); color: var(--muted); margin-right: 2px; }
.alcohol { margin: 10px 0 0; }
.alcohol .seg { margin: 4px 0 0; }
.alcohol .seg button { font-size: 0.82rem; }
.chip {
  border: var(--hair) solid var(--line); background: var(--inset); border-radius: 999px;
  padding: 6px 14px; font-size: var(--fs-ui); min-height: 36px; font-weight: 500;
}
.chip { transition: transform 0.15s var(--ease-out), background-color 0.2s, border-color 0.2s, box-shadow 0.2s; }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); font-weight: 650; }
@media (prefers-color-scheme: dark) { .chip[aria-pressed="true"] { box-shadow: none; } }

/* --- Oggi --- */
/* in alto, senza card: un numero solo (la settimana nell'anello), centrato e con tanto respiro; sotto lo stato in
   piccolo (un pallino del colore dello stato), due valori quieti, i sette giorni e il pet con la sua frase */
.hero { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 0 4px; margin: 0 0 16px; text-align: center; --mood: var(--neon-g); }
/* lo stesso anello della settimana in cima ad Abitudini */
.ring-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 8px; --mood: var(--neon-g); }
.hero-near { --mood: #b86e00; } .hero-over { --mood: #d42a5c; } .hero-free { --mood: var(--neon-v); }
@media (prefers-color-scheme: dark) { .hero-near { --mood: #ffb238; } .hero-over { --mood: #ff6b95; } }
.hero-ring { width: 184px; max-width: 60%; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-cap); font-weight: 500; color: var(--ink-2); line-height: 1.3; }
.hero-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--mood); flex: none; }
.hero-side { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 20px; width: 100%; }
.kv { display: flex; flex-direction: column; gap: 2px; min-width: 0; max-width: 100%; }
.hero .kv { flex-direction: row; align-items: baseline; gap: 6px; }
.kv-k { font-size: var(--fs-cap); font-weight: 500; color: var(--muted); }
.kv-v { font-family: var(--display); font-size: var(--fs-title); font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.hero .kv-v { font-size: var(--fs-h2); font-weight: 600; }
.kv small { font-size: var(--fs-cap); color: var(--muted); line-height: 1.25; }
/* i sette giorni sotto le azioni, senza card */
.week { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 24px 0 8px; text-align: center; }
.week .legend { margin: 0; justify-content: center; }
.week .meter-note { margin: 0; max-width: 34ch; }
.hero-bars { width: 100%; max-width: 360px; }
/* il pet sotto, con la sua frase */
.hero-buddy { display: flex; align-items: flex-end; gap: 8px; width: 100%; max-width: 420px; text-align: left; }
.hero-pet { flex: none; width: 48px; height: 48px; border: 0; padding: 0; background: none; display: grid; place-items: end center; position: relative; }
.hero-pet::before { content: ""; position: absolute; bottom: 2px; left: 50%; width: 28px; height: 5px; margin-left: -14px; border-radius: 50%; background: rgba(20, 15, 60, 0.2); }
.hero-pet .mascot { position: relative; width: 40px; height: auto; margin-bottom: 4px; transform-origin: 50% 100%; animation: bob 4s ease-in-out infinite; image-rendering: pixelated; }
.hero-pet.hop .mascot { animation: buddy-hop 0.6s var(--ease-out); }
.hero-say {
  margin: 0 0 8px; padding: 8px 12px; border-radius: 16px 16px 16px 4px; font-size: var(--fs-cap); font-weight: 400; line-height: 1.4;
  background: var(--inset); color: var(--ink-2);
}
.hero-say b { font-weight: 600; color: var(--ink); }
.hero-say.new { animation: fade-in 0.18s var(--ease-out); }
@keyframes fade-in { from { opacity: 0; } }
body.pet-in-page > .buddy { display: none; }
body.buddy-on.pet-in-page main { padding-bottom: calc(var(--tabs-h) + var(--tabs-gap) + var(--sab) + 28px); }
.hero-side dt { font-size: 0.78rem; color: var(--muted); }
.meter { height: 8px; border-radius: 4px; background: var(--inset); overflow: hidden; margin-top: 4px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.meter.over i { background: var(--warn); }
.meter-note { font-size: var(--fs-cap); color: var(--muted); margin: 0; }
/* pausa di tolleranza */
.pause-card { position: relative; }
.pause-pet { position: absolute; right: 14px; top: 10px; }
.pause-card h2, .pause-card .pause-day { margin-right: 60px; }
.pause-day { margin: 2px 0 6px; font-size: 1.05rem; }
.pause-day b { font-size: 1.6rem; color: var(--accent-text); }
.meter.good { background: color-mix(in srgb, #3fa86a 18%, transparent); }
.meter.good i { background: #3fa86a; }
.pause-card .row { margin-top: 10px; }
.cheers { display: flex; flex-wrap: wrap; gap: 6px; }
.cheers .btn { white-space: nowrap; }

/* le quattro azioni tonde (Canna, Tiro, Voto, Pausa): un cerchio da 56 con l'icona e il nome sotto; sotto «Ho
   dimenticato di segnare» e la fascia della roba */
.log { margin: 8px 0 4px; }
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.act {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; padding: 0; border: 0; background: none;
  color: var(--ink); font-size: var(--fs-cap); font-weight: 500; line-height: 1.2; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.act-ic { position: relative; width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; background: var(--act-bg, var(--inset)); color: var(--act-ink, var(--ink)); transition: transform 0.12s var(--ease-out); }
.act-ic .ic { width: 24px; height: 24px; stroke-width: 1.8; }
.act.canna { --act-bg: var(--s1); --act-ink: #fff; }
.act.tiro { --act-bg: var(--s2); --act-ink: #fff; }
.act:active .act-ic { transform: scale(0.97); }
.act:disabled { opacity: 0.4; cursor: default; }
.act-label { display: flex; flex-direction: column; align-items: center; }
.act-label small { font-size: var(--fs-micro); font-weight: 500; color: var(--muted); }
.add-past { display: inline-flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin: 8px 0 4px; color: var(--muted); font-weight: 500; }
.add-past .ic { width: 16px; height: 16px; }
/* segnato: una spunta che appare e sparisce sul cerchio (niente onde né rimbalzi) */
.act .done-wave { display: none; }
.act .done-check { position: absolute; left: 50%; top: 0; width: 56px; height: 56px; margin-left: -28px; border-radius: 50%; display: grid; place-items: center; pointer-events: none; background: var(--act-bg); animation: check-out 0.9s var(--ease-out) forwards; }
.act .done-check svg { width: 30px; height: 30px; }
.act .done-check circle { display: none; }
.act .done-check path { fill: none; stroke: #fff; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: check-draw 0.25s 0.05s var(--ease-out) forwards; }
@keyframes check-out { 0% { opacity: 0; } 15% { opacity: 1; } 75% { opacity: 1; } 100% { opacity: 0; } }
@keyframes check-draw { to { stroke-dashoffset: 0; } }
/* NEON (solo al buio, sobrio): un alone morbido del loro colore su anello, numero dell'anello, Canna e Tiro,
   il pallino dello stato e il bordo delle card importanti (.card.neon) */
@media (prefers-color-scheme: dark) {
  .vivid.ring-only .ring-arc { filter: drop-shadow(0 0 6px color-mix(in srgb, currentColor 55%, transparent)); }
  .vivid.ring-only .ring-big { filter: drop-shadow(0 0 14px rgba(190, 170, 255, 0.35)); }
  .act.canna .act-ic { box-shadow: 0 0 0 var(--hair) rgba(120, 255, 190, 0.35) inset, 0 0 22px -4px color-mix(in srgb, var(--s1) 75%, transparent); }
  .act.tiro .act-ic { box-shadow: 0 0 0 var(--hair) rgba(210, 190, 255, 0.4) inset, 0 0 22px -4px color-mix(in srgb, var(--s2) 75%, transparent); }
  .hero-badge::before { box-shadow: 0 0 8px var(--mood); }
  .card.neon { border-color: color-mix(in srgb, var(--accent) 38%, transparent); box-shadow: var(--depth-1), 0 0 28px -10px color-mix(in srgb, var(--accent) 70%, transparent); }
}
/* il foglio rapido «Quanta canna?» */
.size-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.size-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px; border: var(--hair) solid var(--line); border-radius: var(--r-md); background: var(--inset); color: var(--ink); font-size: var(--fs-ui); transition: transform 0.12s var(--ease-out); }
.size-opt .act-ic { width: 44px; height: 44px; background: var(--s1); color: #fff; }
.size-opt small { font-size: var(--fs-cap); color: var(--muted); }
.size-opt[aria-pressed="true"] { border-color: var(--accent); }
.size-opt:active { transform: scale(0.97); }
/* la fascia della roba: righe come quelle dei fogli (tondo con l'icona, nome e riga sotto, valore a destra, freccia) */
.roba-card { background: var(--card); border: var(--hair) solid var(--glass-edge); border-radius: var(--radius); box-shadow: var(--depth-1); padding: 12px 8px 8px; }
.roba-h { margin: 0 8px 4px; font-size: var(--fs-cap); font-weight: 600; color: var(--muted); letter-spacing: 0; }
/* «La tua roba» a sinistra e «Cosa ho» a destra, sulla stessa linea di base (come «Tutto il diario») */
.roba-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-right: 8px; }
.roba-head .roba-h { margin-bottom: 0; }
.roba-head .link { margin: 0 0 0 auto; min-height: 44px; padding: 0 4px; font-size: var(--fs-cap); }
.roba-all { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 4px; background: none; border: 0; cursor: pointer; font: inherit; font-size: var(--fs-cap); font-weight: 600; color: var(--muted); }
.roba-all .ic { width: 16px; height: 16px; }
.hub-buy { margin: 4px 0 12px; }
.hub-fold > summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; font-weight: 600; color: var(--accent-text); }
/* le righe sottili quando manca qualcosa: «Pod · nessuno — Segna», su una riga sola */
.roba-row.roba-mini { min-height: 44px; padding: 4px 8px; }
.roba-mini .roba-ic { width: 32px; height: 32px; background: var(--inset); color: var(--muted); }
.roba-mini .roba-ic .ic { width: 18px; height: 18px; }
.roba-mini .roba-main { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.roba-mini .roba-main b { font-weight: 500; color: var(--ink-2); }
.roba-go { flex: none; padding: 0 4px; font-size: var(--fs-cap); font-weight: 600; color: var(--accent-text); }
/* la roba in uso con «Passi a …» dentro la stessa riga */
.roba-line { display: flex; align-items: center; gap: 8px; }
.roba-line > .roba-row { flex: 1; min-width: 0; }
.roba-next { flex: none; padding-right: 8px; }
.roba-next .btn.small { min-height: 36px; padding: 0 12px; font-size: var(--fs-cap); }
.roba-card > :not(.roba-head) + :not(.roba-head) { box-shadow: 0 calc(-1 * var(--hair)) 0 var(--line); }
.roba-head { padding-left: 0; }
.roba-head .roba-all { margin-left: 4px; }
/* «Cosa ho»: ogni cosa con quanto ne resta e il campo per correggerla */
.have-list { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 8px; }
.have-item { padding: 10px 12px; background: var(--inset); border-radius: var(--r-md); display: grid; gap: 8px; }
.have-top { display: flex; align-items: center; gap: 12px; font-size: var(--fs-ui); line-height: 1.3; }
.have-top .roba-main { display: grid; gap: 2px; min-width: 0; }
.have-top small { color: var(--muted); font-size: var(--fs-cap); }
.have-fix { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.have-fix .field { margin: 0; flex: 1 1 96px; min-width: 0; }
.have-fix .field input { width: 100%; min-width: 0; box-sizing: border-box; background: var(--surface); }
.field.have-new input { width: 100%; box-sizing: border-box; }
.spare-list li > span { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pod-edit { flex: 1; min-width: 0; text-align: left; color: var(--ink); text-decoration: none; padding: 0; }
.roba-row, .leftover {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin: 0; padding: 8px; border: 0; border-radius: var(--r-md);
  background: none; color: var(--ink); text-align: left; font-size: var(--fs-ui); line-height: 1.3; transition: background-color 0.2s, transform 0.15s var(--ease-out);
}
.roba-row:active { background: var(--press); transform: scale(0.97); }
.roba-row + .roba-row, .roba-row + .leftover { box-shadow: 0 calc(-1 * var(--hair)) 0 var(--line); border-radius: 0 0 var(--r-md) var(--r-md); }
.roba-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.roba-ic .ic { width: 20px; height: 20px; }
.roba-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.roba-main b { font-weight: 600; overflow-wrap: anywhere; }
.roba-main small { font-size: var(--fs-cap); font-weight: 500; color: var(--muted); }
.roba-val { flex: none; font-family: var(--display); font-size: var(--fs-big); font-weight: 650; font-variant-numeric: tabular-nums; }
.roba-val .unit { margin-left: 2px; }
.roba-row.empty b { color: var(--accent-text); }
.roba-row.low .roba-main small, .roba-row.low .roba-val { color: var(--warn); }
.roba-row.low .roba-ic { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }
/* le ultime sessioni, come movimenti: icona tonda col gradino, cosa e quando, quanto in canne */
.feed-card h2 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.feed-card h2 .link { font-family: var(--font); font-size: var(--fs-cap); font-weight: 600; letter-spacing: 0; text-decoration: none; min-height: 0; padding: 4px 0; margin: 0; }
.feed-list { list-style: none; padding: 0; margin: 6px 0 0; }
.feed-row {
  width: calc(100% + 8px); display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 4px; margin: 0 -4px; border: 0; background: none; text-align: left; border-radius: 16px;
  transition: background-color 0.2s, transform 0.15s var(--ease-out);
}
.feed-row:active { background: var(--press); transform: scale(0.97); }
.feed-ic { position: relative; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; }
.feed-ic .ic { width: 20px; height: 20px; }
.feed-ic.c { background: var(--s1); } .feed-ic.t { background: var(--s2); }
.feed-ic em { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 0.75rem; font-style: normal; }
@media (prefers-color-scheme: dark) {
  .feed-ic.c { background: rgba(61, 255, 162, 0.14); color: #6dffb9; }
  .feed-ic.t { background: rgba(177, 140, 255, 0.18); color: #cdb8ff; }
}
.feed-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.feed-main { gap: 2px; }
.feed-main b { font-size: var(--fs-body); line-height: 1.25; font-weight: 600; }
.feed-main small { font-size: var(--fs-cap); line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed-eq { font-size: var(--fs-h2); font-weight: 600; }

.now { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 0.92rem; }

.banner {
  display: flex; align-items: flex-start; gap: 8px; margin: 12px 0; padding: 12px 8px 12px 16px; font-size: var(--fs-ui); line-height: 1.4;
  background: var(--card); border: var(--hair) solid var(--glass-edge); border-radius: var(--r-md); box-shadow: var(--depth-1);
}
.banner p { margin: 2px 0; flex: 1; font-size: var(--fs-ui); }
.banner-ic { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.banner-ic .ic { width: 18px; height: 18px; }
.eq-news { align-items: center; }
.eq-news p { color: var(--ink-2); line-height: 1.4; }
.eq-news b { color: var(--ink); }
/* la sessione in compagnia che un amico ha segnato con te (shared.js) */
.share-head { display: flex; align-items: flex-start; gap: 12px; }
.share-head h2 { margin: 0 0 2px; font-size: var(--fs-h2); }
.share-head .muted { margin: 0; font-size: var(--fs-cap); line-height: 1.4; }
.share-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.share-ic .ic { width: 20px; height: 20px; }
.share-note { margin: 12px 0 0; font-size: var(--fs-cap); color: var(--ink-2); line-height: 1.4; }
.share-offer .row { margin-top: 12px; }
.share-q { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.share-q > span { flex: 1; font-size: var(--fs-body); }
.share-q .stepper { flex: none; min-width: 176px; margin: 0; }
.share-rate { margin: 12px 0 16px; border-top: var(--hair) solid var(--line); padding-top: 8px; }
.share-rate > summary { min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer; }
.share-rate > summary small { color: var(--muted); font-weight: 400; font-size: var(--fs-cap); }
.link.inline { display: inline; margin: 0; padding: 0; min-height: 0; font-size: inherit; }
.banner .btn { align-self: center; margin-right: 6px; }
.banner .icon { width: 44px; height: 44px; margin: -6px 0; }
/* il vecchio indirizzo su Render: avviso del nuovo link (banners() in app.js) */
.banner.moved { align-items: center; }
.banner.moved a.btn { text-decoration: none; }

.welcome ol { padding-left: 20px; margin: 8px 0; }
.welcome li { margin: 6px 0; }

/* --- voto: gradini, com'è stata, che binnella --- */
.rate h2 { margin-bottom: 0; }
.rate > .muted { font-size: 0.88rem; }
.rate-title { margin: 18px 0 0; }
.rate-q { font-size: 0.9rem; margin: 16px 0 6px; color: var(--ink-2); }
/* i gradini come uno slider: un binario colorato, il pomello che scivola sul gradino scelto, le icone dei gradini sotto */
.steps {
  position: relative; display: grid; grid-template-columns: repeat(7, 1fr); height: 72px; padding: 0; touch-action: pan-y; --sel: 0;
}
.steps::before {
  content: ""; position: absolute; left: calc(100% / 14 - 6px); right: calc(100% / 14 - 6px); top: 13px; height: 12px; border-radius: 6px;
  background: var(--sky-x); pointer-events: none;
}
.steps::after {
  content: ""; position: absolute; top: 4px; width: 30px; height: 30px; margin-left: -15px; border-radius: 50%; pointer-events: none;
  left: calc((var(--sel) + 0.5) * 100% / 7); background: #fff; opacity: 0; transform: scale(0.4);
  box-shadow: 0 0 0 4px rgba(138, 104, 255, 0.45), 0 5px 14px rgba(20, 10, 60, 0.35);
  transition: left 0.5s var(--ease-out), opacity 0.2s, transform 0.15s var(--ease-out);
}
.steps.has-sel::after { opacity: 1; transform: none; }
.steps button {
  position: relative; height: 72px; min-width: 0; border: 0; border-radius: var(--r-md); background: none; padding: 38px 0 0;
  display: grid; place-items: end center; padding-bottom: 6px; color: var(--muted); transition: color 0.15s var(--ease-out);
}
.steps button .ic { width: 22px; height: 22px; stroke-width: 1.7; }
.steps button[aria-checked="true"] { color: var(--accent-text); }
.steps button[aria-checked="true"] .ic { width: 26px; height: 26px; stroke-width: 1.9; }
.steps button:focus-visible { outline: 3px solid var(--accent); outline-offset: -2px; }
.readout {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin: 8px 0 0; min-height: 36px; color: var(--ink-2); text-align: center;
}
.readout { flex-direction: column; gap: 2px; margin-top: 10px; }
.readout .mascot { width: 30px; height: auto; }
.readout .lvl-dot { display: none; }
.readout .nuance-tag { display: inline-block; margin: 2px 6px 0 0; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); }
.readout .lvl-hint { font-weight: 600; color: var(--ink-2); }
.readout b { display: block; font-family: var(--display); font-size: 1.6rem; font-weight: 700; color: var(--ink); letter-spacing: -0.025em; line-height: 1.1; }
.readout .mascot { flex: none; }
.readout-row { display: flex; align-items: flex-start; gap: 6px; }
.readout-row .readout { flex: 1; min-width: 0; }
.readout .lvl-desc { display: block; margin-top: 2px; font-size: 0.84rem; line-height: 1.35; color: var(--muted); }
.lvl-help {
  flex: none; width: 32px; height: 32px; margin-top: 10px; border-radius: 50%; border: var(--hair) solid var(--line);
  background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: 1rem; padding: 0;
}
.lvl-help:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
dialog.lvl-guide {
  width: min(440px, calc(100vw - 24px)); max-height: 88vh; overflow-y: auto; padding: 8px 16px 16px;
  border: 0; border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-float);
}
dialog.lvl-guide::backdrop { background: rgba(10, 6, 20, 0.55); }
.lvl-guide .sheet-head { top: -8px; }
.lvl-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.lvl-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; font: inherit; color: inherit;
  padding: 8px 10px; border-radius: var(--r-md); border: var(--hair) solid var(--line); background: none;
}
.lvl-item.on { border-color: var(--accent); background: var(--accent-soft); }
.lvl-item small { display: block; margin-top: 2px; color: var(--ink-2); font-size: 0.84rem; line-height: 1.35; }
.lvl-emoji { flex: none; display: grid; place-items: center; color: var(--accent-text); }
.lvl-emoji .ic { width: 24px; height: 24px; }
.lvl-tip { font-size: 0.88rem; color: var(--ink-2); margin: 8px 0 0; }
.old-vote { font-size: 0.88rem; color: var(--ink-2); background: var(--accent-soft); border-radius: var(--r-md); padding: 10px 12px; }
.old-vote .btn { margin: 6px 0 2px; }
.old-vote small { display: block; color: var(--muted); }
.vibes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; background: var(--inset); border-radius: var(--r-md); padding: 4px; }
.vibes button {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 58px;
  border: 0; border-radius: 10px; background: none; padding: 6px 2px; color: var(--ink-2);
}
.vibes button span { display: grid; place-items: center; color: var(--muted); }
.vibes button span .ic { width: 26px; height: 26px; stroke-width: 1.7; }
.vibes button small { font-size: 0.68rem; font-weight: 600; line-height: 1.15; }
.vibes button[aria-checked="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.14); }
.vibes button[aria-checked="true"] span { color: var(--accent-text); }
.rate .chips, #sheet .chips { margin-top: 6px; }
.rate-q + .alcohol { margin-top: 0; }
.rate-more { margin-top: 14px; border-top: var(--hair) solid var(--line); padding-top: 4px; }
.rate-more > summary { cursor: pointer; padding: 10px 0 4px; font-weight: 600; color: var(--accent-text); list-style: none; }
.rate-more > summary::-webkit-details-marker { display: none; }
.rate-more > summary::before { content: '＋ '; }
.rate-more[open] > summary::before { content: '－ '; }
.rate-more > summary small { display: block; font-weight: 500; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
/* Voto rapido: i tre tempi sono distinti e le fasce dell'effetto si leggono anche senza tooltip. */
.rate-help { margin: 4px 0 8px; color: var(--muted); font-size: var(--fs-cap); line-height: 1.4; }
.rate-details-save { margin-top: 16px; }
.rate-details-save .rate-help { margin-bottom: 0; }
.rate-time-seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: var(--r-md); }
.rate-time-seg button { display: flex; flex-direction: column; justify-content: center; gap: 4px; min-height: 52px; border-radius: var(--r-md); padding: 8px 4px; }
.rate-time-seg button small { font-size: var(--fs-micro); font-weight: 400; }
.rate-time-seg button[data-v="ongoing"] { grid-column: 1 / -1; min-height: 44px; }
.chip.bad[aria-pressed="true"] { background: var(--warn-soft); border-color: var(--warn); color: var(--warn-text); }
.chip.static { cursor: default; display: inline-flex; align-items: center; gap: 4px; }
.chip.static b { color: var(--accent-text); }
.chip.static.bad b { color: var(--warn-text); }
.compare.three { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.compare.three > div { padding: 10px; }
.compare.three b { font-size: 0.92rem; }
.compare.three .muted { font-size: 0.74rem; }

/* --- Abitudini --- */
.scope { color: var(--muted); font-size: 0.85rem; margin: 4px 2px 0; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--depth-1); border: var(--hair) solid var(--glass-edge); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.tile-label { font-size: var(--fs-cap); font-weight: 500; color: var(--muted); line-height: 1.3; }
.tile-value { font-size: var(--fs-title); font-weight: 700; font-family: var(--display); letter-spacing: -0.01em; line-height: 1.1; }
.tile-value small { font-size: 0.52em; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.tile-sub { font-size: var(--fs-cap); color: var(--ink-2); line-height: 1.3; min-height: 1.3em; }

.legend { display: flex; gap: 16px; font-size: var(--fs-cap); color: var(--ink-2); margin: 0 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.s1 { background: var(--s1); }
.sw.s2 { background: var(--s2); }

.chart { width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart .s1 { fill: var(--s1); color: var(--s1); }
.chart .s2 { fill: var(--s2); color: var(--s2); }
@media (prefers-color-scheme: dark) {
  /* al buio le colonne e le curve brillano appena */
  /* niente bagliori sui grafici: brilla solo l'anello della card in alto */
  .chart .p1 { color: var(--p1); } .chart .p2 { color: var(--p2); } .chart .curve { color: var(--s1); }
  .vivid .m-mattina { color: var(--m1); } .vivid .m-pomeriggio { color: var(--m2); } .vivid .m-sera { color: var(--m3); } .vivid .m-notte { color: var(--m4); }
  .vivid path.s1, .vivid rect.s1 { color: var(--s1); } .vivid path.s2, .vivid rect.s2 { color: var(--s2); }
}
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .limit { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 2 5; stroke-linecap: round; }
.chart .tick { fill: var(--tick); font-size: var(--fs-micro); font-weight: 500; font-variant-numeric: tabular-nums; }
.chart .tick.strong { fill: var(--ink-2); font-weight: 600; }
.chart .tick-ic { color: var(--tick); }
.chart .dot { fill: var(--s1); stroke: var(--surface); stroke-width: 2; }
.chart .curve { fill: none; stroke: var(--s1); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .trend { fill: none; stroke: var(--s1); stroke-opacity: 0.45; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart .area { fill: var(--s1); fill-opacity: 0.12; }
.chart .prior { fill: var(--muted); fill-opacity: 0.55; }
.chart .post { fill: var(--accent); }
.legend .sw.prior { background: var(--muted); opacity: 0.55; }
.legend .sw.post { background: var(--accent); }
/* con quanti tiri quanta binnella: una serie sola nel colore dei tiri (s2) o delle canne (s1) */
.chart .dose-band { fill: currentColor; fill-opacity: 0.14; stroke: none; }
.chart .dose-curve { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.chart .dose-dot { fill: currentColor; fill-opacity: 0.45; stroke: var(--surface); stroke-width: 1.5; }
.chart .dose-need { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 2 4; stroke-linecap: round; }
.chart .dose-mark { fill: currentColor; stroke: var(--surface); stroke-width: 2; }
.chart .trendline { fill: none; stroke: var(--neon-v); stroke-width: 2; stroke-dasharray: 5 4; stroke-linecap: round; }
.chart .fx { stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.chart .fx.dim { stroke: var(--muted); stroke-opacity: 0.7; }
.chart .fx-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.chart .fx-dot.dim { fill: var(--muted); }
.chart .fx-label { fill: var(--ink); font-size: 13px; }
.chart .fx-value { fill: var(--ink-2); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .hit { fill: transparent; outline: none; }
.chart rect.hit.active, .chart rect.hit:focus-visible { fill: var(--hover); }
.chart circle.hit.active, .chart circle.hit:focus-visible { fill: none; stroke: var(--ink-2); stroke-width: 1.5; }
.chart .h0 { fill: var(--h0); } .chart .h1 { fill: var(--h1); } .chart .h2 { fill: var(--h2); }
.chart .h3 { fill: var(--h3); } .chart .h4 { fill: var(--h4); } .chart .h5 { fill: var(--h5); }
.ramp { display: flex; align-items: center; gap: 3px; font-size: 0.75rem; color: var(--muted); margin-top: 8px; }
.ramp span { margin: 0 4px; }
.ramp i { width: 18px; height: 10px; border-radius: 2px; }
.ramp .h1 { background: var(--h1); } .ramp .h2 { background: var(--h2); } .ramp .h3 { background: var(--h3); }
.ramp .h4 { background: var(--h4); } .ramp .h5 { background: var(--h5); }

.numbers { margin-top: 8px; font-size: 0.85rem; }
.numbers summary { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-text); font-weight: 600; font-size: var(--fs-ui); cursor: pointer; min-height: 44px; padding: 0 16px; border-radius: 999px; background: var(--accent-soft); list-style: none; }
.numbers summary::-webkit-details-marker { display: none; }
.numbers summary::after { content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform 0.15s var(--ease-out); }
.numbers[open] summary::after { transform: translateY(1px) rotate(-135deg); }
.numbers table { margin-top: 8px; }
.numbers table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.numbers th, .numbers td { text-align: right; padding: 8px 4px; border-bottom: var(--hair) solid var(--line); }
.numbers th:first-child, .numbers td:first-child { text-align: left; }
.numbers th { color: var(--muted); font-weight: 500; font-size: var(--fs-cap); }

.tip {
  position: fixed; left: 0; top: 0; z-index: 40; pointer-events: none;
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 7px 10px; font-size: 0.82rem;
  display: flex; flex-direction: column; max-width: 240px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}
.tip strong { font-size: 0.95rem; }
.tip span { opacity: 0.75; }

/* --- Tolleranza --- */
.intro { color: var(--ink-2); margin: 4px 2px 8px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 8px; }
.compare > div { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; background: var(--inset); border-radius: var(--r-md); padding: 12px; }
.compare-emoji { display: grid; place-items: center; margin-top: 4px; color: var(--accent-text); }
.compare-emoji .ic { width: 32px; height: 32px; stroke-width: 1.6; }
.compare .muted { font-size: 0.82rem; }
.compare small { font-size: 0.75rem; color: var(--muted); }
.how summary { font-weight: 600; cursor: pointer; }
.how p { color: var(--ink-2); font-size: 0.9rem; }

/* --- Abitudini: previsione, tendenza, ritmo --- */
.fc-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; }
.fc-legend i { display: inline-block; width: 12px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; position: static; }
.warn-text { color: var(--warn-text); }
.link.inline { display: inline; padding: 0; margin: 0; font-size: inherit; text-decoration: underline; text-underline-offset: 2px; }
.trend-text { margin: 10px 0 2px; }
/* il pet che commenta un grafico: lui a sinistra, la frase in un fumetto */
.pet-note { display: flex; align-items: flex-end; gap: 8px; margin: 10px 0 2px; }
.pet-note > .mascot { flex: none; width: 36px; height: auto; image-rendering: pixelated; margin-bottom: 2px; }
.pet-note .trend-text { margin: 0; padding: 10px 12px; border-radius: 16px 16px 16px 5px; background: var(--inset); font-size: 0.92rem; }
.tiles.mini { gap: 8px; margin: 6px 0; }
.tiles.mini .tile { background: var(--inset); box-shadow: none; border-radius: var(--r-md); padding: 10px 12px; }
.tiles.mini .tile-value { font-size: 1.45rem; }
.tiles.mini .tile-value.small { font-size: 1.1rem; line-height: 1.5; }
.moments { display: flex; gap: 2px; height: 14px; border-radius: 7px; overflow: hidden; margin: 4px 0 6px; }
.moments span { min-width: 0; }
.m-mattina { background: var(--m1); } .m-pomeriggio { background: var(--m2); } .m-sera { background: var(--m3); } .m-notte { background: var(--m4); }
.moments-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.8rem; color: var(--ink-2); }
.moments-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* --- Tolleranza: il modello --- */
.big-stat { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0 8px; }
.big-stat b { font-size: var(--fs-hero); font-weight: 700; line-height: 1; letter-spacing: -0.015em; color: var(--ink); }
.big-stat span { color: var(--muted); font-size: var(--fs-cap); }
.model-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 4px 0 6px; }
.model-table th, .model-table td { text-align: left; padding: 7px 4px; border-bottom: var(--hair) solid var(--line); vertical-align: top; }
.model-table thead th { color: var(--muted); font-weight: 600; font-size: 0.78rem; }
.model-table tbody th { font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.model-table td:nth-child(2) { font-variant-numeric: tabular-nums; }
.model-table small { display: block; color: var(--muted); font-size: 0.75rem; }
.model-table tr:last-child th, .model-table tr:last-child td { border-bottom: 0; }
.tiles.three { grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 0; }
.tiles.three .tile { background: var(--inset); box-shadow: none; padding: 10px; border-radius: var(--r-md); }
.tile-value.small { font-size: 1.05rem; line-height: 1.3; }
.facts { list-style: none; padding: 0; margin: 4px 0 6px; display: grid; gap: 12px; }
.facts li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; align-items: start; }
.facts li > span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: 1.05rem; line-height: 1; }
.facts li > span .ic { width: 18px; height: 18px; }
.facts b { display: block; font-size: var(--fs-ui); line-height: 1.35; font-weight: 600; }
.facts small { display: block; color: var(--muted); font-size: var(--fs-cap); line-height: 1.35; margin-top: 2px; }
.said { margin: 6px 0; padding-left: 18px; font-size: 0.92rem; }
.said small { font-size: 0.78rem; }
.mix { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-top: 5px; font-size: 0.75rem; color: var(--muted); }
.mix-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.mix-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.mix-val { font-variant-numeric: tabular-nums; color: var(--ink-2); font-weight: 600; min-width: 4.6em; text-align: right; }
.said li { margin: 3px 0; }

/* --- Diario --- */
.day { display: flex; justify-content: space-between; font-size: var(--fs-cap); font-weight: 600; color: var(--ink-2); margin: 20px 4px 8px; }
.day span { color: var(--muted); font-weight: 500; }
.entries { list-style: none; padding: 0; margin: 0; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: var(--hair) solid var(--glass-edge); overflow: hidden; }
.entries li + li { border-top: var(--hair) solid var(--line); }
.entry {
  width: 100%; display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center;
  min-height: 56px; padding: 12px 16px; background: none; border: 0; text-align: left;
}
.entry:active { background: var(--press); }
.entry-time { font-weight: 600; font-variant-numeric: tabular-nums; grid-row: span 2; min-width: 3.2em; }
.entry-what { font-size: var(--fs-body); font-weight: 500; }
.entry-rate { font-size: var(--fs-cap); color: var(--muted); }
.badge { background: var(--accent-soft); color: var(--accent-text); border-radius: 999px; padding: 1px 8px; font-weight: 600; font-size: 0.78rem; }

.empty:not(.roba-row) { text-align: center; padding: 40px 24px; color: var(--ink-2); }
.empty .mascot { margin: 0 auto 6px; display: block; }

/* --- fogli --- */
.sheet { position: fixed; inset: 0; z-index: 30; }
.backdrop { position: absolute; inset: 0; background: rgba(8, 5, 20, 0.42); opacity: 0; transition: opacity 0.3s var(--ease-out); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
.panel {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; max-width: 560px; max-height: 92vh; overflow-y: auto;
  background: var(--surface); border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--depth-3);
  padding: 4px 20px calc(24px + var(--sab));
  transform: translateY(100%); transition: transform 0.3s var(--ease-out); overscroll-behavior: contain;
}
/* la maniglia: il foglio si chiude anche trascinandolo giù */
.grabber { position: sticky; top: -4px; z-index: 2; height: 18px; margin: 0 -20px -4px; display: grid; place-items: center; background: var(--surface); touch-action: none; }
.grabber::before { content: ""; width: 36px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
@media (prefers-color-scheme: dark) { .grabber::before { background: rgba(255, 255, 255, 0.24); } }
.sheet.closing { pointer-events: none; }
.sheet.closing .panel { transition: transform 0.26s cubic-bezier(0.4, 0, 1, 1); }
.sheet.closing .backdrop { transition-duration: 0.26s; }
.sheet.dragging .panel, .sheet.dragging .backdrop { transition: none; }
.sheet.open .backdrop { opacity: 1; }
.sheet.open .panel { transform: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 14px; background: var(--surface); padding: 8px 0 12px; z-index: 1; }
.sheet-head h2 { font-size: 20px; line-height: 1.2; font-weight: 650; }
.sheet-head .icon { width: 36px; height: 36px; background: var(--inset); color: var(--ink-2); position: relative; }
/* area di tocco di 44 px che non sporge a destra (il foglio scorrerebbe di lato) */
.sheet-head .icon::after { content: ""; position: absolute; inset: -4px 0 -4px -8px; }
.sheet-head .icon .ic { width: 16px; height: 16px; stroke-width: 2.4; }
.sheet-head h2 { margin: 0; }
.intakes { list-style: none; padding: 0; margin: 8px 0; }
.intakes { display: grid; gap: 6px; }
.intakes li { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 6px 6px 12px; border-radius: var(--r-md); background: var(--inset); }
.intakes li span { flex: 1; min-width: 0; font-size: var(--fs-ui); font-weight: 600; }
.intakes li input { flex: 0 1 auto; min-width: 0; width: 13.5em; }
input[type="datetime-local"] {
  border: 0; border-radius: 999px; background: var(--surface); color: var(--ink); padding: 6px 12px; font-size: var(--fs-cap); min-height: 40px;
  font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 1px var(--line);
}
input[type="datetime-local"]::-webkit-calendar-picker-indicator { opacity: 0.55; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: var(--fs-cap); font-weight: 500; color: var(--ink-2); margin: 12px 0; }
.field input { font-size: 1rem; }
.stepper { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; }
.stepper span { flex: 1; text-align: center; }
.stepper b { font-size: 1.4rem; }
.setting { border-bottom: var(--hair) solid var(--line); padding-bottom: 16px; }
.setting:last-child { border: 0; }
.setting h3 { margin-top: 16px; }
.setting .muted { font-size: var(--fs-cap); line-height: 1.4; }

/* --- avvisi --- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--tabs-gap) + var(--sab) + 22px); z-index: 35;
  transform: translate(-50%, 8px); opacity: 0; pointer-events: none;
  transition: transform 0.18s var(--ease-out), opacity 0.18s var(--ease-out);
  display: flex; align-items: center; gap: 10px; width: max-content; max-width: calc(100vw - 32px); overflow: hidden;
  background: rgba(16, 14, 40, 0.9); color: #fff; border-radius: var(--r-md); padding: 8px 8px 8px 16px; min-height: 52px;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: var(--depth-2), inset 0 0 0 var(--hair) rgba(255, 255, 255, 0.1);
  font-size: var(--fs-ui); font-weight: 500; line-height: 1.35;
}
body.signed-out .toast { bottom: calc(var(--sab) + 20px); }
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); pointer-events: auto; }
.toast span { padding: 2px 4px 2px 0; }
.toast button {
  flex: none; border: 0; border-radius: 999px; padding: 0 16px; min-height: 36px; white-space: nowrap;
  background: rgba(255, 255, 255, 0.16); color: #fff; font-weight: 600; font-size: var(--fs-ui);
  transition: transform 0.15s var(--ease-out), background-color 0.2s;
}
.toast button:active { transform: scale(0.97); background: rgba(255, 255, 255, 0.26); }
/* il tempo che resta per annullare */
.toast i { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: rgba(255, 255, 255, 0.55); transform-origin: left; animation: toast-time var(--t, 5s) linear forwards; }
@keyframes toast-time { to { transform: scaleX(0); } }
@media (prefers-color-scheme: dark) { .toast { background: rgba(44, 38, 80, 0.92); box-shadow: var(--depth-2), inset 0 0 0 var(--hair) rgba(255, 255, 255, 0.14); } }

/* --- PIN --- */
.lock { position: fixed; inset: 0; z-index: 43;
  /* Il colore opaco è indipendente dalla luce: variabili decorative mancanti non devono mai lasciare vedere
     la pagina sotto il PIN. Nel tema Aurora c'è una sola luce, --orb1. */
  background-color: var(--bg);
  background-image: radial-gradient(120vmax 70vmax at 50% -22%, var(--orb1), transparent 60%);
  display: grid; place-items: center; padding: env(safe-area-inset-top) 24px var(--sab); }
.pad { text-align: center; width: 100%; max-width: 300px; }
.pad .mascot { display: block; margin: 0 auto; }
.dots { display: flex; justify-content: center; gap: 16px; margin: 18px 0 26px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--ink-2); }
.dots i.on { background: var(--ink); border-color: var(--ink); }
.dots.shake { animation: shake 0.4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; justify-items: center; }
.keys button { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--card); box-shadow: var(--depth-1); border: var(--hair) solid var(--glass-edge); font-size: var(--fs-title); font-weight: 500; font-variant-numeric: tabular-nums; }
.keys button:active { background: var(--accent-soft); }
.keys .key-text { font-size: var(--fs-ui); font-weight: 600; background: none; box-shadow: none; border-color: transparent; }
.pad .bio-btn { margin: 0 auto 18px; display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- accesso --- */
body.signed-out .tabs, body.signed-out .top { display: none; }
body.signed-out main { padding-top: calc(env(safe-area-inset-top) + 6px); padding-bottom: calc(var(--sab) + 32px); }
.auth { max-width: 420px; margin: 0 auto; }
.auth-hero { text-align: center; padding: 18px 8px 6px; }
.auth-hero h1 { margin: 8px 0 4px; font-size: var(--fs-title); line-height: 1.1; letter-spacing: -0.025em; font-weight: 700; }
.auth-hero p { color: var(--muted); font-size: var(--fs-ui); margin: 0 auto; max-width: 300px; }

/* --- mascotte e decorazioni --- */
.mascot { flex: none; }
.buddy { position: relative; display: inline-block; }
.buddy .mascot { position: relative; animation: bob 4s ease-in-out infinite; transform-origin: 50% 90%; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-2deg); } }
/* nuvolette di fumo che salgono e svaniscono */
.smoke { position: absolute; left: 62%; top: 4%; width: 40px; height: 60px; pointer-events: none; }
.smoke i {
  position: absolute; bottom: 0; left: 0; width: 14px; height: 14px; border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 22%, #fff); opacity: 0;
  box-shadow: 8px -3px 0 -2px color-mix(in srgb, var(--accent) 22%, #fff);
  animation: puff 4.5s ease-out infinite; animation-delay: calc(var(--d) * 1.5s);
}
@keyframes puff {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  20% { opacity: 0.85; }
  100% { transform: translate(14px, -46px) scale(1.5); opacity: 0; }
}
.welcome { position: relative; }
.welcome .mascot { float: right; margin: -6px -4px 0 8px; }
.duo { display: flex; justify-content: center; margin-bottom: 4px; }
.duo .mascot + .mascot { margin-left: -10px; transform: rotate(8deg); }
.form .field input, .inline-form input, .have-fix .field input, .field.have-new input {
  border: var(--hair) solid var(--line); border-radius: var(--r-md); background: var(--inset); padding: 10px 14px; font-size: 16px; min-height: 48px; color: var(--ink);
}
.form .field input:focus, .inline-form input:focus, .have-fix .field input:focus, .field.have-new input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.error { color: var(--danger); font-size: var(--fs-cap); font-weight: 600; }
.small { font-size: var(--fs-cap); }
.code {
  font: 600 clamp(1.05rem, 5vw, 1.35rem)/1.5 ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: 0.03em; text-align: center;
  background: var(--inset); border-radius: var(--r-md); padding: 14px 10px; margin: 12px 0; user-select: all; -webkit-user-select: all;
}
.code span { white-space: nowrap; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 6px; font-size: 0.92rem; }
.check input { width: 22px; height: 22px; flex: none; margin: 0; accent-color: var(--accent); }
.btn:disabled { opacity: 0.5; }

/* --- Insieme --- */
.tabs button.dot::after { content: ""; position: absolute; top: 10px; left: 50%; margin-left: 9px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.sw.p1 { background: var(--p1); }
.sw.p2 { background: var(--p2); }
.chart .p1 { fill: var(--p1); }
.chart .p2 { fill: var(--p2); }
.versus { width: 100%; border-collapse: separate; border-spacing: 0 6px; margin-top: 4px; }
.versus th, .versus td { padding: 10px 8px; text-align: left; vertical-align: baseline; }
.versus tbody th, .versus tbody td { background: var(--inset); }
.versus tbody th { border-radius: var(--r-md) 0 0 var(--r-md); padding-left: 12px; }
.versus tbody td:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; }
.versus thead th { font-size: var(--fs-cap); color: var(--muted); font-weight: 500; padding-bottom: 0; overflow-wrap: anywhere; max-width: 0; line-height: 1.25; }
.versus thead .sw { margin-right: 6px; }
.versus tbody th { font-weight: 500; color: var(--ink-2); font-size: var(--fs-cap); width: 34%; }
.versus td { font-weight: 600; width: 33%; font-size: var(--fs-body); }
.versus small { font-weight: 400; color: var(--muted); font-family: var(--font); font-size: 0.8rem; }
.tol-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.tol { background: var(--inset); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; }
.tol-emoji { font-size: 1.6rem; }
.goal { border-top: var(--hair) solid var(--line); padding: 10px 0 4px; }
.goal:first-of-type { border-top: 0; }
.goal-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.goal-head .icon { margin-left: auto; width: 32px; height: 32px; }
.goal-row { display: grid; grid-template-columns: 90px 1fr; gap: 2px 10px; align-items: center; margin: 8px 0; }
.goal-row .meter { margin: 0; }
.goal-who { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-text { grid-column: 2; font-size: 0.8rem; color: var(--ink-2); }
.reactions { display: flex; gap: 8px; margin: 8px 0; }
.reaction { flex: 1; min-height: 48px; border-radius: var(--r-md); border: var(--hair) solid var(--line); background: var(--inset); font-size: 1.5rem; }
.reaction:active { background: var(--accent-soft); transform: scale(0.97); }
.inline-form { display: flex; gap: 8px; margin: 6px 0; }
.inline-form input { flex: 1; min-width: 0; }
.feed { list-style: none; padding: 0; margin: 12px 0 0; }
.feed li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: var(--hair) solid var(--line); font-size: 0.9rem; }
.feed time { font-size: 0.78rem; white-space: nowrap; }
/* modalità aiuto (helpui.js): cosa può fare chi aiuta, la fascia «Stai segnando per …», il diario di lei */
.help-explain p { margin: 12px 0 6px; }
.help-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.help-list li { display: flex; gap: 12px; align-items: flex-start; font-size: var(--fs-ui); line-height: 1.4; }
.help-list svg { width: 20px; height: 20px; flex: none; color: var(--muted); margin-top: 1px; }
.help-h { margin: 20px 0 8px; }
/* quattro durate su due righe: «Finché non lo spengo» resta su una riga */
.help-dur { display: grid; grid-template-columns: 1fr 1fr; border-radius: var(--r-md); margin-bottom: 16px; }
.help-dur button { border-radius: 12px; }
.help-banner { display: flex; gap: 10px; align-items: flex-start; padding: 12px 16px; margin: 4px 0 12px; border-radius: var(--r-md);
  background: var(--inset); font-size: var(--fs-ui); line-height: 1.4; }
.help-banner svg { width: 20px; height: 20px; flex: none; color: var(--accent, currentColor); }
.help-acts .btn svg { width: 20px; height: 20px; margin-right: 6px; vertical-align: -4px; }
.help-day { margin: 16px 0 8px; font-size: var(--fs-cap); font-weight: 600; color: var(--muted); }
.help-on p { margin: 8px 0; }
.help-setting .btn + .btn { margin-top: 8px; }
.help-ask { margin-top: 8px; }
.help-card .row { margin-top: 12px; }
/* il foglio dell'amministratore (admin.js) */
.admin-server, .admin-detail dl { display: grid; gap: 4px; margin: 8px 0 16px; }
.admin-server div, .admin-detail dl div { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-ui); }
.admin-server dt, .admin-detail dt { color: var(--muted); }
.admin-server dd, .admin-detail dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.admin-users .entry { grid-template-columns: 1fr auto; }
.admin-users .entry-what { grid-column: 1; }
.admin-users .entry-rate { grid-column: 2; grid-row: 1; align-self: center; }
.admin-detail { padding: 4px 16px 16px; }
.admin-detail h4 { margin: 12px 0 6px; font-size: var(--fs-cap); }
.admin-subs, .admin-errors { list-style: none; padding: 0; margin: 0 0 8px; font-size: var(--fs-cap); }
.admin-subs li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.admin-errors li { padding: 4px 0; overflow-wrap: anywhere; }
.admin-detail .btn.wide { margin-top: 12px; }
/* Segnala un problema (reportui.js) e le segnalazioni dell'amministratore (admin.js) */
.report-q { display: block; margin: 4px 0 8px; font-size: var(--fs-h2); font-weight: 600; }
.report-forward { margin: 4px 0 12px; }
.report-forward textarea, .report-input { box-sizing: border-box; width: 100%; border: var(--hair) solid var(--line); border-radius: var(--r-md); background: var(--inset); padding: 10px 14px; font: inherit; font-size: 16px; color: var(--ink); }
.report-forward textarea { resize: vertical; font-size: var(--fs-cap); }
.report-form textarea { box-sizing: border-box; width: 100%; border: var(--hair) solid var(--line); border-radius: var(--r-md); background: var(--inset); padding: 10px 14px; font: inherit; font-size: 16px; color: var(--ink); resize: vertical; }
.report-k { margin: 16px 0 4px; font-size: var(--fs-cap); font-weight: 600; color: var(--ink-2); }
.report-ctx { display: grid; gap: 4px; margin: 4px 0 12px; padding: 12px 16px; background: var(--inset); border-radius: var(--r-md); }
.report-ctx div { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-cap); }
.report-ctx dt { color: var(--muted); flex: none; }
.report-ctx dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.report-errors { list-style: none; padding: 0; margin: 0 0 12px; font-size: var(--fs-cap); }
.report-errors li { padding: 4px 0; overflow-wrap: anywhere; color: var(--ink-2); }
.report-form .btn.wide { margin-top: 8px; }
.report-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 12px; }
.report-item { padding: 12px 16px; background: var(--card); border: var(--hair) solid var(--glass-edge); border-radius: var(--radius); box-shadow: var(--depth-1); }
.report-item.resolved { opacity: 0.72; }
.report-head { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.report-text { margin: 0 0 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.switch { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 0.95rem; }
.switch input {
  appearance: none; -webkit-appearance: none; flex: none; width: 46px; height: 28px; border-radius: var(--r-md); background: var(--line); position: relative; margin: 0; transition: background 0.15s;
}
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon.small { width: 36px; height: 36px; font-size: 0.85rem; position: relative; }
.icon.small::after { content: ""; position: absolute; inset: -4px 0 -4px -8px; }
.icon.small .ic { width: 16px; height: 16px; }

/* --- animazioni dei pet --- */
@keyframes wave { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
@keyframes hop { 40% { transform: translateY(-9px) scale(1.05); } 70% { transform: translateY(1px) scale(1.08, 0.94); } }
.squish > .mascot { animation: squish 0.45s ease-out; }
@keyframes squish { 30% { transform: scale(1.15, 0.85); } 60% { transform: scale(0.94, 1.08); } }
/* cuoricini e snack che volano via */
.fx {
  position: absolute; left: 50%; top: 20%; font-size: 1.3rem; pointer-events: none; opacity: 0; z-index: 2;
  animation: fx 1.2s ease-out forwards;
}
@keyframes fx {
  0% { transform: translate(calc(-50% + var(--x) * 0.3), 0) scale(0.5); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--x)), -56px) scale(1.15); opacity: 0; }
}

/* --- scheda della fogliolina --- */
.pet-stage {
  position: relative; display: grid; place-items: center; width: 100%; border: 0; border-radius: var(--radius); padding: 16px 0 10px; margin-top: 4px;
  background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--sage) 30%, transparent), transparent 60%), var(--accent-soft);
}
.pet-stage .mascot { animation: bob 4s ease-in-out infinite; transform-origin: 50% 90%; }
.pet-stage.squish > .mascot { animation: squish 0.45s ease-out; }
.pet-stage .fx { font-size: 1.8rem; top: 35%; }
.pet-mood { text-align: center; font-weight: 700; font-size: 1.05rem; margin: 10px 0 4px; }
/* Pancia, Coccole, Livello: icona 16 e nome in una colonna fissa, poi un binario sottile e tondo come le altre barre */
.pet-bar { --pb: #e8962e; display: grid; grid-template-columns: 92px 1fr; align-items: center; gap: 12px; font-size: var(--fs-cap); color: var(--ink-2); margin: 10px 0; }
.pet-bar.love { --pb: #e9558a; }
.pet-bar.xp { --pb: var(--accent); }
.pet-bar .pb-name { display: flex; align-items: center; gap: 6px; }
.pet-bar .pb-name .ic { width: 16px; height: 16px; flex: none; color: var(--pb); }
.pet-meter { display: block; height: 6px; border-radius: 999px; background: var(--inset); overflow: hidden; }
.pet-meter i { display: block; height: 100%; border-radius: inherit; background: var(--pb); transition: width 0.4s var(--ease-out); }
.pet-meter.low i { background: var(--danger); }
.snacks { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.snack { min-height: 50px; border-radius: 16px; border: var(--hair) solid var(--line); background: var(--inset); font-size: 1.6rem; }
.snack:active { transform: scale(0.97); background: var(--accent-soft); }
/* la cameretta, il livello e le azioni */
.pet-head { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 6px; }
.pet-head .pet-name { margin: 0; }
.pet-level { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 0.78rem; font-weight: 700; color: #5a3a00; background: linear-gradient(160deg, #ffe08a, #ffc94a); box-shadow: 0 1px 0 rgba(90, 58, 0, 0.25); vertical-align: middle; }
.pet-level.small { font-size: 0.68rem; padding: 1px 7px; }
/* (niente sfondo chiaro né bordo dentro il riquadro: sui bordi arrotondati e nell'ultima frazione di pixel sotto la tela
   spuntavano come una riga bianca sotto il pavimento, al buio su iPhone; quello che spunta ora è il colore della card) */
.room-wrap { position: relative; aspect-ratio: 160 / 107; border-radius: var(--r-md); overflow: hidden; margin: 0 -4px; background: transparent; }
.room-canvas { display: block; width: 100%; height: 100%; cursor: pointer; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.pet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 4px; }
.pet-home .snacks { margin-top: 10px; }
/* il diario del pet */
.pet-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ps { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1px; padding: 10px 4px; border-radius: 16px; background: var(--accent-soft); }
.ps-emoji { font-size: 1.35rem; }
.ps b { font-size: 1.25rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ps small { font-size: 0.68rem; color: var(--ink-2); line-height: 1.2; }
/* guardaroba con le figurine */
.wardrobe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
.acc {
  display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; font-size: 0.78rem; font-weight: 600; color: var(--ink-2);
  border: var(--hair) solid var(--line); background: var(--inset); border-radius: 16px; padding: 8px 6px 10px; min-height: 84px;
}
.acc-pic { position: relative; height: 82px; display: flex; align-items: flex-end; justify-content: center; }
.acc-pic .mascot { width: 52px; height: auto; }
.acc-pic.silhouette .mascot { filter: brightness(0); opacity: 0.16; }
@media (prefers-color-scheme: dark) { .acc-pic.silhouette .mascot { filter: brightness(0) invert(1); opacity: 0.13; } }
.acc-pic i { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -30%); font-style: normal; font-size: 1.2rem; }
.acc-name { line-height: 1.2; }
.acc[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.acc[aria-pressed="true"] .acc-pic .mascot { animation: bob 3s ease-in-out infinite; transform-origin: 50% 90%; }
.acc.locked { background: var(--inset); border-style: dashed; color: var(--muted); }
.acc small { font-weight: 400; font-size: 0.7rem; line-height: 1.2; }
.acc .meter { width: 80%; height: 5px; margin: 4px 0 0; }
.acc-count { font-variant-numeric: tabular-nums; }
.acc-on { color: var(--accent-text); font-weight: 700 !important; }
/* collezione dei pesci */
.fish-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.fish { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 8px 4px; border-radius: 16px; background: color-mix(in srgb, #5cbce0 14%, var(--card)); }
.fish span { font-size: 1.6rem; }
.fish b { font-size: 0.72rem; line-height: 1.2; }
.fish small { font-size: 0.68rem; color: var(--muted); }
.fish.unknown { background: var(--inset); border: 1px dashed var(--line); }
.fish.unknown span { opacity: 0.5; }

/* --- la fogliolina in Oggi e nella scheda Pet --- */
.pet-card { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.pet-mini { position: relative; border: 0; background: var(--accent-soft); border-radius: var(--r-md); padding: 4px; flex: none; display: grid; place-items: center; }
.pet-mini .mascot { animation: bob 4s ease-in-out infinite; transform-origin: 50% 90%; }
.pet-mini.squish > .mascot { animation: squish 0.45s ease-out; }
.pet-mini .fx { font-size: 1.3rem; }
.pet-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pet-card-name { align-self: flex-start; border: 0; background: none; padding: 0; font-weight: 700; font-size: 1.05rem; color: var(--ink); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pet-card-name span { color: var(--accent-text); }
.pet-card-btns { display: flex; flex-direction: column; gap: 6px; }
.pet-card-btns .snack { width: 46px; min-height: 42px; font-size: 1.3rem; }
.pet-bar.small { grid-template-columns: 1fr; gap: 0; margin: 5px 0 0; }
.pet-bar.small .pb-name { display: none; }
.pet-bar.small .pet-meter { height: 4px; }
.pet-name { display: block; margin: 0 auto 4px; border: 0; background: none; color: var(--ink); font-size: 1.3rem; font-weight: 700; padding: 4px 10px; border-radius: var(--r-md); }
.pet-name span { font-size: 0.95rem; }
.pet-name .ic { width: 18px; height: 18px; vertical-align: -0.1em; margin-left: 2px; color: var(--muted); }
.shop-shells { white-space: nowrap; }
.pet-name:active { background: var(--accent-soft); }
.pet-home .pet-stage { margin-top: 0; }
.friend-pet { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: var(--hair) solid var(--line); }
.friend-pet:first-of-type { border-top: 0; }
.friend-pet > .mascot { animation: bob 4s ease-in-out infinite -2s; transform-origin: 50% 90%; }
.friend-pet-main { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 1px; }
.friend-pet-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.friend-pet .btn { flex: none; padding: 0 12px; }

/* --- l'isoletta: gioco in pixel art --- */
.pix { image-rendering: pixelated; image-rendering: crisp-edges; }
.isle-wrap { margin: 4px 0 14px; border-radius: var(--radius); overflow: hidden; border: var(--hair) solid var(--glass-edge); box-shadow: var(--shadow); background: var(--card); }
.isle-stage { position: relative; aspect-ratio: 5 / 4; background: var(--sea, #2f7cc0); overflow: hidden; }
/* un velo più scuro ai bordi, come in un gioco (sotto i pulsanti) */
.isle-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 58%, rgba(8, 22, 60, 0.22) 100%); }
.isle-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; -webkit-user-select: none; user-select: none; }
.isle-canvas:active { cursor: grabbing; }
.isle-shells, .isle-full, .isle-center, .isle-sound {
  position: absolute; top: 10px; z-index: 1; border: 0; border-radius: 999px; font-weight: 700; color: #2a1d48;
  background: rgba(255, 255, 255, 0.88); box-shadow: 0 2px 8px rgba(20, 30, 70, 0.2);
}
.isle-shells { left: 10px; padding: 5px 11px; font-size: 0.9rem; }
.isle-full { right: 10px; width: 38px; height: 38px; font-size: 1.15rem; display: grid; place-items: center; }
.isle-center { right: 56px; width: 38px; height: 38px; font-size: 1.05rem; display: grid; place-items: center; }
.isle-sound { right: 102px; width: 38px; height: 38px; font-size: 1.05rem; display: grid; place-items: center; }
.isle-tools { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 10px 12px 0; }
.isle-tools .btn { padding: 0 12px; }
.isle-hint { margin: 8px 16px 12px; font-size: 0.76rem; line-height: 1.4; color: var(--muted); text-align: center; }
/* schermo intero */
.isle-wrap.full { position: fixed; inset: 0; z-index: 25; margin: 0; border: 0; border-radius: 0; box-shadow: none; background: var(--sea, #2f7cc0); }
/* il mare arriva fino ai bordi dello schermo; i pulsanti galleggiano sopra */
.isle-wrap.full .isle-stage { position: absolute; inset: 0; aspect-ratio: auto; }
/* dentro la capanna: la cameretta sopra l'isola */
.isle-house { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; padding: 12px; background: rgba(30, 20, 12, 0.55); }
.isle-house[hidden] { display: none; }
.isle-house-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 2px 4px 8px; }
.isle-house .room-wrap { margin: 0; }
.isle-wrap.full .isle-house { padding-top: calc(env(safe-area-inset-top) + 60px); }
.isle-wrap.full .isle-shells, .isle-wrap.full .isle-full, .isle-wrap.full .isle-center, .isle-wrap.full .isle-sound { top: calc(env(safe-area-inset-top) + 10px); }
.isle-wrap.full .isle-tools {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; pointer-events: none;
  padding: 10px 10px calc(var(--sab) + 14px);
}
.isle-wrap.full .isle-tools .btn { pointer-events: auto; box-shadow: 0 3px 12px rgba(10, 30, 70, 0.28); }
.isle-wrap.full .isle-hint { display: none; }
body.isle-full-open { overflow: hidden; }
/* il meteo sull'isola: l'etichetta sotto le conchiglie, la riga che spiega da dove viene, l'invito una tantum */
.isle-meteo { position: absolute; top: 48px; left: 10px; z-index: 1; border: 0; border-radius: 999px; padding: 4px 10px; font-weight: 700; font-size: 0.85rem;
  color: #2a1d48; background: rgba(255, 255, 255, 0.82); box-shadow: 0 2px 8px rgba(20, 30, 70, 0.2); max-width: 60%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isle-meteo-why { position: absolute; top: 82px; left: 10px; right: 10px; z-index: 2; margin: 0; padding: 8px 12px; border-radius: var(--r-md); font-size: 0.82rem;
  color: #2a1d48; background: rgba(255, 255, 255, 0.94); box-shadow: 0 2px 10px rgba(20, 30, 70, 0.25); }
.isle-meteo-why .btn { margin-top: 6px; }
.isle-meteo-ask { position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2; padding: 10px 12px; border-radius: var(--r-md); font-size: 0.88rem;
  color: #2a1d48; background: rgba(255, 255, 255, 0.95); box-shadow: 0 4px 16px rgba(20, 30, 70, 0.3); }
.isle-meteo-ask p { margin: 0 0 8px; }
.isle-wrap.full .isle-meteo { top: calc(env(safe-area-inset-top) + 48px); }
.isle-wrap.full .isle-meteo-why { top: calc(env(safe-area-inset-top) + 82px); }
.isle-wrap.full .isle-meteo-ask { bottom: calc(var(--sab) + 70px); }
/* Apple Salute: istruzioni del Comando, testo incollato, barre con / senza (stessi colori di «Sonno e umore») */
.hl-steps { margin: 0; padding: 0 16px 12px 36px; font-size: var(--fs-cap); line-height: 1.45; color: var(--ink-2); }
.hl-steps li + li { margin-top: 8px; }
.hl-steps b { color: var(--ink); font-weight: 600; }
.hl-steps code { font: 600 var(--fs-cap)/1 ui-monospace, Menlo, monospace; color: var(--ink); background: var(--surface); border-radius: 4px; padding: 0 4px; overflow-wrap: anywhere; }
.hl-text { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 0; padding: 8px 12px; border-radius: var(--r-md); background: var(--surface); color: var(--ink); }
.hl-text b { font-weight: 600; }
.hl-guide { margin-top: 16px; padding: 16px; border-radius: var(--r-md); background: var(--inset); scroll-margin-top: 84px; }
.hl-guide h4 { margin: 16px 0 8px; font-size: var(--fs-h2); font-weight: 600; color: var(--ink); }
.hl-guide p, .hl-guide-list { font-size: var(--fs-ui); line-height: 1.5; color: var(--ink-2); }
.hl-guide p { margin: 8px 0; }
.hl-guide .hl-guide-step { margin: 0; font-size: var(--fs-cap); color: var(--ink-2); }
.hl-guide-progress { display: flex; gap: 4px; margin-top: 8px; }
.hl-guide-progress i { flex: 1; height: 4px; border-radius: 999px; background: var(--line); }
.hl-guide-progress i.done { background: var(--accent); }
.hl-guide-list { margin: 8px 0; padding-left: 20px; }
.hl-guide-list li + li { margin-top: 8px; }
.hl-guide code { overflow-wrap: anywhere; color: var(--ink); }
.hl-guide .hl-guide-tip { padding: 12px; border-radius: var(--r-md); background: var(--surface); }
.hl-variable-list { padding: 12px 12px 12px 32px; font-size: var(--fs-ui); line-height: 1.5; }
.hl-guide-nav { margin-top: 16px; }
.recovery-copy { margin: 12px 0; }
.recovery-copy > b { display: block; margin-bottom: 4px; }
.hl-help { margin: 12px 0 4px; padding: 4px 16px 12px; border-radius: var(--r-md); background: var(--inset); }
.hl-help .hl-k .muted { font-weight: 400; }
.hl-list { margin: 8px 0 0; padding: 0; list-style: none; font-size: var(--fs-cap); line-height: 1.45; color: var(--ink-2); }
.hl-list li { display: flex; gap: 8px; align-items: flex-start; }
.hl-list li + li { margin-top: 8px; }
.hl-list .ic { flex: none; width: 20px; height: 20px; color: var(--ink-2); }
.hl-raw { margin-top: 12px; font-size: var(--fs-cap); color: var(--ink-2); }
.hl-raw summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; }
.hl-raw pre { margin: 0; padding: 8px 12px; border-radius: var(--r-md); background: var(--surface); font: var(--fs-micro)/1.5 ui-monospace, Menlo, monospace; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.hl-paste { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 8px; }
.hl-paste textarea { box-sizing: border-box; width: 100%; border: var(--hair) solid var(--line); border-radius: var(--r-md); background: var(--inset); padding: 10px 14px; font: inherit; font-size: 16px; color: var(--ink); resize: vertical; }
.cmp-bar .cmp-con { background: var(--f1); }
.cmp-bar .cmp-senza { background: var(--f2); }
.cmp.hl-cmp { margin: 8px 0 12px; }
.hl-k { margin: 12px 0 0; font-size: var(--fs-cap); font-weight: 600; color: var(--ink-2); }
.hl-feel { margin: 8px 0; color: var(--ink-2); }
.meteo-results { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 8px; }
#meteo-search input { flex: 1; min-width: 0; }
/* semi e bancarella */
.seed-list, .shop { display: grid; gap: 8px; margin: 10px 0; }
.shop { grid-template-columns: repeat(2, 1fr); }
.seed { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: var(--hair) solid var(--line); border-radius: 16px; background: var(--inset); color: var(--ink); }
.seed-emoji, .shop-emoji { font-size: 1.8rem; }
.seed-text { flex: 1; display: flex; flex-direction: column; }
.seed-text small, .shop-item small { color: var(--muted); font-size: 0.78rem; }
.price { font-weight: 700; color: var(--accent-text); white-space: nowrap; }
.seed:disabled, .shop-item:disabled { opacity: 0.45; }
.shop-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 8px; border: var(--hair) solid var(--line); border-radius: 16px; background: var(--inset); color: var(--ink); text-align: center; }
.shop-item.owned { background: var(--accent-soft); border-color: var(--accent); }

/* scelta del pet */
.species { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0 12px; }
.species button {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 2px; padding: 8px 4px 10px; border-radius: 16px;
  border: var(--hair) solid var(--line); background: var(--inset); color: var(--ink-2); font-size: 0.8rem; font-weight: 700;
}
.species button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }

/* --- la cartuccia --- */
/* il pod disegnato (podArt in icons.js): bocchino scuro, vetro con l'olio ambrato al livello --lvl, batteria viola */
.pod-art { flex: none; display: block; overflow: visible; }
.pod-s { width: 12px; height: 36px; }
.pod-l { width: 52px; height: 156px; }
.pod-mouth { fill: #2c2844; }
.pod-collar { fill: #cdc9df; }
.pod-glass { fill: rgba(170, 205, 235, 0.24); stroke: rgba(44, 40, 68, 0.38); stroke-width: 1.2; }
.pod-oil { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(var(--lvl)); transition: transform 0.45s var(--ease-out); animation: pod-fill 1.2s var(--ease-out); }
.pod-surf-g { transform: translateY(calc((1 - var(--lvl)) * 38.6px)); transition: transform 0.45s var(--ease-out); animation: pod-rise 1.2s var(--ease-out); }
.pod-surf { fill: #ffe3a6; transform-box: fill-box; transform-origin: 50% 50%; animation: pod-wave 5s ease-in-out infinite; }
.pod-post { fill: rgba(60, 50, 80, 0.22); }
.pod-shine { fill: rgba(255, 255, 255, 0.55); }
.pod-bat-a { stop-color: #9472ff; } .pod-bat-b { stop-color: #5a33d6; }
.pod-seam { stroke: rgba(255, 255, 255, 0.28); stroke-width: 0.8; }
.pod-led { fill: #b9ffdb; }
.pod-art.low .pod-led { fill: #ffb238; }
@media (prefers-color-scheme: dark) {
  .pod-mouth { fill: #4b4569; } .pod-collar { fill: #8f8aa8; }
  .pod-glass { fill: rgba(170, 205, 235, 0.12); stroke: rgba(220, 215, 255, 0.4); }
  .pod-shine { fill: rgba(255, 255, 255, 0.3); }
}
@keyframes pod-fill { from { transform: scaleY(0); } }
@keyframes pod-rise { from { transform: translateY(38.6px); } }
@keyframes pod-wave { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.cart-big { display: flex; align-items: center; gap: 20px; margin: 8px 0 12px; }
/* il foglio del pod: il conto in breve, in una vaschetta, e la correzione a mano */
.pod-calc { margin: 12px 0; padding: 12px 16px; background: var(--inset); border-radius: var(--r-md); }
.pod-calc h3 { margin: 0 0 8px; }
.pod-calc h3 + .calc-list { margin-top: 0; }
.calc-list { margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 4px; font-size: var(--fs-ui); line-height: 1.4; }
.calc-list li { padding-left: 12px; position: relative; }
.calc-list li::before { content: ''; position: absolute; left: 0; top: 0.6em; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }
.pod-fix { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 12px; align-items: end; }
.pod-fix .field { margin: 0; min-width: 0; width: auto; max-width: none; }
.pod-fix .field input { width: 100%; min-width: 0; box-sizing: border-box; }
.pod-fix .btn, .pod-fix .link, .pod-fix .error { grid-column: 1 / -1; justify-self: start; }
/* la scorta: la cima o il panetto in un tondo, con quanto ne resta sotto */
.isle-loading { margin: 4px 0 14px; aspect-ratio: 1 / 1; display: grid; place-items: center; background: var(--sea, #2f7cc0); color: #fff; font-weight: 600; border-radius: var(--radius); }
.predict { width: 100%; display: flex; align-items: center; gap: 12px; margin: 12px 0; padding: 12px 16px; font-size: var(--fs-ui); line-height: 1.35; color: var(--ink); text-align: left;
  background: var(--card); border: var(--hair) solid var(--glass-edge); border-radius: var(--r-md); box-shadow: var(--shadow); transition: transform 0.15s var(--ease-out); }
.predict:active { transform: scale(0.97); transition-duration: 0.1s; }
.predict-ic { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.predict-ic .ic { width: 20px; height: 20px; }
.predict-text { flex: 1; min-width: 0; }
.predict-text small { display: block; margin-top: 2px; font-size: var(--fs-cap); color: var(--muted); }
.targets { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; margin: 4px 0 6px; }
.target { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 10px 12px; border-radius: var(--r-md); border: var(--hair) solid var(--line); background: var(--inset); text-align: left; }
.target b { font-size: 0.95rem; } .target span { font-size: 0.85rem; color: var(--ink-2); } .target small { font-size: 0.72rem; color: var(--muted); }
.target[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.strain-list { list-style: none; padding: 0; margin: 6px 0 10px; display: grid; gap: 6px; }
.strain-list li { display: flex; align-items: center; gap: 6px; }
.strain-list li > span { flex: 1; padding: 8px 12px; background: var(--inset); border-radius: var(--r-md); }
.strain-pick { flex: 1; text-align: left; padding: 10px 12px; border-radius: var(--r-md); border: var(--hair) solid var(--line); background: var(--inset); font-size: 0.95rem; }
.strain-pick[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); font-weight: 600; }
.strain-form { display: grid; grid-template-columns: minmax(0, 1fr) 6.5em; gap: 8px; align-items: end; margin: 6px 0 4px; }
.strain-form .field input { min-width: 0; width: 100%; }
.strain-form .btn { grid-column: 1 / -1; justify-self: start; }
.strain-form .error { grid-column: 1 / -1; }
.level-pick { display: flex; align-items: center; gap: 18px; margin: 8px 0; }
.level-pick > div { flex: 1; min-width: 0; }
.level-pick input[type="range"] { display: block; width: 100%; margin: 0; box-sizing: border-box; accent-color: #e39a2f; height: 32px; }
.level-val { margin: 2px 0 8px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cart-big p { margin: 2px 0; }
.cart-pct { font-size: 2rem; font-weight: 700; line-height: 1; }
#sheet .seg + .field { margin-top: 10px; }
.strain-form .sub-seg { grid-column: 1 / -1; margin: 0; min-width: 0; width: 100%; box-sizing: border-box; }
.strain-form .sub-seg button { min-width: 0; }
.pod-hist { list-style: none; padding: 0; margin: 6px 0 14px; }
.pod-hist > li { padding: 8px 0; border-top: var(--hair) solid var(--line); font-size: 0.9rem; }
.pod-hist > li:first-child { border-top: 0; }
.pod-hist > li.current .pod-head b { color: var(--accent-text); }
.pod-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pod-hist p { margin: 2px 0 0; }
.pod-items { list-style: none; padding: 0; margin: 4px 0 0 4px; }
.pod-items li { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.82rem; color: var(--ink-2); }

/* --- il riepilogo della domenica --- */
.recap { position: relative; }
.recap h2 { margin-right: 54px; }
.recap-pet { position: absolute; top: 10px; right: 12px; }
.recap-pet .mascot { animation: bob 3s ease-in-out infinite; transform-origin: 50% 90%; }
.recap-row { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline; padding: 7px 0; border-top: var(--hair) solid var(--line); }
.recap-row b { font-size: 1.05rem; }
.recap-row small { grid-column: 1 / -1; font-size: 0.78rem; }
.recap-row small.good { color: var(--accent-text); }
.recap-row small.bad { color: var(--warn); }
.recap-row small.same { color: var(--muted); }
.recap .btn { margin-top: 8px; }
.spend-cta .btn { margin-top: 4px; }
.scope.spend { display: flex; align-items: baseline; justify-content: space-between; margin-top: 14px; }
.scope .link.small { display: inline; width: auto; margin: 0; font-size: 0.8rem; padding: 0 4px; }

/* --- il pet che tossisce o è pimpante --- */
@keyframes cough { 0%, 70%, 100% { transform: none; } 74% { transform: translate(-2px, 1px) scale(1.04, 0.95); } 78% { transform: translate(2px, 0) scale(0.97, 1.03); } 82% { transform: translate(-1px, 1px) scale(1.03, 0.96); } 86% { transform: none; } }
@keyframes lively { 0%, 100% { transform: translateY(0); } 30% { transform: translateY(-9px) rotate(-3deg); } 45% { transform: translateY(0) scale(1.06, 0.94); } 60% { transform: translateY(-4px) rotate(2deg); } 75% { transform: translateY(0); } }
.pet-stage:not(.squish) .mascot.cough, .pet-mini:not(.squish) .mascot.cough, .friend-pet > .mascot.cough { animation: cough 2.4s ease-in-out infinite; }
.pet-stage:not(.squish) .mascot.lively, .pet-mini:not(.squish) .mascot.lively, .friend-pet > .mascot.lively { animation: lively 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .mascot.cough, .mascot.lively, .recap-pet .mascot { animation: none !important; } }

.shop-pic { height: 66px; width: auto; max-width: 100%; object-fit: contain; image-rendering: pixelated; margin: -2px auto 2px; }
.company { margin-top: 6px; }
.entry-with { white-space: nowrap; }
.isle-pets .check { margin: 6px 0; }

/* Crescita del pet (scheda Pet): le fasi raggiunte a colori, quelle da raggiungere sbiadite */
.grow-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 6px 0 12px; }
.grow-step { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 4px; border-radius: var(--r-md); }
.grow-step.now { background: color-mix(in srgb, var(--accent, #7b55e0) 14%, transparent); }
.grow-pic { height: 64px; display: flex; align-items: flex-end; }
.grow-pic .mascot { width: 40px; height: auto; }
.grow-step.locked .grow-pic .mascot { filter: grayscale(1); opacity: 0.35; }
.grow-step small { font-weight: 600; }
.grow-of { display: block; }

/* --- il resoconto del mese (storie) --- */
.month-card { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.month-card b { display: block; font-size: 1.05rem; }
.month-card small { color: var(--muted); }
.month-spark { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; color: var(--accent-text); background: var(--accent-soft); }
.month-spark .ic { width: 20px; height: 20px; }
.chips.months .chip { text-transform: none; }
.story { position: fixed; inset: 0; z-index: 1000; color: #fff; overflow: hidden; touch-action: manipulation; user-select: none;
  padding: max(18px, env(safe-area-inset-top)) 16px max(18px, var(--sab)); }
.st-bars { position: absolute; top: max(10px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; gap: 4px; z-index: 3; }
.st-bars i { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, 0.3); }
.st-bars i.done { background: #fff; }
.st-close { position: absolute; top: calc(max(10px, env(safe-area-inset-top)) + 12px); right: 10px; z-index: 4; border: 0; background: none;
  color: #fff; font-size: 1.4rem; width: 44px; height: 44px; display: grid; place-items: center; }
.st-close .ic { width: 24px; height: 24px; }
.st-slide { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 70px 28px 60px; gap: 6px; animation: st-in 0.35s ease; }
.st-slide[hidden] { display: none; }
@keyframes st-in { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: none; } }
.st-slide h2 { font-size: 1.7rem; margin: 10px 0 4px; line-height: 1.2; }
.st-kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; opacity: 0.8; margin: 0 0 8px; }
.st-big { font-size: 5rem; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }
.st-emoji { display: grid; place-items: center; margin: 8px 0; }
.st-emoji .ic { width: 72px; height: 72px; stroke-width: 1.4; }
.st-label { font-size: 1.2rem; font-weight: 600; }
.st-sub { opacity: 0.85; margin: 2px 0; }
.st-cmp { font-size: 1.05rem; margin: 14px 0 2px; }
.st-head { font-size: 1.15rem; opacity: 0.95; }
.st-hint { opacity: 0.6; font-size: 0.85rem; margin-top: 30px; }
.st-good { background: rgba(255, 255, 255, 0.18); padding: 4px 10px; border-radius: 999px; }
.st-same { opacity: 0.85; }
.st-pet { filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.25)); }
.st-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; width: 100%; max-width: 300px; position: relative; z-index: 3; }
.st-actions .btn { background: rgba(255, 255, 255, 0.16); color: #fff; }
.st-actions .btn.primary { background: #fff; color: #3b2a7a; }
.st-nav { position: absolute; top: 60px; bottom: 0; z-index: 2; border: 0; background: none; padding: 0; }
.st-prev { left: 0; width: 33%; }
.st-next { right: 0; width: 67%; }
.story.last .st-nav { bottom: 50%; }
/* sfondi: canne verdi, tiri viola, tu blu, spesa arancio, momenti con m1–m4 */
.story { background: #2b2350; }
.st-intro, .st-outro { background: linear-gradient(160deg, #3b2a7a, #1f5c46); }
.st-green { background: linear-gradient(160deg, #2e9b57, #1c6b3c); }
.st-calm { background: linear-gradient(160deg, #1baf7a, #0f6d6a); }
.st-violet { background: linear-gradient(160deg, #7b55e0, #46289b); }
.st-moment { background: linear-gradient(160deg, #6250d6, #2b2350); }
.st-blue { background: linear-gradient(160deg, #2a78d6, #1b4b8c); }
.st-orange { background: linear-gradient(160deg, #eb6834, #a8431c); }

/* --- grafici illustrati (vivid.js) --- */
.vivid { display: block; overflow: visible; margin: 0 auto; }
.vivid .tick { fill: var(--tick); font-size: 11px; font-variant-numeric: tabular-nums; }
.vivid .tick.strong { fill: var(--ink-2); font-weight: 600; }
.vivid .tick.over { fill: var(--warn-text); }
.vivid .hit { fill: transparent; outline: none; }
.vivid rect.hit.active, .vivid rect.hit:focus-visible { fill: var(--hover); }
.vivid circle.hit.active, .vivid circle.hit:focus-visible { stroke: var(--ink-2); stroke-width: 1.5; }
/* orologio */
.vivid .clock-face { fill: color-mix(in srgb, var(--sky-a) 40%, var(--surface)); }
.vivid .clock-tick { stroke: var(--axis); stroke-width: 1.5; stroke-linecap: round; }
.vivid .petal { stroke: var(--surface); stroke-width: 1.5; }
.vivid .petal-empty { fill: var(--grid); }
.vivid .m-mattina { fill: var(--m1); } .vivid .m-pomeriggio { fill: var(--m2); } .vivid .m-sera { fill: var(--m3); } .vivid .m-notte { fill: var(--m4); }
.vivid .clock-hand { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.vivid .clock-hand-dot { fill: var(--ink); stroke: var(--surface); stroke-width: 2; }
.vivid .clock-big { fill: var(--ink); font-family: var(--display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.v-petal { animation: petal-in 0.7s cubic-bezier(.2, .9, .3, 1.2) both; transform-box: view-box; transform-origin: 50% 50%; }
@keyframes petal-in { from { opacity: 0; transform: scale(0.7) rotate(-8deg); } }
/* pianta */
.vivid.plant { overflow: visible; }
.plant .leaf path { stroke-width: 2; stroke-linejoin: round; }
.plant .leaf.on path:first-child { fill: var(--leaf-on); stroke: var(--leaf-ink); }
.plant .leaf.off path:first-child { fill: var(--leaf-off); stroke: var(--leaf-off-ink); }
.plant .leaf .vein { fill: none; stroke-width: 1.4; stroke-linecap: round; opacity: 0.5; }
.plant .leaf.on .vein { stroke: var(--leaf-ink); } .plant .leaf.off .vein { stroke: var(--leaf-off-ink); }
.plant .plant-stem { fill: none; stroke: var(--stem); stroke-width: 4; stroke-linecap: round; }
.plant .plant-pot { fill: var(--pot); } .plant .plant-rim { fill: var(--pot-rim); }
.plant .plant-shadow { fill: var(--ink); opacity: 0.08; }
.v-leaf { animation: leaf-in 0.8s cubic-bezier(.2, .9, .3, 1.4) both, sway 5s ease-in-out 0.8s infinite; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes leaf-in { from { transform: scale(0.2); opacity: 0; } }
@keyframes sway { 50% { transform: rotate(4deg); } }
.plant-row { display: flex; justify-content: space-between; gap: 2px; margin: 6px 0 2px; }
.plant-cell { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; text-align: center; border-radius: var(--r-md); padding: 2px 0 4px; outline: none; }
.plant-cell:focus-visible, .plant-cell.active { background: var(--hover); }
.plant-cell b { font-size: 0.95rem; font-variant-numeric: tabular-nums; margin-top: -2px; }
.plant-cell span { font-size: 0.75rem; color: var(--muted); }
.plant-cell small { font-size: 0.75rem; color: var(--ink-2); }

/* --- Andamento: sezioni e righe che aprono i dettagli --- */
.subnav {
  position: sticky; top: var(--top-safe); z-index: 5; display: flex; gap: 4px; padding: 5px; margin: 0 0 12px;
  background: var(--glass-strong); border: var(--hair) solid var(--glass-edge); backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  border-radius: 999px; box-shadow: var(--depth-2);
}
.subnav button { flex: 1; border: 0; background: none; border-radius: 999px; padding: 8px 4px; font-weight: 600; font-size: var(--fs-ui); color: var(--muted); min-height: 40px;
  transition: background-color 0.25s var(--ease-out), color 0.25s, transform 0.15s var(--ease-out), box-shadow 0.3s; }
.subnav button:active { transform: scale(0.97); }
.subnav button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(30, 20, 90, 0.1), 0 3px 8px -3px rgba(30, 20, 90, 0.18); }
@media (prefers-color-scheme: dark) {
  .subnav button[aria-selected="true"] { background: rgba(255, 255, 255, 0.14); color: #fff; box-shadow: inset 0 0 0 var(--hair) rgba(255, 255, 255, 0.2); }
}
.more-list { display: grid; gap: 8px; margin: 12px 0; }
.more-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border-radius: var(--r-md);
  background: var(--card); box-shadow: var(--depth-1); border: var(--hair) solid var(--glass-edge); padding: 12px 16px; min-height: 64px;
  transition: transform 0.15s var(--ease-out), background-color 0.2s;
}
.more-row:active { transform: scale(0.97); transition-duration: 0.12s; }
.more-emoji { font-size: 1.3rem; flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.more-emoji .ic { width: 20px; height: 20px; }
.more-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.more-text b { font-size: var(--fs-body); font-weight: 600; line-height: 1.25; }
.more-text small { color: var(--muted); font-size: var(--fs-cap); line-height: 1.3; }
.more-go { color: var(--muted); line-height: 0; transition: transform 0.15s var(--ease-out); }
.more-go .ic { width: 18px; height: 18px; }
.more-row:active .more-go { transform: translateX(3px); }
.hero .meter-note { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; text-align: center; }
.stat-row div { background: var(--inset); border-radius: var(--r-md); padding: 12px 4px; display: flex; flex-direction: column; gap: 2px; }
.stat-row b { font-size: 22px; line-height: 1.1; }
.stat-row b small { font-size: 0.75rem; font-weight: 500; color: var(--ink-2); }
.stat-row span { font-size: var(--fs-cap); color: var(--ink-2); }
.moments-legend b { color: var(--ink); }
.tol-hero { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; }
.tol-hero .big-stat { margin: 2px 0 0; }
.pause-plant { float: right; margin: -8px -6px 0 6px; }
.how-text p { margin: 8px 0; }
.tol-mini { float: right; margin: -6px -6px 0 6px; }

/* sfumatura del voto, sotto i gradini */
.nuance { display: flex; justify-content: center; gap: 6px; margin: 8px 0 0; }
.nuance button {
  border: var(--hair) solid var(--line); background: var(--inset); color: var(--ink-2); border-radius: 999px;
  padding: 5px 12px; font-size: 0.82rem; font-weight: 600; min-height: 32px;
}
.nuance button[aria-checked="true"] { background: var(--accent-soft); color: var(--accent-text); border-color: var(--accent); }
.nuance button:disabled { opacity: 0.35; }
.nuance-tag { font-size: 0.82rem; font-weight: 600; color: var(--accent-text); }
.vivid .clock-small { fill: var(--ink-2); font-size: 11px; }

/* settimana: colonne, anello, area; calendario a quadratini */
.vivid .grid { stroke: var(--grid); stroke-width: 1; }
.vivid .axis { stroke: var(--axis); stroke-width: 1; }
.vivid path.s1, .vivid rect.s1 { fill: var(--s1); } .vivid path.s2, .vivid rect.s2 { fill: var(--s2); }
.v-grow { animation: grow 0.7s cubic-bezier(.2, .8, .2, 1) both; transform-box: view-box; }
@keyframes grow { from { transform: scaleY(0); } }
.vivid .ring-track { fill: none; stroke: var(--inset); stroke-width: 14; }
.vivid .bar-track { fill: var(--inset); }
.vivid .ring-arc { fill: none; stroke-width: 14; }
.vivid .ring-arc.s1 { stroke: var(--s1); color: var(--s1); } .vivid .ring-arc.s2 { stroke: var(--s2); color: var(--s2); }
.week-bars .s1 { color: var(--s1); } .week-bars .s2 { color: var(--s2); }
.vivid.ring-only .ring-big { font-family: var(--display); font-size: 52px; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: proportional-nums; }
.vivid.ring-only .ring-track, .vivid.ring-only .ring-arc { stroke-width: 10; }
.vivid.ring-only .clock-small { font-size: 12.5px; font-weight: 600; fill: var(--muted); }
.vivid .ring-limit { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.vivid .ring-big { fill: var(--ink); font-family: var(--display); font-size: 30px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: proportional-nums; }
.vivid .ring-free { fill: var(--sky-free); } .vivid .ring-future { fill: var(--grid); }
.v-draw { animation: draw 0.9s cubic-bezier(.3, .7, .2, 1) both; }
@keyframes draw { from { stroke-dasharray: 0 100; } }
.vivid .h0 { fill: var(--h0); } .vivid .h1 { fill: var(--h1); } .vivid .h2 { fill: var(--h2); }
.vivid .h3 { fill: var(--h3); } .vivid .h4 { fill: var(--h4); } .vivid .h5 { fill: var(--h5); }
.vivid .cal-future { fill: none; stroke: var(--grid); stroke-width: 1.5; stroke-dasharray: 3 3; }
.vivid .cal-today { stroke: var(--ink); stroke-width: 2; }
.v-pop { animation: pop-in 0.4s ease-out both; transform-box: fill-box; transform-origin: center; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.6); } }

/* --- fluidità: pagine e scheletri --- */
/* cambio di scheda o di sezione: una dissolvenza breve (160 ms) con 6 px di salita, tutta la pagina insieme: niente
   ingressi di lato, niente cascate. La barra delle sezioni resta ferma (si può toccare subito). */
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
main.enter > * { animation: page-in 0.16s var(--ease-out) both; }
main.enter > .subnav { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* scheletri di caricamento: la forma di quello che arriva, con un riflesso che passa */
.skel { position: relative; overflow: hidden; background: var(--line); border-radius: 10px; }
.skel::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--card) 70%, transparent), transparent);
  animation: shimmer 1.3s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(100%); } }
.skel-card { display: grid; gap: 12px; }
.skel-line { height: 14px; width: 60%; }
.skel-line.short { width: 35%; }
.skel-num { height: 56px; width: 38%; border-radius: var(--r-md); }
.skel-block { height: 160px; border-radius: var(--r-md); }
.skel-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.skel-row .skel { height: 150px; border-radius: var(--radius); }
.isle-loading.skel { background: var(--sea, #2f7cc0); border-radius: var(--radius); }

/* --- il pet che accompagna: seduto sul bordo della barra in basso, a destra --- */
body > .buddy {
  position: fixed; z-index: 11; right: max(20px, calc((100% - var(--tabs-w)) / 2 + 8px));
  bottom: calc(var(--sab) + var(--tabs-gap) + var(--tabs-h) + 10px - 7px);
  display: flex; align-items: flex-end; gap: 6px; pointer-events: none;
}
.buddy-pet {
  position: relative; width: 48px; height: 50px; border: 0; padding: 0; background: none; flex: none; pointer-events: auto;
  display: grid; place-items: end center; transition: transform 0.15s var(--ease-out);
}
/* l'ombra sotto i piedi */
.buddy-pet::before { content: ""; position: absolute; bottom: 4px; left: 50%; width: 30px; height: 6px; margin-left: -15px; border-radius: 50%; background: rgba(30, 15, 70, 0.22); filter: blur(1px); }
.buddy-pet:active { transform: scale(0.97); transition-duration: 0.1s; }
.buddy-pet .mascot { position: relative; width: 36px; height: auto; margin-bottom: 6px; transform-origin: 50% 100%; animation: bob 4s ease-in-out infinite; image-rendering: pixelated; }
.buddy-pet.hop .mascot { animation: buddy-hop 0.7s var(--ease-out); }
@keyframes buddy-hop { 25% { transform: translateY(-10px) scale(0.95, 1.06); } 50% { transform: translateY(0) scale(1.1, 0.9); } 70% { transform: translateY(-3px); } }
.buddy-say {
  order: -1; margin-bottom: 26px; max-width: min(250px, calc(100vw - 110px)); padding: 9px 13px; border-radius: 16px 16px 6px 16px;
  background: var(--glass-strong); border: var(--hair) solid var(--glass-edge); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); color: var(--ink); font-size: 0.86rem; font-weight: 650; line-height: 1.3;
  box-shadow: var(--shadow-float), var(--edge);
  transform-origin: 100% 100%; transform: scale(0.6) translateY(8px); opacity: 0;
  transition: transform 0.15s var(--ease-out), opacity 0.2s var(--ease-out);
}
.buddy-say.show { transform: none; opacity: 1; }
body.signed-out > .buddy { display: none; }
body.buddy-on main { padding-bottom: calc(var(--tabs-h) + var(--tabs-gap) + var(--sab) + 76px); }
body.buddy-on .toast { bottom: calc(var(--tabs-h) + var(--tabs-gap) + var(--sab) + 64px); }

/* --- coriandoli dei traguardi --- */
.confetti { position: fixed; inset: 0; z-index: 50; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute; left: var(--x); top: -16px; width: 8px; height: 13px; border-radius: 2px; background: var(--c);
  animation: confetto var(--d, 1.6s) cubic-bezier(0.2, 0.6, 0.4, 1) var(--w, 0s) forwards; opacity: 0;
}
.confetti i:nth-child(3n) { width: 10px; height: 10px; border-radius: 50%; }
@keyframes confetto {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  100% { opacity: 0.9; transform: translate(var(--dx), 105vh) rotate(var(--r)); }
}

/* --- roba --- */
/* la scorta, la canna lasciata e data (sotto Canna e nel foglio "Che roba"), l'acquisto retroattivo */
.when-pick { display: grid; gap: 4px; }
.when-pick .seg { margin: 0; }
.when-pick .seg button { min-width: 0; font-size: 0.85rem; }
.when-pick .field { margin: 4px 0 0; }
.field-label { font-size: 0.88rem; color: var(--ink-2); }
.stash-cal .field { margin-bottom: 0; }
.stash-cal-row { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.stash-cal-row input[type="range"] { flex: 1; min-width: 0; height: 32px; accent-color: var(--accent); }
.stash-cal-row input[type="text"] { width: 4.5em; border: var(--hair) solid var(--line); border-radius: var(--r-md); background: var(--inset); padding: 8px 10px; font-size: 1rem; min-height: 42px; color: var(--ink); text-align: right; }
.stash-cal .row { margin-top: 6px; }
.buy-row { flex: 1; min-width: 0; text-align: left; padding: 8px 12px; background: var(--inset); border-radius: var(--r-md); font-size: 0.9rem; color: var(--ink); }
.retro-list { list-style: none; padding: 0; margin: 8px 0 12px; }
.retro-list li { border-bottom: var(--hair) solid var(--line); }
.retro-list .check { margin: 0; padding: 10px 0; align-items: center; }
.retro-list .check span { display: flex; flex-direction: column; }
.retro-list small { color: var(--muted); font-size: 0.8rem; }
.intakes li.intake-roba { flex-wrap: wrap; gap: 6px; padding-top: 0; }
.intake-roba select { flex: 1 1 40%; min-width: 0; min-height: 38px; border: var(--hair) solid var(--line); border-radius: 10px; background: var(--inset); color: var(--ink); padding: 4px 8px; font-size: 0.85rem; }
#buy-form select { min-height: 46px; border: var(--hair) solid var(--line); border-radius: var(--r-md); background: var(--inset); color: var(--ink); padding: 8px 10px; font-size: 1rem; }
.leave-parts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }

/* --- cuccioli --- (pupui.js: card della scheda Pet, foglio del nome, rifugio; il cucciolo accanto al pet che accompagna) */
.pup { display: grid; grid-template-columns: 60px 1fr auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-bottom: var(--hair) solid var(--line); }
.pup-main { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.pup-main b { font-family: var(--display); }
.pup-btns { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pup-pet { padding: 0; border: 0; background: none; }
.pup-pic { display: block; image-rendering: pixelated; background: var(--inset); border-radius: var(--r-md); }
.pup-pic.dark { filter: brightness(0) opacity(0.35); }
@media (prefers-color-scheme: dark) { .pup-pic.dark { filter: brightness(0) invert(1) opacity(0.16); } }
.pup-main .btn.ghost { padding: 0 4px; min-height: 0; }
.pup .meter { margin-top: 4px; }
.pup-count { min-width: 4.2em; text-align: right; white-space: nowrap; }
.pups .pet-actions { grid-template-columns: 1fr; }
.pup-hero { display: flex; justify-content: center; margin: 4px 0 10px; }
.pup-hero .pup-pic { background: none; }
.chip .pix { image-rendering: pixelated; vertical-align: middle; }
.buddy-pup { position: absolute; right: 78%; bottom: 2px; image-rendering: pixelated; pointer-events: none; }
.hero-pet:has(.buddy-pup) { position: relative; }
.hero-pet .buddy-pup { right: auto; left: 58%; }
.card.pups .pet-actions .btn { width: 100%; }
.facts small.eq-rule { color: var(--ink-2); font-size: var(--fs-ui); font-weight: 500; }
.facts b b { display: inline; }

/* --- casa --- */
/* la casa del pet (petroom.js): frecce delle stanze sopra la stanza, schermo intero, barretta di "Arreda" col magazzino */
.room-wrap { isolation: isolate; }
.room-nav { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
.room-nav > * { pointer-events: auto; }
.room-name { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); padding: 4px 12px; border-radius: 999px; background: var(--surface); color: var(--ink);
  font-size: var(--fs-cap); font-weight: 600; box-shadow: var(--depth-2); white-space: nowrap; pointer-events: none; }
.room-arrow, .room-full-btn { position: absolute; width: 44px; height: 44px; border: 0; border-radius: 999px; background: var(--glass-btn); color: var(--ink);
  font-family: inherit; font-size: var(--fs-big); font-weight: 600; line-height: 1; display: grid; place-items: center; box-shadow: inset 0 0 0 var(--hair) var(--glass-edge), var(--depth-1); cursor: pointer; }
.room-arrow { top: 50%; transform: translateY(-50%); }
.room-arrow.prev { left: 6px; }
.room-arrow.next { right: 6px; }
.room-arrow.locked { font-size: var(--fs-ui); opacity: 0.85; }
.room-arrow[hidden], .room-full-btn[hidden] { display: none; }
.room-full-btn { top: 8px; right: 8px; }
.room-nav.editing .room-arrow { display: none; }
.room-wrap.room-full { position: fixed; inset: 0; z-index: 60; margin: 0; border-radius: 0; aspect-ratio: auto; display: grid; place-items: center; background: var(--bg); }
.room-wrap.room-full .room-canvas { width: 100vw; height: 100dvh; }
.room-wrap.room-full .room-full-btn { top: calc(env(safe-area-inset-top) + 8px); right: 8px; width: 44px; height: 44px; }
.room-wrap.room-full .room-name { top: calc(env(safe-area-inset-top) + 14px); }
body.room-full-on { overflow: hidden; }
/* nella card la stanza è un quadro pulito: niente pulsanti sopra la pixel art. Sotto, una riga quieta come le altre
   righe dell'app: il nome della stanza (e «1 di 3») a sinistra, a destra i tondi di vetro ‹ › e ⤢ (44 px, icone di
   icons.js, niente ombre). Il disegno ha il raggio delle vaschette e un filo di bordo come il vetro delle card. */
.room-inline:not(.room-full) { aspect-ratio: auto; overflow: visible; border-radius: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.room-inline:not(.room-full) .room-canvas {
  aspect-ratio: 160 / 107; height: auto; border-radius: var(--r-md); box-shadow: 0 0 0 var(--hair) var(--glass-edge);
}
.room-inline:not(.room-full) .room-nav { position: static; inset: auto; display: flex; align-items: center; gap: 8px; min-height: 44px; }
.room-inline:not(.room-full) .room-name {
  position: static; transform: none; margin-right: auto; padding: 0 0 0 2px; background: none; box-shadow: none;
  font-size: var(--fs-ui); font-weight: 600; color: var(--ink); display: flex; align-items: baseline; gap: 8px;
}
.room-name small { font-size: var(--fs-cap); font-weight: 500; color: var(--muted); }
.room-inline:not(.room-full) .room-arrow, .room-inline:not(.room-full) .room-full-btn {
  position: static; transform: none; width: 44px; height: 44px; flex: none;
  background: var(--glass-btn); box-shadow: inset 0 0 0 var(--hair) var(--glass-edge);
}
.room-inline:not(.room-full) .room-arrow.locked { opacity: 1; color: var(--muted); }
/* a schermo intero e dentro casa dall'isola i tondi galleggiano sopra la stanza: vetro scuro, senza ombra pesante */
.room-arrow, .room-full-btn { transition: transform 0.15s var(--ease-out); }
.room-arrow:active, .room-full-btn:active { transform: scale(0.97); }
.room-arrow:active { transform: translateY(-50%) scale(0.97); }
.room-inline:not(.room-full) .room-arrow:active { transform: scale(0.97); }
.room-arrow .ic, .room-full-btn .ic { width: 20px; height: 20px; }
.room-wrap.room-full .room-name small, .isle-house .room-name small { margin-left: 6px; }
.room-tools { display: grid; gap: 8px; margin: 8px 0 0; padding: 8px; border-radius: var(--r-md); background: var(--inset); color: var(--ink); font-size: var(--fs-cap); line-height: 1.3; }
.room-tools[hidden] { display: none; }
.room-tools-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.room-tools-name { flex: 1; min-width: 0; }
.room-tools-name small { display: block; color: var(--muted); font-weight: 500; }
.room-stock { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scroll-snap-type: x proximity; }
.room-stock-item { flex: 0 0 auto; width: 72px; min-height: 72px; display: grid; justify-items: center; align-content: start; gap: 2px; padding: 4px; border: 0; border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; scroll-snap-align: start; box-shadow: var(--depth-1); }
.room-stock-item img { image-rendering: pixelated; width: 48px; height: 42px; }
.room-stock-item small { font-size: var(--fs-micro); line-height: 1.2; text-align: center; }
.room-stock-item.shop span { font-size: 28px; line-height: 42px; }
/* (le righe del negozio della casa e delle ricette sono <div>: la card del negozio dell'isola, più su, è un <button>
   centrato con bordo e fondo; qui si tolgono, se no le righe escono centrate e incorniciate) */
div.shop-item:not(.owned) { display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; align-items: center; padding: 8px 0; border: 0; border-bottom: var(--hair, 1px) solid var(--line); border-radius: 0; background: none; text-align: left; }
div.shop-item:not(.owned):last-of-type { border-bottom: 0; }
.shop-item > img.pix { image-rendering: pixelated; grid-row: span 2; background: var(--inset); border-radius: 10px; }
.shop-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.room-buy-emoji, .recipe-dish { grid-row: span 2; width: 64px; height: 56px; display: grid; place-items: center; font-size: 30px; background: var(--inset); border-radius: 10px; }
.recipe.off { opacity: 0.6; }
.isle-house-tools { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 8px; }
/* arredando il dito trascina i mobili: la pagina non scorre (se no il browser annulla il trascinamento a metà) */
.room-wrap.editing .room-canvas { touch-action: none; cursor: grab; }
.room-send { gap: 4px; }
.room-send > small { color: var(--muted); font-weight: 500; margin-right: 2px; }

/* dentro casa dall'isola: la stanza a tutto schermo (sopra tutta l'app), entrando le due ante della facciata si aprono
   (la schermata dell'isola tagliata a metà, isle.js) e la stanza si allarga dal riquadro dell'isola; uscendo al contrario */
.isle-house, .isle-wrap.full .isle-house { position: fixed; inset: 0; z-index: 60; padding: env(safe-area-inset-top) 0 var(--sab); display: flex; flex-direction: column;
  background: var(--surface); overflow: hidden; }
.isle-house[hidden] { display: none; }
/* la stanza riempie tutto lo schermo (parete e pavimento continuano: petroom.js + house.js roomExt); il titolo con Esci
   galleggia in alto sulla parete, i pulsanti in basso sul pavimento, come sull'isola */
.isle-house-head { position: absolute; z-index: 2; top: calc(env(safe-area-inset-top) + 10px); left: 12px; right: 12px; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--surface); box-shadow: var(--depth-2); }
.isle-house-title { font-size: var(--fs-ui); font-weight: 600; min-width: 0; }
.isle-house-main { position: absolute; inset: 0; }
.isle-house .room-wrap { position: absolute; inset: 0; width: auto; margin: 0; border-radius: 0; box-shadow: none; aspect-ratio: auto; background: transparent; }
.isle-house .room-full-btn { display: none; }
.isle-house .room-name { top: calc(env(safe-area-inset-top) + 70px); }
.isle-house-dock { position: absolute; z-index: 2; left: 0; right: 0; bottom: calc(var(--sab) + 14px); display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.isle-house-dock > * { pointer-events: auto; }
.isle-house .room-tools { background: var(--surface); box-shadow: var(--depth-2); max-height: min(46dvh, 270px); overflow-y: auto; }
.isle-house-tools .btn { background: var(--surface); box-shadow: var(--depth-2); }
.isle-house .room-wrap.editing ~ .isle-house-dock .isle-house-tools { display: none; }
@media (orientation: landscape) and (max-height: 520px) {
  .isle-house-dock { left: auto; right: 12px; top: calc(env(safe-area-inset-top) + 72px); width: 300px; align-content: end; justify-items: stretch; }
  .isle-house .room-tools { width: auto; max-height: 100%; }
}
/* la prima riga della barretta: il nome del mobile sopra, Annulla / Rifai / Fatto sotto quando non ci stanno accanto */
.room-tools-row .room-tools-name { flex: 1 1 100%; }
.isle-house .room-tools { width: min(100% - 24px, 560px); margin: 0; }
.isle-house-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 0 16px; }
.house-door { position: fixed; top: var(--hy); width: calc(var(--hw) / 2); height: var(--hh); image-rendering: pixelated; pointer-events: none; visibility: hidden; z-index: 1; }
.house-door.l { left: var(--hx); }
.house-door.r { left: calc(var(--hx) + var(--hw) / 2); }
.isle-house.opening, .isle-house.closing { animation: house-grow 560ms var(--ease-out) both; }
.isle-house.closing { animation-name: house-shrink; animation-duration: 380ms; }
.isle-house.opening .house-door, .isle-house.closing .house-door { visibility: visible; }
.isle-house.opening .house-door.l { animation: door-l 560ms var(--ease-out) both; }
.isle-house.opening .house-door.r { animation: door-r 560ms var(--ease-out) both; }
.isle-house.closing .house-door.l { animation: door-l 380ms var(--ease-out) reverse both; }
.isle-house.closing .house-door.r { animation: door-r 380ms var(--ease-out) reverse both; }
.isle-house.opening .isle-house-main, .isle-house.opening .isle-house-head { animation: house-in 560ms var(--ease-out) both; }
@keyframes house-grow { from { clip-path: inset(var(--hy) var(--hr) var(--hb) var(--hx) round var(--radius)); } to { clip-path: inset(0 round 0); } }
@keyframes house-shrink { from { clip-path: inset(0 round 0); } to { clip-path: inset(var(--hy) var(--hr) var(--hb) var(--hx) round var(--radius)); } }
@keyframes door-l { from { transform: none; opacity: 1; } to { transform: perspective(600px) translateX(-55%) rotateY(55deg); opacity: 0; } }
@keyframes door-r { from { transform: none; opacity: 1; } to { transform: perspective(600px) translateX(55%) rotateY(-55deg); opacity: 0; } }
@keyframes house-in { from { transform: scale(1.06); opacity: 0.4; } to { transform: none; opacity: 1; } }
body.house-on { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { .isle-house.opening, .isle-house.closing, .isle-house .house-door, .isle-house.opening .isle-house-main, .isle-house.opening .isle-house-head { animation: none !important; } .house-door { visibility: hidden !important; } }

.leftover .btn.small { min-height: 36px; padding: 0 14px; }
.leftover .link { margin: 0; padding: 8px 4px; font-size: var(--fs-cap); }
/* le icone della roba davanti ai nomi (erba, fumo, olio) e nelle righe degli storici */
.ic.kind-ic, .pod-items li > span > .ic { width: 18px; height: 18px; margin-right: 6px; vertical-align: -4px; color: var(--accent-text); flex: none; }
.seg .ic.kind-ic { color: inherit; }

/* --- Abitudini a domande: la domanda come titolo, la risposta in una frase, un grafico, una nota piccola --- */
.eq-help { margin: 12px 0; border-radius: var(--r-md); background: var(--inset); }
.eq-help summary { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 8px 8px 16px; font-size: var(--fs-cap); color: var(--ink-2); cursor: pointer; list-style: none; }
.eq-help summary::-webkit-details-marker { display: none; }
.eq-help summary > span:first-child { flex: 1; }
.eq-help b { color: var(--ink); font-weight: 600; }
.eq-q { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 700; font-size: var(--fs-ui); }
.eq-help[open] .eq-q { background: var(--accent); color: var(--accent-ink); }
.eq-help p { margin: 0; padding: 0 16px 12px; font-size: var(--fs-cap); line-height: 1.45; color: var(--ink-2); }
.q-card h2 { margin: 0 0 4px; font-size: var(--fs-h2); }
.q-card .answer { margin: 0 0 12px; font-size: var(--fs-body); line-height: 1.45; color: var(--ink); }
.q-card .answer b { font-weight: 650; }
.q-card > .muted.small { margin: 8px 0 0; }
/* «Quanto sto fumando?»: barre orizzontali, una per riga, con la riga del limite che le attraversa */
.cmp { position: relative; display: grid; gap: 8px; margin: 20px 0 8px; }
.cmp-row { display: grid; grid-template-columns: 7.2em minmax(0, 1fr) 4.6em; align-items: center; gap: 8px; }
.cmp-k { font-size: var(--fs-cap); color: var(--ink-2); font-weight: 500; }
.cmp-v { font-size: var(--fs-ui); font-weight: 650; text-align: right; white-space: nowrap; }
.cmp-v small { font-weight: 500; color: var(--muted); }
.cmp-bar { position: relative; height: 16px; border-radius: 4px; background: var(--inset); }
.cmp-bar i { position: absolute; top: 0; bottom: 0; left: 0; display: block; border-radius: 4px; }
.cmp-done, .fc-legend .cmp-done { background: var(--accent); }
.cmp-range, .fc-legend .cmp-range { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.cmp-mid { width: 2px; margin-left: -1px; background: var(--accent); border-radius: 0 !important; }
.cmp-ref, .fc-legend .cmp-ref { background: var(--h2); }
/* il limite: una riga sopra le barre, allineata alla colonna delle barre */
.cmp-limit { position: absolute; top: -8px; bottom: -4px; left: calc(7.2em + 8px + (100% - 11.8em - 16px) * var(--at-n, 0)); width: 0; border-left: 2px dashed var(--ink-2); }
.cmp-limit span { position: absolute; bottom: 100%; left: -1px; transform: translateX(-50%); white-space: nowrap; font-size: var(--fs-micro); font-weight: 600; color: var(--ink-2); }

/* con quanti tiri, quanta binnella */
.dose-chips { margin: 4px 0 8px; }
.dose-answer { font-size: var(--fs-body); line-height: 1.45; margin: 8px 0 4px; }
.dose-answer .dose-n { font-size: var(--fs-big); font-weight: 700; }
.dose-answer small { color: var(--muted); font-size: var(--fs-cap); }
.dose-ladder { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 2px; background: var(--inset); border-radius: var(--r-md); padding: 8px 12px; }
.dose-ladder li { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; align-items: center; min-height: 32px; font-size: var(--fs-ui); }
.dose-ladder b { font-weight: 650; font-variant-numeric: tabular-nums; }
.dose-few p { margin: 8px 0; }
.dose-few { background: var(--inset); border-radius: var(--r-md); padding: 4px 12px 8px; margin: 8px 0; }
.chart.dose-calib .dose-curve { stroke-dasharray: 6 5; }
.dose-prog { height: 8px; border-radius: 999px; background: var(--inset); overflow: hidden; }
.dose-prog i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* l'astinenza: il controllo in Oggi e la card in Tolleranza */
.abst-rows { display: flex; flex-direction: column; gap: 2px; margin-top: 8px; }
.abst-row { display: flex; align-items: center; gap: 8px; }
.abst-row > span { flex: 1; font-size: var(--fs-ui); min-width: 0; }
.abst-row .seg { margin: 2px 0; flex: none; }
.abst-row .seg button { min-width: 40px; min-height: 40px; }
.abst-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.abst-today { display: flex; align-items: baseline; gap: 8px; margin: 6px 0; }
.abst-today b { font-size: var(--fs-title); font-weight: 700; }
.abst-today span { color: var(--muted); font-size: var(--fs-ui); }
.chart .abst-zone { fill: var(--inset); }
.abst-strong { background: var(--warn-soft); color: var(--warn-text); border-radius: var(--r-md); padding: 10px 12px; font-size: var(--fs-ui); margin: 8px 0; }
.chart .feel-con { fill: var(--f1); stroke: var(--surface); stroke-width: 2; }
.chart .feel-senza { fill: var(--f2); stroke: var(--surface); stroke-width: 2; }
.chart .feel-link { stroke: var(--axis); stroke-width: 2; stroke-linecap: round; }
.chart .feel-label { fill: var(--ink-2); }
.sw.f1 { background: var(--f1); } .sw.f2 { background: var(--f2); }
.feel-taps { display: grid; gap: 10px; margin: 10px 0 4px; }
.feel-taps .seg button { min-height: 44px; font-size: var(--fs-big); }
.feel-q { display: flex; justify-content: space-between; gap: 8px; font-size: var(--fs-ui); color: var(--ink-2); margin: 0 0 4px; }
.feel-q b { color: var(--ink); font-weight: 600; }
.pause-guide { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; margin: 4px 0 10px; }
.pause-say { margin: 0; padding: 8px 12px; border-radius: 16px 16px 16px 4px; font-size: var(--fs-cap); font-weight: 500; line-height: 1.35; background: var(--inset); border: var(--hair) solid var(--line); color: var(--ink); }
.pause-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; margin: 8px 0; }
.pause-kpis div { background: var(--inset); border-radius: var(--r-md); padding: 10px 12px; }
.pause-kpis b { display: block; font-size: var(--fs-big); font-weight: 700; }
.pause-kpis span { font-size: var(--fs-cap); color: var(--muted); }
.abst-past { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 4px; font-size: var(--fs-cap); color: var(--ink-2); }

/* --- la collezione dei pesci (fishbook.js): righe tutte alte uguali, il pesce a sinistra, nome e dove, quanti a destra --- */
.fish-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.fish-row { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; min-height: 60px; padding: 8px 12px; border-radius: var(--r-md); background: var(--inset); }
.fish-pic { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; background: var(--card); font-size: 28px; line-height: 1; }
.fish-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fish-txt b { font-size: var(--fs-ui); font-weight: 600; color: var(--ink); white-space: nowrap; }
.fish-txt small { font-size: var(--fs-cap); color: var(--muted); }
.fish-n { font-size: var(--fs-ui); font-weight: 600; color: var(--ink); }
.fish-row.missing .fish-pic { font-size: var(--fs-h2); font-weight: 700; color: var(--muted); }
.fish-row.missing .fish-txt b { color: var(--muted); }
.fish-row.missing { background: none; border: var(--hair) dashed var(--line); }
.fish-row.missing .fish-pic { background: var(--inset); }

/* la pagina di una roba e «Cosa ho»: il nome che apre la pagina, le canne da spostare su un'altra roba */
.link-plain { all: unset; cursor: pointer; flex: 1; min-height: 44px; align-content: center; }
.link-plain:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.have-top .more-go { color: var(--muted); }
.roba-canne li { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.roba-canne select { flex: 0 1 auto; max-width: 100%; min-height: 44px; border: var(--hair) solid var(--line); border-radius: 10px; background: var(--inset); color: var(--ink); padding: 4px 8px; font-size: var(--fs-cap); }
.roba-vs { font-size: var(--fs-body); }
.roba-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.roba-tiles .tile-value { font-size: var(--fs-big); }
.roba-tiles .tile-label, .roba-tiles .tile-sub { font-size: var(--fs-cap); }

/* --- il voto più ricco (rating.js): icone nei chip, coppie, quantità, nota --- */
.chip .ic { width: 18px; height: 18px; flex: none; margin-right: 6px; vertical-align: -4px; }
.pair-seg button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pair-seg .ic { width: 18px; height: 18px; flex: none; }
.amt-list { list-style: none; padding: 0; margin: 6px 0 4px; display: grid; gap: 10px; }
.amt-row { background: var(--inset); border-radius: var(--r-md); padding: 10px 12px; display: grid; gap: 6px; }
.amt-row .seg { margin: 0; background: var(--card); }
.amt-what { font-size: var(--fs-ui); color: var(--ink-2); }
.amt-what small { color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper .btn { min-width: 44px; min-height: 44px; font-size: var(--fs-big); }
.stepper b { font-size: var(--fs-body); font-weight: 650; min-width: 5em; text-align: center; }
.amt-g { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-cap); color: var(--ink-2); }
.amt-g small { display: block; color: var(--muted); }
.amt-g input { width: 5.5em; border: var(--hair) solid var(--line); border-radius: var(--r-md); background: var(--card); padding: 8px 10px; font-size: 1rem; min-height: 44px; color: var(--ink); text-align: right; }
.rate-note { width: 100%; box-sizing: border-box; border: var(--hair) solid var(--line); border-radius: var(--r-md); background: var(--inset); padding: 10px 12px; font: inherit; font-size: 1rem; color: var(--ink); resize: vertical; min-height: 64px; }
.dose-g { color: var(--muted); font-weight: 500; }

/* «Come stai senza?» in Oggi, compatto: i sintomi principali come chip a icona (più tocchi, più forte) e «Altro» */
.abst-chips { margin: 12px 0 4px; }
.abst-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
.abst-chip .ic { width: 18px; height: 18px; flex: none; }
.abst-chip small { font-size: var(--fs-micro); font-weight: 600; color: var(--accent-text); }
.abst-chip[data-v="2"] { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.abst-chip[data-v="3"] { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.abst-more { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--accent-text); background: none; }
.abst-more .ic { width: 16px; height: 16px; }
.abst-compact .abst-actions { margin-top: 8px; }


/* --- Lo stesso linguaggio dappertutto (secondo giro) ---------------------------------------------------------------
   La barra delle schede è una capsula piena che galleggia appena sopra la linetta di iOS (--tabs-gap 8 px sopra lo
   spazio sicuro). Dietro e sotto, una sfumatura fissa del colore del fondo (html::before): quello che scorre sparisce
   piano verso il basso invece di comparire tagliato attorno alla capsula. --sab è lo spazio sicuro in basso: di solito
   env(), 0 quando iOS (app installata) lo conta già nell'altezza della pagina, se no si sommava due volte (lo
   controlla safeBottom() in app.js). */
:root { --sab: env(safe-area-inset-bottom); --tabs-gap: 8px; --bar: #f4f5fc; --seg: rgba(40, 40, 110, 0.07); }
@media (prefers-color-scheme: dark) { :root { --bar: #0e0d1a; --seg: rgba(255, 255, 255, 0.06); } }
:root.sab-0 { --sab: 0px; }
.tabs { box-shadow: var(--depth-2), 0 0 0 var(--hair) var(--line); border: 0; }
html::before {
  content: ""; position: fixed; left: 0; right: 0; bottom: 0; z-index: 9; pointer-events: none;
  height: calc(var(--sab) + var(--tabs-gap) + var(--tabs-h) + 28px);
  background: linear-gradient(to bottom, transparent, var(--bg) 62%);
}
html:has(body.signed-out)::before, html:has(body.noscroll)::before { display: none; }
body > .buddy { right: 16px; }

/* i segmenti di Andamento: una vaschetta quieta e piena (sotto non si leggono le righe che scorrono), la scelta in
   rilievo leggero; niente ombre che galleggiano */
.subnav {
  background: var(--bar); backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 0 0 var(--hair) var(--line);
  padding: 4px; border: 0;
}
.subnav button { min-height: 36px; padding: 6px 4px; font-size: var(--fs-ui); }
.subnav button[aria-selected="true"] { background: var(--seg); box-shadow: none; }
@media (prefers-color-scheme: dark) { .subnav button[aria-selected="true"] { background: rgba(255, 255, 255, 0.11); box-shadow: none; } }

/* le card: titolo quieto, testo secondario più piccolo; un po' di aria fra i gruppi */
.card > h2:first-child { margin-bottom: 6px; }
.card + h3.day { margin-top: 24px; }

/* il diario come movimenti: tondo a sinistra, cosa e voto in mezzo, l'ora a destra in piccolo */
.entry { grid-template-columns: 40px 1fr auto; gap: 2px 12px; padding: 12px 16px; }
.entry .entry-ic { grid-row: 1 / span 2; grid-column: 1; }
.entry-what { grid-column: 2; grid-row: 1; font-weight: 600; }
.entry-time { grid-column: 3; grid-row: 1; min-width: 0; font-size: var(--fs-cap); font-weight: 500; color: var(--muted); align-self: baseline; }
.entry-rate { grid-column: 2 / 4; grid-row: 2; line-height: 1.35; }
.entry-rate:empty { display: none; }
.day { font-size: var(--fs-ui); color: var(--ink); margin: 24px 4px 8px; }

/* le parti che si aprono (details): niente triangolo, una freccina a destra che gira */
details.card > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; font-weight: 600; cursor: pointer; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after {
  content: ""; flex: none; width: 7px; height: 7px; margin-right: 4px; border: solid var(--muted); border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg) translateY(-2px); transition: transform 0.15s var(--ease-out);
}
details.card[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }

/* il nome del pet con la matita piccola accanto */
.pet-name { display: inline-flex; align-items: center; gap: 6px; }
.pet-name .ic { width: 18px; height: 18px; color: var(--muted); }
.pet-card > .pet-name, .pet-name:only-child { margin-inline: auto; }
.pet-actions .btn { padding: 0 12px; }
.pet-actions .btn small { white-space: nowrap; font-size: var(--fs-cap); font-weight: 500; color: var(--muted); }

/* === Terzo giro: le altre pagine allo stesso livello di Oggi ===
   Ogni sezione ha in cima, senza card, UN numero protagonista (.sec-hero: .fig-k cosa, .fig-v il numero, .fig-s una riga
   quieta) e al massimo una pastiglia di stato (.pill). Le card sono corte: titolo, numero o frase quieta, grafico senza
   assi (bare), e i testi lunghi chiusi in «Come si legge» (details.info). Le righe che aprono i fogli stanno in un'unica
   card raggruppata con i separatori sottili. */
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* barra: la scheda scelta è una pastiglia piena che contiene icona e nome, uguale per tutte, senza alone */
:root { --tab-on: rgba(40, 40, 110, 0.08); }
@media (prefers-color-scheme: dark) { :root { --tab-on: rgba(255, 255, 255, 0.09); } }
.tabs svg { padding: 0; }
.tabs button { gap: 3px; transition: background-color 0.16s var(--ease-out); }
.tabs button[aria-current="page"] { background: var(--tab-on); color: var(--ink); }
.tabs button[aria-current="page"] svg { background: none; color: currentColor; box-shadow: none; }

/* il numero protagonista */
.sec-hero { margin: 20px 0 12px; padding: 0 4px; }
.fig { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.fig-k { font-size: var(--fs-cap); font-weight: 500; color: var(--muted); }
.fig-v { font-size: var(--fs-hero); line-height: 1; font-weight: 700; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: proportional-nums lining-nums; }
.fig-v .dec { font-size: 0.62em; }
.fig-v .unit { font-size: 0.42em; font-weight: 600; letter-spacing: 0; color: var(--ink-2); margin-left: 0.2em; }
.fig-s { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: var(--fs-ui); color: var(--ink-2); }
.card .fig { margin: 8px 0 4px; gap: 2px; }
.card .fig-v { font-size: var(--fs-title); }
.sec-hero .answer, .q-card .answer { font-size: var(--fs-ui); line-height: 1.45; color: var(--ink-2); margin: 8px 0 16px; }
.sec-hero .answer:empty, .q-card .answer:empty { display: none; }
.sec-hero .answer b, .q-card .answer b { color: var(--ink); }
.sec-hero .cmp { margin-top: 8px; }

/* pastiglie di stato: colore quieto, icona e poche parole */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 4px 12px; border-radius: 999px;
  background: var(--inset); color: var(--ink-2); font-size: var(--fs-cap); font-weight: 600; line-height: 1.25;
}
.pill .ic { width: 16px; height: 16px; flex: none; }
.pill.ok { background: color-mix(in srgb, var(--s1) 15%, transparent); color: var(--neon-g); }
.pill.warn { background: var(--warn-soft); color: var(--warn-text); }

/* «Come si legge»: chiuso, una riga quieta con la i; aperto, il testo piccolo */
details.info { margin: 8px 0 -8px; }
details.info > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; cursor: pointer;
  font-size: var(--fs-cap); font-weight: 500; color: var(--muted);
}
details.info > summary::-webkit-details-marker { display: none; }
details.info > summary .ic { width: 16px; height: 16px; }
details.info[open] > summary { color: var(--ink-2); }
.info-body { font-size: var(--fs-cap); line-height: 1.5; color: var(--ink-2); padding: 0 0 12px; }
/* «Vedi i numeri» quieto come «Come si legge» */
.q-card .numbers, .card .numbers { margin: 4px 0 -8px; }
.numbers summary { min-height: 44px; padding: 0; background: none; color: var(--muted); font-weight: 500; font-size: var(--fs-cap); }
.numbers summary::after { width: 6px; height: 6px; border-width: 0 1.6px 1.6px 0; }

/* le card: più aria, titoli netti */
.card { padding: 20px; margin: 16px 0; }
.card > h2:first-child { margin-bottom: 4px; }
.card .sub { margin-bottom: 12px; }

/* righe come movimenti dentro una card o un eroe: tondo, titolo e riga grigia, valore a destra */
.rows { list-style: none; margin: 16px 0 0; padding: 4px 16px; background: var(--card); border-radius: var(--radius); border: var(--hair) solid var(--glass-edge); box-shadow: var(--depth-1); }
.rows li { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; min-height: 60px; }
.rows li + li { border-top: var(--hair) solid var(--line); }
.row-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); }
.row-ic .ic { width: 20px; height: 20px; margin: 0; }
.row-t { display: flex; flex-direction: column; min-width: 0; }
.row-t b { font-size: var(--fs-body); font-weight: 600; }
.row-t small { font-size: var(--fs-cap); color: var(--muted); }
.row-v { font-size: var(--fs-ui); font-weight: 600; color: var(--ink); text-align: right; }

/* le righe che aprono i fogli: un solo gruppo, separatori sottili */
.more-list { gap: 0; padding: 0 16px; background: var(--card); border-radius: var(--radius); border: var(--hair) solid var(--glass-edge); box-shadow: var(--depth-1); margin: 16px 0; }
.more-list > .more-row { background: none; border: 0; border-radius: 0; box-shadow: none; padding-left: 0; padding-right: 0; }
.more-list > .more-row + .more-row { border-top: var(--hair) solid var(--line); }

/* Abitudini: la riga «Tutto è contato in canne» quieta, senza vaschetta */
.eq-help { background: none; margin: 0 0 4px; }
.eq-help summary { padding: 0 4px; min-height: 44px; color: var(--muted); }
.eq-help .eq-q { background: none; width: auto; height: auto; color: var(--muted); }
.eq-help[open] .eq-q { background: none; color: var(--ink-2); }
.eq-help .eq-q .ic { width: 18px; height: 18px; }
.eq-help p { padding: 0 4px 12px; }

/* Tolleranza: il numero grande a sinistra, la pianta a destra */
.tol-hero { display: block; }
.tol-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tol-hero .tol-plant { flex: none; margin: -8px -4px -8px 0; }
.tol-hero .fig-s { font-size: var(--fs-cap); }

/* Diario: il numero dei 7 giorni, sotto l'azione per aggiungere; i giorni come intestazioni con il totale */
.btn.small.add-past .ic { width: 16px; height: 16px; }
.day { margin: 28px 4px 8px; font-weight: 650; }
.day span { font-weight: 500; }
.entries { border-radius: var(--radius); }

/* Insieme: in cima un'intestazione compatta con i nomi, niente numeri grandi */
.duo-head { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 10px; margin: 20px 0 12px; font-size: var(--fs-h2); font-weight: 600; }
.duo-who { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.duo-who .sw { margin: 0; }
.duo-and { font-size: var(--fs-ui); font-weight: 500; color: var(--muted); }
/* Diario: in cima solo le sessioni da votare e l'azione per aggiungere, piccole e centrate */
.diary-head { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 12px; margin: 16px 0 4px; }
.diary-head .add-past { width: auto; margin: 0; color: var(--ink); }
.diary-head .pill { margin: 0; }
/* con le sessioni da votare: due pulsanti uguali sulla stessa riga (stessa altezza, stesso peso), larghi quanto serve
   e il resto della riga diviso a metà; se non stanno, il testo va a capo dentro il pulsante */
.diary-head.two { flex-wrap: nowrap; justify-content: stretch; gap: 8px; }
.diary-head.two .btn { flex: 1 1 auto; min-width: 0; padding: 6px 14px; line-height: 1.25; text-align: center; }
.diary-head .btn { margin: 0;
  background: var(--diary-btn); box-shadow: inset 0 0 0 var(--hair) var(--glass-edge); color: var(--ink); font-weight: 600; }
/* vetro un po' più pieno dei tondi in alto: qui sotto passa la parte più chiara del nastro (testi ≥ 4,5:1) */
:root { --diary-btn: rgba(255, 255, 255, 0.8); }
@media (prefers-color-scheme: dark) { :root { --diary-btn: rgba(22, 20, 42, 0.86); } }
.diary-head.two .btn .ic { width: 18px; height: 18px; }
@media (max-width: 380px) { .diary-head.two .btn { padding: 6px 10px; gap: 4px; } }
/* il foglio «Da votare»: dov'è la sessione, il voto, sotto le altre come movimenti */
.rq-step { margin: -4px 0 4px; }
.rq-next { margin: 24px 4px 8px; font-size: var(--fs-h2); font-weight: 650; }
.rq-note { margin-top: 16px; }
/* il confronto come elenco: righe a filo, niente vaschette */
.versus { border-spacing: 0; }
.versus tbody th, .versus tbody td { background: none; border-radius: 0 !important; border-top: var(--hair) solid var(--line); padding-top: 14px; padding-bottom: 14px; }
.versus tbody th { padding-left: 0; }
.versus thead th { padding: 4px 8px 8px; }
.versus thead th:first-child { padding-left: 0; }
.tol { background: none; padding: 0; border-left: 0; }
.tol-pair { gap: 16px; }
.goal { padding: 14px 0 8px; }

/* i fogli: titolo più grande, le card dentro come gruppi */
.sheet-head h2 { font-size: 22px; letter-spacing: -0.01em; }
/* in fondo alle card: «Vedi i numeri» e «Come si legge» affiancati; quello aperto prende tutta la riga */
.q-foot { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 20px; margin: 4px 0 -8px; }
.q-foot > details { margin: 0; }
.q-foot > details[open] { flex-basis: 100%; order: 2; }
/* gli eroi delle sezioni centrati come l'anello di Oggi (la tolleranza tiene la pianta accanto) */
.sec-hero:not(.tol-hero) { text-align: center; }
.sec-hero:not(.tol-hero) > .fig { align-items: center; }
.sec-hero:not(.tol-hero) .pills { justify-content: center; display: flex; }
.sec-hero:not(.tol-hero) .answer { max-width: 32ch; margin-inline: auto; }
.sec-hero:not(.tol-hero) .q-foot { justify-content: center; }
.sec-hero .fig-v { font-size: 56px; }
.sec-hero { margin: 28px 0 16px; }
.sec-hero .cmp, .sec-hero .fc-legend { text-align: left; }
/* «da votare» quieta come una pastiglia piccola */
.entries .badge { background: var(--inset); color: var(--ink-2); font-weight: 600; }
/* dentro i fogli le card sono gruppi piatti sulla superficie piena: niente ombra, solo la vaschetta */
.sheet .card, #sheet .card { background: var(--inset); box-shadow: none; border-color: transparent; }

/* === Quarto giro: profondità (dal video di un'app di banca: solo i principi) ======================================
   Dietro ogni pagina un nastro lucido in 3D, morbido, di un colore per scheda (.aura: viola Oggi, verde Andamento,
   blu Insieme, rosa Pet), che continua più quieto fino in fondo. Sono WebP disegnate una volta da tools/make-aura.cjs
   (public/aura/). Il contenuto scorre sopra; il nastro sale piano (parallasse leggera) e deriva piano, tutto nel
   compositore; con «riduci movimento» sta fermo. In alto una barra che resta:
   le iniziali tonde (impostazioni), la capsula col giorno e il nome della pagina, un tondo di vetro (il Diario);
   scorre via con la pagina. Le card sono vetro scuro senza bordo evidente, la
   barra delle schede vetro sfocato, le azioni Voto e Pausa tondi di vetro, la roba in Oggi un carosello di card. */
:root {
  --glass-btn: rgba(255, 255, 255, 0.62);       /* tondi e capsule di vetro sopra il nastro */
  --card: rgba(255, 255, 255, 0.74);
  --glass-edge: rgba(255, 255, 255, 0.7);
  --bar-glass: rgba(250, 250, 255, 0.72);
}
@media (prefers-color-scheme: dark) {
  :root {
    --glass-btn: rgba(22, 20, 42, 0.74);
    --card: rgba(22, 20, 40, 0.72);
    --glass-edge: rgba(255, 255, 255, 0.09);
    --bar-glass: rgba(24, 22, 44, 0.7);
  }
}
body { --aura: url(/aura/oggi-light.webp); }
body[data-tab="andamento"] { --aura: url(/aura/andamento-light.webp); }
body[data-tab="insieme"] { --aura: url(/aura/insieme-light.webp); }
body[data-tab="pet"] { --aura: url(/aura/pet-light.webp); }
@media (prefers-color-scheme: dark) {
  body { --aura: url(/aura/oggi-dark.webp); }
  body[data-tab="andamento"] { --aura: url(/aura/andamento-dark.webp); }
  body[data-tab="insieme"] { --aura: url(/aura/insieme-dark.webp); }
  body[data-tab="pet"] { --aura: url(/aura/pet-dark.webp); }
}
/* il nastro: prende il posto della luce in alto. Un livello fisso alto quanto lo schermo più la corsa della parallasse
   (--aura-run), che copre tutta la pagina mentre scorri: in cima il nastro vivo, sotto un secondo più quieto che
   continua fino in fondo. Le immagini Retina (1560 × 3840, opache sul colore del fondo) e la trama del dithering (--dither:
   0–2 livelli a caso, contro le bande) sono due sfondi dello stesso livello, disegnato una volta sola. Si muove solo
   con transform, nel compositore e solo mentre scorri: sale piano (un dodicesimo della pagina, fino a 1440 px)
   ondeggiando appena di lato. Niente backdrop-filter. Fermo con «riduci movimento». */
:root { --aura-run: 120px; --dither: url(/aura/dither-light.png); }
@media (prefers-color-scheme: dark) { :root { --dither: url(/aura/dither-dark.png); } }
.aura {
  position: fixed; top: 0; left: 0; right: 0; z-index: -1; pointer-events: none; overflow: hidden;
  height: calc(max(100%, 100lvh) + var(--aura-run)); contain: strict;
}
.aura::before {
  content: ""; position: absolute; inset: -16px -24px; will-change: transform;
  background: var(--dither) 0 0 / 32px 32px repeat, var(--aura) center top / cover no-repeat;
  transition: background-image 0.3s var(--ease-out);
}
body.signed-out .aura { opacity: 0.6; }
/* lo sfondo vivo (js/aurora.js, WebGL): una tela grande quanto lo schermo, ferma; la parallasse la fa lo shader, ogni
   strato alla sua velocità. Il primo fotogramma è uguale all'immagine (la disegna lo stesso shader), poi la tela compare
   sopra e da lì l'immagine sotto non si disegna più */
.aura > .aura-live {
  position: absolute; left: 0; top: 0; width: 100%; height: calc(100% - var(--aura-run));
  opacity: 0; transition: opacity 0.5s var(--ease-out);
}
.aura.live > .aura-live { opacity: 1; }
.aura.live::before { visibility: hidden; transition: visibility 0s linear 0.6s; }
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    .aura::before { animation: aura-drift linear both; animation-timeline: scroll(root block); animation-range: 0 1440px; }
  }
}
/* sale di 120 px ondeggiando appena di lato: si muove solo mentre scorri (una deriva infinita da ferma teneva occupato
   il compositore e la batteria, e in prova faceva perdere i trascinamenti dei fogli) */
@keyframes aura-drift {
  0% { transform: translate3d(0, 0, 0); }
  35% { transform: translate3d(-12px, -42px, 0); }
  70% { transform: translate3d(10px, -84px, 0); }
  100% { transform: translate3d(0, -120px, 0); }
}
/* dietro al numero protagonista il nastro si quieta (i testi restano ≥ 4,5:1): il velo sta in cima alla pagina e
   scorre via con lei, il nastro resta */
.aura-scrim {
  position: absolute; top: 0; left: 0; right: 0; z-index: -1; pointer-events: none;
  height: min(calc(125vw + var(--top-safe)), 640px);
  background: radial-gradient(100% 36% at 50% 44%, var(--aura-scrim), transparent 100%);
}

/* la barra in alto: iniziali, capsula col nome, un tondo di vetro uguale in ogni scheda. Sta in cima alla pagina e
   scorre via col contenuto (non ti segue: copriva l'anello e le azioni); sotto l'orologio resta la striscia fissa
   body::before, così la barra di stato non finisce mai sopra testo che scorre */
.top {
  position: relative; z-index: 20; height: auto; gap: 10px;
  padding: calc(8px + var(--top-safe)) max(16px, calc((100% - 528px) / 2)) 8px;
}
.avatar {
  flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  background: var(--glass-btn); box-shadow: inset 0 0 0 var(--hair) var(--glass-edge);
  color: var(--ink); font-size: var(--fs-ui); font-weight: 650; transition: transform 0.15s var(--ease-out);
}
.avatar:active, .top-btn:active { transform: scale(0.97); }
.top .brand {
  flex: 1 1 auto; margin: 0; min-width: 0; min-height: 44px; justify-content: center; padding: 3px 16px; border-radius: 999px;
  background: var(--glass-btn); box-shadow: inset 0 0 0 var(--hair) var(--glass-edge);
}
.top .brand small { font-size: var(--fs-micro); color: var(--muted); line-height: 1.25; }
.top .brand h1 { font-size: var(--fs-ui); font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; }
.top .icon { width: 44px; height: 44px; background: var(--glass-btn); box-shadow: inset 0 0 0 var(--hair) var(--glass-edge); color: var(--ink); }
.top .icon svg { width: 20px; height: 20px; stroke-linecap: round; stroke-linejoin: round; }
main { padding-top: 12px; }

/* le card: vetro scuro sopra il nastro, niente bordo evidente */
.card, .rows, .more-list { background: var(--card); border-color: var(--glass-edge); }
@media (prefers-color-scheme: dark) { .card, .rows, .more-list { box-shadow: none; } }
/* «Tutto il diario» in fondo alla card, centrato */
.card-all { margin: 8px auto -8px; padding: 10px 16px; font-size: var(--fs-ui); }

/* la barra delle schede: vetro sfocato a capsula, la scelta una pastiglia tenue */
.tabs { background: var(--bar-glass); backdrop-filter: blur(24px) saturate(1.7); -webkit-backdrop-filter: blur(24px) saturate(1.7); }

/* il numero protagonista: grande e medio, tanto contrasto con il resto */
.sec-hero .fig-v { font-size: 60px; font-weight: 600; letter-spacing: -0.03em; }
/* lo stato sotto l'anello come una pastiglia di vetro */
.hero-badge { padding: 6px 14px 6px 12px; border-radius: 999px; background: var(--glass-btn); box-shadow: inset 0 0 0 var(--hair) var(--glass-edge); color: var(--ink); }
/* Voto e Pausa: tondi di vetro (Canna e Tiro restano del loro colore) */
.act:not(.canna):not(.tiro) .act-ic { background: var(--glass-btn); box-shadow: inset 0 0 0 var(--hair) var(--glass-edge); }

/* la roba in Oggi: le righe una sotto l'altra in una card sola (prima un carosello che nascondeva la seconda di lato) */
.roba-card { background: none; border: 0; box-shadow: none; padding: 0; margin-top: 8px; }
.roba-card .roba-head { padding: 0 4px 0 0; }
.roba-track {
  display: flex; flex-direction: column; margin: 4px 0 12px; overflow: hidden;
  background: var(--card); border: var(--hair) solid var(--glass-edge); border-radius: var(--radius); box-shadow: var(--depth-1);
}
.roba-card .roba-track > * { min-height: 68px; margin: 0; }
.roba-card .roba-track > * + * { box-shadow: 0 calc(-1 * var(--hair)) 0 var(--line); }
.roba-track > .roba-row, .roba-track > .leftover, .roba-track > .roba-line > .roba-row { padding: 14px 16px; }
.roba-track > .roba-row:active { border-radius: var(--radius); }
.roba-track > .leftover { flex-wrap: wrap; row-gap: 4px; }
.roba-track > .leftover .roba-main { flex-basis: calc(100% - 56px); }
.roba-track > .leftover .btn { margin-left: 52px; }
:root { --aura-scrim: rgba(238, 240, 251, 0.72); }
@media (prefers-color-scheme: dark) { :root { --aura-scrim: rgba(11, 10, 20, 0.78); } }
/* sopra il nastro i testi piccoli un gradino più scuri (chiaro) o più chiari (buio) del solito grigio */
.top .brand small, .sec-hero .fig-k, .subnav button { color: var(--ink-2); }
/* i segmenti di Andamento sopra il nastro: capsula di vetro, la scelta una pastiglia tenue */
.subnav { background: var(--subnav-bg); box-shadow: inset 0 0 0 var(--hair) var(--glass-edge); }
:root { --subnav-bg: rgba(255, 255, 255, 0.86); }
@media (prefers-color-scheme: dark) { :root { --subnav-bg: rgba(24, 22, 44, 0.92); } }
.subnav button[aria-selected="true"] { background: var(--tab-on); }
@media (prefers-color-scheme: dark) { .subnav button[aria-selected="true"] { background: rgba(255, 255, 255, 0.12); } }
@media (prefers-color-scheme: light) { .subnav button[aria-selected="true"] { background: rgba(255, 255, 255, 0.9); } }
@media (prefers-color-scheme: dark) { .sec-hero .fig-k { color: var(--ink); } }
/* i segmenti restano in cima mentre scorri, appena sotto la striscia dell'orologio (la barra in alto se ne va) */
.subnav { top: calc(env(safe-area-inset-top) + 8px); }

/* --- scorciatoia in alto a destra, «Come stai?», scorta che finisce, pausa proposta dal pet -------------------------- */
/* Il tondo in alto a destra apre direttamente il Diario. */
.top-btn { position: relative; }
.moods button { min-height: 56px; }
.rate-q small { font-size: var(--fs-cap); font-weight: 400; color: var(--muted); }
.mins-seg button { min-height: 44px; }
.stash-low { display: flex; align-items: center; gap: 8px; width: 100%; margin: 8px 0 0; font-size: var(--fs-cap); color: var(--ink-2); text-align: left; }
.stash-low > span:nth-child(2) { flex: 1; }
.stash-low-ic { display: grid; place-items: center; color: var(--warn-text, var(--muted)); }
.stash-low-ic .ic { width: 16px; height: 16px; }
.stash-low .link { min-height: 44px; padding: 0 8px; }
.pause-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; width: 100%; max-width: 420px; margin-top: 8px; padding-left: 48px; }
.pause-ask .link { min-height: 44px; }
.mood-k { display: inline-flex; align-items: center; gap: 4px; }
.mood-k .ic { width: 16px; height: 16px; flex: none; color: var(--muted); }
.mood-cmp .cmp-row { grid-template-columns: 6.6em minmax(0, 1fr) 3em; }
.dur-line { margin: 12px 0 0; font-size: var(--fs-ui); }
.sess-info { color: var(--ink-2); }

/* Stime: risultato, intervallo e dati che lo sostengono restano vicini e leggibili. */
.estimate-label { display: block; margin-bottom: 4px; color: var(--muted); font-size: var(--fs-cap); font-weight: 500; }
.estimate-support { margin: 8px 0 12px; color: var(--muted); font-size: var(--fs-cap); line-height: 1.4; }
.estimate-range { display: block; margin-top: 4px; }
.dose-answer .dose-n { white-space: nowrap; }
.tol-top .fig { min-width: 0; }
.tol-hero .estimate-support { margin-top: 8px; }
.dose-support { margin-top: 4px; }
.dose-few .info { margin-bottom: 0; }

/* --- lo stato della sincronizzazione: una riga piccola sotto la capsula del titolo ---------------------------------
   Sta nello spazio che c'è già fra intestazione e pagina (8 + 12 px): non sposta l'anello né il resto. Solo testo e un
   pallino quieto, niente animazioni. La legge chi usa VoiceOver (aria-live="polite"). */
.sync-note {
  position: absolute; left: 0; right: 0; top: calc(100% - 7px); margin: 0; pointer-events: none;
  display: flex; justify-content: center; align-items: center; gap: 6px; height: 16px;
  font-size: var(--fs-micro); line-height: 16px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.sync-note:empty { display: none; }
.sync-note::before { content: ''; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); }
.sync-note[data-kind="offline"]::before { background: var(--warn); }

/* impostazioni a gruppi (Essenziali, Account e privacy, Funzioni in più, Altro chiuso) */
.set-group { margin: 24px 0 0; font-size: var(--fs-cap); font-weight: 600; color: var(--muted); }
.set-group:first-of-type { margin-top: 8px; }
.features-setting .feat-opt span { display: flex; flex-direction: column; gap: 2px; }
.features-setting .feat-opt small { font-size: var(--fs-cap); color: var(--muted); }
.set-more { border-bottom: var(--hair) solid var(--line); }
.set-more > summary { display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: 16px 0; cursor: pointer; font-size: var(--fs-h2); font-weight: 600; list-style: none; }
.set-more > summary::-webkit-details-marker { display: none; }
.set-more > summary small { font-size: var(--fs-cap); font-weight: 400; color: var(--muted); }
.set-more[open] > summary { padding-bottom: 0; }
.set-more > .setting:last-child { border-bottom: 0; }

/* Emoji al posto delle icone stilizzate dove bisogna riconoscere qualcosa (gradini, facce, momenti, sintomi,
   tipi di binnella; azioni tonde, tondi canna/tiro delle sessioni e barra delle schede restano icone): prendono il posto dell'icona con la stessa misura, mai tagliate */
.ic.emo {
  display: inline-grid; place-items: center; width: auto; height: auto; flex: none;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; font-style: normal; font-weight: 400;
  line-height: 1; font-size: 1.05em; vertical-align: -0.12em; color: inherit; stroke: none;
}
.ic.emo.lv-ic, .ic.emo.vb-ic { width: auto; height: auto; margin-right: 0.3em; }
.feed-ic em .ic.emo.lv-ic { font-size: 12px; margin: 0; }
.steps button .ic.emo { font-size: 20px; margin: 0; }
.steps button[aria-checked="true"] .ic.emo { font-size: 25px; }
.vibes button span .ic.emo { font-size: 24px; margin: 0; }
.lvl-emoji .ic.emo, .dose-ladder .ic.emo, .row-ic .ic.emo { margin: 0; }
.lvl-emoji .ic.emo { font-size: 24px; }
.dose-ladder .ic.emo, .row-ic .ic.emo { font-size: 18px; }
.compare-emoji .ic.emo { font-size: 30px; margin: 0; }
.st-emoji .ic.emo { font-size: 64px; margin: 0; }
.chip .ic.emo { font-size: 16px; margin-right: 6px; vertical-align: -2px; }
.abst-chip .ic.emo { font-size: 18px; margin: 0; }
.mood-k .ic.emo { font-size: 15px; }
.ic.emo::before { content: attr(data-e); }
.steps button:not([aria-checked="true"]) .ic.emo, .vibes button:not([aria-checked="true"]) .ic.emo { opacity: 0.6; }
.more-emoji .ic.emo { font-size: 20px; }

/* Scorri per eliminare (swipe.js): la riga scorre a sinistra e scopre il cestino rosso dietro; --sw sono i px scoperti.
   Rosso pieno uguale in chiaro e scuro (bianco sopra 4,7:1). Con «riduci movimento» nessuna transizione. */
.swipe { --sw: 0px; position: relative; overflow: hidden; }
.swipe-row { touch-action: pan-y; }
.swipe.moved .swipe-row, .swipe.moved .swipe-row:active { transform: translateX(calc(-1 * var(--sw))); background: none; }
.swipe-row, .swipe-del { transition: transform 0.25s var(--ease-out), width 0.25s var(--ease-out), background-color 0.2s; }
.swipe.dragging .swipe-row, .swipe.dragging .swipe-del { transition: none; }
.swipe-del {
  position: absolute; top: 0; right: 0; bottom: 0; width: var(--sw); overflow: hidden; display: flex; align-items: stretch; justify-content: flex-start;
  padding: 0; border: 0; border-radius: 0; background: #d92d4f; color: #fff; font: 600 var(--fs-micro)/1.2 var(--font); min-height: 0;
}
.swipe-del .sd-in { flex: none; width: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.swipe-del .ic { width: 22px; height: 22px; }
.swipe:not(.moved) .swipe-del { display: none; }
.swipe.collapse { transition: height 0.18s var(--ease-out); }
.feed-list .swipe { margin: 0 -4px; border-radius: 16px; }
.feed-list .swipe .feed-row { width: 100%; margin: 0; }
@media (prefers-reduced-motion: reduce) { .swipe-row, .swipe-del, .swipe.collapse { transition: none !important; } }
