/* Colletta — area riservata. Stesso stile del sito: crema, oro, terra; Cormorant Garamond e Source Sans 3. */
:root {
  --carta: #F6F1E8;
  --carta-2: #EFE7D8;
  --foglio: #FBF8F1;
  --oro: #C0A062;
  --terra: #33281F;
  --accento: #8B5A3C;
  --testo: #3C342C;
  --testo-2: #5E5246;          /* il «testo chiaro» scurito: 6,2:1 sul crema scuro (Umberto, 14/11: caratteri più visibili) */
  --ok: #2F6B3A;
  --errore: #8A3B24;
  --filo: rgba(192,160,98,0.45);
  --filo-forte: rgba(192,160,98,0.8);
  --bordo-campo: #CDBF9F;
  --f-titolo: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --f-testo: 'Source Sans 3', 'Segoe UI', Arial, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--carta); color: var(--testo);
  font-family: var(--f-testo); font-weight: 400; font-size: 16px; line-height: 1.6;
}
b, strong { font-weight: 600; color: var(--terra); }
a { color: var(--accento); text-decoration-color: rgba(139,90,60,0.4); text-underline-offset: 0.15em; }
a:hover { color: var(--terra); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
summary:focus-visible, [tabindex]:focus-visible, label.tasto:focus-within {
  outline: 2px solid var(--accento); outline-offset: 2px;
}
img { max-width: 100%; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.salta { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--terra); color: var(--carta); padding: 8px 14px; }
.salta:focus { left: 8px; }
.tenue { color: var(--testo-2); }
.solo-stampa { display: none; }

/* ── testata ── */
.testata { background: var(--carta-2); border-bottom: 1px solid var(--filo-forte); }
.testata-in { max-width: 1400px; margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 18px 32px; flex-wrap: wrap; }
.marchio { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--terra); }
.marchio img { display: block; border-radius: 6px; }
.marchio small { display: block; font-size: 0.66rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accento); font-weight: 500; line-height: 1.3; }
.marchio b { display: block; font-family: var(--f-titolo); font-size: 1.45rem; font-weight: 600; line-height: 1.1; }
.menu { display: flex; gap: 6px 22px; flex-wrap: wrap; flex: 1; }
.menu a { font-size: 0.76rem; letter-spacing: 0.13em; text-transform: uppercase; color: var(--testo); text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
.menu a:hover { color: var(--accento); }
.menu a[aria-current="page"] { color: var(--accento); border-bottom-color: var(--oro); font-weight: 600; }
.chi { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.chi form { margin: 0; }
.chi-nome { font-size: 0.9rem; color: var(--terra); font-weight: 400; text-align: right; line-height: 1.2; }
.chi-nome small { display: block; font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--testo-2); font-weight: 500; }

/* ── pagina ── */
.pagina { flex: 1; width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 24px 56px; }
.pagina-distinta .pagina { max-width: 1400px; }
.pagina-totale .pagina { max-width: 1520px; }   /* più larga: la tabella entra tutta, fino all'ultima colonna (Umberto, 15/11/2026) */
.piede { border-top: 1px solid var(--filo); padding: 18px 24px 26px; text-align: center; font-size: 0.8rem; color: var(--testo-2); }
.piede p { margin: 2px 0; }

.intestazione { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 28px; flex-wrap: wrap; margin-bottom: 22px; }
.intestazione-destra { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.occhiello { margin: 0 0 4px; font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accento); font-weight: 500; }
h1 { margin: 0; font-family: var(--f-titolo); font-weight: 600; font-size: clamp(2rem, 4.4vw, 2.75rem); line-height: 1.08; color: var(--terra); }
h2 { margin: 0 0 14px; font-family: var(--f-titolo); font-weight: 600; font-size: 1.6rem; line-height: 1.15; color: var(--terra); }
h2 small { font-family: var(--f-testo); font-size: 0.85rem; font-weight: 400; color: var(--testo-2); }
h2::after { content: ""; display: block; width: 40px; height: 1px; background: var(--oro); margin-top: 8px; }
.sotto { margin: 4px 0 0; color: var(--testo-2); }
.stati { margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 0.9rem; }
.conta { display: inline-block; min-width: 1.7em; padding: 0 0.45em; margin-left: 4px; border: 1px solid var(--filo-forte); border-radius: 99px; font-family: var(--f-testo); font-size: 0.8rem; font-weight: 600; color: var(--accento); text-align: center; vertical-align: middle; line-height: 1.6; }
.briciole { font-size: 0.82rem; color: var(--testo-2); margin-bottom: 10px; }
.briciole a { color: var(--accento); }

.blocco { margin: 34px 0 0; }
.riquadro { background: var(--foglio); border: 1px solid var(--filo); padding: 20px 24px; margin: 0 0 22px; }
.riquadro-evidenza { border-left: 3px solid var(--oro); }
.riquadro h2 { font-size: 1.4rem; }
.piegato { padding: 0; }
.piegato > summary { cursor: pointer; padding: 14px 24px; font-weight: 600; color: var(--terra); list-style-position: inside; }
.piegato > :not(summary) { padding: 0 24px 18px; margin: 0; }
.vuoto { border: 1px dashed var(--filo-forte); padding: 26px; text-align: center; color: var(--testo-2); background: var(--foglio); }
.vuoto p { margin: 4px 0; }
.legenda, .aiuto { font-size: 0.84rem; color: var(--testo-2); margin: 10px 0 0; }
.conteggio { font-size: 0.86rem; color: var(--testo-2); margin: 0 0 8px; }
.elenco-semplice { list-style: none; padding: 0 24px 18px; margin: 0; }
.elenco-semplice li { padding: 6px 0; border-bottom: 1px solid var(--filo); }

/* ── avvisi ── */
.avviso { margin: 0 0 20px; padding: 12px 16px; border-left: 3px solid; font-weight: 400; }
.avviso ul { margin: 6px 0 0; padding-left: 22px; }
.avviso-ok { border-color: var(--ok); background: #EEF3EA; color: #24502C; }
.avviso-errore { border-color: var(--errore); background: #FBF1EC; color: var(--errore); }
.avviso-info { border-color: var(--oro); background: var(--carta-2); color: var(--terra); }
.avviso a { font-weight: 600; margin-left: 6px; }

/* ── tasti ── */
.azioni { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 22px; }
.azioni form { margin: 0; }
.tasto {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  font: 600 0.95rem/1.2 var(--f-testo); letter-spacing: 0.01em; text-transform: none; padding: 0.72em 1.25em;
  border-radius: 3px; border: 1px solid transparent; text-decoration: none; cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s; white-space: nowrap;
}
.tasto-primario { background: var(--terra); color: var(--carta); border-color: var(--terra); }
.tasto-primario:hover { background: var(--accento); border-color: var(--accento); color: #fff; }
.tasto-secondario { background: transparent; color: var(--accento); border-color: rgba(139,90,60,0.55); }
.tasto-secondario:hover { background: var(--carta-2); color: var(--terra); border-color: var(--accento); }
.tasto-testo { background: none; border-color: transparent; color: var(--accento); text-decoration: underline; text-decoration-color: rgba(139,90,60,0.4); padding-inline: 0.5em; }
.tasto-testo:hover { color: var(--terra); }
.tasto-pericolo { background: transparent; color: var(--errore); border-color: rgba(138,59,36,0.5); }
.tasto-pericolo:hover { background: #FBF1EC; border-color: var(--errore); }
.tasto-piccolo { font-size: 0.82rem; padding: 0.45em 0.85em; }
.tasto[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ── campi ── */
label { display: grid; gap: 5px; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--testo-2); font-weight: 500; }
input, select, textarea {
  font: 400 1rem/1.35 var(--f-testo); letter-spacing: normal; text-transform: none; color: var(--terra);
  background: #fff; border: 1px solid var(--bordo-campo); border-radius: 3px; padding: 9px 11px; width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--accento); }
::placeholder { color: #7A6D60; font-style: italic; font-weight: 400; opacity: 1; }
input:disabled, select:disabled, textarea:disabled { background: var(--carta-2); color: var(--testo); }
textarea { resize: vertical; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.griglia-modulo { display: grid; grid-template-columns: 9em 1fr 1fr; gap: 14px 16px; }
.campo-largo { grid-column: 1 / -1; }
.azioni-modulo { display: flex; gap: 10px; flex-wrap: wrap; }
.spunta { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: normal; font-size: 0.9rem; }
.spunta input { width: auto; }

/* ── edizione e schede ── */
.edizioni, .schede { display: inline-flex; border: 1px solid var(--filo-forte); border-radius: 3px; overflow: hidden; }
.edizioni a, .schede a { padding: 6px 16px; font-size: 0.86rem; font-weight: 600; text-decoration: none; color: var(--accento); }
.edizioni a + a, .schede a + a { border-left: 1px solid var(--filo-forte); }
.edizioni a[aria-current], .schede a[aria-current] { background: var(--terra); color: var(--carta); }
.schede { margin: 4px 0 8px; }

/* ── stati e segni ── */
.stato, .lettura { display: inline-flex; align-items: center; gap: 0.35em; font-size: 0.86rem; font-weight: 600; white-space: nowrap; }
.stato-confermato, .lettura-fatta { color: var(--ok); }
.stato-corso, .lettura-corso { color: var(--accento); }
.stato-vuoto, .lettura-nessuna { color: var(--testo-2); font-weight: 400; }
.lettura-errore { color: var(--errore); }
.segno { font-weight: 600; white-space: nowrap; }
.segno-ok { color: var(--ok); }
.segno-no { color: var(--errore); }
.segno-nullo { color: var(--testo-2); font-weight: 400; }

/* ── tabelle ── */
.tabella-scorre { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabella { width: 100%; border-collapse: collapse; font-weight: 400; font-size: 0.95rem; }
.tabella th, .tabella td { padding: 9px 12px; text-align: left; vertical-align: middle; }
.tabella thead th { font-size: 0.7rem; letter-spacing: 0.11em; text-transform: uppercase; color: var(--testo-2); font-weight: 600; border-bottom: 2px solid var(--terra); white-space: nowrap; }
.tabella tbody td, .tabella tbody th { border-bottom: 1px solid var(--filo); }
.tabella tbody tr:hover { background: rgba(239,231,216,0.55); }
.tabella tbody th { font-weight: 600; color: var(--terra); }
.tabella tbody th a { color: var(--terra); text-decoration: none; }
.tabella tbody th a:hover { color: var(--accento); text-decoration: underline; }
.tabella th small, .tabella td small { display: block; font-size: 0.8rem; font-weight: 400; color: var(--testo-2); letter-spacing: normal; text-transform: none; }
.tabella tfoot th, .tabella tfoot td { border-top: 2px solid var(--terra); background: var(--carta-2); font-weight: 600; color: var(--terra); padding-top: 11px; padding-bottom: 11px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.forte { font-weight: 600; color: var(--terra); }
.da-fare { color: var(--accento) !important; }
.tabella-punti td:first-child { color: var(--testo-2); width: 3.5em; }

/* miniature (distinte da assegnare) */
.miniature { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.miniature a { display: flex; gap: 12px; align-items: flex-start; padding: 10px; background: #fff; border: 1px solid var(--filo); text-decoration: none; color: var(--testo); height: 100%; }
.miniature a:hover { border-color: var(--accento); }
.miniature img { width: 72px; height: 96px; object-fit: cover; border: 1px solid var(--filo); flex: none; }
.miniature span { display: grid; gap: 3px; font-size: 0.88rem; }
.miniature small { color: var(--testo-2); }
.senza-foto { display: inline-grid; place-items: center; width: 72px; height: 96px; background: var(--carta-2); color: var(--testo-2); font-size: 1.4rem; flex: none; }

/* ── accesso ── */
.pagina-accesso { background: var(--carta-2); }
.pagina-accesso .pagina { display: grid; place-items: center; padding-top: 48px; }
.accesso-scheda { width: 100%; max-width: 500px; background: var(--carta); border: 1px solid var(--filo); padding: 40px clamp(20px, 6vw, 44px); }
.accesso-scheda h1 { font-size: 2.3rem; }
.accesso-scheda .sotto { margin-bottom: 24px; }
.modulo-accesso { display: grid; gap: 16px; }
.nota { margin: 22px 0 0; font-size: 0.86rem; color: var(--testo-2); }
.torna { display: inline-block; margin-top: 18px; font-size: 0.86rem; }

/* ── caricamento ── */
.carica { display: grid; gap: 22px; padding: 24px; }
.carica-punto { display: grid; gap: 6px; max-width: 560px; }
.carica-punto label { display: block; }
.zona { border: 2px dashed var(--filo-forte); background: #fff; padding: 38px 24px; text-align: center; transition: background-color 0.15s, border-color 0.15s; }
.zona.sopra { background: var(--carta-2); border-color: var(--accento); }
.zona-segno { display: block; font-size: 2.2rem; color: var(--oro); line-height: 1; }
.zona-titolo { margin: 10px 0 0; font-family: var(--f-titolo); font-size: 1.6rem; font-weight: 600; color: var(--terra); }
.zona-sotto { margin: 2px 0 12px; color: var(--testo-2); font-size: 0.9rem; }
.zona-tasti { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.zona .aiuto { max-width: 560px; margin: 16px auto 0; }
@media (min-width: 761px) { .solo-telefono { display: none !important; } }
.coda { list-style: none; margin: 8px 0 18px; padding: 0; border-top: 2px solid var(--terra); }
.coda li { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--filo); }
.coda img, .coda .segnaposto { width: 56px; height: 72px; object-fit: cover; border: 1px solid var(--filo); background: var(--carta-2); display: block; }
.coda .nome { font-weight: 600; color: var(--terra); overflow-wrap: anywhere; }
.coda .messaggio { display: block; font-size: 0.86rem; color: var(--testo-2); }
.coda .esito { font-size: 0.88rem; font-weight: 600; white-space: nowrap; }
.coda .esito-attesa { color: var(--testo-2); font-weight: 400; }
.coda .esito-corso { color: var(--accento); }
.coda .esito-ok { color: var(--ok); }
.coda .esito-no { color: var(--errore); }

/* ── distinta ── */
.scorri { display: flex; gap: 8px; }
.distinta-griglia { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.distinta-griglia.distinta-a-mano { grid-template-columns: minmax(0, 760px); }
.foto-pannello { position: sticky; top: 12px; }
.visore-quadro {
  position: relative; overflow: hidden; height: calc(100vh - 150px); min-height: 440px;
  background: #2E251D; border: 1px solid var(--terra); cursor: grab; touch-action: none; user-select: none;
}
.visore-quadro.trascina { cursor: grabbing; }
.visore-quadro img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; will-change: transform; pointer-events: none; }
.visore-tasti { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.visore-tasti .tasto { min-width: 2.6em; }
.dati-pannello { min-width: 0; }
.proposta { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 16px; margin: 0 0 18px; background: var(--carta-2); border-left: 3px solid var(--oro); }
.proposta p { margin: 0; }
.campi-testa { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; margin-bottom: 18px; }
.campi-testa .campo-corto { max-width: 8em; }
.tabella-righe { font-size: 0.95rem; }
.tabella-righe th, .tabella-righe td { padding: 4px 8px; }
.tabella-righe tbody th { font-weight: 400; color: var(--terra); }
.tabella-righe tbody th label { display: block; font-size: 0.95rem; letter-spacing: normal; text-transform: none; color: var(--terra); }
.tabella-righe thead th:nth-child(2), .tabella-righe thead th:nth-child(3) { text-align: right; }
.cifra { text-align: right; font-variant-numeric: tabular-nums lining-nums; width: 7.2em; padding: 6px 9px; }
.cifra-corta { width: 5.4em; }
input.sbagliato { border-color: var(--errore); background: #FBF1EC; }
.tabella-righe td:nth-child(2), .tabella-righe td:nth-child(3) { text-align: right; }
.foglio { color: var(--testo-2); font-size: 0.88rem; white-space: nowrap; }
.foglio-esito .segno { margin-left: 4px; }
tr.differente .foglio-valore { color: var(--errore); font-weight: 600; }
input.cifra.diverso { border-color: var(--errore); box-shadow: inset 0 0 0 1px var(--errore); }
.riga-extra th { padding-left: 8px; }
.nome-extra { font-size: 0.95rem; padding: 6px 9px; }
.togli { background: none; border: 1px solid transparent; color: var(--errore); cursor: pointer; font-size: 0.95rem; padding: 4px 8px; border-radius: 3px; }
.togli:hover { border-color: rgba(138,59,36,0.5); background: #FBF1EC; }
.riga-totale th, .riga-totale td { font-size: 1.05rem; }
#tot-kg, #tot-ct { padding-right: 18px; }
.riga-foglio th, .riga-foglio td { background: var(--foglio) !important; border-top: 1px solid var(--filo) !important; font-weight: 400 !important; color: var(--testo) !important; font-size: 0.9rem; }
.aggiungi { margin-top: 6px; }
.avvisi { margin: 20px 0 0; padding: 14px 18px; background: #FDF8EC; border: 1px solid var(--filo-forte); border-left: 3px solid var(--oro); }
.avvisi h2 { font-size: 1.15rem; margin-bottom: 6px; }
.avvisi h2::after { display: none; }
.avvisi ul { margin: 0; padding-left: 20px; font-size: 0.92rem; }
.avvisi li { margin: 3px 0; }
.campi-note { margin-top: 18px; }
.tasti-distinta {
  position: sticky; bottom: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-top: 20px; padding: 14px 0 16px; background: rgba(246,241,232,0.97); border-top: 1px solid var(--filo-forte);
}
.tasti-distinta .tasto-pericolo { margin-left: auto; }
.esito-rilettura { flex-basis: 100%; margin: 0; font-size: 0.9rem; color: var(--testo-2); }
.esito-rilettura:empty { display: none; }

/* ── punto ── */
.nota-punto { margin: 10px 0 0; padding: 8px 12px; background: var(--foglio); border-left: 2px solid var(--oro); font-size: 0.92rem; max-width: 60ch; }
.tabella-distinte .mini { width: 64px; padding-top: 6px; padding-bottom: 6px; }
.tabella-distinte .mini img { width: 48px; height: 64px; object-fit: cover; border: 1px solid var(--filo); display: block; }
.tabella-distinte .mini .senza-foto { width: 48px; height: 64px; font-size: 1.1rem; }
.riga-riepilogo { background: rgba(239,231,216,0.4); }
.riga-riepilogo th, .riga-riepilogo td { font-style: italic; }
.tre-numeri { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--terra); border-bottom: 1px solid var(--filo); }
.numero-grande { padding: 16px 18px; display: grid; gap: 2px; }
.numero-grande + .numero-grande { border-left: 1px solid var(--filo); }
.etichetta { font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--testo-2); font-weight: 600; }
.numero-grande b { font-family: var(--f-titolo); font-size: 2.1rem; font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums; }
.numero-grande b small { font-size: 1.1rem; color: var(--testo-2); }
.numero-grande > span:last-child { font-size: 0.9rem; }
.modulo-banco { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; margin-top: 16px; padding: 14px 18px; background: var(--foglio); border: 1px solid var(--filo); }
.etichetta-modulo { flex-basis: 100%; font-weight: 600; color: var(--terra); font-size: 0.95rem; }
.modulo-banco label { width: auto; }
.modulo-riapri { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; max-width: 720px; }
.modulo-riapri label { flex: 1 1 320px; }
.chiusura { padding: 20px 24px; background: var(--foglio); border: 1px solid var(--filo); }
.chiusura form { margin-top: 12px; }
.amministrazione { margin-top: 30px; }
.amministrazione .azioni { margin: 0; padding-top: 4px; }

/* ── totale ── */
.cifre { display: flex; flex-wrap: wrap; gap: 14px 0; margin: 0 0 24px; }
.cifra-grande { padding: 2px 26px 2px 16px; border-left: 2px solid var(--oro); display: grid; }
.cifra-grande b { font-family: var(--f-titolo); font-size: 2.15rem; font-weight: 600; line-height: 1.1; font-variant-numeric: lining-nums; }
.cifra-grande b small { font-size: 1.05rem; color: var(--testo-2); }
.tabella-totale { font-size: 0.86rem; }
.tabella-totale th, .tabella-totale td { padding: 7px 6px; }
.tabella-totale thead th.cat { white-space: normal; min-width: 4.4em; line-height: 1.25; vertical-align: bottom; font-size: 0.66rem; letter-spacing: 0.06em; }
.tabella-totale .col-punto { position: sticky; left: 0; z-index: 1; background: var(--carta); min-width: 10.8em; box-shadow: 1px 0 0 var(--filo); }
.tabella-totale thead .col-punto { z-index: 2; }
.tabella-totale tfoot .col-punto { background: var(--carta-2); }
.tabella-totale tbody tr:hover .col-punto { background: #F1EBDF; }
.tabella-totale .col-tot { font-weight: 600; color: var(--terra); background: rgba(239,231,216,0.6); }
.tabella-totale tfoot .col-tot { background: #E6DCC8; }
.segno-stato { display: inline-block; width: 1.1em; color: var(--accento); font-weight: 400; }
tr.confermato .segno-stato { color: var(--ok); }
tr.non-confermato .col-punto a { font-style: italic; }
.blocco-comuni .tabella { max-width: 820px; }

/* ── registro ── */
.filtro { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; }
.filtro label:not(.spunta) { flex: 1 1 200px; }
.tabella-registro { font-size: 0.88rem; }
.tabella-registro .quando { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--testo-2); }
.tabella-registro code { font-size: 0.84rem; color: var(--terra); background: var(--carta-2); padding: 1px 6px; border-radius: 2px; }
.dettagli summary { cursor: pointer; color: var(--accento); font-size: 0.84rem; }
.prima-dopo { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 8px; }
.prima-dopo pre { margin: 4px 0 0; padding: 8px 10px; background: #fff; border: 1px solid var(--filo); font-size: 0.78rem; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 320px; overflow: auto; }

/* ── telefono e schermi stretti ── */
@media (max-width: 980px) {
  .distinta-griglia { grid-template-columns: minmax(0, 1fr); }
  .foto-pannello { position: static; }
  .visore-quadro { height: 56vh; min-height: 300px; }
}
@media (max-width: 760px) {
  .testata-in { padding: 10px 16px; gap: 10px 16px; }
  .marchio b { font-size: 1.25rem; }
  .menu { order: 3; flex-basis: 100%; gap: 4px 14px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .menu a { white-space: nowrap; font-size: 0.7rem; letter-spacing: 0.07em; }
  .tabella-punti .stato-parola { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tabella-punti .stato { font-size: 1.05rem; }
  .tasti-distinta { position: static; }
  .coda li { grid-template-columns: 56px 1fr; row-gap: 4px; }
  .coda li > img, .coda li > .segnaposto { grid-row: span 2; }
  .coda .esito { grid-column: 2; }
  .chi-nome { display: none; }
  .pagina { padding: 20px 16px 44px; }
  .intestazione-destra { align-items: flex-start; }
  .griglia-modulo { grid-template-columns: 1fr 1fr; }
  .griglia-modulo .campo-corto { grid-column: 1 / -1; max-width: 10em; }
  .campi-testa { grid-template-columns: 1fr; }
  .facoltativa { display: none; }
  .tre-numeri { grid-template-columns: 1fr; }
  .numero-grande + .numero-grande { border-left: 0; border-top: 1px solid var(--filo); }
  .riquadro { padding: 16px; }
  .tabella th, .tabella td { padding: 8px 8px; }
  .cifra { width: 6.2em; }
  .cifra-corta { width: 4.6em; }
  .tasti-distinta .tasto { flex: 1 1 auto; }
  .tasti-distinta .tasto-pericolo { margin-left: 0; }
  .cifra-grande { padding-right: 18px; }
  .cifra-grande b { font-size: 1.7rem; }
}

/* ── stampa: A4 orizzontale, curata ── */
.tabella-punti td.togli { white-space: nowrap; text-align: right; padding-block: 0.3em; }
.tabella-punti td.togli form { margin: 0; }
.tabella td small.pacchi { margin-top: 1px; font-size: 0.78rem; font-weight: 500; color: var(--testo-2); }
/* vista kg: i numeri in alto, sulla riga dei kg; sotto, la riga piccola dei pacchi (e la parola «pacchi» nella colonna Pacchi) */
.tabella-totale .unita { font-size: 0.7em; font-weight: 500; color: var(--testo-2); }
.tabella-totale.vista-kg tfoot td { padding-left: 4px; padding-right: 4px; }
.tabella-totale.vista-kg tbody td, .tabella-totale.vista-kg tbody th, .tabella-totale.vista-kg tfoot td, .tabella-totale.vista-kg tfoot th { vertical-align: top; }
.campo-password { position: relative; display: block; }
.campo-password input { width: 100%; padding-right: 3em; }
.mostra-password { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 2.4em; height: 2.4em; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--testo-2); cursor: pointer; }
.mostra-password:hover { color: var(--terra); background: var(--carta-2); }
.mostra-password .occhio-chiuso, .mostra-password[aria-pressed="true"] .occhio-aperto { display: none; }
.mostra-password[aria-pressed="true"] .occhio-chiuso { display: block; }
h1 .rif { font-family: var(--f-testo); font-size: 0.42em; font-weight: 500; color: var(--testo-2); letter-spacing: 0.04em; vertical-align: middle; }

/* ── i «?» dell'aiuto (15/11/2026) ── */
.domanda { position: relative; display: inline-block; vertical-align: middle; margin-left: 6px; line-height: 1; }
.domanda-tasto {
  display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border-radius: 50%;
  border: 1px solid rgba(139,90,60,0.6); background: var(--foglio); color: var(--accento);
  font: 600 0.82rem/1 var(--f-testo); letter-spacing: 0; text-transform: none; cursor: help;
}
.domanda-tasto:hover, .domanda.aperta .domanda-tasto { background: var(--accento); border-color: var(--accento); color: #fff; }
.domanda-testo {
  display: none; position: absolute; z-index: 40; left: 50%; top: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: min(340px, 86vw); padding: 11px 15px; border-radius: 3px;
  background: var(--terra); color: var(--carta); box-shadow: 0 8px 22px rgba(51,40,31,0.28);
  font: 400 0.88rem/1.5 var(--f-testo); letter-spacing: normal; text-transform: none; text-align: left; white-space: normal;
}
.domanda-testo::before { content: ""; position: absolute; left: 50%; top: -6px; margin-left: -6px; border: 6px solid transparent; border-top: 0; border-bottom-color: var(--terra); }
.domanda-testo a { color: #F3E2BC; font-weight: 600; margin-left: 2px; white-space: nowrap; }
.domanda-testo a:hover { color: #fff; }
.domanda.aperta .domanda-testo { display: block; }
@media (hover: hover) { .domanda:hover .domanda-testo { display: block; } }
h2 .domanda { margin-left: 10px; top: -2px; }
.domanda.sopra .domanda-testo { top: auto; bottom: calc(100% + 8px); }
.domanda.sopra .domanda-testo::before { top: auto; bottom: -6px; border-bottom: 0; border-top: 6px solid var(--terra); }

/* ── i grafici del totale (15/11/2026) ── */
.grafici { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 20px; }
.grafico { margin: 0; background: var(--foglio); border: 1px solid var(--filo); padding: 18px 22px 16px; min-width: 0; }
.grafico-largo { grid-column: 1 / -1; }
.grafico figcaption { margin: 0 0 14px; display: grid; gap: 1px; }
.grafico figcaption b { font-family: var(--f-titolo); font-size: 1.3rem; font-weight: 600; line-height: 1.2; }
.grafico figcaption span { font-size: 0.84rem; color: var(--testo-2); }
.grafico-legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 12px; }
.chiave { display: inline-block; vertical-align: middle; }
.chiave-ora { width: 18px; height: 8px; border-radius: 0 3px 3px 0; background: var(--accento); }
.chiave-prima { width: 18px; height: 5px; border-radius: 0 2px 2px 0; background: #C9AE93; }
.chiave-tacca { width: 2px; height: 14px; background: var(--terra); margin: 0 4px; }

/* la ciambella e le categorie */
.ciambella-corpo { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 22px; align-items: center; }
.ciambella { width: 100%; max-width: 200px; height: auto; display: block; }
.ciambella-settori path { stroke: var(--foglio); stroke-width: 2; stroke-linejoin: round; }
.ciambella-settori path:hover { opacity: 0.85; }
.ciambella-cifra { font-family: var(--f-titolo); font-size: 30px; font-weight: 600; fill: var(--terra); }
.ciambella-unita { font-family: var(--f-testo); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; fill: var(--testo-2); }
.voci { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }
.voci li { display: grid; grid-template-columns: 10px minmax(8em, 1.3fr) minmax(40px, 1fr) 4.2em 3.6em; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 2px; }
.voci li:hover { background: var(--carta-2); }
.campione { width: 10px; height: 10px; border-radius: 50%; }
.voce-nome { color: var(--terra); line-height: 1.25; }
.voce-traccia { height: 6px; }
.voce-traccia span { display: block; height: 100%; min-width: 2px; border-radius: 0 3px 3px 0; }
.voce-valore, .voce-quota { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.voce-valore { font-weight: 600; color: var(--terra); }
.voce-quota { color: var(--testo-2); }

/* i comuni, quest'anno e l'anno prima */
.comuni-barre { list-style: none; margin: 0; padding: 0; font-size: 0.86rem; }
.comuni-barre li { display: grid; grid-template-columns: minmax(6.5em, 8em) minmax(40px, 1fr) auto 4.8em; gap: 10px; align-items: center; padding: 5px 4px; border-bottom: 1px solid rgba(192,160,98,0.25); }
.comuni-barre li:last-child { border-bottom: 0; }
.comuni-barre li:hover { background: var(--carta-2); }
.comune-nome { color: var(--terra); font-weight: 600; line-height: 1.2; }
.comune-nome small { display: block; font-weight: 400; font-size: 0.76rem; color: var(--testo-2); }
.comune-barre { display: grid; gap: 3px; }
.barra-ora, .barra-prima { display: block; min-width: 2px; }
.barra-ora { height: 9px; border-radius: 0 3px 3px 0; background: var(--accento); }
.barra-prima { height: 5px; border-radius: 0 2px 2px 0; background: #C9AE93; }
.comune-valori { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; line-height: 1.2; }
.comune-valori b { display: block; }
.comune-valori small { display: block; font-size: 0.76rem; color: var(--testo-2); }
.comune-diff { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; font-size: 0.84rem; }

/* i punti, in due colonne sulla stessa scala */
.punti-barre { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 40px; font-size: 0.86rem; }
.punti-barre li { break-inside: avoid; display: grid; grid-template-columns: 1.1em minmax(9em, 13em) minmax(40px, 1fr) 5.4em; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 2px; }
.punti-barre li:hover { background: var(--carta-2); }
.pb-stato { color: var(--accento); text-align: center; }
.punti-barre li.confermato .pb-stato { color: var(--ok); }
.pb-nome { min-width: 0; line-height: 1.2; }
.pb-nome a { color: var(--terra); font-weight: 600; text-decoration: none; }
.pb-nome a:hover { color: var(--accento); text-decoration: underline; }
.punti-barre li.non-confermato .pb-nome a { font-style: italic; }
.pb-nome small { display: block; font-size: 0.74rem; color: var(--testo-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-traccia { position: relative; height: 16px; display: flex; align-items: center; }
.pb-barra { display: block; height: 9px; min-width: 2px; border-radius: 0 3px 3px 0; background: var(--accento); }
.pb-prima { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--terra); }
.pb-valore { text-align: right; font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; line-height: 1.15; }
.pb-valore b { display: block; color: var(--terra); }
.pb-valore small { display: block; font-size: 0.74rem; color: var(--testo-2); }

@media (max-width: 1100px) {
  .grafici { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .grafico { padding: 14px 14px 12px; }
  .ciambella-corpo { grid-template-columns: minmax(0, 1fr); }
  .ciambella { max-width: 190px; margin: 0 auto; }
  .voci li { grid-template-columns: 10px minmax(0, 1fr) 4em 3.4em; }
  .voce-traccia { grid-column: 2 / -1; grid-row: 2; }
  .punti-barre { columns: 1; }
  .punti-barre li { grid-template-columns: 1.1em minmax(0, 1fr) 5em; }
  .pb-traccia { grid-column: 2 / -1; grid-row: 2; height: 12px; }
  .comuni-barre li { grid-template-columns: minmax(0, 1fr) auto 4.6em; }
  .comune-barre { grid-column: 1 / -1; grid-row: 2; }
}

/* ── la pagina d'aiuto ── */
.aiuto-pagina { max-width: 860px; }
.aiuto-indice { columns: 2; column-gap: 32px; margin: 0; padding: 16px 24px 16px 44px; background: var(--foglio); border: 1px solid var(--filo); }
.aiuto-indice li { margin: 3px 0; break-inside: avoid; }
.aiuto-voce { margin: 34px 0 0; scroll-margin-top: 16px; }
.aiuto-voce p, .aiuto-voce li { max-width: 72ch; }
.aiuto-voce ul, .aiuto-voce ol { padding-left: 22px; }
.aiuto-voce li { margin: 4px 0; }
.aiuto-voce:target h2 { color: var(--accento); }
.passi { list-style: none; padding: 0 !important; counter-reset: passo; display: grid; gap: 10px; }
.passi li { counter-increment: passo; display: grid; grid-template-columns: 2.2em 1fr; gap: 12px; align-items: start; margin: 0 !important; }
.passi li::before { content: counter(passo); display: grid; place-items: center; width: 2.2em; height: 2.2em; border-radius: 50%; border: 1px solid var(--oro); font-family: var(--f-titolo); font-weight: 600; font-size: 1.1rem; font-variant-numeric: lining-nums; color: var(--accento); background: var(--foglio); }
.esempio-tasto { display: inline-block; padding: 0 0.6em; border: 1px solid rgba(139,90,60,0.55); border-radius: 3px; font-size: 0.86em; font-weight: 600; color: var(--accento); background: var(--foglio); white-space: nowrap; }
.esempio-tasto.pericolo { color: var(--errore); border-color: rgba(138,59,36,0.5); }
.esempio-tasto.primario { color: var(--carta); background: var(--terra); border-color: var(--terra); }
.chi-puo { font-size: 0.86rem; color: var(--testo-2); }
.chi-puo b { color: var(--accento); }
@media (max-width: 760px) { .aiuto-indice { columns: 1; } }

@media print {
  .togli { display: none !important; }
  .domanda { display: none !important; }
  .grafici { grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: 8pt; }
  .grafico { background: #fff; padding: 7pt 9pt 6pt; break-inside: avoid; }
  .grafico figcaption { margin-bottom: 5pt; }
  .grafico figcaption b { font-size: 11pt; }
  .grafico figcaption span { font-size: 7pt; }
  .ciambella-corpo { grid-template-columns: 105pt minmax(0, 1fr); gap: 10pt; }
  .ciambella { max-width: 105pt; }
  .voci, .comuni-barre, .punti-barre { font-size: 7.2pt; }
  .voci li, .punti-barre li { padding: 0.6pt 2pt; gap: 5pt; }
  .comuni-barre li { padding: 1.6pt 2pt; gap: 6pt; }
  .punti-barre { columns: 3; column-gap: 16pt; }
  .punti-barre li { grid-template-columns: 1em minmax(0, 1.25fr) minmax(20pt, 1fr) 3.6em; }
  .pb-traccia { height: 10pt; }
  .pb-barra, .barra-ora { height: 6pt; }
  .pb-nome small, .comune-nome small, .comune-valori small, .pb-valore small { font-size: 6pt; }
  .grafico-legenda { margin-top: 4pt; }
  .aiuto-indice { display: none; }
  @page { size: A4 landscape; margin: 10mm 9mm 12mm; }
  html, body { background: #fff !important; }
  body { font-size: 9pt; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .testata, .piede, .salta, .non-stampa, .azioni, .avviso, .briciole, .schede, .edizioni, .tasti-distinta, .legenda br { display: none !important; }
  .solo-stampa { display: block !important; }
  .pagina { max-width: none !important; padding: 0 !important; }
  .intestazione { margin-bottom: 8pt; align-items: flex-end; }
  h1 { font-size: 20pt; }
  h2 { font-size: 13pt; margin-bottom: 5pt; }
  h2::after { margin-top: 3pt; }
  .data-stampa { margin: 3pt 0 0; font-size: 8.5pt; color: #333; }
  a { color: inherit !important; text-decoration: none !important; }
  .blocco { margin-top: 12pt; break-inside: auto; }
  .blocco-comuni { break-before: auto; break-inside: avoid; }
  .cifre { margin-bottom: 8pt; }
  .cifra-grande b { font-size: 15pt; }
  .tabella-scorre { overflow: visible !important; }
  .tabella { font-size: 7.4pt; }
  .tabella th, .tabella td { padding: 2.2pt 3pt; }
  .tabella thead { display: table-header-group; }
  .tabella tr { break-inside: avoid; }
  .tabella tbody tr:hover { background: none; }
  .tabella thead th { font-size: 6.4pt; letter-spacing: 0.06em; }
  .tabella-totale thead th.cat { font-size: 6.2pt; min-width: 0; letter-spacing: 0.02em; }
  .tabella-totale .col-punto { position: static; min-width: 0; box-shadow: none; background: transparent !important; }
  .tabella-totale tfoot .col-punto { background: var(--carta-2) !important; }
  .tabella-totale .col-punto small { display: inline; margin-left: 3pt; }
  .tabella th small, .tabella td small { font-size: 6.6pt; }
  .tabella td small.pacchi { font-size: 6.2pt; margin-top: 0; }
  .tabella tfoot { display: table-row-group; }   /* il totale una volta sola, in fondo, non su ogni pagina */
  .legenda { font-size: 7pt; margin-top: 4pt; }
  .foto-pannello { display: none; }
  .distinta-griglia { display: block; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
