/* Demo interattiva di Arianna.
 *
 * Un deal, dall'inizio alla fine, in sei scene. Stesso sistema visivo
 * della vetrina e del prodotto, e la stessa regola: IL BLU APPARTIENE
 * ALL'AGENTE. Marca cio' che Arianna ha letto, scritto e collegato. La
 * barra di avanzamento e i bottoni sono slate, perche' avanzare nella
 * demo lo fa chi la guarda; l'ambra compare solo dove serve una persona.
 *
 * Pensata prima per il telefono: una colonna, comandi in basso a portata
 * di pollice. Dal portatile in su le scene si aprono su due colonne.
 */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--stone);
  color: var(--ink);
  font-family: var(--f-testo);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: 72rem; margin-inline: auto; padding-inline: 20px; }
.fatti { font-family: var(--f-fatti); font-variant-numeric: tabular-nums; }

/* ── testata ─────────────────────────────────────────────────── */

.testa { background: var(--sheet); border-bottom: 1px solid var(--rule); padding-top: env(safe-area-inset-top, 0px); }
.testa-riga { display: flex; align-items: center; gap: 12px; height: 56px; }
.marchio { display: flex; align-items: center; gap: 9px; }
.marchio svg { width: 22px; height: 22px; display: block; overflow: visible; }
.marchio span { font-size: 17px; font-weight: 700; letter-spacing: -.035em; }
.stacco { width: 1px; height: 22px; background: var(--rule); }
.dove { font-size: 13px; color: var(--muted); white-space: nowrap; }
.testa-dx { margin-left: auto; display: flex; align-items: center; gap: 6px; }

/* ── bottoni: slate, mai blu ─────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-testo); font-size: 14px; font-weight: 600; line-height: 1;
  padding: 12px 16px; border: 1px solid transparent; background: none;
  cursor: pointer; white-space: nowrap; min-height: 44px;
  transition: background-color .12s, color .12s, border-color .12s;
  -webkit-tap-highlight-color: transparent;
}
.btn-ink { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.btn-ink:hover { background: var(--muted-fort); border-color: var(--muted-fort); }
.btn-line { border-color: var(--ink); color: var(--ink); }
.btn-line:hover { background: var(--ink); color: var(--on-ink); }
.btn-plain { color: var(--muted); padding-inline: 8px; }
.btn-plain:hover { color: var(--ink); }
.btn-l { font-size: 15px; padding: 15px 22px; }
.btn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.tema { width: 36px; min-height: 36px; height: 36px; padding: 0; border: 1px solid var(--rule); color: var(--muted); font-size: 13px; }

/* ── la barra dei passi ──────────────────────────────────────── */

.rail { background: var(--sheet); border-bottom: 1px solid var(--rule); }
.rail ol { list-style: none; margin: 0; padding: 0; display: flex; }
.rail li { flex: 1; min-width: 0; }
.rail button {
  all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%;
  padding: 13px 0 11px; position: relative;
  -webkit-tap-highlight-color: transparent;
}
.rail button::before {
  content: ""; position: absolute; left: 0; right: 0; top: 17px; height: 1px;
  background: var(--rule);
}
.rail li.fatto button::before { background: var(--ink); }
.rail .nodo {
  display: block; position: relative; z-index: 1;
  width: 9px; height: 9px;
  background: var(--sheet); border: 1.5px solid var(--rule);
}
.rail li.fatto .nodo, .rail li.qui .nodo { background: var(--ink); border-color: var(--ink); }
.rail li.qui .nodo { outline: 3px solid color-mix(in oklab, var(--ink) 16%, transparent); }
.rail .voce {
  display: none; margin-top: 7px; padding-right: 10px;
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rail li.qui .voce { color: var(--ink); font-weight: 600; }
.rail button:focus-visible .nodo { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (min-width: 52rem) { .rail .voce { display: block; } }

/* ── il palco ────────────────────────────────────────────────── */

#palco { flex: 1; }

.scena { display: none; padding-block: 26px 34px; }
.scena.on { display: block; animation: entra .3s ease both; }

@keyframes entra { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.scena-testa { margin-bottom: 22px; }
.passo { display: block; font-size: 12px; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }

.scena h1 {
  font-weight: 700;
  font-size: clamp(1.75rem, 5.4vw, 3rem);
  line-height: 1.04;
  letter-spacing: -.036em;
  max-width: 20ch;
  text-wrap: balance;
}
.guida { margin-top: 12px; color: var(--muted-fort); max-width: 58ch; text-wrap: pretty; }

@media (min-width: 60rem) {
  .scena { padding-block: 44px 52px; }
  .scena-testa { display: grid; grid-template-columns: 200px minmax(0, 1fr); column-gap: 40px; margin-bottom: 30px; }
  .scena-testa .passo { grid-row: 1 / span 2; padding-top: .8em; margin: 0; }
}

/* ── fogli ───────────────────────────────────────────────────── */

.foglio { background: var(--sheet); border: 1px solid var(--rule); min-width: 0; }
.foglio-testa {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--rule);
  font-size: 13px; font-weight: 600;
}
.foglio-testa .fatti { font-size: 11.5px; font-weight: 400; color: var(--muted); white-space: nowrap; }
.foglio-piede {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px; border-top: 1px solid var(--rule);
}
.foglio-piede:empty { display: none; }
.suggerimento { font-size: 12.5px; color: var(--muted); }

.due { display: grid; gap: 16px; }
@media (min-width: 52rem) { .due { grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; } }

/* il quadrato del marchio, in tutti i suoi stati */
.quadro { display: inline-block; flex: none; width: 9px; height: 9px; }
.quadro-filo  { background: var(--thread); }
.quadro-ambra { background: var(--amber); }
.quadro-vuoto { width: 8px; height: 8px; border: 1.5px solid var(--ink); }

/* ── 0 · apertura ────────────────────────────────────────────── */

.apertura { padding-block: 18px 8px; }
@media (min-width: 60rem) { .apertura { padding: 40px 0 20px 240px; } }

.marchio-grande { width: 84px; height: 84px; display: block; overflow: visible; margin-bottom: 26px; }
@media (min-width: 60rem) { .marchio-grande { width: 112px; height: 112px; margin-bottom: 34px; } }

.filo-anim { stroke-dasharray: 1; stroke-dashoffset: 1; animation: tira .9s .25s ease-out forwards; }
.capo-anim { opacity: 0; animation: appare .2s 1.1s ease-out forwards; }
@keyframes tira { to { stroke-dashoffset: 0; } }
@keyframes appare { to { opacity: 1; } }

.apertura h1 { font-size: clamp(2.2rem, 8vw, 4.6rem); max-width: 15ch; line-height: 1.0; letter-spacing: -.042em; }
.apertura .guida { font-size: clamp(1rem, 1.5vw, 1.2rem); margin-top: 20px; max-width: 44ch; }
.apertura-azioni { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.nota { margin-top: 22px; font-size: 12.5px; color: var(--muted); max-width: 52ch; }

/* ── 1 · il fascicolo ────────────────────────────────────────── */

.documenti { list-style: none; margin: 0; padding: 0; }
.documenti li { border-bottom: 1px solid var(--rule-soft); }
.documenti li:last-child { border-bottom: none; }

.doc {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px; min-height: 52px;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .12s, opacity .2s;
}
.doc:hover { background: var(--stone); }
.doc:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.doc .nome { font-size: 12.5px; overflow-wrap: anywhere; }
.doc .meta { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.doc .piu { flex: none; width: 18px; text-align: center; color: var(--muted); font-weight: 600; }
.doc.dato { opacity: .38; cursor: default; pointer-events: none; }

.dati li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; animation: entra .25s ease both; }
.dati .nome { font-size: 12.5px; overflow-wrap: anywhere; }
.dati .meta { margin-left: auto; font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.modello-riga { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--rule); }
.modello-riga .quadro { margin-top: 5px; }
.modello-riga .nome { font-size: 12.5px; }
.modello-riga .meta { font-size: 12.5px; color: var(--muted); }

.vuoto { padding: 18px 16px; font-size: 13px; color: var(--muted); }
.pronto {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 16px; border-top: 1px solid var(--rule);
  font-size: 13.5px; font-weight: 600;
}

/* ── 2 · la cronologia ───────────────────────────────────────── */

.stato-riga { display: flex; align-items: center; gap: 14px; padding: 13px 16px; border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.stato-etichetta { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.stato-etichetta.attesa { background: var(--amberBg); color: var(--amberInk); padding: 4px 10px; }
.barra { flex: 1; min-width: 90px; height: 4px; background: var(--rule); position: relative; }
.barra-dentro { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--thread); transition: width .5s ease; }
.conta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

.cronologia { padding: 6px 16px 10px; min-height: 120px; }

.voce-c { display: grid; grid-template-columns: 22px minmax(0, 1fr); column-gap: 12px; animation: entra .3s ease both; }
@media (min-width: 40rem) { .voce-c { grid-template-columns: 64px 22px minmax(0, 1fr); column-gap: 14px; } }

.voce-c .ora { display: none; font-size: 11px; color: var(--muted); padding-top: 15px; }
@media (min-width: 40rem) { .voce-c .ora { display: block; } }

.voce-c .asse { position: relative; }
.voce-c .asse::before { content: ""; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--thread); }
.voce-c:last-child .asse::before { bottom: auto; height: 22px; }
.voce-c .asse i { position: absolute; left: 6px; top: 18px; width: 10px; height: 10px; background: var(--thread); }
.voce-c.strumento .asse i { left: 7px; top: 15px; width: 8px; height: 8px; background: var(--sheet); border: 1.5px solid var(--thread); }
.voce-c.chiede .asse i { left: 5px; top: 17px; width: 12px; height: 12px; background: var(--amber); }

.voce-c .corpo { padding: 12px 0; min-width: 0; }
.voce-c.strumento .corpo {
  padding: 9px 0; font-family: var(--f-fatti); font-size: 11.5px; color: var(--muted);
  display: flex; flex-wrap: wrap; gap: 2px 14px;
}
.voce-c.strumento .corpo b { color: var(--ink); font-weight: 500; }
.voce-c.strumento .corpo .tempo { margin-left: auto; }
.voce-c .titolo { font-weight: 600; margin-bottom: 8px; }
.voce-c.chiede .corpo p { background: var(--amberBg); color: var(--amberInk); font-weight: 600; font-size: 13.5px; padding: 10px 12px; }

/* ── tabelle di celle ────────────────────────────────────────── */

.celle { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.celle td { padding: 0; border-bottom: 1px solid var(--rule-soft); }
.celle tr:last-child td { border-bottom: none; }
.celle .rif { font-family: var(--f-fatti); font-size: 11px; color: var(--muted); padding: 10px 0 10px 16px; width: 50px; white-space: nowrap; }
.celle .voce-t { padding: 10px 8px; }
.celle .val { text-align: right; white-space: nowrap; padding: 10px 12px; font-variant-numeric: tabular-nums; }
.celle .da { font-family: var(--f-fatti); font-size: 11px; color: var(--traceInk); text-align: right; padding: 10px 16px 10px 8px; white-space: nowrap; }

/* una cella compilata da Arianna: l'unico posto in cui il blu tocca un numero */
.celle .scritta { background: var(--trace); color: var(--traceInk); font-weight: 500; }
.celle .prima { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.celle .uguale { color: var(--muted); }

.cronologia .celle { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cronologia .celle .rif { padding-left: 0; }
.cronologia .celle .da { padding-right: 0; }
@media (max-width: 30rem) { .cronologia .celle .da { display: none; } }

/* ── 3 · la domanda ──────────────────────────────────────────── */

.domanda { background: var(--amberBg); padding: 18px 18px 20px; }
@media (min-width: 60rem) { .domanda, .esito { margin-left: 240px; } .domanda { padding: 24px 26px 26px; } }

.domanda-testa { display: flex; align-items: center; gap: 9px; font-size: 12.5px; font-weight: 600; color: var(--amberInk); }
.domanda-testo { margin-top: 12px; font-size: clamp(1rem, 1.6vw, 1.15rem); line-height: 1.5; max-width: 60ch; text-wrap: pretty; }
.domanda .fonte { font-size: .78em; color: var(--traceInk); white-space: nowrap; }
.scelte { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.scelte .btn { flex: 1 1 200px; }
.domanda.risposta { opacity: .55; }
.domanda.risposta .scelte { display: none; }

.esito { margin-top: 18px; display: grid; gap: 14px; animation: entra .3s ease both; }
.esito-riga { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; }
.sigla {
  flex: none; width: 26px; height: 26px; margin-top: 1px;
  background: var(--ink); color: var(--on-ink);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.quando { font-size: 11px; color: var(--muted); margin-top: 3px; }
.nota-esito { font-size: 13px; color: var(--muted-fort); text-wrap: pretty; }
.esito > .btn { justify-self: start; }

/* ── 4 · la traccia ──────────────────────────────────────────── */

/* La corsia a destra e' lo spazio in cui scorre il filo quando modello
 * e fonte stanno uno sopra l'altra: senza, passerebbe sopra i numeri. */
.traccia { position: relative; display: grid; gap: 20px; padding-right: 18px; }
@media (min-width: 60rem) {
  .traccia { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 0 56px; padding-right: 0; align-items: start; }
}

.filo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 2; }
.filo path { fill: none; stroke: var(--thread); stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: tira .45s ease-out forwards; }
.filo rect { fill: var(--thread); opacity: 0; animation: appare .15s .42s forwards; }

.selezionabili tr { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.selezionabili tr:hover td { background-color: color-mix(in oklab, var(--stone) 60%, transparent); }
.selezionabili tr:hover td.scritta { background: var(--trace); }
.selezionabili tr.sel { outline: 2px solid var(--thread); outline-offset: -2px; }
.selezionabili tr.sel.tua { outline-color: var(--ink); }
.selezionabili tr:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }

.traccia-fonte { background: var(--stone); animation: entra .25s ease both; }
.fonte-corpo { padding: 16px; display: grid; gap: 14px; }
.etichetta { font-family: var(--f-fatti); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.cifra-grande { font-size: clamp(1.9rem, 6vw, 2.5rem); font-weight: 600; letter-spacing: -.03em; line-height: 1.05; color: var(--traceInk); }
.cifra-grande.tua { color: var(--ink); }
.sotto-cifra { font-size: 12px; color: var(--muted); margin-top: 4px; }
.fonte-file { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.fonte-file b { font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.fonte-file span { font-family: var(--f-fatti); font-size: 11.5px; color: var(--traceInk); white-space: nowrap; }

.estratto { background: var(--sheet); border: 1px solid var(--rule); padding: 10px 12px; font-family: var(--f-fatti); font-size: 11px; line-height: 1.9; }
.estratto div { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 14px; }
.estratto .cap { color: var(--muted); }
.estratto .usata { background: var(--trace); color: var(--traceInk); margin: 0 -6px; padding: 0 6px; }
.estratto span:last-child { text-align: right; white-space: nowrap; }

.ragione { font-size: 13.5px; line-height: 1.6; color: var(--muted-fort); text-wrap: pretty; }
.decisione { display: flex; gap: 10px; align-items: flex-start; font-size: 12.5px; color: var(--ink); }
.decisione .sigla { width: 22px; height: 22px; font-size: 9px; }

/* ── 5 · il memo ─────────────────────────────────────────────── */

.memo-griglia { display: grid; gap: 16px; }
@media (min-width: 60rem) { .memo-griglia { grid-template-columns: 20rem minmax(0, 1fr); gap: 28px; align-items: start; } }

.passi { list-style: none; margin: 0; padding: 4px 0; }
.passi li { display: flex; gap: 11px; align-items: flex-start; padding: 9px 16px; font-size: 13.5px; }
.passi .quadro { margin-top: 6px; }
.passi .perche { display: block; font-size: 12px; color: var(--amberInk); font-weight: 500; }
.passi .prove { display: block; font-family: var(--f-fatti); font-size: 10.5px; color: var(--traceInk); }
.passi li.fatto > div > span:first-child { color: var(--muted); }
.passi li.corso .quadro { animation: pulsa 1s ease-in-out infinite; }
@keyframes pulsa { 50% { opacity: .35; } }

.arrivo { flex-direction: column; align-items: stretch; }
.arrivo .btn { width: 100%; white-space: normal; text-align: center; line-height: 1.25; }
.arrivo .suggerimento { text-align: center; }

.carta { padding: 22px 20px 26px; }
@media (min-width: 60rem) { .carta { padding: 38px 44px 44px; } }

.carta-copertina { text-align: center; padding-bottom: 20px; border-bottom: 1px solid var(--rule); margin-bottom: 22px; }
.carta-copertina .sopra { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.carta-copertina h2 { font-size: clamp(1.3rem, 3.4vw, 1.75rem); font-weight: 700; letter-spacing: -.03em; margin-top: 6px; }
.bozza { display: inline-block; margin-top: 12px; padding: 4px 10px; font-size: 11.5px; font-weight: 600; letter-spacing: .04em; }
.bozza.incompleta { background: var(--amberBg); color: var(--amberInk); }
.carta-copertina .fatti { display: block; margin-top: 10px; font-size: 11.5px; color: var(--muted); }

.sezione-m { padding-block: 14px; border-bottom: 1px solid var(--rule-soft); }
.sezione-m:last-child { border-bottom: none; padding-bottom: 0; }
.sezione-m h3 { font-size: 15px; font-weight: 600; letter-spacing: -.015em; margin-bottom: 8px; }
.sezione-m p { font-size: 14px; line-height: 1.65; color: var(--muted-fort); text-wrap: pretty; }
.sezione-m p + p { margin-top: 10px; }

/* una cifra citata nel memo: si tocca, e dice da dove viene */
.cit {
  all: unset; cursor: pointer;
  background: var(--trace); color: var(--traceInk); font-weight: 500;
  padding: 0 4px; -webkit-tap-highlight-color: transparent;
}
.cit:focus-visible, .cit.aperta { outline: 2px solid var(--thread); outline-offset: 1px; }

.origine {
  margin-top: 10px; padding: 10px 12px;
  border-left: 2px solid var(--thread); background: var(--stone);
  font-size: 12.5px; color: var(--muted-fort);
  animation: entra .2s ease both;
}
.origine b { display: block; font-family: var(--f-fatti); font-size: 11.5px; font-weight: 500; color: var(--traceInk); margin-bottom: 3px; }

.manca { background: var(--amberBg); color: var(--amberInk); font-size: 13px; font-weight: 600; padding: 10px 12px; }
.altre { font-size: 12.5px; color: var(--muted); padding-top: 14px; }
.cursore::after { content: ""; display: inline-block; width: 7px; height: 1em; margin-left: 2px; vertical-align: -.15em; background: var(--thread); animation: pulsa .7s steps(2) infinite; }

/* ── 6 · chiusura ────────────────────────────────────────────── */

.numeri { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); background: var(--sheet); }
@media (min-width: 52rem) { .numeri { grid-template-columns: repeat(4, 1fr); } }
.numeri div { padding: 18px 16px 16px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.numeri b { display: block; font-size: clamp(1.7rem, 5vw, 2.6rem); font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.numeri span { display: block; margin-top: 8px; font-size: 12.5px; color: var(--muted); }

.tre { display: grid; gap: 0; margin-top: 26px; border-top: 1px solid var(--rule); }
.tre > div { padding: 16px 0; border-bottom: 1px solid var(--rule-soft); }
.tre h3 { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.tre p { margin-top: 4px; font-size: 14px; color: var(--muted-fort); max-width: 48ch; text-wrap: pretty; }
@media (min-width: 52rem) {
  .tre { grid-template-columns: repeat(3, 1fr); gap: 32px; }
  .tre > div { border-bottom: none; padding: 20px 0 0; }
}

.chiusa { margin-top: 34px; background: var(--ink); color: var(--on-ink); padding: 30px 22px 32px; }
@media (min-width: 60rem) { .chiusa { padding: 52px 56px 56px; margin-top: 48px; } }
.chiusa h2 { font-size: clamp(1.6rem, 4.4vw, 2.7rem); font-weight: 700; line-height: 1.05; letter-spacing: -.036em; max-width: 17ch; text-wrap: balance; }
.chiusa p { margin-top: 14px; max-width: 44ch; color: color-mix(in oklab, var(--on-ink) 68%, transparent); }
.chiusa .btn-ink { background: var(--on-ink); color: var(--ink); border-color: var(--on-ink); }
.chiusa .btn-ink:hover { background: color-mix(in oklab, var(--on-ink) 84%, var(--ink)); }
.chiusa .btn-line { border-color: color-mix(in oklab, var(--on-ink) 42%, transparent); color: var(--on-ink); }
.chiusa .btn-line:hover { background: var(--on-ink); color: var(--ink); }

/* ── i comandi in basso ──────────────────────────────────────── */

.comandi {
  position: sticky; bottom: 0; z-index: 20;
  background: var(--sheet); border-top: 1px solid var(--rule);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.comandi-riga { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.comandi .btn { min-width: 96px; }
.dove-sono { flex: 1; text-align: center; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.nome-passo { display: none; }
@media (min-width: 40rem) { .nome-passo { display: inline; } }
#avanti.invito { animation: invito 1.6s ease-in-out infinite; }
@keyframes invito { 50% { box-shadow: 0 0 0 5px color-mix(in oklab, var(--ink) 16%, transparent); } }

/* ── accessibilita' ──────────────────────────────────────────── */

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
  .filo-anim, .filo path { stroke-dashoffset: 0; }
  .capo-anim, .filo rect { opacity: 1; }
}

/* Stato fermo: chi ha chiesto meno movimento, e le prove automatiche, che
 * altrimenti fotografano una scena a meta' dissolvenza. */
.fermo *, .fermo *::before, .fermo *::after { animation: none !important; transition: none !important; }
.fermo .filo-anim, .fermo .filo path { stroke-dashoffset: 0; }
.fermo .capo-anim, .fermo .filo rect { opacity: 1; }

/* ── 3 · il T-12 ─────────────────────────────────────────────── */

.mappa-testa {
  display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 8px; padding: 9px 16px; border-bottom: 1px solid var(--rule);
  font-size: 10.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.mappa-freccia { display: block; height: 1px; background: var(--rule); align-self: center; }

.mappa { list-style: none; margin: 0; padding: 0; min-height: 120px; }
.mappa li { border-bottom: 1px solid var(--rule-soft); animation: entra .25s ease both; }
.mappa li:last-child { border-bottom: none; }

.riga-m {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 8px; align-items: center; padding: 10px 16px; min-height: 50px;
  font-size: 13px; -webkit-tap-highlight-color: transparent;
}
.riga-m:hover { background: var(--stone); }
.riga-m:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.riga-m .lato { display: flex; justify-content: space-between; gap: 10px; min-width: 0; }
.riga-m .nome-r { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.riga-m .cifra-r { white-space: nowrap; font-variant-numeric: tabular-nums; }
.riga-m .filo-r { display: block; height: 2px; background: var(--thread); }
.riga-m .roll { font-family: var(--f-fatti); font-size: 11px; color: var(--traceInk); white-space: nowrap; }
.riga-m .dest { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.riga-m .dest .nome-r { color: var(--traceInk); font-weight: 500; }

/* riclassificata: va sotto l'NOI. Esclusa: non entra nel rollup. Sono
 * decisioni dell'agente, quindi blu; ma sono decisioni da leggere, quindi
 * hanno una parola accanto. */
.riga-m .marca { font-family: var(--f-fatti); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--traceInk); border: 1px solid color-mix(in oklab, var(--thread) 40%, transparent); padding: 1px 5px; white-space: nowrap; }
.riga-m.esclusa .filo-r { background: var(--rule); }
.riga-m.esclusa .dest .nome-r, .riga-m.esclusa .roll { color: var(--muted); font-weight: 400; }
.riga-m.esclusa .marca { color: var(--muted); border-color: var(--rule); }

.mappa .perche-m {
  padding: 0 16px 12px; font-size: 13px; line-height: 1.55; color: var(--muted-fort);
  text-wrap: pretty; animation: entra .2s ease both;
}
.mappa .perche-m b { font-family: var(--f-fatti); font-size: 11px; font-weight: 500; color: var(--traceInk); display: block; margin-bottom: 3px; }
.mappa li.aperta .riga-m { background: var(--stone); }

.riconcilia {
  border-top: 1px solid var(--rule); padding: 12px 16px;
  display: grid; gap: 4px 20px; font-size: 13px;
}
@media (min-width: 40rem) { .riconcilia { grid-template-columns: repeat(4, auto); justify-content: start; } }
.riconcilia span { display: block; }
.riconcilia b { display: block; font-size: 11px; font-weight: 400; color: var(--muted); letter-spacing: .04em; text-transform: uppercase; }
.riconcilia .zero { font-weight: 600; }

@media (max-width: 40rem) {
  .riga-m { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .riga-m .filo-r, .mappa-freccia { display: none; }
  .mappa-testa { grid-template-columns: 1fr; }
  .mappa-testa span:last-child { display: none; }
  .riga-m .dest { padding-left: 12px; border-left: 2px solid var(--thread); }
  .riga-m.esclusa .dest { border-left-color: var(--rule); }
}
