/* Programmazione dei turni (solo station manager).
   Telefono in verticale: giorni a sinistra, turni in alto, cerchietti dei dipendenti sotto.
   In orizzontale e su schermi larghi la tabella si gira (giorni in alto, turni a sinistra) e i
   cerchietti vanno a destra. Le celle portano --d (giorno) e --f (fascia): per girare la tabella
   bastano le regole qui, il DOM resta lo stesso. Nelle celle ci sono i nomi, uno per riga. */

.gest {
  position: fixed; inset: 0; z-index: 20; background: var(--bg); color: var(--ink);
  padding: calc(env(safe-area-inset-top, 0px) + 18px) calc(env(safe-area-inset-right, 0px) + 14px) calc(env(safe-area-inset-bottom, 0px) + 14px) calc(env(safe-area-inset-left, 0px) + 14px);
  display: flex; flex-direction: column; gap: 12px;
  animation: g-entra .35s var(--spring);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
@keyframes g-entra { from { opacity: 0; transform: translateY(14px); } }

/* intestazione */
.g-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; height: 40px; flex: none; }
.g-tit { display: flex; align-items: center; gap: 10px; min-width: 0; }
.g-tit h1 { margin: 0; font-size: clamp(20px, 6vw, 26px); font-weight: 800; letter-spacing: .01em; white-space: nowrap; }
.g-tit h1 span { color: var(--muted); }
.g-frecce { display: flex; gap: 4px; }
.g-frecce button { background: var(--fill); } /* 9/10/2026: tondini come gli altri tasti */
.g-frecce button, .g-az button { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--ink); }
.g-frecce svg, .g-az svg { width: 18px; height: 18px; }
.g-az { display: flex; align-items: center; gap: 8px; position: relative; }
.g-az .g-chiudi { background: var(--fill); }
.g-az .g-salva { background: var(--ink); color: var(--bg); animation: pop .3s var(--spring); }
.g-az .g-salva.fatto { background: #34C759; color: #fff; } /* 9/10/2026: niente rimbalzo, diventa verde e basta */

.g-corpo { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; }

/* ── tabella ── */
.g-tab {
  flex: 1; min-height: 0; display: grid;
  grid-template-columns: 42px repeat(7, minmax(0, 1fr));
  grid-template-rows: 44px repeat(var(--nf, 5), minmax(0, 1fr));
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden;
  transition: opacity .2s;
}
.g-tab.attesa { opacity: .45; }
.g-tab.va-avanti { animation: g-avanti .35s var(--spring); }
.g-tab.va-indietro { animation: g-indietro .35s var(--spring); }
@keyframes g-avanti { from { transform: translateX(24px); opacity: .3; } }
@keyframes g-indietro { from { transform: translateX(-24px); opacity: .3; } }

/* giorni in alto, turni a sinistra (8/10/2026: anche in verticale, come in orizzontale) */
.g-tab > * { grid-row: calc(var(--f, -1) + 2); grid-column: calc(var(--d, -1) + 2); }
.g-tab .g-ang { grid-row: 1; grid-column: 1; }
.g-tab .g-tf { grid-column: 1; grid-row: calc(var(--f) + 2); }
.g-tab .g-tg { grid-row: 1; grid-column: calc(var(--d) + 2); }

.g-tf { display: grid; place-items: center; font-size: 10.5px; font-weight: 800; letter-spacing: .02em; position: relative; }
.g-tf::after { content: none; } /* 8/10/2026: via la lineetta colorata accanto alla sigla */
.g-tf.t-off::after { background: var(--line); }
.g-tg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; line-height: 1.05; border-left: 1px solid var(--line); }
.g-tg b { font-size: 11px; font-weight: 800; }
.g-tg small { font-size: 15px; font-weight: 600; }
/* oggi: solo il numero nel tondino nero, come nel calendario (8/10/2026: via la colonna azzurra) */
/* tutti i numeri dei giorni stanno in un posto alto 24 px: il tondino di oggi non sposta la lettera sopra */
.g-tg small { height: 24px; min-width: 24px; display: grid; place-items: center; }
.g-tg.g-oggi small { width: 24px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 750; }
.g-tg.g-oggi b { color: var(--ink); }
/* cambio di mese dentro la settimana: dal 9/10/2026 nessuna linea marcata, il primo del mese e' come gli altri */
/* le frecce per cambiare settimana solo col mouse: col dito si scorre di lato */
.g-frecce { display: none; }
@media (hover: hover) and (pointer: fine) { .g-frecce { display: flex; } }
/* nomi interi nelle celle; sul telefono in verticale, dove le colonne sono strette, le iniziali */
.g-ri { display: none; }
@media (orientation: portrait) and (max-width: 699px) {
  .g-rn { display: none; }
  .g-ri { display: inline; font-size: 12px; font-weight: 750; letter-spacing: .02em; }
  .g-cella { padding: 4px 2px; align-items: center; gap: 3px; }
  .g-r { justify-content: center; gap: 2px; }
  .g-piu { text-align: center; }
}

.g-cella {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 1px;
  padding: 3px 4px 3px 6px; border-top: 1px solid var(--line); border-left: 1px solid var(--line);
}
.g-cella.passato { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--fill) 6px 7px); }
.g-cella.passato .g-r { opacity: .5; }

/* la cella sotto il dito si accende (sotto i nomi) solo se li' si puo' lasciare */
.g-cella::before { content: ""; position: absolute; inset: 2px; border-radius: 9px; background: var(--mat-bg); opacity: 0; pointer-events: none; }
.g-cella.sopra::before { animation: g-respira 1s ease-in-out infinite; }
@keyframes g-respira { 0%, 100% { opacity: .1; } 50% { opacity: .24; } }
.g-cella.no { animation: g-no .45s; }
@keyframes g-no { 0%, 100% { transform: none; } 20% { transform: translateX(-5px); background-color: rgba(255, 59, 48, .14); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }

/* i nomi nelle celle: "Elena C.", allineati a sinistra, centrati in verticale */
.g-r {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 3px; min-width: 0;
  font-size: 11.5px; font-weight: 650; line-height: 15px; white-space: nowrap; touch-action: none;
}
.g-rn { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.g-r .g-mot { flex: none; width: 11px; height: 11px; display: grid; }
.g-r .g-mot svg { width: 100%; height: 100%; }
.g-r.nuovo .g-rn { text-decoration: underline dotted var(--muted); text-underline-offset: 2px; }
.g-r.nasce { animation: g-entra-nome .55s var(--spring) both; }
@keyframes g-entra-nome { 0% { opacity: 0; transform: translateX(-8px) scale(.85); color: var(--mat-bg); } 60% { color: var(--mat-bg); } }
.g-r.muore { animation: g-esce-nome .28s ease-in forwards; }
@keyframes g-esce-nome { to { opacity: 0; transform: scale(.7); } }
.g-r.bozza .g-rn { color: var(--muted); }               /* sul sito e' ancora bozza, non comunicata */
.g-r.fisso .g-rn { color: var(--muted); font-style: italic; } /* permessi, 104...: non si toccano da qui */
.g-piu { position: relative; z-index: 1; font-size: 11px; font-weight: 800; color: var(--muted); line-height: 15px; }

/* ── finestra della cella (uguale su telefono, tablet e computer) ── */
.g-finestra {
  position: fixed; z-index: 30; width: min(320px, calc(100vw - 20px)); max-height: 60vh; overflow: auto;
  background: var(--surface); border-radius: 18px; box-shadow: 0 16px 44px rgba(0, 0, 0, .26);
  padding: 12px 12px 8px; animation: g-apre .28s var(--spring);
}
@keyframes g-apre { from { opacity: 0; transform: scale(.85); } }
.g-finestra header { display: flex; align-items: center; gap: 8px; padding: 0 2px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.g-finestra header b { font-size: 15px; font-weight: 800; }
.g-finestra .g-sig { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: .03em; }
.g-finestra header button { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); }
.g-finestra header svg { width: 16px; height: 16px; }
.g-finestra ul { list-style: none; margin: 0; padding: 0; }
.g-finestra li { display: flex; align-items: center; gap: 8px; padding: 6px 2px; }
.g-finestra li + li { border-top: 1px solid var(--line); }
.g-fn { flex: 1; min-width: 0; font-size: 15px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-motivi { display: flex; gap: 2px; }
.g-motivi button { height: 30px; min-width: 34px; padding-inline: 6px; border-radius: 8px; display: grid; place-items: center; font-size: 11px; font-weight: 800; }
.g-motivi button[aria-pressed="true"] { background: var(--fill); }
.g-motivi svg { width: 15px; height: 15px; }
.g-finestra li.fisso .g-fn { color: var(--muted); }
.g-lucchetto { font-size: 12px; color: var(--muted); }
.g-via { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--ink); }
.g-via svg { width: 14px; height: 14px; }

/* ── cerchietti dei dipendenti, col nome sotto ── */
.g-vassoio { flex: none; display: flex; align-items: flex-end; gap: 10px; }
.g-pers {
  flex: 1; min-width: 0;
  display: grid; grid-template-columns: repeat(var(--per, 5), var(--t, 56px)); gap: 10px 14px; justify-content: center; padding-top: 8px;
}
.g-pw { display: flex; flex-direction: column; align-items: center; gap: 4px; width: var(--t, 56px); touch-action: none; }
.g-nome { max-width: calc(var(--t, 56px) + 14px); font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .25s; }
.g-p.finito + .g-nome { opacity: .35; }
.g-p {
  position: relative; width: var(--t); height: var(--t); border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: calc(var(--t) * .34); font-weight: 750; touch-action: none; cursor: grab;
  transition: transform .25s var(--spring), opacity .25s;
}
.g-p .g-n {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding-inline: 5px; border-radius: 99px;
  display: grid; place-items: center; background: #FF3B30; color: #fff; font-size: 11.5px; font-weight: 800;
  box-shadow: 0 0 0 2px var(--bg);
}
.g-p .g-n.su { animation: g-conta .35s var(--spring); }
@keyframes g-conta { 40% { transform: scale(1.35); } }
.g-p.finito { opacity: .3; cursor: pointer; }
.g-p.finito .g-n { display: none; }

/* la copia che segue il dito */
.g-fantasma {
  position: fixed; z-index: 40; left: 0; top: 0; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface); color: var(--ink); font-size: 19px; font-weight: 750;
  box-shadow: inset 0 0 0 1.5px var(--line), 0 12px 28px rgba(0, 0, 0, .25); pointer-events: none; transform: scale(1.08);
}
.g-fantasma.torna { transition: left .3s var(--spring), top .3s var(--spring), transform .3s, opacity .3s; transform: scale(.6); opacity: 0; }

/* piccoli riquadri: motivo dell'OFF, straordinario */
.g-scelta {
  position: fixed; z-index: 30; display: flex; gap: 4px; padding: 5px; border-radius: 14px;
  background: var(--surface); box-shadow: 0 10px 30px rgba(0, 0, 0, .22); animation: pop .22s var(--spring);
}
.g-scelta > button { height: 36px; min-width: 44px; padding-inline: 10px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; gap: 5px; font-size: 13px; font-weight: 700; }
.g-scelta > button[aria-pressed="true"] { background: var(--fill); }
.g-scelta svg { width: 16px; height: 16px; }
.g-straord { flex-direction: column; width: min(270px, calc(100vw - 32px)); padding: 14px; gap: 12px; }
.g-straord p { margin: 0; font-size: 14px; line-height: 1.35; }
.g-conta { display: flex; align-items: center; justify-content: center; gap: 14px; }
.g-conta button { width: 36px; height: 36px; border-radius: 50%; background: var(--fill); font-size: 20px; font-weight: 700; }
.g-conta output { min-width: 28px; text-align: center; font-size: 22px; font-weight: 800; }
.g-scelte { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.g-scelte button { height: 40px; border-radius: 11px; background: var(--fill); font-size: 14px; font-weight: 700; }
.g-scelte .g-si { background: var(--ink); color: var(--bg); }

.g-avviso {
  position: fixed; z-index: 45; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 64px); transform: translateX(-50%);
  padding: 9px 16px; border-radius: 99px; background: var(--ink); color: var(--bg); font-size: 14px; font-weight: 600;
  white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
  animation: pop .25s var(--spring); pointer-events: none;
}
.g-avviso.ok { background: #34C759; color: #fff; }

/* ── orizzontale e schermi larghi: giorni in alto, turni a sinistra, cerchietti a destra ── */
@media (orientation: landscape) and (min-width: 560px), (min-width: 820px) {
  .gest { padding-top: calc(env(safe-area-inset-top, 0px) + 12px); gap: 8px; }
  .g-corpo { flex-direction: row; gap: 14px; }
  .g-tab { grid-template-columns: 44px repeat(7, minmax(0, 1fr)); grid-template-rows: 44px repeat(var(--nf, 5), minmax(0, 1fr)); } /* 9/10/2026: 34 px non bastavano a lettera e numero, la lettera toccava il bordo sopra */
  .g-tab > * { grid-row: calc(var(--f, -1) + 2); grid-column: calc(var(--d, -1) + 2); }
  .g-tab .g-ang { grid-row: 1; grid-column: 1; }
  .g-tab .g-tf { grid-column: 1; grid-row: calc(var(--f) + 2); }
  .g-tab .g-tg { grid-row: 1; grid-column: calc(var(--d) + 2); }
  .g-tg { border-top: 0; border-left: 1px solid var(--line); }
  .g-vassoio { width: min(32%, 300px); flex-direction: column; align-items: stretch; justify-content: center; }
  .g-pers { --per: 3 !important; flex: none; }
}
/* tablet e computer: cerchietti piu' grandi (c'e' spazio) */
@media (min-width: 820px) and (min-height: 600px) {
  .g-pers { --t: 56px !important; }
}
/* iPhone in orizzontale: cerchietti in colonna, a destra, per lasciare la larghezza alla tabella */
@media (orientation: landscape) and (max-height: 599px) {
  .g-vassoio { width: auto; }
  .g-pers { --per: 1 !important; --t: 38px !important; gap: 4px; padding-top: 4px; align-content: center; }
  .g-pw { gap: 2px; }
  .g-nome { font-size: 10px; }
  .g-p .g-n { min-width: 17px; height: 17px; font-size: 10px; top: -3px; right: -5px; }
}
@media (min-width: 820px) and (min-height: 600px) {
  .g-r { font-size: 13px; line-height: 18px; }
  .g-cella { padding: 6px 8px 6px 10px; gap: 2px; }
}

/* la seconda maniera (8/10/2026): nella finestra della cella, le persone da aggiungere con un tocco */
.g-finestra ul:empty { display: none; }
.g-agg { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 2px 6px; }
.g-finestra ul:not(:empty) + .g-agg { margin-top: 4px; border-top: 1px solid var(--line); }
.g-agg button { height: 34px; padding: 0 13px; border-radius: 99px; background: var(--fill); color: var(--ink); font-size: 14px; font-weight: 650; }
.g-agg button:active { transform: scale(.95); }
.g-agg button.extra { color: var(--muted); } /* turni della settimana finiti: sarebbe uno straordinario */

/* in basso: intermedio e serale accesi o spenti per la settimana (8/10/2026) */
.g-fasce { flex: none; display: flex; justify-content: center; gap: 10px; }
.g-fasce button { height: 38px; display: inline-flex; align-items: center; gap: 10px; padding: 0 6px 0 14px; border-radius: 99px; background: var(--surface);
  font-size: 12.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); transition: color .2s; }
.g-fasce button[aria-checked="true"] { color: var(--ink); }
.g-fasce i { position: relative; width: 40px; height: 26px; border-radius: 99px; background: var(--fill); transition: background-color .25s; }
.g-fasce i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--spring); }
.g-fasce .g-int[aria-checked="true"] i { background: var(--int-bg); }
.g-fasce .g-ser[aria-checked="true"] i { background: var(--ser-bg); }
.g-fasce button[aria-checked="true"] i::after { transform: translateX(14px); }
.g-mot { margin-left: 1px; }
.g-corpo { flex-direction: column !important; } /* niente piu tondini a destra: gli interruttori stanno sotto anche in orizzontale */

/* ── il foglio della casella (proposta C, 8/10/2026): sale dal basso sopra la tabella ── */
.g-foglio {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; max-height: 62vh; display: flex; flex-direction: column;
  padding: 8px calc(env(safe-area-inset-right, 0px) + 16px) calc(env(safe-area-inset-bottom, 0px) + 18px) calc(env(safe-area-inset-left, 0px) + 16px);
  border-radius: 22px 22px 0 0; background: var(--surface); box-shadow: 0 -10px 34px rgba(0, 0, 0, .18);
  animation: g-sale .34s var(--spring) both; transition: transform .3s var(--spring);
}
.g-foglio.via { animation: g-scende .24s ease-in both; pointer-events: none; }
@keyframes g-sale { from { transform: translateY(100%); } }
@keyframes g-scende { to { transform: translateY(100%); } }
@media (min-width: 700px) { .g-foglio { left: 50%; right: auto; width: 560px; margin-left: -280px; } }
.g-fmani { display: block; flex: none; width: 36px; height: 5px; margin: 0 auto 10px; border-radius: 99px; background: #D1D1D6; }
.g-ftit { flex: none; display: flex; align-items: center; gap: 8px; }
.g-ftit b { font-size: 16px; font-weight: 800; }
.g-fsig { display: inline-grid; place-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--sbg); color: var(--sfg); font-size: 11px; font-weight: 800; letter-spacing: .04em; }
.g-foglio.t-off .g-fsig, .g-fum.t-off .g-fsig { box-shadow: inset 0 0 0 1px var(--line); }
.g-fok { margin-left: auto; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--bg); }
.g-fok svg { width: 16px; height: 16px; }
.g-fcorpo { min-height: 0; overflow-y: auto; padding-bottom: 2px; }
.g-fsez { margin: 14px 0 8px; font-size: 11px; font-weight: 750; color: var(--muted); letter-spacing: .05em; text-transform: uppercase; }
.g-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.g-chip { height: 34px; padding: 0 13px; border-radius: 99px; display: inline-flex; align-items: center; background: var(--fill); color: var(--ink); font-size: 14px; font-weight: 650; white-space: nowrap; }
.g-chip:active { transform: scale(.95); }
.g-chip.dentro { background: var(--sbg); color: var(--sfg); }
.g-foglio.t-off .g-chip.dentro, .g-fum.t-off .g-chip.dentro { box-shadow: inset 0 0 0 1.5px var(--ink); }
.g-chip.grigio, .g-chip.extra { color: var(--muted); }
.g-chip.fisso { color: var(--muted); font-style: italic; }
.g-off { list-style: none; margin: 0; padding: 0; }
.g-off li { display: flex; align-items: center; gap: 8px; padding: 5px 0; }
.g-off li + li { border-top: 1px solid var(--line); }

/* il mirino sulla tabella: turno e giorno accesi, riga e colonna appena tinte, la casella col bordino rosso */
.g-tf.g-mira { background: var(--sbg); color: var(--sfg); }
.g-tf.t-off.g-mira { background: var(--ink); color: var(--bg); }
.g-tg.g-mira { background: var(--ink); color: var(--bg); }
.g-tg.g-mira.g-oggi small { background: var(--bg); color: var(--ink); }
.g-cella.g-mira-riga, .g-cella.g-mira-col { background-color: rgba(26, 147, 216, .07); }
.g-cella.g-su { box-shadow: inset 0 0 0 2.5px #FF3B30; background-color: rgba(255, 59, 48, .06); }
.g-tf, .g-tg, .g-cella { transition: background-color .2s, color .2s, box-shadow .2s; }

/* quando il foglio coprirebbe la casella, la tabella sale e scorre sotto la testata */
.g-tab { position: relative; overflow-y: auto; scrollbar-width: none; transition: opacity .2s; } /* l altezza cambia subito: il foglio copre comunque quella parte mentre sale */
.g-tab::-webkit-scrollbar { display: none; }
/* la riga dei giorni resta ferma in alto quando la tabella scorre (foglio aperto) */
.g-tab .g-ang, .g-tab .g-tg { position: sticky; top: 0; z-index: 3; background: var(--surface); }
.g-tab .g-tg { box-shadow: 0 1px 0 var(--line); }
.g-tab .g-tg.g-mira { background: var(--ink); }
.g-fasce button:disabled { opacity: .4; cursor: default; } /* fascia con turni: si spegne solo dopo averla svuotata */

/* ── il fumetto della casella (proposta A, 8/10/2026): la punta verso la casella, un velo sul resto ── */
.g-velo { position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .14); pointer-events: none; animation: g-vela .22s ease both; }
.g-velo.via { animation: g-svela .18s ease both; }
@keyframes g-vela { from { opacity: 0; } }
@keyframes g-svela { to { opacity: 0; } }
.g-cella.g-su { z-index: 26; background-color: var(--surface); }
.g-cella.passato.g-su { background: var(--surface); }
.g-fum {
  position: fixed; z-index: 30; width: min(360px, calc(100vw - 20px)); padding: 14px 14px 12px; border-radius: 18px; background: var(--surface);
  filter: drop-shadow(0 0 1px rgba(0,0,0,.25)) drop-shadow(0 12px 22px rgba(0,0,0,.22));
  animation: g-fapre .26s var(--spring) both;
}
.g-fum.nuovo { animation: g-fapre .22s var(--spring) both; }
.g-fum.via { animation: g-fchiude .16s ease-in both; pointer-events: none; }
@keyframes g-fapre { from { opacity: 0; transform: scale(.88); } }
@keyframes g-fchiude { to { opacity: 0; transform: scale(.9); } }
.g-punta { position: absolute; left: var(--punta); width: 0; height: 0; margin-left: -11px; border-left: 11px solid transparent; border-right: 11px solid transparent; }
.g-fum.sotto .g-punta { top: -12px; border-bottom: 12px solid var(--surface); }
.g-fum.sopra .g-punta { bottom: -12px; border-top: 12px solid var(--surface); }
.g-fum .g-ftit { margin-bottom: 12px; }
.g-fum .g-off { margin: -4px 0 10px; }

/* nel fumetto: tutti sempre nello stesso ordine; chi non si puo' mettere in quel turno e' barrato */
.g-chip small { margin-left: 5px; font-size: 10.5px; font-weight: 800; letter-spacing: .04em; color: var(--muted); }
.g-chip.dentro small { color: inherit; opacity: .8; }
.g-chip.no { background: transparent; box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.g-chip.no s { text-decoration-thickness: 1.5px; text-decoration-color: rgba(215, 0, 21, .75); }
.g-chip.extra { color: var(--ink); }

/* l'elenco nel fumetto (scelta B, 8/10/2026): una riga per persona, il tondino con la spunta a destra */
.g-lista { list-style: none; margin: 0; padding: 0; max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
.g-lista::-webkit-scrollbar { display: none; }
/* iPhone in orizzontale: niente tetto fisso all'elenco, lo accorcia posiziona() solo se non ci sta da nessuna parte (9/10/2026) */
@media (orientation: landscape) and (max-height: 599px) { .g-lista { max-height: none; } }
.g-lista li { display: flex; align-items: center; gap: 8px; min-height: 46px; }
.g-lista li + li { border-top: 1px solid var(--line); }
.g-riga { flex: 1; min-width: 0; align-self: stretch; display: flex; align-items: center; text-align: left; }
.g-lista .g-fn { font-size: 15px; font-weight: 550; }
.g-lista li.si .g-fn { font-weight: 700; }
.g-lista li.fisso { padding-right: 4px; }
.g-spunta { flex: none; width: 26px; height: 26px; margin: 0 2px; border-radius: 50%; display: grid; place-items: center; box-shadow: inset 0 0 0 1.5px #C7C7CC; color: var(--sfg); transition: background-color .15s, box-shadow .15s; }
.g-lista li.si .g-spunta { background: var(--sbg); box-shadow: none; }
.g-fum.t-off .g-lista li.si .g-spunta { background: var(--ink); color: var(--bg); }
.g-spunta svg { width: 14px; height: 14px; }
.g-fum .g-ftit { margin-bottom: 6px; }
/* spostato da un altro turno: si puo' tenerlo in tutti e due (doppio turno, straordinario) */
.g-sposta { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 8px 8px 8px 12px; border-radius: 12px; background: var(--fill); font-size: 13px; font-weight: 600; color: var(--muted); animation: g-fapre .2s var(--spring) both; }
.g-sposta button { flex: none; height: 30px; padding: 0 11px; border-radius: 99px; background: var(--ink); color: var(--bg); font-size: 12.5px; font-weight: 700; }

/* ── testata: cestino e impostazioni, tondi grigi come la X (8/10/2026) ── */
.g-az .g-tondo { position: relative; background: var(--fill); }
.g-pallino { position: absolute; top: 1px; right: 1px; width: 10px; height: 10px; border-radius: 50%; background: #FF9500; box-shadow: 0 0 0 2px var(--bg); }
.g-fasce { display: none !important; }
/* le impostazioni della settimana: come il menu del tondino (9/10/2026), compatto e senza punta, sotto i
   tasti allineato a destra; testo normale a sinistra e l'interruttore a destra */
.g-imp { position: absolute; top: calc(100% + 8px); right: 0; z-index: 30; width: min(250px, calc(100vw - 24px)); border-radius: 14px; overflow: hidden;
  background: var(--surface); box-shadow: 0 0 0 .5px rgba(0,0,0,.1), 0 12px 32px -6px rgba(0,0,0,.28);
  transform-origin: 100% 0; animation: io-apre .28s var(--spring) both; }
.g-imp.via { animation: io-chiude .16s ease-in both; pointer-events: none; }
.g-az .g-imp .g-voce { width: 100%; height: 48px; border-radius: 0; display: flex; padding: 0 14px 0 16px; align-items: center; justify-content: space-between; gap: 10px; font-size: 16px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--ink); }
.g-voce + .g-voce { border-top: .5px solid var(--line); }
.g-az .g-imp .g-voce.rosso { color: var(--danger); } /* «Svuota settimana» (9/10/2026) */
.g-az .g-imp .g-voce svg { width: 20px; height: 20px; }
.g-imp-nota { margin: 0; padding: 11px 16px 10px; border-bottom: .5px solid var(--line); font-size: 13px; color: var(--muted); }
.g-voce:disabled { opacity: .4; cursor: default; }
.g-voce i { position: relative; flex: none; width: 44px; height: 27px; border-radius: 99px; background: var(--fill); transition: background-color .25s; }
.g-voce i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 21px; height: 21px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .25s var(--spring); }
.g-voce[aria-checked="true"] i::after { transform: translateX(17px); }
.g-voce.g-int[aria-checked="true"] i { background: var(--int-bg); }
.g-voce.g-ser[aria-checked="true"] i { background: var(--ser-bg); }
.g-voce.g-str[aria-checked="true"] i { background: #FF9500; }
.g-fstr { height: 20px; padding: 0 7px; border-radius: 6px; display: inline-grid; place-items: center; background: #FF9500; color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
/* conferma per svuotare la settimana: al centro, come quella per eliminare una richiesta */

/* testata stretta (telefono): tasti da 34 e piu' vicini */
@media (max-width: 440px) {
  .g-az { gap: 6px; }
  .g-az button { width: 34px; height: 34px; }
}

/* le sigle dei turni a sinistra: pillole col colore del turno, come nel calendario (OFF bianca col bordo) */
.g-tf span { display: grid; place-items: center; width: 34px; height: 22px; border-radius: 6px; background: var(--sbg); color: var(--sfg); font-size: 10.5px; font-weight: 800; letter-spacing: .03em; }
.g-tf.t-off span { box-shadow: inset 0 0 0 1px var(--line); }


/* fumetto a destra o a sinistra della casella (telefono in orizzontale): la punta di lato */
.g-fum.dx .g-punta, .g-fum.sx .g-punta { left: auto; top: var(--punta); margin: -11px 0 0; border: 0; border-top: 11px solid transparent; border-bottom: 11px solid transparent; }
.g-fum.dx .g-punta { left: -12px; border-right: 12px solid var(--surface); }
.g-fum.sx .g-punta { right: -12px; border-left: 12px solid var(--surface); }

/* schermi grandi (tablet in orizzontale, computer): piu' aria attorno alla tabella (9/10/2026) */
@media (min-width: 820px) and (min-height: 600px) {
  .gest { padding: calc(env(safe-area-inset-top, 0px) + 28px) max(48px, calc((100vw - 1240px) / 2)) calc(env(safe-area-inset-bottom, 0px) + 32px); gap: 20px; }
}
