/*
 * Vista TV dell'officina. Pensata per 16:9 a 1920×1080 e 3840×2160, letta a 3-5 metri.
 * Tutto in rem: 1rem = 1/120 della larghezza (16px a 1920), quindi in 4K è identica, solo più nitida.
 * Niente scroll: ciò che non sta ruota a pagine.
 */
html { font-size: min(calc(100vw / 120), calc(100vh / 67.5)); }
body.tv {
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  width: 100vw;
  background: var(--bg);
  --auto-vetro: rgba(0, 0, 0, .55);
  --auto-tetto: rgba(0, 0, 0, .18);
  --gap: 1rem;
  --pad: 1.75rem;
}

/* ---------- testata ---------- */
.testa {
  grid-row: 1;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 2rem;
  padding: 1.1rem var(--pad);
  background: var(--band);
  color: var(--band-text);
  border-bottom: 1px solid var(--line);
}
.testa .logo { height: 2.6rem; width: auto; display: block; }
.titolo { display: flex; flex-direction: column; gap: .2rem; padding-left: 2rem; border-left: 1px solid #ffffff2a; }
.titolo .occhiello { font-size: 1rem; }
.titolo h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 2.5rem; line-height: 1; color: var(--band-text); }
.kpi { grid-column: 4; display: flex; gap: 0; }
.kpi .k { padding: 0 1.3rem; border-left: 1px solid #ffffff22; display: flex; flex-direction: column; gap: .25rem; }
.kpi .k span { font-size: 1.05rem; color: var(--band-text-2); white-space: nowrap; }
.kpi .k b { font-family: var(--font-body); font-weight: 700; font-size: 2.9rem; line-height: .95; font-variant-numeric: tabular-nums lining-nums; }
.kpi .k.crit b { color: var(--crit); }
.kpi .k.att b { color: var(--att); }
.kpi .k.ver b { color: var(--ver); }
.orologio { grid-column: 5; text-align: right; padding-left: 1.6rem; border-left: 1px solid #ffffff22; }
.orologio .ora { font-weight: 700; font-size: 3.1rem; line-height: .95; }
.orologio .data { font-size: 1.05rem; color: var(--band-text-2); margin-top: .3rem; }
.orologio .data::first-letter { text-transform: uppercase; }
.orologio .sim-ora { color: var(--att); }

.avviso {
  grid-row: 2;
  padding: .7rem var(--pad);
  font-size: 1.5rem; font-weight: 700;
  background: var(--att-bg); color: var(--att);
  border-bottom: 2px solid var(--att-fill);
}
.avviso.grave { background: var(--crit-bg); color: var(--crit); border-color: var(--crit-fill); }

/* ---------- scena ---------- */
.scena { grid-row: 3; position: relative; overflow: hidden; padding: var(--pad); min-height: 0; }
.stato-pagina {
  height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.5rem;
  text-align: center; color: var(--text-2);
}
.stato-pagina h2 { margin: 0; font-family: var(--font-display); font-size: 3.6rem; color: var(--text); }
.stato-pagina p { margin: 0; font-size: 1.8rem; max-width: 60rem; line-height: 1.35; }
.stato-pagina.errore h2 { color: var(--crit); }
.spinner { width: 3.5rem; height: 3.5rem; border-radius: 50%; border: .35rem solid var(--line-2); border-top-color: var(--text-2); animation: gira 1s linear infinite; }
@keyframes gira { to { transform: rotate(360deg); } }

/* ---------- piede ---------- */
.piede {
  grid-row: 4;
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 2rem;
  padding: .8rem var(--pad) 1rem;
  border-top: 1px solid var(--line);
  font-size: 1.15rem; color: var(--text-2);
  background: var(--surface);
}
.legenda { display: flex; gap: 1.3rem; flex-wrap: nowrap; white-space: nowrap; }
.legenda .l { display: inline-flex; align-items: center; gap: .55rem; }
.legenda .l i { width: 1.6rem; height: .9rem; display: inline-block; background: var(--cf); border-radius: 2px; }
.legenda .l.e-senza-riferimento i { background: repeating-linear-gradient(135deg, var(--cf) 0 .25rem, transparent .25rem .5rem); outline: 1px solid var(--cf); }
.legenda .l.e-da-verificare i { background: transparent; outline: .18rem dashed var(--cf); outline-offset: -.18rem; }
.legenda .l.tick i { width: .25rem; height: 1.3rem; background: var(--text); }
.piede-dx { display: flex; align-items: center; gap: 1.2rem; white-space: nowrap; min-width: 0; }
.piede { font-size: 1.1rem; }
.riservatezza { display: inline-flex; align-items: center; gap: .5rem; }
.riservatezza b { color: var(--text); }
.anteprima { font-family: var(--font-occhiello); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; font-size: .95rem; color: var(--att); border: 1px solid var(--att-fill); padding: .2rem .5rem; border-radius: 3px; }
.pagine { display: inline-flex; gap: .4rem; }
.pagine i { width: .8rem; height: .8rem; border-radius: 50%; background: var(--line-2); display: inline-block; }
.pagine i.on { background: var(--text); }
.giro-barra { position: absolute; left: 0; right: 0; top: -1px; height: 3px; }
.giro-barra i { display: block; height: 100%; width: 0; background: var(--text-3); }

/* ---------- elementi comuni ---------- */
.barra { position: relative; height: 1rem; background: var(--surface-3); border-radius: 2px; overflow: visible; }
.barra .f { position: absolute; left: 0; top: 0; bottom: 0; background: var(--cf); border-radius: 2px; }
.e-senza-riferimento .barra .f { background: repeating-linear-gradient(135deg, var(--cf) 0 .35rem, transparent .35rem .7rem); }
.barra .t { position: absolute; top: -.35rem; bottom: -.35rem; width: .22rem; background: var(--text); transform: translateX(-50%); }
.barra .t.obi { background: var(--text-2); width: .16rem; }

/* ---------- formato: griglia di card ---------- */
.griglia { height: 100%; display: grid; gap: var(--gap); grid-template-columns: repeat(var(--col, 6), minmax(0, 1fr)); grid-template-rows: repeat(var(--righe, 3), minmax(0, 1fr)); }
.cella {
  min-width: 0; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; gap: .35rem;
  overflow: hidden;
  padding: 1rem 1.1rem 1.1rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}
.cella.e-oltre-preventivo { background: var(--cb); border-color: var(--cf); border-width: 3px; }
.cella.e-oltre-obiettivo { border-color: var(--cf); }
.cella.e-da-verificare { border: 3px dashed var(--cf); }
.cella-testa { display: flex; align-items: baseline; gap: .8rem; min-width: 0; }
.ponte-n { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; line-height: .9; color: var(--text); }
.ponte-n small { font-family: var(--font-body); font-size: 1rem; font-weight: 400; color: var(--text-3); margin-right: .25rem; letter-spacing: .04em; }
.cella-nome { font-size: 1.55rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cella-veicolo { font-size: 1.3rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cella-veicolo .tg { color: var(--text); font-weight: 700; letter-spacing: .04em; }
.cella-lavoro { font-size: 1.3rem; line-height: 1.2; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: start; }
.cella-tempo { display: flex; align-items: baseline; gap: .5rem; }
.cella-tempo .timer { font-weight: 700; font-size: 3.3rem; line-height: .9; }
.cella-tempo .rif { font-size: 1.45rem; color: var(--text-2); white-space: nowrap; }
.cella-tempo .rif small { font-size: 1.05rem; color: var(--text-3); }
.cella-esito { font-size: 1.3rem; font-weight: 700; color: var(--c); display: flex; flex-wrap: wrap; justify-content: space-between; column-gap: .5rem; row-gap: .1rem; white-space: nowrap; }
.cella-esito .resa { color: var(--text-2); font-weight: 400; }
/* Con una seconda lavorazione aperta l'avviso viola prende il posto della resa. */
.cella.con-altra .cella-esito .resa { display: none; }
.cella.vuota { background: transparent; border-style: dashed; border-color: var(--line-2); }
.cella.vuota .vuoto-testo { align-self: center; font-size: 1.35rem; color: var(--text-2); line-height: 1.3; }
.cella.vuota .vuoto-testo b { display: block; color: var(--text); font-size: 1.45rem; }

/* ---------- formato: tabellone ---------- */
.tabellone { height: 100%; display: flex; flex-direction: column; }
.tab-righe { flex: 1; display: grid; grid-auto-rows: var(--h-riga, 5.4rem); align-content: start; }
.tab-riga, .tab-int {
  display: grid; align-items: center; gap: 1.4rem;
  grid-template-columns: 5.5rem minmax(0, 15rem) minmax(0, 23rem) minmax(0, 1fr) 6.5rem 12.5rem 15rem;
  padding: 0 1.2rem;
}
.tabellone.anonima .tab-riga, .tabellone.anonima .tab-int { grid-template-columns: 5.5rem minmax(0, 26rem) minmax(0, 1fr) 6.5rem 12.5rem 15rem; }
.tab-int { height: 3.2rem; font-size: 1.1rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; font-family: var(--font-occhiello); font-weight: 700; border-bottom: 2px solid var(--line-2); }
.tab-riga { font-size: 1.75rem; border-bottom: 1px solid var(--line); animation: flip .45s ease-out both; }
.tab-riga:nth-child(even) { background: var(--surface); }
@keyframes flip { from { transform: rotateX(70deg); opacity: 0; } to { transform: none; opacity: 1; } }
.tab-riga .p { font-family: var(--font-display); font-weight: 700; font-size: 2.6rem; }
.tab-riga .nome { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-riga .veic { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.tab-riga .veic .tg { color: var(--text); font-weight: 700; letter-spacing: .04em; margin-right: .5rem; }
.tab-riga .lav { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tab-riga .ini { color: var(--text-2); }
.tab-riga .tempo b { font-size: 2.3rem; }
.tab-riga .tempo span { color: var(--text-2); font-size: 1.4rem; margin-left: .4rem; }
.tab-riga .st {
  justify-self: stretch; text-align: center; font-weight: 700; font-size: 1.5rem;
  padding: .45rem .6rem; border-radius: 3px; background: var(--cf); color: #fff; white-space: nowrap;
}
.tab-riga .st.e-oltre-obiettivo { color: #1b1300; }
.tab-riga .st.e-nei-tempi { background: transparent; color: var(--c); outline: 2px solid var(--cf); outline-offset: -2px; }
.tab-riga .st.e-senza-riferimento { background: transparent; color: var(--c); outline: 2px dashed var(--cf); outline-offset: -2px; }
.tab-riga .st.e-da-verificare { background: transparent; color: var(--c); outline: 2px dashed var(--cf); outline-offset: -2px; }
.tab-riga .st.e-vuoto { background: transparent; color: var(--text-3); font-weight: 400; }
.tab-riga.muta { color: var(--text-3); }
/* Tutti i ponti in una pagina: righe più basse, testo a 1,75rem (28 px su 1920) invariato. */
.tabellone.fitta .tab-riga .p { font-size: 2.1rem; }
.tabellone.fitta .tab-riga .tempo b { font-size: 2rem; }
.tabellone.fitta .tab-riga .st { padding: .1rem .6rem; font-size: 1.35rem; }
.tabellone.fitta .tab-riga { font-size: 1.7rem; }
.tabellone.fitta .tab-int { height: 2.6rem; }
.tab-riga.muta .p, .tab-riga.muta .nome { color: var(--text-2); }

/* ---------- formato: mappa dei ponti ---------- */
.mappa { height: 100%; display: grid; grid-template-rows: 1fr auto 1fr; gap: 1.1rem; }
.fila { display: grid; grid-template-columns: repeat(var(--n, 9), minmax(0, 1fr)); gap: var(--gap); min-height: 0; }
.corsia {
  display: flex; align-items: center; gap: 1.2rem; height: 2.6rem;
  color: var(--text-3); font-family: var(--font-occhiello); font-weight: 700; font-size: 1rem; letter-spacing: .3em; text-transform: uppercase;
}
.corsia::before, .corsia::after { content: ''; flex: 1; border-top: 2px dashed var(--line-2); }
.corsia .timbra { letter-spacing: .1em; color: var(--text-2); border: 1px solid var(--line-2); padding: .3rem .7rem; border-radius: 3px; }
.box {
  position: relative; min-width: 0; min-height: 0;
  display: grid; grid-template-rows: auto 1fr auto auto; justify-items: center; gap: .3rem;
  padding: .8rem .6rem 1rem;
  border: 2px solid var(--line-2); border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: center;
}
.box .bn { font-family: var(--font-display); font-weight: 700; font-size: 3.2rem; line-height: .9; }
.box svg { height: 100%; max-height: 10rem; width: auto; color: var(--cf); min-height: 0; }
.box .bt { font-weight: 700; font-size: 2.3rem; line-height: 1; }
.box .bs { font-size: 1.2rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.box.e-oltre-preventivo { background: var(--crit-fill); border-color: var(--crit-fill); color: #fff; --auto-vetro: rgba(0,0,0,.35); }
.box.e-oltre-preventivo svg { color: #ffffffd9; }
.box.e-oltre-preventivo .bs { color: #ffffffe6; }
.box.e-oltre-obiettivo { border-color: var(--att-fill); border-width: 3px; background: var(--att-bg); }
.box.e-nei-tempi { border-color: var(--ok-fill); }
.box.e-da-verificare { border: 3px dashed var(--ver-fill); }
.box.libero { background: transparent; border-style: dashed; }
.box.libero .bn { color: var(--text-3); }
.box.libero .vuoto { align-self: center; font-size: 1.2rem; color: var(--text-3); line-height: 1.3; }

/* ---------- formato: solo eccezioni ---------- */
.eccezioni { height: 100%; display: grid; grid-template-rows: auto 1fr auto; gap: 1.4rem; }
.ecc-titolo { display: flex; align-items: flex-end; justify-content: space-between; gap: 2rem; }
.ecc-titolo h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 3.1rem; line-height: 1.05; }
.ecc-titolo p { margin: 0; font-size: 1.5rem; color: var(--text-2); text-align: right; line-height: 1.35; }
.ecc-casi { display: grid; gap: var(--gap); grid-template-columns: repeat(var(--col, 3), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); min-height: 0; }
.caso {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr auto; column-gap: 1.6rem; row-gap: .6rem;
  padding: 1.4rem 1.6rem; border-radius: var(--radius);
  background: var(--cb); border: 3px solid var(--cf); min-height: 0; overflow: hidden;
}
.caso.e-da-verificare { border-style: dashed; }
.caso .cp { grid-row: 1 / 3; font-family: var(--font-display); font-weight: 700; font-size: 6rem; line-height: .85; }
.caso .cp small { display: block; font-family: var(--font-body); font-size: 1.2rem; font-weight: 400; color: var(--text-2); letter-spacing: .06em; text-transform: uppercase; margin-bottom: .3rem; }
.caso .cn { font-size: 2rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.caso .cd { font-size: 1.5rem; color: var(--text-2); line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.caso .cs { grid-column: 1 / 3; display: flex; align-items: baseline; gap: 1rem; color: var(--c); }
.caso .cs b { font-size: 4.4rem; line-height: .9; font-weight: 700; }
.caso .cs span { font-size: 1.6rem; font-weight: 700; }
.calmo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; text-align: center; color: var(--ok); }
.calmo b { font-family: var(--font-display); font-size: 5rem; }
.calmo span { font-size: 1.8rem; color: var(--text-2); }
.quadro { display: grid; grid-template-columns: repeat(var(--n, 18), minmax(0, 1fr)); gap: .6rem; }
.qp {
  display: flex; flex-direction: column; align-items: center; gap: .25rem; padding: .5rem 0 .6rem;
  border-radius: 4px; background: var(--surface); border: 2px solid var(--cf); font-weight: 700;
}
.qp b { font-family: var(--font-display); font-size: 2rem; line-height: 1; }
.qp span { font-size: .95rem; color: var(--text-2); font-weight: 400; }
.qp.e-oltre-preventivo { background: var(--crit-fill); color: #fff; }
.qp.e-oltre-preventivo span { color: #fff; }
.qp.e-vuoto { border-style: dashed; color: var(--text-3); }
.qp.e-da-verificare, .qp.e-senza-riferimento { border-style: dashed; }

/* ---------- pannello impostazioni ---------- */
.pannello {
  position: fixed; right: 1.5rem; top: 8.5rem; z-index: 10; width: 46rem;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--line-2); border-radius: var(--radius);
  padding: 1.2rem 1.4rem 1.3rem; font-size: 1rem;
  display: flex; flex-direction: column; gap: .9rem;
}
.pannello[hidden] { display: none; }
.pannello-testa { display: flex; justify-content: space-between; align-items: baseline; }
.pannello-testa .occhiello { font-size: .85rem; }
.pannello-tasti { color: var(--text-3); font-size: .85rem; }
.campo { display: grid; grid-template-columns: 7.5rem 1fr; align-items: center; gap: .8rem; }
.campo > span { color: var(--text-2); }
.seg { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; width: fit-content; }
.seg button {
  font: inherit; font-size: .95rem; color: var(--text-2); background: transparent; border: 0; border-left: 1px solid var(--line-2);
  padding: .45rem .75rem; cursor: pointer;
}
.seg button:first-child { border-left: 0; }
.seg button:hover { background: var(--surface-3); color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); font-weight: 700; }
.seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.pannello-link { display: flex; gap: 1.4rem; padding-top: .4rem; border-top: 1px solid var(--line); }
.pannello-link a { color: var(--text); font-weight: 700; }

/* tema chiaro: la testata resta una banda scura (una per pagina) */
:root[data-theme="light"] body.tv { --auto-vetro: rgba(255,255,255,.6); --auto-tetto: rgba(255,255,255,.25); }
:root[data-theme="light"] .tab-riga .st.e-oltre-obiettivo { color: #fff; }

/* Sulla TV il «simulato» lo dice l'etichetta Anteprima nel piede: i puntini da lontano sono rumore. */
.tv .sim { text-decoration: none; }

.altra { display: block; font-size: 1.1rem; font-weight: 700; color: var(--ver); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cella { grid-template-rows: auto auto minmax(0, 1fr) auto auto auto; }
.cella.con-altra .cella-lavoro { -webkit-line-clamp: 1; }
.caso .cs b { white-space: nowrap; }
.tab-riga .lav .altra { display: inline; margin-left: .8rem; font-size: 1.2rem; }
.caso.ver .cs b { font-size: 3.2rem; }
.caso.ver .cs span { font-size: 1.4rem; }

/* ---------- formato: stato degli operatori (forma del mockup di Silvia Prato, dati dell'API) ----------
 * 4 colonne × 5 righe a 1920×1080: ogni testo almeno 1,75rem (28 px). Nessun colore di giudizio:
 * il bordo dice solo lo stato (al lavoro / nessuna aperta / da verificare), mai «bene» o «male».
 */
body.tv[data-formato="operatori"] { --pad: 1.4rem; }
body.tv[data-formato="operatori"] .scena { padding: 1.1rem var(--pad); }
.ops { height: 100%; display: grid; gap: .9rem; grid-template-columns: repeat(var(--col, 4), minmax(0, 1fr)); grid-template-rows: repeat(var(--righe, 5), minmax(0, 1fr)); }
.op {
  min-width: 0; min-height: 0; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between; gap: .1rem;
  padding: .55rem 1rem .6rem;
  background: var(--surface); border: 2px solid var(--line); border-top: .35rem solid var(--text-2);
  border-radius: var(--radius);
  font-size: 1.75rem; line-height: 1.15;
}
.op.s-nessuna-aperta { background: transparent; border-style: solid; border-color: var(--line); border-top: .35rem solid var(--line-2); }
.op.s-da-verificare { border: 3px dashed var(--ver-fill); border-top: .35rem dashed var(--ver-fill); background: var(--ver-bg); }
.op-testa { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.op-sigla {
  flex: none; min-width: 3.2rem; height: 3.1rem; padding: 0 .45rem; display: grid; place-items: center;
  background: var(--text); color: var(--bg); font-weight: 700; font-size: 1.75rem; border-radius: 3px; letter-spacing: .02em;
}
.op.s-nessuna-aperta .op-sigla { background: var(--surface-3); color: var(--text-2); }
.op-chi { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.op-nome { font-family: var(--font-display); font-weight: 700; font-size: 2.05rem; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-mat { display: none; }
.op-tempo { flex: none; font-weight: 700; font-size: 3.1rem; line-height: .9; letter-spacing: -.01em; }
.op-tempo.ver { color: var(--ver); }
.op-commessa { display: flex; align-items: baseline; gap: .45rem; min-width: 0; white-space: nowrap; overflow: hidden; }
.op-commessa b { font-weight: 700; }
.op-commessa .tg { font-weight: 700; letter-spacing: .03em; color: var(--text); }
.op-sep { color: var(--text-3); margin: 0 .1rem; }
.op-dalle { margin-left: auto; padding-left: .6rem; color: var(--text-2); }
.op-lav { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.op-muto { color: var(--text-3); }
.op-vuoto { color: var(--text-2); font-weight: 700; }
.op-piede { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-piede b { color: var(--text); }
.op-piede.ver { color: var(--ver); font-weight: 700; }
.op-tag { font-size: 1.75rem; font-weight: 700; padding: 0 .4rem; border-radius: 3px; background: var(--surface-3); }
.op-rif { font-weight: 700; color: var(--text-2); }
.kpi .k b small { font-size: 1.6rem; font-weight: 400; margin-left: .1rem; color: var(--band-text-2); }
/* Piede della vista operatori: legenda degli stati, non dei giudizi */
.legenda .l.s-al-lavoro i { background: var(--text-2); height: .35rem; }
.legenda .l.s-nessuna-aperta i { background: var(--line-2); height: .35rem; }
.legenda .l.s-da-verificare i { background: transparent; outline: .18rem dashed var(--ver-fill); outline-offset: -.18rem; }
/* Con meno operatori le celle crescono: testo più grande, tutto il resto uguale */
.ops[style*="--righe:3"] .op, .ops[style*="--righe:2"] .op { font-size: 2.1rem; padding: 1rem 1.3rem; }
.ops[style*="--righe:3"] .op-nome, .ops[style*="--righe:2"] .op-nome { font-size: 2.6rem; }
.ops[style*="--righe:3"] .op-tempo, .ops[style*="--righe:2"] .op-tempo { font-size: 4rem; }
.ops[style*="--righe:3"] .op-mat, .ops[style*="--righe:2"] .op-mat { display: block; font-size: 1.75rem; color: var(--text-2); }
/* Le etichette dei contatori in alto si leggono anche da lontano */
body.tv[data-formato="operatori"] .kpi .k span { font-size: 1.3rem; }
body.tv[data-formato="operatori"] .kpi .k b { font-size: 3.1rem; }
body.tv[data-formato="operatori"] .titolo h1 { white-space: nowrap; }
body.tv[data-formato="operatori"] .testa { gap: 1.4rem; }
body.tv[data-formato="operatori"] .kpi .k { padding: 0 1rem; }
body.tv[data-formato="operatori"] .kpi .k span { font-size: 1.2rem; }
/* Senza nomi la matricola è il titolo: in Calibri, perché le cifre di Georgia scendono sotto la riga */
.op-nome.num { font-family: var(--font-body); font-size: 2.2rem; }
.op-piede .op-sep { margin: 0 .4rem; }

/* ---------- formati «da lontano»: riquadri (A) e partenze (B) · giro5 ----------
 * Letti a 4 m in 3-5 s: il tempo è la cosa più grande, poi chi; targa e lavoro sotto. Testo minimo 28 px (1.75rem),
 * ciò che si legge da lontano da 40 px (2.5rem) in su. Colore solo per «da verificare». */
body[data-attivo="riquadri"], body[data-attivo="partenze"] { --pad: 1.5rem; }
body[data-attivo="riquadri"] .testa, body[data-attivo="partenze"] .testa { padding: .9rem var(--pad); }
body[data-attivo="riquadri"] .titolo .occhiello, body[data-attivo="partenze"] .titolo .occhiello { font-size: 1.75rem; color: var(--band-text-2); }
body[data-attivo="riquadri"] .titolo h1, body[data-attivo="partenze"] .titolo h1 { font-size: 2.9rem; white-space: nowrap; }
body[data-attivo="riquadri"] .kpi .k, body[data-attivo="partenze"] .kpi .k { padding: 0 2rem; gap: .35rem; }
body[data-attivo="riquadri"] .kpi .k span, body[data-attivo="partenze"] .kpi .k span { font-size: 1.75rem; color: var(--band-text); }
body[data-attivo="riquadri"] .kpi .k b, body[data-attivo="partenze"] .kpi .k b { font-size: 3.6rem; }
body[data-attivo="riquadri"] .orologio .ora, body[data-attivo="partenze"] .orologio .ora { font-size: 3.9rem; }
body[data-attivo="riquadri"] .orologio .data, body[data-attivo="partenze"] .orologio .data { font-size: 1.75rem; color: var(--band-text); }
body[data-attivo="riquadri"] .piede, body[data-attivo="partenze"] .piede { font-size: 1.75rem; color: var(--text-2); padding: .6rem var(--pad) .8rem; }
body[data-attivo="riquadri"] .anteprima, body[data-attivo="partenze"] .anteprima { font-size: 1.75rem; letter-spacing: .04em; text-transform: none; padding: .1rem .6rem; }
body[data-attivo="riquadri"] .aggiornato, body[data-attivo="partenze"] .aggiornato { font-size: 1.75rem; }
.lo-pag { font-weight: 700; color: var(--text); }
.lo-spiega { color: var(--text-2); }

.lo { height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 1.1rem; }
.lo-muto { color: var(--text-2); font-style: italic; }
.lo-nota { font-size: 1.9rem; font-weight: 700; color: var(--ver); line-height: 1.1; }
.lo-tempo-ver { color: var(--ver); font-weight: 700; }
.lo-targa { font-weight: 700; letter-spacing: .04em; white-space: nowrap; }

/* A · riquadri */
.lo-griglia { display: grid; gap: 1.1rem; min-height: 0;
  grid-template-columns: repeat(var(--col), minmax(0, 1fr)); grid-template-rows: repeat(var(--righe), minmax(0, 1fr)); }
.lo-r { min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-start; gap: .5rem;
  padding: 1.4rem 1.6rem; background: var(--surface); border: 1px solid var(--line); border-radius: .5rem; }
.lo-r > * { flex-shrink: 0; }
.lo-r > .lo-auto { flex-shrink: 1; min-height: 0; }
.lo-alto { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.lo-r .lo-tempo { font-weight: 700; line-height: .9; color: var(--text); font-size: 7rem; font-variant-numeric: tabular-nums lining-nums; }
.lo-r .lo-tempo.lo-tempo-ver { color: var(--ver); }
.lo-r .lo-nota { font-size: 1.75rem; line-height: 1.15; text-align: right; white-space: nowrap; }
.lo-nome { display: block; font-family: var(--font-body); font-weight: 700; font-size: 3rem; line-height: 1.1; color: var(--text);
  white-space: nowrap; overflow: hidden; }
.lo-auto { display: flex; flex-direction: column; gap: .2rem; min-width: 0; font-size: 2rem; line-height: 1.2; color: var(--text); }
.lo-auto .lo-lav { color: var(--text-2); display: block; max-height: 2.45em; overflow: hidden; }
.lo-r.ver { border: .3rem dashed var(--ver-fill); background: var(--ver-bg); padding: calc(1.4rem - .3rem + 1px) calc(1.6rem - .3rem + 1px); }
/* 4×3: tutto più compatto, targa e lavoro su una riga */
.lo-griglia[style*="--righe:3"] .lo-r { padding: .9rem 1.3rem; gap: .35rem; }
.lo-griglia[style*="--righe:3"] .lo-r.ver { padding: calc(.9rem - .3rem + 1px) calc(1.3rem - .3rem + 1px); }
.lo-griglia[style*="--righe:3"] .lo-r .lo-tempo { font-size: 4.8rem; }
.lo-griglia[style*="--righe:3"] .lo-nome { font-size: 2.6rem; }
.lo-griglia[style*="--righe:3"] .lo-auto { flex-direction: row; align-items: baseline; gap: 1rem; font-size: 1.75rem; }
.lo-griglia[style*="--righe:3"] .lo-auto .lo-lav { max-height: 2.45em; min-width: 0; flex: 1; }

/* B · partenze */
.lo-tabella { display: grid; grid-template-rows: auto repeat(var(--righe), minmax(0, 1fr)); min-height: 0; }
.lo-riga { display: grid; grid-template-columns: 13rem 27rem 15rem minmax(0, 1fr); align-items: center; gap: 2rem;
  padding: 0 1.4rem; border-bottom: 1px solid var(--line); min-height: 0; }
.lo-riga:nth-child(even):not(.lo-intesta) { background: var(--surface); }
.lo-intesta { font-size: 1.75rem; color: var(--text-2); padding-bottom: .5rem; border-bottom: 2px solid var(--line-2); }
.lo-c-tempo { text-align: right; font-weight: 700; font-size: 4.4rem; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
.lo-intesta .lo-c-tempo { font-size: 1.75rem; font-weight: 400; }
.lo-c-chi { min-width: 0; display: flex; flex-direction: column; }
.lo-c-chi .lo-nome { font-size: 3rem; }
.lo-c-chi .lo-nota { font-size: 1.75rem; }
.lo-c-targa .lo-targa { font-size: 2.5rem; }
.lo-c-lav { min-width: 0; }
.lo-c-lav .lo-lav { display: block; font-size: 2.3rem; line-height: 1.2; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.lo-riga.ver { background: var(--ver-bg) !important; box-shadow: inset .5rem 0 0 var(--ver-fill); }

/* fascia di chi non ha una lavorazione aperta */
.lo-ferme { display: flex; align-items: baseline; gap: 1.4rem; padding: .9rem 1.4rem; border-top: 2px solid var(--line-2);
  font-size: 2.2rem; line-height: 1.25; color: var(--text); }
.lo-ferme b { white-space: nowrap; color: var(--text-2); font-weight: 700; font-size: 1.9rem; }
.lo-ferme-nomi { min-width: 0; }
.lo-ferme-nomi i { font-style: normal; color: var(--text-2); margin: 0 .7rem; }
