/* Presenze – Farmacia Ciacco.
   Stile da app iOS: carattere di sistema, elenchi raggruppati su fondo grigio,
   tasti alti almeno 44 px, barra delle sezioni in basso con icone disegnate,
   fogli che salgono dal basso. Chiaro e scuro seguono il telefono.
   Ogni stato ha un colore E una parola: mai il solo colore. */

:root {
  --fondo: #f2f2f7; --gruppo: #ffffff; --gruppo-2: #f2f2f7; --riempi: rgba(118, 118, 128, .12); --riempi-2: rgba(118, 118, 128, .2);
  --sep: rgba(60, 60, 67, .18); --testo: #000000; --testo-2: rgba(60, 60, 67, .6); --testo-3: rgba(60, 60, 67, .3);
  --tinta: #0d7d74; --tinta-chiara: rgba(13, 125, 116, .12); --su-tinta: #ffffff;
  --blu: #007aff; --rosso: #ff3b30; --arancio: #ff9500; --viola: #af52de; --verde: #34c759; --giallo: #ffcc00;
  --f-fondo: rgba(0, 122, 255, .13); --f-testo: #0062cc;
  --cm-fondo: rgba(255, 59, 48, .13); --cm-testo: #d70015;
  --p-fondo: rgba(255, 149, 0, .16); --p-testo: #b35c00;
  --m-fondo: rgba(175, 82, 222, .14); --m-testo: #8e3fb8;
  --barre: rgba(249, 249, 249, .86);
  --ombra-foglio: 0 -10px 40px rgba(0, 0, 0, .18);
  --raggio: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #000000; --gruppo: #1c1c1e; --gruppo-2: #2c2c2e; --riempi: rgba(118, 118, 128, .24); --riempi-2: rgba(118, 118, 128, .36);
    --sep: rgba(84, 84, 88, .6); --testo: #ffffff; --testo-2: rgba(235, 235, 245, .6); --testo-3: rgba(235, 235, 245, .3);
    --tinta: #4fd1c1; --tinta-chiara: rgba(79, 209, 193, .16); --su-tinta: #002b27;
    --blu: #0a84ff; --rosso: #ff453a; --arancio: #ff9f0a;
    --f-fondo: rgba(10, 132, 255, .22); --f-testo: #64b0ff;
    --cm-fondo: rgba(255, 69, 58, .22); --cm-testo: #ff7a72;
    --p-fondo: rgba(255, 159, 10, .22); --p-testo: #ffb547;
    --m-fondo: rgba(191, 90, 242, .22); --m-testo: #d9a0f7;
    --barre: rgba(22, 22, 24, .86);
    --ombra-foglio: 0 -10px 40px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fondo); color: var(--testo); min-height: 100vh; min-height: 100dvh;
  font: 400 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  letter-spacing: -.01em; }
h1, h2, h3 { margin: 0; font-weight: 700; }
p { margin: 0; }
a { color: var(--tinta); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--tinta); outline-offset: 2px; border-radius: 8px; }
.ic { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.p { width: 18px; height: 18px; stroke-width: 2.2; }
.ic.g { width: 28px; height: 28px; }
.nascosto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.salta { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--gruppo); padding: 10px 14px; border-radius: 10px; }
.salta:focus { top: 8px; }
.muto { color: var(--testo-2); }
.num { font-variant-numeric: tabular-nums; }

/* --- impaginazione --- */
main { max-width: 760px; margin: 0 auto; outline: none;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) max(16px, env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
main.largo { max-width: 1240px; }
.testata { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 14px 4px 10px; }
.testata h1 { font-size: 34px; line-height: 1.1; letter-spacing: -.02em; }
.testata .sopra { display: block; font-size: 15px; font-weight: 600; color: var(--testo-2); letter-spacing: 0; margin-bottom: 2px; }
.testata .azioni { display: flex; gap: 8px; flex: none; }
.indietro { display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--tinta); font-size: 17px; margin-left: -8px; background: none; border: 0; padding: 0 8px 0 0; }

/* --- barra delle sezioni --- */
.schede { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; justify-content: center;
  background: var(--barre); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep); padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
.schede a { flex: 1; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px 6px; min-height: 50px;
  font-size: 10.5px; font-weight: 600; letter-spacing: .01em; color: #8e8e93; }
.schede a .ic { width: 27px; height: 27px; }
.schede a[aria-current="page"] { color: var(--tinta); }
@media (min-width: 1000px) {
  .schede { top: 0; right: auto; width: 230px; flex-direction: column; justify-content: flex-start; gap: 2px; border-top: 0; border-right: .5px solid var(--sep);
    padding: calc(20px + env(safe-area-inset-top, 0px)) 12px 20px; }
  .schede::before { content: "Presenze"; font-size: 22px; font-weight: 700; padding: 0 12px 14px; color: var(--testo); }
  .schede a { flex: none; max-width: none; flex-direction: row; gap: 12px; font-size: 16px; font-weight: 500; letter-spacing: -.01em; padding: 8px 12px; min-height: 44px; border-radius: 10px; color: var(--testo); }
  .schede a .ic { width: 24px; height: 24px; color: var(--tinta); }
  .schede a[aria-current="page"] { background: var(--tinta); color: var(--su-tinta); }
  .schede a[aria-current="page"] .ic { color: var(--su-tinta); }
  body.dentro main { margin-left: max(230px, calc(50vw - 380px + 115px)); padding-bottom: 40px; }
  body.dentro main.largo { margin-left: 230px; max-width: none; padding-left: 32px; padding-right: 32px; }
}

/* --- elenchi raggruppati --- */
.gruppo { background: var(--gruppo); border-radius: var(--raggio); overflow: hidden; margin: 0 0 22px; padding: 0; list-style: none; }
.titolo-gruppo { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 400; text-transform: uppercase; letter-spacing: .02em; color: var(--testo-2); padding: 0 16px 7px; }
.piede-gruppo { font-size: 13px; color: var(--testo-2); padding: 0 16px; margin: -14px 0 22px; line-height: 1.4; }
.riga { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 16px; background: none; border: 0; text-align: left; color: var(--testo); }
button.riga:active, a.riga:active { background: var(--riempi); }
.gruppo > li + li .riga::before, .gruppo > .riga + .riga::before { content: ""; position: absolute; top: 0; right: 0; left: var(--rientro, 16px); border-top: .5px solid var(--sep); }
.riga .corpo { flex: 1; min-width: 0; }
.riga .titolo { display: block; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.riga .sotto { display: block; font-size: 14px; color: var(--testo-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.riga .sotto.nota { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.riga .freccia { color: var(--testo-3); width: 18px; height: 18px; stroke-width: 2.4; }
.riga .icona-riga { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; color: #fff; flex: none; }
.riga .icona-riga .ic { width: 19px; height: 19px; stroke-width: 2; }
.riga.distruttiva { color: var(--rosso); justify-content: center; }
.riga.tinta { color: var(--tinta); }
.riga[disabled] { opacity: .45; }

/* avatar con la sigla */
.avatar { width: 40px; height: 40px; border-radius: 50%; flex: none; display: grid; place-items: center; font-size: 15px; font-weight: 600; letter-spacing: 0; color: #fff; }
.avatar.piccolo { width: 32px; height: 32px; font-size: 13px; }

/* il valore di una cella: ore, F, CM, P, oppure da segnare */
.pillola { flex: none; min-width: 52px; padding: 5px 11px; border-radius: 999px; text-align: center; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; background: var(--riempi); color: var(--testo); }
.pillola.v-F { background: var(--f-fondo); color: var(--f-testo); }
.pillola.v-CM { background: var(--cm-fondo); color: var(--cm-testo); }
.pillola.v-P, .pillola.v-PL { background: var(--p-fondo); color: var(--p-testo); }
.pillola.v-M { background: var(--m-fondo); color: var(--m-testo); }
.pillola.zero { background: none; color: var(--testo-2); }
.pillola.da-fare { background: none; color: var(--tinta); box-shadow: inset 0 0 0 1.5px var(--tinta); }
.pillola.futuro { background: none; color: var(--testo-3); font-weight: 400; }

/* etichette del calendario della farmacia */
.etichetta { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; vertical-align: 1px; }
.etichetta.turno { background: var(--tinta-chiara); color: var(--tinta); }
.etichetta.speciale { background: var(--p-fondo); color: var(--p-testo); }
.etichetta.chiusa { background: var(--riempi); color: var(--testo-2); }
.etichetta .croce { width: 10px; height: 10px; }

/* --- tasti --- */
.tasto { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 20px; border-radius: 14px; border: 0;
  font-size: 17px; font-weight: 600; background: var(--tinta); color: var(--su-tinta); }
.tasto:active { opacity: .75; }
.tasto.pieno { width: 100%; }
.tasto.chiaro { background: var(--tinta-chiara); color: var(--tinta); }
.tasto.grigio { background: var(--gruppo); color: var(--tinta); }
.tasto[disabled] { opacity: .4; cursor: default; }
.tondo { width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--riempi); color: var(--tinta); flex: none; }
.tondo .ic { width: 20px; height: 20px; stroke-width: 2.4; }
.tondo.pieno { background: var(--tinta); color: var(--su-tinta); }
.tondo:active { opacity: .6; }
.tasti { display: flex; gap: 10px; margin: 0 0 22px; }
.tasti > * { flex: 1; }

/* --- striscia della settimana (vista Giorno) --- */
.mese-barra { display: flex; align-items: center; justify-content: space-between; margin: 0 0 8px; }
.mese-barra .mese-nome { display: inline-flex; align-items: center; gap: 4px; font-size: 17px; font-weight: 600; color: var(--tinta); background: none; border: 0; min-height: 44px; padding: 0 4px; position: relative; }
.mese-barra .mese-nome input { position: absolute; inset: 0; opacity: 0; width: 100%; }
.mese-barra .frecce { display: flex; gap: 10px; }
.settimana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin: 0 0 18px; touch-action: pan-y; }
.settimana button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0 4px; border: 0; background: none; border-radius: 12px; min-height: 66px; }
.settimana .gs { font-size: 11px; font-weight: 600; color: var(--testo-2); text-transform: uppercase; }
.settimana .gn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; font-size: 19px; font-weight: 500; font-variant-numeric: tabular-nums; }
.settimana .oggi .gn { color: var(--tinta); font-weight: 700; }
.settimana .scelto .gn { background: var(--testo); color: var(--fondo); font-weight: 700; }
.settimana .scelto.oggi .gn { background: var(--tinta); color: var(--su-tinta); }
.settimana .punto { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.settimana .punto.da-fare { background: var(--tinta); }
.settimana .punto.chiusa { background: var(--testo-3); }
.settimana .punto.turno { background: var(--arancio); }

.banda { display: flex; align-items: center; gap: 12px; background: var(--gruppo); border-radius: var(--raggio); padding: 12px 16px; margin: 0 0 22px; font-size: 15px; }
.banda .ic { color: var(--tinta); }
.banda.avviso { background: var(--p-fondo); color: var(--p-testo); }
.banda.avviso .ic { color: var(--p-testo); }
.banda.errore { background: var(--cm-fondo); color: var(--cm-testo); }

/* --- scelta della persona (vista Persona) --- */
.facce { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: none; padding: 4px 4px 12px; margin: 0 -4px 6px; scroll-snap-type: x proximity; }
.facce::-webkit-scrollbar { display: none; }
.facce button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; padding: 0; width: 58px; scroll-snap-align: start; }
.facce .avatar { width: 54px; height: 54px; font-size: 18px; box-shadow: 0 0 0 3px var(--fondo); transition: box-shadow .15s; }
.facce button[aria-pressed="true"] .avatar { box-shadow: 0 0 0 3px var(--fondo), 0 0 0 5.5px var(--tinta); }
.facce .nome { font-size: 12px; color: var(--testo-2); max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facce button[aria-pressed="true"] .nome { color: var(--testo); font-weight: 600; }

.riassunto { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 0 0 22px; }
.riassunto .cifra { background: var(--gruppo); border-radius: var(--raggio); padding: 12px 14px; }
.riassunto b { display: block; font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.riassunto span { font-size: 13px; color: var(--testo-2); }

.data-riga { width: 50px; flex: none; text-align: center; line-height: 1.1; }
.data-riga small { display: block; font-size: 12px; font-weight: 600; color: var(--testo-2); text-transform: uppercase; }
.data-riga b { font-size: 21px; font-weight: 500; font-variant-numeric: tabular-nums; }
.oggi .data-riga b { color: var(--tinta); font-weight: 700; }
.fine-settimana .data-riga small { color: var(--testo-3); }

/* --- griglia del mese --- */
.scorri { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--gruppo); border-radius: var(--raggio); margin: 0 0 22px; }
table.registro { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.registro th, .registro td { padding: 3px 2px; text-align: center; font-weight: 400; }
.registro thead th { font-size: 11px; font-weight: 600; color: var(--testo-2); padding-top: 10px; }
.registro .nome { position: sticky; left: 0; z-index: 1; background: var(--gruppo); text-align: left; padding-left: 14px; padding-right: 10px; font-weight: 600; white-space: nowrap; }
.registro tr.giorni th { font-size: 12px; color: var(--testo-2); padding-top: 12px; font-weight: 600; }
.registro tbody:not(:first-of-type) tr.giorni th { border-top: .5px solid var(--sep); }
.registro tr.giorni th.festa { color: var(--rosso); }
.registro .segno { display: block; font-size: 9px; font-weight: 700; line-height: 1; margin-top: 1px; }
.registro .segno.turno { color: var(--tinta); } .registro .segno.apertura_speciale { color: var(--p-testo); }
.registro .segno.ferie, .registro .segno.festivo { color: var(--testo-3); }
.registro .cella { width: 100%; min-width: 38px; height: 34px; border: 0; border-radius: 8px; background: none; font-size: 14px; font-weight: 500; position: relative; }
.registro .cella:active { background: var(--riempi-2); }
.registro .cella.v-F { background: var(--f-fondo); color: var(--f-testo); }
.registro .cella.v-CM { background: var(--cm-fondo); color: var(--cm-testo); }
.registro .cella.v-P, .registro .cella.v-PL { background: var(--p-fondo); color: var(--p-testo); }
.registro .cella.v-M { background: var(--m-fondo); color: var(--m-testo); }
.registro .cella.zero { color: var(--testo-3); }
.registro .cella.da-fare { color: var(--tinta); }
.registro .cella.da-fare::after { content: ""; position: absolute; left: 50%; top: 50%; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--tinta); }
.registro .cella.futuro::after { content: ""; position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 50%; background: var(--testo-3); }
.registro .cella.con-nota::before { content: ""; position: absolute; top: 2px; right: 2px; border: 5px solid transparent; border-top-color: var(--arancio); border-right-color: var(--arancio); border-radius: 0 3px 0 0; }
.registro td.tot { font-weight: 700; padding: 0 12px 0 8px; color: var(--testo); }
.registro td.fuori { opacity: 0; }
.legenda { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 13px; color: var(--testo-2); margin: -10px 4px 22px; }
.legenda span { display: inline-flex; align-items: center; gap: 6px; }
.legenda i { display: inline-block; width: 14px; height: 14px; border-radius: 4px; background: var(--riempi); }
.legenda i.v-F { background: var(--f-fondo); } .legenda i.v-CM { background: var(--cm-fondo); } .legenda i.v-P { background: var(--p-fondo); }
.legenda i.da-fare { background: none; box-shadow: inset 0 0 0 1.5px var(--tinta); border-radius: 50%; }

/* --- fogli (dal basso sul telefono, al centro sul computer) --- */
dialog.foglio { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: calc(100dvh - 40px - env(safe-area-inset-top, 0px));
  background: var(--fondo); color: var(--testo); border-radius: 14px 14px 0 0; box-shadow: var(--ombra-foglio); overflow: hidden; display: flex; flex-direction: column; }
dialog.foglio:not([open]) { display: none; }
dialog.foglio[open] { animation: sali .32s cubic-bezier(.2, .9, .3, 1); }
dialog.foglio::backdrop { background: rgba(0, 0, 0, .35); animation: appari .25s ease; }
@keyframes sali { from { transform: translateY(100%); } to { transform: none; } }
@keyframes appari { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 700px) { dialog.foglio { margin: auto; border-radius: 16px; max-height: calc(100dvh - 80px); } dialog.foglio[open] { animation: appari .2s ease; } }
.foglio-testa { position: relative; display: flex; align-items: center; gap: 12px; padding: 18px 16px 12px; }
.foglio-testa::before { content: ""; position: absolute; top: 6px; left: 50%; width: 36px; height: 5px; margin-left: -18px; border-radius: 3px; background: var(--testo-3); }
.foglio-testa h2 { font-size: 20px; line-height: 1.2; }
.foglio-testa .muto { font-size: 15px; }
.foglio-testa .corpo { flex: 1; min-width: 0; }
.foglio-corpo { overflow-y: auto; padding: 4px 16px calc(20px + env(safe-area-inset-bottom, 0px)); -webkit-overflow-scrolling: touch; }

.scelte { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 0 0 22px; }
.scelte .scelta { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 72px; border-radius: 14px; border: 0; background: var(--gruppo); font-size: 15px; font-weight: 600; padding: 8px; }
.scelte .scelta b { font-size: 22px; font-weight: 700; }
.scelte .scelta.solito { grid-column: 1 / -1; flex-direction: row; gap: 10px; min-height: 56px; background: var(--tinta); color: var(--su-tinta); font-size: 17px; }
.scelte .scelta.F b { color: var(--f-testo); } .scelte .scelta.CM b { color: var(--cm-testo); } .scelte .scelta.P b { color: var(--p-testo); }
.scelte .scelta[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--tinta); }
.scelte .scelta.solito[aria-pressed="true"] { box-shadow: inset 0 0 0 2.5px var(--su-tinta); }
.scelte .scelta:active { opacity: .7; }

/* campi in riga, come le impostazioni di iOS */
.campo-riga { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 16px; position: relative; }
.gruppo > .campo-riga + .campo-riga::before, .gruppo > * + .campo-riga::before { content: ""; position: absolute; top: 0; right: 0; left: 16px; border-top: .5px solid var(--sep); }
.campo-riga > label, .campo-riga > .etichetta-campo { flex: 1; }
.campo-riga input[type="date"], .campo-riga input.valore-campo, .campo-riga select { border: 0; background: var(--riempi); border-radius: 8px; padding: 6px 10px; min-height: 36px; font-size: 17px; text-align: right; color: var(--testo); }
.campo-riga input[type="date"] { -webkit-appearance: none; appearance: none; min-width: 140px; }
.area { display: block; width: 100%; border: 0; background: none; padding: 12px 16px; min-height: 84px; resize: vertical; font-size: 17px; }
.area::placeholder, input::placeholder { color: var(--testo-3); }
.passo { display: flex; align-items: center; gap: 0; background: var(--riempi); border-radius: 9px; }
.passo button { width: 44px; height: 36px; border: 0; background: none; color: var(--testo); display: grid; place-items: center; }
.passo button .ic { width: 18px; height: 18px; stroke-width: 2.4; }
.passo input { width: 64px; border: 0; background: none; text-align: center; font-size: 19px; font-weight: 600; font-variant-numeric: tabular-nums; min-height: 36px; }
.passo .sep { width: .5px; height: 20px; background: var(--sep); }

/* interruttore */
.interruttore { position: relative; width: 51px; height: 31px; flex: none; }
.interruttore input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.interruttore span { position: absolute; inset: 0; border-radius: 16px; background: var(--riempi-2); transition: background .2s; }
.interruttore span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: transform .2s; }
.interruttore input:checked + span { background: var(--verde); }
.interruttore input:checked + span::after { transform: translateX(20px); }
.interruttore input:focus-visible + span { outline: 3px solid var(--tinta); outline-offset: 2px; }

/* controllo a segmenti */
.segmenti { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--riempi); border-radius: 9px; padding: 2px; margin: 0 0 22px; }
.segmenti button { border: 0; background: none; border-radius: 7px; min-height: 36px; font-size: 15px; font-weight: 500; }
.segmenti button[aria-pressed="true"] { background: var(--gruppo); font-weight: 600; box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
@media (prefers-color-scheme: dark) { .segmenti button[aria-pressed="true"] { background: #636366; } }

.anteprima { font-size: 14px; color: var(--testo-2); padding: 0 16px; margin: -12px 0 18px; }

/* --- messaggio che passa --- */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: calc(100% - 32px);
  background: rgba(30, 30, 32, .92); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 15px; box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); animation: appari .2s ease; }
@media (min-width: 1000px) { .toast { bottom: 24px; left: calc(50% + 115px); } }

.caricamento { display: grid; place-items: center; min-height: 50vh; color: var(--testo-2); }
.caricamento::before { content: ""; width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--riempi-2); border-top-color: var(--testo-2); animation: gira .8s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }
.vuoto { text-align: center; color: var(--testo-2); padding: 40px 20px; }

/* --- accesso --- */
.accesso { max-width: 420px; margin: 0 auto; padding-top: 8vh; }
.accesso .logo { width: 84px; height: 84px; border-radius: 19px; display: block; margin: 0 auto 18px; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); }
.accesso h1 { text-align: center; font-size: 28px; margin-bottom: 6px; }
.accesso p.muto { text-align: center; font-size: 15px; margin-bottom: 26px; }
.accesso .gruppo input { width: 100%; border: 0; background: none; min-height: 50px; padding: 0 16px; font-size: 17px; }
.accesso .gruppo label + label input { border-top: .5px solid var(--sep); }

/* --- personale e giornata tipo --- */
.ore-settimana { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 12px 16px 14px; }
.ore-settimana label { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--testo-2); }
.ore-settimana input { width: 100%; text-align: center; border: 0; border-radius: 8px; background: var(--riempi); min-height: 40px; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (min-width: 560px) { .ore-settimana { grid-template-columns: repeat(8, 1fr); } }
.campo-testo { flex: 2; min-width: 0; border: 0; background: none; text-align: right; font-size: 17px; min-height: 36px; }
.versioni { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.versioni th, .versioni td { padding: 6px 4px; text-align: center; border-top: .5px solid var(--sep); }
.versioni th { color: var(--testo-2); font-weight: 600; border-top: 0; }
.versioni td:first-child, .versioni th:first-child { text-align: left; padding-left: 16px; }
