/* ==========================================================================
   Marana Tech — gestionali.html (Gestionali e web app, MT·GES)
   Oggetto della pagina: dal foglio al gestionale. Le celle di un foglio di calcolo
   disordinato si staccano e volano (GSAP Flip) nei loro posti dentro un'applicazione:
   barra laterale, schede, tabella con stati e scadenze.
   Stato base = stato finale: il gestionale montato. Lo stato «foglio» esiste solo con
   html.js-motion prima della trasformazione (o su richiesta, .is-sheet-view).
   Prefisso delle classi: .ges-
   ========================================================================== */

/* ---------- Testata ---------- */
.ges-hero__grid { grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); }
@media (max-width: 960px) { .ges-hero__grid { grid-template-columns: 1fr; } }
.ges-h1 { font-size: clamp(2.3rem, 3.9vw, 3.6rem); }

.ges-hero__object { min-height: 0; container: ges / inline-size; }
.ges-demo { position: relative; }
.ges-demo__in { position: relative; }
.ges-demo__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: 60px; /* sopra, a destra, sporge il promemoria */
}
.ges-replay { --h: 44px; padding: 0 16px; font-size: .875rem; }
.ges-replay svg { width: 16px; height: 16px; }
.ges-replay:hover svg { transform: rotate(-60deg); }
html:not(.js) .ges-replay, .mt-nocore .ges-replay { display: none; } /* senza script il bottone non farebbe nulla */

/* ---------- La finestra ---------- */
.ges-win {
  position: relative;
  z-index: 2;
  padding: 0 7px 7px;
  border-radius: 14px;
  background: var(--brushed), linear-gradient(180deg, #2C3338 0%, #1D2226 55%, #171B1E 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    inset 0 0 0 1px rgba(255, 255, 255, .04),
    0 0 0 1px rgba(0, 0, 0, .55),
    0 2px 0 rgba(0, 0, 0, .35),
    0 36px 70px -30px rgba(0, 0, 0, .95),
    0 80px 120px -60px rgba(0, 0, 0, .7);
}
.ges-win__bar { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 6px; }
.ges-dots { display: inline-flex; flex: none; gap: 6px; }
.ges-dots i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #D5DADD, #6E787F 55%, #2B3237);
  box-shadow: 0 1px 1px rgba(0, 0, 0, .6);
}
.ges-dots--ghost { visibility: hidden; }
.ges-win__title { position: relative; flex: 1; min-width: 0; height: 16px; }
.ges-win__t {
  position: absolute;
  inset: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: .62rem;
  line-height: 16px;
  letter-spacing: .06em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--acciaio-testo);
  transition: opacity .2s var(--ease-out);
}
/* i due titoli non si sovrappongono mai: prima esce l'uscente, poi entra l'altro */
.ges-win__t--app { transition-duration: .3s; transition-delay: .22s; }
.ges-win__t--sheet { opacity: 0; transition-delay: 0s; }

.ges-stage {
  position: relative;
  isolation: isolate;
  height: 404px;
  overflow: hidden;
  border-radius: 8px;
  background: #121619;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6), 0 1px 0 rgba(255, 255, 255, .05);
}

/* Copie del foglio dietro la finestra (solo nello stato «foglio») */
.ges-ghost {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 14px;
  background: linear-gradient(180deg, #2A3136, #1B2024);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .5), 0 30px 50px -26px rgba(0, 0, 0, .9);
  opacity: 0;
  visibility: hidden;
}
.ges-ghost::before {
  content: "";
  position: absolute;
  inset: 34px 7px 7px;
  border-radius: 8px;
  background:
    repeating-linear-gradient(0deg, #D9DEE1 0 1px, transparent 1px 29px),
    repeating-linear-gradient(90deg, #D9DEE1 0 1px, transparent 1px 118px),
    #F1F3F4;
}
.ges-ghost span {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  font-family: var(--font-mono);
  font-size: .58rem;
  letter-spacing: .06em;
  text-align: center;
  color: var(--acciaio);
}
.ges-ghost--1 { transform: translate(18px, -18px) rotate(2deg); }
.ges-ghost--2 { transform: translate(36px, -34px) rotate(4deg); }

/* ---------- Il foglio di partenza ---------- */
.ges-sheet {
  --ges-cols: 30px 138px 124px 112px 96px minmax(64px, 1fr);
  --ges-rows: 22px repeat(16, 29px);
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #FBFCFC;
  color: #15181A;
  font-family: var(--font-body);
  visibility: hidden;
  opacity: 0;
}
.ges-fx {
  display: flex;
  align-items: stretch;
  height: 30px;
  background: #F1F3F4;
  border-bottom: 1px solid #D5DADD;
  font-size: 11px;
  line-height: 30px;
}
.ges-fx__ref { flex: none; width: 58px; border-right: 1px solid #D5DADD; font-family: var(--font-mono); font-size: 10px; text-align: center; color: #3A4247; }
.ges-fx__f { flex: none; padding: 0 10px; border-right: 1px solid #D5DADD; font-style: italic; font-weight: 500; color: #6E787F; }
.ges-fx__v { min-width: 0; padding: 0 10px; overflow: hidden; white-space: nowrap; font-family: var(--font-mono); font-size: 10.5px; color: #15181A; }

.ges-grid {
  position: relative;
  display: grid;
  grid-template-columns: var(--ges-cols);
  grid-template-rows: var(--ges-rows);
  grid-auto-rows: 29px;
}
.ges-lines {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: var(--ges-cols);
  grid-template-rows: var(--ges-rows);
  grid-auto-rows: 29px;
  pointer-events: none;
}
.ges-vl { grid-column: var(--c); grid-row: 1 / -1; justify-self: end; width: 1px; background: #DCE0E3; transform-origin: 50% 0; }
.ges-hl { grid-column: 1 / -1; grid-row: var(--r); align-self: end; height: 1px; background: #E4E8EA; transform-origin: 0 50%; }
.ges-sel { position: relative; z-index: 2; grid-column: 5; grid-row: 6; margin: -1px 0 -1px -1px; border: 2px solid #2F6E9E; }
.ges-sel::after { content: ""; position: absolute; right: -5px; bottom: -5px; width: 7px; height: 7px; background: #2F6E9E; box-shadow: 0 0 0 1.5px #FBFCFC; }

.ges-ch, .ges-rn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #EEF1F3;
  box-shadow: inset -1px -1px 0 #D5DADD;
  font-size: 10.5px;
  font-weight: 500;
  color: #5B656C;
}
.ges-rn { grid-column: 1; }
.ges-ch.is-sel, .ges-rn.is-sel { background: #D9E6F0; color: #2F6E9E; font-weight: 700; }
.ges-cell { position: relative; z-index: 1; display: flex; align-items: center; min-width: 0; overflow: hidden; }
.ges-cell.is-hl { background: #FFEDB8; }
.ges-cell--note { padding-left: 6px; font-size: 11.5px; font-style: italic; white-space: nowrap; color: #5B656C; }
.ges-cell--note b { font-size: 12px; font-style: normal; font-weight: 700; color: #15181A; }
.ges-sheet__tabs {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: stretch;
  height: 28px;
  padding-left: 30px;
  overflow: hidden;
  background: #EEF1F3;
  border-top: 1px solid #D5DADD;
  font-size: 10.5px;
  line-height: 27px;
  white-space: nowrap;
  color: #5B656C;
}
.ges-sheet__tabs span { padding: 0 12px; border-right: 1px solid #D5DADD; }
.ges-sheet__tabs .is-on { background: #FBFCFC; color: #15181A; font-weight: 600; box-shadow: inset 0 -2px 0 #2F6E9E; }

/* ---------- I pezzi che volano: stessa misura nel foglio e nell'app ---------- */
.ges-k { position: relative; display: block; flex: none; height: 22px; }
.ges-k--name { width: 112px; }
.ges-k--doc { width: 104px; }
.ges-k--state { width: 98px; height: 24px; }
.ges-k--date { width: 80px; }
.ges-k--h { height: 18px; }

.ges-sheet .ges-k, .ges-k__raw {
  display: flex;
  align-items: center;
  padding: 0 5px;
  overflow: hidden;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
  color: #15181A;
}
.ges-sheet .ges-k--h, .ges-k--h .ges-k__raw { font-weight: 700; }
.ges-sheet .ges-k.is-r, .ges-k__raw.is-r { justify-content: flex-end; }
.ges-sheet .ges-k.is-c, .ges-k__raw.is-c { justify-content: center; }
.ges-k__raw {
  position: absolute;
  inset: 0;
  border-radius: 2px;
  background: #FFFFFF;
  box-shadow: 0 0 0 1px rgba(21, 24, 26, .12), 0 10px 18px -8px rgba(0, 0, 0, .55);
  opacity: 0;
}
.ges-k__raw.is-hl { background: #FFEDB8; }
.ges-k__val { position: absolute; inset: 0; display: flex; align-items: center; white-space: nowrap; }

/* ---------- Il gestionale ---------- */
.ges-app {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  color: var(--cromo);
  font-family: var(--font-body);
}
.ges-app__bg { position: absolute; inset: 0; z-index: 0; background: var(--brushed), linear-gradient(180deg, #1D2226 0%, #171B1E 100%); }

.ges-side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 14px 8px 12px;
  background: linear-gradient(180deg, #16191C, #121518);
  box-shadow: inset -1px 0 0 rgba(195, 202, 208, .08);
}
.ges-side__brand { display: flex; align-items: center; gap: 7px; padding: 0 4px; font-size: 10.5px; font-weight: 650; line-height: 1.15; }
.ges-side__logo { flex: none; width: 18px; height: 18px; border-radius: 5px; background: var(--steel); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25); }
.ges-side__nav { list-style: none; display: grid; gap: 2px; }
.ges-side__nav li {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 6px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 520;
  white-space: nowrap;
  color: var(--acciaio-testo);
}
.ges-side__nav svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.ges-side__nav .is-active { color: var(--cromo); background: rgba(140, 192, 230, .1); box-shadow: inset 2px 0 0 var(--blu); }
.ges-side__badge {
  margin-left: auto;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--scintilla);
  box-shadow: 0 0 10px rgba(224, 160, 80, .55);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: #1B1307;
}
.ges-side__user { display: flex; align-items: center; gap: 7px; margin-top: auto; padding: 0 4px; font-size: 10.5px; font-weight: 520; color: var(--argento); }

.ges-main { position: relative; z-index: 2; display: flex; flex-direction: column; min-width: 0; padding: 0 14px 12px; }
.ges-top { display: flex; align-items: center; gap: 10px; height: 46px; }
.ges-top__title { font-family: var(--font-display); font-stretch: 112%; font-size: 15px; font-weight: 720; letter-spacing: -.01em; }
.ges-top__btn {
  margin-left: auto;
  height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--steel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 10px -4px rgba(0, 0, 0, .7);
  font-size: 10.5px;
  font-weight: 650;
  line-height: 26px;
  white-space: nowrap;
  color: #121517;
}
.ges-burger, .ges-av--me { display: none; }
.ges-tabs { display: flex; align-items: flex-end; gap: 18px; height: 32px; border-bottom: 1px solid rgba(195, 202, 208, .1); }
.ges-tabs span { position: relative; padding-bottom: 9px; font-size: 11px; font-weight: 560; white-space: nowrap; color: var(--acciaio-testo); }
.ges-tabs i { margin-left: 3px; font-family: var(--font-mono); font-size: 9px; font-style: normal; color: var(--acciaio); }
.ges-tabs .is-on { color: var(--cromo); }
.ges-tabs .is-on::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 1px;
  background: var(--blu);
  box-shadow: 0 0 8px rgba(140, 192, 230, .7);
  transform: scaleX(var(--tab, 1));
  transform-origin: 0 50%;
}

.ges-table { margin-top: 2px; }
.ges-tr {
  position: relative;
  display: grid;
  grid-template-columns: 26px minmax(112px, 1.2fr) minmax(104px, 1.1fr) minmax(98px, 1fr) 80px;
  column-gap: 10px;
  align-items: center;
  height: 46px;
}
.ges-tr::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(195, 202, 208, .08);
  transform: scaleX(var(--sep, 1));
  transform-origin: 0 50%;
}
.ges-tr--head { height: 32px; }
.ges-tr--head::after { background: rgba(195, 202, 208, .14); }
.ges-tr.ges-tr--head .ges-k__val { font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--acciaio-testo); }

.ges-av {
  display: grid;
  place-items: center;
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(180deg, #58626A, #30373C);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 2px 5px rgba(0, 0, 0, .5);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--cromo);
}
.ges-av--sm { width: 22px; height: 22px; font-size: 7.5px; }
.ges-k--name .ges-k__val { font-size: 12.5px; font-weight: 620; color: var(--cromo); }
.ges-k--doc .ges-k__val { font-size: 12px; color: var(--argento); }
.ges-k--date .ges-k__val { font-family: var(--font-mono); font-size: 10px; letter-spacing: .02em; color: var(--argento); transition: color .5s var(--ease-out); }
.ges-k--date.is-due .ges-k__val { color: var(--scintilla); }
.ges-k--date.is-due.is-quiet .ges-k__val { color: var(--argento); }

.ges-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  padding-top: 14px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--acciaio-testo);
}
.ges-legend span { display: inline-flex; align-items: center; gap: 7px; }

/* ---------- Stati: grammatica a tre (fatto · serve una persona · da fare) ---------- */
.ges-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 22px;
  padding: 0 9px 0 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}
.ges-badge.is-done { color: #CFE4F4; background: rgba(140, 192, 230, .12); border-color: rgba(140, 192, 230, .34); }
.ges-badge.is-wip { color: #F2CD96; background: rgba(224, 160, 80, .12); border-color: rgba(224, 160, 80, .42); }
.ges-badge.is-todo { color: var(--acciaio-testo); background: transparent; border: 1px dashed rgba(195, 202, 208, .45); }
.ges-badge.is-pop { animation: ges-pop .45s var(--ease-clack); }

.ges-led {
  position: relative;
  display: inline-block;
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2A3136;
  box-shadow: inset 0 1px 1px rgba(0, 0, 0, .7);
  transition: background-color .3s var(--ease-out), box-shadow .45s var(--ease-out);
}
.is-done > .ges-led, .ges-led.is-done { background: var(--blu); box-shadow: 0 0 0 2px rgba(140, 192, 230, .18), 0 0 10px rgba(140, 192, 230, .9); }
.is-wip > .ges-led, .ges-led.is-wip { background: var(--scintilla); box-shadow: 0 0 0 2px rgba(224, 160, 80, .2), 0 0 10px rgba(224, 160, 80, .85); }
.is-todo > .ges-led, .ges-led.is-todo { background: transparent; box-shadow: inset 0 0 0 1px rgba(195, 202, 208, .55); }
.ges-badge.is-dim > .ges-led { background: #2A3136; box-shadow: inset 0 1px 1px rgba(0, 0, 0, .7); }
.ges-led::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(170, 212, 242, .95) 0, rgba(140, 192, 230, 0) 70%);
  opacity: 0;
  pointer-events: none;
}
.is-wip > .ges-led::after { background: radial-gradient(circle, rgba(255, 222, 170, .95) 0, rgba(224, 160, 80, 0) 70%); }
.ges-led.is-flash::after { animation: ges-flash .7s var(--ease-out) both; }
.ges-sonar { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 1.5px rgba(224, 160, 80, .9); opacity: 0; pointer-events: none; will-change: transform, opacity; /* strato proprio: il loop non ridisegna */ }

@keyframes ges-flash { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: 1; } 100% { opacity: 0; transform: scale(2.4); } }
@keyframes ges-pop { from { transform: scale(.9); } to { transform: none; } }

/* ---------- Il promemoria: la svolta della scena ---------- */
.ges-toast {
  position: absolute;
  z-index: 4;
  right: -20px;
  bottom: -42px; /* a cavallo del bordo: non copre righe né legenda */
  display: flex;
  align-items: flex-start;
  gap: 11px;
  width: 256px;
  padding: 12px 14px 13px 12px;
  border-radius: 11px;
  background: var(--brushed), linear-gradient(180deg, #2E353A, #21272B);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    inset 0 0 0 1px rgba(224, 160, 80, .34),
    0 26px 44px -18px rgba(0, 0, 0, .95),
    0 8px 16px -8px rgba(0, 0, 0, .6);
}
.ges-toast__ico {
  display: grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: var(--scintilla);
  background: rgba(224, 160, 80, .13);
  box-shadow: inset 0 0 0 1px rgba(224, 160, 80, .3);
}
.ges-toast__ico svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.ges-toast__txt { font-size: 12.5px; font-weight: 520; line-height: 1.35; color: var(--cromo); }
.ges-toast__txt b { display: block; margin-bottom: 4px; font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--scintilla); }

/* ---------- Stato «foglio»: solo con movimento, prima della trasformazione ---------- */
@media screen {
  html.js-motion .ges-demo:not(.is-app) .ges-sheet,
  .ges-demo.is-sheet-view .ges-sheet { visibility: visible; opacity: 1; }
  html.js-motion .ges-demo:not(.is-app) .ges-app,
  .ges-demo.is-sheet-view .ges-app { visibility: hidden; }
  html.js-motion .ges-demo:not(.is-app) .ges-ghost,
  .ges-demo.is-sheet-view .ges-ghost { visibility: visible; opacity: 1; }
  html.js-motion .ges-demo:not(.is-app) .ges-toast,
  .ges-demo.is-sheet-view .ges-toast { visibility: hidden; opacity: 0; }
  html.js-motion .ges-demo:not(.is-app) .ges-win__t--sheet,
  .ges-demo.is-sheet-view .ges-win__t--sheet { opacity: 1; transition-duration: .3s; transition-delay: .22s; }
  html.js-motion .ges-demo:not(.is-app) .ges-win__t--app,
  .ges-demo.is-sheet-view .ges-win__t--app { opacity: 0; transition-duration: .2s; transition-delay: 0s; }
}
/* durante lo scambio le celle del foglio lasciano il posto ai pezzi dell'app */
.ges-demo.is-app:not(.is-sheet-view) .ges-sheet .ges-k { visibility: hidden; }

/* ---------- Oggetto stretto (telefono, colonna piccola): l'app diventa a schede ---------- */
@container ges (max-width: 609px) {
  .ges-stage { height: 486px; } /* in fondo resta un margine libero: lì si appoggia il promemoria */
  .ges-sheet { --ges-cols: 26px 124px 114px 108px 92px 76px; --ges-rows: 20px repeat(16, 27px); }
  .ges-fx { height: 28px; line-height: 28px; }
  .ges-sheet__tabs { padding-left: 26px; }
  /* colonna stretta: le finestre dietro si impilano dritte e più strette, senza uscire dal bordo dello schermo */
  .ges-ghost--1 { transform-origin: 50% 0; transform: translateY(-11px) scale(.95); }
  .ges-ghost--2 { transform-origin: 50% 0; transform: translateY(-21px) scale(.9); }

  .ges-app { grid-template-columns: minmax(0, 1fr); }
  .ges-side { display: none; }
  .ges-main { padding: 0 10px 10px; }
  .ges-top { height: 44px; }
  .ges-burger { display: inline-grid; gap: 3px; width: 14px; }
  .ges-burger i { height: 1.5px; border-radius: 1px; background: var(--argento); }
  .ges-top__btn { display: none; }
  .ges-av--me { display: grid; margin-left: auto; }
  .ges-tabs {
    gap: 4px;
    height: auto;
    padding: 3px;
    border: 0;
    border-radius: 8px;
    background: rgba(0, 0, 0, .28);
    box-shadow: inset 0 0 0 1px rgba(195, 202, 208, .08);
  }
  .ges-tabs span { flex: 1; padding: 7px 4px; border-radius: 6px; font-size: 10.5px; text-align: center; }
  .ges-tabs .is-on { background: rgba(140, 192, 230, .12); box-shadow: inset 0 0 0 1px rgba(140, 192, 230, .3); }
  .ges-tabs .is-on::after { display: none; }
  .ges-table { display: grid; gap: 6px; margin-top: 8px; }
  .ges-tr--head { display: none; }
  .ges-tr {
    grid-template-columns: 28px minmax(0, 1fr) auto;
    grid-template-areas: "av name state" "av doc date";
    row-gap: 3px;
    height: auto;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, .03);
    box-shadow: inset 0 0 0 1px rgba(195, 202, 208, .08);
  }
  .ges-tr::after { display: none; }
  .ges-tr > .ges-av { grid-area: av; align-self: start; margin-top: 1px; }
  .ges-tr > .ges-k--name { grid-area: name; }
  .ges-tr > .ges-k--doc { grid-area: doc; }
  .ges-tr > .ges-k--state { grid-area: state; justify-self: end; }
  .ges-tr > .ges-k--date { grid-area: date; justify-self: end; }
  .ges-k--doc, .ges-k--date { height: 18px; }
  .ges-app .ges-k--state .ges-k__val, .ges-app .ges-k--date .ges-k__val { justify-content: flex-end; }
  .ges-legend { gap: 6px 12px; font-size: 8.5px; }
  .ges-toast { right: 10px; bottom: -38px; width: min(256px, calc(100% - 20px)); }
  .ges-demo__foot { margin-top: 56px; }
}

/* telefoni stretti: la legenda va su due righe, la scena si allunga di conseguenza */
@container ges (max-width: 400px) {
  .ges-stage { height: 508px; }
}

/* ---------- Quando serve: il quadro dei segnali ---------- */
.ges-when__split { align-items: center; }
.ges-when__head { margin-bottom: 0; }
.ges-panel { padding: clamp(26px, 3.4vw, 40px); }
.ges-screw {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #FFFFFF, #AEB6BC 55%, #7A848B);
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .25), 0 1px 1px rgba(0, 0, 0, .2);
}
.ges-screw::after { content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 1px; margin-top: -.5px; background: rgba(21, 24, 26, .5); transform: rotate(var(--sr, 35deg)); }
.ges-screw:nth-child(1) { top: 12px; left: 12px; }
.ges-screw:nth-child(2) { top: 12px; right: 12px; --sr: -20deg; }
.ges-screw:nth-child(3) { bottom: 12px; left: 12px; --sr: 80deg; }
.ges-screw:nth-child(4) { bottom: 12px; right: 12px; --sr: 10deg; }
.ges-panel__code { margin-bottom: 26px; }
.ges-signals { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 26px; }
.ges-signal { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 14px; }
.ges-signal__txt { font-size: var(--fs-small); font-weight: 540; line-height: 1.4; color: var(--fg); }
/* leve già accese, sola lettura: stato base = acceso */
.ges-signal .toggle__lever { transform: scaleY(.9); }
.ges-signal .led { --led-lit: 1; }
html.js-motion .ges-panel.is-armed .ges-signal:not(.is-on) .toggle__lever { transform: scaleY(-.9); }
html.js-motion .ges-panel.is-armed .ges-signal:not(.is-on) .led { --led-lit: 0; }
/* all'armamento (sotto la piega) leve e luci passano allo stato di partenza senza animarsi */
html.js-motion .ges-panel.is-armed:not(.is-played) .toggle__lever,
html.js-motion .ges-panel.is-armed:not(.is-played) .led::after,
html.js-motion .ges-panel.is-armed:not(.is-played) .ges-master__lamp::after { transition: none; }

.ges-master { display: flex; align-items: center; gap: 16px; margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--line); }
.ges-master__lamp {
  position: relative;
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #F3F5F6, #BCC3C8 55%, #8E979D);
  box-shadow: 0 0 0 4px rgba(21, 24, 26, .06), inset 0 -2px 3px rgba(0, 0, 0, .2);
}
.ges-master__lamp::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #E2F1FC, #8CC0E6 45%, #2F6E9E);
  box-shadow: 0 0 0 4px rgba(47, 110, 158, .14), 0 0 20px rgba(47, 110, 158, .7);
  transition: opacity .5s var(--ease-out);
}
html.js-motion .ges-panel.is-armed:not(.is-complete) .ges-master__lamp::after { opacity: 0; }
.ges-master p { font-family: var(--font-display); font-stretch: 110%; font-size: 1.15rem; font-weight: 680; line-height: 1.25; }
@media (max-width: 560px) { .ges-signals { grid-template-columns: 1fr; } }

/* ---------- Cosa può fare: targhe ---------- */
.ges-bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2vw, 24px); }
.ges-feat { display: flex; flex-direction: column; }
.ges-feat--wide { grid-column: span 2; }
.ges-feat__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.ges-feat__top .plate__code { margin-bottom: 0; }
.ges-feat__ico { flex: none; width: 30px; height: 30px; margin-top: -6px; fill: none; stroke: var(--argento); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
.ges-feat .plate__foot { margin-top: auto; padding-top: 22px; }
.ges-states { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.ges-files { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: auto; padding-top: 24px; }
.ges-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 28px;
  padding: 0 10px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .04em;
  white-space: nowrap;
  color: var(--fg-3);
}
.ges-file.is-old { text-decoration: line-through; text-decoration-color: rgba(195, 202, 208, .55); }
.ges-file.is-one { color: var(--fg); background: var(--accent-soft); box-shadow: inset 0 0 0 1px rgba(140, 192, 230, .35); }
.ges-files__arrow { width: 16px; height: 16px; color: var(--fg-3); }
@media (max-width: 960px) {
  .ges-bento { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ges-feat--wide:last-child { grid-column: auto; }
}
@media (max-width: 640px) {
  .ges-bento { grid-template-columns: minmax(0, 1fr); }
  .ges-feat--wide { grid-column: auto; }
}

/* ---------- Dall'officina: un gestionale d'esempio, con dati finti ----------
   Filtro per ruolo: i moduli si riordinano (Flip) e cambia la vista. */
.ges-officina__grid { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(36px, 6vw, 96px); align-items: center; }
.ges-officina__text { display: grid; gap: 22px; align-content: start; justify-items: start; }
.ges-officina__text h2 { font-size: clamp(1.9rem, 3vw, 2.8rem); }
@media (max-width: 960px) { .ges-officina__grid { grid-template-columns: minmax(0, 1fr); } }

.ges-tool__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ges-roles {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .35);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .6), inset 0 0 0 1px var(--line);
}
html:not(.js) .ges-roles, .mt-nocore .ges-roles { display: none; }
.ges-role {
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: .875rem;
  font-weight: 600;
  color: var(--fg-3);
  transition: color var(--t-ui) var(--ease-out), background-color var(--t-ui) var(--ease-out), box-shadow var(--t-ui) var(--ease-out);
}
.ges-role:hover { color: var(--fg); }
.ges-role[aria-pressed="true"] {
  color: #121517;
  background: var(--steel);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9), 0 4px 10px -4px rgba(0, 0, 0, .8);
}

.ges-tool {
  padding: 0 7px 7px;
  border-radius: 14px;
  background: var(--brushed), linear-gradient(180deg, #2C3338 0%, #1D2226 55%, #171B1E 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 0 0 1px rgba(0, 0, 0, .55), 0 36px 70px -30px rgba(0, 0, 0, .95);
}
.ges-tool__bar { display: flex; align-items: center; gap: 12px; height: 34px; padding: 0 6px; }
.ges-tool__url { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .06em; color: var(--acciaio-testo); }
.ges-tool__body {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  min-height: 392px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--brushed), linear-gradient(180deg, #1D2226, #171B1E);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .6);
}
.ges-tool__nav {
  list-style: none;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 10px;
  background: linear-gradient(180deg, #16191C, #121518);
  box-shadow: inset -1px 0 0 rgba(195, 202, 208, .08);
}
.ges-tool__nav li {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 32px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 540;
  white-space: nowrap;
  color: var(--argento);
}
.ges-tool__nav li i { flex: none; width: 6px; height: 6px; border-radius: 2px; background: var(--acciaio); }
.ges-tool__nav li.is-off { display: none; }
.ges-tool__views { position: relative; min-width: 0; padding: 18px 20px 20px; container: gesv / inline-size; }
/* le tre viste stanno nella stessa cella: il riquadro è alto quanto la più lunga e al cambio di ruolo
   non salta (né sposta la didascalia e la pagina sotto). Le viste nascoste restano fuori da lettori di
   schermo e tastiera con visibility: hidden (qui serve battere il [hidden] del core, che è !important) */
.ges-tool__views { display: grid; align-content: start; }
.ges-view { grid-area: 1 / 1; min-width: 0; }
.ges-tool__views > .ges-view[hidden] { display: block !important; visibility: hidden; }
.ges-view__title { margin-bottom: 14px; font-family: var(--font-display); font-stretch: 110%; font-size: 1.05rem; font-weight: 700; }

/* vista del reparto: la segnalazione aperta e le sue tappe */
.ges-ticket { display: grid; gap: 3px; margin: -4px 0 10px; padding-bottom: 12px; border-bottom: 1px solid rgba(195, 202, 208, .1); }
.ges-ticket b { font-size: .9rem; font-weight: 640; }
.ges-ticket span { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.ges-steps { list-style: none; display: grid; }
.ges-step { position: relative; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 40px; font-size: .86rem; }
.ges-step::before { content: ""; position: absolute; left: 10.5px; top: 50%; height: 100%; width: 1px; background: rgba(195, 202, 208, .16); }
.ges-step:last-child::before { display: none; }
.ges-step.is-done::before { background: rgba(140, 192, 230, .55); }
.ges-step__dot {
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 12px;
  height: 12px;
  border: 1.5px solid rgba(195, 202, 208, .18);
  border-radius: 50%;
  background: #22282C;
}
/* la luce di ogni tappa è un livello già disegnato che si accende in opacità */
.ges-step__dot::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: 50%;
  opacity: 0;
}
.ges-step.is-done .ges-step__dot::before { background: var(--blu); box-shadow: 0 0 0 3px rgba(140, 192, 230, .16), 0 0 12px rgba(140, 192, 230, .85); opacity: 1; }
.ges-step.is-wip .ges-step__dot::before { background: var(--scintilla); box-shadow: 0 0 0 3px rgba(224, 160, 80, .18), 0 0 12px rgba(224, 160, 80, .85); opacity: 1; }
.ges-step.is-todo .ges-step__dot { background: #1B2024; border: 1.5px dashed rgba(195, 202, 208, .55); }
.ges-step__name { font-weight: 560; color: var(--fg); }
.ges-step.is-todo .ges-step__name { color: var(--fg-2); }
.ges-step__st { font-family: var(--font-mono); font-size: .6rem; letter-spacing: .1em; text-align: right; text-transform: uppercase; color: var(--fg-3); }
.ges-step.is-done .ges-step__st { color: #A9D0EE; }
.ges-step.is-wip .ges-step__st { color: #EFC287; }
/* accensione in sequenza (solo con movimento, se la scena è ancora sotto la piega) */
.ges-tool.is-played .ges-step__dot::before { transition: opacity .4s var(--ease-out); }
html.js-motion .ges-tool.is-armed .ges-step:not(.is-lit) .ges-step__dot::before { opacity: 0; }
html.js-motion .ges-tool.is-armed .ges-step:not(.is-lit)::before { background: rgba(195, 202, 208, .12); }
.ges-step.is-lit.is-done .ges-step__dot::after,
.ges-step.is-lit.is-wip .ges-step__dot::after {
  content: "";
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(170, 212, 242, .9), rgba(140, 192, 230, 0) 70%);
  animation: ges-flash .7s var(--ease-out) both;
}
.ges-step.is-lit.is-wip .ges-step__dot::after { background: radial-gradient(circle, rgba(255, 222, 170, .95), rgba(224, 160, 80, 0) 70%); }

/* vista della manutenzione: gli interventi in ordine di urgenza */
.ges-jobs, .ges-queue { list-style: none; display: grid; gap: 8px; }
.ges-job {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  grid-template-areas: "av what st" "av seg seg";
  align-items: center;
  gap: 8px 12px;
  padding: 12px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .03);
  box-shadow: inset 0 0 0 1px rgba(195, 202, 208, .08);
}
.ges-job .ges-av { grid-area: av; align-self: start; width: 32px; height: 32px; font-size: 10px; }
.ges-job__what { grid-area: what; display: grid; line-height: 1.3; }
.ges-job__what b { font-size: .86rem; font-weight: 620; }
.ges-job__what span { font-size: .76rem; color: var(--fg-3); }
.ges-job__st { grid-area: st; font-family: var(--font-mono); font-size: .58rem; letter-spacing: .08em; text-align: right; text-transform: uppercase; color: var(--fg-3); }
.ges-job__st.is-wip { color: #EFC287; }
.ges-job__st.is-done { color: #A9D0EE; }
.ges-seg { grid-area: seg; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 3px; }
.ges-seg i { height: 6px; border: 1px dashed rgba(195, 202, 208, .38); border-radius: 2px; }
.ges-seg i.d { background: var(--blu); border: 0; box-shadow: 0 0 6px rgba(140, 192, 230, .5); }
.ges-seg i.w { background: var(--scintilla); border: 0; box-shadow: 0 0 6px rgba(224, 160, 80, .5); }

/* vista della direzione: il quadro della settimana */
.ges-queue li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: "led what" "led st";
  align-items: center;
  column-gap: 14px;
  row-gap: 2px;
  padding: 12px 14px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .03);
  box-shadow: inset 0 0 0 1px rgba(195, 202, 208, .08);
}
.ges-queue .ges-led { grid-area: led; }
.ges-queue b { grid-area: what; font-size: .86rem; font-weight: 620; }
.ges-queue li > span:not(.ges-led) { grid-area: st; font-size: .78rem; color: var(--fg-3); }
.ges-queue li.is-wip { box-shadow: inset 0 0 0 1px rgba(224, 160, 80, .3); }
.ges-queue li.is-todo { box-shadow: none; outline: 1px dashed rgba(195, 202, 208, .28); outline-offset: -1px; }
.ges-queue--mini { margin-top: 14px; }
.ges-queue--mini li { padding: 10px 14px; background: transparent; }

.ges-tool__cap { min-height: 1.6em; margin-top: 14px; font-size: var(--fs-small); color: var(--fg-2); }

@media (max-width: 640px) {
  .ges-tool__body { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .ges-tool__nav { flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 12px; box-shadow: inset 0 -1px 0 rgba(195, 202, 208, .08); }
  .ges-tool__nav li { height: 30px; padding: 0 10px; font-size: .74rem; background: rgba(255, 255, 255, .04); }
  .ges-tool__views { padding: 16px 14px 18px; }
}
/* colonna delle viste stretta (anche su desktop a 1024): lo stato va sotto il nome della tappa */
@container gesv (max-width: 340px) {
  .ges-step { grid-template-columns: 22px minmax(0, 1fr); row-gap: 2px; padding-block: 6px; }
  .ges-step__st { grid-column: 2; text-align: left; }
  .ges-step::before { top: 21px; }
}
/* telefono: le tre linguette su una riga (Direzione da sola sotto sembrava un'altra cosa);
   solo sotto i 375 px, dove «Manutenzione» non ci starebbe, due sopra e una sotto */
@media (max-width: 520px) {
  .ges-roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .ges-role { padding: 0 4px; font-size: .8125rem; }
}
@media (max-width: 374px) {
  .ges-roles { grid-template-columns: 1fr 1fr; }
  .ges-role { padding: 0 10px; font-size: .875rem; }
  .ges-role:last-child { grid-column: span 2; }
}

/* ---------- Costruito per durare: la scheda di collaudo ---------- */
/* il timbro armato (scale 1.75, rotation -22) sporge oltre il bordo: la sezione, larga quanto lo schermo,
   lo ritaglia in orizzontale, così su telefono la pagina non si allarga e l'header resta al suo posto */
.ges-built { overflow-x: clip; }
.ges-built__split { align-items: center; }
.ges-built__head { margin-bottom: 0; }
.ges-test { padding: clamp(26px, 3.2vw, 40px); padding-bottom: clamp(34px, 4vw, 48px); }
.ges-test__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-strong);
}
.ges-test__head .plate__code { margin: 0; }
.ges-test__ref { font-family: var(--font-display); font-stretch: 110%; font-size: 1.05rem; font-weight: 700; }
.ges-test__list { list-style: none; }
.ges-test__row {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px dashed var(--line-strong);
}
.ges-test__txt { font-weight: 540; line-height: 1.4; }
.ges-test__tag {
  padding: 4px 8px;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  font-family: var(--font-mono);
  font-size: .6rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--fg-3);
}
/* la spunta di ogni voce: cerchio e tratto (pathLength="1"); stato base = spuntata */
.ges-test__ind { width: 16px; height: 16px; overflow: visible; fill: none; stroke: var(--blu-scuro); stroke-linecap: round; stroke-linejoin: round; }
.ges-test__ring { stroke-width: 1.4; }
.ges-test__tick { stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 0; }
/* collaudo in corso: cerchio tratteggiato, poi ambra mentre si prova, poi la spunta si traccia */
html.js-motion .ges-test.is-armed .ges-test__row:not(.is-ok) .ges-test__ring { stroke: rgba(21, 24, 26, .42); stroke-dasharray: 2.2 2.4; }
html.js-motion .ges-test.is-armed .ges-test__row.is-wip .ges-test__ring { stroke: #B5763A; stroke-dasharray: none; }
html.js-motion .ges-test.is-armed .ges-test__row:not(.is-ok) .ges-test__tick { stroke-dashoffset: 1; }
.ges-test.is-played .ges-test__tick { transition: stroke-dashoffset .32s var(--ease-out); }
/* riga «Esito» in fondo alla scheda: il timbro ci cade sopra, senza coprire le voci */
.ges-test__foot { position: relative; display: flex; align-items: flex-end; gap: 14px; min-height: 104px; padding-top: 20px; }
.ges-test__label { padding-bottom: 4px; font-family: var(--font-mono); font-size: .62rem; letter-spacing: .2em; text-transform: uppercase; color: var(--fg-3); }
.ges-test__line { flex: 1; height: 1px; margin-bottom: 8px; background: var(--line-strong); }
.ges-stamp {
  position: absolute;
  right: 22px;
  bottom: -26px;
  width: 128px;
  height: 128px;
  pointer-events: none;
  transform: rotate(-9deg);
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .7));
}
.ges-stamp svg { width: 100%; height: 100%; overflow: visible; }
.ges-stamp text { font-family: var(--font-mono); font-weight: 600; }
html.js-motion .ges-test.is-armed .ges-stamp { opacity: 0; }
/* durante la caduta timbro e scheda stanno su un livello proprio: l'ombra del timbro si disegna una volta */
.ges-test.is-played, .ges-test.is-played .ges-stamp { will-change: transform; }
@media (max-width: 640px) {
  .ges-test__row { grid-template-columns: 16px minmax(0, 1fr); row-gap: 6px; }
  .ges-test__tag { grid-column: 2; justify-self: start; }
  .ges-test__foot { min-height: 92px; }
  .ges-stamp { right: 10px; bottom: -22px; width: 108px; height: 108px; }
}

/* ---------- Come lavoriamo: la rotaia ---------- */
.ges-rail {
  --p: 1;
  list-style: none;
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
  padding-top: 38px;
}
.ges-rail::before, .ges-rail::after { content: ""; position: absolute; left: 0; right: 0; top: 7px; height: 2px; border-radius: 1px; }
.ges-rail::before { background: var(--line-strong); }
.ges-rail::after {
  background: linear-gradient(90deg, var(--argento), var(--blu));
  box-shadow: 0 0 10px rgba(140, 192, 230, .45);
  transform: scaleX(var(--p));
  transform-origin: 0 50%;
}
html.js-motion .ges-rail.is-armed { --p: 0; }
.ges-rail__step { position: relative; display: grid; align-content: start; gap: 10px; }
.ges-rail__node {
  position: absolute;
  top: -38px;
  left: 0;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #EEF1F3, #7A848B 60%, #3A4247);
  box-shadow: 0 2px 4px rgba(0, 0, 0, .6);
}
.ges-rail__node::after {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: var(--blu);
  box-shadow: 0 0 10px rgba(140, 192, 230, .9);
  transition: opacity .4s var(--ease-out);
}
html.js-motion .ges-rail.is-armed .ges-rail__step:not(.is-on) .ges-rail__node::after { opacity: 0; }
html.js-motion .ges-rail.is-armed:not(.is-played) .ges-rail__node::after { transition: none; }
.ges-rail__num { font-family: var(--font-mono); font-size: .7rem; letter-spacing: .14em; color: var(--fg-3); }
.ges-rail__step h3 { font-size: 1.3rem; }
.ges-rail__step p { font-size: var(--fs-small); color: var(--fg-2); }
.ges-rail__after {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 32px;
  margin-top: clamp(40px, 5vw, 64px);
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.ges-rail__after > p { font-family: var(--font-display); font-stretch: 112%; font-size: clamp(1.3rem, 2.2vw, 1.8rem); font-weight: 700; letter-spacing: -.01em; }
.ges-rail__after .btn-row { gap: 12px 28px; }
@media (max-width: 860px) {
  .ges-rail { grid-template-columns: minmax(0, 1fr); gap: 30px; padding-top: 0; padding-left: 40px; }
  .ges-rail::before, .ges-rail::after { left: 7px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .ges-rail::after { background: linear-gradient(180deg, var(--argento), var(--blu)); transform: scaleY(var(--p)); transform-origin: 50% 0; }
  .ges-rail__node { top: 2px; left: -40px; }
}

/* ---------- Stampa: il gestionale finito, leggibile su carta ---------- */
@media print {
  .ges-tool__views > .ges-view[hidden] { display: none !important; }
  .ges-ghost, .ges-toast, .ges-replay, .ges-roles { display: none !important; }
  .ges-stamp { filter: none; }
  .ges-win, .ges-tool, .ges-stage, .ges-app__bg, .ges-side, .ges-tool__body, .ges-tool__nav { background: none !important; border: 1px solid #bbb; }
  .ges-app, .ges-app *, .ges-tool, .ges-tool * { color: #111 !important; }
  .ges-badge { border-color: #777 !important; background: none !important; }
  .ges-k__raw { display: none !important; }
  .ges-step.is-todo .ges-step__dot { background: none !important; border-color: #777 !important; }
  .ges-stamp { will-change: auto; }
}

/* ---------- WebKit (Safari e iOS): la superficie dell'app entra su un livello già disegnato ----------
   In WebKit l'ingresso usa scaleX al posto del ritaglio animato (gestionali.js): il livello
   esiste da subito, così la superficie si rasterizza una volta col primo disegno della pagina
   e non nel primo fotogramma dello scambio. */
html.is-webkit.js-motion .ges-app__bg { will-change: transform; }
/* la scheda di collaudo e il timbro: in WebKit il livello c'è già prima della scena e resta dopo,
   così né l'inizio della scena né la fine (quando .is-played se ne va) ridipingono la scheda intera */
html.is-webkit.js-motion .ges-test,
html.is-webkit.js-motion .ges-test .ges-stamp { will-change: transform; }
@media print { html.is-webkit :is(.ges-app__bg, .ges-test, .ges-stamp) { will-change: auto; } }
