/* ==========================================================================
   VETRO UI — v1.34.0
   Sistema di design modulare, leggero e senza dipendenze.
   --------------------------------------------------------------------------
   Indice
   01 · Token & temi (colori modulari: cambia una variabile, cambia tutto)
   02 · Reset & base
   03 · Tipografia
   04 · Layout: container, sezioni, griglia 12 colonne, utilities
   05 · Bottoni, badge, chip
   06 · Form
   07 · Navbar, dropdown, tabs, accordion
   08 · Card, alert, modal, toast, tooltip, progress, skeleton
   09 · Tabelle & DataTable
   10 · Calendario
   11 · Flow, timeline, KPI & dashboard
   12 · Parallax, animazioni, reveal
   13 · Stampa
   ========================================================================== */

/* ==========================================================================
   01 · TOKEN & TEMI
   Personalizza SOLO le variabili --c-* : tinte hover, sfondi soft, bordi e
   testi colorati vengono derivati automaticamente con color-mix().
   ========================================================================== */
:root {
  /* ---- Brand (variabili con valore di default) -------------------------
     Ogni colore è un seme sovrascrivibile: definisci --vt-primary,
     --vt-secondary, … su :root (o inline) e tutta la UI si ricalcola.
     In alternativa sovrascrivi direttamente --c-primary ecc.
     A runtime: Vetro.theme.colors({ primary:"#…", secondary:"#…" }).   */
  --c-primary:   var(--vt-primary,   #0fa387);  /* laguna   */
  --c-secondary: var(--vt-secondary, #64748b);  /* ardesia  */
  --c-accent:    var(--vt-accent,    #f76b15);  /* tramonto */
  --c-success:   var(--vt-success,   #45a557);
  --c-warning:   var(--vt-warning,   #f5a524);
  --c-danger:    var(--vt-danger,    #e5484d);
  --c-info:      var(--vt-info,      #3a8bfd);
  --on-brand:    var(--vt-on-brand,  #ffffff);  /* testo sopra colori pieni */

  /* ---- Geometria ------------------------------------------------------- */
  --radius-s: 9px;
  --radius-m: 14px;
  --radius-l: 22px;
  --radius-pill: 999px;
  --border-w: 1px;

  /* ---- Spaziatura (scala 4px) ------------------------------------------ */
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem;  --sp-7: 3rem;   --sp-8: 4rem; --sp-9: 6rem;

  /* ---- Font ------------------------------------------------------------ */
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "SF Pro Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --fs-xs: .75rem;
  --fs-sm: .8125rem;
  --fs-base: .9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: 1.25rem;

  /* ---- Motion ----------------------------------------------------------- */
  --ease: cubic-bezier(.22,.8,.32,1);
  --ease-pop: cubic-bezier(.34,1.56,.5,1);
  --t-fast: 140ms;
  --t-med: 260ms;
  --t-slow: 480ms;

  /* ---- Z-index ---------------------------------------------------------- */
  --z-nav: 100; --z-drop: 200; --z-modal: 500; --z-toast: 900;

  /* ---- Derivati brand (NON toccare: seguono --c-*) ---------------------- */
  --grad-brand: linear-gradient(120deg, var(--c-primary), var(--c-accent));
  --primary-hover:  color-mix(in oklab, var(--c-primary) 84%, var(--ink));
  --primary-soft:   color-mix(in srgb, var(--c-primary) 13%, var(--surface));
  --primary-soft-2: color-mix(in srgb, var(--c-primary) 22%, var(--surface));
  --primary-border: color-mix(in srgb, var(--c-primary) 42%, var(--border));
  --primary-text:   color-mix(in oklab, var(--c-primary) 72%, var(--ink));

  --accent-hover:  color-mix(in oklab, var(--c-accent) 84%, var(--ink));
  --accent-soft:   color-mix(in srgb, var(--c-accent) 14%, var(--surface));
  --accent-border: color-mix(in srgb, var(--c-accent) 42%, var(--border));
  --accent-text:   color-mix(in oklab, var(--c-accent) 72%, var(--ink));

  --secondary-hover:  color-mix(in oklab, var(--c-secondary) 84%, var(--ink));
  --secondary-soft:   color-mix(in srgb, var(--c-secondary) 14%, var(--surface));
  --secondary-border: color-mix(in srgb, var(--c-secondary) 42%, var(--border));
  --secondary-text:   color-mix(in oklab, var(--c-secondary) 72%, var(--ink));

  --success-hover:  color-mix(in oklab, var(--c-success) 84%, var(--ink));
  --success-soft:   color-mix(in srgb, var(--c-success) 14%, var(--surface));
  --success-border: color-mix(in srgb, var(--c-success) 42%, var(--border));
  --success-text:   color-mix(in oklab, var(--c-success) 72%, var(--ink));

  --warning-hover:  color-mix(in oklab, var(--c-warning) 84%, var(--ink));
  --warning-soft:   color-mix(in srgb, var(--c-warning) 16%, var(--surface));
  --warning-border: color-mix(in srgb, var(--c-warning) 46%, var(--border));
  --warning-text:   color-mix(in oklab, var(--c-warning) 60%, var(--ink));

  --danger-hover:  color-mix(in oklab, var(--c-danger) 84%, var(--ink));
  --danger-soft:   color-mix(in srgb, var(--c-danger) 13%, var(--surface));
  --danger-border: color-mix(in srgb, var(--c-danger) 42%, var(--border));
  --danger-text:   color-mix(in oklab, var(--c-danger) 74%, var(--ink));

  --info-hover:  color-mix(in oklab, var(--c-info) 84%, var(--ink));
  --info-soft:   color-mix(in srgb, var(--c-info) 13%, var(--surface));
  --info-border: color-mix(in srgb, var(--c-info) 42%, var(--border));
  --info-text:   color-mix(in oklab, var(--c-info) 74%, var(--ink));

  color-scheme: light dark;
  accent-color: var(--c-primary);
}

/* ---- Tema CHIARO (default) ----------------------------------------------
   Ogni neutro è un seme sovrascrivibile: definisci --vt-bg, --vt-surface…
   (e le versioni --vt-*-dark) su :root per ricolorare ENTRAMBI i temi
   senza toccare questo file. I valori qui sotto sono i default.        */
:root, html[data-theme="light"] {
  --bg: var(--vt-bg, #f3f5f6);
  --surface: var(--vt-surface, #ffffff);
  --surface-2: var(--vt-surface-2, #eceff1);
  --surface-3: var(--vt-surface-3, #e2e7ea);
  --text: var(--vt-text, #131c24);
  --text-2: var(--vt-text-2, #51606c);
  --text-3: var(--vt-text-3, #8b98a3);
  --border: var(--vt-border, #dde3e7);
  --border-2: var(--vt-border-2, #c6cfd6);
  --ink: var(--vt-ink, #0b1420);     /* direzione del contrasto (testo) */
  --paper: var(--vt-paper, #ffffff); /* direzione della superficie      */
  --glass-bg: color-mix(in srgb, #ffffff 68%, transparent);
  --glass-border: color-mix(in srgb, #ffffff 55%, transparent);
  --backdrop: rgb(15 23 32 / .45);
  --shadow-s: 0 1px 2px rgb(10 22 33 / .07), 0 1px 1px rgb(10 22 33 / .04);
  --shadow-m: 0 10px 28px -10px rgb(10 22 33 / .18), 0 2px 6px -2px rgb(10 22 33 / .08);
  --shadow-l: 0 28px 60px -18px rgb(10 22 33 / .26), 0 6px 18px -8px rgb(10 22 33 / .12);
}
html[data-theme="light"] { color-scheme: light; }

/* ---- Tema SCURO ---------------------------------------------------------- */
html[data-theme="dark"] {
  --bg: var(--vt-bg-dark, #0c111e);
  --surface: var(--vt-surface-dark, #131a2b);
  --surface-2: var(--vt-surface-2-dark, #1a2335);
  --surface-3: var(--vt-surface-3-dark, #232e44);
  --text: var(--vt-text-dark, #e8eef7);
  --text-2: var(--vt-text-2-dark, #9aa8bd);
  --text-3: var(--vt-text-3-dark, #66758d);
  --border: var(--vt-border-dark, #27324a);
  --border-2: var(--vt-border-2-dark, #364361);
  --ink: var(--vt-ink-dark, #eef4ff);
  --paper: var(--vt-paper-dark, #0b1018);
  --glass-bg: color-mix(in srgb, #131a2b 62%, transparent);
  --glass-border: color-mix(in srgb, #aebcd8 16%, transparent);
  --backdrop: rgb(2 6 14 / .6);
  --shadow-s: 0 1px 2px rgb(0 0 0 / .35);
  --shadow-m: 0 12px 30px -12px rgb(0 0 0 / .55), 0 2px 8px -2px rgb(0 0 0 / .4);
  --shadow-l: 0 30px 70px -20px rgb(0 0 0 / .65), 0 8px 22px -10px rgb(0 0 0 / .5);
  color-scheme: dark;
}

/* ---- Tema AUTO: segue il sistema quando manca data-theme ----------------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --bg: var(--vt-bg-dark, #0c111e);
    --surface: var(--vt-surface-dark, #131a2b);
    --surface-2: var(--vt-surface-2-dark, #1a2335);
    --surface-3: var(--vt-surface-3-dark, #232e44);
    --text: var(--vt-text-dark, #e8eef7);
    --text-2: var(--vt-text-2-dark, #9aa8bd);
    --text-3: var(--vt-text-3-dark, #66758d);
    --border: var(--vt-border-dark, #27324a);
    --border-2: var(--vt-border-2-dark, #364361);
    --ink: var(--vt-ink-dark, #eef4ff);
    --paper: var(--vt-paper-dark, #0b1018);
    --glass-bg: color-mix(in srgb, #131a2b 62%, transparent);
    --glass-border: color-mix(in srgb, #aebcd8 16%, transparent);
    --backdrop: rgb(2 6 14 / .6);
    --shadow-s: 0 1px 2px rgb(0 0 0 / .35);
    --shadow-m: 0 12px 30px -12px rgb(0 0 0 / .55), 0 2px 8px -2px rgb(0 0 0 / .4);
    --shadow-l: 0 30px 70px -20px rgb(0 0 0 / .65), 0 8px 22px -10px rgb(0 0 0 / .5);
  }
}

/* ==========================================================================
   02 · RESET & BASE
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 84px; /* compensazione navbar sticky per gli anchor */
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--t-med) var(--ease), color var(--t-med) var(--ease);
}

img, picture, video, canvas, svg { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
iframe { border: 0; }
:disabled { cursor: not-allowed; }

::selection { background: var(--primary-soft-2); color: var(--text); }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--c-primary) 80%, transparent);
  outline-offset: 2px;
  border-radius: var(--radius-s);
}

/* Scrollbar coerente con il tema */
* { scrollbar-width: thin; scrollbar-color: var(--border-2) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 99px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

hr { border: 0; border-top: var(--border-w) solid var(--border); margin-block: var(--sp-5); }

/* ==========================================================================
   03 · TIPOGRAFIA
   ========================================================================== */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.015em;
  color: var(--text);
  text-wrap: balance;
}
h1, .h1 { font-size: clamp(1.9rem, 1.35rem + 2.2vw, 2.75rem); }
h2, .h2 { font-size: clamp(1.5rem, 1.2rem + 1.3vw, 2.05rem); }
h3, .h3 { font-size: clamp(1.2rem, 1.05rem + .7vw, 1.5rem); }
h4, .h4 { font-size: 1.125rem; }
h5, .h5 { font-size: 1rem; }
h6, .h6 { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .08em; }

.display {
  font-size: clamp(2.5rem, 1.6rem + 4.6vw, 4.4rem);
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.02;
}

p { margin-block: 0 var(--sp-4); }
.lead { font-size: var(--fs-lg); color: var(--text-2); line-height: 1.55; }
.small, small { font-size: var(--fs-sm); }
.tiny { font-size: var(--fs-xs); }

a { color: var(--primary-text); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--c-primary); text-decoration: underline; text-underline-offset: 3px; }

strong, b { font-weight: 640; }

code, kbd, pre, .mono { font-family: var(--font-mono); }
code {
  font-size: .85em;
  background: var(--surface-2);
  border: var(--border-w) solid var(--border);
  border-radius: 6px;
  padding: .12em .4em;
  color: var(--accent-text);
}
pre.code {
  background: var(--surface-2);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  padding: var(--sp-4) var(--sp-5);
  font-size: var(--fs-sm);
  line-height: 1.7;
  overflow-x: auto;
  tab-size: 2;
  /* le righe lunghe vanno a capo invece di far scorrere il blocco in
     orizzontale; l'indentazione a inizio riga resta intatta (pre-wrap) */
  white-space: pre-wrap;
  overflow-wrap: break-word;
}
pre.code.nowrap { white-space: pre; }
pre.code code { background: none; border: 0; padding: 0; color: var(--text); }
/* bottone "copia" automatico su ogni pre.code */
pre.code { position: relative; }
.code-copy {
  position: absolute; top: 8px; right: 8px;
  display: inline-flex; align-items: center; gap: .35em;
  font-family: var(--font-mono); font-size: var(--fs-xs); line-height: 1;
  padding: .4em .6em; border-radius: 8px; cursor: pointer;
  color: var(--text-2);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border: var(--border-w) solid var(--border-2);
  opacity: 0; transition: opacity var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
  backdrop-filter: blur(4px);
}
pre.code:hover .code-copy, .code-copy:focus-visible { opacity: 1; }
.code-copy:hover { color: var(--c-primary); border-color: var(--c-primary); }
.code-copy.is-done { color: var(--c-success); border-color: var(--c-success); opacity: 1; }
.code-copy .icon { width: 14px; height: 14px; }
@media (hover: none) { pre.code .code-copy { opacity: 1; } }
/* lascia spazio all'eventuale tag lingua già presente in basso a destra */
.kbd {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  background: var(--surface);
  border: var(--border-w) solid var(--border-2);
  border-bottom-width: 2px;
  border-radius: 7px;
  padding: .15em .5em;
}

/* Occhiello di sezione — firma tipografica di Vetro */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--primary-text);
}
.eyebrow::before {
  content: "";
  width: .65em; height: .65em;
  border-radius: 3px;
  background: var(--grad-brand);
  transform: rotate(45deg);
}

.text-grad {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Colori testuali */
.text-muted   { color: var(--text-2); }
.text-2       { color: var(--text-2); }  /* testo secondario (usata in tutte le demo) */
.text-3       { color: var(--text-3); }  /* testo terziario/didascalie */
.text-faint   { color: var(--text-3); }
.text-primary { color: var(--primary-text); }
.text-accent  { color: var(--accent-text); }
.text-success { color: var(--success-text); }
.text-warning { color: var(--warning-text); }
.text-danger  { color: var(--danger-text); }
.text-info    { color: var(--info-text); }

.text-center { text-align: center; }
.text-right  { text-align: right; }
.upper { text-transform: uppercase; letter-spacing: .06em; }
.fw-400 { font-weight: 400; } .fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; }

/* Icone SVG (sprite montato da vetro.js) */
.icon {
  width: 1.25em; height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -.28em;
}
.icon-s { width: 1em; height: 1em; }
.icon-l { width: 1.6em; height: 1.6em; }

/* ==========================================================================
   04 · LAYOUT — container, sezioni, griglia, utilities
   Breakpoint: sm 640 · md 768 · lg 1024 · xl 1280
   ========================================================================== */
.container { width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }
.container-narrow { max-width: 880px; }
.container-fluid { max-width: none; }

.section { padding-block: clamp(56px, 9vw, 108px); }
.section-s { padding-block: clamp(32px, 5vw, 56px); }
.section-head { max-width: 640px; margin-bottom: var(--sp-6); }
.section-head h2 { margin-block: .35em .35em; }

/* ---- Griglia a 12 colonne (CSS Grid) ---- */
.grid { display: grid; gap: var(--gap, var(--sp-4)); }
.grid-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
/* su schermi stretti il column-gap di una griglia a 12 tracce (11 gap fissi)
   farebbe sforare la riga: lo limitiamo, lasciando intatto il row-gap (--gap) */
@media (max-width: 640px) {
  .grid-12 { column-gap: min(var(--gap, var(--sp-4)), var(--sp-3)); }
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* Card responsive senza media query: si adattano da sole */
.grid-auto { display: grid; gap: var(--gap, var(--sp-4)); grid-template-columns: repeat(auto-fill, minmax(min(var(--min, 240px), 100%), 1fr)); }
.grid-auto-fit { display: grid; gap: var(--gap, var(--sp-4)); grid-template-columns: repeat(auto-fit, minmax(min(var(--min, 240px), 1fr), 1fr)); }

.col-1{grid-column:span 1}.col-2{grid-column:span 2}.col-3{grid-column:span 3}
.col-4{grid-column:span 4}.col-5{grid-column:span 5}.col-6{grid-column:span 6}
.col-7{grid-column:span 7}.col-8{grid-column:span 8}.col-9{grid-column:span 9}
.col-10{grid-column:span 10}.col-11{grid-column:span 11}.col-12{grid-column:span 12}
.col-full{grid-column:1/-1}

@media (min-width:640px){
.col-sm-1{grid-column:span 1}.col-sm-2{grid-column:span 2}.col-sm-3{grid-column:span 3}
.col-sm-4{grid-column:span 4}.col-sm-5{grid-column:span 5}.col-sm-6{grid-column:span 6}
.col-sm-7{grid-column:span 7}.col-sm-8{grid-column:span 8}.col-sm-9{grid-column:span 9}
.col-sm-10{grid-column:span 10}.col-sm-11{grid-column:span 11}.col-sm-12{grid-column:span 12}
}
@media (min-width:768px){
.col-md-1{grid-column:span 1}.col-md-2{grid-column:span 2}.col-md-3{grid-column:span 3}
.col-md-4{grid-column:span 4}.col-md-5{grid-column:span 5}.col-md-6{grid-column:span 6}
.col-md-7{grid-column:span 7}.col-md-8{grid-column:span 8}.col-md-9{grid-column:span 9}
.col-md-10{grid-column:span 10}.col-md-11{grid-column:span 11}.col-md-12{grid-column:span 12}
}
@media (min-width:1024px){
.col-lg-1{grid-column:span 1}.col-lg-2{grid-column:span 2}.col-lg-3{grid-column:span 3}
.col-lg-4{grid-column:span 4}.col-lg-5{grid-column:span 5}.col-lg-6{grid-column:span 6}
.col-lg-7{grid-column:span 7}.col-lg-8{grid-column:span 8}.col-lg-9{grid-column:span 9}
.col-lg-10{grid-column:span 10}.col-lg-11{grid-column:span 11}.col-lg-12{grid-column:span 12}
}
@media (min-width:1280px){
.col-xl-1{grid-column:span 1}.col-xl-2{grid-column:span 2}.col-xl-3{grid-column:span 3}
.col-xl-4{grid-column:span 4}.col-xl-5{grid-column:span 5}.col-xl-6{grid-column:span 6}
.col-xl-7{grid-column:span 7}.col-xl-8{grid-column:span 8}.col-xl-9{grid-column:span 9}
.col-xl-10{grid-column:span 10}.col-xl-11{grid-column:span 11}.col-xl-12{grid-column:span 12}
}

/* ---- Flex utilities ---- */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.col-dir { flex-direction: column; }
.wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-1 { flex: 1 1 0%; min-width: 0; }
.shrink-0 { flex-shrink: 0; }

.gap-1{gap:var(--sp-1)}.gap-2{gap:var(--sp-2)}.gap-3{gap:var(--sp-3)}
.gap-4{gap:var(--sp-4)}.gap-5{gap:var(--sp-5)}.gap-6{gap:var(--sp-6)}.gap-7{gap:var(--sp-7)}

/* ---- Spaziatura ---- */
.m-0{margin:0}.mt-0{margin-top:0}.mb-0{margin-bottom:0}
.m-1{margin:var(--sp-1)}.m-2{margin:var(--sp-2)}.m-3{margin:var(--sp-3)}.m-4{margin:var(--sp-4)}.m-5{margin:var(--sp-5)}.m-6{margin:var(--sp-6)}
.mt-1{margin-top:var(--sp-1)}.mt-2{margin-top:var(--sp-2)}.mt-3{margin-top:var(--sp-3)}.mt-4{margin-top:var(--sp-4)}.mt-5{margin-top:var(--sp-5)}.mt-6{margin-top:var(--sp-6)}.mt-7{margin-top:var(--sp-7)}
.mb-1{margin-bottom:var(--sp-1)}.mb-2{margin-bottom:var(--sp-2)}.mb-3{margin-bottom:var(--sp-3)}.mb-4{margin-bottom:var(--sp-4)}.mb-5{margin-bottom:var(--sp-5)}.mb-6{margin-bottom:var(--sp-6)}.mb-7{margin-bottom:var(--sp-7)}
.mx-auto{margin-inline:auto}.ms-auto{margin-inline-start:auto}.me-auto{margin-inline-end:auto}
.my-1{margin-block:var(--sp-1)}.my-2{margin-block:var(--sp-2)}.my-3{margin-block:var(--sp-3)}.my-4{margin-block:var(--sp-4)}.my-5{margin-block:var(--sp-5)}.my-6{margin-block:var(--sp-6)}

.p-0{padding:0}
.p-1{padding:var(--sp-1)}.p-2{padding:var(--sp-2)}.p-3{padding:var(--sp-3)}.p-4{padding:var(--sp-4)}.p-5{padding:var(--sp-5)}.p-6{padding:var(--sp-6)}
.pt-2{padding-top:var(--sp-2)}.pt-4{padding-top:var(--sp-4)}.pt-6{padding-top:var(--sp-6)}
.pb-2{padding-bottom:var(--sp-2)}.pb-4{padding-bottom:var(--sp-4)}.pb-6{padding-bottom:var(--sp-6)}
.px-2{padding-inline:var(--sp-2)}.px-3{padding-inline:var(--sp-3)}.px-4{padding-inline:var(--sp-4)}.px-5{padding-inline:var(--sp-5)}
.py-2{padding-block:var(--sp-2)}.py-3{padding-block:var(--sp-3)}.py-4{padding-block:var(--sp-4)}.py-5{padding-block:var(--sp-5)}
/* margin per lato sinistro/destro (logici: start/end) */
.ml-0{margin-left:0}.ml-1{margin-left:var(--sp-1)}.ml-2{margin-left:var(--sp-2)}.ml-3{margin-left:var(--sp-3)}.ml-4{margin-left:var(--sp-4)}.ml-5{margin-left:var(--sp-5)}.ml-6{margin-left:var(--sp-6)}
.mr-0{margin-right:0}.mr-1{margin-right:var(--sp-1)}.mr-2{margin-right:var(--sp-2)}.mr-3{margin-right:var(--sp-3)}.mr-4{margin-right:var(--sp-4)}.mr-5{margin-right:var(--sp-5)}.mr-6{margin-right:var(--sp-6)}
.ms-1{margin-inline-start:var(--sp-1)}.ms-2{margin-inline-start:var(--sp-2)}.ms-3{margin-inline-start:var(--sp-3)}.ms-4{margin-inline-start:var(--sp-4)}
.me-1{margin-inline-end:var(--sp-1)}.me-2{margin-inline-end:var(--sp-2)}.me-3{margin-inline-end:var(--sp-3)}.me-4{margin-inline-end:var(--sp-4)}
/* padding per lato sinistro/destro */
.pl-0{padding-left:0}.pl-1{padding-left:var(--sp-1)}.pl-2{padding-left:var(--sp-2)}.pl-3{padding-left:var(--sp-3)}.pl-4{padding-left:var(--sp-4)}.pl-5{padding-left:var(--sp-5)}.pl-6{padding-left:var(--sp-6)}
.pr-0{padding-right:0}.pr-1{padding-right:var(--sp-1)}.pr-2{padding-right:var(--sp-2)}.pr-3{padding-right:var(--sp-3)}.pr-4{padding-right:var(--sp-4)}.pr-5{padding-right:var(--sp-5)}.pr-6{padding-right:var(--sp-6)}
/* bordi per lato, spessore, colore e raggi per lato */
.border-0{border:0}.border-2{border-width:calc(var(--border-w) * 2)}
.border-t{border-top:var(--border-w) solid var(--border)}.border-r{border-right:var(--border-w) solid var(--border)}
.border-b{border-bottom:var(--border-w) solid var(--border)}.border-l{border-left:var(--border-w) solid var(--border)}
.border-primary{border-color:var(--c-primary)}.border-accent{border-color:var(--c-accent)}.border-info{border-color:var(--c-info)}
.border-success{border-color:var(--c-success)}.border-warning{border-color:var(--c-warning)}.border-danger{border-color:var(--c-danger)}
.rounded-none{border-radius:0}.rounded-t{border-radius:var(--radius-m) var(--radius-m) 0 0}.rounded-b{border-radius:0 0 var(--radius-m) var(--radius-m)}
.rounded-l-s{border-radius:var(--radius-s) 0 0 var(--radius-s)}.rounded-r-s{border-radius:0 var(--radius-s) var(--radius-s) 0}

/* ---- Display & helpers ---- */
.block{display:block}.inline-block{display:inline-block}.hidden{display:none!important}
.relative{position:relative}.sticky-top{position:sticky;top:84px}
.w-full{width:100%}.h-full{height:100%}
.maxw-prose{max-width:62ch}
.overflow-hidden{overflow:hidden}
.rounded{border-radius:var(--radius-m)}.rounded-s{border-radius:var(--radius-s)}.rounded-l{border-radius:var(--radius-l)}.rounded-full{border-radius:var(--radius-pill)}
.border{border:var(--border-w) solid var(--border)}
.shadow-s{box-shadow:var(--shadow-s)}.shadow-m{box-shadow:var(--shadow-m)}.shadow-l{box-shadow:var(--shadow-l)}
.bg-surface{background:var(--surface)}.bg-surface-2{background:var(--surface-2)}.bg-soft{background:var(--primary-soft)}
/* livelli di opacità (decili) */
.opacity-0{opacity:0}.opacity-10{opacity:.1}.opacity-20{opacity:.2}.opacity-30{opacity:.3}.opacity-40{opacity:.4}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-80{opacity:.8}.opacity-90{opacity:.9}.opacity-100{opacity:1}
/* visibilità & interazione */
.invisible{visibility:hidden}.visible{visibility:visible}
.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}
.select-none{user-select:none;-webkit-user-select:none}
.cursor-pointer{cursor:pointer}.cursor-not-allowed{cursor:not-allowed}.cursor-grab{cursor:grab}.cursor-wait{cursor:wait}

/* Responsive show/hide */
@media (max-width:767.98px){ .hide-mobile{display:none!important} }
@media (min-width:768px){ .only-mobile{display:none!important} }
@media (max-width:1023.98px){ .hide-tablet{display:none!important} }
@media (min-width:1024px){ .only-tablet-down{display:none!important} }

/* Superficie "vetro" — la firma del kit */
.vetro {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border: var(--border-w) solid var(--glass-border);
}

/* Nastro sfumato sul bordo superiore */
.ribbon { position: relative; }
.ribbon::before {
  content: "";
  position: absolute; inset: 0 0 auto 0;
  height: 3px;
  background: var(--grad-brand);
  border-radius: var(--radius-m) var(--radius-m) 0 0;
}

.divider-label {
  display: flex; align-items: center; gap: var(--sp-3);
  color: var(--text-3); font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: .12em;
}
.divider-label::before, .divider-label::after { content:""; flex:1; border-top: var(--border-w) solid var(--border); }

/* ==========================================================================
   05 · BOTTONI, BADGE, CHIP
   Ogni variante imposta solo --btn-c: il resto si deriva da solo.
   ========================================================================== */
.btn {
  --btn-c: var(--c-primary);
  --btn-on: var(--on-brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .62em 1.15em;
  border: var(--border-w) solid transparent;
  border-radius: var(--radius-s);
  font-weight: 600;
  font-size: var(--fs-base);
  line-height: 1.2;
  color: var(--btn-on);
  background:
    linear-gradient(180deg, color-mix(in oklab, var(--btn-c) 90%, #fff) 0%, var(--btn-c) 55%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 4px 14px -6px color-mix(in srgb, var(--btn-c) 55%, transparent);
  text-decoration: none;
  user-select: none;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease),
              background-color var(--t-fast) var(--ease), filter var(--t-fast) var(--ease);
}
.btn:hover { filter: brightness(1.05) saturate(1.05); text-decoration: none; color: var(--btn-on);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .22), 0 8px 20px -8px color-mix(in srgb, var(--btn-c) 65%, transparent);
  transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.985); filter: brightness(.97); }
.btn:disabled, .btn.is-disabled { opacity: .55; pointer-events: none; box-shadow: none; }

.btn-secondary { --btn-c: var(--c-secondary); }
.btn-accent  { --btn-c: var(--c-accent); }
.btn-success { --btn-c: var(--c-success); }
.btn-warning { --btn-c: var(--c-warning); --btn-on: #271a02; }
.btn-danger  { --btn-c: var(--c-danger); }
.btn-info    { --btn-c: var(--c-info); }
.btn-dark    { --btn-c: var(--ink); --btn-on: var(--paper); }

.btn-soft {
  background: color-mix(in srgb, var(--btn-c) 14%, var(--surface));
  color: color-mix(in oklab, var(--btn-c) 72%, var(--ink));
  box-shadow: none;
}
.btn-soft:hover { background: color-mix(in srgb, var(--btn-c) 22%, var(--surface)); color: color-mix(in oklab, var(--btn-c) 78%, var(--ink)); filter:none; }

.btn-outline {
  background: transparent;
  border-color: color-mix(in srgb, var(--btn-c) 55%, var(--border));
  color: color-mix(in oklab, var(--btn-c) 72%, var(--ink));
  box-shadow: none;
}
.btn-outline:hover { background: color-mix(in srgb, var(--btn-c) 10%, transparent); filter:none; color: color-mix(in oklab, var(--btn-c) 80%, var(--ink)); }

.btn-ghost {
  background: transparent; box-shadow: none; color: var(--text-2);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); filter: none; }

.btn-grad { background: var(--grad-brand); box-shadow: 0 6px 18px -8px color-mix(in srgb, var(--c-accent) 60%, transparent); }

.btn-sm { padding: .4em .8em; font-size: var(--fs-sm); border-radius: 8px; }
.btn-lg { padding: .78em 1.5em; font-size: var(--fs-md); border-radius: 12px; }
.btn-pill { border-radius: var(--radius-pill); }
.btn-icon { padding: .58em; aspect-ratio: 1; }
.btn-icon.btn-sm { padding: .42em; }
.btn-block { width: 100%; }

.btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-loading::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 1.1em; height: 1.1em;
  border: 2px solid color-mix(in srgb, var(--btn-on) 35%, transparent);
  border-top-color: var(--btn-on);
  border-radius: 50%;
  animation: vt-spin .7s linear infinite;
}
.btn-soft.is-loading::after, .btn-outline.is-loading::after, .btn-ghost.is-loading::after {
  border-color: color-mix(in srgb, var(--btn-c) 30%, transparent);
  border-top-color: var(--btn-c);
}

.btn-group { display: inline-flex; }
.btn-group > .btn { border-radius: 0; }
.btn-group > .btn:first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.btn-group > .btn:last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.btn-group > .btn + .btn { margin-left: 1px; }

/* Segmented control (usato anche per lo switch tema) */
.seg {
  display: inline-flex; gap: 2px;
  background: var(--surface-2);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
}
.seg > button {
  border: 0; background: transparent; color: var(--text-2);
  padding: .35em .9em; border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: 600;
  display: inline-flex; align-items: center; gap: .45em;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.seg > button:hover { color: var(--text); }
.seg > button.is-active { background: var(--surface); color: var(--primary-text); box-shadow: var(--shadow-s); }

/* ---- Badge ---- */
.badge {
  --bd-c: var(--badge-c, var(--c-primary)); /* ricolora inline con --badge-c (come --btn-c per i bottoni) */
  display: inline-flex; align-items: center; gap: .35em;
  font-size: var(--fs-xs); font-weight: 600; line-height: 1;
  padding: .38em .65em;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--bd-c) 14%, var(--surface));
  color: color-mix(in oklab, var(--bd-c) 72%, var(--ink));
  border: var(--border-w) solid color-mix(in srgb, var(--bd-c) 26%, transparent);
  white-space: nowrap;
}
.badge-secondary{--bd-c:var(--c-secondary)}.badge-accent{--bd-c:var(--c-accent)}.badge-success{--bd-c:var(--c-success)}
.badge-warning{--bd-c:var(--c-warning)}.badge-danger{--bd-c:var(--c-danger)}
.badge-info{--bd-c:var(--c-info)}.badge-neutral{--bd-c:var(--text-3)}
.badge-solid { background: var(--bd-c); color: var(--on-brand); border-color: transparent; }
.badge-dot::before { content:""; width:.5em; height:.5em; border-radius:50%; background: var(--bd-c); }
.badge-lg { font-size: var(--fs-sm); padding: .5em .9em; }

/* ---- Chip (rimovibile) ---- */
.chip {
  display: inline-flex; align-items: center; gap: .45em;
  font-size: var(--fs-sm); font-weight: 500;
  padding: .35em .5em .35em .8em;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: var(--border-w) solid var(--border);
}
.chip button {
  border: 0; background: var(--surface-3); color: var(--text-2);
  width: 1.35em; height: 1.35em; border-radius: 50%;
  display: grid; place-items: center; font-size: .8em; line-height: 1;
}
.chip button:hover { background: var(--danger-soft); color: var(--danger-text); }

/* Avatar */
.avatar {
  --av: 38px;
  width: var(--av); height: var(--av);
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--primary-soft-2);
  color: var(--primary-text);
  font-weight: 700; font-size: calc(var(--av) * .38);
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-s);
  overflow: hidden; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-stack { display: inline-flex; }
.avatar-stack .avatar + .avatar { margin-left: calc(var(--av) * -.32); }

/* ==========================================================================
   06 · FORM
   ========================================================================== */
.field { display: flex; flex-direction: column; gap: .4rem; }
.field > label { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.field .help { font-size: var(--fs-xs); color: var(--text-3); }

.input {
  width: 100%;
  padding: .6em .85em;
  background: var(--surface);
  border: var(--border-w) solid var(--border-2);
  border-radius: var(--radius-s);
  color: var(--text);
  font-size: var(--fs-base);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.input::placeholder { color: var(--text-3); }
.input:hover { border-color: var(--border-2); }
.input:focus-visible {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 4px var(--primary-soft);
}
textarea.input { min-height: 96px; resize: vertical; }

select.input {
  appearance: none;
  padding-right: 2.4em;
  background-image:
    linear-gradient(45deg, transparent 49%, var(--text-2) 50%),
    linear-gradient(-45deg, transparent 49%, var(--text-2) 50%);
  background-position: calc(100% - 1.15em) 55%, calc(100% - .8em) 55%;
  background-size: .38em .38em;
  background-repeat: no-repeat;
}

.input-sm { padding: .4em .65em; font-size: var(--fs-sm); }
.input-lg { padding: .8em 1em; font-size: var(--fs-md); }

/* Gruppo con icona/addon */
.input-group { display: flex; align-items: stretch; }
.input-group .input { border-radius: 0; flex: 1; min-width: 0; }
.input-group > :first-child { border-radius: var(--radius-s) 0 0 var(--radius-s); }
.input-group > :last-child { border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.input-group .addon {
  display: inline-flex; align-items: center; gap: .4em;
  padding: 0 .8em;
  background: var(--surface-2);
  border: var(--border-w) solid var(--border-2);
  color: var(--text-2); font-size: var(--fs-sm);
}
.input-group .addon + .input, .input-group .input + .addon, .input-group .input + .btn { margin-left: calc(var(--border-w) * -1); }

/* Input con icona interna */
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: .8em; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon > .input { padding-left: 2.5em; }

/* Stati disabled / readonly */
.input:disabled, select.input:disabled, textarea.input:disabled {
  opacity: .55; background: var(--surface-2); cursor: not-allowed;
}
.input[readonly]:not(:disabled) { background: var(--surface-2); color: var(--text-2); }
.field.is-disabled > label, label.is-disabled { opacity: .55; cursor: not-allowed; }
.switch:disabled { opacity: .55; cursor: not-allowed; }

/* Password con occhio (auto-init: input[type=password][data-password]) */
.pw-wrap { position: relative; }
.pw-wrap .input { width: 100%; padding-right: 2.8em; }
.pw-toggle {
  position: absolute; right: .35em; top: 50%; translate: 0 -50%;
  display: inline-grid; place-items: center;
  width: 2em; height: 2em; padding: 0;
  border: 0; border-radius: var(--radius-s);
  background: none; color: var(--text-3); cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.pw-toggle:hover { color: var(--text); background: var(--surface-2); }
.pw-toggle .icon { width: 17px; height: 17px; }

/* Dropzone — area drag & drop per file */
.dropzone {
  border: 2px dashed var(--border-2);
  border-radius: var(--radius-m);
  background: var(--surface);
  padding: var(--sp-5);
  text-align: center; cursor: pointer; user-select: none;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--c-primary); outline: none; }
.dropzone.is-over { border-color: var(--c-primary); background: var(--primary-soft); }
.dropzone .dz-icon { width: 26px; height: 26px; color: var(--c-primary); }
.dropzone .dz-text { margin: var(--sp-2) 0 0; font-size: var(--fs-base); }
.dropzone .dz-text b { color: var(--primary-text); }
.dropzone .dz-or { color: var(--text-3); }
.dropzone .dz-hint { margin: .25em 0 0; font-size: var(--fs-xs); color: var(--text-3); }
.dz-list { list-style: none; margin: 0; padding: 0; text-align: left; }
.dropzone.has-files .dz-list { margin-top: var(--sp-4); }
.dz-item {
  display: flex; align-items: center; gap: .6em;
  padding: .45em .6em; border-radius: var(--radius-s);
  background: var(--surface-2); border: var(--border-w) solid var(--border);
  font-size: var(--fs-sm);
}
.dz-item + .dz-item { margin-top: var(--sp-2); }
.dz-item .icon { width: 15px; height: 15px; color: var(--text-3); flex: none; }
.dz-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-size { margin-left: auto; color: var(--text-3); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; flex: none; }
.dz-remove {
  display: inline-grid; place-items: center; flex: none;
  width: 1.7em; height: 1.7em; padding: 0;
  border: 0; border-radius: var(--radius-s);
  background: none; color: var(--text-3); cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.dz-remove:hover { color: var(--danger-text); background: var(--danger-soft); }
.dz-remove .icon { width: 13px; height: 13px; }

/* Validazione */
.is-valid .input, .input.is-valid { border-color: var(--c-success); }
.is-valid .input:focus-visible { box-shadow: 0 0 0 4px var(--success-soft); }
.is-invalid .input, .input.is-invalid { border-color: var(--c-danger); }
.is-invalid .input:focus-visible { box-shadow: 0 0 0 4px var(--danger-soft); }
.field .feedback { font-size: var(--fs-xs); display: none; }
.is-valid .feedback.valid { display: block; color: var(--success-text); }
.is-invalid .feedback.invalid { display: block; color: var(--danger-text); }

/* Check / radio nativi accentati */
input[type="checkbox"]:not(.switch), input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 1.18em; height: 1.18em; flex: none;
  display: inline-grid; place-content: center;
  background: var(--surface);
  border: var(--border-w) solid var(--border-2);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
input[type="checkbox"]:not(.switch) { border-radius: .3em; }
input[type="radio"] { border-radius: 50%; }
input[type="checkbox"]:not(.switch)::before {
  content: ""; width: .58em; height: .32em;
  border-left: 2.5px solid var(--on-brand);
  border-bottom: 2.5px solid var(--on-brand);
  transform: rotate(-45deg) translate(.02em, -.1em) scale(0);
  transition: transform var(--t-fast) var(--ease-pop);
}
input[type="radio"]::before {
  content: ""; width: .52em; height: .52em; border-radius: 50%;
  background: var(--on-brand);
  scale: 0;
  transition: scale var(--t-fast) var(--ease-pop);
}
input[type="checkbox"]:not(.switch):checked, input[type="radio"]:checked {
  background: var(--c-primary); border-color: var(--c-primary);
}
input[type="checkbox"]:not(.switch):checked::before { transform: rotate(-45deg) translate(.02em, -.1em) scale(1); }
input[type="radio"]:checked::before { scale: 1; }
input[type="checkbox"]:not(.switch):focus-visible, input[type="radio"]:focus-visible, .switch:focus-visible {
  outline: none; box-shadow: 0 0 0 3px var(--primary-soft);
}
input[type="checkbox"]:disabled, input[type="radio"]:disabled { opacity: .55; cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: .55em; font-size: var(--fs-base); cursor: pointer; }

/* Switch */
.switch {
  appearance: none; -webkit-appearance: none;
  width: 2.7em; height: 1.5em;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  border: var(--border-w) solid var(--border-2);
  position: relative;
  transition: background var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
  cursor: pointer; flex: none;
}
.switch::after {
  content: "";
  position: absolute; top: 50%; left: .14em;
  width: 1.12em; height: 1.12em;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow-s);
  transform: translateY(-50%);
  transition: left var(--t-med) var(--ease-pop), background var(--t-med) var(--ease);
}
.switch:checked { background: var(--c-primary); border-color: var(--c-primary); }
.switch:checked::after { left: calc(100% - 1.26em); background: #fff; }

/* Range */
input[type="range"].range {
  appearance: none; width: 100%; height: 6px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--c-primary) calc(var(--p, 50) * 1%), var(--surface-3) 0);
  outline-offset: 4px;
}
input[type="range"].range::-webkit-slider-thumb {
  appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--c-primary);
  box-shadow: var(--shadow-s); cursor: grab;
}
input[type="range"].range::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--c-primary);
  box-shadow: var(--shadow-s); cursor: grab;
}

input[type="color"].swatch {
  appearance: none; -webkit-appearance: none;
  width: 44px; height: 32px; padding: 0;
  border: var(--border-w) solid var(--border-2);
  border-radius: var(--radius-s);
  background: none; cursor: pointer;
}
input[type="color"].swatch::-webkit-color-swatch-wrapper { padding: 3px; }
input[type="color"].swatch::-webkit-color-swatch { border: 0; border-radius: 6px; }
input[type="color"].swatch::-moz-color-swatch { border: 0; border-radius: 6px; }

/* ==========================================================================
   07 · NAVBAR, DROPDOWN, TABS, ACCORDION
   ========================================================================== */
.navbar {
  position: relative;
  z-index: var(--z-nav);
  background: transparent;
  transition: background var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
  border-bottom: var(--border-w) solid transparent;
}
.navbar-sticky { position: sticky; top: 0; }
.navbar.is-scrolled, .navbar-solid {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  backdrop-filter: blur(16px) saturate(1.5);
  border-bottom-color: var(--glass-border);
  box-shadow: var(--shadow-s);
}
.navbar-inner { display: flex; align-items: center; gap: var(--sp-4); min-height: 64px; }

.brand { display: inline-flex; align-items: center; gap: .6em; font-family: var(--font-display); font-weight: 750; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: var(--grad-brand);
  display: grid; place-items: center;
  color: #fff;
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--c-primary) 70%, transparent);
}
.brand-mark .icon { width: 1.05em; height: 1.05em; }

.navbar-menu { display: flex; align-items: center; gap: var(--sp-1); margin-left: auto; }
.nav-link {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .45em .8em;
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-weight: 550; font-size: var(--fs-base);
}
.nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-link.is-active { color: var(--primary-text); background: var(--primary-soft); }

.nav-toggle { display: none; margin-left: auto; }

@media (max-width: 1023.98px) {
  .nav-toggle { display: inline-flex; }
  .navbar-menu {
    position: absolute;
    top: calc(100% + 8px); left: 12px; right: 12px;
    flex-direction: column; align-items: stretch;
    gap: 2px;
    max-height: calc(100dvh - 90px); overflow-y: auto; overscroll-behavior: contain;
    padding: var(--sp-3);
    margin-left: 0;
    background: var(--surface);
    border: var(--border-w) solid var(--border);
    border-radius: var(--radius-m);
    box-shadow: var(--shadow-l);
    opacity: 0; transform: translateY(-8px) scale(.99);
    pointer-events: none;
    transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease);
  }
  .navbar-menu.open { opacity: 1; transform: none; pointer-events: auto; }
  .navbar-menu .nav-link { padding: .7em .9em; width: 100%; justify-content: flex-start; }

  /* il dropdown "Altro" si espande IN LINEA, non come riquadro fluttuante */
  .navbar-menu .dropdown { width: 100%; }
  .navbar-menu .dropdown > [data-dropdown] { width: 100%; justify-content: space-between; }
  .navbar-menu .dropdown > [data-dropdown] .icon { transition: transform var(--t-fast) var(--ease); }
  .navbar-menu .dropdown.open > [data-dropdown] .icon { transform: rotate(180deg); }
  .navbar-menu .menu {
    position: static; min-width: 0;
    margin: 2px 0 4px; padding: 2px 0 2px var(--sp-3);
    background: none; border: 0; border-left: 2px solid var(--border); border-radius: 0;
    box-shadow: none; opacity: 1; transform: none; pointer-events: auto;
    display: none;
  }
  .navbar-menu .dropdown.open > .menu { display: block; }

  /* ricerca a tutta larghezza dentro il menu mobile */
  .navbar-menu .nav-search { display: block; width: 100%; margin-top: 4px; }
  .navbar-menu .nav-search input { width: 100%; }
  .navbar-menu .nav-search kbd { display: none; }

  /* segmented tema a tutta larghezza */
  .navbar-menu .seg { width: 100%; }
  .navbar-menu .seg button { flex: 1; }
}

/* ---- Dropdown ---- */
.dropdown { position: relative; display: inline-block; }
.menu {
  position: absolute; top: calc(100% + 6px); left: 0;
  min-width: 200px;
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-l);
  padding: .4rem;
  z-index: var(--z-drop);
  opacity: 0; transform: translateY(-6px) scale(.98);
  transform-origin: top left;
  pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease-pop);
}
.menu.menu-end { left: auto; right: 0; transform-origin: top right; }
.dropdown.open > .menu { opacity: 1; transform: none; pointer-events: auto; }
.menu-item {
  display: flex; align-items: center; gap: .6em;
  width: 100%;
  padding: .55em .7em;
  border: 0; background: none;
  border-radius: var(--radius-s);
  color: var(--text); font-size: var(--fs-base); text-align: left;
}
.menu-item:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.menu-item.danger { color: var(--danger-text); }
.menu-item.danger:hover { background: var(--danger-soft); }
.menu-sep { border: 0; border-top: var(--border-w) solid var(--border); margin: .35rem .2rem; }
.menu-label { padding: .4em .7em .2em; font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }

/* ---- Tabs ---- */
.tabs { display: flex; flex-direction: column; gap: var(--sp-4); }
.tab-list {
  display: flex; gap: var(--sp-1);
  border-bottom: var(--border-w) solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-list::-webkit-scrollbar { display: none; }
.tab-list [role="tab"], .tab-btn {
  border: 0; background: none;
  padding: .6em .95em;
  font-weight: 600; font-size: var(--fs-base);
  color: var(--text-2);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: .45em;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.tab-list [role="tab"]:hover { color: var(--text); }
.tab-list [role="tab"].is-active { color: var(--primary-text); border-bottom-color: var(--c-primary); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; animation: vt-fade-up var(--t-med) var(--ease) both; }

/* Tabs "pill" alternative */
.tab-list.pills { border: 0; gap: .35rem; }
.tab-list.pills [role="tab"] { border: var(--border-w) solid transparent; border-radius: var(--radius-pill); margin: 0; padding: .45em .95em; }
.tab-list.pills [role="tab"].is-active { background: var(--primary-soft); border-color: var(--primary-border); }

/* ---- Accordion (nativo <details>) ---- */
.accordion {
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  background: var(--surface);
  overflow: hidden;
}
.accordion + .accordion { margin-top: var(--sp-2); }
.accordion > summary {
  list-style: none;
  display: flex; align-items: center; gap: .7em;
  padding: var(--sp-4) var(--sp-5);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.accordion > summary::-webkit-details-marker { display: none; }
.accordion > summary:hover { background: var(--surface-2); }
.accordion > summary::after {
  content: "";
  margin-left: auto;
  width: .55em; height: .55em;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  transition: transform var(--t-med) var(--ease);
  flex: none;
}
.accordion[open] > summary { color: var(--primary-text); }
.accordion[open] > summary::after { transform: rotate(225deg); }
.accordion .accordion-body { padding: 0 var(--sp-5) var(--sp-4); color: var(--text-2); }

/* Breadcrumb — markup valido: <nav aria-label="Percorso"><ol class="breadcrumb"><li>… */
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: .5em; font-size: var(--fs-sm); color: var(--text-3); padding: 0; }
.breadcrumb a { color: var(--text-2); }
.breadcrumb li { list-style: none; display: inline-flex; align-items: center; gap: .5em; }
.breadcrumb li + li::before { content: "/"; color: var(--text-3); }
.breadcrumb [aria-current] { color: var(--text); font-weight: 600; }

/* ==========================================================================
   08 · CARD, ALERT, MODAL, TOAST, TOOLTIP, PROGRESS, SKELETON
   ========================================================================== */
.card {
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), border-color var(--t-med) var(--ease);
}
.card-body { padding: var(--sp-5); }
.card-head { padding: var(--sp-4) var(--sp-5); border-bottom: var(--border-w) solid var(--border); display: flex; align-items: center; gap: var(--sp-3); }
.card-head h3, .card-head h4 { margin: 0; }
.card-foot { padding: var(--sp-4) var(--sp-5); border-top: var(--border-w) solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-m) var(--radius-m); }
.card-img-top { border-radius: var(--radius-m) var(--radius-m) 0 0; width: 100%; object-fit: cover; }
.hover-lift:hover { transform: translateY(-4px); box-shadow: var(--shadow-m); border-color: var(--primary-border); }
.card.vetro { background: var(--glass-bg); }

/* ---- Alert ---- */
.alert {
  --al-c: var(--c-info);
  display: flex; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-4);
  border-radius: var(--radius-m);
  background: color-mix(in srgb, var(--al-c) 11%, var(--surface));
  border: var(--border-w) solid color-mix(in srgb, var(--al-c) 30%, transparent);
  border-left: 3px solid var(--al-c);
  color: var(--text);
}
.alert .icon { color: color-mix(in oklab, var(--al-c) 75%, var(--ink)); margin-top: .15em; }
.alert strong { color: color-mix(in oklab, var(--al-c) 72%, var(--ink)); }
.alert p:last-child { margin: 0; }
.alert-success{--al-c:var(--c-success)} .alert-warning{--al-c:var(--c-warning)}
.alert-danger{--al-c:var(--c-danger)}  .alert-primary{--al-c:var(--c-primary)} .alert-secondary{--al-c:var(--c-secondary)}
.alert-info{--al-c:var(--c-info)}      .alert-accent{--al-c:var(--c-accent)}
.alert .alert-close { margin-left: auto; align-self: flex-start; }

/* ---- Modal (su <dialog> nativo) ---- */
dialog.modal {
  border: 0; padding: 0; background: transparent;
  max-width: min(560px, calc(100vw - 32px));
  width: 100%;
  margin: auto;
}
dialog.modal::backdrop {
  background: var(--backdrop);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
dialog.modal[open] .modal-card { animation: vt-zoom var(--t-med) var(--ease-pop) both; }
dialog.modal.modal-lg { max-width: min(840px, calc(100vw - 32px)); }
dialog.modal.modal-sm { max-width: min(420px, calc(100vw - 32px)); }
.modal-card {
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-l);
  overflow: hidden;
}
.modal-head { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5); border-bottom: var(--border-w) solid var(--border); }
.modal-head h3 { margin: 0; font-size: 1.15rem; }
.modal-body { padding: var(--sp-5); max-height: min(60vh, 520px); overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-4) var(--sp-5); border-top: var(--border-w) solid var(--border); background: var(--surface-2); }

/* ---- Toast ---- */
.toast-stack {
  position: fixed;
  bottom: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: var(--z-toast);
  width: min(380px, calc(100vw - 32px));
}
@media (max-width: 639.98px) { .toast-stack { right: 50%; transform: translateX(50%); } }
.toast {
  --tc: var(--c-info);
  display: flex; gap: .7em; align-items: flex-start;
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-l);
  padding: .9rem 1rem;
  position: relative; overflow: hidden;
  animation: vt-slide-l var(--t-med) var(--ease-pop) both;
}
.toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tc); }
.toast .icon { color: color-mix(in oklab, var(--tc) 75%, var(--ink)); margin-top: .1em; }
.toast-title { font-weight: 650; font-size: var(--fs-base); }
.toast-msg { font-size: var(--fs-sm); color: var(--text-2); }
.toast-close { margin-left: auto; border: 0; background: none; color: var(--text-3); padding: .1em; border-radius: 6px; }
.toast-close:hover { color: var(--text); background: var(--surface-2); }
.toast.success{--tc:var(--c-success)} .toast.warning{--tc:var(--c-warning)}
.toast.danger{--tc:var(--c-danger)}   .toast.primary{--tc:var(--c-primary)}
.toast.secondary{--tc:var(--c-secondary)}
.toast.leaving { animation: vt-toast-out var(--t-med) var(--ease) both; }

/* ---- Tooltip (CSS puro via data-tip) ---- */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--ink); color: var(--paper);
  font-size: var(--fs-xs); font-weight: 550; line-height: 1.35;
  padding: .45em .7em; border-radius: 8px;
  white-space: pre; max-width: 260px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  z-index: var(--z-drop);
  box-shadow: var(--shadow-m);
}
[data-tip]::before {
  content: ""; position: absolute; bottom: calc(100% + 3px); left: 50%;
  transform: translateX(-50%) translateY(4px) rotate(45deg);
  width: 9px; height: 9px; background: var(--ink);
  opacity: 0; pointer-events: none;
  transition: inherit;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after,
[data-tip]:hover::before, [data-tip]:focus-visible::before { opacity: 1; transform: translateX(-50%) translateY(0) rotate(0); }
[data-tip]:hover::before, [data-tip]:focus-visible::before { transform: translateX(-50%) translateY(0) rotate(45deg); }

/* ---- Progress ---- */
.progress {
  height: 8px;
  background: var(--surface-3);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: calc(var(--p, 0) * 1%);
  background: var(--c-primary);
  border-radius: inherit;
  transition: width var(--t-slow) var(--ease);
}
.progress-bar.grad { background: var(--grad-brand); }
.progress-bar.striped {
  background-image: linear-gradient(45deg, rgb(255 255 255 / .18) 25%, transparent 25%, transparent 50%, rgb(255 255 255 / .18) 50%, rgb(255 255 255 / .18) 75%, transparent 75%);
  background-size: 16px 16px;
  animation: vt-stripes 1s linear infinite;
}

/* Anello di avanzamento: <svg class="ring" style="--p:72"> */
.ring { --size: 84px; --w: 9; width: var(--size); height: var(--size); position: relative; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring circle { fill: none; stroke-width: var(--w); stroke-linecap: round; }
.ring .track { stroke: var(--surface-3); }
.ring .bar {
  stroke: var(--ring-c, var(--c-primary));
  stroke-dasharray: var(--p, 0) 100;
  transition: stroke-dasharray var(--t-slow) var(--ease);
}
.ring .ring-label {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-weight: 700; font-size: calc(var(--size) * .22);
  font-family: var(--font-display);
}

/* ---- Skeleton ---- */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--surface-2);
  border-radius: var(--radius-s);
  min-height: 1em;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--paper) 35%, transparent), transparent);
  transform: translateX(-100%);
  animation: vt-shimmer 1.4s var(--ease) infinite;
}
.sk-text { height: .85em; margin-block: .35em; }
.sk-circle { border-radius: 50%; aspect-ratio: 1; }

/* Spinner standalone */
.spinner {
  width: 1.4em; height: 1.4em;
  border: 2.5px solid var(--surface-3);
  border-top-color: var(--spin-c, var(--c-primary));
  border-radius: 50%;
  animation: vt-spin .7s linear infinite;
}
.spinner-sm { width: 1em; height: 1em; border-width: 2px; }
.spinner-lg { width: 2.4em; height: 2.4em; border-width: 3px; }

/* Stato vuoto */
.empty {
  text-align: center;
  padding: var(--sp-7) var(--sp-5);
  color: var(--text-2);
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-m);
}
.empty .icon { width: 2.2em; height: 2.2em; color: var(--text-3); margin-inline: auto; margin-bottom: var(--sp-3); }

/* ==========================================================================
   09 · TABELLE & DATATABLE
   ========================================================================== */
.table-wrap { overflow-x: auto; border: var(--border-w) solid var(--border); border-radius: var(--radius-m); background: var(--surface); }
.table-wrap.h-fixed { max-height: var(--h, 420px); overflow-y: auto; }

.table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.table th, .table td { padding: .7rem .9rem; text-align: left; vertical-align: middle; }
.table thead th {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-2);
  font-weight: 650;
  background: var(--surface-2);
  border-bottom: var(--border-w) solid var(--border);
  white-space: nowrap;
}
.table tbody tr { border-bottom: var(--border-w) solid var(--border); transition: background var(--t-fast) var(--ease); }
.table tbody tr:last-child { border-bottom: 0; }
.table-hover tbody tr:hover { background: color-mix(in srgb, var(--c-primary) 5%, var(--surface)); }
.table-striped tbody tr:nth-child(odd) { background: color-mix(in srgb, var(--surface-2) 55%, var(--surface)); }
.table-compact th, .table-compact td { padding: .45rem .7rem; }
.table-bordered { border: var(--border-w) solid var(--border); }
.table-bordered th, .table-bordered td { border: var(--border-w) solid var(--border); }
.table .num, .table .text-right { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap.h-fixed thead th { position: sticky; top: 0; z-index: 2; }

/* DataTable (generata da vetro.js) */
.vt { display: flex; flex-direction: column; gap: var(--sp-3); }
.vt-toolbar { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.vt-toolbar .input-icon { flex: 1 1 220px; max-width: 340px; }
.vt-actions { display: flex; gap: var(--sp-2); margin-left: auto; }
.vt th.sortable { cursor: pointer; user-select: none; }
.vt th.sortable:hover { color: var(--text); }
.vt th .th-inner { display: inline-flex; align-items: center; gap: .4em; }
.vt th .sort-ind { display: inline-flex; flex-direction: column; gap: 2px; opacity: .35; }
.vt th .sort-ind::before, .vt th .sort-ind::after {
  content: ""; border: 3.5px solid transparent;
}
.vt th .sort-ind::before { border-bottom-color: currentColor; }
.vt th .sort-ind::after { border-top-color: currentColor; }
.vt th.asc .sort-ind { opacity: 1; color: var(--c-primary); }
.vt th.asc .sort-ind::after { opacity: .25; }
.vt th.desc .sort-ind { opacity: 1; color: var(--c-primary); }
.vt th.desc .sort-ind::before { opacity: .25; }
.vt-footer { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); font-size: var(--fs-sm); color: var(--text-2); }
.vt-pager { display: inline-flex; gap: 4px; margin-left: auto; }
.vt-pager button {
  min-width: 32px; height: 32px;
  border: var(--border-w) solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-size: var(--fs-sm); font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--t-fast) var(--ease);
}
.vt-pager button:hover:not(:disabled) { border-color: var(--primary-border); color: var(--primary-text); }
.vt-pager button.is-active { background: var(--c-primary); border-color: var(--c-primary); color: var(--on-brand); }
.vt-pager button:disabled { opacity: .4; }
.vt-empty { padding: var(--sp-6); text-align: center; color: var(--text-3); }

/* ==========================================================================
   10 · CALENDARIO (markup generato da vetro.js)
   ========================================================================== */
.cal { background: var(--surface); border: var(--border-w) solid var(--border); border-radius: var(--radius-m); overflow: hidden; }
.cal-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4); border-bottom: var(--border-w) solid var(--border); }
.cal-title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-transform: capitalize; }
.cal-nav { display: inline-flex; gap: 4px; margin-left: auto; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-dow {
  padding: .55rem 0; text-align: center;
  font-size: var(--fs-xs); font-weight: 650;
  color: var(--text-3); text-transform: uppercase; letter-spacing: .06em;
  border-bottom: var(--border-w) solid var(--border);
}
.cal-day {
  position: relative;
  aspect-ratio: 1.05;
  border: 0; background: none;
  border-right: var(--border-w) solid var(--border);
  border-bottom: var(--border-w) solid var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-size: var(--fs-sm); font-weight: 550;
  color: var(--text);
  transition: background var(--t-fast) var(--ease);
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day:hover { background: var(--surface-2); }
.cal-day.other { color: var(--text-3); background: color-mix(in srgb, var(--surface-2) 40%, var(--surface)); }
.cal-day.today .cal-num {
  background: var(--c-primary); color: var(--on-brand);
  width: 1.9em; height: 1.9em; border-radius: 50%;
  display: grid; place-items: center;
}
.cal-day.selected { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--c-primary); }
.cal-dots { display: flex; gap: 3px; height: 5px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--dot, var(--c-accent)); }
.cal-events { padding: var(--sp-3) var(--sp-4); border-top: var(--border-w) solid var(--border); display: flex; flex-direction: column; gap: .5rem; min-height: 64px; }
.cal-ev { display: flex; align-items: center; gap: .6em; font-size: var(--fs-sm); padding: .5em .7em; border-radius: var(--radius-s); background: var(--surface-2); }
.cal-ev i { width: 8px; height: 8px; border-radius: 3px; background: var(--dot, var(--c-primary)); flex: none; }
.cal-ev time { margin-left: auto; color: var(--text-3); font-family: var(--font-mono); font-size: var(--fs-xs); }
@media (max-width: 480px) { .cal-day { aspect-ratio: 1; font-size: var(--fs-xs); } }

/* ==========================================================================
   11 · FLOW, TIMELINE, KPI & DASHBOARD
   ========================================================================== */
/* Flow: diagrammi di processo per dashboard e presentazioni.
   <div class="flow"> <div class="flow-node">…</div> <div class="flow-link"></div> … </div> */
.flow { display: flex; align-items: stretch; gap: 0; }
.flow-node {
  --node-c: var(--c-primary);
  flex: 1 1 0;
  min-width: 0;
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-top: 3px solid var(--node-c);
  border-radius: var(--radius-m);
  padding: var(--sp-4);
  box-shadow: var(--shadow-s);
  position: relative;
  transition: transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.flow-node:hover { transform: translateY(-3px); box-shadow: var(--shadow-m); }
.flow-node .flow-k {
  font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 700;
  color: color-mix(in oklab, var(--node-c) 72%, var(--ink));
  letter-spacing: .1em; text-transform: uppercase;
  display: flex; align-items: center; gap: .5em;
}
.flow-node .flow-k .icon { width: 1.2em; height: 1.2em; }
.flow-node h4 { margin: .3em 0 .15em; font-size: 1.02rem; }
.flow-node p { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }
.flow-node.accent{--node-c:var(--c-accent)} .flow-node.success{--node-c:var(--c-success)}
.flow-node.warning{--node-c:var(--c-warning)} .flow-node.danger{--node-c:var(--c-danger)}
.flow-node.info{--node-c:var(--c-info)}
.flow-node.is-active { box-shadow: 0 0 0 2px var(--node-c), var(--shadow-m); }
.flow-node.ghost { border-style: dashed; border-top-style: solid; opacity: .75; background: transparent; box-shadow: none; }

.flow-link { flex: 0 0 34px; display: grid; place-items: center; color: var(--text-3); position: relative; }
.flow-link::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--border-2); }
.flow-link::after {
  content: ""; position: relative;
  width: 9px; height: 9px;
  border-top: 2px solid var(--text-3);
  border-right: 2px solid var(--text-3);
  transform: rotate(45deg) translate(-1px, 1px);
  background: var(--bg);
}
.flow-link.solid::before { border-top-style: solid; border-color: var(--c-primary); }
.flow-link.solid::after { border-color: var(--c-primary); }

/* In verticale su mobile (o forzato con .flow-v) */
.flow-v { flex-direction: column; }
.flow-v .flow-link { flex-basis: 30px; }
.flow-v .flow-link::before { left: 50%; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px dashed var(--border-2); }
.flow-v .flow-link::after { transform: rotate(135deg) translate(-1px, 1px); }
.flow-v .flow-link.solid::before { border-left-style: solid; border-color: var(--c-primary); }
@media (max-width: 767.98px) {
  .flow:not(.flow-h) { flex-direction: column; }
  .flow:not(.flow-h) .flow-link { flex-basis: 30px; }
  .flow:not(.flow-h) .flow-link::before { left: 50%; right: auto; top: 0; bottom: 0; border-top: 0; border-left: 2px dashed var(--border-2); }
  .flow:not(.flow-h) .flow-link::after { transform: rotate(135deg) translate(-1px, 1px); }
  .flow:not(.flow-h) .flow-link.solid::before { border-left-style: solid; border-color: var(--c-primary); }
}

/* Steps numerati per presentazioni */
.steps { display: grid; gap: var(--sp-4); counter-reset: step; }
.step { display: flex; gap: var(--sp-4); counter-increment: step; }
.step::before {
  content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-weight: 700; font-size: var(--fs-sm);
  color: var(--primary-text);
  background: var(--primary-soft);
  border: var(--border-w) solid var(--primary-border);
  width: 2.6em; height: 2.6em; border-radius: 12px;
  display: grid; place-items: center; flex: none;
}
.step h4 { margin: .15em 0 .2em; }
.step p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }

/* Timeline verticale */
.timeline { position: relative; padding-left: 28px; display: grid; gap: var(--sp-5); }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; border-left: 2px solid var(--border-2); }
.tl-item { position: relative; }
.tl-item::before {
  content: ""; position: absolute; left: -26px; top: .35em;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--tl-c, var(--c-primary));
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--tl-c, var(--c-primary)) 18%, var(--bg));
}
.tl-item time { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--text-3); letter-spacing: .04em; }
.tl-item h4 { margin: .15em 0 .2em; font-size: 1rem; }
.tl-item p { margin: 0; font-size: var(--fs-sm); color: var(--text-2); }

/* KPI / stat card per dashboard */
.kpi { display: flex; flex-direction: column; gap: .35rem; }
.kpi-label { font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); display: flex; align-items: center; gap: .5em; }
.kpi-value { font-family: var(--font-display); font-size: clamp(1.6rem, 1.3rem + 1vw, 2.1rem); font-weight: 750; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi-delta { display: inline-flex; align-items: center; gap: .3em; font-size: var(--fs-sm); font-weight: 650; }
.kpi-delta.up { color: var(--success-text); }
.kpi-delta.down { color: var(--danger-text); }
.kpi-delta .icon { width: 1em; height: 1em; }
.kpi-spark { margin-top: .4rem; height: 42px; }
.kpi-spark canvas { width: 100% !important; height: 42px !important; }

.chart-box { position: relative; width: 100%; height: var(--h, 300px); }
.chart-box canvas { position: absolute; inset: 0; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--dot, var(--c-primary)); margin-right: .4em; vertical-align: baseline; }

/* ==========================================================================
   12 · PARALLAX, ANIMAZIONI, REVEAL
   ========================================================================== */
.parallax { position: relative; overflow: clip; isolation: isolate; }
.parallax-bg {
  position: absolute; inset: -14% 0;
  z-index: -2;
  background-position: center;
  background-size: cover;
  will-change: transform;
}
.parallax-veil { position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--bg) 55%, transparent); }
[data-parallax] { will-change: transform; }

/* Blob decorativi fluttuanti (hero) */
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: .5;
  z-index: -1;
  background: var(--blob-c, var(--c-primary));
  animation: vt-float 9s ease-in-out infinite;
  pointer-events: none;
}

/* Sfondo a griglia tecnica */
.bg-grid {
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 35%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 35%, transparent 80%);
}

/* ---- Keyframes ---- */
@keyframes vt-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes vt-fade-up { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes vt-fade-down { from { opacity: 0; transform: translateY(-18px); } to { opacity: 1; transform: none; } }
@keyframes vt-slide-l { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes vt-slide-r { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
@keyframes vt-zoom { from { opacity: 0; transform: scale(.92); } to { opacity: 1; transform: none; } }
@keyframes vt-pop { 0% { transform: scale(.9); } 60% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes vt-spin { to { transform: rotate(360deg); } }
@keyframes vt-pulse { 50% { opacity: .55; } }
@keyframes vt-float { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-22px) } }
@keyframes vt-shimmer { to { transform: translateX(100%); } }
@keyframes vt-stripes { to { background-position: 16px 0; } }
@keyframes vt-grad { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes vt-toast-out { to { opacity: 0; transform: translateX(24px); } }

/* ---- Utility animazione ---- */
.anim-fade-in  { animation: vt-fade-in  var(--dur, .5s) var(--ease) var(--delay, 0s) both; }
.anim-fade-up  { animation: vt-fade-up  var(--dur, .5s) var(--ease) var(--delay, 0s) both; }
.anim-zoom     { animation: vt-zoom     var(--dur, .4s) var(--ease-pop) var(--delay, 0s) both; }
.anim-slide-l  { animation: vt-slide-l  var(--dur, .5s) var(--ease) var(--delay, 0s) both; }
.anim-slide-r  { animation: vt-slide-r  var(--dur, .5s) var(--ease) var(--delay, 0s) both; }
.anim-pulse    { animation: vt-pulse 1.8s ease-in-out infinite; }
.anim-float    { animation: vt-float 7s ease-in-out infinite; }
.anim-grad     { background-size: 220% 220%; animation: vt-grad 7s ease infinite; }
.delay-1{--delay:.08s}.delay-2{--delay:.16s}.delay-3{--delay:.24s}
.delay-4{--delay:.32s}.delay-5{--delay:.4s}.delay-6{--delay:.48s}

/* ---- Reveal allo scroll (gestito da vetro.js con IntersectionObserver) ---- */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ease), transform .6s var(--ease); transition-delay: var(--delay, 0s); }
[data-reveal="left"]  { transform: translateX(-26px); }
[data-reveal="right"] { transform: translateX(26px); }
[data-reveal="zoom"]  { transform: scale(.93); }
[data-reveal].revealed { opacity: 1; transform: none; }

.hover-glow:hover { box-shadow: 0 0 0 1px var(--primary-border), 0 10px 34px -10px color-mix(in srgb, var(--c-primary) 45%, transparent); }

/* ---- Riduzione del movimento ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .parallax-bg, [data-parallax] { transform: none !important; }
}

/* ==========================================================================
   13 · STAMPA
   ========================================================================== */
@media print {
  .navbar, .nav-toggle, .toast-stack, .vt-toolbar, .vt-pager, .btn { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .table-wrap { box-shadow: none; border-color: #ccc; }
  a { color: #000; text-decoration: underline; }
}

/* ==========================================================================
   14 · RIFINITURE COMPONENTI JS (toast body, info datatable, eventi calendario)
   ========================================================================== */
.toast.info { --tc: var(--c-info); }
.toast-body { display: flex; flex-direction: column; gap: .1em; min-width: 0; }
.vt-info { font-variant-numeric: tabular-nums; }
.vt-dots { align-self: center; padding: 0 .35em; color: var(--text-3); }
.vt-pager .icon { width: 15px; height: 15px; }
.cal-ev-head { font-weight: 650; font-size: var(--fs-sm); text-transform: capitalize; }
.cal-ev-empty { color: var(--text-3); font-size: var(--fs-sm); padding: .35em 0; }
.cal-nav .btn span { font-size: var(--fs-xs); font-weight: 650; }

/* ==========================================================================
   15 · BOTTONIERE (gruppi di bottoni, toolbar)
   .btn-group        → bottoni attaccati (segmented). Funziona con qualunque
                       variante: outline, soft, primary, ghost…
   .btn-group-full   → occupa il 100% e divide lo spazio in parti uguali
   .btn-group-v      → verticale
   .is-active        → stato attivo dentro al gruppo (outline diventa pieno)
   .toolbar          → barra strumenti con separatori .toolbar-sep
   ========================================================================== */
.btn-group { display: inline-flex; vertical-align: middle; isolation: isolate; }
.btn-group > .btn {
  border-radius: 0;
  margin-left: calc(var(--border-w) * -1);
  position: relative;
}
.btn-group > .btn:first-child { margin-left: 0; border-start-start-radius: var(--radius-s); border-end-start-radius: var(--radius-s); }
.btn-group > .btn:last-child  { border-start-end-radius: var(--radius-s); border-end-end-radius: var(--radius-s); }
.btn-group > .btn:hover,
.btn-group > .btn:focus-visible,
.btn-group > .btn.is-active { z-index: 1; }

/* attivo: la variante outline/soft/ghost diventa piena, coerente col colore */
.btn-group > .btn.is-active,
.toolbar  > .btn.is-active {
  background: var(--btn-c, var(--c-primary));
  border-color: var(--btn-c, var(--c-primary));
  color: var(--on-brand);
  box-shadow: inset 0 2px 6px rgb(0 0 0 / .18);
}

.btn-group-full { display: flex; width: 100%; }
.btn-group-full > .btn { flex: 1 1 0; justify-content: center; }

.btn-group-v { display: inline-flex; flex-direction: column; align-items: stretch; }
.btn-group-v > .btn { border-radius: 0; margin: 0; margin-top: calc(var(--border-w) * -1); justify-content: flex-start; }
.btn-group-v > .btn:first-child { margin-top: 0; border-start-start-radius: var(--radius-s); border-start-end-radius: var(--radius-s); }
.btn-group-v > .btn:last-child  { border-end-start-radius: var(--radius-s); border-end-end-radius: var(--radius-s); }

/* mobile: i gruppi segmentati orizzontali si spezzano su più righe invece di
   sforare a lato. Ogni bottone torna pill autonomo e i bottoni riempiono la riga. */
@media (max-width: 560px) {
  .btn-group:not(.btn-group-v):not(.btn-group-full) {
    display: flex; flex-wrap: wrap; gap: var(--sp-1); width: 100%;
  }
  .btn-group:not(.btn-group-v):not(.btn-group-full) > .btn {
    margin-left: 0; flex: 1 1 auto;
    border-radius: var(--radius-s);
  }
}

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1);
  width: fit-content; max-width: 100%;
  padding: var(--sp-1);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}
.toolbar .btn { box-shadow: none; }
.toolbar-sep { width: 1px; align-self: stretch; margin: 4px var(--sp-1); background: var(--border); }

/* ==========================================================================
   16 · ARROW INPUT (stepper numerico) e ARROW PAD (frecce direzionali)
   .stepper  → [−] [valore] [+]  · JS: Vetro.spin() o data-stepper
   .arrow-pad→ tastierino ▲◀▼▶   · JS: Vetro.arrows() o data-arrows
   ========================================================================== */
.stepper {
  display: inline-flex; align-items: stretch;
  background: var(--surface);
  border: var(--border-w) solid var(--border-2);
  border-radius: var(--radius-s);
  overflow: hidden;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.stepper:focus-within {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--primary-soft-2);
}
.stepper input {
  border: 0; outline: 0; background: transparent;
  width: 5ch; text-align: center;
  font: 650 var(--fs-base) var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  appearance: textfield; -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-btn {
  border: 0; cursor: pointer;
  width: 36px; display: grid; place-items: center;
  background: var(--surface-2); color: var(--text-2);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  touch-action: manipulation; user-select: none;
}
.stepper-btn:first-child { border-right: var(--border-w) solid var(--border); }
.stepper-btn:last-child  { border-left:  var(--border-w) solid var(--border); }
.stepper-btn:hover  { background: var(--primary-soft); color: var(--primary-text); }
.stepper-btn:active { background: var(--primary-soft-2); }
.stepper-btn:disabled { opacity: .38; cursor: not-allowed; background: var(--surface-2); color: var(--text-3); }
.stepper-btn .icon { width: 15px; height: 15px; }

.arrow-pad {
  display: grid;
  grid-template-columns: repeat(3, 46px);
  grid-auto-rows: 46px;
  gap: 6px; width: fit-content;
  touch-action: none; user-select: none;
}
.pad-btn {
  border: var(--border-w) solid var(--border-2);
  border-radius: var(--radius-s);
  background: var(--surface); color: var(--text-2);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-s);
  transition: background var(--t-fast) var(--ease), translate var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.pad-btn:hover { background: var(--surface-2); color: var(--text); }
.pad-btn:active, .pad-btn.is-on {
  background: var(--c-primary); border-color: var(--c-primary);
  color: var(--on-brand); translate: 0 1px; box-shadow: none;
}
.pad-up    { grid-area: 1 / 2; }
.pad-left  { grid-area: 2 / 1; }
.pad-down  { grid-area: 2 / 2; }
.pad-right { grid-area: 2 / 3; }
.pad-mid   { grid-area: 1 / 2 / 3 / 3; } /* slot libero per pad a croce completa */

/* ==========================================================================
   17 · TIMER (countdown, cronometro)  · JS: Vetro.timer.*
   ========================================================================== */
.timer { display: inline-flex; align-items: flex-start; gap: .55em; }
.timer-seg { display: grid; justify-items: center; gap: .35em; }
.timer-num {
  position: relative; min-width: 2.5ch; text-align: center;
  padding: .14em .26em;
  font: 700 clamp(1.5rem, 1.1rem + 1.7vw, 2.3rem)/1.15 var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-s);
}
.timer-num::after { /* giunzione stile flip-clock */
  content: ""; position: absolute; left: 8%; right: 8%; top: 50%;
  height: 1px; background: var(--border);
}
.timer-lbl {
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-3);
}
.timer-sep { font: 700 1.6em/1.5 var(--font-mono); color: var(--text-3); }
.timer.is-danger .timer-num {
  color: var(--danger-text);
  border-color: var(--danger-border);
  animation: vt-beat 1s var(--ease) infinite;
}
.timer.is-done .timer-num { color: var(--text-3); animation: none; }
@keyframes vt-beat { 0%,100% { box-shadow: var(--shadow-s); } 50% { box-shadow: 0 0 0 6px var(--danger-soft); } }

.stopwatch-time {
  font: 750 clamp(2rem, 1.4rem + 2.4vw, 3rem)/1.1 var(--font-mono);
  font-variant-numeric: tabular-nums; letter-spacing: .01em;
}
.laps { margin: var(--sp-3) 0 0; padding: 0; list-style: none; font-family: var(--font-mono); font-size: var(--fs-sm); }
.laps li {
  display: flex; justify-content: space-between; gap: var(--sp-4);
  padding: .4em .15em; border-bottom: 1px dashed var(--border);
  font-variant-numeric: tabular-nums;
  animation: vt-fade-up var(--t-med) var(--ease) both;
}
.laps li.best  b { color: var(--success-text); }
.laps li.worst b { color: var(--danger-text); }

/* ==========================================================================
   18 · PARTICELLE  · JS: Vetro.particles(host, { preset: "stars" | … })
   Il canvas viene creato dal JS dentro a .particles-host.
   ========================================================================== */
.particles-host { position: relative; isolation: isolate; overflow: hidden; }
.particles-canvas {
  position: absolute; inset: 0; z-index: 0;
  width: 100%; height: 100%;
  pointer-events: none;
}
.particles-host > :not(.particles-canvas) { position: relative; z-index: 1; }

/* ==========================================================================
   19 · NEON & RIFLESSI (light pattern, glare, shine, aurora, reflection)
   ========================================================================== */
/* Testo neon: cambia colore con --neon-c */
.neon {
  --neon-c: var(--c-accent);
  color: color-mix(in oklab, var(--neon-c) 78%, var(--ink));
  text-shadow:
    0 0 2px  color-mix(in srgb, var(--neon-c) 65%, transparent),
    0 0 10px color-mix(in srgb, var(--neon-c) 55%, transparent),
    0 0 26px color-mix(in srgb, var(--neon-c) 45%, transparent),
    0 0 58px color-mix(in srgb, var(--neon-c) 35%, transparent);
}
html[data-theme="dark"] .neon { color: color-mix(in oklab, var(--neon-c) 55%, #fff); }
@media (prefers-color-scheme: dark) {
  html:not([data-theme]) .neon, html[data-theme="auto"] .neon { color: color-mix(in oklab, var(--neon-c) 55%, #fff); }
}
.neon-flicker { animation: vt-flicker 3.6s linear infinite; }
@keyframes vt-flicker {
  0%, 6%, 8.5%, 41%, 43.5%, 100% { opacity: 1; }
  7%, 42%, 43% { opacity: .35; }
  79% { opacity: 1; } 80% { opacity: .6; } 81% { opacity: 1; }
}

/* Cornice neon (tubo) */
.neon-box {
  --neon-c: var(--c-primary);
  border: 2px solid color-mix(in srgb, var(--neon-c) 80%, #fff);
  border-radius: var(--radius-m);
  box-shadow:
    0 0 7px  color-mix(in srgb, var(--neon-c) 55%, transparent),
    0 0 24px color-mix(in srgb, var(--neon-c) 30%, transparent),
    inset 0 0 9px  color-mix(in srgb, var(--neon-c) 35%, transparent),
    inset 0 0 26px color-mix(in srgb, var(--neon-c) 14%, transparent);
}

/* Riflesso "shine": lama di luce che attraversa l'elemento.
   .shine → all'hover · .shine-auto → in loop continuo */
.shine, .shine-auto { position: relative; overflow: hidden; }
.shine::after, .shine-auto::after {
  content: ""; position: absolute; z-index: 2; pointer-events: none;
  top: -60%; bottom: -60%; left: -30%; width: 38%;
  transform: rotate(18deg) translateX(-320%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / .34) 50%, transparent);
}
.shine:hover::after { animation: vt-shine .9s var(--ease); }
.shine-auto::after  { animation: vt-shine 3.2s var(--ease) infinite; }
@keyframes vt-shine { to { transform: rotate(18deg) translateX(420%); } }

/* Glare: alone di luce che segue il puntatore (JS imposta --gx/--gy).
   Auto-init con [data-glare]. */
.glare { position: relative; }
.glare::before {
  content: ""; position: absolute; inset: 0; z-index: 2;
  border-radius: inherit; pointer-events: none;
  opacity: 0; transition: opacity var(--t-med) var(--ease);
  background: radial-gradient(480px circle at var(--gx, 50%) var(--gy, 50%),
              rgb(255 255 255 / .20), transparent 55%);
}
.glare:hover::before { opacity: 1; }
html[data-theme="dark"] .glare::before { background: radial-gradient(480px circle at var(--gx,50%) var(--gy,50%), rgb(255 255 255 / .12), transparent 55%); }

/* Aurora: pattern di luce animato di sfondo (usa i colori brand) */
.aurora { position: relative; overflow: hidden; isolation: isolate; }
.aurora::before, .aurora::after {
  content: ""; position: absolute; z-index: -1;
  width: 65%; aspect-ratio: 1; border-radius: 50%;
  filter: blur(64px); opacity: .55; will-change: transform;
}
.aurora::before {
  left: -12%; top: -28%;
  background: conic-gradient(from 90deg,
    color-mix(in srgb, var(--c-primary) 70%, transparent),
    color-mix(in srgb, var(--c-info) 55%, transparent),
    color-mix(in srgb, var(--c-primary) 70%, transparent));
  animation: vt-aurora 16s ease-in-out infinite alternate;
}
.aurora::after {
  right: -14%; bottom: -30%;
  background: conic-gradient(from 230deg,
    color-mix(in srgb, var(--c-accent) 65%, transparent),
    color-mix(in srgb, var(--c-primary) 45%, transparent),
    color-mix(in srgb, var(--c-accent) 65%, transparent));
  animation: vt-aurora 19s ease-in-out infinite alternate-reverse;
}
@keyframes vt-aurora {
  0%   { transform: translate(0, 0) rotate(0deg)   scale(1); }
  50%  { transform: translate(9%, 6%) rotate(40deg) scale(1.15); }
  100% { transform: translate(-7%, -4%) rotate(-30deg) scale(.95); }
}

/* Riflesso speculare sotto l'elemento (logo, immagine) */
.reflect { -webkit-box-reflect: below 3px linear-gradient(transparent 58%, rgb(0 0 0 / .25)); }

/* ==========================================================================
   20 · VIDEO PLAYER  · JS: Vetro.video(el) oppure <div class="vplayer" data-player>
   ========================================================================== */
.vplayer {
  position: relative; overflow: hidden;
  background: #000; border-radius: var(--radius-l);
  box-shadow: var(--shadow-m);
  aspect-ratio: 16 / 9;
}
.vplayer video { display: block; width: 100%; height: 100%; object-fit: contain; background: #000; }

.vp-overlay {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center;
  border: 0; background: transparent; cursor: pointer; color: #fff;
  opacity: 0; transition: opacity var(--t-med) var(--ease);
}
.vplayer.is-paused .vp-overlay { opacity: 1; background: rgb(0 0 0 / .28); }
.vp-bigplay {
  width: 76px; height: 76px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--c-primary) 90%, #000);
  box-shadow: 0 14px 38px -10px color-mix(in srgb, var(--c-primary) 70%, transparent);
  transition: transform var(--t-fast) var(--ease-pop);
}
.vp-overlay:hover .vp-bigplay { transform: scale(1.07); }
.vp-bigplay .icon { width: 30px; height: 30px; }

.vp-bar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  display: flex; align-items: center; gap: .35em;
  padding: 1.6em .7em .5em;
  background: linear-gradient(transparent, rgb(0 0 0 / .74));
  color: #fff;
  opacity: 0; translate: 0 8px;
  transition: opacity var(--t-med) var(--ease), translate var(--t-med) var(--ease);
}
.vplayer:hover .vp-bar,
.vplayer:focus-within .vp-bar,
.vplayer.is-paused .vp-bar { opacity: 1; translate: 0 0; }
.vp-btn {
  flex: none; width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: #fff;
  transition: background var(--t-fast) var(--ease);
}
.vp-btn:hover { background: rgb(255 255 255 / .18); }
.vp-btn .icon { width: 18px; height: 18px; }
.vp-time { flex: none; min-width: 9ch; text-align: center; font: 600 var(--fs-xs) var(--font-mono); color: rgb(255 255 255 / .9); font-variant-numeric: tabular-nums; }

input[type="range"].vp-progress, input[type="range"].vp-vol {
  appearance: none; -webkit-appearance: none;
  height: 5px; border-radius: 999px; cursor: pointer; border: 0;
  background: linear-gradient(90deg, var(--c-primary) var(--val, 0%), rgb(255 255 255 / .28) 0);
}
.vp-progress { flex: 1; min-width: 60px; }
.vp-vol { flex: none; width: 72px; }
.vp-progress::-webkit-slider-thumb, .vp-vol::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%;
  background: var(--c-primary); border: 2px solid #fff;
  box-shadow: 0 1px 5px rgb(0 0 0 / .5);
}
.vp-progress::-moz-range-thumb, .vp-vol::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--c-primary); border: 2px solid #fff;
  box-shadow: 0 1px 5px rgb(0 0 0 / .5);
}
.vplayer.is-live .vp-progress { opacity: .35; pointer-events: none; }
.vp-livebadge { display: none; }
.vplayer.is-live .vp-livebadge { display: inline-flex; margin-inline: .35em; }
@media (max-width: 560px) { .vp-vol, .vp-pip { display: none; } }

/* ==========================================================================
   21 · AMBIENT LIGHT  · JS: Vetro.ambient(media) o [data-ambient]
   Alone di luce dietro a immagini/video, ricavato dai colori del media
   (stile "ambient mode"). Il canvas .ambient-glow lo crea il JS.
   ========================================================================== */
.ambient-host { position: relative; border-radius: inherit; }
.ambient-glow {
  position: absolute; inset: 0; z-index: -1;
  width: 100%; height: 100%; border-radius: inherit;
  transform: scale(var(--ambient-scale, 1.16));
  filter: blur(var(--ambient-blur, 44px)) saturate(1.6) brightness(1.05);
  opacity: var(--ambient-op, .65);
  pointer-events: none;
}
html[data-theme="dark"] .ambient-glow { opacity: calc(var(--ambient-op, .65) + .2); }

/* ==========================================================================
   22 · LIVE DATA (badge live, ticker, console log, readout)
   JS: Vetro.live.{feed, ticker, log, value}
   ========================================================================== */
.live-badge {
  display: inline-flex; align-items: center; gap: .5em;
  font: 750 var(--fs-xs) var(--font-body);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--danger-text);
}
.live-badge::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%;
  background: var(--c-danger);
  animation: vt-live 1.7s var(--ease) infinite;
}
.live-badge.is-idle { color: var(--text-3); }
.live-badge.is-idle::before { background: var(--text-3); animation: none; }
@keyframes vt-live {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c-danger) 50%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* Nastro scorrevole di quotazioni / notizie (il JS duplica il contenuto) */
.ticker {
  overflow: hidden; user-select: none;
  border-block: var(--border-w) solid var(--border);
  background: var(--surface);
  -webkit-mask: linear-gradient(90deg, transparent, #000 7% 93%, transparent);
          mask: linear-gradient(90deg, transparent, #000 7% 93%, transparent);
}
.ticker-track {
  display: flex; gap: var(--sp-6); width: max-content;
  padding: .62em var(--sp-4);
  animation: vt-ticker var(--ticker-t, 28s) linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes vt-ticker { to { transform: translateX(-50%); } }
.ticker-item {
  display: inline-flex; align-items: baseline; gap: .55em;
  font: 600 var(--fs-sm) var(--font-mono); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ticker-item .sym { color: var(--text-2); }
.ticker-item .delta { font-size: var(--fs-xs); font-weight: 700; }
.ticker-item .delta.up   { color: var(--success-text); }
.ticker-item .delta.down { color: var(--danger-text); }

/* Console log live (scuro in entrambi i temi, tinta dal primary) */
.console {
  height: var(--h, 250px); overflow-y: auto;
  padding: var(--sp-3) var(--sp-4);
  background: color-mix(in srgb, #0a1015 95%, var(--c-primary));
  color: #d6e2e8;
  border: var(--border-w) solid rgb(255 255 255 / .08);
  border-radius: var(--radius-m);
  font: 500 var(--fs-sm)/1.6 var(--font-mono);
  scrollbar-width: thin;
  overscroll-behavior: contain;
}
.log-line { display: flex; gap: .7em; align-items: baseline; animation: vt-fade-up .25s var(--ease) both; }
.log-time { flex: none; color: rgb(255 255 255 / .35); font-size: var(--fs-xs); }
.log-lvl  { flex: none; width: 7px; height: 7px; border-radius: 50%; align-self: center; background: #58a6ff; }
.log-line.ok   .log-lvl { background: #3fb950; }
.log-line.warn .log-lvl { background: #d29922; }
.log-line.err  .log-lvl { background: #f85149; }
.log-line.err  .log-msg { color: #ffa8a3; }
.log-line.warn .log-msg { color: #e6c980; }
.log-msg { word-break: break-word; }

/* Valore live con flash su variazione (stile trading) */
.readout { display: grid; gap: .12em; }
.readout-label {
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-3);
}
.readout-value {
  font: 750 clamp(1.4rem, 1.1rem + 1.2vw, 2rem)/1.15 var(--font-mono);
  font-variant-numeric: tabular-nums; color: var(--text);
}
.readout-unit { font-size: .55em; font-weight: 600; color: var(--text-3); margin-left: .2em; }
.flash-up   { animation: vt-flash-up .8s var(--ease); }
.flash-down { animation: vt-flash-down .8s var(--ease); }
@keyframes vt-flash-up {
  0% { color: var(--success-text); text-shadow: 0 0 16px color-mix(in srgb, var(--c-success) 55%, transparent); }
}
@keyframes vt-flash-down {
  0% { color: var(--danger-text); text-shadow: 0 0 16px color-mix(in srgb, var(--c-danger) 55%, transparent); }
}

/* ==========================================================================
   23 · IMPACT & SENSORI (vibrazione, shake, tilt 3D, bussola, livella)
   JS: Vetro.impact.* e Vetro.motion.*
   ========================================================================== */
@keyframes vt-shake {
  10%, 90% { translate: -1px 0; }
  20%, 80% { translate:  2px 0; }
  30%, 50%, 70% { translate: -4px 0; }
  40%, 60% { translate:  4px 0; }
}
.shake { animation: vt-shake .45s var(--ease); }

/* Card 3D che si inclina col puntatore o col giroscopio ([data-tilt]) */
.tilt {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  transition: transform .14s linear;
  will-change: transform;
}
.tilt-layer { transform: translateZ(36px); }

/* Bussola: la lancetta ruota con --heading (gradi) */
.compass {
  --size: 170px;
  position: relative; width: var(--size); aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--border-2);
  background:
    radial-gradient(circle at 50% 50%, var(--surface) 0 58%, var(--surface-2) 59% 100%);
  box-shadow: inset 0 2px 10px rgb(0 0 0 / .08), var(--shadow-s);
  display: grid; place-items: center;
}
.compass b {
  position: absolute; font: 700 var(--fs-xs) var(--font-mono); color: var(--text-3);
}
/* coordinate esplicite su entrambi gli assi: dentro .compass-dial (bussola
   "rose") non c'è la grid centrante, senza queste N e S collassano a sinistra */
.compass .pt-n { top: 9px; left: 50%; translate: -50% 0; color: var(--danger-text); }
.compass .pt-s { bottom: 9px; left: 50%; translate: -50% 0; }
.compass .pt-e { right: 12px; top: 50%; translate: 0 -50%; }
.compass .pt-o { left: 12px; top: 50%; translate: 0 -50%; }
.compass-needle {
  position: absolute; left: calc(50% - 2.5px); bottom: 50%;
  width: 5px; height: 40%;
  transform-origin: 50% 100%;
  rotate: var(--heading, 0deg);
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(var(--c-danger) 45%, color-mix(in srgb, var(--c-danger) 30%, var(--surface)));
  transition: rotate .2s var(--ease);
}
.compass::after { /* perno centrale */
  content: ""; position: absolute; width: 13px; height: 13px; border-radius: 50%;
  background: var(--text); border: 3px solid var(--surface); box-shadow: var(--shadow-s);
}

/* Livella a bolla: la bolla si sposta con --bx/--by */
.bubble-level {
  position: relative; overflow: hidden;
  height: var(--h, 130px);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  background:
    linear-gradient(var(--border) 0 0) center / 100% 1px no-repeat,
    linear-gradient(var(--border) 0 0) center / 1px 100% no-repeat,
    radial-gradient(circle at center, transparent 0 26px, var(--surface-2) 27px 28px, transparent 29px),
    var(--surface);
}
.bubble-dot {
  position: absolute; left: 50%; top: 50%;
  width: 26px; height: 26px; margin: -13px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c-info) 30%, #fff), var(--c-info));
  box-shadow: var(--shadow-m);
  translate: var(--bx, 0px) var(--by, 0px);
  transition: translate .09s linear;
}
.bubble-level.is-level .bubble-dot { background: radial-gradient(circle at 32% 28%, color-mix(in srgb, var(--c-success) 30%, #fff), var(--c-success)); }

/* ==========================================================================
   24 · MAPPE  · JS: Vetro.map(el, opts) — richiede Leaflet (CDN)
   Skin coerente col tema per tile, controlli, popup e pin.
   ========================================================================== */
.map-box {
  position: relative; z-index: 0; overflow: hidden;
  height: var(--h, 380px);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-l);
  background: var(--surface-2);
  box-shadow: var(--shadow-s);
}
.map-box .leaflet-container { width: 100%; height: 100%; background: var(--surface-2); font-family: var(--font-body); }
/* MapLibre dentro .map-box */
.map-box .maplibregl-map { width: 100%; height: 100%; font-family: var(--font-body); }
.map-box .maplibregl-popup-content { background: var(--surface); color: var(--text); border-radius: var(--radius-s); box-shadow: var(--shadow-m); font: 600 var(--fs-sm) var(--font-body); }
.map-box .maplibregl-popup-tip { border-top-color: var(--surface); }
.map-fallback { display: grid; place-items: center; height: 100%; padding: var(--sp-5); color: var(--text-2); text-align: center; font-size: var(--fs-sm); }

/* tile in tema scuro: inversione morbida (solo con .map-dark-auto) */
html[data-theme="dark"] .map-box.map-dark-auto .leaflet-tile-pane {
  filter: invert(1) hue-rotate(180deg) brightness(.9) contrast(.9) saturate(.65);
}
.map-box .leaflet-bar { border: 0; box-shadow: var(--shadow-m); border-radius: var(--radius-s); overflow: hidden; }
.map-box .leaflet-bar a {
  background: var(--surface); color: var(--text);
  border-bottom: var(--border-w) solid var(--border);
  width: 32px; height: 32px; line-height: 32px;
}
.map-box .leaflet-bar a:hover { background: var(--surface-2); }
.map-box .leaflet-control-attribution {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  color: var(--text-3); font-size: 10px;
  border-radius: var(--radius-s) 0 0 0;
}
.map-box .leaflet-control-attribution a { color: var(--text-2); }
.map-box .leaflet-popup-content-wrapper {
  background: var(--surface); color: var(--text);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m); box-shadow: var(--shadow-l);
}
.map-box .leaflet-popup-tip { background: var(--surface); border: var(--border-w) solid var(--border); }
.map-box .leaflet-popup-content { margin: 12px 16px; font: 400 var(--fs-sm)/1.5 var(--font-body); }
.map-pop b { display: block; font-size: var(--fs-base); margin-bottom: .15em; }
.map-pop span { color: var(--text-2); }

/* Pin marker in CSS puro (colore via --pin-c) */
.vt-pin { position: relative; width: 30px; height: 40px; }
.vt-pin::before {
  content: ""; position: absolute; left: 1px; top: 0;
  width: 26px; height: 26px;
  background: var(--pin-c, var(--c-primary));
  border: 3px solid var(--paper);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 6px 14px -4px rgb(0 0 0 / .5);
}
.vt-pin::after {
  content: ""; position: absolute; left: 11px; top: 9px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--paper);
}
.vt-pin.is-bounce { animation: vt-pin-drop .5s var(--ease-pop); }
@keyframes vt-pin-drop { from { translate: 0 -14px; opacity: 0; } }

.map-fallback {
  display: grid; place-items: center; height: 100%;
  padding: var(--sp-5); text-align: center; color: var(--text-2);
}

/* ==========================================================================
   25 · FORM AVANZATI & ERRORI  · JS: Vetro.form.validate(form)
   ========================================================================== */
.req::after { content: " *"; color: var(--danger-text); }
.char-counter {
  margin-top: .35em; text-align: right;
  font: 600 var(--fs-xs) var(--font-mono); color: var(--text-3);
  font-variant-numeric: tabular-nums;
}
.char-counter.is-over { color: var(--danger-text); }
.form-errors ul { margin: .3em 0 0 1.15em; padding: 0; }
.form-errors a { color: inherit; font-weight: 650; text-underline-offset: 2px; }

/* Pagina di errore (404/500): codice gigante con effetto glitch */
.error-hero { text-align: center; padding-block: var(--sp-7); }
.error-code {
  position: relative; display: inline-block;
  font: 800 clamp(4rem, 3rem + 9vw, 8.5rem)/1 var(--font-display);
  letter-spacing: -.03em; color: var(--text);
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0; overflow: hidden;
}
.glitch::before { color: var(--c-accent); translate: -3px 0; animation: vt-glitch 2.6s steps(2, end) infinite; }
.glitch::after  { color: var(--c-info);   translate:  3px 0; animation: vt-glitch 2.6s steps(2, end) infinite reverse; }
@keyframes vt-glitch {
  0%, 8%, 100% { clip-path: inset(0 0 100% 0); }
  2%  { clip-path: inset(12% 0 56% 0); }
  4%  { clip-path: inset(64% 0 8% 0); }
  6%  { clip-path: inset(38% 0 42% 0); }
  52% { clip-path: inset(0 0 100% 0); }
  54% { clip-path: inset(78% 0 4% 0); }
  56% { clip-path: inset(22% 0 60% 0); }
}

/* ==========================================================================
   26 · MODALI EXTRA & DRAWER
   .sheet  → il modal sale dal basso (stile mobile)
   .drawer → pannello laterale; toggle con [data-drawer="#id"]
   Vetro.confirm() costruisce un modal di conferma e ritorna una Promise.
   ========================================================================== */
dialog.modal.sheet {
  margin: auto auto 0; width: 100%;
  max-width: min(640px, 100vw);
}
dialog.modal.sheet .modal-card {
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  border-bottom: 0;
}
dialog.modal.sheet[open] .modal-card { animation: vt-sheet-up var(--t-med) var(--ease-pop) both; }
@keyframes vt-sheet-up { from { translate: 0 60px; opacity: .4; } }
dialog.modal.sheet .modal-card::before { /* maniglia */
  content: ""; display: block; width: 44px; height: 4px;
  margin: 10px auto 0; border-radius: 999px; background: var(--border-2);
}

.drawer {
  position: fixed; top: 0; bottom: 0; right: 0;
  z-index: var(--z-modal);
  width: min(380px, 92vw);
  display: flex; flex-direction: column;
  background: var(--surface);
  border-left: var(--border-w) solid var(--border);
  box-shadow: var(--shadow-l);
  translate: 105% 0; visibility: hidden;
  transition: translate var(--t-med) var(--ease), visibility 0s var(--t-med);
}
.drawer.open { translate: 0 0; visibility: visible; transition-delay: 0s; }
.drawer-left { right: auto; left: 0; border-left: 0; border-right: var(--border-w) solid var(--border); translate: -105% 0; }
.drawer-left.open { translate: 0 0; }
.drawer-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: var(--border-w) solid var(--border);
}
.drawer-head h3 { margin: 0; font-size: 1.1rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: var(--sp-5); }
.drawer-foot {
  display: flex; gap: var(--sp-2); justify-content: flex-end;
  padding: var(--sp-4) var(--sp-5);
  border-top: var(--border-w) solid var(--border);
  background: var(--surface-2);
}
.drawer-backdrop {
  position: fixed; inset: 0; z-index: calc(var(--z-modal) - 1);
  background: var(--backdrop);
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* Riduzione movimento: spegne gli effetti decorativi più vistosi */
@media (prefers-reduced-motion: reduce) {
  .shine::after, .shine-auto::after, .aurora::before, .aurora::after,
  .neon-flicker, .glitch::before, .glitch::after, .ticker-track { animation: none !important; }
  .tilt { transform: none !important; }
}

/* ==========================================================================
   27 · COLLAPSE & ORGANIGRAMMA
   .collapse + [data-collapse="#id"]  · JS: Vetro.collapse()
   .org-wrap > albero generato da Vetro.org(el, dati) con rami comprimibili
   ========================================================================== */
.collapse { overflow: hidden; max-height: 0; transition: max-height var(--t-med) var(--ease); }
.collapse.open { max-height: none; }
[data-collapse] .icon { transition: rotate var(--t-med) var(--ease); }
[data-collapse].is-open .icon { rotate: 180deg; }

.org-wrap { overflow-x: auto; padding: var(--sp-3) var(--sp-2) var(--sp-5); }
.org-tree, .org-tree ul { list-style: none; margin: 0; padding: 0; }
.org-tree { display: flex; justify-content: center; min-width: max-content; margin-inline: auto; }
.org-tree ul {
  display: flex; align-items: flex-start; gap: var(--sp-4);
  padding-top: 26px; position: relative;
}
.org-tree ul::before { /* gambo che scende dal genitore */
  content: ""; position: absolute; top: 0; left: 50%;
  width: var(--border-w); height: 26px; background: var(--border-2);
}
.org-tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding-top: 26px; }
.org-tree li::before, .org-tree li::after {
  content: ""; position: absolute; top: 0; width: 50%; height: 26px;
}
.org-tree li::before { right: 50%; border-top: var(--border-w) solid var(--border-2); }
.org-tree li::after  { left: 50%;  border-top: var(--border-w) solid var(--border-2); border-left: var(--border-w) solid var(--border-2); }
.org-tree li:first-child::before { border-top: 0; }
.org-tree li:last-child::after   { border-top: 0; }
.org-tree > li { padding-top: 0; }
.org-tree > li::before, .org-tree > li::after { display: none; }
.org-tree li.is-collapsed > ul { display: none; }

.org-node {
  position: relative; z-index: 1;
  display: grid; justify-items: center; gap: .3em;
  min-width: 132px; padding: var(--sp-3) var(--sp-4) var(--sp-4);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-top: 3px solid var(--org-c, var(--c-primary));
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
  text-align: center;
  transition: box-shadow var(--t-fast) var(--ease), translate var(--t-fast) var(--ease);
}
.org-node:hover { box-shadow: var(--shadow-m); translate: 0 -2px; }
.org-av {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 var(--fs-sm) var(--font-display); color: var(--on-brand);
  background: var(--org-c, var(--c-primary));
}
.org-name { font-weight: 650; font-size: var(--fs-base); line-height: 1.2; }
.org-role { font-size: var(--fs-xs); color: var(--text-3); }
.org-toggle {
  position: absolute; left: calc(50% - 12px); bottom: -12px; z-index: 2;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--text-2);
  border: var(--border-w) solid var(--border-2);
  box-shadow: var(--shadow-s);
  font: 700 10px var(--font-mono);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.org-toggle:hover { background: var(--primary-soft); color: var(--primary-text); }
.org-toggle .icon { width: 13px; height: 13px; transition: rotate var(--t-med) var(--ease); }
li.is-collapsed .org-toggle .icon { rotate: -90deg; }
li.is-collapsed .org-toggle { background: var(--primary-soft); color: var(--primary-text); }

/* ==========================================================================
   28 · CALENDARIO — VISTE SETTIMANA / GIORNO / LISTA
   Generate da Vetro.calendar(el, { view:"week" }) · drag, creazione su slot,
   swipe per cambiare periodo, densità compatta, multilingua.
   ========================================================================== */
.cal-head { flex-wrap: wrap; gap: var(--sp-2); }
.cal-views .btn, .cal-nav .btn { white-space: nowrap; }
.cal-body { position: relative; }
.cal-body.slide-l > * { animation: vt-slide-l var(--t-med) var(--ease) both; }
.cal-body.slide-r > * { animation: vt-slide-r var(--t-med) var(--ease) both; }

.cal { --cal-hh: 46px; --cal-gutter: 52px; --cal-colw: 110px; }
.cal.is-compact { --cal-hh: 28px; }

.cal-tscroll { overflow: auto; max-height: var(--cal-vh, 580px); overscroll-behavior: contain; border: var(--border-w) solid var(--border); border-radius: var(--radius-m); background: var(--surface); }
.cal-thead, .cal-allday, .cal-trow {
  display: grid;
  grid-template-columns: var(--cal-gutter) repeat(var(--cols, 7), minmax(var(--cal-colw), 1fr));
  /* larghezza minima CALCOLATA (non max-content): le tre righe sono grid
     separate e un chip largo gonfierebbe solo la propria riga, facendo
     scivolare le colonne rispetto a testata e griglia oraria */
  min-width: calc(var(--cal-gutter) + var(--cols, 7) * var(--cal-colw));
  width: 100%;
}
.cal.view-day .cal-thead, .cal.view-day .cal-allday, .cal.view-day .cal-trow { --cal-colw: 220px; }

.cal-corner, .cal-gutter { position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: var(--border-w) solid var(--border); }
.cal-thead .cal-corner { z-index: 7; }
.cal-thead { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: var(--border-w) solid var(--border); }
.cal-dayhead {
  padding: .5em .4em; text-align: center; border-right: var(--border-w) solid var(--border);
  display: grid; gap: .05em; justify-items: center;
}
.cal-dayhead:last-child { border-right: 0; }
.cal-dayhead .dh-dow { font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; color: var(--text-3); font-weight: 650; }
.cal-dayhead .dh-num {
  font: 700 var(--fs-md) var(--font-display);
  width: 1.9em; line-height: 1.9em; border-radius: 50%;
}
.cal-dayhead.today .dh-num { background: var(--c-primary); color: var(--on-brand); }
.cal-dayhead.today .dh-dow { color: var(--primary-text); }

.cal-allday { border-bottom: var(--border-w) solid var(--border); background: var(--surface); }
.cal-allday .cal-gutter { font-size: 10px; color: var(--text-3); display: grid; place-items: center; padding: .3em; }
.cal-adcol { padding: 3px 4px; display: grid; gap: 3px; align-content: start; border-right: var(--border-w) solid var(--border); min-height: 26px; min-width: 0; }
.cal-adcol > .cal-adev { min-width: 0; } /* il chip nowrap si tronca con l'ellissi invece di sbordare nella colonna dopo */
.cal-adcol:last-child { border-right: 0; }
.cal-adev {
  font-size: var(--fs-xs); font-weight: 650; line-height: 1.3;
  padding: .15em .5em; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--ev-c, var(--c-primary)) 16%, var(--surface));
  color: color-mix(in oklab, var(--ev-c, var(--c-primary)) 72%, var(--ink));
  border: var(--border-w) solid color-mix(in srgb, var(--ev-c, var(--c-primary)) 35%, transparent);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.cal-tbody { overflow: visible; }
.cal-hour {
  height: var(--cal-hh); padding: 2px 8px 0 0; text-align: right;
  font: 600 var(--fs-xs) var(--font-mono); color: var(--text-3);
  transform: translateY(-1px);
}
.cal-col {
  position: relative; border-right: var(--border-w) solid var(--border);
  background:
    repeating-linear-gradient(to bottom,
      transparent 0 calc(var(--cal-hh) - 1px),
      var(--border) calc(var(--cal-hh) - 1px) var(--cal-hh));
}
.cal-col:last-child { border-right: 0; }
.cal-col.today { background-color: color-mix(in srgb, var(--c-primary) 4%, transparent); }
.cal-col.wend  { background-color: color-mix(in srgb, var(--text-3) 6%, transparent); }

.cal-ev-block {
  position: absolute; z-index: 1;
  border-radius: var(--radius-s);
  padding: .25em .5em; overflow: hidden;
  font-size: var(--fs-xs); line-height: 1.3; cursor: grab;
  background: color-mix(in srgb, var(--ev-c, var(--c-primary)) 18%, var(--surface));
  border-left: 3px solid var(--ev-c, var(--c-primary));
  color: color-mix(in oklab, var(--ev-c, var(--c-primary)) 70%, var(--ink));
  box-shadow: var(--shadow-s);
  user-select: none; -webkit-user-select: none;
  transition: box-shadow var(--t-fast) var(--ease), filter var(--t-fast) var(--ease), scale var(--t-fast) var(--ease);
}
.cal-ev-block b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev-block time { opacity: .75; font-family: var(--font-mono); font-size: 10px; }
.cal-ev-block:hover { box-shadow: var(--shadow-m); z-index: 2; }
.cal-ev-block.is-armed { scale: 1.04; box-shadow: var(--shadow-m); z-index: 3; }
.cal-ev-block.is-dragging { opacity: .45; cursor: grabbing; }
.cal.is-compact .cal-ev-block time { display: none; }

.cal-ghost {
  position: absolute; z-index: 3; pointer-events: none;
  border: 2px dashed var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 12%, transparent);
  border-radius: var(--radius-s);
  font: 650 10px var(--font-mono); color: var(--primary-text);
  padding: .2em .45em;
}
.cal-hoverslot {
  position: absolute; z-index: 0; pointer-events: none;
  inset-inline: 2px; border-radius: var(--radius-s);
  border: 1px dashed var(--border-2);
  background: color-mix(in srgb, var(--c-primary) 6%, transparent);
  display: grid; place-items: center; color: var(--text-3);
}
.cal-hoverslot .icon { width: 14px; height: 14px; }
.cal-now {
  position: absolute; inset-inline: 0; z-index: 2; height: 2px;
  background: var(--c-danger); pointer-events: none;
}
.cal-now::before {
  content: ""; position: absolute; left: -4px; top: -3px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--c-danger);
}

/* vista lista (agenda) */
.cal-list { display: grid; gap: var(--sp-2); }
.cal-list .cal-ev { cursor: default; }
.cal-list-day {
  display: flex; align-items: baseline; gap: .6em;
  margin-top: var(--sp-3);
  font-weight: 700; font-family: var(--font-display);
}
.cal-list-day:first-child { margin-top: 0; }
.cal-list-day small { font-weight: 600; color: var(--text-3); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .08em; }
.cal-list-day.today { color: var(--primary-text); }
.cal-more { font-size: 10px; font-weight: 700; color: var(--text-3); }

/* ==========================================================================
   29 · METEO  · JS: Vetro.weather.mount(el, { lat, lon })
   Card meteo con icone animate in puro CSS (sole, nuvole, pioggia, neve…)
   ========================================================================== */
.weather { display: grid; gap: var(--sp-4); }
.wx-place { display: flex; align-items: center; gap: .45em; font-weight: 650; }
.wx-place .icon { width: 15px; height: 15px; color: var(--text-3); }
.wx-now { display: flex; align-items: center; gap: var(--sp-4); flex-wrap: wrap; }
.wx-temp { font: 750 clamp(2.4rem, 2rem + 1.6vw, 3.2rem)/1 var(--font-display); letter-spacing: -.02em; }
.wx-temp sup { font-size: .45em; font-weight: 650; color: var(--text-2); }
.wx-label { color: var(--text-2); font-weight: 600; }
.wx-chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.wx-chips .chip { font-size: var(--fs-xs); }
.wx-days { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: var(--sp-2); }
.wx-day {
  display: grid; justify-items: center; gap: .25em;
  padding: var(--sp-2) var(--sp-1);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  background: var(--surface);
  text-align: center;
}
.wx-day .dow { font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.wx-day .tt { font: 650 var(--fs-sm) var(--font-mono); }
.wx-day .tt small { color: var(--text-3); font-weight: 600; }
.wx-day .pp { font-size: 10px; color: var(--info-text); font-weight: 650; }
.wx-note { font-size: var(--fs-xs); color: var(--text-3); }

/* — icone meteo animate — */
.wicon { --wsize: 44px; position: relative; width: var(--wsize); height: var(--wsize); display: inline-block; flex: none; }
.wicon.lg { --wsize: 74px; }
.wi-core { /* sole */
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 46%; height: 46%; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe07a, var(--c-warning));
  box-shadow: 0 0 calc(var(--wsize) * .22) color-mix(in srgb, var(--c-warning) 65%, transparent);
}
.wi-rays { position: absolute; inset: 0; animation: vt-spin 14s linear infinite; }
.wi-rays::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background:
    repeating-conic-gradient(var(--c-warning) 0 6deg, transparent 6deg 45deg);
  -webkit-mask: radial-gradient(circle, transparent 0 36%, #000 37% 49%, transparent 50%);
          mask: radial-gradient(circle, transparent 0 36%, #000 37% 49%, transparent 50%);
}
.wicon.small-sun .wi-core { width: 34%; height: 34%; left: 32%; top: 34%; }
.wicon.small-sun .wi-rays { inset: 6% 28% 28% 6%; }
.wi-cloud, .wi-cloud-b {
  position: absolute; left: 12%; bottom: 18%;
  width: 64%; height: 34%; border-radius: 999px;
  background: linear-gradient(#fff, #cfd8df);
  box-shadow: 0 2px 6px rgb(20 30 40 / .18);
}
html[data-theme="dark"] .wi-cloud, html[data-theme="dark"] .wi-cloud-b { background: linear-gradient(#aebbc6, #7b8893); }
.wi-cloud::before {
  content: ""; position: absolute; left: 16%; top: -55%;
  width: 46%; aspect-ratio: 1; border-radius: 50%;
  background: inherit;
}
.wi-cloud::after {
  content: ""; position: absolute; right: 12%; top: -34%;
  width: 38%; aspect-ratio: 1; border-radius: 50%;
  background: inherit;
}
.wi-cloud-b { left: 30%; bottom: 32%; width: 52%; height: 26%; opacity: .65; animation: vt-cloud-drift 5.5s ease-in-out infinite alternate; }
@keyframes vt-cloud-drift { to { translate: 9% 0; } }
.wi-drops, .wi-flakes { position: absolute; left: 18%; right: 14%; bottom: 0; height: 22%; display: flex; justify-content: space-around; }
.wi-drops i {
  width: 2.5px; height: 100%; border-radius: 999px;
  background: var(--c-info); rotate: 14deg;
  animation: vt-rainfall 1s linear infinite;
}
.wi-drops i:nth-child(2) { animation-delay: .33s; }
.wi-drops i:nth-child(3) { animation-delay: .66s; }
.wicon.drizzle .wi-drops i { height: 60%; opacity: .8; animation-duration: 1.5s; }
@keyframes vt-rainfall {
  0% { translate: 0 -40%; opacity: 0; }
  30%, 70% { opacity: 1; }
  100% { translate: -12% 60%; opacity: 0; }
}
.wi-flakes i {
  width: 4px; height: 4px; border-radius: 50%; background: #fff;
  box-shadow: 0 0 0 1px rgb(140 170 200 / .5);
  animation: vt-snowfall 2.4s linear infinite;
}
html[data-theme="light"] .wi-flakes i, :root:not([data-theme]) .wi-flakes i { background: #bcd2e4; }
.wi-flakes i:nth-child(2) { animation-delay: .8s; }
.wi-flakes i:nth-child(3) { animation-delay: 1.6s; }
@keyframes vt-snowfall {
  0% { translate: 0 -60%; opacity: 0; }
  25%, 75% { opacity: 1; }
  100% { translate: 30% 90%; opacity: 0; }
}
.wi-bolt {
  position: absolute; left: 44%; bottom: -4%;
  width: 22%; height: 36%;
  background: var(--c-warning);
  clip-path: polygon(45% 0, 100% 0, 55% 45%, 85% 45%, 20% 100%, 42% 52%, 8% 52%);
  animation: vt-bolt 2.6s ease-in-out infinite;
  filter: drop-shadow(0 0 5px color-mix(in srgb, var(--c-warning) 70%, transparent));
}
@keyframes vt-bolt { 0%, 86%, 94%, 100% { opacity: 1; } 90%, 92% { opacity: .15; } }
.wi-fog { position: absolute; left: 10%; right: 10%; bottom: 4%; height: 26%; display: grid; gap: 22%; }
.wi-fog i { height: 3px; border-radius: 999px; background: color-mix(in srgb, var(--text-3) 60%, transparent); animation: vt-fog 3.5s ease-in-out infinite alternate; }
.wi-fog i:nth-child(2) { animation-delay: .9s; width: 80%; justify-self: end; }

/* — variante notte: luna e stelle (icon(code, { night:true })) — */
.wi-moon {
  position: absolute; left: 50%; top: 50%; translate: -50% -50%;
  width: 52%; height: 52%; border-radius: 50%;
  background: radial-gradient(circle at 38% 35%, #f2f6ff, #b9c6d8);
  -webkit-mask: radial-gradient(circle at 74% 24%, transparent 0 38%, #000 41%);
          mask: radial-gradient(circle at 74% 24%, transparent 0 38%, #000 41%);
  filter: drop-shadow(0 0 calc(var(--wsize) * .14) rgb(190 215 245 / .45));
}
.wicon.small-moon .wi-moon { width: 40%; height: 40%; left: 33%; top: 35%; }
.wi-stars { position: absolute; inset: 4% 6%; }
.wi-stars i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #dfe9ff;
  box-shadow: 0 0 6px rgb(200 220 255 / .9);
  animation: vt-twinkle 2.2s ease-in-out infinite;
}
.wi-stars i:nth-child(1) { left: 10%; top: 14%; }
.wi-stars i:nth-child(2) { right: 6%; top: 32%; animation-delay: .7s; }
.wi-stars i:nth-child(3) { left: 24%; bottom: 12%; animation-delay: 1.4s; }
@keyframes vt-twinkle { 0%, 100% { opacity: .25; scale: .8; } 50% { opacity: 1; scale: 1.15; } }
html[data-theme="light"] .wi-stars i, :root:not([data-theme]) .wi-stars i { background: #8fa6c4; box-shadow: 0 0 5px rgb(140 170 210 / .6); }
@keyframes vt-fog { to { translate: 10% 0; opacity: .55; } }

/* ==========================================================================
   30 · MAPPE — FILTRI VISIVI (skin tile) ed export
   Vetro.map(el, { filter:"ink" }) oppure istanza.setFilter("notte"|"ink"|
   "gray"|"sepia"|"none"). I filtri manuali sostituiscono il dark automatico.
   ========================================================================== */
.map-box.map-filter-notte .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.88) contrast(.95) saturate(.6); }
.map-box.map-filter-ink   .leaflet-tile-pane { filter: grayscale(1) invert(1) contrast(1.28) brightness(.82); }
.map-box.map-filter-gray  .leaflet-tile-pane { filter: grayscale(1) contrast(1.04); }
.map-box.map-filter-sepia .leaflet-tile-pane { filter: sepia(.85) saturate(1.15) contrast(.95) brightness(1.02); }

@media (prefers-reduced-motion: reduce) {
  .wi-rays, .wi-cloud-b, .wi-drops i, .wi-flakes i, .wi-bolt, .wi-fog i, .wi-stars i { animation: none !important; }
}

/* ==========================================================================
   31 · FOGLIO DATI (datagrid / Excel live)  · JS: Vetro.sheet(el, opts)
   ========================================================================== */
.sheet-tabs { display: flex; gap: var(--sp-1); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.sheet-tab {
  padding: .3em .85em; cursor: pointer;
  font: 650 var(--fs-xs) var(--font-body);
  color: var(--text-2); background: var(--surface-2);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-pill);
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.sheet-tab:hover { color: var(--text); }
.sheet-tab.is-active { background: var(--c-primary); border-color: var(--c-primary); color: var(--on-brand); }

.sheet-wrap {
  overflow: auto; max-height: var(--sheet-h, 440px);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  background: var(--surface);
  overscroll-behavior: contain;
}
.sheet-wrap:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.sheet-table {
  border-collapse: separate; border-spacing: 0;
  min-width: 100%; font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}
.sheet-table th {
  position: sticky; z-index: 2;
  background: var(--surface-2); color: var(--text-3);
  font: 650 var(--fs-xs) var(--font-body);
  letter-spacing: .04em; text-align: center;
  padding: .34em .5em; user-select: none;
  border-bottom: var(--border-w) solid var(--border);
  border-right: var(--border-w) solid var(--border);
}
.sheet-table thead th { top: 0; }
.sheet-table .sh-row { left: 0; font-family: var(--font-mono); }
.sheet-table .sh-corner { left: 0; z-index: 4; }
.sheet-table thead th.sh-col { z-index: 3; }
.sh-col.is-hl, .sh-row.is-hl { background: var(--primary-soft); color: var(--primary-text); }
.sh-col { position: relative; }
.sh-rz { position: absolute; top: 0; right: -4px; width: 8px; height: 100%; cursor: col-resize; z-index: 5; touch-action: none; }
.sh-rz::after { content: ""; position: absolute; inset: 0 3px; border-radius: 2px; }
.sh-rz:hover::after { background: var(--c-primary); }

.sh-cell {
  padding: .32em .55em; cursor: cell;
  background: var(--surface);
  border-right: var(--border-w) solid var(--border);
  border-bottom: var(--border-w) solid var(--border);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 340px;
}
.sh-cell.num { text-align: right; font-family: var(--font-mono); font-size: .94em; }
tr.sh-hd .sh-cell { font-weight: 650; background: color-mix(in srgb, var(--c-primary) 6%, var(--surface)); }
.sh-cell.is-sel {
  outline: 2px solid var(--c-primary); outline-offset: -2px;
  background: color-mix(in srgb, var(--c-primary) 9%, var(--surface));
}
.sh-cell.is-edit {
  outline: 2px solid var(--c-accent); outline-offset: -2px;
  background: var(--surface); cursor: text;
  white-space: pre; text-overflow: clip; overflow: visible;
  min-width: 64px;
}

/* ==========================================================================
   32 · PATH SVG INTERATTIVI  · JS: Vetro.path.editor / Vetro.path.draw
   ========================================================================== */
.path-box {
  position: relative; overflow: hidden;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  background: var(--surface);
  touch-action: none;
}
.path-box svg { display: block; width: 100%; height: auto; user-select: none; }
.pe-gridline { stroke: var(--border); stroke-width: 1; opacity: .55; }
.pe-line {
  fill: none; stroke: var(--c-primary);
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--c-primary) 30%, transparent));
}
.pe-pt {
  fill: var(--surface); stroke: var(--c-primary); stroke-width: 2.5;
  cursor: grab; transition: r var(--t-fast) var(--ease), fill var(--t-fast) var(--ease);
}
.pe-pt:hover { r: 9px; fill: var(--primary-soft); }
.pe-pt.is-drag { cursor: grabbing; fill: var(--c-primary); }
.path-box.is-draw { cursor: crosshair; }
.pd-stroke { fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ==========================================================================
   33 · SCROLL & SITE FX — effetti da sito interattivo
   Path che si disegna con lo scroll (Vetro.path.scroll), cursore custom,
   marquee infinito, sticker fluttuanti, swap al passaggio, lettere che
   rimbalzano e parole a rotazione.
   ========================================================================== */

/* ---- path disegnato dallo scroll ---- */
.scrollpath { position: absolute; inset: 0; pointer-events: none; overflow: visible; }
.scrollpath path.sp-line {
  fill: none;
  stroke: var(--sp-c, var(--c-primary));
  stroke-linecap: round; stroke-linejoin: round;
  opacity: var(--sp-o, 1);
}
.scrollpath path.sp-ghost {
  fill: none;
  stroke: var(--sp-c, var(--c-primary));
  opacity: .12;
  stroke-linecap: round;
}
.scrollpath .sp-dot {
  fill: var(--surface);
  stroke: var(--sp-c, var(--c-primary));
  stroke-width: 2.5;
  transition: fill var(--t-med) var(--ease), r var(--t-med) var(--ease);
}
.scrollpath .sp-dot.is-passed { fill: var(--sp-c, var(--c-primary)); }
.sp-traveler {
  position: absolute; left: 0; top: 0; z-index: 3;
  pointer-events: none; user-select: none;
  font-size: var(--sp-size, 22px); line-height: 1;
  filter: drop-shadow(0 2px 6px color-mix(in srgb, var(--sp-c, var(--c-primary)) 45%, transparent));
  will-change: transform;
}
/* decorazione di pagina: SEMPRE dietro al contenuto (card, player, bottoni) —
   con z negativo la linea vive tra lo sfondo pagina e tutto ciò che ha un box */
.scrollpath-page { z-index: -1; --sp-o: .5; }
@media (max-width: 1100px) { .scrollpath-page { display: none; } }

/* tappe collegate: si "accendono" quando il viaggiatore le supera */
[data-sp-step] { transition: opacity var(--t-med) var(--ease), translate var(--t-med) var(--ease), border-color var(--t-med) var(--ease); opacity: .45; translate: 0 8px; }
[data-sp-step].is-passed { opacity: 1; translate: 0 0; border-color: var(--c-primary); }

/* ---- cursore custom ---- */
body.vt-cursor-on, body.vt-cursor-on a, body.vt-cursor-on button,
body.vt-cursor-on .btn, body.vt-cursor-on [data-cursor], body.vt-cursor-on label { cursor: none !important; }
.vt-cursor-dot, .vt-cursor-ring {
  position: fixed; left: 0; top: 0; z-index: 99990;
  pointer-events: none; border-radius: 50%;
  will-change: transform;
}
.vt-cursor-dot {
  width: 8px; height: 8px; margin: -4px 0 0 -4px;
  background: var(--c-primary);
}
.vt-cursor-ring {
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  border: 1.5px solid color-mix(in srgb, var(--c-primary) 75%, transparent);
  background: color-mix(in srgb, var(--c-primary) 7%, transparent);
  display: grid; place-items: center;
  font: 650 10px var(--font-body); letter-spacing: .06em; text-transform: uppercase;
  color: var(--primary-text);
  transition: width var(--t-med) var(--ease-pop), height var(--t-med) var(--ease-pop),
    margin var(--t-med) var(--ease-pop), background var(--t-med) var(--ease),
    border-color var(--t-med) var(--ease);
}
.vt-cursor-ring.is-hover {
  width: 58px; height: 58px; margin: -29px 0 0 -29px;
  background: color-mix(in srgb, var(--c-primary) 14%, transparent);
}
.vt-cursor-ring.has-label {
  width: 76px; height: 76px; margin: -38px 0 0 -38px;
  background: var(--c-primary); border-color: var(--c-primary);
  color: var(--on-brand);
}
.vt-cursor-ring .vt-cursor-label { padding: 0 .5em; text-align: center; }
.vt-cursor-dot.is-down { scale: .6; }

/* ---- marquee infinito ---- */
.marquee {
  overflow: hidden; display: flex;
  -webkit-mask: linear-gradient(90deg, transparent, #000 7% 93%, transparent);
          mask: linear-gradient(90deg, transparent, #000 7% 93%, transparent);
}
.marquee-track {
  display: flex; align-items: center; flex: none;
  gap: var(--mq-gap, 2.2em);
  padding-right: var(--mq-gap, 2.2em);
  white-space: nowrap; will-change: transform;
  animation: vt-marquee var(--mq-dur, 18s) linear infinite;
  animation-direction: var(--mq-dir, normal);
}
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes vt-marquee { to { transform: translateX(-100%); } }
.marquee-big {
  font: 800 clamp(1.6rem, 1.2rem + 2.6vw, 3rem)/1.1 var(--font-display);
  letter-spacing: -.02em; text-transform: uppercase;
}
.marquee-big .mq-sep { color: var(--c-accent); }
.marquee.outline .marquee-track > * {
  color: transparent;
  -webkit-text-stroke: 1.5px var(--text-3);
}
.marquee.outline .marquee-track > .mq-sep { -webkit-text-stroke: 0; color: var(--c-accent); }

/* ---- sticker fluttuanti ---- */
.is-floating {
  animation: vt-float var(--fl-dur, 4.5s) ease-in-out var(--fl-delay, 0s) infinite alternate;
  will-change: transform;
}
@keyframes vt-float {
  from { transform: translate(0, 0) rotate(0deg); }
  to { transform: translate(var(--fl-dx, 0px), var(--fl-dy, -12px)) rotate(var(--fl-rot, 5deg)); }
}
.sticker {
  position: absolute; z-index: 1;
  font-size: var(--st-size, 30px); line-height: 1;
  user-select: none; pointer-events: none;
  filter: drop-shadow(0 3px 8px rgb(10 18 28 / .18));
}

/* ---- swap al passaggio (card progetto) ---- */
.swap { position: relative; display: block; overflow: hidden; border-radius: var(--radius-m); cursor: pointer; }
.swap > * { display: block; width: 100%; transition: scale var(--t-slow) var(--ease), opacity var(--t-med) var(--ease); }
.swap > *:last-child:not(:only-child) { position: absolute; inset: 0; height: 100%; opacity: 0; }
.swap:hover > *:first-child, .swap:focus-visible > *:first-child { scale: 1.05; }
.swap:hover > *:last-child:not(:only-child), .swap:focus-visible > *:last-child:not(:only-child) { opacity: 1; scale: 1.02; }
.swap-face {
  display: grid; place-items: center; gap: .3em;
  aspect-ratio: 4 / 3; padding: var(--sp-4);
  font: 750 var(--fs-lg) var(--font-display);
  color: var(--on-brand); text-align: center;
}

/* ---- lettere che rimbalzano ---- */
.lts .lt { display: inline-block; white-space: pre; }
.lts.is-play .lt {
  animation: vt-lt-bounce .62s var(--ease-pop) both;
  animation-delay: calc(var(--i) * var(--lt-stagger, 34ms));
}
@keyframes vt-lt-bounce {
  0% { transform: translateY(0) rotate(0); }
  35% { transform: translateY(-.34em) rotate(-5deg); }
  65% { transform: translateY(.08em) rotate(3deg); }
  100% { transform: translateY(0) rotate(0); }
}

/* ---- parole a rotazione ---- */
.cycle { display: inline-block; vertical-align: bottom; overflow: hidden; }
.cycle .cycle-w { display: inline-block; will-change: transform, opacity; color: var(--primary-text); }
.cycle .cycle-w.is-out { animation: vt-cy-out .24s var(--ease) both; }
.cycle .cycle-w.is-in { animation: vt-cy-in .3s var(--ease-pop) both; }
@keyframes vt-cy-out { to { transform: translateY(-110%); opacity: 0; } }
@keyframes vt-cy-in { from { transform: translateY(110%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .marquee-track, .is-floating, .lts.is-play .lt, .cycle .cycle-w { animation: none !important; }
  [data-sp-step] { opacity: 1; translate: 0 0; }
}

/* ==========================================================================
   34 · NAVBAR — RICERCA COMPONENTI (stile docs) · indice: window.VETRO_INDEX
   ========================================================================== */
.nav-search { position: relative; }
.nav-search > .icon {
  position: absolute; left: .65em; top: 50%; translate: 0 -50%;
  width: 14px; height: 14px; color: var(--text-3); pointer-events: none;
}
.nav-search input {
  width: clamp(150px, 15vw, 225px);
  padding: .44em .9em .44em 2.15em;
  font: 500 var(--fs-sm) var(--font-body); color: var(--text);
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-pill);
  outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), width var(--t-med) var(--ease);
}
.nav-search input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.nav-search input::-webkit-search-cancel-button { display: none; }
.nav-search kbd {
  position: absolute; right: .6em; top: 50%; translate: 0 -50%;
  font: 600 9.5px var(--font-mono); color: var(--text-3);
  padding: .12em .42em; border: var(--border-w) solid var(--border);
  border-radius: 5px; background: var(--surface-2); pointer-events: none;
}
.nav-search input:focus ~ kbd { display: none; }
.nav-search-pop {
  position: absolute; top: calc(100% + 9px); right: 0; z-index: 70;
  width: min(340px, 86vw); max-height: 380px; overflow: auto;
  padding: 6px; display: none;
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-l);
}
.nav-search-pop.open { display: block; animation: vt-pop-in var(--t-fast) var(--ease-pop); }
.ns-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1em;
  padding: .52em .65em; border-radius: var(--radius-s); cursor: pointer;
}
.ns-item:hover, .ns-item.is-active { background: var(--primary-soft); }
.ns-item b { font-weight: 650; font-size: var(--fs-sm); }
.ns-item small { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; }
.ns-empty { padding: .8em; color: var(--text-3); font-size: var(--fs-sm); }
/* la ricerca: inline su desktop, dentro al menu su mobile (vedi blocco navbar) */

/* ==========================================================================
   35 · PAGE NAV — precedente / successiva (demo multipagina)
   ========================================================================== */
.page-nav-sec { position: relative; z-index: 1; padding-block: var(--sp-7); }
.page-nav {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4);
  padding-top: var(--sp-6);
  border-top: var(--border-w) solid var(--border);
}
.page-nav a {
  display: grid; gap: .3em; padding: var(--sp-4) var(--sp-5);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  text-decoration: none; color: var(--text);
  transition: border-color var(--t-fast) var(--ease), translate var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.page-nav a:hover { border-color: var(--c-primary); translate: 0 -2px; box-shadow: var(--shadow-m); }
.page-nav a.next { text-align: right; }
.page-nav a.next .pn-k { justify-content: flex-end; }
.page-nav .pn-k {
  display: flex; align-items: center; gap: .45em;
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: .07em;
  text-transform: uppercase; color: var(--text-3);
}
.page-nav .pn-k .icon { width: 13px; height: 13px; }
.page-nav .pn-t { font: 700 var(--fs-md) var(--font-display); }
@media (max-width: 640px) { .page-nav { grid-template-columns: 1fr; } .page-nav a.next { text-align: left; } .page-nav a.next .pn-k { justify-content: flex-start; } }

/* ==========================================================================
   36 · MAP SEARCH — controllo di ricerca sovrapposto alla mappa
   ========================================================================== */
.map-box { position: relative; }
.map-search {
  position: absolute; z-index: 600; top: 12px; left: 12px;
  width: min(340px, calc(100% - 70px));
  display: flex; align-items: center;
}
.map-search > .icon {
  position: absolute; left: .7em; width: 15px; height: 15px;
  color: var(--text-3); pointer-events: none; z-index: 1;
}
.map-search-input {
  width: 100%; padding: .58em .9em .58em 2.3em;
  font: 500 var(--fs-sm) var(--font-body); color: var(--text);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-m); outline: none;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.map-search-input:focus { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-m); }
.map-search-input::-webkit-search-cancel-button { display: none; }
.map-search-pop {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  max-height: 280px; overflow: auto; padding: 6px; display: none;
  background: var(--surface); border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m); box-shadow: var(--shadow-l);
}
.map-search-pop.open { display: block; animation: vt-pop-in var(--t-fast) var(--ease-pop); }
.map-search-pop .ns-item {
  display: block; padding: .5em .6em; border-radius: var(--radius-s);
  font-size: var(--fs-sm); cursor: pointer; line-height: 1.35;
}
.map-search-pop .ns-item:hover, .map-search-pop .ns-item.is-active { background: var(--primary-soft); }

/* ==========================================================================
   37 · SFONDI & TEXTURE — utility riusabili (bg-*)
   bg-grid già definito sopra; queste si combinano con qualsiasi sezione.
   ========================================================================== */
.bg-dots {
  background-image: radial-gradient(color-mix(in srgb, var(--text) 16%, transparent) 1.4px, transparent 1.5px);
  background-size: 22px 22px;
}
.bg-lines {
  background-image: repeating-linear-gradient(45deg,
    color-mix(in srgb, var(--text) 6%, transparent) 0 1px, transparent 1px 11px);
}
.bg-mesh {
  background-color: var(--bg);
  background-image:
    radial-gradient(40% 50% at 12% 18%, color-mix(in srgb, var(--c-primary) 30%, transparent), transparent 70%),
    radial-gradient(45% 55% at 88% 22%, color-mix(in srgb, var(--c-accent) 26%, transparent), transparent 72%),
    radial-gradient(50% 60% at 60% 95%, color-mix(in srgb, var(--c-secondary) 24%, transparent), transparent 72%);
}
.bg-aurora { position: relative; isolation: isolate; overflow: clip; }
.bg-aurora::before {
  content: ""; position: absolute; inset: -30%; z-index: -1;
  background:
    radial-gradient(35% 45% at 30% 40%, color-mix(in srgb, var(--c-primary) 55%, transparent), transparent 60%),
    radial-gradient(30% 40% at 70% 55%, color-mix(in srgb, var(--c-accent) 50%, transparent), transparent 60%),
    radial-gradient(40% 50% at 50% 80%, color-mix(in srgb, var(--c-secondary) 45%, transparent), transparent 62%);
  filter: blur(38px); opacity: .55;
  animation: vt-aurora 18s ease-in-out infinite alternate;
}
@keyframes vt-aurora {
  0%   { transform: translate3d(-4%, -2%, 0) scale(1.05) rotate(0deg); }
  100% { transform: translate3d(4%, 3%, 0) scale(1.15) rotate(8deg); }
}
.bg-glow { position: relative; isolation: isolate; }
.bg-glow::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(60% 50% at 50% 0%, color-mix(in srgb, var(--c-primary) 22%, transparent), transparent 70%);
}
.bg-noise::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.045'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: reduce) { .bg-aurora::before { animation: none; } }

/* ==========================================================================
   38 · DEMO HELPERS — visualizzatori per le sezioni Layout / Sfondi
   ========================================================================== */
.demo-grid > * {
  display: grid; place-items: center; min-height: 58px;
  padding: var(--sp-3);
  background: var(--primary-soft);
  border: var(--border-w) dashed color-mix(in srgb, var(--c-primary) 45%, transparent);
  border-radius: var(--radius-s);
  font: 600 var(--fs-sm) var(--font-mono); color: var(--c-primary-text, var(--c-primary));
  text-align: center;
}
.demo-rows { display: grid; grid-template-rows: var(--rows, auto); gap: var(--sp-3); }
.demo-rows .dr-cell {
  display: flex; align-items: center; justify-content: center;
  padding: var(--sp-3); border-radius: var(--radius-s);
  background: var(--surface-2); border: var(--border-w) solid var(--border);
  font: 600 var(--fs-sm) var(--font-mono); color: var(--text-2);
}
.bg-gallery { --gap: var(--sp-4); }
.bg-tile {
  position: relative; isolation: isolate; overflow: clip;
  min-height: 132px; border-radius: var(--radius-m);
  border: var(--border-w) solid var(--border);
  display: flex; align-items: flex-end; padding: var(--sp-4);
  background-color: var(--surface);
}
.bg-tile > span {
  font: 600 var(--fs-sm) var(--font-mono); color: var(--text);
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  padding: .25em .6em; border-radius: var(--radius-pill);
  border: var(--border-w) solid var(--border); backdrop-filter: blur(4px);
}

/* ==========================================================================
   39 · ALLINEAMENTO & POSIZIONAMENTO — utility
   ========================================================================== */
.flex-col { display: flex; flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-stretch { align-items: stretch; }
.justify-around { justify-content: space-around; }
.text-end { text-align: right; }
.text-start { text-align: left; }
.stack { display: flex; flex-direction: column; gap: var(--gap, var(--sp-3)); }
.stack-h { display: flex; align-items: center; gap: var(--gap, var(--sp-3)); }

/* centratura con un nome solo */
.center { display: grid; place-items: center; }
.center-x { display: flex; justify-content: center; }
.center-y { display: flex; align-items: center; }
.mx-center { margin-inline: auto; }

/* centrare un blocco nello schermo (es. form di login al centro pagina) */
.center-screen { min-height: 100svh; min-height: 100dvh; display: grid; place-items: center; padding: var(--sp-5); }
.center-screen > * { width: 100%; max-width: var(--cs-w, 420px); }

/* posizionamento */
.static { position: static; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.inset-x { left: 0; right: 0; }
.inset-y { top: 0; bottom: 0; }
.top-0 { top: 0; } .bottom-0 { bottom: 0; } .left-0 { left: 0; } .right-0 { right: 0; }
.z-1 { z-index: 1; } .z-10 { z-index: 10; } .z-100 { z-index: 100; }
/* centratura assoluta dentro un genitore .relative */
.abs-center { position: absolute; top: 50%; left: 50%; translate: -50% -50%; }
.abs-center-x { position: absolute; left: 50%; translate: -50% 0; }
.abs-center-y { position: absolute; top: 50%; translate: 0 -50%; }

/* ==========================================================================
   40 · FAB & FLOATER — pulsante d'azione flottante e pannelli ancorati
   posizioni: predefinito basso-destra; .fab-bl .fab-tr .fab-tl per gli angoli
   ========================================================================== */
.fab-zone {
  position: fixed; z-index: 850;
  right: max(var(--sp-5), env(safe-area-inset-right));
  bottom: max(var(--sp-5), env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-3);
}
.fab-zone.fab-bl { right: auto; left: max(var(--sp-5), env(safe-area-inset-left)); align-items: flex-start; }
.fab-zone.fab-tr { bottom: auto; top: max(var(--sp-5), env(safe-area-inset-top)); flex-direction: column-reverse; }
.fab-zone.fab-tl { bottom: auto; top: max(var(--sp-5), env(safe-area-inset-top)); right: auto; left: max(var(--sp-5), env(safe-area-inset-left)); flex-direction: column-reverse; align-items: flex-start; }
.fab {
  --fab-c: var(--c-primary);
  display: inline-grid; place-items: center;
  width: 56px; height: 56px; flex: 0 0 auto;
  border: 0; border-radius: 50%; cursor: pointer;
  color: var(--on-brand, #fff);
  background: var(--fab-c);
  box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--fab-c) 65%, transparent), var(--shadow-m);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.fab:hover { transform: translateY(-2px) scale(1.04); }
.fab:active { transform: scale(.96); }
.fab .icon { width: 24px; height: 24px; transition: transform var(--t-med) var(--ease); }
.fab.is-open .icon { transform: rotate(135deg); }
.fab-sm { width: 44px; height: 44px; }
.fab-sm .icon { width: 20px; height: 20px; }
.fab-ghost { background: var(--surface); color: var(--text); border: var(--border-w) solid var(--border); box-shadow: var(--shadow-m); }
/* etichetta opzionale a fianco (pill) */
.fab-label { gap: .55em; width: auto; border-radius: var(--radius-pill); padding-inline: 1.1em 1.25em; }
.fab-label > span { font: 650 var(--fs-sm) var(--font-body); }

/* mini-menu (speed dial): voci nascoste finché .is-open sul gruppo */
.fab-actions { display: flex; flex-direction: column; align-items: flex-end; gap: var(--sp-2); }
.fab-zone.fab-bl .fab-actions, .fab-zone.fab-tl .fab-actions { align-items: flex-start; }
.fab-actions .fab { opacity: 0; transform: scale(.4) translateY(8px); pointer-events: none; }
.fab-zone.is-open .fab-actions .fab { opacity: 1; transform: none; pointer-events: auto; }
.fab-actions .fab:nth-child(1) { transition-delay: .03s; }
.fab-actions .fab:nth-child(2) { transition-delay: .06s; }
.fab-actions .fab:nth-child(3) { transition-delay: .09s; }

/* floater generico: pannello ancorato a un angolo, mostrato con .is-open */
.floater {
  position: fixed; z-index: 840;
  right: max(var(--sp-5), env(safe-area-inset-right));
  bottom: calc(72px + max(var(--sp-5), env(safe-area-inset-bottom)));
  width: min(360px, calc(100vw - 2 * var(--sp-5)));
  background: var(--surface); border: var(--border-w) solid var(--border);
  border-radius: var(--radius-l); box-shadow: var(--shadow-l);
  transform-origin: bottom right;
  opacity: 0; transform: translateY(12px) scale(.96); pointer-events: none;
  transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease-pop);
}
.floater.is-open { opacity: 1; transform: none; pointer-events: auto; }
.floater.float-bl { right: auto; left: max(var(--sp-5), env(safe-area-inset-left)); transform-origin: bottom left; }

@media (prefers-reduced-motion: reduce) {
  .fab, .fab .icon, .fab-actions .fab, .floater { transition: opacity var(--t-fast) linear; transform: none !important; }
}

/* ==========================================================================
   41 · CHAT — log di messaggi, bolle, typing, barra di invio
   ========================================================================== */
.chat { display: flex; flex-direction: column; min-height: 0; height: 100%; background: var(--surface); }
.chat-head {
  display: flex; align-items: center; gap: .7em;
  padding: var(--sp-3) var(--sp-4); border-bottom: var(--border-w) solid var(--border);
}
.chat-head .chat-av { width: 34px; height: 34px; }
.chat-head b { font-weight: 650; }
.chat-head small { color: var(--c-success); font-size: var(--fs-xs); display: flex; align-items: center; gap: .35em; }
.chat-head small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c-success); }
.chat-log {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: var(--sp-3);
  padding: var(--sp-4); scroll-behavior: smooth;
}
.chat-msg { display: flex; align-items: flex-end; gap: .55em; max-width: 82%; }
.chat-msg.is-me { align-self: flex-end; flex-direction: row-reverse; }
.chat-av {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: var(--fs-xs);
  background: var(--primary-soft); color: var(--c-primary-text, var(--c-primary));
  overflow: hidden;
}
.chat-av img { width: 100%; height: 100%; object-fit: cover; }
.chat-bubble {
  padding: .6em .85em; border-radius: 16px;
  background: var(--surface-2); color: var(--text);
  border: var(--border-w) solid var(--border);
  line-height: 1.45; font-size: var(--fs-sm);
  border-bottom-left-radius: 5px; word-break: break-word;
}
.chat-msg.is-me .chat-bubble {
  background: var(--c-primary); color: var(--on-brand, #fff); border-color: transparent;
  border-bottom-left-radius: 16px; border-bottom-right-radius: 5px;
}
.chat-time { display: block; margin-top: .3em; font-size: 10px; opacity: .6; }
.chat-row { display: flex; flex-direction: column; }
.chat-msg.is-me .chat-row { align-items: flex-end; }
/* indicatore "sta scrivendo" */
.chat-typing .chat-bubble { display: inline-flex; gap: 4px; padding: .75em .9em; }
.chat-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); animation: vt-typing 1.2s infinite ease-in-out; }
.chat-typing i:nth-child(2) { animation-delay: .18s; }
.chat-typing i:nth-child(3) { animation-delay: .36s; }
@keyframes vt-typing { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .chat-typing i { animation: none; } }
/* barra di invio */
.chat-bar { display: flex; gap: var(--sp-2); padding: var(--sp-3); border-top: var(--border-w) solid var(--border); }
.chat-bar .input { flex: 1 1 auto; border-radius: var(--radius-pill); }
.chat-bar .btn { flex: 0 0 auto; border-radius: 50%; width: 42px; height: 42px; padding: 0; }
/* chat dentro un floater: altezza comoda */
.floater .chat { height: min(70vh, 520px); border-radius: inherit; overflow: hidden; }

/* ==========================================================================
   42 · VMAP — slippy map autonoma (sostituisce Leaflet)
   ========================================================================== */
.vmap { position: relative; overflow: hidden; background: var(--surface-2); cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
.vmap.is-grab { cursor: grabbing; }
.vmap-tiles, .vmap-pins { position: absolute; inset: 0; }
.vmap-tiles { transition: filter var(--t-med) var(--ease); will-change: filter; }
.vmap-lbls { z-index: 2; pointer-events: none; }   /* layer etichette sopra la base, sotto i pin */
.vmap-tile { position: absolute; top: 0; left: 0; width: 256px; height: 256px; max-width: none; pointer-events: none; opacity: 0; transition: opacity .2s var(--ease); }
.vmap-tile.is-loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .vmap-tile { transition: none; } }
.vmap-pins { pointer-events: none; }
.vmap-pins .vt-pin { position: absolute; top: 0; left: 0; pointer-events: auto; }
.vmap-zoom { position: absolute; right: 10px; bottom: 10px; z-index: 500; display: flex; flex-direction: column; border-radius: var(--radius-s); overflow: hidden; box-shadow: var(--shadow-m); }
.vmap-zoom button {
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); color: var(--text); border: 0; border-bottom: var(--border-w) solid var(--border);
}
.vmap-zoom button:last-child { border-bottom: 0; }
.vmap-zoom button:hover { background: var(--surface-2); }
.vmap-zoom .icon { width: 17px; height: 17px; }
.vmap-attr {
  position: absolute; right: 0; bottom: 0; z-index: 500;
  font-size: 10px; color: var(--text-2);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  padding: 1px 7px; border-top-left-radius: var(--radius-s);
}
/* filtri (skin) applicati al layer dei tile */
html[data-theme="dark"] .vmap.map-dark-auto .vmap-tiles { filter: invert(1) hue-rotate(180deg) brightness(.92) contrast(.92) saturate(.7); }
.vmap.map-filter-notte .vmap-tiles { filter: invert(1) hue-rotate(180deg) brightness(.88) contrast(.95) saturate(.6); }
.vmap.map-filter-ink   .vmap-tiles { filter: grayscale(1) invert(1) contrast(1.28) brightness(.82); }
.vmap.map-filter-gray  .vmap-tiles { filter: grayscale(1) contrast(1.04); }
.vmap.map-filter-sepia .vmap-tiles { filter: sepia(.85) saturate(1.15) contrast(.95) brightness(1.02); }
/* la regola globale img{max-width:100%} non deve toccare i tile */
.map-box img { max-width: none; }

/* ==========================================================================
   43 · CARD — varianti (cliccabile, orizzontale, media, accenti, nastro)
   ========================================================================== */
/* card cliccabile: <a class="card hover-lift"> o .card-link */
a.card, a.card-link, .card-link { display: block; color: inherit; text-decoration: none; }
a.card:hover, a.card-link:hover { text-decoration: none; color: inherit; }
.card-link { cursor: pointer; }
.card:focus-visible, a.card:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-m); }

/* media con proporzioni costanti */
.card-media { overflow: hidden; background: var(--surface-2); }
.card-media > img, .card-media > video { width: 100%; height: 100%; object-fit: cover; display: block; }
.card > .card-media:first-child, .card > a:first-child > .card-media { border-radius: var(--radius-m) var(--radius-m) 0 0; }
.card-media.ratio-16x9 { aspect-ratio: 16 / 9; }
.card-media.ratio-4x3  { aspect-ratio: 4 / 3; }
.card-media.ratio-1x1  { aspect-ratio: 1 / 1; }
/* fallback senza aspect-ratio */
@supports not (aspect-ratio: 1) { .card-media { height: 180px; } }

/* card orizzontale: media a sinistra, contenuto a destra */
.card-h { display: grid; grid-template-columns: clamp(120px, 38%, 240px) 1fr; overflow: hidden; }
.card-h > .card-media { height: 100%; border-radius: var(--radius-m) 0 0 var(--radius-m); }
@media (max-width: 560px) {
  .card-h { grid-template-columns: 1fr; }
  .card-h > .card-media { border-radius: var(--radius-m) var(--radius-m) 0 0; height: 170px; }
}

/* accenti ed elevazioni */
.card-line { border-top: 3px solid var(--c-primary); }
.card-flat { box-shadow: none; }
.card-elevated { box-shadow: var(--shadow-l); }
.card-grad {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad-brand) border-box;
}

/* nastro d'angolo */
.card:has(.card-ribbon) { position: relative; overflow: hidden; }
.card-ribbon {
  position: absolute; top: 16px; right: -38px; rotate: 45deg;
  background: var(--c-accent); color: var(--on-brand, #fff);
  padding: .25em 3.2em; font: 700 var(--fs-xs) var(--font-body);
  letter-spacing: .04em; box-shadow: var(--shadow-s); z-index: 1;
}

/* ==========================================================================
   44 · INPUT AVANZATI — tel con prefisso/bandiera, date/ora a tema, textarea
   ========================================================================== */
/* i picker nativi di date/time seguono il tema */
html[data-theme="dark"]  { color-scheme: dark; }
html[data-theme="light"] { color-scheme: light; }
input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"], input[type="week"] { -webkit-appearance: none; appearance: none; }
.input::-webkit-calendar-picker-indicator { cursor: pointer; opacity: .7; }
.input::-webkit-calendar-picker-indicator:hover { opacity: 1; }
textarea.input[data-autosize] { resize: none; overflow: hidden; }

/* telefono con prefisso internazionale */
.phone { display: flex; align-items: stretch; position: relative; }
.phone-trigger {
  display: inline-flex; align-items: center; gap: .45em;
  padding: .55em .7em; cursor: pointer;
  background: var(--surface-2); color: var(--text);
  border: var(--border-w) solid var(--border);
  border-right: 0; border-radius: var(--radius-s) 0 0 var(--radius-s);
  font: inherit; white-space: nowrap;
}
.phone-trigger:hover { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.phone-flag { font-size: 1.15em; line-height: 1; }
.phone-trigger .icon { width: 14px; height: 14px; color: var(--text-3); }
.phone .input { border-radius: 0 var(--radius-s) var(--radius-s) 0; flex: 1; min-width: 0; }
.phone:focus-within .phone-trigger { border-color: var(--c-primary); }
.phone-pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: var(--z-drop);
  width: min(320px, 90vw); max-height: 280px; overflow-y: auto;
  background: var(--surface); border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m); box-shadow: var(--shadow-l); padding: .35rem;
  display: none;
}
.phone-pop.open { display: block; animation: vt-pop-in var(--t-fast) var(--ease-pop); }
.phone-search { width: 100%; margin-bottom: .35rem; }
.phone-opt {
  display: flex; align-items: center; gap: .6em; width: 100%;
  padding: .5em .6em; border: 0; background: none; border-radius: var(--radius-s);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.phone-opt:hover, .phone-opt.is-active { background: var(--surface-2); }
.phone-opt .pc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.phone-opt .pc-code { color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ==========================================================================
   45 · CODICE EVIDENZIATO — token colorati per linguaggio (.tok-*)
   ========================================================================== */
pre.code.hl, pre.code[data-lang] { position: relative; }
pre.code .code-lang {
  position: absolute; bottom: 8px; right: 10px;
  font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; user-select: none; pointer-events: none;
}
.tok-comment { color: var(--text-3); font-style: italic; }
.tok-string  { color: var(--success-text); }
.tok-number  { color: var(--warning-text); }
.tok-keyword { color: var(--accent-text); font-weight: 600; }
.tok-fn      { color: var(--info-text); }
.tok-tag     { color: var(--danger-text); }
.tok-attr    { color: var(--accent-text); }
.tok-var     { color: var(--primary-text); }
.tok-punc    { color: var(--text-2); }

/* ==========================================================================
   46 · STATI DI CARICAMENTO — loader a puntini, progress indeterminata, overlay
   ========================================================================== */
.loader-dots { display: inline-flex; align-items: center; gap: .4em; }
.loader-dots i { width: .5em; height: .5em; border-radius: 50%; background: var(--spin-c, var(--c-primary)); animation: vt-bounce 1s infinite ease-in-out both; }
.loader-dots i:nth-child(2) { animation-delay: .15s; }
.loader-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes vt-bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

/* barra di avanzamento indeterminata (non si conosce la percentuale) */
.progress.indeterminate .progress-bar { width: 40%; animation: vt-indet 1.1s var(--ease) infinite; }
@keyframes vt-indet { 0% { margin-left: -42%; } 100% { margin-left: 102%; } }

/* overlay "occupato" su un contenitore: Vetro.loading(el, true/false) */
.busy { position: relative; }
.busy.is-busy { pointer-events: none; }
.busy-veil {
  position: absolute; inset: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center; gap: .6em;
  color: var(--text-2);
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  border-radius: inherit;
  opacity: 0; pointer-events: none;
  transition: opacity var(--t-med) var(--ease);
}
.busy.is-busy > .busy-veil { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .spinner, .loader-dots i, .progress.indeterminate .progress-bar, .progress-bar.striped { animation-duration: 0s; }
}

/* ==========================================================================
   47 · CODEVIEW — visualizzatore di codice pieghevole (fold) con numeri riga
   ========================================================================== */
/* "Guarda codice" — trigger compatto che rivela il blocco snippet */
details.code-reveal > summary {
  list-style: none;
  display: inline-flex; align-items: center; gap: .55em;
  padding: .45em .95em;
  font-size: var(--fs-xs); font-weight: 650; letter-spacing: .01em;
  color: var(--text-2);
  background: var(--surface-2);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer; user-select: none;
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
details.code-reveal > summary::-webkit-details-marker { display: none; }
details.code-reveal > summary::before {
  content: "</>";
  font: 700 .95em var(--font-mono);
  color: var(--primary-text);
}
details.code-reveal > summary::after {
  content: "";
  width: .5em; height: .5em;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  transition: transform var(--t-med) var(--ease);
}
details.code-reveal > summary:hover { color: var(--primary-text); border-color: var(--primary-border); background: var(--primary-soft); }
details.code-reveal[open] > summary { color: var(--primary-text); border-color: var(--primary-border); }
details.code-reveal[open] > summary::after { transform: rotate(225deg); }
details.code-reveal > .accordion-body { padding: var(--sp-3) 0 0; }

/* Code tabs — esempio multi-formato (Struttura / JS / Totale) */
.codetabs {
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  background: var(--surface-2);
}
.codetabs .ct-tabs {
  display: flex; gap: 4px; flex-wrap: wrap;
  padding: 6px;
  background: linear-gradient(var(--surface-2), var(--surface));
  border-bottom: var(--border-w) solid var(--border);
}
.codetabs .ct-tab {
  font: 650 var(--fs-xs)/1 var(--font-sans, inherit);
  letter-spacing: .01em;
  padding: .5em .85em;
  border: 0; border-radius: var(--radius-s);
  background: none; color: var(--text-3);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.codetabs .ct-tab:hover { color: var(--text); background: var(--surface-2); }
.codetabs .ct-tab.is-active { background: var(--primary-soft); color: var(--primary-text); box-shadow: inset 0 0 0 var(--border-w) var(--primary-border); }
.codetabs .ct-panes { position: relative; }
.codetabs .ct-pane { display: none; margin: 0; border: 0; border-radius: 0; }
.codetabs .ct-pane.is-active { display: block; }

.codeview {
  background: var(--surface-2);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  font-family: var(--font-mono);
}
.cv-toolbar {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: .4rem .55rem; border-bottom: var(--border-w) solid var(--border);
  background: color-mix(in srgb, var(--surface) 60%, var(--surface-2));
}
.cv-toolbar .cv-spacer { flex: 1; }
.cv-lang { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; padding-inline: .3em; }
.cv-btn {
  display: inline-flex; align-items: center; gap: .35em;
  border: 0; background: none; cursor: pointer;
  color: var(--text-2); font: 600 var(--fs-xs) var(--font-body);
  padding: .35em .55em; border-radius: var(--radius-s);
}
.cv-btn:hover { background: var(--surface); color: var(--text); }
.cv-btn .icon { width: 14px; height: 14px; }
.cv-body { overflow-x: auto; padding: .5rem 0; font-size: var(--fs-sm); line-height: 1.65; tab-size: 2; }
.cv-line { display: flex; align-items: flex-start; white-space: pre; }
.cv-line:hover { background: color-mix(in srgb, var(--c-primary) 7%, transparent); }
.cv-line.is-hidden { display: none; }
.cv-gutter {
  flex: 0 0 auto; width: 3em; padding-right: .8em; text-align: right;
  color: var(--text-3); user-select: none; opacity: .7;
}
.cv-fold {
  flex: 0 0 auto; width: 1.3em; text-align: center; color: var(--text-3);
  user-select: none;
}
.cv-fold.can { cursor: pointer; }
.cv-fold.can:hover { color: var(--c-primary); }
.cv-code { flex: 1; padding-right: var(--sp-4); }
.cv-line.is-folded > .cv-code::after {
  content: " \2026"; margin-left: .3em;
  color: var(--text-2); background: var(--surface-3);
  padding: 0 .5em; border-radius: var(--radius-pill); font-size: .85em;
}

/* ==========================================================================
   48 · CALENDAR EDITOR — modale dettagli/modifica evento + sotto-task
   ========================================================================== */
.cal-editor-back {
  position: fixed; inset: 0; z-index: var(--z-modal, 1000);
  display: grid; place-items: center; padding: var(--sp-4);
  background: color-mix(in srgb, #0b1220 55%, transparent);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  animation: vt-fade-in var(--t-fast) var(--ease);
}
.cal-editor {
  width: min(440px, 100%); max-height: 90dvh; overflow-y: auto;
  background: var(--surface); color: var(--text);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-l); box-shadow: var(--shadow-l);
  animation: vt-pop-in var(--t-med) var(--ease-pop);
}
.cal-ed-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-4) 0; }
.cal-ed-title { font-weight: 650; font-size: var(--fs-md); }
.cal-ed-x { border: 0; background: none; cursor: pointer; font-size: 1.6rem; line-height: 1; color: var(--text-3); padding: 0 .2em; }
.cal-ed-x:hover { color: var(--text); }
.cal-ed-body { padding: var(--sp-4); }
.cal-ed-body .field > span.help { margin-bottom: .2em; }
.cal-ed-colors { display: flex; gap: .4em; flex-wrap: wrap; padding-top: .2em; }
.cal-sw { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .15); }
.cal-sw.is-active { border-color: var(--text); transform: scale(1.08); }
.cal-tasks { display: flex; flex-direction: column; gap: .35em; }
.cal-task { display: flex; align-items: center; gap: .5em; }
.cal-task input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--c-primary); flex: 0 0 auto; }
.cal-task .cal-task-text { flex: 1; }
.cal-task.is-done .cal-task-text { text-decoration: line-through; color: var(--text-3); }
.cal-task-rm { border: 0; background: none; cursor: pointer; color: var(--text-3); font-size: 1.2rem; line-height: 1; padding: 0 .25em; }
.cal-task-rm:hover { color: var(--c-danger); }
.cal-task-add { display: flex; gap: .4em; margin-top: .45em; }
.cal-task-add .cal-ed-newtask { flex: 1; }
.cal-ed-foot { display: flex; align-items: center; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-4); }

/* ==========================================================================
   49 · CAROUSEL & SLIDER — scroll-snap orizzontale, frecce, dots
   ========================================================================== */
/* riga scorrevole semplice senza JS: <div class="snap-x">…figli…</div> */
.snap-x {
  display: flex; gap: var(--gap, var(--sp-4));
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; padding-bottom: .6rem;
  scrollbar-width: thin; scrollbar-color: var(--border-2) transparent;
}
.snap-x > * { scroll-snap-align: start; flex: 0 0 auto; }

/* carosello completo */
.carousel { position: relative; }
.carousel:focus { outline: none; }
.carousel:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 3px; border-radius: var(--radius-m); }
.carousel-track {
  display: flex; gap: var(--cargap, var(--sp-4));
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.carousel-track::-webkit-scrollbar { display: none; }
.carousel.is-grabbing .carousel-track { scroll-behavior: auto; cursor: grabbing; scroll-snap-type: none; }
.carousel-slide { scroll-snap-align: start; flex: 0 0 var(--cw, 100%); min-width: 0; }
.carousel-slide > * { height: 100%; }

.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: var(--border-w) solid var(--border); border-radius: 50%;
  background: var(--glass-bg); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--text); cursor: pointer; box-shadow: var(--shadow-s);
  transition: background var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.carousel-arrow:hover { background: var(--surface); transform: translateY(-50%) scale(1.06); }
.carousel-arrow:disabled { opacity: .35; cursor: default; }
.carousel-arrow .icon { width: 20px; height: 20px; }
.car-prev { left: 8px; } .car-next { right: 8px; }
@media (max-width: 640px) { .carousel-arrow { width: 34px; height: 34px; } }

.carousel-dots { display: flex; gap: .45em; justify-content: center; margin-top: var(--sp-3); }
.carousel-dot {
  width: 8px; height: 8px; padding: 0; border: 0; cursor: pointer;
  border-radius: 50%; background: var(--border-2);
  transition: background var(--t-fast) var(--ease), width var(--t-fast) var(--ease);
}
.carousel-dot:hover { background: var(--text-3); }
.carousel-dot.is-active { background: var(--c-primary); width: 22px; border-radius: var(--radius-pill); }

/* ==========================================================================
   50 · CODE EDITOR — textarea modificabile con evidenziazione in overlay
   ========================================================================== */
.code-editor {
  position: relative;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  background: var(--surface-2);
  overflow: hidden;
  --ce-pad: var(--sp-4);
  --ce-lh: 1.6;
}
.code-editor-hl,
.code-editor-area {
  margin: 0;
  padding: var(--ce-pad);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: var(--ce-lh);
  tab-size: var(--ce-tab, 2);
  -moz-tab-size: var(--ce-tab, 2);
  white-space: pre;
  overflow: auto;
  letter-spacing: 0;
  word-spacing: 0;
  text-indent: 0;
  text-rendering: auto;
  font-variant-ligatures: none;
  font-kerning: none;
  font-feature-settings: normal;
  box-sizing: border-box;
  border: 0;
}
.code-editor-hl {
  position: absolute; inset: 0;
  pointer-events: none;
  color: var(--text);
  z-index: 0;
  overflow: hidden;
}
.code-editor-hl code { font: inherit; display: block; min-height: 100%; }
.code-editor-area {
  position: relative;
  display: block;
  width: 100%;
  min-height: 9rem;
  resize: vertical;
  background: transparent;
  color: transparent;
  caret-color: var(--text);
  z-index: 1;
  outline: none;
  -webkit-text-fill-color: transparent;
}
.code-editor-area::selection { background: color-mix(in srgb, var(--c-primary) 40%, transparent); }
.code-editor:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 18%, transparent); }

/* indicatore sotto-task sugli eventi: pill X/Y + barra di avanzamento */
.cal-task-pill {
  display: inline-flex; align-items: center; gap: .22em;
  font-size: 10px; font-weight: 700; line-height: 1;
  padding: .18em .42em; border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--ev-c, var(--dot, var(--c-primary))) 24%, transparent);
  color: color-mix(in oklab, var(--ev-c, var(--dot, var(--c-primary))) 78%, var(--ink));
  vertical-align: middle; white-space: nowrap;
}
.cal-ev-block .cal-task-pill { margin-top: .15em; }
.cal-ev-block b + time + .cal-task-pill { margin-left: 0; }
.cal-ev .cal-task-pill,
.cal-adev .cal-task-pill { margin-left: .45em; }
.cal-task-pill .icon { width: 12px; height: 12px; }
.cal-task-pill b { font-weight: 700; }
.cal-task-pill.is-done {
  background: color-mix(in srgb, var(--c-success) 24%, transparent);
  color: var(--success-text);
}
.cal-ev-prog {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: color-mix(in srgb, var(--ev-c, var(--c-primary)) 20%, transparent);
}
.cal-ev-prog i { display: block; height: 100%; background: var(--ev-c, var(--c-primary)); transition: width var(--t-med) var(--ease); }
.cal-ev-prog.is-done i { background: var(--c-success); }

/* ==========================================================================
   51 · LOOKUP & COPERTINE — ricerca assistita + galleria poster video
   ========================================================================== */
.lookup { position: relative; }
.lookup-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 30;
  display: none; flex-direction: column; padding: .35rem;
  background: var(--glass-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border: var(--border-w) solid var(--border); border-radius: var(--radius-m);
  box-shadow: var(--shadow-l); max-height: 260px; overflow-y: auto;
}
.lookup.is-open .lookup-menu { display: flex; }
.lookup-item {
  text-align: left; border: 0; background: none; cursor: pointer;
  padding: .5em .65em; border-radius: var(--radius-s);
  color: var(--text); font-size: var(--fs-sm); line-height: 1.3;
}
.lookup-item b { color: var(--primary-text); font-weight: 700; }
.lookup-item:hover, .lookup-item.is-active { background: color-mix(in srgb, var(--c-primary) 14%, transparent); }

/* copertine (poster) video */
.vcovers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
.vcov {
  position: relative; aspect-ratio: 16/9; border-radius: var(--radius-m);
  border: var(--border-w) solid var(--border); overflow: hidden; cursor: pointer;
  display: flex; align-items: flex-end; padding: .55rem .7rem;
  box-shadow: var(--shadow-s);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), outline-color var(--t-fast) var(--ease);
  outline: 2px solid transparent; outline-offset: 2px;
}
.vcov:hover { transform: translateY(-2px); box-shadow: var(--shadow-m); }
.vcov.is-active { outline-color: var(--c-primary); }
.vcov span {
  position: relative; z-index: 1; color: #fff; font-weight: 650; font-size: var(--fs-sm);
  text-shadow: 0 1px 6px rgb(0 0 0 / .55);
}
.vcov::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgb(0 0 0 / .45)); }
.vcov.is-hidden { display: none; }

/* ==========================================================================
   52 · BASE HTML5 — stile di default per i tag semantici "nudi"
   (le versioni con classe — .table, .kbd… — restano componenti a parte)
   ========================================================================== */
blockquote {
  margin: var(--sp-4) 0; padding: var(--sp-3) var(--sp-5);
  border-left: 3px solid var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 6%, transparent);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  color: var(--text-2); font-style: italic;
}
blockquote cite, blockquote footer { display: block; margin-top: .5em; font-style: normal; font-size: var(--fs-sm); color: var(--text-3); }
mark { background: color-mix(in srgb, var(--c-warning) 35%, transparent); color: var(--text); padding: .08em .25em; border-radius: 4px; }
abbr[title] { text-decoration: underline dotted var(--text-3); text-underline-offset: 2px; cursor: help; }
address { font-style: normal; color: var(--text-2); line-height: 1.7; }
small { font-size: var(--fs-sm); color: var(--text-3); }
kbd:not(.kbd) {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  background: var(--surface); border: var(--border-w) solid var(--border-2);
  border-bottom-width: 2px; border-radius: 6px; padding: .12em .45em;
}
samp, var { font-family: var(--font-mono); font-size: .9em; }
var { color: var(--accent-text); font-style: italic; }
dfn { font-style: italic; color: var(--primary-text); }

table:not([class]) { width: 100%; border-collapse: collapse; font-size: var(--fs-base); margin-block: var(--sp-4); }
table:not([class]) caption { text-align: left; font-weight: 650; padding-bottom: .5em; color: var(--text-2); font-size: var(--fs-sm); }
table:not([class]) th, table:not([class]) td { padding: .55em .8em; border-bottom: var(--border-w) solid var(--border); text-align: left; }
table:not([class]) thead th { font-size: var(--fs-sm); color: var(--text-2); border-bottom-color: var(--border-2); }
table:not([class]) tbody tr:hover { background: color-mix(in srgb, var(--c-primary) 4%, transparent); }
table:not([class]) tfoot td { font-weight: 650; border-bottom: 0; }

dl { margin: var(--sp-4) 0; display: grid; grid-template-columns: max-content 1fr; gap: .35em var(--sp-5); }
dt { font-weight: 650; color: var(--text); }
dd { margin: 0; color: var(--text-2); }
@media (max-width: 560px) { dl { grid-template-columns: 1fr; } dd { margin-bottom: .5em; } }

figure { margin: var(--sp-4) 0; }
figure > img, figure > svg, figure > pre { border-radius: var(--radius-m); display: block; max-width: 100%; }
figcaption { margin-top: .55em; font-size: var(--fs-sm); color: var(--text-3); }

meter, progress[value] { accent-color: var(--c-primary); }
.carousel-dot:focus { outline: none; }
.carousel-dot:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

/* ==========================================================================
   53 · v1.28 — DIALOG A EVENTI · LIGHTBOX · PATTERN DI LUCE · BUSSOLA ROSE ·
   ORG ORIZZONTALE · EVENTI CALENDARIO (multi-giorno/sfondo/animati) ·
   CURSORI EXTRA · OCCHI/MAGNETE · METEO FX · TRANSIZIONI · FILTRI · CORNICE
   ========================================================================== */

/* ---- fix mobile: niente scivolamento orizzontale della pagina ----
   decorazioni larghe (marquee, path, sticker) non devono creare una
   seconda corsia di scroll che sposta navbar e footer */
html, body { overflow-x: clip; }

/* ---- Vetro.dialog — modale a eventi (stile SweetAlert) ---- */
dialog.vdialog .modal-card { max-width: 430px; width: min(92vw, 430px); text-align: center; padding: var(--sp-6) var(--sp-5) var(--sp-5); position: relative; overflow: hidden; }
dialog.vdialog.is-closing { opacity: 0; transition: opacity .14s ease; }
.vd-head { display: grid; place-items: center; min-height: 0; }
.vd-title { margin: var(--sp-4) 0 0; font-size: 1.35rem; }
.vd-msg { margin-top: var(--sp-2); color: var(--text-2); }
.vd-html { margin-top: var(--sp-4); text-align: left; }
.vd-html:empty { display: none; }
.vd-foot { display: flex; gap: var(--sp-2); justify-content: center; margin-top: var(--sp-5); }
.vd-timer { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: color-mix(in srgb, var(--c-primary) 14%, transparent); display: none; }
dialog.vdialog.has-timer .vd-timer { display: block; }
.vd-timer i { display: block; height: 100%; width: 100%; background: var(--c-primary); transform-origin: left; animation: vt-vd-timer linear forwards; }
@keyframes vt-vd-timer { from { scale: 1 1; } to { scale: 0 1; } }

.vd-icon {
  --vd-c: var(--c-primary);
  position: relative; width: 84px; height: 84px; border-radius: 50%;
  border: 3.5px solid color-mix(in srgb, var(--vd-c) 45%, transparent);
  display: grid; place-items: center;
  animation: vt-vd-pop .45s var(--ease-pop);
}
@keyframes vt-vd-pop { 0% { scale: .4; opacity: 0; } 70% { scale: 1.08; } 100% { scale: 1; opacity: 1; } }
.vd-success { --vd-c: var(--c-success); }
.vd-error { --vd-c: var(--c-danger); }
.vd-warning { --vd-c: var(--c-warning); }
.vd-info { --vd-c: var(--c-info); }
.vd-question { --vd-c: var(--c-secondary, #64748b); }
.vd-icon i { position: absolute; background: var(--vd-c); border-radius: 3px; }
.vd-success .vd-tip { width: 20px; height: 5px; rotate: 45deg; left: 15px; top: 36px; transform-origin: left center; animation: vt-vd-tip .3s .15s var(--ease) backwards; }
.vd-success .vd-long { width: 40px; height: 5px; rotate: -45deg; left: 27px; top: 50px; transform-origin: left center; animation: vt-vd-long .3s .28s var(--ease) backwards; }
@keyframes vt-vd-tip { from { scale: 0 1; } to { scale: 1 1; } }
@keyframes vt-vd-long { from { scale: 0 1; } to { scale: 1 1; } }
.vd-error .vd-x1, .vd-error .vd-x2 { width: 42px; height: 5px; left: 18px; top: 37px; animation: vt-vd-x .3s .15s var(--ease) backwards; }
.vd-error .vd-x1 { rotate: 45deg; }
.vd-error .vd-x2 { rotate: -45deg; }
@keyframes vt-vd-x { from { scale: 0 1; opacity: 0; } to { scale: 1 1; opacity: 1; } }
.vd-warning .vd-bar, .vd-info .vd-bar { width: 5px; height: 30px; left: 36.5px; top: 16px; }
.vd-warning .vd-dot, .vd-info .vd-dot { width: 6px; height: 6px; border-radius: 50%; left: 36px; top: 54px; }
.vd-info .vd-bar { top: 30px; }
.vd-info .vd-dot { top: 18px; }
.vd-warning { animation: vt-vd-pop .45s var(--ease-pop), vt-vd-ring 1.4s .5s ease-in-out infinite; }
@keyframes vt-vd-ring { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--vd-c) 30%, transparent); } 50% { box-shadow: 0 0 0 10px transparent; } }
.vd-question b { font: 800 44px var(--font-display); color: var(--vd-c); }
.vd-loading { border-color: color-mix(in srgb, var(--c-primary) 18%, transparent); animation: none; }
dialog.vdialog.is-loading .vd-foot { display: none; }

/* ---- Vetro.lightbox — galleria con zoom + ambient ---- */
.vlb-item { cursor: zoom-in; }
dialog.vlightbox { width: min(96vw, 1100px); background: transparent; border: 0; padding: 0; }
dialog.vlightbox::backdrop { background: rgb(8 12 18 / .82); backdrop-filter: blur(10px); }
.vlb-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: var(--sp-2); }
.vlb-stage { position: relative; display: grid; place-items: center; min-height: 220px; }
.vlb-media { position: relative; z-index: 2; max-width: 100%; max-height: 78vh; border-radius: var(--radius-l); box-shadow: 0 30px 80px rgb(0 0 0 / .5); animation: vt-vlb-in .25s var(--ease-pop); }
.vlb-clone { width: min(82vw, 720px); aspect-ratio: 16/9; display: grid; place-items: center; font: 700 1.6rem var(--font-display); color: #fff; }
@keyframes vt-vlb-in { from { scale: .92; opacity: 0; } to { scale: 1; opacity: 1; } }
.vlb-glow {
  position: absolute; inset: -6%; z-index: 1; border-radius: 24px;
  background-size: cover; background-position: center;
  filter: blur(54px) saturate(1.5); opacity: .62; pointer-events: none;
}
.vlb-bar { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: var(--sp-4); color: #e8edf4; font-size: var(--fs-sm); padding-inline: var(--sp-2); }
.vlb-n { font-family: var(--font-mono); opacity: .7; }
.vlb-x { position: absolute; top: -44px; right: 0; z-index: 5; color: #fff !important; }
.vlb-prev, .vlb-next { z-index: 5; color: #fff !important; background: rgb(255 255 255 / .08) !important; border-radius: 50%; }
@media (max-width: 640px) { .vlb-card { grid-template-columns: 1fr; } .vlb-prev, .vlb-next { position: absolute; top: 50%; translate: 0 -50%; } .vlb-prev { left: 6px; } .vlb-next { right: 6px; } }

/* ---- pattern di luce animati (.lightfx) ----
   variabili: --lfx-c1/--lfx-c2 (colori), --lfx-speed (s), --lfx-strength */
.lightfx { position: relative; overflow: hidden; isolation: isolate; }
.lightfx > * { position: relative; z-index: 1; }
.lightfx::before, .lightfx::after {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  --c1: var(--lfx-c1, var(--c-primary));
  --c2: var(--lfx-c2, var(--c-accent));
  --sp: var(--lfx-speed, 14s);
  --st: var(--lfx-strength, .5);
}
/* preset come CLASSI (niente style inline): colori agganciati al tema,
   velocità e intensità a scatti — le variabili --lfx-* restano per il fine-tuning */
.lfx-freddo { --lfx-c1: var(--c-info); --lfx-c2: var(--c-primary); }
.lfx-fuoco  { --lfx-c1: var(--c-warning); --lfx-c2: var(--c-danger); }
.lfx-bosco  { --lfx-c1: var(--c-success); --lfx-c2: var(--c-primary); }
.lfx-notte  { --lfx-c1: var(--c-secondary); --lfx-c2: var(--c-info); }
.lfx-brand  { --lfx-c1: var(--c-primary); --lfx-c2: var(--c-accent); }
.lfx-lento   { --lfx-speed: 24s; }
.lfx-veloce  { --lfx-speed: 7s; }
.lfx-turbo   { --lfx-speed: 3.5s; }
.lfx-tenue   { --lfx-strength: .3; }
.lfx-intenso { --lfx-strength: .75; }

.lfx-aurora::before {
  inset: -28%;
  background:
    conic-gradient(from 0deg at 30% 35%, transparent, color-mix(in srgb, var(--c1) 55%, transparent), transparent 32%),
    conic-gradient(from 180deg at 70% 65%, transparent, color-mix(in srgb, var(--c2) 48%, transparent), transparent 30%);
  filter: blur(46px); opacity: var(--st);
  animation: vt-lfx-spin var(--sp) linear infinite;
}
@keyframes vt-lfx-spin { to { rotate: 360deg; } }
.lfx-fascio::before {
  inset: -45%;
  background: conic-gradient(from 0deg,
    transparent 0 8%, color-mix(in srgb, var(--c1) 60%, transparent) 11%, transparent 15%,
    transparent 48%, color-mix(in srgb, var(--c2) 45%, transparent) 53%, transparent 58%);
  filter: blur(26px); opacity: var(--st);
  animation: vt-lfx-spin var(--sp) linear infinite;
}
.lfx-fascio::after {
  background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--c1) 22%, transparent), transparent 55%);
  opacity: calc(var(--st) * .9);
}
.lfx-onde::before {
  inset: -10% -60%;
  background:
    radial-gradient(45% 65% at 25% 60%, color-mix(in srgb, var(--c1) 45%, transparent), transparent 70%),
    radial-gradient(40% 60% at 60% 35%, color-mix(in srgb, var(--c2) 40%, transparent), transparent 70%),
    radial-gradient(50% 70% at 85% 70%, color-mix(in srgb, var(--c1) 32%, transparent), transparent 72%);
  filter: blur(34px); opacity: var(--st);
  animation: vt-lfx-slide var(--sp) ease-in-out infinite alternate;
}
@keyframes vt-lfx-slide { from { translate: -8% 0; } to { translate: 8% 0; } }
.lfx-plasma::before, .lfx-plasma::after {
  width: 58%; aspect-ratio: 1; inset: auto;
  border-radius: 46% 54% 60% 40% / 48% 42% 58% 52%;
  filter: blur(40px); opacity: var(--st);
}
.lfx-plasma::before { left: -6%; top: -18%; background: var(--c1); animation: vt-lfx-blob var(--sp) ease-in-out infinite alternate; }
.lfx-plasma::after { right: -8%; bottom: -22%; background: var(--c2); animation: vt-lfx-blob var(--sp) ease-in-out infinite alternate-reverse; }
@keyframes vt-lfx-blob {
  from { translate: 0 0; scale: 1; border-radius: 46% 54% 60% 40% / 48% 42% 58% 52%; }
  to { translate: 9% 14%; scale: 1.22; border-radius: 58% 42% 38% 62% / 42% 60% 40% 58%; }
}
.lfx-scan::before {
  background: linear-gradient(180deg, transparent 0 12%,
    color-mix(in srgb, var(--c1) 28%, transparent) 47%,
    color-mix(in srgb, var(--c2) 45%, transparent) 50%,
    color-mix(in srgb, var(--c1) 28%, transparent) 53%, transparent 88%);
  background-size: 100% 240%; opacity: var(--st);
  animation: vt-lfx-scan var(--sp) ease-in-out infinite;
}
.lfx-scan::after {
  background: repeating-linear-gradient(180deg, rgb(255 255 255 / .035) 0 1px, transparent 1px 4px);
  opacity: calc(var(--st) * .8);
}
@keyframes vt-lfx-scan { 0% { background-position: 0 -120%; } 50% { background-position: 0 120%; } 100% { background-position: 0 -120%; } }

/* ---- bussola "rose": il QUADRANTE gira, la freccia resta ferma ---- */
.compass.rose .compass-needle { rotate: 0deg; }
.compass-dial {
  position: absolute; inset: 0; border-radius: 50%;
  rotate: calc(var(--heading, 0deg) * -1);
  transition: rotate .2s var(--ease);
}
.compass-dial::before { /* tacche del quadrante */
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background:
    repeating-conic-gradient(from -0.75deg, var(--border-2) 0 1.5deg, transparent 1.5deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 0 76%, #000 77%);
  mask: radial-gradient(circle, transparent 0 76%, #000 77%);
}
.compass.rose b { transition: none; }

/* ---- organigramma ORIZZONTALE (sinistra -> destra) ---- */
.org-wrap.org-h .org-tree { flex-direction: column; justify-content: flex-start; align-items: flex-start; min-width: max-content; }
.org-wrap.org-h .org-tree ul {
  flex-direction: column; align-items: flex-start;
  padding-top: 0; padding-left: 38px; gap: var(--sp-3);
}
.org-wrap.org-h .org-tree ul::before { top: 50%; left: 0; width: 38px; height: var(--border-w); }
.org-wrap.org-h .org-tree li { flex-direction: row; align-items: center; padding-top: 0; padding-left: 38px; }
.org-wrap.org-h .org-tree li::before, .org-wrap.org-h .org-tree li::after {
  top: auto; right: auto; left: 0; width: 38px; height: 50%; border: 0;
}
.org-wrap.org-h .org-tree li::before { bottom: 50%; border-left: var(--border-w) solid var(--border-2); }
.org-wrap.org-h .org-tree li::after { top: 50%; border-left: var(--border-w) solid var(--border-2); border-top: var(--border-w) solid var(--border-2); }
.org-wrap.org-h .org-tree li:first-child::before { border-left: 0; }
.org-wrap.org-h .org-tree li:last-child::after { border-left: 0; }
.org-wrap.org-h .org-tree > li { padding-left: 0; }
.org-wrap.org-h .org-tree > li::before, .org-wrap.org-h .org-tree > li::after { display: none; }
.org-wrap.org-h .org-node { border-top: var(--border-w) solid var(--border); border-left: 3px solid var(--org-c, var(--c-primary)); }
.org-wrap.org-h .org-toggle { left: auto; right: -12px; bottom: auto; top: calc(50% - 12px); }
.org-wrap.org-h li.is-collapsed .org-toggle .icon { rotate: 90deg; }

/* ---- organigramma: bordi SFUMATI (da un colore all'altro o dal tema) ---- */
.org-wrap.org-grad .org-node {
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    linear-gradient(135deg, var(--og-c1, var(--c-primary)), var(--og-c2, var(--c-accent))) border-box;
}
.org-wrap.org-grad.org-h .org-node { border-left-width: 2px; }

/* ---- diagrammi (Vetro.diagram.render) ---- */
.diagram-box { overflow: auto; border: var(--border-w) solid var(--border); border-radius: var(--radius-m); background: var(--surface); padding: var(--sp-3); }
.diagram-box svg { min-width: 320px; }
html[data-theme="dark"] .diagram-box { background: #f4f7fa; } /* i diagrammi nascono "carta": leggibili anche in dark */

/* ---- eventi calendario: multi-giorno, sfondo, stili animati ---- */
.cal-day.has-bgev { background: color-mix(in srgb, var(--bgev, var(--c-accent)) 13%, transparent); }
.cal-day.has-bgev.other { background: color-mix(in srgb, var(--bgev, var(--c-accent)) 6%, transparent); }
.cal-bgev {
  position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: color-mix(in srgb, var(--ev-c, var(--c-accent)) 12%, transparent);
  border-inline: 2px solid color-mix(in srgb, var(--ev-c, var(--c-accent)) 32%, transparent);
}
.cal-bgev.is-ad { background: color-mix(in srgb, var(--ev-c, var(--c-accent)) 7%, transparent); border-inline: 0; }
.cal-day.has-adev { background: color-mix(in srgb, var(--bgev, var(--c-accent)) 8%, transparent); }
.cal-day.has-adev.other { background: color-mix(in srgb, var(--bgev, var(--c-accent)) 4%, transparent); }
.cal-adcol .cal-adev { position: relative; z-index: 1; }
.cal-adev.is-span { position: relative; }
.cal-adev.is-span-start { border-start-end-radius: 0; border-end-end-radius: 0; margin-right: -5px; }
.cal-adev.is-span-mid { border-radius: 0; margin-inline: -5px; min-height: 1.5em; }
.cal-adev.is-span-end { border-start-start-radius: 0; border-end-start-radius: 0; margin-left: -5px; }
.cal-fx-pulse { animation: vt-calfx-pulse 1.8s ease-in-out infinite; }
@keyframes vt-calfx-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.cal-fx-glow { animation: vt-calfx-glow 1.8s ease-in-out infinite; }
@keyframes vt-calfx-glow {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ev-c, var(--c-primary)) 45%, transparent); }
  50% { box-shadow: 0 0 12px 3px color-mix(in srgb, var(--ev-c, var(--c-primary)) 45%, transparent); }
}
.cal-fx-stripes { position: relative; overflow: hidden; }
.cal-fx-stripes::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(-45deg, rgb(255 255 255 / .22) 0 8px, transparent 8px 16px);
  background-size: 200% 200%;
  animation: vt-calfx-stripes 1.2s linear infinite;
}
@keyframes vt-calfx-stripes { to { background-position: 22.6px 0; } }
.cal-fx-shimmer { position: relative; overflow: hidden; }
.cal-fx-shimmer::after {
  content: ""; position: absolute; inset: -50% auto; width: 38%; left: -45%;
  background: linear-gradient(105deg, transparent, rgb(255 255 255 / .4), transparent);
  rotate: 12deg;
  animation: vt-calfx-shimmer 2.2s ease-in-out infinite;
}
@keyframes vt-calfx-shimmer { 60%, 100% { left: 130%; } }

/* ---- cursori custom: varianti ---- */
.vt-cursor-dot, .vt-cursor-ring { --cur-c: var(--c-primary); }
.vt-cursor-dot { background: var(--cur-c); }
.vt-cursor-ring { border-color: color-mix(in srgb, var(--cur-c) 75%, transparent); background: color-mix(in srgb, var(--cur-c) 7%, transparent); }
.vt-cursor-ring.has-label { background: var(--cur-c); border-color: var(--cur-c); }
/* punto: solo pallino, niente anello */
.vt-cursor-dot.cur-punto { width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.vt-cursor-ring.cur-punto { border: 0; background: transparent; }
.vt-cursor-ring.cur-punto.has-label { background: var(--cur-c); }
/* mirino: croce + anello sottile */
.vt-cursor-dot.cur-mirino { width: 4px; height: 4px; margin: -2px 0 0 -2px; border-radius: 0; }
.vt-cursor-ring.cur-mirino { border-radius: 0; border-width: 1px; }
.vt-cursor-ring.cur-mirino::before, .vt-cursor-ring.cur-mirino::after {
  content: ""; position: absolute; background: var(--cur-c);
}
.vt-cursor-ring.cur-mirino::before { left: 50%; top: -9px; bottom: -9px; width: 1px; }
.vt-cursor-ring.cur-mirino::after { top: 50%; left: -9px; right: -9px; height: 1px; }
/* alone: blob luminoso morbido */
.vt-cursor-dot.cur-alone { width: 6px; height: 6px; margin: -3px 0 0 -3px; }
.vt-cursor-ring.cur-alone {
  width: 84px; height: 84px; margin: -42px 0 0 -42px; border: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--cur-c) 32%, transparent), transparent 65%);
  filter: blur(2px);
}
.vt-cursor-ring.cur-alone.is-hover { width: 120px; height: 120px; margin: -60px 0 0 -60px; }
/* emoji: il punto È un'emoji */
.vt-cursor-dot.cur-emoji { width: auto; height: auto; margin: -4px 0 0 -6px; background: none; font-size: 22px; line-height: 1; }
.vt-cursor-ring.cur-emoji { border-style: dashed; }

/* ---- occhi che seguono il puntatore ---- */
.fx-eyes { display: inline-flex; gap: 10px; }
.fx-eye {
  position: relative; width: 46px; height: 46px; border-radius: 50%;
  background: var(--paper, #fff); border: var(--border-w) solid var(--border-2);
  box-shadow: inset 0 -4px 8px rgb(0 0 0 / .07), var(--shadow-s);
  display: grid; place-items: center; overflow: hidden;
}
.fx-eye i {
  width: 17px; height: 17px; border-radius: 50%;
  background: radial-gradient(circle at 35% 32%, #5b6b7a 0 18%, var(--ink, #15202c) 40%);
  transition: transform .08s linear;
}
.fx-eye::after { content: ""; position: absolute; top: 9px; left: 13px; width: 8px; height: 5px; border-radius: 50%; background: rgb(255 255 255 / .8); pointer-events: none; }

/* ---- meteo fx (Vetro.weatherfx) ---- */
.wfx-host { isolation: isolate; }
.wfx-canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.wfx-host.wfx-caldo::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgb(255 120 30 / .07), transparent 55%);
}

/* ---- transizioni pronte (entrata/uscita) — usate via classi .anim-* ----
   durata con --anim-dur (default .55s); "out" lascia l'elemento invisibile */
[class*="anim-"] { animation-duration: var(--anim-dur, .55s); animation-timing-function: var(--ease-pop, ease); animation-fill-mode: both; }
.anim-rapida { --anim-dur: .25s; }
.anim-lenta { --anim-dur: 1s; }
.anim-lentissima { --anim-dur: 1.8s; }
.anim-fade-in { animation-name: vt-a-fade-in; }
.anim-fade-out { animation-name: vt-a-fade-out; }
.anim-pop-in { animation-name: vt-a-pop-in; }
.anim-shrink-out { animation-name: vt-a-shrink-out; }
.anim-slide-up { animation-name: vt-a-slide-up; }
.anim-slide-down-out { animation-name: vt-a-slide-down-out; }
.anim-blur-in { animation-name: vt-a-blur-in; }
.anim-blur-out { animation-name: vt-a-blur-out; }
.anim-squash-in { animation-name: vt-a-squash-in; }
.anim-squash-out { animation-name: vt-a-squash-out; }
.anim-flip-in { animation-name: vt-a-flip-in; perspective: 600px; }
.anim-flip-out { animation-name: vt-a-flip-out; }
.anim-fold-out { animation-name: vt-a-fold-out; transform-origin: top; }
.anim-unfold-in { animation-name: vt-a-unfold-in; transform-origin: top; }
@keyframes vt-a-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes vt-a-fade-out { to { opacity: 0; visibility: hidden; } }
@keyframes vt-a-pop-in { 0% { opacity: 0; scale: .55; } 75% { scale: 1.06; } 100% { opacity: 1; scale: 1; } }
@keyframes vt-a-shrink-out { to { opacity: 0; scale: .55; visibility: hidden; } }
@keyframes vt-a-slide-up { from { opacity: 0; translate: 0 26px; } to { opacity: 1; translate: 0 0; } }
@keyframes vt-a-slide-down-out { to { opacity: 0; translate: 0 26px; visibility: hidden; } }
@keyframes vt-a-blur-in { from { opacity: 0; filter: blur(14px); } to { opacity: 1; filter: blur(0); } }
@keyframes vt-a-blur-out { to { opacity: 0; filter: blur(14px); visibility: hidden; } }
@keyframes vt-a-squash-in { 0% { opacity: 0; scale: 1.3 .2; } 60% { scale: .92 1.06; } 100% { opacity: 1; scale: 1 1; } }
@keyframes vt-a-squash-out { 40% { scale: 1.12 .8; } 100% { opacity: 0; scale: 1.3 .08; visibility: hidden; } }
@keyframes vt-a-flip-in { from { opacity: 0; transform: perspective(640px) rotateX(-72deg); } to { opacity: 1; transform: perspective(640px) rotateX(0); } }
@keyframes vt-a-flip-out { to { opacity: 0; transform: perspective(640px) rotateX(78deg); visibility: hidden; } }
@keyframes vt-a-fold-out { 50% { scale: 1 .5; opacity: .7; } 100% { scale: 0 0; opacity: 0; visibility: hidden; } }
@keyframes vt-a-unfold-in { 0% { scale: 0 0; opacity: 0; } 55% { scale: 1 .5; opacity: .8; } 100% { scale: 1 1; opacity: 1; } }

/* ---- filtri immagine: overlay sfumato + leve hue/sat (JS imposta filter) ---- */
.fimg { position: relative; overflow: hidden; border-radius: var(--radius-m); }
.fimg > img, .fimg > .fimg-fill { display: block; width: 100%; }
.fimg-grad::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(var(--fg-angle, 135deg), var(--fg-c1, var(--c-primary)), var(--fg-c2, var(--c-accent)));
  mix-blend-mode: var(--fg-blend, overlay);
  opacity: var(--fg-op, .55);
}

/* ---- cornice di pagina con bordo sfumato (tema o color picker) ---- */
body.page-frame::after {
  content: ""; position: fixed; inset: 0; z-index: 99980; pointer-events: none;
  border: var(--pf-w, 6px) solid transparent;
  border-image: linear-gradient(135deg, var(--pf-c1, var(--c-primary)), var(--pf-c2, var(--c-accent))) 1;
}

/* ---- barra "fruizione" del video (tracking) ---- */
.vtrack { position: relative; height: 12px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.vtrack i { position: absolute; top: 0; bottom: 0; background: var(--c-success); opacity: .85; }

/* ---- riduzione del movimento ---- */
@media (prefers-reduced-motion: reduce) {
  .lightfx::before, .lightfx::after,
  .cal-fx-pulse, .cal-fx-glow, .cal-fx-stripes::after, .cal-fx-shimmer::after,
  .vd-icon, .vd-icon i, .vd-warning, .vd-timer i,
  [class*="anim-"] { animation: none !important; }
  .vlb-media { animation: none; }
}

/* ---- v1.29: player solo audio (Vetro.audio) ---- */
.aplayer {
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  background: var(--surface);
  padding: var(--sp-3);
  display: grid; gap: var(--sp-3);
}
.ap-viz { width: 100%; height: 72px; display: none; border-radius: var(--radius-s); background: var(--surface-2); }
.aplayer.has-viz .ap-viz { display: block; }
.ap-bar { display: flex; align-items: center; gap: var(--sp-3); }
.ap-meta { display: grid; min-width: 110px; }
.ap-meta b { font-size: var(--fs-sm); line-height: 1.2; }
.ap-time { font: 500 var(--fs-xs) var(--font-mono); color: var(--text-3); }
.ap-progress { flex: 1; min-width: 80px; }
.ap-vol { width: 76px; }
@media (max-width: 560px) { .ap-vol { display: none; } }

/* ---- v1.30: switcher tema prefatto (Vetro.themePanel / [data-theme-panel]) ---- */
.tpanel {
  display: grid; gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
}
.tp-title { font-size: var(--fs-sm); }
.tp-row { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.tp-lab { min-width: 52px; font: 650 var(--fs-xs) var(--font-body); color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.tp-mode button { display: inline-flex; align-items: center; gap: .4em; }
.tp-dots { display: flex; gap: .5em; }
.tp-dot {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-2);
  transition: transform var(--t-fast) var(--ease-pop), box-shadow var(--t-fast) var(--ease);
}
.tp-dot:hover { transform: scale(1.14); }
.tp-dot.is-active { box-shadow: 0 0 0 2px var(--c-primary); }
.tp-picks { display: flex; gap: .55em; }
.tp-picks label { position: relative; cursor: pointer; }
.tp-picks input[type="color"] {
  width: 34px; height: 28px; padding: 0; border: var(--border-w) solid var(--border-2);
  border-radius: var(--radius-s); background: none; cursor: pointer;
}
.tp-picks i {
  position: absolute; right: -3px; bottom: -5px;
  font: 700 9px var(--font-mono); font-style: normal;
  background: var(--surface); color: var(--text-3);
  border: var(--border-w) solid var(--border-2); border-radius: 5px;
  padding: 0 .3em; pointer-events: none;
}
.tp-radius { flex: 1; min-width: 90px; }
.tp-radius-v { font-size: var(--fs-xs); color: var(--text-3); min-width: 4ch; }
.tp-fonts { display: flex; gap: .35em; flex-wrap: wrap; }
.tp-font {
  font: 600 var(--fs-xs) var(--font-body); cursor: pointer;
  padding: .3em .65em; border-radius: var(--radius-pill);
  background: var(--surface-2); color: var(--text-2);
  border: var(--border-w) solid var(--border);
}
.tp-font.is-active { background: var(--primary-soft); color: var(--primary-text); border-color: color-mix(in srgb, var(--c-primary) 40%, transparent); }
.tp-reset {
  justify-self: start; cursor: pointer;
  font: 600 var(--fs-xs) var(--font-body);
  padding: .35em .7em; border-radius: var(--radius-pill);
  background: none; color: var(--text-3);
  border: var(--border-w) dashed var(--border-2);
}
.tp-reset:hover { color: var(--danger-text); border-color: var(--c-danger); }

/* ===================================================================== */
/* ===== 54 · v1.31 — PLAYLIST M3U · SUONI/API · PAGINATION · LIST GROUP
         · POPOVER · FLOATING LABEL · HELPER RESPONSIVE ================= */
/* ===================================================================== */

/* ---- guardie responsive: niente sbordi fuori pagina ----
   Gli item di griglia non allargano mai la traccia oltre lo spazio (il
   min-width:auto dei contenuti lunghi è la prima causa di layout rotti);
   iframe/embed e i blocchi di codice restano dentro il contenitore. */
.grid > * { min-width: 0; }
iframe, embed, object { max-width: 100%; }
pre { max-width: 100%; }

/* ---- utility di overflow & troncamento ---- */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-clip { overflow: clip; }
.min-w-0 { min-width: 0; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2, .clamp-3 { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { -webkit-line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; }

/* ---- accessibilità: testo solo per screen reader ---- */
.sr-only, .visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* ---- link esteso: un <a> interno rende cliccabile tutto il box ---- */
.stretched-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }

/* ---- rapporti d'aspetto generici (per iframe, embed, mappe) ---- */
.ratio { position: relative; width: 100%; }
.ratio > * { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ratio-16x9 { aspect-ratio: 16 / 9; }
.ratio-4x3 { aspect-ratio: 4 / 3; }
.ratio-1x1 { aspect-ratio: 1; }
.ratio-21x9 { aspect-ratio: 21 / 9; }

/* ---- bottone di chiusura generico ---- */
.btn-x {
  display: inline-grid; place-items: center;
  width: 1.9em; height: 1.9em; padding: 0;
  border: 0; border-radius: var(--radius-s);
  background: transparent; color: var(--text-3);
  font-size: 1em; line-height: 1; cursor: pointer;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn-x:hover { color: var(--text); background: var(--surface-2); }

/* ---- list group: elenco di voci con bordo, hover e stato attivo ---- */
.list-group {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  padding: 0; margin: 0; list-style: none;
}
.list-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: var(--border-w) solid var(--border);
  color: var(--text); text-align: left;
  background: transparent; border-left: 0; border-right: 0; border-top: 0;
  font: inherit; width: 100%;
}
.list-item:last-child { border-bottom: 0; }
a.list-item, button.list-item { cursor: pointer; text-decoration: none; }
a.list-item:hover, button.list-item:hover { background: var(--surface-2); }
.list-item.is-active {
  background: var(--primary-soft); color: var(--primary-text);
  box-shadow: inset 3px 0 0 var(--c-primary);
}
.list-item.is-disabled, .list-item:disabled { opacity: .55; pointer-events: none; }
.list-item .badge { margin-left: auto; }
.list-item small { color: var(--text-3); }

/* ---- pagination (Vetro.pagination o markup a mano) ---- */
.pagination { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pagination .pg-btn, .pagination > a, .pagination > button {
  min-width: 2.3em; height: 2.3em; padding: 0 .5em;
  display: inline-grid; place-items: center;
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface); color: var(--text);
  font: 600 var(--fs-sm) var(--font-body);
  cursor: pointer; text-decoration: none;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.pagination .pg-btn:hover:not(:disabled):not(.is-active),
.pagination > a:hover:not([aria-current]),
.pagination > button:hover:not(:disabled):not(.is-active):not([aria-current]) { background: var(--surface-2); border-color: var(--border-2); }
.pagination .is-active, .pagination [aria-current="page"] {
  background: var(--c-primary); border-color: var(--c-primary); color: var(--on-brand);
  cursor: default;
}
.pagination [disabled] { opacity: .4; cursor: default; }
.pagination .pg-dots { min-width: 1.6em; text-align: center; color: var(--text-3); user-select: none; }
.pagination .pg-btn .icon { width: 15px; height: 15px; }

/* ---- popover: pannello ricco ancorato al trigger ---- */
.popover-host { position: relative; display: inline-block; }
.popover {
  position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
  min-width: 230px; max-width: min(320px, 82vw);
  background: var(--surface);
  border: var(--border-w) solid var(--border-2);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-l);
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--fs-sm); color: var(--text-2);
  opacity: 0; translate: 0 -4px; visibility: hidden; pointer-events: none;
  transition: opacity var(--t-fast) var(--ease), translate var(--t-fast) var(--ease), visibility var(--t-fast);
}
.popover.open { opacity: 1; translate: 0 0; visibility: visible; pointer-events: auto; }
.popover-title { font-weight: 700; color: var(--text); margin-bottom: var(--sp-2); }
.popover.pop-end { left: auto; right: 0; }
.popover.pop-top { top: auto; bottom: calc(100% + 8px); translate: 0 4px; }
.popover.pop-top.open { translate: 0 0; }

/* ---- floating label: l'etichetta vive nel campo e sale al focus ---- */
.field-float { position: relative; }
.field-float > .input {
  padding-top: 1.45em; padding-bottom: .45em;
}
.field-float > label {
  position: absolute; left: calc(.85em + var(--border-w)); top: 50%;
  translate: 0 -50%;
  color: var(--text-3); font-size: var(--fs-base);
  pointer-events: none;
  transition: top var(--t-fast) var(--ease), translate var(--t-fast) var(--ease), font-size var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.field-float > .input:focus + label,
.field-float > .input:not(:placeholder-shown) + label {
  top: .5em; translate: 0 0;
  font-size: var(--fs-xs); color: var(--primary-text);
}

/* ---- playlist M3U / IPTV (Vetro.video.playlist) ---- */
.vplaylist {
  display: grid; grid-template-rows: auto 1fr;
  background: var(--surface);
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  overflow: hidden;
  max-height: var(--h, 420px);
}
.vpl-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3);
  border-bottom: var(--border-w) solid var(--border);
  background: var(--surface-2);
}
.vpl-search { flex: 1; min-width: 0; }
.vpl-count { flex: none; white-space: nowrap; }
.vpl-list { overflow-y: auto; overscroll-behavior: contain; }
.vpl-group {
  position: sticky; top: 0; z-index: 1;
  padding: .45em var(--sp-4) .35em;
  font: 700 var(--fs-xs) var(--font-body);
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--text-3);
  background: color-mix(in srgb, var(--surface) 88%, var(--c-primary));
  border-bottom: var(--border-w) solid var(--border);
}
.vpl-item {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; padding: .55em var(--sp-4);
  background: transparent; border: 0;
  border-bottom: var(--border-w) solid var(--border);
  color: var(--text); font: inherit; text-align: left; cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.vpl-item:last-child { border-bottom: 0; }
.vpl-item:hover { background: var(--surface-2); }
.vpl-item.is-active { background: var(--primary-soft); box-shadow: inset 3px 0 0 var(--c-primary); }
.vpl-item.is-active .vpl-title { color: var(--primary-text); }
.vpl-logo {
  flex: none; width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: var(--radius-s);
  background: color-mix(in srgb, var(--c-primary) 14%, var(--surface-2));
  color: var(--primary-text);
  font: 700 var(--fs-xs) var(--font-mono);
  overflow: hidden;
}
.vpl-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.vpl-meta { display: grid; gap: 1px; min-width: 0; }
.vpl-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vpl-sub { font: 500 var(--fs-xs) var(--font-mono); color: var(--text-3); text-transform: uppercase; }
.vpl-empty { padding: var(--sp-5); color: var(--text-3); font-size: var(--fs-sm); text-align: center; }

/* ---- esploratore API / Swagger (Vetro.api) ---- */
.api { display: grid; gap: var(--sp-3); }
.api-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.api-base {
  font: 500 var(--fs-xs) var(--font-mono); color: var(--text-2);
  background: var(--surface-2); border: var(--border-w) solid var(--border);
  border-radius: 7px; padding: .15em .5em;
  overflow-wrap: anywhere;
}
.api > .api-desc { margin: 0; font-size: var(--fs-sm); }
.api-search { max-width: 320px; }
.api-group { display: grid; gap: var(--sp-2); }
.api-tag { margin: var(--sp-2) 0 0; font-size: var(--fs-sm); letter-spacing: .05em; text-transform: uppercase; color: var(--text-3); }
.api-op {
  border: var(--border-w) solid var(--border);
  border-radius: var(--radius-m);
  background: var(--surface);
  overflow: hidden;
}
.api-row {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; padding: .55em var(--sp-3);
  background: transparent; border: 0;
  font: inherit; color: var(--text); text-align: left; cursor: pointer;
  min-width: 0;
}
.api-row:hover { background: var(--surface-2); }
.api-m {
  flex: none; min-width: 4.6em; text-align: center;
  padding: .22em .5em; border-radius: var(--radius-s);
  font: 700 var(--fs-xs) var(--font-mono); letter-spacing: .04em;
  color: var(--on-brand); background: var(--api-c, var(--c-secondary));
}
.api-m.get    { --api-c: var(--c-info); }
.api-m.post   { --api-c: var(--c-success); }
.api-m.put    { --api-c: var(--c-warning); }
.api-m.patch  { --api-c: color-mix(in srgb, var(--c-warning) 60%, var(--c-danger)); }
.api-m.delete { --api-c: var(--c-danger); }
.api-m.query  { --api-c: var(--c-accent); }
.api-m.head, .api-m.options { --api-c: var(--c-secondary); }
.api-path { font: 600 var(--fs-sm) var(--font-mono); color: var(--text); overflow-wrap: anywhere; }
.api-sum { color: var(--text-3); font-size: var(--fs-xs); margin-left: auto; text-align: right; min-width: 0; }
.api-panel { display: none; padding: var(--sp-3); border-top: var(--border-w) solid var(--border); }
.api-op.open .api-panel { display: grid; gap: var(--sp-3); }
.api-panel .api-desc { margin: 0; font-size: var(--fs-sm); }
.api-params { display: grid; gap: var(--sp-2); grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.api-param { display: grid; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--text-2); }
.api-param .req-star { color: var(--danger-text); }
.api-in {
  font: 500 var(--fs-xs) var(--font-mono); font-style: normal;
  color: var(--text-3); background: var(--surface-2);
  border-radius: 5px; padding: 0 .35em;
}
.api-body { font-family: var(--font-mono); font-size: var(--fs-xs); resize: vertical; }
.api-run { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.api-status { font: 600 var(--fs-xs) var(--font-mono); color: var(--text-3); }
.api-status.ok { color: var(--success-text); }
.api-status.err { color: var(--danger-text); }
.api-res { margin: 0; max-height: 300px; overflow: auto; font-size: var(--fs-xs); }
@media (max-width: 560px) {
  .api-sum { display: none; }
}

/* ---- v1.32: switcher lingua & voci di menu attive ---- */
.menu-item.is-active { color: var(--primary-text); font-weight: 700; background: var(--primary-soft); }
.lang-dd .menu { min-width: 150px; }
.lang-cur { font-weight: 700; font-family: var(--font-mono); font-size: var(--fs-xs); }

/* ===== 55 · v1.33 — SCROLL FX: PIN ORIZZONTALE · PROFONDITÀ · PILA DI CARD
   ===================================================================== */

/* ---- hscroll: la sezione si blocca e i pannelli scorrono in orizzontale.
   L'altezza extra della sezione (JS) è la "corsia" di scroll consumata;
   la scena resta appiccicata a schermo mentre la traccia trasla. ---- */
.hscroll { position: relative; }
.hscroll-stage {
  position: sticky;
  top: 0;
  height: var(--hs-h, 100dvh);
  overflow: clip;
  display: flex;
  align-items: center;
}
.hscroll-track {
  display: flex;
  align-items: stretch;
  gap: var(--hs-gap, var(--sp-4));
  padding-inline: var(--hs-pad, 6vw);
  will-change: transform;
}
.hscroll-panel { flex: 0 0 var(--hp-w, min(72vw, 520px)); min-width: 0; }
@media (prefers-reduced-motion: reduce) {
  .hscroll { height: auto !important; }
  .hscroll-stage { position: static; height: auto; }
  .hscroll-track { transform: none !important; overflow-x: auto; padding-block: var(--sp-3); }
}

/* ---- profondità: i livelli [data-depth] seguono il puntatore ---- */
.plx-scene { position: relative; overflow: clip; }
.plx-scene [data-depth] {
  will-change: transform;
  transition: transform .3s cubic-bezier(.2, .6, .2, 1);
}
@media (prefers-reduced-motion: reduce) {
  .plx-scene [data-depth] { transform: none !important; transition: none; }
}

/* ---- pila di card sticky: ogni card si ferma sotto la precedente ---- */
.stack-cards { display: grid; gap: var(--st-gap, var(--sp-5)); }
.stack-cards > * { position: sticky; transform-origin: center top; }
@media (prefers-reduced-motion: reduce) {
  .stack-cards > * { position: static; transform: none !important; filter: none !important; }
}
