/* PseudoGate – foglio di stile della landing page.
   Nessuna risorsa esterna: font di sistema, nessun tracciamento.
   Colori ispirati alla palette di Bootstrap Italia, verificati per WCAG 2.1 AA. */

:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f2f5f8;
  --surface: #ffffff;
  --text: #17324d;
  --text-strong: #0b1f33;
  --muted: #4a5f73;
  --primary: #0059b3;
  --primary-hover: #00478f;
  --on-primary: #ffffff;
  --primary-soft: #e3effb;
  --border: #c5d0db;
  --border-strong: #8a9bab;
  --ok: #00704a;
  --ok-soft: #e1f3eb;
  --no: #b3261e;
  --no-soft: #fbe9e7;
  --warn-soft: #fff4d6;
  --warn-border: #b07a00;
  --warn-text: #5c4100;
  --code-bg: #eef2f6;
  --focus: #b35c00;
  --shadow: 0 1px 2px rgba(11, 31, 51, .08), 0 2px 8px rgba(11, 31, 51, .06);
  --radius: 6px;
  --maxw: 1120px;
  --font: "Titillium Web", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e1822;
    --bg-alt: #15222f;
    --surface: #1a2938;
    --text: #dde6ee;
    --text-strong: #f4f8fb;
    --muted: #a8b8c7;
    --primary: #7cbcff;
    --primary-hover: #a6d1ff;
    --on-primary: #0b1f33;
    --primary-soft: #1d3550;
    --border: #2f4356;
    --border-strong: #6b8197;
    --ok: #6fd3a5;
    --ok-soft: #143428;
    --no: #ff9d93;
    --no-soft: #3b1d1b;
    --warn-soft: #3a2f12;
    --warn-border: #d9a830;
    --warn-text: #f4dfa6;
    --code-bg: #0a131c;
    --focus: #ffb366;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1822;
  --bg-alt: #15222f;
  --surface: #1a2938;
  --text: #dde6ee;
  --text-strong: #f4f8fb;
  --muted: #a8b8c7;
  --primary: #7cbcff;
  --primary-hover: #a6d1ff;
  --on-primary: #0b1f33;
  --primary-soft: #1d3550;
  --border: #2f4356;
  --border-strong: #6b8197;
  --ok: #6fd3a5;
  --ok-soft: #143428;
  --no: #ff9d93;
  --no-soft: #3b1d1b;
  --warn-soft: #3a2f12;
  --warn-border: #d9a830;
  --warn-text: #f4dfa6;
  --code-bg: #0a131c;
  --focus: #ffb366;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}
h1, h2, h3, h4 { color: var(--text-strong); line-height: 1.25; margin: 0 0 .6em; }
h2 { font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: var(--primary); text-underline-offset: .15em; }
a:hover { color: var(--primary-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; overflow-wrap: anywhere; }
pre code { overflow-wrap: normal; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin-bottom: .35em; }
img, svg { max-width: 100%; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 32px; } }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* Skip link */
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--primary); color: var(--on-primary);
  padding: .6em 1em; border-radius: var(--radius); font-weight: 700;
}
.skip-link:focus { top: 8px; color: var(--on-primary); }

/* Barra superiore */
.slim-header { background: var(--text-strong); color: var(--bg); font-size: .9rem; }
:root[data-theme="dark"] .slim-header { background: #060d14; color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .slim-header { background: #060d14; color: var(--text); } }
.slim-header .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 40px; flex-wrap: wrap; padding-top: 4px; padding-bottom: 4px; }
.slim-header a { color: inherit; }

/* Intestazione */
.site-header { background: var(--primary-soft); border-bottom: 1px solid var(--border); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text-strong); }
.brand:hover { color: var(--text-strong); }
.brand svg { width: 44px; height: 44px; flex: none; }
.brand-name { font-size: 1.5rem; font-weight: 700; line-height: 1.1; display: block; }
.brand-tag { font-size: .88rem; color: var(--muted); display: block; }
.header-tools { display: flex; gap: 8px; align-items: center; }

.btn-icon {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; min-width: 44px;
  padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text-strong); font: inherit; font-size: .95rem; cursor: pointer;
}
.btn-icon:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon svg { width: 20px; height: 20px; }
.menu-toggle { display: none; }

.main-nav { border-top: 1px solid var(--border); }
.main-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0; padding: 0; }
.main-nav li { margin: 0; }
.main-nav a {
  display: block; padding: 10px 10px; color: var(--text-strong); text-decoration: none; font-weight: 600; font-size: .98rem;
  border-bottom: 3px solid transparent;
}
.main-nav a:hover { color: var(--primary); border-bottom-color: var(--primary); }

@media (max-width: 899px) {
  .js .menu-toggle { display: inline-flex; }
  .js .main-nav { display: none; }
  .js .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 4px 0 8px; }
  .main-nav a { border-bottom: 0; border-left: 3px solid transparent; padding: 10px 12px; }
  .main-nav a:hover { border-left-color: var(--primary); }
  .theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* Avviso di stato */
.status {
  background: var(--warn-soft); border-bottom: 1px solid var(--warn-border); color: var(--warn-text);
}
.status .wrap { padding-top: 10px; padding-bottom: 10px; display: flex; gap: 10px; align-items: flex-start; }
.status strong { color: var(--warn-text); }
.status svg { flex: none; width: 22px; height: 22px; margin-top: 2px; }

/* Hero */
.hero { padding: 48px 0 40px; background: linear-gradient(180deg, var(--primary-soft), var(--bg)); }
.hero h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 3rem); max-width: 22ch; margin-bottom: .4em; }
.hero .lead { font-size: clamp(1.1rem, 1rem + .5vw, 1.3rem); max-width: 60ch; color: var(--text); }
.hero .honest {
  border-left: 4px solid var(--primary); padding: .5em 0 .5em 1em; margin: 1.2em 0 1.6em; max-width: 62ch; color: var(--text);
}
.cta { display: flex; flex-wrap: wrap; gap: 12px; }
.tag-demo { margin-top: 28px; display: grid; gap: 10px; max-width: 760px; }
.tag-demo .row { display: grid; grid-template-columns: 7.5rem 1fr; gap: 10px; align-items: start; }
.tag-demo .lbl { font-size: .85rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; padding-top: 10px; }
.tag-demo .txt { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 12px; font-family: var(--mono); font-size: .9rem; }
.ph { color: var(--primary); font-weight: 700; white-space: nowrap; }
@media (max-width: 520px) {
  .tag-demo .row { grid-template-columns: 1fr; gap: 2px; }
  .tag-demo .lbl { padding-top: 0; }
}

/* Pulsanti */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 10px 20px; border-radius: var(--radius); font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 2px solid var(--primary); line-height: 1.25; text-align: center;
}
.btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-outline { background: transparent; color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); color: var(--primary-hover); }
.btn-disabled { border-color: var(--border-strong); color: var(--muted); background: var(--bg-alt); cursor: not-allowed; }
.btn svg { width: 20px; height: 20px; flex: none; }

/* Sezioni */
section { padding: 56px 0; scroll-margin-top: 8px; }
section.alt { background: var(--bg-alt); }
.section-intro { max-width: 70ch; color: var(--text); }
.eyebrow { display: block; font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: .3em; }

.grid { display: grid; gap: 20px; }
.grid + p, .grid + .note { margin-top: 20px; }
.grid > *, .dl-grid > *, .footer-grid > * { min-width: 0; }
@media (min-width: 720px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .4em; }
.card > :last-child { margin-bottom: 0; }
.card.ok { border-top: 5px solid var(--ok); }
.card.no { border-top: 5px solid var(--no); }
.card.accent { border-top: 5px solid var(--primary); }

.check-list, .x-list { list-style: none; padding: 0; }
.check-list li, .x-list li { position: relative; padding-left: 1.8em; }
.check-list li::before, .x-list li::before {
  position: absolute; left: 0; top: .05em; font-weight: 700; width: 1.3em; text-align: center;
}
.check-list li::before { content: "✓"; color: var(--ok); }
.x-list li::before { content: "✕"; color: var(--no); }

/* Diagramma */
.diagram { margin: 28px 0 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.diagram figcaption { color: var(--muted); font-size: .95rem; margin-top: 10px; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram .narrow { display: none; max-width: 420px; margin: 0 auto; }
@media (max-width: 760px) {
  .diagram { padding: 10px; }
  .diagram .wide { display: none; }
  .diagram .narrow { display: block; }
}
.d-zone { fill: none; stroke: var(--border-strong); stroke-width: 2; stroke-dasharray: 8 6; }
.d-box { fill: var(--bg-alt); stroke: var(--border-strong); stroke-width: 1.5; }
.d-box-strong { fill: var(--primary-soft); stroke: var(--primary); stroke-width: 2; }
.d-cloud { fill: var(--surface); stroke: var(--text-strong); stroke-width: 1.5; }
.d-title { fill: var(--text-strong); font-family: var(--font); font-weight: 700; }
.d-text { fill: var(--text); font-family: var(--font); }
.d-muted { fill: var(--muted); font-family: var(--font); }
.d-tag { fill: var(--primary); font-family: var(--mono); font-weight: 700; }
.d-arrow { stroke: var(--text-strong); stroke-width: 2.5; fill: none; }
.d-arrow-safe { stroke: var(--ok); stroke-width: 3; fill: none; }
.d-head { fill: var(--text-strong); }
.d-head-safe { fill: var(--ok); }
.d-num { fill: var(--primary); }
.d-num-text { fill: var(--on-primary); font-family: var(--font); font-weight: 700; }
.d-ok { fill: var(--ok); font-family: var(--font); font-weight: 700; }

.steps { counter-reset: s; list-style: none; padding: 0; display: grid; gap: 12px; }
@media (min-width: 900px) {
  .steps { grid-template-columns: repeat(5, 1fr); }
  .steps li { padding: 52px 16px 16px; }
  .steps li::before { left: 16px; top: 14px; }
}
.steps li { counter-increment: s; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 14px 14px 52px; position: relative; margin: 0; }
.steps li::before {
  content: counter(s); position: absolute; left: 12px; top: 12px; width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: var(--on-primary); font-weight: 700; display: grid; place-items: center; font-size: .95rem;
}

/* Tabelle */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; min-width: 0; }
th, td { text-align: left; vertical-align: top; padding: 12px 14px; border-bottom: 1px solid var(--border); }
thead th { background: var(--primary-soft); color: var(--text-strong); font-size: .95rem; }
tbody th { font-weight: 700; color: var(--text-strong); width: 26%; }
tbody tr:last-child > * { border-bottom: 0; }
.modes-table td, .modes-table th { width: 37%; }
.modes-table tr > :first-child { width: 26%; }
@media (max-width: 640px) {
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table th, .stack-table td { display: block; width: auto !important; }
  .stack-table tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  .stack-table tbody tr:last-child { border-bottom: 0; }
  .stack-table th, .stack-table td { border: 0; padding: 4px 14px; }
  .stack-table tbody th { font-size: 1.05rem; padding-top: 8px; }
  .stack-table td::before { content: attr(data-label); display: block; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
}

/* Download */
.dl-grid { display: grid; gap: 20px; }
@media (min-width: 900px) { .dl-grid { grid-template-columns: repeat(3, 1fr); } }
.dl-card { display: flex; flex-direction: column; }
.dl-card p { flex: 1; }
.dl-card .btn { width: 100%; }
.badge {
  display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; border: 1px solid currentColor; vertical-align: middle; margin-left: 6px;
}
.badge-soon { color: var(--warn-text); background: var(--warn-soft); border-color: var(--warn-border); }

/* Codice */
.code-block { position: relative; margin: 0 0 1em; }
pre {
  background: var(--code-bg); color: var(--text-strong); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px; overflow-x: auto; margin: 0; line-height: 1.5; font-size: .88rem;
}
pre code { background: none; padding: 0; }
.code-block.has-copy { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.code-block.has-copy pre { align-self: stretch; }
.copy-btn {
  min-height: 36px; padding: 2px 10px; font: inherit; font-size: .8rem;
  background: var(--surface); color: var(--text-strong); border: 1px solid var(--border-strong); border-radius: 4px; cursor: pointer;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.js-only { display: none; }
.js .js-only { display: inline-block; }

.note {
  border: 1px solid var(--warn-border); background: var(--warn-soft); color: var(--warn-text);
  border-radius: var(--radius); padding: 14px 16px; margin: 20px 0;
}
.note strong, .note a { color: var(--warn-text); }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; }
.faq summary {
  cursor: pointer; padding: 14px 48px 14px 16px; font-weight: 700; color: var(--text-strong); position: relative; list-style: none;
  min-height: 48px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--primary); line-height: 1;
}
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--primary); }
.faq .answer { padding: 0 16px 14px; }
.faq .answer > :last-child { margin-bottom: 0; }

/* Footer */
.site-footer { background: var(--text-strong); color: #e6edf3; padding: 40px 0 28px; font-size: .95rem; }
:root[data-theme="dark"] .site-footer { background: #060d14; color: var(--text); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .site-footer { background: #060d14; color: var(--text); } }
.site-footer a { color: #ffffff; }
.site-footer h2 { color: #ffffff; font-size: 1.1rem; margin-bottom: .5em; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 820px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr; } }
.site-footer ul { list-style: none; padding: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.25); margin-top: 24px; padding-top: 16px; font-size: .88rem; }
.site-footer .small { font-size: .88rem; }

/* Pagine secondarie (es. informativa privacy) */
.prose p, .prose li { max-width: 78ch; }
.prose td, .prose th { max-width: none; }
@media (max-width: 899px) {
  .js .main-nav.nav-static { display: block; }
  .main-nav.nav-static ul { flex-direction: row; flex-wrap: wrap; padding: 0; }
  .main-nav.nav-static a { border-left: 0; padding: 10px 8px; }
}
.prose p.note { max-width: none; }

/* ===== Pseudomania: componenti aggiunti ===== */
.status p, .footer-bottom p { margin: 0; }
.demo-note, .meta-note, .small-note { color: var(--muted); font-size: .92rem; }
.demo-note { margin-top: 10px; }
.after-table { margin-top: 16px; }
blockquote { margin: 1em 0; padding: .6em 1em; border-left: 4px solid var(--primary); background: var(--bg-alt); border-radius: 0 var(--radius) var(--radius) 0; }
blockquote p:last-child { margin-bottom: 0; }
.license-text { font-family: var(--mono); font-size: .82rem; line-height: 1.55; }
.note.disclaimer { border-width: 2px; }
.note p:last-child { margin-bottom: 0; }
kbd { border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; padding: 0 .35em; background: var(--surface); font-size: .85em; }
caption { text-align: left; font-weight: 700; padding: 10px 14px; color: var(--text-strong); }

/* Sezioni della home */
.home-sec { padding: 52px 0; scroll-margin-top: 8px; }
.home-sec.alt { background: var(--bg-alt); }

/* Carosello: senza JS è una lista scorrevole orizzontalmente con aggancio */
.carousel { position: relative; margin-top: 18px; }
.car-controls { display: none; align-items: center; justify-content: flex-end; gap: 10px; margin-bottom: 10px; }
.js .car-controls { display: flex; }
.car-status { color: var(--muted); font-size: .92rem; min-width: 7.5em; text-align: center; }
.car-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 50%;
  border: 2px solid var(--primary); background: var(--surface); color: var(--primary); cursor: pointer;
}
.car-btn svg { width: 24px; height: 24px; }
.car-btn:hover:not(:disabled) { background: var(--primary); color: var(--on-primary); }
.car-btn:disabled { border-color: var(--border); color: var(--border-strong); cursor: default; }
.car-track {
  list-style: none; margin: 0; padding: 4px 4px 14px; display: grid; grid-auto-flow: column;
  grid-auto-columns: min(82%, 300px); gap: 16px; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding: 4px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent;
}
@media (min-width: 720px) { .car-track { grid-auto-columns: calc((100% - 32px) / 2.4); } }
@media (min-width: 1000px) { .car-track { grid-auto-columns: calc((100% - 48px) / 3.3); } }
@media (prefers-reduced-motion: no-preference) { .car-track { scroll-behavior: smooth; } }
.car-slide { margin: 0; scroll-snap-align: start; display: flex; }
.car-card {
  position: relative; display: flex; flex-direction: column; width: 100%; background: var(--surface);
  border: 1px solid var(--border); border-top: 4px solid var(--primary); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow); transition: border-color .15s;
}
.car-card:hover { border-color: var(--primary); }
.car-card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.car-card h3 { font-size: 1.15rem; margin: 4px 0 .45em; }
.car-card h3 a { color: var(--text-strong); text-decoration: none; }
.car-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.car-card h3 a:focus-visible { outline: none; }
.car-card:hover h3 a { color: var(--primary); text-decoration: underline; }
.car-card p { flex: 1; margin-bottom: .8em; }
.car-num { font-family: var(--mono); font-weight: 700; color: var(--muted); font-size: .85rem; }
.car-more { font-weight: 700; color: var(--primary); font-size: .95rem; }
.car-more::after { content: " →"; }
.car-hint { color: var(--muted); font-size: .88rem; margin: 2px 0 0; }

/* Layout degli approfondimenti con menu ad albero */
.docs-layout { display: grid; gap: 28px; padding-top: 28px; padding-bottom: 56px; }
@media (min-width: 1000px) { .docs-layout { grid-template-columns: 270px minmax(0, 1fr); align-items: start; } }
.docs-main { min-width: 0; }
.docs-main > h1 { font-size: clamp(1.8rem, 1.3rem + 2vw, 2.5rem); margin-top: .2em; }
.docs-main .lead { font-size: 1.15rem; max-width: 70ch; }
.docs-main h2 { margin-top: 1.8em; scroll-margin-top: 12px; font-size: clamp(1.35rem, 1.1rem + .8vw, 1.7rem); }
.docs-main p, .docs-main li { max-width: 78ch; }
.docs-main .table-wrap { margin: 12px 0 16px; }
.docs-main .card p, .docs-main .card li { max-width: none; }
.docs-nav {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 12px;
  font-size: .97rem;
}
@media (min-width: 1000px) {
  .docs-nav { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
}
.docs-nav-title { font-weight: 700; color: var(--text-strong); margin: 0 4px 8px; font-size: 1.05rem; }
.tree-tools { display: none; gap: 6px; flex-wrap: wrap; margin: 0 4px 10px; }
.js .tree-tools { display: flex; }
.tree-tools button, .btn-small {
  font: inherit; font-size: .85rem; min-height: 32px; padding: 2px 10px; border-radius: 4px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-strong);
}
.tree-tools button:hover, .btn-small:hover { border-color: var(--primary); color: var(--primary); }
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree li { margin: 0; }
.tree summary {
  cursor: pointer; padding: 8px 8px 8px 28px; border-radius: 4px; font-weight: 700; color: var(--text-strong);
  position: relative; list-style: none; min-height: 40px;
}
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before {
  content: ""; position: absolute; left: 10px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s;
}
.tree details[open] > summary::before { transform: rotate(45deg); margin-top: -6px; }
.tree summary:hover { background: var(--primary-soft); }
.tree summary.tree-current { color: var(--primary); }
.tree ul ul, .tree details > ul { margin: 0 0 6px 18px; border-left: 2px solid var(--border); }
.tree details a, .tree-leaf a {
  display: block; padding: 6px 10px; color: var(--text); text-decoration: none; border-radius: 0 4px 4px 0; line-height: 1.35;
}
.tree-leaf a { font-weight: 700; color: var(--text-strong); padding-left: 28px; }
.tree a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: underline; }
.tree a[aria-current="page"] { color: var(--primary); font-weight: 700; background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--primary); }
.tree-toggle {
  display: none; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; width: 100%;
  font: inherit; font-weight: 700; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text-strong); cursor: pointer;
}
.tree-toggle svg { width: 20px; height: 20px; }
@media (max-width: 999px) {
  .js .tree-toggle { display: flex; }
  .js .docs-nav { display: none; }
  .js .docs-nav.open { display: block; }
  .docs-layout { gap: 14px; padding-top: 18px; }
}

.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; padding: 0; margin: 0 0 8px; font-size: .92rem; color: var(--muted); }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.pager { display: grid; gap: 12px; margin-top: 48px; border-top: 1px solid var(--border); padding-top: 20px; }
@media (min-width: 640px) { .pager { grid-template-columns: 1fr 1fr; } }
.pager a {
  display: block; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  text-decoration: none; font-weight: 700;
}
.pager a span { display: block; font-weight: 400; font-size: .85rem; color: var(--muted); }
.pager a:hover { border-color: var(--primary); }
.pager-next { text-align: right; grid-column: -2; }
.chapter-card h2 { margin-top: 0; font-size: 1.25rem; }
.chapter-card ul { font-size: .95rem; margin-bottom: 0; }

/* Domande e risposte espandibili */
.acc-tools { display: none; gap: 8px; flex-wrap: wrap; margin: 8px 0 4px; }
.js .acc-tools { display: flex; }
.acc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 0 0 10px; scroll-margin-top: 12px; }
.acc > summary {
  cursor: pointer; padding: 14px 48px 14px 16px; font-weight: 700; color: var(--text-strong); position: relative; list-style: none; min-height: 48px;
}
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: "+"; position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-size: 1.4rem; color: var(--primary); line-height: 1; }
.acc[open] > summary::after { content: "−"; }
.acc > summary:hover { color: var(--primary); }
.acc-body { padding: 0 16px 14px; }
.acc-body > :last-child { margin-bottom: 0; }
.acc:target, .acc.is-target { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.acc-open-block { margin-bottom: 16px; scroll-margin-top: 12px; }
.retention td, .retention th { font-size: .95rem; }
.docs-main .steps { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.docs-main .steps li { padding: 52px 16px 16px; }
.docs-main .steps li::before { left: 16px; top: 14px; }
@media (max-width: 420px) {
  .brand-tag { display: none; }
  .brand svg { width: 38px; height: 38px; }
  .header-tools { gap: 6px; }
}
/* Negli approfondimenti la colonna è stretta: si usa sempre lo schema verticale, leggibile */
.docs-main .diagram .wide { display: none; }
.docs-main .diagram .narrow { display: block; max-width: 440px; }
@media (max-width: 599px) {
  .docs-main .steps li { padding: 14px 14px 14px 52px; }
  .docs-main .steps li::before { left: 12px; top: 12px; }
}
.recovery { margin-top: 40px; padding-top: 8px; border-top: 1px solid var(--border); }
.recovery h2 { scroll-margin-top: 12px; }
