/* LeggiP7M – "Vignelli, carta da ufficio" */
@font-face { font-family: 'Bodoni Moda'; src: url('/assets/fonts/bodoni-moda-latin-wght-normal.woff2') format('woff2'); font-weight: 400 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Bodoni Moda'; src: url('/assets/fonts/bodoni-moda-latin-wght-italic.woff2') format('woff2'); font-weight: 400 900; font-style: italic; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/assets/fonts/ibm-plex-sans-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/assets/fonts/ibm-plex-sans-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/assets/fonts/ibm-plex-sans-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Plex'; src: url('/assets/fonts/ibm-plex-sans-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Plex Mono'; src: url('/assets/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  --paper: #ffffff;
  --sheet: #f4f5f6;
  --ink: #121417;
  --ink-2: #3d434b;
  --ink-3: #5c636c;
  --rule: #121417;
  --hair: #d6d9dd;
  --seal: #c8281e;
  --seal-dark: #9e1d15;
  --ok: #16794a;
  --ok-bg: #e7f3ec;
  --warn: #8a5300;
  --warn-bg: #fbf1e1;
  --bad: #b42318;
  --bad-bg: #fbeceb;
  --display: 'Bodoni Moda', 'Didot', 'Bodoni 72', Georgia, serif;
  --sans: 'Plex', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Plex Mono', ui-monospace, Menlo, monospace;
  --wrap: 1200px;
  --gut: clamp(20px, 4vw, 48px);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--sans); }
img, svg, canvas { max-width: 100%; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--seal-dark); }
:focus-visible { outline: 3px solid var(--seal); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(38px, 5.6vw, 72px); font-weight: 600; }
h2 { font-size: clamp(28px, 3.4vw, 42px); }
h3 { font-size: 22px; line-height: 1.25; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 14px; z-index: 50; }
.skip:focus { left: 8px; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--ink-3); }

/* ---------- testata ---------- */
.top { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--hair); }
.top .wrap { display: flex; align-items: center; gap: 28px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 600 21px/1 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand b { font-weight: 800; }
.nav { display: flex; gap: 22px; margin-left: auto; align-items: center; }
.nav a { text-decoration: none; font-size: 15px; color: var(--ink-2); padding: 12px 0; }
.nav a:hover, .nav a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.nav .btn { padding: 0 18px; color: #fff; box-shadow: none; }
.menu-btn { display: none; margin-left: auto; min-width: 44px; height: 44px; border: 1px solid var(--hair); background: #fff; border-radius: 6px; font: 500 15px var(--sans); color: var(--ink); padding: 0 14px; }

/* ---------- bottoni ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: 6px; border: 1.5px solid var(--ink); background: var(--ink); color: #fff; font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s, color .15s; }
.btn:hover { background: #2a2f36; color: #fff; }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.ghost:hover { background: var(--sheet); color: var(--ink); }
.btn.small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .lock { width: 15px; height: 15px; }
.linkbtn { background: none; border: 0; padding: 10px 0; min-height: 44px; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- prima schermata ---------- */
.hero { padding: clamp(40px, 6vw, 84px) 0 clamp(48px, 6vw, 80px); }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.hero h1 em { font-style: italic; font-weight: 500; }
.lede { font-size: clamp(17px, 1.6vw, 19px); color: var(--ink-2); max-width: 34em; }
.facts { list-style: none; padding: 0; margin: 28px 0 0; border-top: 2px solid var(--rule); }
.facts li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--hair); font-size: 15.5px; }
.facts svg { width: 20px; height: 20px; margin-top: 2px; color: var(--ink); }
.crumbs { font-size: 14px; color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { color: var(--ink-3); }

/* busta: zona di caricamento */
.drop { position: relative; display: block; background: var(--sheet); border-radius: 4px; padding: 14px; }
.drop-sheet { position: relative; background: #fff; border: 1px solid var(--hair); box-shadow: 0 1px 0 var(--hair), 0 18px 40px -24px rgba(18, 20, 23, .35); min-height: 380px; padding: 34px 34px 30px; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.drop-sheet::before { content: ''; position: absolute; top: 0; right: 0; width: 46px; height: 46px; background: linear-gradient(225deg, var(--sheet) 50%, #e3e6e9 50%); }
.drop.over .drop-sheet { transform: translateY(-3px); box-shadow: 0 1px 0 var(--hair), 0 26px 50px -22px rgba(18, 20, 23, .45); outline: 2px dashed var(--ink); outline-offset: -12px; }
.drop-lines { display: grid; gap: 10px; margin-bottom: 26px; }
.drop-lines i { display: block; height: 7px; background: #e8eaed; border-radius: 2px; }
.drop-lines i:nth-child(1) { width: 46%; height: 11px; background: #d9dce0; }
.drop-lines i:nth-child(3) { width: 88%; }
.drop-lines i:nth-child(4) { width: 72%; }
.drop-title { font: 600 26px/1.15 var(--display); margin: 0 0 6px; }
.drop-text { color: var(--ink-2); margin: 0 0 22px; font-size: 15.5px; }
.drop-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: auto; padding-right: 96px; }
.drop-note { font-size: 14px; color: var(--ink-3); margin: 14px 0 0; padding-right: 96px; }
.seal { position: absolute; right: 26px; bottom: 26px; width: 92px; height: 92px; border-radius: 50%; background: radial-gradient(circle at 38% 34%, #e0473c 0, var(--seal) 46%, var(--seal-dark) 100%); color: #fff; display: grid; place-items: center; font: italic 600 22px/1 var(--display); box-shadow: 0 3px 0 rgba(0, 0, 0, .12), inset 0 0 0 6px rgba(255, 255, 255, .08); transform: rotate(-8deg); }
.seal::after { content: ''; position: absolute; inset: 9px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .45); }
.seal span { position: relative; }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.drop-error { margin: 14px 0 0; padding: 12px 14px; background: var(--bad-bg); color: var(--bad); border-left: 3px solid var(--bad); font-size: 15px; }
.drop-busy { display: none; align-items: center; gap: 10px; font-size: 15px; color: var(--ink-2); margin-top: 14px; }
.drop.busy .drop-busy { display: flex; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--hair); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- sezioni ---------- */
.band { padding: clamp(48px, 7vw, 96px) 0; }
.band.alt { background: var(--sheet); }
.section-head { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 4vw, 64px); border-top: 2px solid var(--rule); padding-top: 22px; margin-bottom: 36px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--ink-2); font-size: 17px; max-width: 40em; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 1px solid var(--hair); }
.steps li { padding: 24px 28px 8px 0; border-right: 1px solid var(--hair); margin-right: 28px; }
.steps li:last-child { border-right: 0; margin-right: 0; }
.steps .n { font: italic 600 44px/1 var(--display); color: var(--seal); display: block; margin-bottom: 12px; }
.steps h3 { font-size: 21px; }
.steps p { color: var(--ink-2); font-size: 15.5px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 4vw, 64px); }
.feature { border-top: 1px solid var(--hair); padding: 22px 0 10px; display: grid; grid-template-columns: 40px 1fr; gap: 14px; }
.feature svg { width: 28px; height: 28px; }
.feature h3 { font-size: 20px; margin-bottom: 6px; }
.feature p { color: var(--ink-2); font-size: 15.5px; }

/* esempio firma (illustrazione con dati di esempio) */
.specimen { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.specimen-note { font-size: 14px; color: var(--ink-3); margin-top: 10px; }

/* ---------- prezzi ---------- */
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--rule); }
.plan { padding: 26px 24px 28px 0; display: flex; flex-direction: column; border-right: 1px solid var(--hair); margin-right: 24px; }
.plan:last-child { border-right: 0; margin-right: 0; }
.plan h3 { font-size: 22px; margin-bottom: 4px; }
.plan .price { font: 600 44px/1 var(--display); margin: 14px 0 4px; }
.plan .per { color: var(--ink-3); font-size: 14.5px; min-height: 44px; }
.plan ul { padding: 0; list-style: none; margin: 16px 0 22px; font-size: 15px; }
.plan li { padding: 7px 0 7px 22px; border-top: 1px solid var(--hair); position: relative; }
.plan li::before { content: ''; position: absolute; left: 2px; top: 15px; width: 9px; height: 5px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.plan .btn { margin-top: auto; }
.plan.best .price { color: var(--seal); }
.plan .tag { display: inline-block; font-size: 13px; font-weight: 600; color: var(--seal-dark); margin-bottom: 6px; }
.fine { font-size: 14px; color: var(--ink-3); margin-top: 22px; }

/* ---------- FAQ ---------- */
.faq { border-top: 2px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--hair); }
.faq summary { cursor: pointer; list-style: none; padding: 18px 44px 18px 0; position: relative; font: 600 19px/1.35 var(--sans); min-height: 44px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 10px; top: 26px; width: 10px; height: 10px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(225deg); top: 30px; }
.faq .a { padding: 0 0 18px; color: var(--ink-2); max-width: 46em; }

/* ---------- testi lunghi (guide, legale) ---------- */
.prose { max-width: 46em; }
.prose h2 { font-size: clamp(26px, 3vw, 34px); margin-top: 1.6em; padding-top: 18px; border-top: 2px solid var(--rule); }
.prose h3 { margin-top: 1.4em; }
.prose ol, .prose ul { padding-left: 1.3em; }
.prose li { margin-bottom: .5em; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 1em 0 1.4em; }
.prose th, .prose td { text-align: left; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--hair); vertical-align: top; }
.prose th { border-bottom: 2px solid var(--rule); }
.prose .box { background: var(--sheet); padding: 18px 20px; border-left: 3px solid var(--ink); margin: 1.2em 0; }
.page-head { padding: clamp(36px, 5vw, 64px) 0 12px; }
.page-head .lede { margin-top: 8px; }
.two-col { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.aside { position: sticky; top: 92px; border-top: 2px solid var(--rule); padding-top: 16px; font-size: 15px; }
.aside h3 { font-size: 18px; }
.aside ul { list-style: none; padding: 0; margin: 0; }
.aside li { border-bottom: 1px solid var(--hair); }
.aside li a { display: block; padding: 10px 0; text-decoration: none; }
.aside li a:hover { text-decoration: underline; }

/* ---------- piè di pagina ---------- */
.foot { border-top: 2px solid var(--rule); padding: 44px 0 56px; margin-top: 40px; font-size: 15px; }
.foot .cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot h3 { font: 600 15px/1.3 var(--sans); margin: 0 0 10px; }
.foot ul { list-style: none; padding: 0; margin: 0; }
.foot li a { display: inline-block; padding: 5px 0; text-decoration: none; color: var(--ink-2); }
.foot li a:hover { text-decoration: underline; color: var(--ink); }
.foot .small { color: var(--ink-3); font-size: 14px; margin-top: 28px; }

/* ---------- area di lavoro (file aperto) ---------- */
.ws { display: none; padding: 20px 0 64px; }
body.has-file .ws { display: block; }
body.has-file .when-empty { display: none; }
.ws-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; border-bottom: 2px solid var(--rule); padding: 8px 0 14px; margin-bottom: 20px; }
.ws-file { min-width: 0; flex: 1 1 320px; }
.ws-file h1 { font-size: clamp(24px, 2.6vw, 32px); margin: 0; overflow-wrap: anywhere; }
.ws-file p { margin: 4px 0 0; color: var(--ink-3); font-size: 14.5px; }
.ws-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ws-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 28px; align-items: start; }
.viewer { background: var(--sheet); border-radius: 4px; padding: 18px; min-height: 420px; }
.viewer .page { display: block; margin: 0 auto 16px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 8px 24px -16px rgba(0, 0, 0, .3); max-width: 100%; height: auto; }
.viewer .page-ph { margin: 0 auto 16px; background: #fff; display: grid; place-items: center; color: var(--ink-3); font-size: 14px; }
.viewer pre { margin: 0; background: #fff; padding: 18px; overflow: auto; font: 13.5px/1.55 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; max-height: 75vh; }
.viewer .img { display: block; margin: 0 auto; background: #fff; }
.viewer .other { background: #fff; padding: 28px; }
.viewer-tabs { display: flex; gap: 4px; margin: -4px 0 14px; flex-wrap: wrap; }
.viewer-tabs button { min-height: 40px; padding: 0 14px; border: 1px solid var(--hair); background: #fff; border-radius: 4px; font: 500 14.5px var(--sans); color: var(--ink-2); cursor: pointer; }
.viewer-tabs button[aria-selected=true] { background: var(--ink); border-color: var(--ink); color: #fff; }
.pages-info { font-size: 14px; color: var(--ink-3); margin: 0 0 12px; }

.side { display: grid; gap: 18px; }
.panel { border-top: 2px solid var(--rule); padding-top: 14px; }
.panel h2 { font-size: 24px; margin-bottom: 12px; }
.verdict { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 14px; border-radius: 4px; margin-bottom: 14px; }
.verdict svg { width: 28px; height: 28px; }
.verdict strong { display: block; font-size: 16.5px; line-height: 1.3; }
.verdict span { font-size: 14.5px; }
.verdict.ok { background: var(--ok-bg); color: var(--ok); }
.verdict.warn { background: var(--warn-bg); color: var(--warn); }
.verdict.bad { background: var(--bad-bg); color: var(--bad); }
.verdict span { color: var(--ink-2); }
.signer { border: 1px solid var(--hair); background: #fff; border-radius: 4px; padding: 16px; margin-bottom: 12px; position: relative; }
.signer-head { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; margin-bottom: 10px; }
.mini-seal { width: 48px; height: 48px; border-radius: 50%; background: var(--seal); color: #fff; display: grid; place-items: center; font: italic 600 17px/1 var(--display); }
.mini-seal.bad { background: var(--bad); }
.mini-seal.warn { background: var(--warn); }
.signer-name { font: 600 18px/1.25 var(--sans); overflow-wrap: anywhere; }
.signer-role { font-size: 14px; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 128px 1fr; gap: 6px 10px; margin: 0; font-size: 14.5px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.checks { list-style: none; padding: 0; margin: 12px 0 0; font-size: 14.5px; }
.checks li { display: grid; grid-template-columns: 20px 1fr; gap: 8px; padding: 6px 0; border-top: 1px solid var(--hair); }
.checks svg { width: 16px; height: 16px; margin-top: 3px; }
.checks .y { color: var(--ok); }
.checks .n { color: var(--bad); }
.checks .q { color: var(--warn); }
.more { margin-top: 10px; font-size: 14px; }
.more summary { cursor: pointer; min-height: 40px; display: flex; align-items: center; font-weight: 500; }
.more .kv { grid-template-columns: 118px 1fr; font-size: 13.5px; }
.layer-note { font-size: 14px; color: var(--ink-3); margin: 0 0 10px; }
.stamp { border: 1px solid var(--hair); border-left: 3px solid var(--ink); background: #fff; padding: 12px 14px; margin-bottom: 10px; font-size: 14.5px; }
.lockbox { background: var(--ink); color: #fff; border-radius: 4px; padding: 18px; }
.lockbox h3 { color: #fff; font-size: 20px; margin-bottom: 6px; }
.lockbox p { color: #d5d8dc; font-size: 15px; }
.lockbox .btn { background: #fff; color: var(--ink); border-color: #fff; width: 100%; }
.lockbox .btn:hover { background: var(--sheet); }
.lockbox .linkbtn { color: #fff; }
.okbox { background: var(--ok-bg); border-left: 3px solid var(--ok); padding: 12px 14px; font-size: 15px; margin-bottom: 14px; }
.privacy-line { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-3); }
.privacy-line svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }

/* elenco di più file */
.batch { display: none; }
body.has-batch .batch { display: block; }
body.has-batch .when-empty { display: none; }
.batch table { width: 100%; border-collapse: collapse; font-size: 15px; background: #fff; }
.batch th, .batch td { text-align: left; padding: 12px 12px 12px 0; border-bottom: 1px solid var(--hair); vertical-align: middle; }
.batch th { border-bottom: 2px solid var(--rule); font-weight: 600; }
.batch td.name { overflow-wrap: anywhere; }
.pill { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.pill.ok { background: var(--ok-bg); color: var(--ok); }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.bad { background: var(--bad-bg); color: var(--bad); }

/* ---------- finestra pagamento ---------- */
dialog.pay { border: 0; border-radius: 6px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 24px); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
dialog.pay::backdrop { background: rgba(18, 20, 23, .55); }
.pay-in { padding: 26px 26px 22px; }
.pay-in h2 { font-size: 30px; margin-bottom: 6px; }
.pay-in > p { color: var(--ink-2); font-size: 15.5px; }
.opts { display: grid; gap: 10px; margin: 18px 0 10px; }
.opt { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; align-items: center; padding: 14px 16px; border: 1.5px solid var(--hair); border-radius: 6px; text-decoration: none; color: var(--ink); min-height: 64px; }
.opt:hover { border-color: var(--ink); color: var(--ink); }
.opt strong { font-size: 16.5px; }
.opt span { font-size: 14px; color: var(--ink-3); grid-column: 1; }
.opt b { grid-row: 1 / span 2; grid-column: 2; font: 600 24px/1 var(--display); }
.opt.best { border-color: var(--ink); }
.pay-x { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--ink-2); }
.restore { border-top: 1px solid var(--hair); margin-top: 14px; padding-top: 12px; font-size: 14.5px; }
.restore form { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.restore input { flex: 1 1 200px; min-height: 44px; border: 1.5px solid var(--hair); border-radius: 6px; padding: 0 12px; font: 16px var(--sans); }
.restore-msg { margin-top: 8px; }

/* ---------- fattura ---------- */
.fattura { background: #fff; padding: clamp(18px, 3vw, 36px); font-size: 14.5px; line-height: 1.5; }
.fx-top { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.fx-party { border-top: 2px solid var(--rule); padding-top: 10px; }
.fx-party h3 { font: 500 13.5px/1.3 var(--sans); color: var(--ink-3); margin: 0 0 6px; }
.fx-party .fx-name { font: 600 18px/1.3 var(--sans); margin-bottom: 4px; }
.fx-party p { margin: 0; }
.fx-party dl, .fx-foot dl, .fx-totals dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 12px; margin: 8px 0 0; }
.fx-party dt, .fx-foot dt { color: var(--ink-3); }
.fx-party dd, .fx-foot dd { margin: 0; overflow-wrap: anywhere; }
.fx-doc { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; border: 1px solid var(--hair); margin: 8px 0 14px; }
.fx-doc > div { padding: 10px 12px; border-right: 1px solid var(--hair); }
.fx-doc > div:last-child { border-right: 0; }
.fx-k { display: block; font-size: 13px; color: var(--ink-3); }
.fx-doc strong { font-size: 15.5px; }
.fx-code { font: 12.5px var(--mono); color: var(--ink-3); }
.fx-causale, .fx-refs { margin: 0 0 12px; }
.fx-causale .fx-k, .fx-refs .fx-k { display: inline; margin-right: 6px; }
.fx-scroll { overflow-x: auto; margin-bottom: 14px; }
.fattura table { width: 100%; border-collapse: collapse; min-width: 520px; }
.fattura th { text-align: left; font-weight: 600; font-size: 13.5px; border-bottom: 2px solid var(--rule); padding: 8px 8px 8px 0; }
.fattura td { border-bottom: 1px solid var(--hair); padding: 8px 8px 8px 0; vertical-align: top; }
.fattura .r { text-align: right; white-space: nowrap; }
.fx-sub { display: block; color: var(--ink-3); font-size: 13px; }
.fx-sub-inline { color: var(--ink-3); font: 400 14px var(--sans); }
.fx-h { font: 600 17px/1.3 var(--sans); margin: 18px 0 8px; }
.fx-totals { display: flex; justify-content: flex-end; margin: 6px 0 14px; }
.fx-totals dl { min-width: 280px; column-gap: 0; }
.fx-totals dt, .fx-totals dd { padding: 3px 0; }
.fx-totals dt { padding-right: 24px; }
.fx-totals dd { margin: 0; text-align: right; }
.fx-grand { font-weight: 600; font-size: 17px; border-top: 2px solid var(--rule); padding-top: 6px; }
.fx-mono { font-family: var(--mono); font-size: 13px; }
.fx-att { padding: 0; list-style: none; }
.fx-att li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--hair); }
.fx-att-btn { margin-left: auto; min-height: 40px; padding: 0 14px; border: 1.5px solid var(--ink); background: #fff; border-radius: 6px; font: 500 14px var(--sans); cursor: pointer; }
.fx-foot { margin-top: 18px; border-top: 1px solid var(--hair); padding-top: 8px; font-size: 13.5px; }
.fx-sep { border: 0; border-top: 2px dashed var(--hair); margin: 28px 0; }
.fx-bodyhead { font-size: 22px; }

/* ---------- risposte ---------- */
@media (max-width: 1020px) {
  .hero .wrap { grid-template-columns: minmax(0, 1fr); }
  .ws-grid { grid-template-columns: minmax(0, 1fr); }
  .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan:nth-child(2) { border-right: 0; margin-right: 0; }
  .plan:nth-child(3), .plan:nth-child(4) { border-top: 1px solid var(--hair); }
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .foot .cols { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--gut) 16px; border-bottom: 2px solid var(--rule); }
  .nav.open { display: flex; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--hair); }
  .nav a:hover, .nav a[aria-current] { box-shadow: none; }
  .nav .btn { margin-top: 12px; border-bottom: 0; }
  .menu-btn { display: inline-flex; align-items: center; }
  .section-head { grid-template-columns: 1fr; gap: 10px; }
  .steps { grid-template-columns: 1fr; }
  .steps li { border-right: 0; margin-right: 0; border-bottom: 1px solid var(--hair); padding-right: 0; }
  .grid2, .specimen { grid-template-columns: minmax(0, 1fr); }
  .fx-top { grid-template-columns: 1fr; }
  .fx-doc { grid-template-columns: 1fr 1fr; }
  .fx-doc > div:nth-child(2) { border-right: 0; }
  .fx-doc > div:nth-child(n+3) { border-top: 1px solid var(--hair); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .top .wrap { height: 60px; }
  .nav { top: 60px; }
  .brand { font-size: 19px; }
  .drop { padding: 8px; }
  .drop-sheet { padding: 24px 20px 22px; min-height: 0; }
  .drop-actions, .drop-note { padding-right: 0; }
  .drop-actions .btn { width: 100%; }
  .seal { width: 64px; height: 64px; font-size: 16px; right: 16px; top: 18px; bottom: auto; }
  .drop-lines { margin-right: 72px; }
  .plans { grid-template-columns: 1fr; }
  .plan { border-right: 0; margin-right: 0; padding-right: 0; border-bottom: 1px solid var(--hair); }
  .plan:nth-child(n+2) { border-top: 0; }
  .foot .cols { grid-template-columns: 1fr; }
  .viewer { padding: 8px; margin: 0 calc(var(--gut) * -1); border-radius: 0; }
  .kv { grid-template-columns: 112px 1fr; }
  .ws-actions { width: 100%; }
  .ws-actions .btn { flex: 1 1 auto; }
  .batch thead { display: none; }
  .batch tr { display: grid; grid-template-columns: 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--hair); }
  .batch td { border: 0; padding: 2px 0; }
  .fx-totals dl { min-width: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- stampa: fattura o rapporto, solo se sbloccati ---------- */
.print-only, .print-lock { display: none; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 11pt; }
  .top, .foot, .when-empty, .ws-bar, .side, .viewer-tabs, .band, .hero, .batch, .no-print, dialog { display: none !important; }
  .ws { display: block !important; padding: 0; }
  .ws-grid { display: block; }
  .viewer { background: none; padding: 0; }
  .fattura { padding: 0; }
  .fx-att-btn { display: none; }
  .fattura table { min-width: 0; }
  body.print-report .viewer { display: none; }
  body.print-report .side, body.print-report .report-print { display: block !important; }
  body.print-report .lockbox, body.print-report .side .btn, body.print-report .more summary { display: none !important; }
  body.print-report .more:not([open]) > *:not(summary) { display: block; }
  body:not(.may-print) .ws { display: none !important; }
  body:not(.may-print) .print-lock { display: block !important; font-size: 14pt; padding: 40mm 10mm; text-align: center; }
  .print-only { display: block !important; }
}

/* telefono: prima il riquadro, poi i punti di forza; esito della firma in alto */
.ws-sum { display: none; }
@media (max-width: 1020px) {
  .hero .wrap > div:first-child { display: contents; }
  .hero .crumbs { order: 0; }
  .hero h1 { order: 1; }
  .hero .lede { order: 2; margin-bottom: 0; }
  .hero .drop { order: 3; }
  .hero .facts { order: 4; margin-top: 0; }
  .hero .wrap { gap: 22px; }
  .ws-sum { display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 4px; font-size: 15px; text-decoration: none; min-height: 44px; }
  .ws-sum svg { width: 22px; height: 22px; flex: none; }
  .ws-sum.ok { background: var(--ok-bg); color: var(--ok); }
  .ws-sum.warn { background: var(--warn-bg); color: var(--warn); }
  .ws-sum.bad { background: var(--bad-bg); color: var(--bad); }
  .ws-sum span { color: var(--ink); }
}
