/* ==========================================================================
   PokéBind — Legal Design System
   File autonomo per informativa.html, termini.html, cookie.html.
   Nessuna dipendenza esterna: niente Tailwind, niente Google Fonts, niente CDN.
   Le pagine legali devono poter essere lette anche a rete degradata e non
   devono contattare terze parti mentre spiegano quali terze parti esistono.
   ========================================================================== */

/* --- 0. Reset minimo ---------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul, ol { padding: 0; }
img { max-width: 100%; display: block; }
button, input { font: inherit; color: inherit; }
table { border-collapse: collapse; width: 100%; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* --- 1. Token ----------------------------------------------------------- */
:root {
  --lg-red:        #dc2626;
  --lg-red-bright: #ef4444;
  --lg-red-deep:   #991b1b;
  --lg-red-wash:   rgba(239, 68, 68, .08);
  --lg-red-line:   rgba(239, 68, 68, .22);

  --lg-ink:        #0b1220;
  --lg-strong:     #111827;
  --lg-body:       #3b475c;
  --lg-muted:      #6b7688;
  --lg-faint:      #93a0b4;

  --lg-page:       #f6f7fb;
  --lg-surface:    rgba(255, 255, 255, .78);
  --lg-surface-2:  rgba(255, 255, 255, .92);
  --lg-solid:      #ffffff;
  --lg-line:       rgba(15, 23, 42, .09);
  --lg-line-soft:  rgba(15, 23, 42, .06);
  --lg-hover:      rgba(15, 23, 42, .04);

  --lg-shadow-sm:  0 2px 8px rgba(15, 23, 42, .05);
  --lg-shadow:     0 10px 40px -12px rgba(15, 23, 42, .16);
  --lg-shadow-lg:  0 24px 60px -18px rgba(15, 23, 42, .24);

  --lg-radius:     24px;
  --lg-radius-md:  16px;
  --lg-radius-sm:  11px;

  --lg-nav-h:      74px;
  --lg-font:       'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif;
  --lg-mono:       ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;

  --lg-maxw:       1320px;
  color-scheme: light;
}

html.lg-dark {
  --lg-red:        #f87171;
  --lg-red-bright: #fca5a5;
  --lg-red-deep:   #fecaca;
  --lg-red-wash:   rgba(248, 113, 113, .12);
  --lg-red-line:   rgba(248, 113, 113, .28);

  --lg-ink:        #f3f6fc;
  --lg-strong:     #ffffff;
  --lg-body:       #c2ccdb;
  --lg-muted:      #94a3b8;
  --lg-faint:      #74839a;

  --lg-page:       #080b14;
  --lg-surface:    rgba(22, 28, 43, .78);
  --lg-surface-2:  rgba(26, 33, 50, .94);
  --lg-solid:      #131a29;
  --lg-line:       rgba(255, 255, 255, .10);
  --lg-line-soft:  rgba(255, 255, 255, .06);
  --lg-hover:      rgba(255, 255, 255, .06);

  --lg-shadow-sm:  0 2px 8px rgba(0, 0, 0, .4);
  --lg-shadow:     0 10px 40px -12px rgba(0, 0, 0, .7);
  --lg-shadow-lg:  0 24px 60px -18px rgba(0, 0, 0, .8);
  color-scheme: dark;
}

/* --- 2. Pagina ---------------------------------------------------------- */
body {
  font-family: var(--lg-font);
  font-size: 16px;
  line-height: 1.72;
  color: var(--lg-body);
  background: var(--lg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  padding-top: calc(var(--lg-nav-h) + 34px);
  text-rendering: optimizeLegibility;
}

/* Lo stesso sfondo animato bianco/rosso della home, così la pagina legale
   non sembra un allegato staccato dal prodotto. */
.lg-backdrop {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  contain: strict;
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(239, 68, 68, .16), transparent 62%),
    radial-gradient(900px 620px at 92% 4%, rgba(220, 38, 38, .13), transparent 60%),
    radial-gradient(1100px 780px at 50% 108%, rgba(239, 68, 68, .10), transparent 65%),
    linear-gradient(180deg, #ffffff 0%, #f7f8fc 44%, #f2f4f9 100%);
  background-size: 180% 180%, 180% 180%, 180% 180%, 100% 100%;
  animation: lgDrift 30s ease-in-out infinite alternate;
}
html.lg-dark .lg-backdrop {
  background:
    radial-gradient(1200px 700px at 12% -10%, rgba(239, 68, 68, .20), transparent 62%),
    radial-gradient(900px 620px at 92% 4%, rgba(127, 29, 29, .34), transparent 60%),
    radial-gradient(1100px 780px at 50% 108%, rgba(239, 68, 68, .12), transparent 65%),
    linear-gradient(180deg, #0a0e18 0%, #070a12 55%, #05070d 100%);
}
@keyframes lgDrift {
  0%   { background-position: 12% 18%, 88% 8%, 50% 100%, 0 0; }
  100% { background-position: 32% 40%, 62% 26%, 44% 84%, 0 0; }
}

.lg-grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .55;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
}

/* --- 3. Barra di avanzamento lettura ------------------------------------ */
.lg-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 10000;
  background: transparent;
  pointer-events: none;
}
.lg-progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--lg-red-bright), var(--lg-red), var(--lg-red-deep));
  box-shadow: 0 0 14px rgba(220, 38, 38, .55);
  transition: width .12s linear;
}

/* --- 4. Navigazione ----------------------------------------------------- */
.lg-nav {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 24px), var(--lg-maxw));
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px 11px 16px;
  border-radius: 22px;
  background: var(--lg-surface-2);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, .9);
  box-shadow: 0 15px 35px rgba(15, 23, 42, .10), 0 5px 15px rgba(15, 23, 42, .05);
}
html.lg-dark .lg-nav { border-color: rgba(255, 255, 255, .10); }

.lg-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex: 0 0 auto;
  min-width: 0;
}
.lg-brand img {
  height: 42px;
  width: auto;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .12));
  transition: transform .3s cubic-bezier(.34, 1.56, .64, 1);
}
.lg-brand:hover img { transform: rotate(-11deg) scale(1.04); }
.lg-brand b {
  font-size: 1.42rem;
  font-weight: 900;
  letter-spacing: -.03em;
  color: var(--lg-strong);
  white-space: nowrap;
}
.lg-brand b span { color: var(--lg-red); }
.lg-brand small {
  display: block;
  font-size: .64rem;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--lg-faint);
  margin-top: -3px;
}

.lg-nav-spacer { flex: 1 1 auto; }

/* Segmented control: i tre documenti sono sempre a un tap di distanza. */
.lg-seg {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px;
  border-radius: 15px;
  background: var(--lg-hover);
  border: 1px solid var(--lg-line-soft);
}
.lg-seg a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 11px;
  font-size: .875rem;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--lg-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.lg-seg a svg { width: 17px; height: 17px; flex: 0 0 auto; }
.lg-seg a:hover { color: var(--lg-strong); background: var(--lg-surface-2); transform: translateY(-1px); }
.lg-seg a[aria-current="page"] {
  background: var(--lg-solid);
  color: var(--lg-red);
  box-shadow: var(--lg-shadow-sm), inset 0 0 0 1px var(--lg-red-line);
}

.lg-nav-home {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 17px;
  border-radius: 13px;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: -.01em;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, var(--lg-red-bright), var(--lg-red));
  box-shadow: 0 8px 20px -6px rgba(220, 38, 38, .55);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
  flex: 0 0 auto;
}
.lg-nav-home:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -8px rgba(220, 38, 38, .6); filter: saturate(1.08); }
.lg-nav-home:active { transform: translateY(0); }
.lg-nav-home svg { width: 17px; height: 17px; }

.lg-theme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  border-radius: 12px;
  border: 1px solid var(--lg-line);
  background: transparent;
  color: var(--lg-muted);
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
  flex: 0 0 auto;
}
.lg-theme:hover { background: var(--lg-hover); color: var(--lg-strong); transform: translateY(-1px); }
.lg-theme svg { width: 19px; height: 19px; }
.lg-theme .lg-icon-sun { display: none; }
html.lg-dark .lg-theme .lg-icon-sun { display: block; }
html.lg-dark .lg-theme .lg-icon-moon { display: none; }

@media (max-width: 1100px) {
  .lg-seg a span { display: none; }
  .lg-seg a { padding: 9px 11px; }
}
@media (max-width: 860px) {
  body { padding-top: calc(var(--lg-nav-h) + 18px); }
  .lg-nav { top: 10px; padding: 9px 10px 9px 12px; gap: 8px; border-radius: 19px; }
  .lg-brand img { height: 34px; }
  .lg-brand b { font-size: 1.16rem; }
  .lg-brand small { display: none; }
  .lg-nav-home span { display: none; }
  .lg-nav-home { padding: 10px 12px; }
  .lg-seg { padding: 3px; border-radius: 13px; gap: 2px; }
  .lg-seg a { padding: 8px 9px; border-radius: 10px; }
  .lg-seg a svg { width: 18px; height: 18px; }
}

/* Sotto i 620px il nome esteso lascia il posto ai tre documenti: il logo basta
   a identificare il sito, il selettore dei documenti no. */
@media (max-width: 620px) {
  .lg-brand b { display: none; }
  .lg-brand img { height: 32px; }
  .lg-nav { gap: 6px; padding: 8px 9px; }
  .lg-nav-home { padding: 9px 11px; }
  .lg-theme { width: 36px; height: 36px; border-radius: 11px; }
}

/* --- 5. Guscio ---------------------------------------------------------- */
.lg-shell {
  width: min(calc(100% - 32px), var(--lg-maxw));
  margin: 0 auto;
}
@media (max-width: 860px) { .lg-shell { width: calc(100% - 26px); } }

/* --- 6. Hero ------------------------------------------------------------ */
.lg-hero {
  position: relative;
  margin-top: 30px;
  padding: 46px 44px 40px;
  border-radius: var(--lg-radius);
  background: var(--lg-surface);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .65);
  box-shadow: var(--lg-shadow);
  overflow: hidden;
}
html.lg-dark .lg-hero { border-color: var(--lg-line); }
.lg-hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--lg-red-bright), var(--lg-red), transparent 78%);
}
.lg-hero::after {
  content: "";
  position: absolute;
  top: -120px; right: -90px;
  width: 340px; height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(239, 68, 68, .16), transparent 68%);
  pointer-events: none;
}

.lg-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px 6px 9px;
  border-radius: 999px;
  background: var(--lg-red-wash);
  border: 1px solid var(--lg-red-line);
  color: var(--lg-red);
  font-size: .705rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.lg-eyebrow svg { width: 15px; height: 15px; }

.lg-title {
  margin: 20px 0 0;
  font-size: clamp(2.15rem, 5.2vw, 3.55rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -.04em;
  color: var(--lg-strong);
  max-width: 21ch;
}
.lg-title em {
  font-style: normal;
  background: linear-gradient(120deg, var(--lg-red-bright), var(--lg-red-deep));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
html.lg-dark .lg-title em { background: linear-gradient(120deg, #fca5a5, #ef4444); -webkit-background-clip: text; background-clip: text; }

.lg-lead {
  margin-top: 18px;
  max-width: 74ch;
  font-size: 1.09rem;
  line-height: 1.75;
  color: var(--lg-body);
}
.lg-lead strong { color: var(--lg-strong); font-weight: 700; }

.lg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 26px;
}
.lg-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--lg-surface-2);
  border: 1px solid var(--lg-line);
  font-size: .795rem;
  font-weight: 600;
  color: var(--lg-muted);
  white-space: nowrap;
}
.lg-chip b { color: var(--lg-strong); font-weight: 800; }
.lg-chip svg { width: 15px; height: 15px; color: var(--lg-red); flex: 0 0 auto; }
.lg-chip--live { border-color: rgba(16, 185, 129, .34); background: rgba(16, 185, 129, .09); color: #047857; }
html.lg-dark .lg-chip--live { color: #6ee7b7; }
.lg-chip--live svg { color: currentColor; }

.lg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid var(--lg-line-soft);
}
.lg-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 20px;
  border-radius: 14px;
  font-size: .9rem;
  font-weight: 800;
  letter-spacing: -.01em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--lg-line);
  background: var(--lg-surface-2);
  color: var(--lg-strong);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease;
}
.lg-btn svg { width: 17px; height: 17px; }
.lg-btn:hover { transform: translateY(-2px); box-shadow: var(--lg-shadow-sm); border-color: var(--lg-red-line); color: var(--lg-red); }
.lg-btn--primary {
  background: linear-gradient(135deg, #1f2937, #0b1220);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 24px -10px rgba(11, 18, 32, .8);
}
.lg-btn--primary:hover { color: #fff; box-shadow: 0 16px 32px -12px rgba(11, 18, 32, .9); }
html.lg-dark .lg-btn--primary { background: linear-gradient(135deg, #f8fafc, #cbd5e1); color: #0b1220; }
html.lg-dark .lg-btn--primary:hover { color: #0b1220; }

@media (max-width: 860px) {
  .lg-hero { padding: 32px 22px 30px; margin-top: 20px; border-radius: 20px; }
  .lg-actions .lg-btn { flex: 1 1 auto; justify-content: center; }
}

/* --- 7. Layout documento ------------------------------------------------ */
.lg-layout {
  display: grid;
  grid-template-columns: 296px minmax(0, 1fr);
  gap: 30px;
  align-items: start;
  margin-top: 30px;
  margin-bottom: 70px;
}
@media (max-width: 1080px) { .lg-layout { grid-template-columns: 1fr; gap: 18px; } }

/* --- 8. Indice ---------------------------------------------------------- */
.lg-aside { position: sticky; top: calc(var(--lg-nav-h) + 30px); }
@media (max-width: 1080px) { .lg-aside { position: static; } }

.lg-toc {
  border-radius: 20px;
  background: var(--lg-surface);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  backdrop-filter: blur(22px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--lg-shadow);
  overflow: hidden;
}
html.lg-dark .lg-toc { border-color: var(--lg-line); }

.lg-toc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--lg-line-soft);
  font-size: .72rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--lg-faint);
}
.lg-toc-head svg { width: 15px; height: 15px; color: var(--lg-red); }

.lg-toc-search { padding: 12px 14px; border-bottom: 1px solid var(--lg-line-soft); }
.lg-toc-search input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 11px;
  border: 1px solid var(--lg-line);
  background: var(--lg-solid);
  font-size: .85rem;
  color: var(--lg-strong);
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.lg-toc-search input::placeholder { color: var(--lg-faint); }
.lg-toc-search input:focus { border-color: var(--lg-red-line); box-shadow: 0 0 0 3px var(--lg-red-wash); }

.lg-toc-list {
  list-style: none;
  margin: 0;
  padding: 10px;
  max-height: min(58vh, 620px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.lg-toc-list::-webkit-scrollbar { width: 7px; }
.lg-toc-list::-webkit-scrollbar-thumb { background: var(--lg-line); border-radius: 6px; }
.lg-toc-list li { margin: 1px 0; }
.lg-toc-list a {
  display: flex;
  align-items: baseline;
  gap: 9px;
  padding: 8px 11px;
  border-radius: 10px;
  font-size: .845rem;
  line-height: 1.42;
  font-weight: 600;
  color: var(--lg-muted);
  text-decoration: none;
  transition: background .16s ease, color .16s ease;
}
.lg-toc-list a i {
  font-style: normal;
  flex: 0 0 auto;
  min-width: 20px;
  font-size: .7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--lg-faint);
}
.lg-toc-list a:hover { background: var(--lg-hover); color: var(--lg-strong); }
.lg-toc-list a.is-active {
  background: var(--lg-red-wash);
  color: var(--lg-red);
  box-shadow: inset 2px 0 0 var(--lg-red);
}
.lg-toc-list a.is-active i { color: var(--lg-red); }
.lg-toc-list li.is-hidden { display: none; }
.lg-toc-empty { padding: 14px 12px; font-size: .82rem; color: var(--lg-faint); text-align: center; }

.lg-toc-foot {
  padding: 13px 16px;
  border-top: 1px solid var(--lg-line-soft);
  font-size: .77rem;
  color: var(--lg-faint);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.lg-toc-foot a { color: var(--lg-red); font-weight: 700; text-decoration: none; }
.lg-toc-foot a:hover { text-decoration: underline; }

/* Su mobile l'indice diventa una scheda apribile. */
.lg-toc-mobile { display: none; }
@media (max-width: 1080px) {
  .lg-toc-mobile { display: block; }
  .lg-toc-mobile > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 18px;
    border-radius: 16px;
    background: var(--lg-surface-2);
    border: 1px solid var(--lg-line);
    box-shadow: var(--lg-shadow-sm);
    font-weight: 800;
    font-size: .92rem;
    color: var(--lg-strong);
  }
  .lg-toc-mobile > summary::-webkit-details-marker { display: none; }
  .lg-toc-mobile > summary svg.lg-caret { margin-left: auto; width: 17px; height: 17px; transition: transform .25s ease; color: var(--lg-muted); }
  .lg-toc-mobile[open] > summary svg.lg-caret { transform: rotate(180deg); }
  .lg-toc-mobile[open] > summary { border-radius: 16px 16px 0 0; border-bottom-color: transparent; }
  .lg-toc-mobile .lg-toc { border-radius: 0 0 16px 16px; border-top: 0; }
  .lg-aside .lg-toc-desktop { display: none; }
}
@media (min-width: 1081px) { .lg-toc-mobile { display: none; } }

/* --- 9. Documento ------------------------------------------------------- */
.lg-doc {
  border-radius: var(--lg-radius);
  background: var(--lg-surface);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  backdrop-filter: blur(24px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, .6);
  box-shadow: var(--lg-shadow);
  padding: 46px 52px 54px;
  min-width: 0;
}
html.lg-dark .lg-doc { border-color: var(--lg-line); }
@media (max-width: 860px) { .lg-doc { padding: 28px 20px 34px; border-radius: 20px; } }

.lg-doc p { margin: 0 0 15px; max-width: 82ch; }
.lg-doc p:last-child { margin-bottom: 0; }
.lg-doc strong { color: var(--lg-strong); font-weight: 700; }
.lg-doc a { color: var(--lg-red); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; text-decoration-color: var(--lg-red-line); transition: text-decoration-color .18s ease; }
.lg-doc a:hover { text-decoration-color: var(--lg-red); }

.lg-doc ul, .lg-doc ol { margin: 0 0 16px; padding-left: 0; list-style: none; max-width: 82ch; }
.lg-doc ul > li, .lg-doc ol > li { position: relative; padding-left: 27px; margin-bottom: 9px; }
.lg-doc ul > li::before {
  content: "";
  position: absolute;
  left: 8px; top: .68em;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--lg-red);
  opacity: .55;
}
.lg-doc ol { counter-reset: lgol; }
.lg-doc ol > li { counter-increment: lgol; }
.lg-doc ol > li::before {
  content: counter(lgol) ".";
  position: absolute;
  left: 0; top: 0;
  font-size: .8rem;
  font-weight: 800;
  color: var(--lg-red);
  font-variant-numeric: tabular-nums;
}
.lg-doc li > ul, .lg-doc li > ol { margin-top: 9px; margin-bottom: 4px; }

.lg-doc code {
  font-family: var(--lg-mono);
  font-size: .855em;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--lg-hover);
  border: 1px solid var(--lg-line-soft);
  color: var(--lg-strong);
  white-space: nowrap;
}

/* Sezioni */
.lg-section { scroll-margin-top: calc(var(--lg-nav-h) + 34px); padding-top: 34px; margin-top: 34px; border-top: 1px solid var(--lg-line-soft); }
.lg-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }

.lg-h2 {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 0 0 18px;
  font-size: clamp(1.32rem, 2.5vw, 1.68rem);
  line-height: 1.26;
  font-weight: 900;
  letter-spacing: -.028em;
  color: var(--lg-strong);
  scroll-margin-top: calc(var(--lg-nav-h) + 34px);
}
.lg-num {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 9px;
  margin-top: 1px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--lg-red-bright), var(--lg-red));
  color: #fff;
  font-size: .9rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 14px -5px rgba(220, 38, 38, .6);
}
.lg-anchor {
  flex: 0 0 auto;
  margin-left: 4px;
  align-self: center;
  opacity: 0;
  color: var(--lg-faint);
  text-decoration: none;
  font-weight: 700;
  transition: opacity .18s ease, color .18s ease;
}
.lg-h2:hover .lg-anchor { opacity: 1; }
.lg-anchor:hover { color: var(--lg-red); }
.lg-anchor svg { width: 16px; height: 16px; }

.lg-h3 {
  margin: 30px 0 12px;
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -.018em;
  color: var(--lg-strong);
  display: flex;
  align-items: center;
  gap: 10px;
  scroll-margin-top: calc(var(--lg-nav-h) + 34px);
}
.lg-h3::before {
  content: "";
  width: 15px; height: 2px;
  border-radius: 2px;
  background: var(--lg-red);
  flex: 0 0 auto;
  opacity: .7;
}
.lg-h4 { margin: 22px 0 9px; font-size: .96rem; font-weight: 800; color: var(--lg-strong); letter-spacing: -.01em; }

/* --- 10. Sintesi -------------------------------------------------------- */
.lg-tldr {
  margin-bottom: 6px;
  padding: 26px 28px;
  border-radius: 20px;
  background: linear-gradient(150deg, rgba(239, 68, 68, .07), rgba(255, 255, 255, .05) 62%);
  border: 1px solid var(--lg-red-line);
}
.lg-tldr-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .74rem;
  font-weight: 900;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--lg-red);
  margin-bottom: 16px;
}
.lg-tldr-title svg { width: 16px; height: 16px; }
.lg-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 12px; }
.lg-card {
  padding: 16px 17px;
  border-radius: 15px;
  background: var(--lg-surface-2);
  border: 1px solid var(--lg-line);
  box-shadow: var(--lg-shadow-sm);
}
.lg-card b { display: block; font-size: .875rem; font-weight: 800; color: var(--lg-strong); margin-bottom: 5px; letter-spacing: -.01em; }
.lg-card span { display: block; font-size: .825rem; line-height: 1.6; color: var(--lg-muted); }

/* --- 11. Callout -------------------------------------------------------- */
.lg-note {
  position: relative;
  margin: 20px 0;
  padding: 17px 20px 17px 54px;
  border-radius: 15px;
  border: 1px solid var(--lg-line);
  background: var(--lg-surface-2);
  font-size: .92rem;
  line-height: 1.68;
  max-width: 82ch;
}
.lg-note > svg {
  position: absolute;
  left: 19px; top: 18px;
  width: 20px; height: 20px;
}
.lg-note b { display: block; margin-bottom: 4px; color: var(--lg-strong); font-weight: 800; }
.lg-note p { margin: 0 0 8px; }
.lg-note p:last-child { margin-bottom: 0; }
.lg-note--info   { border-color: rgba(37, 99, 235, .28); background: rgba(59, 130, 246, .07); }
.lg-note--info > svg { color: #2563eb; }
.lg-note--ok     { border-color: rgba(16, 185, 129, .3); background: rgba(16, 185, 129, .07); }
.lg-note--ok > svg { color: #059669; }
.lg-note--warn   { border-color: rgba(217, 119, 6, .3); background: rgba(245, 158, 11, .08); }
.lg-note--warn > svg { color: #d97706; }
.lg-note--danger { border-color: var(--lg-red-line); background: var(--lg-red-wash); }
.lg-note--danger > svg { color: var(--lg-red); }
.lg-note--legal  { border-color: rgba(99, 102, 241, .28); background: rgba(99, 102, 241, .07); }
.lg-note--legal > svg { color: #6366f1; }
html.lg-dark .lg-note--info > svg { color: #93c5fd; }
html.lg-dark .lg-note--ok > svg { color: #6ee7b7; }
html.lg-dark .lg-note--warn > svg { color: #fcd34d; }
html.lg-dark .lg-note--legal > svg { color: #a5b4fc; }

/* --- 12. Tabelle -------------------------------------------------------- */
.lg-tablewrap {
  margin: 20px 0;
  border-radius: 16px;
  border: 1px solid var(--lg-line);
  background: var(--lg-solid);
  box-shadow: var(--lg-shadow-sm);
  overflow: hidden;
}
.lg-tablescroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.lg-tablewrap table { font-size: .865rem; min-width: 560px; }
.lg-tablewrap caption {
  caption-side: top;
  text-align: left;
  padding: 13px 18px;
  font-size: .73rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--lg-faint);
  border-bottom: 1px solid var(--lg-line-soft);
  background: var(--lg-hover);
}
.lg-tablewrap th {
  text-align: left;
  padding: 12px 16px;
  font-size: .715rem;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--lg-muted);
  background: var(--lg-hover);
  border-bottom: 1px solid var(--lg-line);
  white-space: nowrap;
  vertical-align: middle;
}
.lg-tablewrap td {
  padding: 13px 16px;
  vertical-align: top;
  border-bottom: 1px solid var(--lg-line-soft);
  line-height: 1.6;
  color: var(--lg-body);
}
.lg-tablewrap tbody tr:last-child td { border-bottom: 0; }
.lg-tablewrap tbody tr:hover td { background: var(--lg-hover); }
.lg-tablewrap td strong, .lg-tablewrap td b { color: var(--lg-strong); }
.lg-tablewrap td code { white-space: nowrap; }
.lg-tablewrap ul { margin: 0; }
.lg-tablewrap ul > li { margin-bottom: 4px; padding-left: 15px; font-size: .95em; }
.lg-tablewrap ul > li::before { left: 2px; top: .6em; width: 4px; height: 4px; }

.lg-tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: .695rem;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  border: 1px solid transparent;
}
.lg-tag--contract { background: rgba(59, 130, 246, .12); color: #1d4ed8; border-color: rgba(59, 130, 246, .26); }
.lg-tag--consent  { background: rgba(16, 185, 129, .13); color: #047857; border-color: rgba(16, 185, 129, .28); }
.lg-tag--interest { background: rgba(245, 158, 11, .14); color: #b45309; border-color: rgba(245, 158, 11, .3); }
.lg-tag--legal    { background: rgba(99, 102, 241, .13); color: #4338ca; border-color: rgba(99, 102, 241, .28); }
.lg-tag--vital    { background: rgba(220, 38, 38, .12); color: #b91c1c; border-color: rgba(220, 38, 38, .26); }
.lg-tag--neutral  { background: var(--lg-hover); color: var(--lg-muted); border-color: var(--lg-line); }
html.lg-dark .lg-tag--contract { color: #93c5fd; }
html.lg-dark .lg-tag--consent  { color: #6ee7b7; }
html.lg-dark .lg-tag--interest { color: #fcd34d; }
html.lg-dark .lg-tag--legal    { color: #a5b4fc; }
html.lg-dark .lg-tag--vital    { color: #fca5a5; }

.lg-scroll-hint {
  display: none;
  padding: 8px 16px;
  font-size: .73rem;
  font-weight: 700;
  color: var(--lg-faint);
  border-top: 1px solid var(--lg-line-soft);
  background: var(--lg-hover);
}
@media (max-width: 720px) { .lg-scroll-hint { display: block; } }

/* --- 13. Definizioni ---------------------------------------------------- */
.lg-defs { margin: 18px 0; display: grid; gap: 10px; }
.lg-def {
  padding: 15px 18px;
  border-radius: 14px;
  border: 1px solid var(--lg-line);
  background: var(--lg-surface-2);
  border-left: 3px solid var(--lg-red);
}
.lg-def dt { font-weight: 800; color: var(--lg-strong); font-size: .92rem; margin-bottom: 3px; letter-spacing: -.01em; }
.lg-def dd { margin: 0; font-size: .89rem; line-height: 1.66; color: var(--lg-body); }

/* --- 14. Contatti / firma ----------------------------------------------- */
.lg-contact {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin: 20px 0;
}
.lg-contact > div {
  padding: 17px 19px;
  border-radius: 15px;
  border: 1px solid var(--lg-line);
  background: var(--lg-surface-2);
}
.lg-contact b { display: block; font-size: .7rem; font-weight: 900; letter-spacing: .11em; text-transform: uppercase; color: var(--lg-faint); margin-bottom: 6px; }
.lg-contact span, .lg-contact a { font-size: .93rem; font-weight: 700; color: var(--lg-strong); }

.lg-sign {
  margin-top: 44px;
  padding: 22px 24px;
  border-radius: 16px;
  border: 1px dashed var(--lg-line);
  background: var(--lg-hover);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  font-size: .85rem;
  color: var(--lg-muted);
}
.lg-sign b { color: var(--lg-strong); }

/* --- 15. Changelog ------------------------------------------------------ */
.lg-timeline { list-style: none; margin: 18px 0 0; padding: 0 0 0 22px; border-left: 2px solid var(--lg-line); }
.lg-timeline > li { position: relative; padding: 0 0 20px 20px; margin: 0; }
.lg-timeline > li::before {
  content: "";
  position: absolute;
  left: -29px; top: 6px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--lg-solid);
  border: 3px solid var(--lg-red);
  opacity: 1;
}
.lg-timeline > li:last-child { padding-bottom: 0; }
.lg-timeline time { display: block; font-size: .72rem; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: var(--lg-red); margin-bottom: 4px; }
.lg-timeline b { display: block; color: var(--lg-strong); font-size: .93rem; margin-bottom: 3px; }
.lg-timeline p { font-size: .875rem; color: var(--lg-muted); margin: 0; }

/* --- 16. Cross-link ----------------------------------------------------- */
.lg-crosslinks { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 13px; margin-top: 30px; }
.lg-crosslink {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 19px;
  border-radius: 17px;
  background: var(--lg-surface);
  border: 1px solid var(--lg-line);
  box-shadow: var(--lg-shadow-sm);
  text-decoration: none;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.lg-crosslink:hover { transform: translateY(-3px); box-shadow: var(--lg-shadow); border-color: var(--lg-red-line); }
.lg-crosslink-ico {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: var(--lg-red-wash);
  color: var(--lg-red);
  border: 1px solid var(--lg-red-line);
}
.lg-crosslink-ico svg { width: 21px; height: 21px; }
.lg-crosslink b { display: block; font-size: .93rem; font-weight: 800; color: var(--lg-strong); letter-spacing: -.01em; }
.lg-crosslink span { display: block; font-size: .8rem; color: var(--lg-muted); margin-top: 2px; }
.lg-crosslink-go { margin-left: auto; color: var(--lg-faint); }
.lg-crosslink:hover .lg-crosslink-go { color: var(--lg-red); }
.lg-crosslink-go svg { width: 18px; height: 18px; }

/* --- 17. Footer --------------------------------------------------------- */
.lg-footer {
  border-top: 1px solid var(--lg-line);
  background: var(--lg-surface-2);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  padding: 48px 0 40px;
}
.lg-footer-in { width: min(calc(100% - 32px), var(--lg-maxw)); margin: 0 auto; text-align: center; }
.lg-footer-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; margin-bottom: 14px; }
.lg-footer-brand img { height: 30px; }
.lg-footer-brand b { font-size: 1.3rem; font-weight: 900; color: var(--lg-strong); letter-spacing: -.03em; }
.lg-footer-brand b span { color: var(--lg-red); }
.lg-footer p { font-size: .84rem; color: var(--lg-muted); margin: 0 0 6px; }
.lg-footer-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; margin-top: 20px; }
.lg-footer-legal a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 12px;
  border: 1px solid var(--lg-line);
  background: var(--lg-solid);
  font-size: .83rem;
  font-weight: 700;
  color: var(--lg-body);
  text-decoration: none;
  transition: all .2s ease;
}
.lg-footer-legal a svg { width: 15px; height: 15px; color: var(--lg-red); }
.lg-footer-legal a:hover { border-color: var(--lg-red-line); color: var(--lg-red); transform: translateY(-2px); box-shadow: var(--lg-shadow-sm); }
.lg-footer-legal a[aria-current="page"] { border-color: var(--lg-red-line); background: var(--lg-red-wash); color: var(--lg-red); }
.lg-footer-fine { margin-top: 22px; font-size: .74rem; color: var(--lg-faint); line-height: 1.7; max-width: 74ch; margin-left: auto; margin-right: auto; }

/* --- 18. Torna su ------------------------------------------------------- */
.lg-fab {
  position: fixed;
  right: 22px; bottom: 22px;
  z-index: 900;
  width: 48px; height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  border: 1px solid var(--lg-line);
  background: var(--lg-surface-2);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: var(--lg-shadow);
  color: var(--lg-strong);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .25s ease, transform .25s ease, visibility .25s ease, border-color .2s ease;
}
.lg-fab.is-on { opacity: 1; visibility: visible; transform: translateY(0); }
.lg-fab:hover { border-color: var(--lg-red-line); color: var(--lg-red); }
.lg-fab svg { width: 20px; height: 20px; }

/* --- 19. Toast ---------------------------------------------------------- */
.lg-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 24px);
  z-index: 10001;
  padding: 12px 20px;
  border-radius: 13px;
  background: #0b1220;
  color: #fff;
  font-size: .87rem;
  font-weight: 700;
  box-shadow: var(--lg-shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}
.lg-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* --- 20. Utility -------------------------------------------------------- */
.lg-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.lg-skip {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 10002;
  padding: 11px 18px;
  border-radius: 12px;
  background: #0b1220;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transition: top .2s ease;
}
.lg-skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--lg-red-bright); outline-offset: 2px; border-radius: 6px; }

/* --- 21. Stampa --------------------------------------------------------- */
@media print {
  @page { margin: 16mm 14mm; }
  html.lg-dark { --lg-ink: #000; --lg-strong: #000; --lg-body: #222; }
  body { padding-top: 0; background: #fff; color: #000; font-size: 10.5pt; line-height: 1.55; }
  .lg-backdrop, .lg-grain, .lg-progress, .lg-nav, .lg-aside, .lg-toc-mobile,
  .lg-fab, .lg-actions, .lg-toast, .lg-crosslinks, .lg-skip { display: none !important; }
  .lg-shell { width: 100%; }
  .lg-layout { display: block; margin: 0; }
  .lg-hero, .lg-doc {
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .lg-hero { margin: 0 0 14mm; padding-bottom: 6mm !important; border-bottom: 1pt solid #ccc !important; }
  .lg-hero::before, .lg-hero::after { display: none; }
  .lg-title { font-size: 22pt; }
  .lg-h2 { font-size: 13pt; break-after: avoid; page-break-after: avoid; }
  .lg-h3, .lg-h4 { break-after: avoid; page-break-after: avoid; }
  .lg-section { break-inside: auto; border-top: 0; padding-top: 6mm; margin-top: 6mm; }
  .lg-num { background: #dc2626 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lg-tablewrap, .lg-note, .lg-card, .lg-def { break-inside: avoid; page-break-inside: avoid; }
  .lg-tablewrap table { min-width: 0; font-size: 8.6pt; }
  .lg-tablescroll { overflow: visible; }
  .lg-doc a { color: #000; text-decoration: underline; }
  .lg-doc a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 7.5pt; color: #555; word-break: break-all; }
  .lg-footer { padding: 6mm 0 0; border-top: 1pt solid #ccc; background: none; }
  .lg-footer-legal { display: none; }
}

/* --- 22. Segnaposto redazionali ----------------------------------------- */
/* Campi che il titolare deve completare prima della pubblicazione.
   Sono volutamente evidenti: un dato identificativo mancante in
   un'informativa è una violazione dell'art. 13 GDPR, non un dettaglio. */
.lg-fill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 6px;
  background: repeating-linear-gradient(135deg, rgba(245, 158, 11, .16) 0 8px, rgba(245, 158, 11, .26) 8px 16px);
  border: 1px dashed rgba(217, 119, 6, .55);
  color: #92400e;
  font-weight: 700;
  font-size: .92em;
  font-style: normal;
}
html.lg-dark .lg-fill { color: #fcd34d; border-color: rgba(252, 211, 77, .5); }
@media print { .lg-fill { background: none; border: 1px solid #999; color: #000; } }

/* --- 23. Degradazione senza JavaScript ---------------------------------- */
/* L'indice è generato dal documento a runtime. Se lo script non gira, il
   riquadro resterebbe vuoto: meglio non mostrarlo affatto. Il testo del
   documento resta interamente leggibile in ogni caso. */
.lg-toc:has(.lg-toc-list:empty) { display: none; }
.lg-toc-mobile:has(.lg-toc-list:empty) { display: none; }
@media (min-width: 1081px) {
  .lg-layout:has(.lg-toc-list:empty) { grid-template-columns: minmax(0, 1fr); }
}
