:root {
    --navy: #002147;
    --navy-2: #0a2e5c;
    --gold: #D4AF37;
    --slate: #334155;
    --muted: #64748b;
    --border: #e2e8f0;
    --light: #f8fafc;
    --green: #16a34a;
    --amber: #d97706;
    --red: #dc2626;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: #e6eaf1;
    color: var(--slate);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── topbar (logo a sx → home, titolo al centro, azioni a dx) ── */
.topbar {
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
    background: var(--navy);
    padding: 14px 24px;
    color: #fff;
}
.topbar .logo { justify-self: start; font-size: 1.1rem; font-weight: 900; color: #fff; letter-spacing: -0.5px; text-decoration: none; white-space: nowrap; }
.topbar .logo span { color: var(--gold); }
.topbar .brand { font-weight: 800; font-size: 1.05rem; letter-spacing: -0.3px; }
.topbar .brand em { color: var(--gold); font-style: normal; }
.topbar-title { justify-self: center; margin: 0; }
.topbar-right { justify-self: end; display: flex; align-items: center; gap: 16px; }
.topbar .btn-back { text-decoration: none; white-space: nowrap; }
.topbar .btn-link { background: none; border: none; font-family: inherit; color: #cbd5e1; font-size: 0.85rem; font-weight: 600; cursor: pointer; text-decoration: none; }
.topbar .btn-link:hover { color: var(--gold); }

main { width: 100%; margin: 0; padding: 40px 24px 72px; flex: 1; display: flex; flex-direction: column; justify-content: center; }

/* ── connect view ── */
.connect { max-width: 720px; margin: 24px auto; text-align: center; background: #002147; border-radius: 16px; padding: 56px 44px; }
.connect h1 { font-size: 2rem; font-weight: 900; color: #fff; line-height: 1.2; letter-spacing: -0.5px; margin-bottom: 18px; }
.connect h1 em { color: var(--gold); font-style: normal; }
.connect p { font-size: 1.02rem; color: #cbd5e1; margin-bottom: 24px; }
.connect p strong { color: #fff; }
.connect .hint { font-size: 0.85rem; color: #94a3b8; margin-top: 16px; }

.btn-primary {
    background: var(--gold); color: var(--navy);
    border: none; border-radius: 10px;
    padding: 15px 30px;
    font-size: 0.95rem; font-weight: 800;
    cursor: pointer; transition: transform .15s, background .2s;
}
.btn-primary:hover:not(:disabled) { background: #fff; transform: translateY(-2px); }
.btn-primary:disabled { opacity: .6; cursor: default; }

.notice {
    background: #fef3c7; border: 1px solid #fcd34d; color: #92400e;
    border-radius: 8px; padding: 14px 18px; font-size: 0.9rem; margin-top: 20px;
}

/* ── app view ── */
.block { margin-bottom: 40px; }
.block h2 {
    font-size: 0.75rem; font-weight: 800; text-transform: uppercase;
    letter-spacing: 2px; color: var(--muted);
    padding-bottom: 10px; margin-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.empty { color: var(--muted); font-size: 0.92rem; padding: 8px 0; }

/* ── main a tab (stile S35 list.php) ── */
.detail-tab-nav { display: flex; gap: 3px; align-items: flex-end; border-bottom: 2px solid #002147; padding: 0 4px; }
.detail-tab-btn { padding: 8px 22px 10px; font-size: 12px; font-weight: 700; color: #64748b; background: #eef2f7; border: 1px solid #e2e8f0; border-bottom: 2px solid #002147; border-radius: 6px 6px 0 0; cursor: pointer; text-transform: uppercase; letter-spacing: 0.04em; position: relative; top: 2px; font-family: inherit; }
.detail-tab-btn:hover { background: #e2e8f0; color: #334155; }
.detail-tab-btn.active { color: #002147; background: #fff; border: 1px solid #002147; border-bottom: 3px solid #fff; font-weight: 800; }

.list-card { background: #fff; border: 1px solid #002147; border-radius: 0 10px 10px 10px; overflow: hidden; padding: 0; margin: 0; box-shadow: none; } /* padding/margin/ombra: annullano .list-card di site-new.css (25/10) */
.list-header { display: flex; align-items: center; gap: 14px; padding: 10px 16px; background: #002147; color: #f1f5f9; }
.list-header .lc-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; flex-shrink: 0; }
.list-header .folder-info { flex: 1; text-align: center; font-size: 0.82rem; font-weight: 700; color: var(--gold); }
.list-header .folder-info a { color: var(--gold); text-decoration: underline; font-weight: 800; }
.list-header .folder-info a:hover { color: #fff; }
.list-header .btn-new { flex-shrink: 0; }
.btn-new { background: var(--gold); color: #002147; font-weight: 800; font-size: 0.82rem; border: none; border-radius: 6px; padding: 7px 14px; cursor: pointer; font-family: inherit; transition: background .15s; }
.btn-new:hover { background: #fff; }
.list-body { padding: 16px; background: #fff; }

.s35-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; font-size: 13px; }
.s35-table thead { background: #1e3a5f; }
.s35-table th { text-align: left; padding: 7px 10px; font-size: 12px; font-weight: 600; color: #fff; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 2px solid #162d4a; border-right: 1px solid #2a4a72; }
.s35-table th:last-child { border-right: none; }
.s35-table td { padding: 7px 10px; border-bottom: 1px solid #e2e8f0; border-right: 1px solid #e2e8f0; color: #334155; }
.s35-table td:last-child { border-right: none; }
.s35-table tbody tr { transition: background .15s; cursor: pointer; }
.s35-table tbody tr:nth-child(even) { background: #f8fafc; }
.s35-table tbody tr:hover td { background: #eef2f7; }

.badge { display: inline-block; font-weight: 700; font-size: 11px; padding: 2px 9px; border-radius: 10px; background: #e2e8f0; color: #475569; border: 1px solid #cbd5e1; }
.badge-bozza { background: #f1f5f9; color: #64748b; border-color: #cbd5e1; }
.badge-attivo { background: #dcfce7; color: #15803d; border-color: #86efac; }
.badge-pianificato { background: #e0f2fe; color: #0369a1; border-color: #7dd3fc; }
.badge-in_corso { background: #fef9c3; color: #a16207; border-color: #fde68a; }
.badge-completato { background: #dcfce7; color: #15803d; border-color: #86efac; }
.badge-annullato { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.badge-ok { background: #dcfce7; color: #15803d; border-color: #86efac; }
.badge-ko { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }

.picker { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.picker-title { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: 12px; }

.audit-row {
    display: grid; grid-template-columns: 100px 1fr 150px 110px 90px; gap: 12px;
    align-items: center;
    background: #fff; border: 1px solid var(--border); border-radius: 8px;
    padding: 12px 16px; margin-bottom: 8px; font-size: 0.9rem;
}
.audit-row .ar-nome { font-weight: 700; color: var(--navy); }

.ar-stato { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; text-align: center; }
.st-completato { background: #dcfce7; color: var(--green); border-radius: 20px; padding: 3px 10px; }
.st-in_corso   { background: #fef3c7; color: var(--amber); border-radius: 20px; padding: 3px 10px; }
.st-pianificato{ background: #e2e8f0; color: var(--muted); border-radius: 20px; padding: 3px 10px; }
.st-annullato  { background: #fee2e2; color: var(--red);   border-radius: 20px; padding: 3px 10px; }
.ar-esito { font-size: 0.74rem; font-weight: 700; text-align: center; }
.es-positivo { color: var(--green); }
.es-negativo { color: var(--red); }
.audit-row { cursor: pointer; transition: border-color .15s; }
.audit-row:hover { border-color: var(--gold); }

/* ── compila ── */
.compile-head { background: #002147; color: #fff; border-radius: 10px; padding: 14px 20px 16px; margin-bottom: 20px; }
.btn-print { font-family: inherit; font-size: 0.86rem; font-weight: 800; background: var(--gold); color: var(--navy); border: none; border-radius: 10px; padding: 10px 18px; cursor: pointer; white-space: nowrap; transition: background .15s, transform .15s; }
.btn-print:hover { background: #fff; transform: translateY(-1px); }
.btn-danger { font-family: inherit; font-size: 0.88rem; font-weight: 700; background: transparent; color: #fca5a5; border: 1.5px solid #fca5a5; border-radius: 10px; padding: 10px 18px; cursor: pointer; white-space: nowrap; transition: background .15s, color .15s; }
.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }

.compile-head-row { display: flex; align-items: center; gap: 16px; }
.btn-back { font-family: inherit; font-size: 0.8rem; font-weight: 800; background: #fff; color: var(--navy); border: none; border-radius: 8px; padding: 9px 16px; cursor: pointer; white-space: nowrap; transition: background .15s, transform .15s; }
.btn-back:hover { background: var(--gold); transform: translateY(-1px); }
.ch-title { flex: 1; text-align: center; font-size: 1.2rem; font-weight: 900; color: #fff; letter-spacing: -0.3px; }
@media (max-width: 560px) {
    .compile-head-row { flex-wrap: wrap; justify-content: center; }
    .ch-title { order: -1; flex-basis: 100%; }
}

.az-hint { color: var(--muted); font-size: 0.88rem; margin: 16px 0 20px; }
.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 14px; margin-bottom: 24px; }
/* Nome della checklist largo tre campi, accanto Tipo e le due date (25/10).
   Sotto i 700px tre colonne da 185px non ci stanno: torna largo un campo. */
.meta-grid .meta-wide { grid-column: span 3; }
@media (min-width: 701px) and (max-width: 1521px) {
    .meta-grid .meta-wide { grid-column: span 2; }
}
@media (max-width: 700px) {
    .meta-grid .meta-wide { grid-column: auto; }
}
.meta-grid label, .note-block { display: flex; flex-direction: column; gap: 5px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.meta-grid input, .meta-grid select, .note-block textarea {
    font-family: inherit; font-size: 0.92rem; font-weight: 400; text-transform: none; letter-spacing: 0;
    color: var(--slate); background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px;
}
.meta-grid input:focus, .note-block textarea:focus, .voce-nota:focus { outline: none; border-color: var(--gold); }
.meta-grid input[readonly] { background: var(--light); color: var(--muted); cursor: default; }
.note-block { margin: 20px 0 90px; }
.note-block textarea { resize: vertical; }

.voci-wrap { margin-bottom: 20px; border: 1px solid var(--border); border-radius: 10px; }
.voci-table { background: #fff; }
.vt-head, .vrow {
    display: grid;
    grid-template-columns: 34px 62px minmax(0, 2.6fr) 62px minmax(0, 1.7fr);
    gap: 12px; align-items: center; padding: 9px 16px;
}
.vt-head { background: var(--navy); color: #fff; font-size: 0.66rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; position: sticky; top: 0; z-index: 5; }
.vrow { border-top: 1px solid var(--border); font-size: 0.87rem; }
.vrow:nth-child(2n) { background: #fafbfc; }
.vrow:hover { background: var(--light); }
@media (max-width: 760px) {
    .voci-wrap { overflow-x: auto; }
    .voci-table { min-width: 640px; }
    .vt-head { position: static; }
}
.vrow.rated { box-shadow: inset 3px 0 0 var(--gold); }

/* ── editor schema: variante colonne (7) + input inline ── */
.voci-table.schema-cols .vt-head,
.voci-table.schema-cols .vrow {
    grid-template-columns: 28px 100px 120px minmax(0, 2.2fr) 130px 60px 28px;
}
.vrow-in { width: 100%; font-family: inherit; font-size: 0.84rem; color: var(--slate); border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; background: #fff; }
.vrow-in:focus { outline: none; border-color: var(--gold); }
.vc-obl { text-align: center; }
.vc-obl input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.btn-del-row { background: none; border: none; color: var(--muted); font-size: 1rem; cursor: pointer; line-height: 1; padding: 4px; }
.btn-del-row:hover { color: var(--red); }
.btn-add-row { display: block; width: 100%; background: var(--light); border: none; border-top: 1px solid var(--border); color: var(--navy); font-weight: 700; font-size: 0.82rem; font-family: inherit; padding: 10px; cursor: pointer; }
.btn-add-row:hover { background: #eef2f6; }
.vc-num { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-align: right; }
.vc-req { font-weight: 800; color: var(--navy); font-size: 0.78rem; }
.vc-req .oblig { color: var(--red); font-style: normal; margin-left: 1px; }
.vc-dom { color: var(--slate); line-height: 1.45; }
.liv-select { width: 100%; font-family: inherit; font-size: 0.9rem; color: var(--slate); background: #fff; border: 1.5px solid var(--border); border-radius: 6px; padding: 7px 8px; cursor: pointer; }
.liv-select:focus, .voce-nota:focus { outline: none; border-color: var(--gold); }
.voce-nota { width: 100%; font-family: inherit; font-size: 0.84rem; color: var(--slate); border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; }

.foto-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.foto-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--light); border: 1px solid var(--border); border-radius: 6px; padding: 3px 6px; }
.foto-view { background: none; border: none; color: var(--navy); font-weight: 700; cursor: pointer; font-family: inherit; font-size: 0.76rem; padding: 0; }
.foto-view:hover { color: var(--gold); text-decoration: underline; }
.foto-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.78rem; padding: 0; line-height: 1; }
.foto-del:hover { color: var(--red); }
.foto-add { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border: 1.5px dashed var(--border); border-radius: 6px; cursor: pointer; font-size: 0.8rem; color: var(--muted); }
.foto-add:hover { border-color: var(--gold); color: var(--navy); }

.save-bar {
    position: sticky; bottom: 0;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    background: #fff; border-top: 2px solid var(--gold);
    padding: 14px 24px; margin: 0 -24px -72px;
    box-shadow: 0 -6px 20px rgba(0,33,71,.06);
}
#progress { font-size: 0.85rem; font-weight: 700; color: var(--muted); }
.save-actions { display: flex; align-items: center; gap: 12px; }
.btn-ghost { font-family: inherit; font-size: 0.9rem; font-weight: 700; background: #fff; color: var(--slate); border: 1.5px solid var(--border); border-radius: 10px; padding: 13px 22px; cursor: pointer; transition: border-color .15s; }
.btn-ghost:hover { border-color: var(--slate); }
.closed-badge { font-size: 0.85rem; font-weight: 700; color: var(--green); }
.save-status { font-size: 0.82rem; font-weight: 600; color: var(--muted); min-width: 150px; }

@media (max-width: 560px) {
    .connect h1 { font-size: 1.55rem; }
    .audit-row { grid-template-columns: 1fr; gap: 4px; }
    .meta-grid { grid-template-columns: 1fr; }
}

/* ── verbale (solo stampa, formato mutuato da S35 audit_verbale.php) ── */
.verbale { display: none; }
@media print {
    .topbar, main, .site-header, .site-footer { display: none !important; }
    /* footer del sito: fuori da <main>, quindi verrebbe stampato sopra il verbale.
       Nascosto solo durante la stampa del verbale (classe messa da printVerbale). */
    body.printing-verbale .tool-footer { display: none !important; }
    body { background: #fff; }
    .verbale { display: block; color: #1f2937; font-size: 11pt; font-family: 'Inter', Arial, sans-serif; }
    .verbale h1 { font-size: 20pt; margin: 0 0 2pt; }
    .verbale h2 { font-size: 13pt; margin: 20pt 0 8pt; border-bottom: 2px solid #002147; padding-bottom: 4pt; page-break-after: avoid; }
    .verbale .head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid #002147; padding-bottom: 10pt; }
    .verbale .az { font-size: 10pt; color: #6b7280; }
    .verbale .az-nome { font-weight: 700; color: #1f2937; font-size: 11pt; margin-bottom: 2pt; }
    .verbale .meta { display: grid; grid-template-columns: 1fr 1fr; gap: 4pt 20pt; margin-top: 10pt; font-size: 10pt; }
    .verbale .meta div { padding: 2pt 0; border-bottom: 1px solid #f0f0f0; }
    .verbale .meta b { color: #374151; display: inline-block; min-width: 110px; }
    .verbale .summary { display: flex; flex-wrap: wrap; gap: 8pt; margin: 6pt 0 4pt; }
    .verbale .chip { display: inline-flex; align-items: baseline; gap: 4pt; border: 1px solid #e5e7eb; border-radius: 6pt; padding: 3pt 10pt; font-size: 9.5pt; }
    .verbale .chip .n { font-size: 12pt; font-weight: 700; }
    .verbale .legenda { margin: 10pt 0 4pt; padding: 8pt 10pt; border: 1px solid #e5e7eb; border-radius: 4pt; background: #fafbfc; page-break-inside: avoid; }
    .verbale .legenda-t { font-size: 9.5pt; font-weight: 700; color: #374151; margin-bottom: 5pt; }
    .verbale .legenda-b { font-size: 8.5pt; line-height: 1.45; color: #4b5563; margin-bottom: 4pt; }
    .verbale .legenda-b b { color: #1f2937; display: block; }
    .verbale .legenda-nota { font-size: 8.5pt; line-height: 1.45; color: #4b5563; margin: 6pt 0 0; padding-top: 6pt; border-top: 1px solid #e5e7eb; }
    .verbale table.righe { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
    .verbale table.righe th { background: #f9fafb; text-align: left; padding: 5pt 6pt; border-bottom: 2px solid #e5e7eb; }
    .verbale table.righe td { padding: 6pt; border-bottom: 1px solid #eef0f2; vertical-align: top; }
    .verbale table.righe tr { page-break-inside: avoid; }
    .verbale .vb-num { text-align: center; color: #6b7280; font-weight: 600; }
    .verbale .req { font-weight: 700; margin-right: 4pt; }
    .verbale .nota { color: #1d4ed8; font-style: italic; }
    .verbale .vb-badge { display: inline-block; padding: 2pt 6pt; border-radius: 4pt; color: #fff; font-size: 9pt; }
    .verbale .vb-nc { color: #9ca3af; }
    .verbale .vb-note-text { font-size: 10pt; white-space: pre-wrap; margin-top: 4pt; }
    .verbale .foto-ref { color: #6b7280; font-size: 8.5pt; margin-top: 2pt; }
    .verbale .firme { display: flex; gap: 30pt; margin-top: 30pt; }
    .verbale .firme div { flex: 1; border-top: 1px solid #9ca3af; padding-top: 5pt; font-size: 9pt; color: #6b7280; }
    .verbale .foto-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8pt; margin-top: 10pt; }
    .verbale .foto-grid figure { margin: 0; break-inside: avoid; }
    .verbale .foto-grid img { width: 100%; height: 55mm; object-fit: cover; border: 1px solid #e5e7eb; border-radius: 3pt; display: block; }
    .verbale .foto-grid figcaption { font-size: 8pt; color: #6b7280; margin-top: 2pt; text-align: center; }
    .verbale .foto-page-break { page-break-after: always; }
    @page { margin: 1.5cm; }
}

/* ── quick-start: timeline verticale centrata (usata da index.php e guida.php) ── */
.qs-title { text-align: center; font-size: 1.6rem; font-weight: 900; color: var(--navy); letter-spacing: -0.02em; margin: 0 auto 22px; max-width: 620px; }
.qs-title .qs-title-ic { color: var(--gold); }
.qs-diagram { max-width: 620px; margin: 0 auto 40px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 26px 30px 20px; }
.qs-tl-row { display: grid; grid-template-columns: 34px 1fr; column-gap: 16px; }
.qs-tl-rail { position: relative; display: flex; justify-content: center; }
.qs-tl-rail::before { content: ''; position: absolute; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.qs-tl-row:last-child .qs-tl-rail::before { display: none; }
.qs-tl-dot { position: relative; z-index: 1; width: 34px; height: 34px; border-radius: 50%; background: var(--navy); display: flex; align-items: center; justify-content: center; font-size: 1.15rem; }
.qs-tl-content { padding-bottom: 22px; }
.qs-tl-content strong { display: block; color: var(--navy); font-size: 0.98rem; font-weight: 800; }
.qs-tl-content span { font-size: 0.82rem; color: var(--muted); }
.qs-tl-branch { margin: 8px 0 4px 2px; padding: 10px 14px; border: 1px dashed #b9c3d6; border-radius: 10px; background: var(--light); display: flex; align-items: center; gap: 10px; }
.qs-tl-branch .qs-tl-icon { font-size: 1.2rem; }
.qs-tl-branch strong { font-size: 0.86rem; }
.qs-tl-branch span { font-size: 0.76rem; }
.qs-tl-optional { display: inline-block; font-size: 0.6rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.4px; color: #7a5c0e; background: rgba(212,175,55,.18); border: 1px solid rgba(212,175,55,.4); border-radius: 20px; padding: 1px 8px; margin-left: 6px; vertical-align: 1px; }
.qs-guide-link { display: block; text-align: center; margin: -18px auto 40px; font-size: 0.88rem; font-weight: 700; color: var(--navy); text-decoration: none; }
.qs-guide-link:hover { color: var(--gold); text-decoration: underline; }

/* ── footer leggero — identità licalzi.com senza importare tutta la nav del sito ── */
.tool-footer { background: var(--navy); border-top: 1px solid rgba(212,175,55,.3); padding: 22px 24px; margin-top: 48px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.tool-footer-logo { font-size: 1rem; font-weight: 900; color: #fff; text-decoration: none; letter-spacing: -0.3px; }
.tool-footer-logo span { color: var(--gold); }
.tool-footer nav { display: flex; gap: 18px; flex-wrap: wrap; }
.tool-footer nav a { color: #cbd5e1; text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.tool-footer nav a:hover { color: var(--gold); }
.tool-footer-copy { color: #8ea0c2; font-size: 0.78rem; }
@media (max-width: 560px) { .tool-footer { justify-content: center; text-align: center; } }

/* ── colonna di servizio accanto agli elenchi (25/10) ──
   Dati azienda, Backup, Ripristina e Supporto, ognuno con la sua spiegazione:
   prima erano pulsanti in testata con un'icona e una parola. */
/* ── tre colonne a tutta larghezza (25/10, Antonio) ──
   servizio a sinistra | area di lavoro | colonna libera a destra, larga come la sinistra.
   Le viste senza colonne (schede da compilare, dati azienda) rientrano dello stesso
   spazio, così il lavoro sta sempre nella stessa fascia centrale. */
.tool-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr) 270px; grid-template-areas: "side main free"; gap: 24px; align-items: start; }
.tool-main { grid-area: main; }
.tool-free { grid-area: free; }
.tool-side { grid-area: side; display: flex; flex-direction: column; gap: 14px; padding-top: 40px; }
main > section:not(#connect-view):not(#app-view) { padding-inline: 294px; }
.side-card { background: #fff; border: 1px solid #002147; border-radius: 10px; padding: 14px 16px 16px; }
.side-card-t { font-size: 0.86rem; font-weight: 800; color: #002147; margin-bottom: 6px; }
.side-card p { font-size: 0.8rem; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.side-btn { display: inline-block; background: var(--gold); color: #002147; font-family: inherit; font-weight: 800; font-size: 0.8rem; border: none; border-radius: 6px; padding: 8px 14px; cursor: pointer; text-decoration: none; transition: background .15s; }
.side-btn:hover { background: #002147; color: #fff; }
.side-btn:disabled { opacity: .6; cursor: default; }
.side-card-sup { background: #002147; }
.side-card-sup .side-card-t { color: var(--gold); }
.side-card-sup p { color: #cbd5e1; }
.side-card-sup .side-btn:hover { background: #fff; color: #002147; }
/* Pagina d'ingresso: la presentazione navy riempie la colonna centrale, i comandi stanno a sinistra. */
.tool-layout-intro .connect { max-width: none; margin: 0; }
.tool-layout-intro .tool-side { padding-top: 0; }
.side-btn-big { display: block; width: 100%; text-align: center; padding: 12px 14px; font-size: 0.88rem; }
.side-hint { font-size: 0.76rem !important; color: var(--muted); margin: 10px 0 0 !important; }
.side-card .notice { margin-top: 10px; font-size: 0.8rem; padding: 10px 12px; }
.side-links { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.side-links a { font-size: 0.82rem; font-weight: 700; color: #002147; text-decoration: none; border-bottom: 1px solid var(--gold); }
.side-links a:hover { color: #a97e14; }
/* Viste da compilare: sotto i 1700px la striscia di lavoro prende anche lo spazio della colonna libera (25/10, dal controllo con Chromium:
   a 1366px la tabella delle misure scorreva e la testata della visita andava a capo). */
@media (max-width: 1700px) {
    main > section:not(#connect-view):not(#app-view) { padding-inline: 294px 0; }
}
@media (max-width: 1280px) {
    .tool-layout { grid-template-columns: 270px minmax(0, 1fr); grid-template-areas: "side main"; }
    .tool-free { display: none; }
    main > section:not(#connect-view):not(#app-view) { padding-inline: 294px 0; }
}
@media (max-width: 1000px) {
    .tool-layout { grid-template-columns: 1fr; grid-template-areas: "main" "side"; }
    .tool-side { padding-top: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
    main > section:not(#connect-view):not(#app-view) { padding-inline: 0; }
    /* Ingresso: il pulsante per iniziare prima del testo lungo. */
    .tool-layout-intro { grid-template-areas: "side" "main"; }
}

/* ── "Ecco come funziona" in finestra, con anteprima nella colonna destra (25/10) ── */
.howto-dlg { width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 48px); margin: auto; border: none; border-radius: 16px; padding: 22px 24px 18px; background: #002147; color: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.35); overflow: auto; text-align: center; }
.howto-dlg::backdrop { background: rgba(0,20,45,.62); }
.howto-head { position: relative; margin-bottom: 4px; }
.howto-head .qs-lead { margin: 4px 0 14px; }
.howto-x { position: absolute; top: -6px; right: -8px; background: none; border: none; color: #cbd5e1; font-size: 1.1rem; cursor: pointer; padding: 6px 10px; border-radius: 8px; }
.howto-x:hover { color: var(--gold); background: rgba(255,255,255,.06); }
.howto-dlg .qs-diagram { margin: 0 auto; }
.howto-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 16px; }
.howto-mai { display: inline-flex; align-items: center; gap: 8px; font-size: 0.84rem; color: #cbd5e1; cursor: pointer; }
.howto-mai input { width: 16px; height: 16px; accent-color: var(--gold); }
.howto-card { text-align: left; }
.howto-thumb { display: block; width: 100%; padding: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #002147; cursor: zoom-in; margin-bottom: 10px; }
.howto-thumb img { display: block; width: 100%; height: auto; transition: transform .25s; }
.howto-thumb:hover img { transform: scale(1.03); }
.howto-card.howto-arrivata { animation: howto-arrivo 1.1s ease-out; }
@keyframes howto-arrivo { 0% { box-shadow: 0 0 0 0 rgba(212,175,55,.75); } 100% { box-shadow: 0 0 0 14px rgba(212,175,55,0); } }
/* Sotto i 1280px la colonna destra non c'è: nell'ingresso l'anteprima scende nella colonna sinistra. */
@media (max-width: 1280px) {
    .tool-layout-intro { grid-template-areas: "side main" "free main"; grid-template-rows: auto 1fr; }
    .tool-layout-intro .tool-free { display: block; }
}
@media (max-width: 1000px) {
    .tool-layout-intro { grid-template-areas: "side" "free" "main"; grid-template-rows: none; }
}
.howto-dlg:focus { outline: none; }
/* Scheda d'anteprima: pulsante grande in cima, immagine sotto (25/10). */
.howto-card .side-btn-big { margin-bottom: 12px; }
.howto-card .howto-thumb { margin-bottom: 0; }
