/* Lavorare con l'IA — site.css. «La pagina è l'oggetto»: il verbale di collaudo e la sua cancelleria su una scrivania scura.
   Vincolante: design/DESIGN.md. Palette «Stone and blueprint», Big Shoulders 800 + Public Sans, cinque misure di testo,
   angoli vivi, niente ombre, niente filetti sottili, movimento solo transform/opacity. Nessuna libreria, nessun CDN. */

@font-face { font-family: 'Big Shoulders'; src: url('../fonts/big-shoulders-800-latin.woff2') format('woff2'); font-weight: 800; font-style: normal; font-display: optional; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Public Sans'; src: url('../fonts/public-sans-latin.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: optional; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Public Sans'; src: url('../fonts/public-sans-italic-latin.woff2') format('woff2'); font-weight: 100 900; font-style: italic; font-display: optional; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* colore: la scrivania, la carta, l'inchiostro, il blu della penna e del timbro (solo dove l'ingegnere mette mano) */
  --desk: #26251e;
  --paper: #dfdedb;
  --paper-2: #d3d2ce;
  --paper-3: #c9c8c3;
  --ink: #26251e;
  --muted: #57554e;          /* 5,5:1 su --paper, 4,9:1 su --paper-2 */
  --accent: #2456d6;
  --accent-strong: #1b44ad;
  --accent-ink: #ffffff;
  --on-desk: #dfdedb;
  --on-desk-soft: #b9b7af;

  --display: 'Big Shoulders', 'Arial Narrow', 'sans-serif-condensed', 'Roboto Condensed', sans-serif;
  --text: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* le cinque misure del testo: piccolo, corpo, guida, titolo, gigante. Non aggiungerne. */
  --fs-s: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --fs-b: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --fs-l: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);
  --fs-h: clamp(2.5rem, 1.2rem + 5vw, 5.5rem);
  --fs-g: clamp(4.5rem, 1rem + 10vw, 10rem);

  --margin: clamp(1rem, 2.2vw, 2rem);
  --gutter: clamp(0.75rem, 1.4vw, 1.5rem);
  --section: clamp(4.5rem, 3rem + 5vw, 8.5rem);
  --pad: clamp(1.25rem, 3vw, 2.5rem);
  --wrap: min(100% - 2 * var(--margin), 96rem);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.33, 1, 0.68, 1);
  --t-press: 140ms;
  --t-hover: 180ms;
  --t-ui: 240ms;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 1rem; }
body {
  margin: 0;
  background: var(--desk);
  color: var(--on-desk);
  font-family: var(--text);
  font-size: var(--fs-b);
  line-height: 1.5;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3, p, figure, ul, ol, dl, dd, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.foglio :focus-visible, .verbale :focus-visible, .retro :focus-visible { outline-color: var(--accent); }
body > header :focus-visible, .conto :focus-visible, .tavole :focus-visible { outline-color: var(--on-desk); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: var(--margin); top: 0.5rem; z-index: 10; padding: 0.75rem 1rem; background: var(--paper); color: var(--ink); font-weight: 600; }
.skip:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
main:focus { outline: none; }
p { text-wrap: pretty; }

h2 { font-family: var(--display); font-weight: 800; font-size: var(--fs-h); line-height: 0.9; letter-spacing: -0.005em; text-transform: uppercase; text-wrap: balance; }

.link { text-decoration: underline; text-decoration-thickness: 0.08em; text-underline-offset: 0.2em; transition: color var(--t-hover) ease; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 3.25rem; padding: 0 1.5rem;
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: var(--fs-b); line-height: 1.2; text-decoration: none; text-align: center;
  border: 0; border-radius: 0; cursor: pointer;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) ease, color var(--t-hover) ease;
}
.button:active { transform: scale(0.97); }
.button--paper { background: var(--paper); color: var(--ink); }
.button--ink { background: var(--ink); color: var(--paper); }
.linklike { background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.2em; font-size: inherit; text-align: left; }
@media (hover: hover) and (pointer: fine) {
  .button:hover { background: var(--accent-strong); color: var(--accent-ink); }
  .link:hover { color: var(--accent); }
  .conto .link:hover, .testata a:hover { color: var(--paper); }
}
.firma { font-style: italic; }
.nota { font-size: var(--fs-s); color: var(--muted); line-height: 1.5; }
.lead { font-size: var(--fs-l); line-height: 1.3; font-weight: 500; max-width: 38ch; }
.giant {
  font-family: var(--display); font-weight: 800; line-height: 0.8; letter-spacing: -0.005em; text-transform: uppercase;
  white-space: nowrap; font-size: min(var(--fs-g), calc(100cqw / var(--n, 8) / 0.48)); padding-top: 0.06em;
}
.giant > span { display: block; }
.edge { display: block; width: 100%; }
.edge path { fill: var(--paper); }
.param-missing { background: none; color: var(--muted); font-style: italic; }

/* ============ il timbro: il verdetto. Solo con un verdetto vero; in bianco è un riquadro tratteggiato ============ */
.timbro {
  justify-self: center; align-self: center;
  font-family: var(--display); font-weight: 800; font-size: var(--fs-l); line-height: 1; text-transform: uppercase; white-space: nowrap;
  color: var(--accent); border: 4px solid var(--accent); padding: 0.25em 0.4em 0.15em; transform: rotate(-7deg); margin: 0.25rem 0.5rem;
}
.timbro[data-verdetto="bocciato"] { transform: rotate(5deg); }
.timbro--vuoto { color: var(--muted); border: 3px dashed var(--muted); transform: none; text-align: center; white-space: normal; line-height: 1.05; }
.timbro--vuoto span { display: block; }
.timbro--piccolo { display: inline-block; font-size: var(--fs-s); font-family: var(--text); font-weight: 700; color: var(--accent-strong); border-color: var(--accent-strong); border-width: 2px; padding: 0.2em 0.45em 0.15em; margin: 0; transform: rotate(-4deg); letter-spacing: 0; }
.timbro--piccolo[data-verdetto="bocciato"] { transform: rotate(3deg); }

/* ============ testata delle pagine interne: il nome sulla scrivania ============ */
.testata {
  width: var(--wrap); margin: 0 auto; padding: 1.25rem 0 1.5rem;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem 2rem;
}
.testata__nome { font-family: var(--display); font-weight: 800; font-size: var(--fs-l); line-height: 1; text-transform: uppercase; text-decoration: none; color: var(--paper); padding: 0.6rem 0; }
.testata__nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; }
.testata__nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; color: var(--on-desk); text-decoration: underline;
  text-decoration-thickness: 0.1em; text-underline-offset: 0.3em; text-decoration-color: transparent; transition: text-decoration-color var(--t-hover) ease;
}
.testata__nav a[aria-current="page"] { text-decoration-color: currentColor; font-weight: 600; }
@media (hover: hover) and (pointer: fine) { .testata__nav a:hover { text-decoration-color: currentColor; } }

/* ============ il foglio: ogni pagina interna è un documento sulla scrivania ============ */
.foglio { background: var(--paper); color: var(--ink); }
main > .foglio { width: var(--wrap); margin: 0 auto; padding: var(--pad) var(--pad) calc(var(--pad) * 1.6); }
.foglio a:not(.button) { color: inherit; }
.crumbs { font-size: var(--fs-s); color: var(--muted); display: flex; flex-wrap: wrap; gap: 0 0.5rem; margin-bottom: 1.5rem; }
.crumbs a { color: var(--ink); text-underline-offset: 0.2em; }
.foglio__sotto { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 2rem; align-items: start; margin-top: 1.75rem; }
.foglio__sotto > div { grid-column: 1 / 9; container-type: inline-size; }
.foglio__testa .tavola img { aspect-ratio: 1; }
.foglio__sotto > .tavola { grid-column: 9 / 13; }
.foglio__grid--sezione { margin-top: 3.5rem; }
.foglio__grid--sezione .programma li { display: grid; gap: 0.25rem; }
.foglio--pagina .foglio__sotto { margin-top: 0; }
.titolo-pagina { font-family: var(--display); font-weight: 800; font-size: var(--fs-h); line-height: 0.9; text-transform: uppercase; text-wrap: balance; letter-spacing: -0.005em; }
.titolo-articolo { font-family: var(--display); font-weight: 800; font-size: var(--fs-h); line-height: 0.92; text-wrap: balance; letter-spacing: -0.005em; }
.foglio__testa .lead { margin-top: 1.25rem; }
.foglio__fatti { margin-top: 1.25rem; font-size: var(--fs-s); color: var(--muted); }
.firma-riga { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; color: var(--muted); font-size: var(--fs-s); }
.firma-riga .firma { color: var(--ink); font-size: var(--fs-b); }
.tavola img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: var(--paper-3); }
.tavola figcaption { margin-top: 0.625rem; font-size: var(--fs-s); color: var(--muted); max-width: 40ch; }
.tavola--testo { margin: 2rem 0; }
.tavola--testo img { aspect-ratio: auto; }

.foglio__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); margin-top: 3rem; }
.foglio__testo { grid-column: 1 / 8; min-width: 0; }
.foglio__lato { grid-column: 9 / 13; }
.foglio__lato-in { position: sticky; top: 1.5rem; display: grid; gap: 2rem; }
.foglio__sezione { margin-top: 3.5rem; }
.foglio__sezione > h2, .foglio__testo > h2, .foglio__lato-titolo, .modulo__legenda h3 { font-size: var(--fs-l); line-height: 1; margin-bottom: 1.25rem; }
.foglio__nota { max-width: 68ch; margin-bottom: 1.5rem; }
.foglio__testo .prose, .foglio__testo > .tagliando { max-width: 68ch; }

.toc { background: var(--paper-2); padding: 1.25rem 1.25rem 1rem; }
.toc__title { font-weight: 700; margin-bottom: 0.5rem; }
.toc ol { display: grid; gap: 0.125rem; }
.toc a { display: block; padding: 0.375rem 0; text-decoration: none; line-height: 1.3; }
@media (hover: hover) and (pointer: fine) { .toc a:hover { text-decoration: underline; } }
.toc--testo { margin: 1.5rem 0; }

.tagliando { background: var(--paper-2); padding: 1.25rem 1.25rem 1rem; border-top: 5px dotted var(--paper); }
.tagliando p + p { margin-top: 0.75rem; }
.tagliando--lato p:first-child { font-weight: 600; }

/* il registro: righe piene, una per pezzo */
.registro-righe { display: grid; gap: 6px; }
.registro-righe a {
  position: relative; display: grid; gap: 0.25rem; padding: 1rem 1.25rem; background: var(--paper-2); text-decoration: none;
  transition: background-color var(--t-hover) ease;
}
.registro-righe__titolo { font-weight: 700; line-height: 1.3; padding-right: 7rem; }
.registro-righe__meta { font-size: var(--fs-s); color: var(--muted); }
.registro-righe__desc { max-width: 68ch; }
.registro-righe .timbro--piccolo { position: absolute; right: 1.25rem; top: 1rem; }
@media (hover: hover) and (pointer: fine) { .registro-righe a:hover { background: var(--paper-3); } }
.foglio--pagina .registro-righe__titolo, .foglio--sezione .registro-righe__titolo { padding-right: 0; }
.registro-righe a:has(.timbro--piccolo) .registro-righe__titolo { padding-right: 8rem; }

.programma { display: grid; gap: 6px; }
.programma li { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem 1.5rem; flex-wrap: wrap; padding: 1rem 1.25rem; background: var(--paper-2); }
.programma li > span:first-child { font-weight: 600; flex: 1 1 22rem; }
.programma__stato { font-size: var(--fs-s); color: var(--muted); }
.programma--registro li { display: grid; gap: 0.375rem; }
.programma--registro li > span:first-child { flex: none; }
.programma__misura { max-width: 60ch; }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; margin-top: 2rem; }

/* il listino */
.listino-vuoto { background: var(--paper-2); padding: 1.25rem; max-width: 68ch; }
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
.foglio__sezione > .table-wrap { margin-top: 0; }
.listino, .prose table, .misure { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.listino caption, .prose table caption, .misure caption { text-align: left; font-size: var(--fs-s); color: var(--muted); padding-bottom: 0.75rem; caption-side: top; }
.listino th, .listino td, .prose th, .prose td, .misure th, .misure td { text-align: left; vertical-align: top; padding: 0.75rem 1rem; font-weight: 400; }
.listino thead th, .prose thead th, .misure thead th { font-weight: 700; background: var(--ink); color: var(--paper); }
.listino tbody tr:nth-child(even), .prose tbody tr:nth-child(even), .misure tbody tr:nth-child(even) { background: var(--paper-2); }
.listino tbody th { font-weight: 600; }
.listino__gruppo { background: var(--paper) !important; }
.listino__gruppo th { font-family: var(--display); font-weight: 800; font-size: var(--fs-l); text-transform: uppercase; line-height: 1; padding-top: 1.5rem !important; background: var(--paper) !important; }
.listino__euro { white-space: nowrap; font-weight: 700; }
.listino__euro span { display: block; font-weight: 400; font-size: var(--fs-s); color: var(--muted); white-space: normal; min-width: 11rem; }
.listino__vuota td:first-of-type { color: var(--muted); font-weight: 600; }

/* il testo */
.prose { line-height: 1.62; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: var(--fs-l); line-height: 1.05; margin-top: 2.5rem; scroll-margin-top: 1.5rem; }
.prose h3 { font-family: var(--text); font-size: var(--fs-b); font-weight: 700; text-transform: none; margin-top: 1.75rem; line-height: 1.3; }
.prose h2 + *, .prose h3 + * { margin-top: 0.75rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose ul { list-style: square; }
.prose ol { list-style: decimal; }
.prose li + li { margin-top: 0.4em; }
.prose li > ul, .prose li > ol { margin-top: 0.4em; }
.prose a { text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.18em; }
@media (hover: hover) and (pointer: fine) { .prose a:hover { color: var(--accent); } }
.prose strong, .prose b { font-weight: 650; }
.prose code { font-size: 0.9em; background: var(--paper-2); padding: 0.05em 0.3em; }
.prose blockquote { background: var(--paper-2); padding: 1.1rem 1.25rem; }
.prose blockquote.riquadro--attenzione { background: var(--ink); color: var(--paper); }
.prose blockquote.riquadro--attenzione a { color: var(--paper); }
.prose hr { border: 0; height: 0.5rem; background: var(--paper-2); margin: 2rem 0; }
.prose .table-wrap { margin: 1.5rem 0; }
.fonte { font-style: normal; }
.in-breve { background: var(--paper-2); padding: 1.25rem 1.25rem 1.1rem; margin-bottom: 2rem; }
.in-breve h2 { font-size: var(--fs-l); line-height: 1; margin-bottom: 0.75rem; }
.in-breve ul { list-style: square; padding-left: 1.25rem; display: grid; gap: 0.4rem; }
.faq { margin-top: 3rem; }
.faq details { background: var(--paper-2); margin-top: 6px; }
.faq summary { cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq details p { padding: 0 1.1rem 1rem; margin: 0; }
.fonti { margin-top: 3rem; }
.fonti ol { font-size: var(--fs-s); }

/* il verbale di un collaudo: scheda, misure, timbro */
.scheda { background: var(--paper-2); padding: 1.5rem 1.5rem 1.25rem; margin-bottom: 2.5rem; }
.scheda__testa { display: flex; justify-content: space-between; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.scheda__testa h2 { font-size: var(--fs-l); line-height: 1; }
.scheda__testa .timbro { margin: 0.5rem 1rem 0.5rem 0; }
.scheda__dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 2rem; }
.scheda__dl dt, .esito dt, .bar__dl dt { font-size: var(--fs-s); color: var(--muted); }
.scheda__dl dd { font-weight: 600; line-height: 1.35; }
.scheda .table-wrap { margin: 1.5rem 0 0; }
.misure tbody tr:nth-child(odd) { background: var(--paper); }
.misure tbody tr:nth-child(even) { background: var(--paper-2); }
.misure__valore { font-weight: 700; white-space: nowrap; }

/* modulo in bianco su /collaudi/ */
.modulo__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 2rem; align-items: start; }
.verbale--modulo { grid-column: 1 / 9; background: var(--paper-2); padding: var(--pad); }
.verbale--modulo .esito { background: var(--paper); }
.verbale--modulo .box { background: var(--paper-2); }
.modulo__legenda { grid-column: 9 / 13; }
.modulo__legenda dl { display: grid; gap: 1.25rem; }
.modulo__legenda dt { margin-bottom: 0.5rem; }
.modulo__legenda .nota { margin-top: 1.5rem; }

/* contatti, ricerca, scelte */
.tagliando.tagliando { margin-bottom: 2.5rem; }
form.tagliando h2 { font-size: var(--fs-l); line-height: 1; margin-bottom: 1rem; }
.campo { display: grid; gap: 0.375rem; margin-bottom: 1rem; }
.campo label, .cerca label { font-weight: 600; }
.campo input, .campo textarea, .cerca input { width: 100%; min-height: 3rem; padding: 0.625rem 0.875rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 0; }
.campo textarea { resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.avviso { background: var(--ink); color: var(--paper); padding: 0.875rem 1rem; margin-bottom: 1rem; }
.avviso--ok { background: var(--accent); color: var(--accent-ink); }
form.tagliando .nota { margin-top: 1rem; }
.cerca { margin-top: 1.75rem; display: grid; gap: 0.5rem; max-width: 40rem; }
.cerca__riga { display: flex; gap: 6px; }
.cerca__riga input { flex: 1; }
.scelte { margin-top: 2.5rem; background: var(--paper-2); padding: 1.5rem; max-width: 68ch; }
.scelte h2 { font-size: var(--fs-l); line-height: 1; margin-bottom: 0.75rem; }
.scelte p + p { margin-top: 1rem; }

.rimando { display: grid; gap: 0.25rem; padding: 1rem 1.25rem; background: var(--paper-2); text-decoration: none; }
.rimando__titolo { font-weight: 700; }
.rimando__meta { font-size: var(--fs-s); color: var(--muted); }

/* ============ HOME: il verbale sopra un ufficio di Milano, 1963 ============ */
.hero { position: relative; }
.hero__room { position: absolute; inset: 0; overflow: clip; background: #4b4a44; }
.hero__room img { width: 100%; height: 100%; object-fit: cover; object-position: 38% 55%; filter: brightness(0.62); }
.hero__frame { position: relative; z-index: 2; min-height: 100svh; display: grid; place-items: center; padding: clamp(1rem, 5svh, 3.5rem) var(--margin); }
.verbale { position: relative; background: var(--paper); color: var(--ink); }
.hero .verbale { width: min(100%, 62rem); padding: clamp(1.25rem, 2.4vw, 2rem); }
.letterhead { font-family: var(--display); font-weight: 800; font-size: var(--fs-h); line-height: 0.88; letter-spacing: -0.005em; text-transform: uppercase; }
.letterhead .w { display: inline-block; overflow: clip; overflow-clip-margin: 0.12em; vertical-align: top; }
.letterhead .w > span { display: inline-block; }
.letterhead__nav { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin-top: 0.5rem; }
.letterhead__nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: underline; text-decoration-thickness: 0.08em;
  text-underline-offset: 0.25em; text-decoration-color: transparent; transition: text-decoration-color var(--t-hover) ease;
}
@media (hover: hover) and (pointer: fine) { .letterhead__nav a:hover { text-decoration-color: currentColor; } }

.verbale__intro { display: grid; grid-template-columns: 5fr 7fr; gap: 1rem 2rem; align-items: start; margin-top: 1rem; }
.facts { font-family: var(--display); font-weight: 800; font-size: var(--fs-l); line-height: 1; text-transform: uppercase; }
.facts > span > span { display: block; }
.facts > span > span + span { margin-top: 0.2em; }
.verbale__lead { font-weight: 500; max-width: 36ch; }

.compito { border: 0; margin: 1.5rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1.5rem; min-inline-size: 0; }
.compito legend { padding: 0; margin-bottom: 0.375rem; font-weight: 700; }
.compito label { position: relative; display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; line-height: 1.25; cursor: pointer; }
.compito input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.box { position: relative; flex: 0 0 1.5rem; width: 1.5rem; height: 1.5rem; border: 2px solid var(--ink); background: var(--paper); transition: background-color var(--t-hover) ease, transform var(--t-press) var(--ease-out); }
.box::before, .box::after {
  content: ''; position: absolute; left: 50%; top: 50%; width: 1.6rem; height: 0.2rem; background: var(--accent); border-radius: 0.1rem; opacity: 0;
  transform: translate(-50%, -50%) rotate(45deg) scaleX(0.4); transition: opacity var(--t-ui) ease, transform var(--t-ui) var(--ease-out);
}
.box::after { transform: translate(-50%, -50%) rotate(-45deg) scaleX(0.4); }
.compito input:checked + .box::before { opacity: 1; transform: translate(-50%, -50%) rotate(45deg) scaleX(1); }
.compito input:checked + .box::after { opacity: 1; transform: translate(-50%, -50%) rotate(-45deg) scaleX(1); transition-delay: 70ms; }
.compito input:focus-visible + .box { outline: 3px solid var(--accent); outline-offset: 2px; }
.compito label:active .box { transform: scale(0.92); }
@media (hover: hover) and (pointer: fine) { .compito label:hover .box { background: var(--paper-3); } }

.esiti { margin-top: 1rem; }
.esito { grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 1rem 1.5rem; background: var(--paper-2); padding: 1rem 1.25rem; }
.esito dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem 1.5rem; }
.esito dd { font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.esito .timbro--vuoto { min-width: 8.5rem; }

/* la cosa viva senza script: un radio per lavoro, le regole :has sono generate nella vista (partials/compito.php) */
.facts > [data-job] { display: none; --on: block; }
.esito { display: none; --on: grid; }
.verbale__action .button { display: none; --on: inline-flex; }
.facts > .is-def, .esito.is-def, .verbale__action .button.is-def { display: var(--on); }

.verbale__foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin-top: 1.25rem; }
.verbale__protocol { justify-self: end; }

/* le macchine d'ufficio */
.tavole {
  width: var(--wrap); margin: var(--section) auto 0;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 3rem; align-items: start;
}
.tavole__frase { grid-column: 1 / 6; align-self: end; font-family: var(--text); text-transform: none; font-size: var(--fs-l); font-weight: 600; line-height: 1.3; letter-spacing: 0; max-width: 24ch; }
.plate { overflow: clip; }
.plate img, .plate video { width: 100%; object-fit: cover; background: #4b4a44; }
.plate figcaption { margin-top: 0.75rem; font-size: var(--fs-s); color: var(--on-desk-soft); max-width: 40ch; }
.plate--a { grid-column: 6 / 13; }
.plate--a video { aspect-ratio: 4 / 3; }
.plate--b { grid-column: 1 / 4; }
.plate--b img { aspect-ratio: 4 / 5; }
.plate--c { grid-column: 4 / 10; margin-top: 4rem; }
.plate--c img { aspect-ratio: 3 / 2; }
.plate--d { grid-column: 10 / 13; }
.plate--d img { aspect-ratio: 4 / 5; }

/* il registro dei collaudi */
.registro { width: var(--wrap); margin: var(--section) auto 0; }
.registro__sheet { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 2rem; padding: var(--pad); align-items: start; }
.registro__testa { grid-column: 1 / 7; container-type: inline-size; display: grid; gap: 1.5rem; }
.registro__lead { max-width: 46ch; }
.registro__corpo { grid-column: 7 / 13; }
.registro__sotto { font-family: var(--display); font-weight: 800; font-size: var(--fs-l); line-height: 1; text-transform: uppercase; margin-bottom: 1rem; }
.bar { background: var(--paper-2); margin-top: 6px; }
.bar summary { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.5rem; padding: 0.5rem 1.125rem; font-weight: 600; cursor: pointer; list-style: none; transition: background-color var(--t-hover) ease; }
.bar summary::-webkit-details-marker { display: none; }
@media (hover: hover) and (pointer: fine) { .bar summary:hover { background: var(--paper-3); } }
.bar__plus { position: relative; flex: 0 0 1rem; width: 1rem; height: 1rem; }
.bar__plus::before, .bar__plus::after { content: ''; position: absolute; left: 0; top: 50%; width: 100%; height: 3px; margin-top: -1.5px; background: var(--ink); transition: transform var(--t-ui) var(--ease-out); }
.bar__plus::after { transform: rotate(90deg); }
.bar[open] .bar__plus::after { transform: rotate(0deg); }
.bar__panel { padding: 0.25rem 1.125rem 1.25rem; }
.bar__dl { display: grid; gap: 0.625rem; margin-bottom: 0.75rem; }
.bar__dl dd { font-weight: 600; line-height: 1.35; }

/* il protocollo su modulo continuo */
.nastro { position: relative; margin-top: var(--section); background: var(--paper); color: var(--ink); padding: 3.5rem 0 4rem; }
.nastro::before, .nastro::after { content: ''; position: absolute; left: 0; right: 0; border-top: 10px dotted var(--desk); }
.nastro::before { top: 14px; }
.nastro::after { bottom: 14px; }
.nastro__head { width: var(--wrap); margin: 0 auto; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); align-items: end; }
.nastro__head h2 { grid-column: 1 / 8; }
.nastro__lead { grid-column: 8 / 13; max-width: 40ch; }
.nastro__row { width: var(--wrap); margin: 2.5rem auto 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem var(--gutter); }
.nastro__row li { display: flex; flex-direction: column; }
.nastro__row h3 { font-size: var(--fs-b); font-weight: 700; line-height: 1.3; }
.nastro__row p { margin-top: 0.375rem; }
.nastro__row img { margin-top: auto; padding-top: 1.5rem; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* i prezzi: il listino e il suo scontrino */
.conto { width: var(--wrap); margin: var(--section) auto 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 2.5rem; align-items: stretch; }
.conto__left { grid-column: 1 / 7; display: flex; flex-direction: column; justify-content: space-between; gap: 2.5rem; }
.conto__note { margin-top: 1.25rem; max-width: 46ch; color: var(--on-desk); }
.conto__total { container-type: inline-size; }
.conto__figure { color: var(--on-desk); font-variant-numeric: tabular-nums; }
.conto__caption { margin-top: 1.5rem; max-width: 40ch; color: var(--on-desk); }
.scontrino { grid-column: 8 / 13; align-self: start; width: 100%; max-width: 30rem; justify-self: end; }
.scontrino__paper { background: var(--paper); color: var(--ink); padding: 1.5rem 1.5rem 1rem; }
.scontrino__head { font-family: var(--display); font-weight: 800; font-size: var(--fs-l); line-height: 1; text-transform: uppercase; text-align: center; margin-bottom: 1rem; }
.scontrino table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.scontrino th, .scontrino td { padding: 0.25rem 0; font-weight: 400; text-align: left; vertical-align: baseline; }
.scontrino td { text-align: right; padding-left: 0.5rem; white-space: nowrap; }
.scontrino tbody th[scope="row"] span { display: flex; align-items: baseline; gap: 0.375rem; }
.scontrino tbody th[scope="row"] span::after { content: ''; flex: 1; border-bottom: 3px dotted var(--muted); transform: translateY(-0.25em); min-width: 1rem; }
.scontrino .group th { font-weight: 700; padding-top: 0.875rem; }
.scontrino tfoot th, .scontrino tfoot td { background: var(--ink); color: var(--paper); font-weight: 700; padding: 0.625rem 0.75rem; }
.scontrino tfoot tr { border-top: 0.75rem solid var(--paper); }
.scontrino__nota, .scontrino__vuoto { margin-top: 1rem; font-size: var(--fs-s); color: var(--muted); }
.scontrino__vuoto { font-size: var(--fs-b); color: var(--ink); }
.edge--zigzag { height: 14px; }

/* chi scrive: la lettera, la foto del banco e il tagliando */
.lettera { width: var(--wrap); margin: var(--section) auto 0; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 2rem; align-items: start; }
.lettera__sheet { grid-column: 1 / 8; padding: var(--pad); }
.lettera__sheet h2 { margin-bottom: 1.5rem; }
.lettera__sheet p { line-height: 1.6; max-width: 62ch; }
.lettera__sheet p + p { margin-top: 1.1em; }
.lettera__sign { font-style: italic; font-size: var(--fs-l); line-height: 1.2; padding-top: 0.5rem; }
.lettera__sign span { display: block; margin-top: 0.375rem; font-style: normal; font-size: var(--fs-s); color: var(--muted); }
.lettera__lato { grid-column: 9 / 13; display: grid; gap: 2rem; }
.lettera__lato .tavola figcaption { color: var(--on-desk-soft); }
.lettera__lato .tagliando { color: var(--ink); background: var(--paper); border-top-color: var(--desk); }
.lettera__lato .tagliando p:first-child { font-weight: 600; }

/* le regole: le avvertenze stampate su un foglio con l'angolo piegato */
.avvertenze { width: var(--wrap); margin: var(--section) auto 0; }
.avvertenze__sheet { position: relative; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 2rem; padding: var(--pad); clip-path: polygon(0 0, calc(100% - 4rem) 0, 100% 4rem, 100% 100%, 0 100%); }
.avvertenze__sheet::after { content: ''; position: absolute; top: 0; right: 0; width: 4rem; height: 4rem; background: var(--paper-3); clip-path: polygon(0 0, 0 100%, 100% 100%); }
.avvertenze__head { grid-column: 1 / 5; display: grid; gap: 1.25rem; align-content: start; }
.avvertenze__head > p { max-width: 30ch; }
.guide { display: grid; gap: 6px; }
.guide li > a, .guide li > span:first-child { display: block; padding: 0.75rem 1rem; background: var(--paper-2); font-weight: 600; line-height: 1.3; text-decoration: none; }
.guide li:has(.guide__stato) { background: var(--paper-2); padding-bottom: 0.625rem; }
.guide__stato { display: block; padding: 0 1rem; font-size: var(--fs-s); color: var(--muted); }
@media (hover: hover) and (pointer: fine) { .guide a:hover { background: var(--ink); color: var(--paper); } }
.avvertenze__text { grid-column: 6 / 13; columns: 2; column-gap: 3rem; }
.avvertenze__text p { break-inside: avoid; margin-bottom: 1.25rem; line-height: 1.6; }
.avvertenze__text b { font-weight: 650; }

/* ============ il retro del verbale ============ */
.retro { width: var(--wrap); margin: var(--section) auto 0; padding-bottom: var(--margin); }
.edge--scallop-up { height: 25px; }
.retro__panel { background: var(--paper); color: var(--ink); padding: 2.5rem var(--pad) 1.75rem; }
.retro__titolo { font-size: var(--fs-h); }
.retro__grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--gutter); row-gap: 2rem; margin-top: 2.5rem; align-items: start; }
.retro__msg { grid-column: 1 / 6; }
.retro__msg p + p { margin-top: 1rem; }
.retro__msg .firma { font-size: var(--fs-l); }
.retro__links { grid-column: 6 / 10; display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.retro__links ul { display: grid; gap: 0.25rem; align-content: start; }
.retro__links a, .retro__links .linklike { display: inline-flex; align-items: center; min-height: 2.25rem; text-decoration: underline; text-decoration-thickness: 0.06em; text-underline-offset: 0.2em; text-decoration-color: transparent; transition: text-decoration-color var(--t-hover) ease, color var(--t-hover) ease; }
@media (hover: hover) and (pointer: fine) { .retro__links a:hover, .retro__links .linklike:hover { text-decoration-color: currentColor; color: var(--accent); } }
.retro__bolli { grid-column: 10 / 13; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; justify-self: end; width: 100%; max-width: 19rem; }
.bollo { display: block; padding: 6px; background: var(--paper-2); border: 4px dotted var(--paper); transform: rotate(var(--r, 3deg)); }
.bollo img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.retro__editore { margin-top: 2.5rem; font-size: var(--fs-s); max-width: 72ch; }
.retro__crediti { margin-top: 0.75rem; font-size: var(--fs-s); color: var(--muted); line-height: 1.5; max-width: 72ch; }
.retro__crediti a { color: inherit; }

/* ============ tablet ============ */
@media (max-width: 1099px) {
  .verbale__lead { font-size: var(--fs-l); line-height: 1.3; }
  .foglio__sotto > div { grid-column: 1 / 9; }
  .foglio__sotto > .tavola { grid-column: 9 / 13; }
  .foglio__testo { grid-column: 1 / -1; }
  .foglio__lato { grid-column: 1 / -1; margin-top: 3rem; }
  .foglio__lato-in { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
  .foglio__lato .tavola img { aspect-ratio: 4 / 3; }
  .verbale--modulo, .modulo__legenda { grid-column: 1 / -1; }
  .tavole__frase { grid-column: 1 / -1; max-width: 30ch; }
  .plate--a { grid-column: 1 / -1; }
  .plate--b { grid-column: 1 / 6; }
  .plate--c { grid-column: 6 / 13; margin-top: 0; }
  .plate--d { grid-column: 1 / 6; }
  .registro__testa, .registro__corpo { grid-column: 1 / -1; }
  .nastro__head h2, .nastro__lead { grid-column: 1 / -1; }
  .nastro__lead { margin-top: 1rem; }
  .nastro__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .conto__left { grid-column: 1 / 7; }
  .scontrino { grid-column: 7 / 13; }
  .lettera__sheet { grid-column: 1 / -1; }
  .lettera__lato { grid-column: 1 / -1; grid-template-columns: 1fr 1fr; align-items: end; }
  .avvertenze__head, .avvertenze__text { grid-column: 1 / -1; }
  .retro__msg { grid-column: 1 / -1; }
  .retro__links { grid-column: 1 / 8; }
  .retro__bolli { grid-column: 8 / 13; }
}

/* ============ telefono: una composizione sua ============ */
@media (max-width: 720px) {
  .testata { padding-top: 0.75rem; }
  .testata__nav { gap: 0 1.1rem; }
  .foglio__sotto { margin-top: 1.25rem; }
  .foglio__sotto > div, .foglio__sotto > .tavola { grid-column: 1 / -1; }
  .foglio__sotto > .tavola { width: min(100%, 20rem); }
  .foglio__sotto > .tavola img { aspect-ratio: 4 / 3; }
  .foglio__lato-in { grid-template-columns: 1fr; }
  .scheda__dl, .esito dl { grid-template-columns: 1fr; }
  .registro-righe a:has(.timbro--piccolo) .registro-righe__titolo { padding-right: 0; }
  .listino, .listino tbody { display: block; }
  .listino caption { display: block; }
  .listino thead { display: none; }
  .listino tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; row-gap: 0.25rem; padding: 0.875rem 1rem; }
  .listino th, .listino td { padding: 0; }
  .listino__gruppo { padding: 1.5rem 0 0.5rem !important; }
  .listino__gruppo th { padding: 0 !important; grid-column: 1 / -1; }
  .listino__euro { text-align: right; }
  .listino__euro span { min-width: 0; max-width: 11rem; margin-left: auto; }
  .listino td:nth-child(3), .listino td:nth-child(4) { grid-column: 1 / -1; }
  .registro-righe .timbro--piccolo { position: static; justify-self: start; margin-top: 0.5rem; }

  .hero__frame { padding-top: 1rem; padding-bottom: 2rem; }
  .letterhead__nav .only-wide { display: none; }
  .verbale__corpo { display: flex; flex-direction: column; }
  .verbale__intro { grid-template-columns: 1fr; gap: 0.75rem; }
  .esiti { order: 3; }
  .verbale__foot { order: 4; grid-template-columns: 1fr; gap: 0.75rem; }
  .compito { order: 5; grid-template-columns: 1fr; margin-top: 1.5rem; }
  .esito { grid-template-columns: 1fr; padding: 0.875rem 1rem; gap: 0.75rem; }
  .esito .timbro { grid-row: 1; justify-self: start; margin: 0.25rem 0 0.25rem 0.25rem; }
  .verbale__action { order: -1; }
  .verbale__action .button { width: 100%; }
  .verbale__protocol { justify-self: start; }

  .tavole { row-gap: 2.25rem; }
  .plate--b, .plate--c, .plate--d { grid-column: 1 / -1; }
  .plate--b img, .plate--d img { aspect-ratio: 4 / 3; }
  .nastro { padding: 3rem 0 3.5rem; }
  .nastro__row { grid-template-columns: 1fr; }
  .nastro__row img { aspect-ratio: 4 / 3; }
  .conto { display: block; }
  .conto__left { display: block; }
  .conto__total { margin-top: 2.5rem; }
  .conto__left > p:last-child { margin-top: 2rem; }
  .scontrino { margin-top: 2.5rem; max-width: none; }
  .lettera__lato { grid-template-columns: 1fr; }
  .lettera__lato .tavola img { aspect-ratio: 4 / 3; }
  .avvertenze__text { columns: 1; }
  .avvertenze__sheet { clip-path: polygon(0 0, calc(100% - 2.5rem) 0, 100% 2.5rem, 100% 100%, 0 100%); }
  .avvertenze__sheet::after { width: 2.5rem; height: 2.5rem; }
  .retro__links { grid-column: 1 / -1; grid-template-columns: 1fr; gap: 0.25rem; }
  .retro__bolli { grid-column: 1 / -1; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: none; justify-self: stretch; }
  .edge--scallop-up { height: 16px; }
}

/* ============ movimento: entrate una volta sola, solo transform e opacity ============ */
@media (prefers-reduced-motion: no-preference) {
  /* all'apertura: le tre parole salgono dalla loro riga, poi i fatti, il timbro cade, il pulsante entra */
  .js .letterhead .w > span { transform: translateY(105%); animation: load-line 900ms var(--ease-expo) forwards; animation-delay: calc(100ms + var(--i) * 90ms); }
  .js [data-load] { opacity: 0; transform: translateY(12px); animation: load-rise 600ms var(--ease-out) forwards; animation-delay: var(--d, 300ms); }
  .js .esito.is-def .timbro:not(.timbro--vuoto), .js .scheda .timbro[data-load] { animation: stamp-down 520ms var(--ease-out) both; animation-delay: 560ms; }
  .js .esito.is-def .timbro[data-verdetto="bocciato"] { animation-name: stamp-down-b; }
  .js .hero__room img { animation: room-settle 1600ms var(--ease-soft) both; }
  .timbro.is-stamped { animation: stamp-down 420ms var(--ease-out) both !important; animation-delay: 0ms !important; }
  .timbro[data-verdetto="bocciato"].is-stamped { animation-name: stamp-down-b !important; }

  /* entrate: lo stato nascosto lo mette lo script solo un attimo prima che l'elemento arrivi (armed) */
  .js .armed { opacity: 0; transform: translateY(24px); }
  .js [data-reveal] { transition: opacity 700ms var(--ease-out), transform 900ms var(--ease-expo); transition-delay: calc(var(--i, 0) * 70ms); }
  .js .plate.armed img, .js .plate.armed video { transform: scale(1.05); }
  .js .plate img, .js .plate video { transition: transform 1600ms var(--ease-soft); }
}
@media (prefers-reduced-motion: no-preference) {
  /* pagine interne: la testata del foglio arriva in ordine, poi le parti del testo entrano una volta sola */
  .js .foglio__testa .crumbs, .js .foglio__testa h1, .js .foglio__testa .lead, .js .foglio__testa .foglio__fatti, .js .foglio__testa .firma-riga, .js .foglio__testa .tavola, .js .foglio__testa .cerca {
    opacity: 0; transform: translateY(12px); animation: load-rise 600ms var(--ease-out) forwards; animation-delay: 60ms;
  }
  .js .foglio__testa h1 { animation-delay: 120ms; }
  .js .foglio__testa .lead, .js .foglio__testa .cerca { animation-delay: 220ms; }
  .js .foglio__testa .foglio__fatti, .js .foglio__testa .firma-riga { animation-delay: 300ms; }
  .js .foglio__testa .tavola { animation-delay: 340ms; }
}
@keyframes load-line { to { transform: none; } }
@keyframes load-rise { to { opacity: 1; transform: none; } }
@keyframes stamp-down { from { opacity: 0; transform: rotate(-7deg) scale(1.5); } 60% { opacity: 1; } to { opacity: 1; transform: rotate(-7deg) scale(1); } }
@keyframes stamp-down-b { from { opacity: 0; transform: rotate(5deg) scale(1.5); } 60% { opacity: 1; } to { opacity: 1; transform: rotate(5deg) scale(1); } }
@keyframes room-settle { from { transform: scale(1.06); } to { transform: none; } }

@media print {
  body { background: #fff; color: #000; }
  .testata__nav, .retro__bolli, .hero__room, .tavole, .skip { display: none !important; }
  main > .foglio, .retro__panel { width: auto; padding: 0; }
}
