/*
 * Formaxia — Piattaforma e-learning aziendale
 * Progetto ideato e sviluppato da Eugenio Damaso
 * Copyright (c) 2026 Eugenio Damaso — SPDX-License-Identifier: AGPL-3.0-or-later
 *
 * Design system «Atelier» (v3.1): avorio caldo e prugna profonda, viola elettrico e corallo,
 * titoli in Fraunces, testo in Manrope. Barra laterale a gruppi, superfici editoriali.
 */

/* =====================================================================================
 * Temi giorno e notte.
 * Il tema segue il sistema operativo; html[data-theme] lo fissa per scelta dell'utente.
 * Tutti i colori passano da qui: le regole dei componenti usano solo variabili.
 * ===================================================================================== */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url("../fonts/manrope.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/fraunces-soft.woff2") format("woff2"); }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap; src: url("../fonts/fraunces-italic.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("../fonts/jetbrains-mono.woff2") format("woff2"); }

:root {
  color-scheme: light;
  /* Giorno: avorio caldo, inchiostro prugna, viola elettrico e corallo */
  --paper: #f5f3ee;
  --paper-deep: #ece8e0;
  --surface: #ffffff;
  --surface-2: #faf8f4;
  --surface-3: #f1ede6;
  --glass: rgba(255, 255, 255, .74);
  --glass-strong: rgba(255, 255, 255, .92);
  --line: rgba(28, 22, 48, .07);
  --rule: #e9e4db;
  --rule-strong: #d8d1c5;
  --rule-hover: #b7ae9f;
  --ink: #1c1630;
  --ink-soft: #4a4460;
  --ink-mute: #6c667e;
  --accent: #5b3df5;
  --accent-strong: #4326d8;
  --accent-2: #ff6b3d;
  --accent-soft: #f0ecff;
  --accent-glow: rgba(91, 61, 245, .26);
  --on-accent: #ffffff;
  --solid: #1c1630;
  --on-solid: #ffffff;
  --navy: #1c1630;
  --gold: #e7a03a;
  --gold-soft: #fdf2df;
  --gold-ink: #8a5300;
  --gold-line: #f0d3a2;
  --brass: #ff6b3d;
  --brass-soft: #fff0ea;
  --coral: #ff6b3d;
  --coral-ink: #c2410c;
  --coral-soft: #fff0ea;
  --info: #4326d8;
  --info-soft: #f0ecff;
  --info-line: #d9d0fd;
  --ok: #0d8656;
  --ok-soft: #e3f5ec;
  --ok-line: #b5e1cb;
  --warn: #9f5800;
  --warn-soft: #fdf1dc;
  --warn-line: #efd29b;
  --error: #cf2f3d;
  --error-soft: #fdecee;
  --error-line: #f3c3c8;
  --focus: #5b3df5;
  --doc: #ffffff;
  --scale-0: #fde2e1; --scale-0-ink: #7f1d1d;
  --scale-1: #fdebd3; --scale-1-ink: #7c2d12;
  --scale-2: #fef3c7; --scale-2-ink: #713f12;
  --scale-3: #ece7ff; --scale-3-ink: #3b1f9e;
  --scale-4: #d9cfff; --scale-4-ink: #3b1f9e;
  --scale-5: #c9f1dc; --scale-5-ink: #14532d;
  --shadow-1: 0 1px 2px rgba(28, 22, 48, .05);
  --shadow-2: 0 1px 2px rgba(28, 22, 48, .04), 0 14px 34px -18px rgba(28, 22, 48, .16);
  --shadow-3: 0 2px 8px rgba(28, 22, 48, .06), 0 34px 70px -26px rgba(28, 22, 48, .30);
  --edge: inset 0 1px 0 rgba(255, 255, 255, .85);
  --aurora-a: rgba(91, 61, 245, .11);
  --aurora-b: rgba(255, 107, 61, .09);
  --aurora-c: rgba(255, 186, 140, .14);
  --grain: .035;
  --btn-from: #6a4dff;
  --btn-to: #4a2ce2;
  --card-bg: var(--surface);
  --field-bg: #fdfcfa;
  --lit-glow: rgba(91, 61, 245, .05);
  --doc-canvas: linear-gradient(180deg, #fbfaf7, #f1eee8);
  --doc-border: var(--rule);
  --logo-hex: #5b3df5;
  --brand: var(--accent);
  --sb-bg: #15112a;
  --sb-bg-2: #1f1838;
  --sb-ink: #f1eefb;
  --sb-mute: #a7a1c2;
  --sb-line: rgba(255, 255, 255, .08);
  --sb-hover: rgba(255, 255, 255, .06);
  --sb-active: rgba(124, 99, 255, .32);
  --sb-accent: #ff9a74;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.125rem;
  --step-2: 1.5rem;
  --step-3: 2.5rem;

  --radius-field: 12px;
  --radius-panel: 18px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --sb-w: 272px;
  --appbar-h: 64px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
}

/* Notte: prugna quasi nera, superfici profonde, viola e corallo più luminosi */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0c0a14;
  --paper-deep: #08060e;
  --surface: #15121f;
  --surface-2: #1b1727;
  --surface-3: #252033;
  --glass: rgba(18, 15, 27, .72);
  --glass-strong: rgba(21, 18, 31, .92);
  --line: rgba(205, 195, 245, .08);
  --rule: rgba(205, 195, 245, .11);
  --rule-strong: rgba(205, 195, 245, .2);
  --rule-hover: rgba(205, 195, 245, .34);
  --ink: #f3f1f9;
  --ink-soft: #c6c1d8;
  --ink-mute: #938ca9;
  --accent: #9a84ff;
  --accent-strong: #bcaeff;
  --accent-2: #ff8a62;
  --accent-soft: rgba(154, 132, 255, .14);
  --accent-glow: rgba(154, 132, 255, .36);
  --on-accent: #ffffff;
  --solid: #9a84ff;
  --on-solid: #120d24;
  --navy: #0c0a14;
  --gold: #f3b552;
  --gold-soft: rgba(243, 181, 82, .13);
  --gold-ink: #f6c97a;
  --gold-line: rgba(243, 181, 82, .32);
  --brass: #ff8a62;
  --brass-soft: rgba(255, 138, 98, .13);
  --coral: #ff8a62;
  --coral-ink: #ffb394;
  --coral-soft: rgba(255, 138, 98, .13);
  --info: #bcaeff;
  --info-soft: rgba(154, 132, 255, .13);
  --info-line: rgba(154, 132, 255, .3);
  --ok: #4fd69c;
  --ok-soft: rgba(79, 214, 156, .12);
  --ok-line: rgba(79, 214, 156, .3);
  --warn: #f4b450;
  --warn-soft: rgba(244, 180, 80, .12);
  --warn-line: rgba(244, 180, 80, .32);
  --error: #ff7c86;
  --error-soft: rgba(255, 124, 134, .12);
  --error-line: rgba(255, 124, 134, .32);
  --focus: #bcaeff;
  --doc: #ffffff;
  --scale-0: rgba(248, 113, 113, .22); --scale-0-ink: #fecaca;
  --scale-1: rgba(251, 146, 60, .2); --scale-1-ink: #fed7aa;
  --scale-2: rgba(250, 204, 21, .17); --scale-2-ink: #fef08a;
  --scale-3: rgba(154, 132, 255, .18); --scale-3-ink: #ddd5ff;
  --scale-4: rgba(154, 132, 255, .34); --scale-4-ink: #ece8ff;
  --scale-5: rgba(74, 222, 128, .24); --scale-5-ink: #bbf7d0;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .45);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 36px -18px rgba(0, 0, 0, .75);
  --shadow-3: 0 2px 8px rgba(0, 0, 0, .45), 0 36px 74px -26px rgba(0, 0, 0, .9);
  --edge: inset 0 1px 0 rgba(255, 255, 255, .05);
  --aurora-a: rgba(124, 92, 255, .20);
  --aurora-b: rgba(255, 110, 70, .10);
  --aurora-c: rgba(255, 170, 120, .06);
  --grain: .05;
  --btn-from: #8064ff;
  --btn-to: #5c3ff0;
  --card-bg: var(--surface);
  --field-bg: #110e1a;
  --lit-glow: rgba(154, 132, 255, .07);
  --doc-canvas: linear-gradient(180deg, #f6f4ef, #ebe7df);
  --doc-border: transparent;
  --logo-hex: #7c5cff;
  --brand: #bcaeff;
  --sb-bg: #0b0913;
  --sb-bg-2: #13101f;
  --sb-ink: #f1eefb;
  --sb-mute: #9c96b5;
  --sb-line: rgba(255, 255, 255, .07);
  --sb-hover: rgba(255, 255, 255, .05);
  --sb-active: rgba(124, 99, 255, .28);
  --sb-accent: #ff9a74;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0c0a14;
    --paper-deep: #08060e;
    --surface: #15121f;
    --surface-2: #1b1727;
    --surface-3: #252033;
    --glass: rgba(18, 15, 27, .72);
    --glass-strong: rgba(21, 18, 31, .92);
    --line: rgba(205, 195, 245, .08);
    --rule: rgba(205, 195, 245, .11);
    --rule-strong: rgba(205, 195, 245, .2);
    --rule-hover: rgba(205, 195, 245, .34);
    --ink: #f3f1f9;
    --ink-soft: #c6c1d8;
    --ink-mute: #938ca9;
    --accent: #9a84ff;
    --accent-strong: #bcaeff;
    --accent-2: #ff8a62;
    --accent-soft: rgba(154, 132, 255, .14);
    --accent-glow: rgba(154, 132, 255, .36);
    --on-accent: #ffffff;
    --solid: #9a84ff;
    --on-solid: #120d24;
    --navy: #0c0a14;
    --gold: #f3b552;
    --gold-soft: rgba(243, 181, 82, .13);
    --gold-ink: #f6c97a;
    --gold-line: rgba(243, 181, 82, .32);
    --brass: #ff8a62;
    --brass-soft: rgba(255, 138, 98, .13);
    --coral: #ff8a62;
    --coral-ink: #ffb394;
    --coral-soft: rgba(255, 138, 98, .13);
    --info: #bcaeff;
    --info-soft: rgba(154, 132, 255, .13);
    --info-line: rgba(154, 132, 255, .3);
    --ok: #4fd69c;
    --ok-soft: rgba(79, 214, 156, .12);
    --ok-line: rgba(79, 214, 156, .3);
    --warn: #f4b450;
    --warn-soft: rgba(244, 180, 80, .12);
    --warn-line: rgba(244, 180, 80, .32);
    --error: #ff7c86;
    --error-soft: rgba(255, 124, 134, .12);
    --error-line: rgba(255, 124, 134, .32);
    --focus: #bcaeff;
    --doc: #ffffff;
    --scale-0: rgba(248, 113, 113, .22); --scale-0-ink: #fecaca;
    --scale-1: rgba(251, 146, 60, .2); --scale-1-ink: #fed7aa;
    --scale-2: rgba(250, 204, 21, .17); --scale-2-ink: #fef08a;
    --scale-3: rgba(154, 132, 255, .18); --scale-3-ink: #ddd5ff;
    --scale-4: rgba(154, 132, 255, .34); --scale-4-ink: #ece8ff;
    --scale-5: rgba(74, 222, 128, .24); --scale-5-ink: #bbf7d0;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 36px -18px rgba(0, 0, 0, .75);
    --shadow-3: 0 2px 8px rgba(0, 0, 0, .45), 0 36px 74px -26px rgba(0, 0, 0, .9);
    --edge: inset 0 1px 0 rgba(255, 255, 255, .05);
    --aurora-a: rgba(124, 92, 255, .20);
    --aurora-b: rgba(255, 110, 70, .10);
    --aurora-c: rgba(255, 170, 120, .06);
    --grain: .05;
    --btn-from: #8064ff;
    --btn-to: #5c3ff0;
    --card-bg: var(--surface);
    --field-bg: #110e1a;
    --lit-glow: rgba(154, 132, 255, .07);
    --doc-canvas: linear-gradient(180deg, #f6f4ef, #ebe7df);
    --doc-border: transparent;
    --logo-hex: #7c5cff;
    --brand: #bcaeff;
    --sb-bg: #0b0913;
    --sb-bg-2: #13101f;
    --sb-ink: #f1eefb;
    --sb-mute: #9c96b5;
    --sb-line: rgba(255, 255, 255, .07);
    --sb-hover: rgba(255, 255, 255, .05);
    --sb-active: rgba(124, 99, 255, .28);
    --sb-accent: #ff9a74;
  }
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--step-0)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ink); text-underline-offset: 3px; }
a:hover { color: var(--brass); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.2;
  margin: 0;
}

h1 { font-size: var(--step-3); margin-bottom: var(--space-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 var(--space-4); max-width: 66ch; }

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

/* ---------- Wizard di installazione ---------- */

.setup {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
}

.setup-rail { color: #e8edf4; }

/* La trama copre tutta l'altezza della colonna; il contenuto resta fermo durante lo scroll. */
.setup-rail-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: var(--space-7) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-7);
}

.setup-brand {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
}

.setup-brand strong {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  color: #fff;
}

.setup-brand span { color: #b7c3d4; font-size: var(--step--1); }

.stepper { list-style: none; margin: 0; padding: 0; counter-reset: step; }

.stepper li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 32px 1fr;
  column-gap: var(--space-3);
  padding: var(--space-3) 0;
  position: relative;
}

.stepper li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 44px;
  bottom: -4px;
  width: 1px;
  background: rgba(255,255,255,.18);
}

.stepper .mark {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 600 var(--step--1)/1 var(--font-body);
  border: 1px solid rgba(255,255,255,.35);
  color: #c9d3e0;
  grid-row: span 2;
}

.stepper .mark::before { content: counter(step); }

.stepper .name { color: #e8edf4; font-weight: 600; }
.stepper .desc { color: #9fadc1; font-size: var(--step--1); }

.stepper li.is-done .mark {
  background: var(--brass);
  border-color: var(--brass);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(169,128,63,.25);
}

.stepper li.is-done .mark::before { content: "✓"; }

.stepper li.is-current .mark {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}

.stepper li.is-locked { opacity: .55; }

.stepper a { color: inherit; text-decoration: none; }
.stepper a:hover .name { text-decoration: underline; }

.setup-credit {
  margin-top: auto;
  font-size: var(--step--1);
  color: #9fadc1;
  max-width: 28ch;
}

.setup-main {
  padding: var(--space-7) clamp(var(--space-5), 6vw, 96px);
  display: flex;
  flex-direction: column;
  max-width: 760px;
}

.setup-progress { display: none; color: var(--ink-mute); font-size: var(--step--1); margin-bottom: var(--space-3); }

.setup-main header { margin-bottom: var(--space-6); }
.setup-main header p { color: var(--ink-soft); }

/* ---------- Form ---------- */

.form { display: grid; gap: var(--space-5); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-5) var(--space-4);
}

.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
.span-3 { grid-column: span 3; }
.span-2 { grid-column: span 2; }
.span-1 { grid-column: span 1; }

fieldset {
  border: 0;
  border-top: 1px solid var(--rule);
  padding: var(--space-5) 0 0;
  margin: 0;
}

legend {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  padding: 0 var(--space-3) 0 0;
}

.field { display: grid; gap: var(--space-2); align-content: start; }
fieldset > .field + .field, fieldset > .field + .form-grid, fieldset > .hint + .form-grid { margin-top: var(--space-4); }

.field label { font-weight: 600; font-size: var(--step--1); color: var(--ink); }
.field .optional { font-weight: 400; color: var(--ink-mute); }

.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="number"],
.field select {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-field);
  transition: border-color .12s ease, box-shadow .12s ease;
}

.field input:hover, .field select:hover { border-color: var(--ink-mute); }

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.field .hint { color: var(--ink-mute); font-size: var(--step--1); margin: 0; }

.field.has-error input, .field.has-error select { border-color: var(--error); }
.field .error { color: var(--error); font-size: var(--step--1); margin: 0; font-weight: 500; }

.token-input input {
  font: 600 1.25rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.color-field { display: flex; gap: var(--space-2); align-items: center; }
.color-field input[type="color"] {
  width: 46px; height: 42px; padding: 3px;
  border: 1px solid var(--rule-strong); border-radius: var(--radius-field);
  background: var(--surface); cursor: pointer;
}

.choice-group { display: grid; gap: var(--space-3); grid-template-columns: 1fr 1fr; }

.choice {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-panel);
  background: var(--surface);
  cursor: pointer;
}

.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); background: var(--accent-soft); }
.choice input { margin: 3px 0 0; accent-color: var(--accent); }
.choice strong { display: block; }
.choice span { color: var(--ink-mute); font-size: var(--step--1); }

.password-rules {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px var(--space-4);
  font-size: var(--step--1); color: var(--ink-mute);
}

.password-rules li::before { content: "○"; margin-right: 6px; color: var(--rule-strong); }
.password-rules li.met { color: var(--ok); }
.password-rules li.met::before { content: "●"; color: var(--ok); }

.field input[type="file"] { font: inherit; color: var(--ink-soft); }

.field input[type="file"]::file-selector-button {
  margin-right: var(--space-3);
  min-height: 38px;
  padding: 0 16px;
  font: 600 var(--step--1)/1 var(--font-body);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-field);
  cursor: pointer;
}

.field input[type="file"]::file-selector-button:hover { border-color: var(--ink); }

.logo-preview {
  display: none;
  max-height: 64px;
  max-width: 240px;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-field);
}
.logo-preview.is-visible { display: block; }

/* ---------- Pulsanti ---------- */

.actions {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding-top: var(--space-5);
  border-top: 1px solid var(--rule);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 22px;
  font: 600 var(--step-0)/1 var(--font-body);
  border-radius: var(--radius-field);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
}

.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); color: var(--on-accent); }
.btn-primary[disabled], .btn-primary[aria-disabled="true"] { background: var(--ink-mute); cursor: not-allowed; }
.btn-primary.is-busy { opacity: .75; cursor: progress; }

.btn-quiet { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn-quiet:hover { border-color: var(--accent); color: var(--accent-strong); }

/* ---------- Messaggi ---------- */

.notice {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-panel);
  border-left: 4px solid;
  margin-bottom: var(--space-5);
}

.notice p { margin: 0; }
.notice-error { background: var(--error-soft); border-color: var(--error); }
.notice-success { background: var(--ok-soft); border-color: var(--ok); }
.notice-warn { background: var(--warn-soft); border-color: var(--warn); }
.notice-info { background: var(--surface); border-color: var(--rule-strong); }

code, .mono {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .875em;
  background: var(--surface-3);
  padding: 1px 6px;
  border-radius: 4px;
}

/* ---------- Requisiti ---------- */

.checks { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }

.checks li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}

.checks .state {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: #fff;
  margin-top: 1px;
}

.checks .ok .state { background: var(--ok); }
.checks .fail .state { background: var(--error); }
.checks .warn .state { background: var(--warn); }
.checks .detail { color: var(--ink-mute); font-size: var(--step--1); }
.checks .tag { font-size: var(--step--1); color: var(--ink-mute); white-space: nowrap; }

/* ---------- Riepilogo ---------- */

.summary {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  border-top: 1px solid var(--rule);
}

.summary dt, .summary dd {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--rule);
  margin: 0;
}

.summary dt { color: var(--ink-mute); padding-right: var(--space-6); }
.summary dd { font-weight: 600; overflow-wrap: anywhere; }
.summary + .ref { margin-top: var(--space-4); color: var(--ink-mute); font-size: var(--step--1); }

/* ---------- App shell (pagine pubbliche e home) ---------- */

.shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }

.topbar {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(var(--space-4), 4vw, var(--space-7));
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
}

.topbar .identity { display: flex; align-items: center; gap: var(--space-3); font-weight: 600; }
.topbar .identity img { max-height: 36px; max-width: 160px; }
.topbar .product { font-family: var(--font-display); font-size: var(--step-1); }

.page {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--space-7) clamp(var(--space-4), 4vw, var(--space-7));
}

.welcome {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--space-7);
  align-items: start;
}

.welcome .lead { font-size: var(--step-1); color: var(--ink-soft); }

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  padding: var(--space-5) var(--space-6);
}

.panel h2 { font-size: var(--step-1); margin-bottom: var(--space-4); }

.milestones { list-style: none; margin: 0; padding: 0; }
.milestones li {
  display: grid; grid-template-columns: 28px 1fr; gap: var(--space-3);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--rule);
}
.milestones li:last-child { border-bottom: 0; }
.milestones .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--rule-strong); margin: 5px 0 0 6px; }
.milestones .is-done .dot { background: var(--brass); border-color: var(--brass); }
.milestones .is-next .dot { border-color: var(--ink); }
.milestones small { display: block; color: var(--ink-mute); }

.footer {
  padding: var(--space-5) clamp(var(--space-4), 4vw, var(--space-7));
  color: var(--ink-mute);
  font-size: var(--step--1);
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

/* ---------- Pagina di errore ---------- */

.error-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 8px 1fr;
}

.error-page .band { background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--gold)); }

.error-page main {
  align-self: center;
  padding: var(--space-7) clamp(var(--space-5), 8vw, 120px);
  max-width: 720px;
}

.error-page .status {
  font-family: var(--font-display);
  font-size: clamp(5rem, 3rem + 8vw, 9rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: .9;
  background: linear-gradient(120deg, var(--accent) 10%, var(--accent-2) 55%, var(--gold) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: var(--space-4);
}

.error-page .ref { color: var(--ink-mute); font-size: var(--step--1); }

.debug {
  margin-top: var(--space-6);
  padding: var(--space-4);
  background: #1b2433;
  color: #d8e0eb;
  border-radius: var(--radius-panel);
  font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .setup { grid-template-columns: 1fr; }
  .setup-rail-inner {
    position: static; height: auto;
    padding: var(--space-5);
    gap: var(--space-4);
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
  .stepper, .setup-credit { display: none; }
  .setup-progress { display: block; }
  .setup-main { padding: var(--space-6) var(--space-4); }
  .welcome { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .span-6, .span-4, .span-3, .span-2, .span-1 { grid-column: 1 / -1; }
  .choice-group, .password-rules { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr; }
  .summary dt { border-bottom: 0; padding-bottom: 0; }
  .actions { flex-direction: column-reverse; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ===================== Push 002 · Accesso e area riservata ===================== */

.skip-link {
  position: absolute; left: -9999px; top: 8px;
  background: var(--solid); color: var(--on-solid); padding: 8px 14px; border-radius: var(--radius-field); z-index: 10;
}
.skip-link:focus { left: 8px; }

/* ---------- Pagine di accesso ---------- */

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 44%) 1fr;
}

.auth-brand { color: #e8edf4; }

.auth-brand-inner {
  position: sticky; top: 0;
  min-height: 100vh;
  padding: var(--space-7) clamp(var(--space-5), 5vw, 72px);
  display: flex; flex-direction: column; gap: var(--space-5);
}

.auth-logo {
  align-self: flex-start;
  background: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-panel);
}
.auth-logo img { display: block; max-height: 48px; max-width: 220px; }

.auth-company { font-family: var(--font-display); font-size: var(--step-2); color: #fff; }

.auth-claim {
  margin-top: auto;
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 2.25rem);
  line-height: 1.25;
  color: #fff;
  max-width: 18ch;
}

.auth-product { color: #9fadc1; font-size: var(--step--1); margin: 0; }

.auth-main {
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--space-7) clamp(var(--space-4), 6vw, 96px);
}

.auth-panel { width: 100%; max-width: 420px; }
.auth-panel:has(.enroll) { max-width: 560px; }
.auth-lead { color: var(--ink-soft); }
.auth-help { margin-top: var(--space-5); color: var(--ink-mute); font-size: var(--step--1); }
.auth-credit { margin-top: var(--space-7); color: var(--ink-mute); font-size: var(--step--1); }

.btn-block { width: 100%; }
.btn-small { min-height: 34px; padding: 0 14px; font-size: var(--step--1); }
.btn-danger { background: var(--error); color: #fff; }
.btn-danger:hover { filter: brightness(.92); color: #fff; }

.code-input {
  font: 600 1.375rem/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace !important;
  letter-spacing: .18em;
  text-align: center;
}

/* ---------- Attivazione 2FA ---------- */

.enroll-steps { list-style: none; margin: var(--space-5) 0 0; padding: 0; counter-reset: enroll; }

.enroll-steps > li {
  counter-increment: enroll;
  position: relative;
  padding: 0 0 var(--space-6) 48px;
  border-left: 1px solid var(--rule);
  margin-left: 15px;
}
.enroll-steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }

.enroll-steps > li::before {
  content: counter(enroll);
  position: absolute; left: -16px; top: -2px;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--solid); color: var(--on-solid);
  font: 600 var(--step--1)/1 var(--font-body);
}

.enroll-steps h2 { font-size: var(--step-1); margin-bottom: var(--space-2); }

.qr {
  width: 200px; height: 200px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  margin: var(--space-3) 0;
}
.qr svg { display: block; width: 100%; height: 100%; }

.secret { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.secret code { font-size: 1rem; letter-spacing: .06em; padding: 6px 10px; }
.secret-long code { font-size: .875rem; letter-spacing: 0; overflow-wrap: anywhere; max-width: 100%; }
.cron-url summary { cursor: pointer; }
.cron-url summary code { overflow-wrap: anywhere; }
.cron-url ul { margin: var(--space-3) 0; padding-left: 1.2em; display: grid; gap: var(--space-2); }
.cron-url li code { overflow-wrap: anywhere; }

.actions-tight { border-top: 0; padding-top: 0; }

/* ---------- Area riservata ---------- */

.mainnav { display: flex; gap: var(--space-1); margin-left: var(--space-6); margin-right: auto; }

.mainnav a {
  padding: 8px 12px;
  border-radius: var(--radius-field);
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
}
.mainnav a:hover { background: var(--paper); color: var(--ink); }
.mainnav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--brass); border-radius: 0; }

.usermenu { display: flex; align-items: center; gap: var(--space-3); }
.usermenu form { margin: 0; }

.avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--solid); color: var(--on-solid);
  font: 600 var(--step--1)/1 var(--font-body);
}

.who { display: grid; line-height: 1.25; }
.who small { color: var(--ink-mute); font-size: var(--step--1); }

.narrow { max-width: 680px; }

.lead { font-size: var(--step-1); color: var(--ink-soft); }

.section-title { font-size: var(--step-1); margin: var(--space-6) 0 var(--space-3); }

.module-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.module-list li { display: grid; padding: var(--space-3) 0; border-bottom: 1px solid var(--rule); }
.module-list small { color: var(--ink-mute); }

.setting-block {
  margin-top: var(--space-6);
  padding: var(--space-5) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  display: grid; gap: var(--space-4);
}

.setting-head { display: flex; justify-content: space-between; gap: var(--space-4); align-items: flex-start; }
.setting-head h2 { font-size: var(--step-1); margin-bottom: var(--space-2); }
.setting-head p { margin: 0; color: var(--ink-soft); }

.status-pill {
  white-space: nowrap;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
}
.status-pill.is-on { background: var(--ok-soft); color: var(--ok); }
.status-pill.is-off { background: var(--surface-3); color: var(--ink-soft); }

.disclosure { border-top: 1px solid var(--rule); padding-top: var(--space-4); }
.disclosure summary { cursor: pointer; font-weight: 600; }
.disclosure[open] summary { margin-bottom: var(--space-4); }

.recovery-codes {
  list-style: none; margin: var(--space-5) 0; padding: var(--space-5);
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3) var(--space-6);
  background: var(--surface);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-panel);
  counter-reset: code;
}
.recovery-codes li { counter-increment: code; display: flex; gap: var(--space-3); align-items: baseline; }
.recovery-codes li::before { content: counter(code) "."; color: var(--ink-mute); font-size: var(--step--1); min-width: 2ch; text-align: right; }
.recovery-codes code { font-size: 1.0625rem; letter-spacing: .08em; background: none; padding: 0; }

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand-inner { min-height: 0; position: static; padding: var(--space-5); flex-direction: row; align-items: center; justify-content: space-between; }
  .auth-claim, .auth-product { display: none; }
  .mainnav { margin-left: var(--space-3); }
  .who { display: none; }
}

@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; height: auto; padding-top: var(--space-3); padding-bottom: var(--space-3); gap: var(--space-2); }
  .mainnav { order: 3; width: 100%; margin: 0; }
  .recovery-codes { grid-template-columns: 1fr; }
  .setting-block { padding: var(--space-4); }
}

@media print {
  .topbar, .footer, .actions, .skip-link { display: none !important; }
  body { background: #fff; }
  .recovery-codes { border-color: #000; }
}

.enroll { max-width: 680px; }
.enroll .field { max-width: 260px; }

/* ===================== Push 003 · Organizzazione ===================== */

.page { max-width: 1180px; }

.page-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4);
  margin-bottom: var(--space-5);
}
.page-head h1 { margin-bottom: var(--space-2); }
.page-head .lead { margin: 0; }

.breadcrumb { font-size: var(--step--1); color: var(--ink-mute); margin-bottom: var(--space-3); }
.breadcrumb a { color: var(--ink-mute); }

.muted { color: var(--ink-mute); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table th.num { text-align: right; }
.link-quiet { color: var(--ink-mute); font-size: var(--step--1); }
.link-danger { background: none; border: 0; padding: 0; color: var(--error); font: inherit; font-size: var(--step--1); text-decoration: underline; cursor: pointer; }

.field textarea,
.field input[type="date"],
.field input[type="search"] {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-field);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field textarea:focus, .field input[type="date"]:focus, .field input[type="search"]:focus {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px var(--accent-soft);
}

.checkbox { display: flex; gap: var(--space-3); align-items: flex-start; font-weight: 400 !important; font-size: var(--step-0) !important; cursor: pointer; }
.checkbox input { margin-top: 4px; accent-color: var(--accent); width: 16px; height: 16px; }

/* Filtri */
.filters {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) repeat(auto-fit, minmax(150px, 1fr));
  gap: var(--space-3);
  align-items: end;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  margin-bottom: var(--space-5);
}
.filters .field label { font-size: var(--step--1); }
.filters-actions { display: flex; align-items: center; gap: var(--space-3); }

/* Tabelle */
.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
}

.table { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.table th {
  text-align: left;
  font-size: var(--step--1);
  font-weight: 600;
  color: var(--ink-mute);
  padding: 12px var(--space-4);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.table td { padding: 12px var(--space-4); border-bottom: 1px solid var(--rule); vertical-align: top; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table td small { display: block; color: var(--ink-mute); font-size: var(--step--1); margin-top: 2px; }
.table-quiet td { color: var(--ink-soft); }
.row-link { font-weight: 600; text-decoration: none; }
.row-link:hover { text-decoration: underline; }
.cell-actions { text-align: right; white-space: nowrap; width: 1%; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 600;
  white-space: nowrap;
  vertical-align: middle;
}
.badge-active { background: var(--ok-soft); color: var(--ok); }
.badge-suspended { background: var(--warn-soft); color: var(--warn); }
.badge-disabled, .badge-closed, .badge-archived { background: var(--surface-3); color: var(--ink-soft); }

.tag {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  border: 1px solid var(--rule-strong);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-soft);
  vertical-align: middle;
}

.pagination { display: flex; align-items: center; gap: var(--space-3); justify-content: flex-end; margin-top: var(--space-4); font-size: var(--step--1); }
.pagination-info { margin-right: auto; color: var(--ink-mute); }
.pagination-current { color: var(--ink-soft); }

.empty {
  text-align: center;
  padding: var(--space-7) var(--space-5);
  background: var(--surface);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-panel);
}
.empty h2 { font-size: var(--step-1); margin-bottom: var(--space-2); }
.empty p { margin: 0 auto var(--space-4); color: var(--ink-soft); }
.empty-left { text-align: left; }
.empty-left p { margin-left: 0; }

/* Schede */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: start; }
.split { display: grid; grid-template-columns: 1fr 340px; gap: var(--space-6); align-items: start; }
.panel .form { gap: var(--space-4); }

.person { display: flex; gap: var(--space-4); align-items: center; }
.avatar-lg { width: 56px; height: 56px; font-size: var(--step-1); }

.summary-compact { grid-template-columns: max-content 1fr; }
.summary-compact dt, .summary-compact dd { padding: var(--space-2) 0; font-size: var(--step-0); }
.summary-compact dd { font-weight: 500; }

.inline-action {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-4);
  padding: var(--space-3) 0;
}
.inline-action p { margin: 2px 0 0; }

.section { margin-top: var(--space-7); }
.section-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-4); }
.section-head h2 { font-size: var(--step-2); }
.subsection { font-size: var(--step-1); margin: var(--space-6) 0 var(--space-3); color: var(--ink-soft); }

.disclosure-boxed {
  margin-top: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
}

.row-disclosure { display: inline-block; text-align: left; }
.row-disclosure summary { cursor: pointer; font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); list-style: none; }
.row-disclosure summary::-webkit-details-marker { display: none; }
.row-disclosure summary::after { content: " ▾"; }
.row-disclosure[open] { display: block; margin-top: var(--space-3); }
.form-compact { display: grid; gap: var(--space-3); min-width: 240px; margin-top: var(--space-3); }

.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); }
.stat {
  display: grid; gap: var(--space-1);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
}
.stat-value { font-family: var(--font-display); font-size: var(--step-3); line-height: 1.1; }
.stat-value.stat-text { font-size: var(--step-1); font-family: var(--font-body); font-weight: 600; line-height: 1.4; }
.stat-label { color: var(--ink-mute); font-size: var(--step--1); }

.team-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.team-list li { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-4); flex-wrap: wrap; padding: var(--space-3) var(--space-5); border-bottom: 1px solid var(--rule); }
.team-list li:last-child { border-bottom: 0; }
.team-main { display: grid; }
.team-main small { color: var(--ink-mute); }

.credential-card {
  margin: var(--space-5) 0;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-panel);
}
.credential-card dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: var(--space-3) var(--space-5); align-items: center; }
.credential-card dt { color: var(--ink-mute); }
.credential-card dd { margin: 0; display: flex; gap: var(--space-2); align-items: center; flex-wrap: wrap; }
.credential { font-size: 1.25rem !important; letter-spacing: .08em; padding: 6px 12px !important; }

@media (max-width: 900px) {
  .two-col, .split { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .mainnav { overflow-x: auto; }
}

@media (max-width: 560px) {
  .page-head { flex-direction: column; }
  .filters { grid-template-columns: 1fr; }
  .credential-card dl { grid-template-columns: 1fr; }
}

/* Le tabelle scorrono dentro il loro contenitore, mai la pagina intera. */
.shell > main, .page, .two-col > *, .split > * { min-width: 0; }
.summary-compact dt { padding-right: var(--space-5); }
.shell { grid-template-columns: minmax(0, 1fr); }
.mainnav { min-width: 0; }
.mainnav a { white-space: nowrap; }

@media (max-width: 560px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
  .mainnav { grid-column: 1 / -1; grid-row: 2; overflow-x: auto; scrollbar-width: none; }
}
.table-wrap { position: relative; }

/* ===================== Push 004 · Competenze, import, impostazioni, registro ===================== */

.head-actions { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.narrow-wide { max-width: 860px; }
.nowrap { white-space: nowrap; }
.group-title { font-size: var(--step-1); margin: var(--space-5) 0 var(--space-3); color: var(--ink-soft); }
.group-title:first-child { margin-top: 0; }

/* Schede delle impostazioni */
.tabs {
  display: flex; gap: var(--space-1);
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--space-6);
  overflow-x: auto;
}
.tabs a {
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brass); }
.settings-body { max-width: 760px; }

.logo-current {
  display: inline-block;
  padding: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-field);
  margin-bottom: var(--space-2);
}
.logo-current img { display: block; max-height: 56px; max-width: 240px; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); margin-top: var(--space-3); }
.facts { margin: var(--space-3) 0 0; padding-left: 1.2em; color: var(--ink-soft); }
.facts li { margin-bottom: var(--space-2); }

/* Firmatari */
.signer-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; display: grid; gap: var(--space-3); }
.signer-list li {
  display: grid; grid-template-columns: 180px 1fr auto; gap: var(--space-4); align-items: center;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
}
.signature-preview {
  height: 72px;
  display: grid; place-items: center;
  border-bottom: 1px solid var(--ink-mute);
  background: repeating-linear-gradient(0deg, transparent 0 17px, var(--surface-3) 17px 18px);
}
.signature-preview img { max-height: 64px; max-width: 170px; }
.signer-meta { display: grid; gap: 2px; justify-items: start; }
.signer-meta small { color: var(--ink-mute); }
.signer-actions { display: flex; gap: var(--space-3); align-items: center; }
.signer-actions form { margin: 0; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { display: flex; justify-content: space-between; align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
.plain-list form { margin: 0; }

/* Livelli di competenza: intensità crescente dello stesso inchiostro */
.level {
  display: inline-grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  font: 700 var(--step--1)/1 var(--font-body);
  color: var(--ink);
  border: 1.5px solid var(--ink);
}
.level-1 { background: var(--surface); }
.level-2 { background: var(--surface-3); }
.level-3 { background: var(--rule-hover); color: var(--on-solid); border-color: var(--rule-hover); }
.level-4 { background: var(--solid); color: var(--on-solid); }
.level-none { color: var(--rule-strong); font-size: 1.25rem; }

.level-legend { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6); }
.level-legend li { display: flex; align-items: center; gap: var(--space-2); }
.level-legend small { color: var(--ink-mute); }

.matrix th[scope="row"] { font-weight: 600; text-align: left; white-space: nowrap; }
.matrix th[scope="row"] small { display: block; font-weight: 400; color: var(--ink-mute); font-size: var(--step--1); }
.matrix-col { text-align: center !important; white-space: normal !important; min-width: 96px; vertical-align: bottom; }
.matrix-col a { color: var(--ink); text-decoration: none; }
.matrix-col a:hover { text-decoration: underline; }
.matrix-cell { text-align: center; vertical-align: middle !important; }

.level-editor { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.level-editor li { padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--rule); }
.level-editor li:last-child { border-bottom: 0; }
.level-editor fieldset { border: 0; padding: 0; display: grid; grid-template-columns: minmax(200px, 1fr) auto; gap: var(--space-4); align-items: center; }
.level-editor legend { float: left; padding: 0; font-family: var(--font-body); font-size: var(--step-0); display: grid; }
.level-editor legend small { color: var(--ink-mute); font-weight: 400; }

.segmented { display: inline-flex; border: 1px solid var(--rule-strong); border-radius: var(--radius-field); overflow: hidden; background: var(--surface); }
.segment { position: relative; cursor: pointer; }
.segment input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segment span { display: block; padding: 8px 12px; font-size: var(--step--1); font-weight: 500; color: var(--ink-soft); border-left: 1px solid var(--rule); white-space: nowrap; }
.segment:first-child span { border-left: 0; }
.segment input:checked + span { background: var(--solid); color: var(--on-solid); }
.segment-0 input:checked + span { background: var(--surface-3); color: var(--ink); }
.segment input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -2px; }

/* Import */
.upload-box {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius-panel);
  display: grid; gap: var(--space-4);
}
.stat-row-3 { grid-template-columns: repeat(3, 1fr); margin-bottom: var(--space-5); }
.stat-alert { border-color: var(--warn); background: var(--warn-soft); }
.badge-neutral { background: var(--surface-3); color: var(--ink); }
.row-error td { background: var(--error-soft); }
.error-text { color: var(--error) !important; font-weight: 500; }

/* Registro */
.log-table td { font-size: var(--step--1); }
.log-table td strong { font-size: var(--step-0); }
.row-warning td:first-child { box-shadow: inset 3px 0 0 var(--warn); }
.payload {
  margin: var(--space-2) 0 0;
  max-width: 420px;
  max-height: 260px;
  overflow: auto;
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius-field);
  font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .signer-list li { grid-template-columns: 1fr; }
  .level-editor fieldset { grid-template-columns: 1fr; }
  .segmented { flex-wrap: wrap; }
  .stat-row-3 { grid-template-columns: 1fr; }
}

@media print {
  .tabs, .level-legend + .empty, .page-head button { display: none !important; }
  .matrix { font-size: 11px; }
}

/* Correzioni dalla verifica visiva del Push 004 */
.form, .field { grid-template-columns: minmax(0, 1fr); }
.field input, .field select, .field textarea { min-width: 0; }
.table tbody tr:last-child th { border-bottom: 0; }
.matrix tbody th[scope="row"] { color: var(--ink); font-size: var(--step-0); padding: 12px var(--space-4); border-bottom: 1px solid var(--rule); }

/* ------------------------------------------------------------------ Lezioni (Push 005) */
.badge-draft { background: var(--surface); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--rule-strong); text-decoration: none; }
.badge-review { background: var(--info-soft); color: var(--info); text-decoration: none; }
a.badge:hover { filter: brightness(0.97); color: inherit; }
.stat-link { text-decoration: none; color: inherit; }
.stat-link:hover { border-color: var(--ink-soft); color: inherit; }
.choice-group-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.optional { color: var(--ink-mute); font-weight: 400; font-family: var(--font-body); font-size: var(--step--1); }

.lesson-ident { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.lesson-ident code, .doc-card code, .table code { font-size: var(--step--1); color: var(--ink-soft); letter-spacing: 0.02em; }

.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; margin-top: var(--space-4); }
.lesson-summary { color: var(--ink-soft); }
.lesson-stage { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); overflow: hidden; }
.lesson-stage-page, .lesson-stage-external, .lesson-stage-classroom { padding: var(--space-6); }
.lesson-video { display: block; width: 100%; max-height: 70vh; background: #0b1422; }
.lesson-pdf { display: block; width: 100%; height: 72vh; min-height: 420px; border: 0; background: var(--surface-3); }
.lesson-pdf-fallback { margin: 0; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--rule); font-size: var(--step--1); max-width: none; }
.lesson-empty { display: grid; gap: 2px; place-items: center; text-align: center; padding: var(--space-7) var(--space-5); color: var(--ink-mute); }
.lesson-empty strong { color: var(--ink-soft); font-family: var(--font-display); font-size: var(--step-1); font-weight: 600; }
.lesson-stage-page .lesson-empty, .lesson-stage-external .lesson-empty { padding: var(--space-5) 0; }

.external-card { display: grid; gap: var(--space-3); justify-items: start; }
.external-card p { margin: 0; color: var(--ink-soft); }
.external-host { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; word-break: break-all; }

.prose { max-width: 70ch; font-size: 1rem; line-height: 1.7; }
.prose > :first-child { margin-top: 0; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin: 0 0 var(--space-4); }
.prose h2 { font-size: var(--step-2); margin: var(--space-6) 0 var(--space-3); }
.prose h3 { font-size: var(--step-1); margin: var(--space-5) 0 var(--space-2); }
.prose h4 { font-size: var(--step-0); margin: var(--space-4) 0 var(--space-2); font-family: var(--font-body); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 4px; }
.prose blockquote { padding: var(--space-3) var(--space-4); border-left: 3px solid var(--brass); background: var(--brass-soft); border-radius: 0 var(--radius-field) var(--radius-field) 0; }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { display: block; max-width: 100%; height: auto; margin: var(--space-4) 0; border-radius: var(--radius-field); border: 1px solid var(--rule); }
.prose pre { padding: var(--space-3); background: var(--surface-2); border-radius: var(--radius-field); overflow-x: auto; font-size: var(--step--1); }
.prose a { color: var(--info); }

.subhead { font-family: var(--font-body); font-size: var(--step--1); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); margin: var(--space-5) 0 var(--space-3); }

.file-list { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-2); }
.file-list li, .upload-current { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-field); }
.file-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; background: var(--paper); border: 1px solid var(--rule); font-size: 10px; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-soft); }
.file-icon-empty { border-style: dashed; color: var(--ink-mute); }
.file-meta { display: grid; min-width: 0; margin-right: auto; }
.file-meta a, .file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.file-meta small { color: var(--ink-mute); font-size: var(--step--1); }
.inline-form { margin: 0; }

.doc-card { position: sticky; top: var(--space-4); border-top: 3px solid var(--ink); }
.doc-card h2 { font-size: var(--step-1); margin-bottom: var(--space-3); }
.doc-card .summary { grid-template-columns: 1fr; gap: 0; margin: 0; }
.doc-card .summary dt { margin-top: var(--space-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-mute); font-weight: 600; }
.doc-card .summary dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.doc-card .summary dd small, .summary-compact dd small { display: block; color: var(--ink-mute); font-size: var(--step--1); font-weight: 400; }
.doc-card .subhead { margin-top: var(--space-5); }
.hash-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); font-size: var(--step--1); }
.hash-list a { font-weight: 600; overflow-wrap: anywhere; }
.hash-list small { display: block; color: var(--ink-mute); }
.tag-inline { display: inline-block !important; margin-top: 4px; padding: 1px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn) !important; font-weight: 600; }

.approval-panel { margin: var(--space-4) 0; padding: var(--space-5); background: var(--surface); border: 1px solid var(--info-line); border-left: 4px solid var(--info); border-radius: var(--radius-panel); }
.approval-head h2 { font-size: var(--step-1); margin-bottom: var(--space-2); }
.approval-head p { color: var(--ink-soft); margin-bottom: var(--space-4); }
.approval-panel .form { max-width: 640px; }
.approval-withdraw { margin-top: var(--space-3); }
.approval-withdraw button, button.link-quiet { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.row-current td { background: var(--surface-2); }
.row-current td:first-child { box-shadow: inset 3px 0 0 var(--ink); }

.readiness { display: flex; justify-content: space-between; align-items: center; gap: var(--space-5); margin: var(--space-4) 0 var(--space-5); padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px dashed var(--rule-strong); border-radius: var(--radius-panel); }
.readiness h2 { font-size: var(--step-1); margin-bottom: var(--space-2); }
.readiness p { margin: 0; color: var(--ink-soft); }
.readiness.is-ready { border-style: solid; border-color: var(--ok-line); background: var(--ok-soft); }
.readiness form { flex: none; }
.todo-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--ink-soft); }
.todo-list li { display: flex; gap: var(--space-2); align-items: baseline; }
.todo-list li::before { content: ""; flex: none; width: 10px; height: 10px; border: 1.5px solid var(--rule-strong); border-radius: 3px; transform: translateY(1px); }

.upload-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-4); align-items: end; }
.upload-form { display: flex; gap: var(--space-3); align-items: flex-end; flex-wrap: wrap; margin: 0; }
.upload-form .field { flex: 1 1 220px; margin: 0; }
.upload-form-inline { padding: var(--space-4); background: var(--surface); border: 1px dashed var(--rule-strong); border-radius: var(--radius-panel); }
.upload-form-inline .field:first-of-type { flex: 0 1 200px; }
.field input[type="text"]:not([name]) { width: 100%; }

.editor { border: 1px solid var(--rule-strong); border-radius: var(--radius-panel); background: var(--surface); overflow: hidden; }
.editor.has-error { border-color: var(--error); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 2px; padding: var(--space-2); border-bottom: 1px solid var(--rule); background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
.editor-toolbar button { min-height: 32px; padding: 0 10px; border: 1px solid transparent; border-radius: 6px; background: none; font: inherit; font-size: var(--step--1); color: var(--ink); cursor: pointer; }
.editor-toolbar button:hover { background: var(--surface); border-color: var(--rule); }
.editor-sep { width: 1px; margin: 4px 6px; background: var(--rule); }
.editor-link { display: flex; gap: var(--space-2); align-items: center; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--rule); background: var(--brass-soft); }
.editor-link input { flex: 1; min-width: 0; height: 34px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-field); font: inherit; }
.editor-area { min-height: 320px; max-width: none; padding: var(--space-5) var(--space-6); outline: none; }
.editor-area:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.editor-area img { outline-offset: 2px; }
.editor-source { display: block; width: 100%; border: 0; padding: var(--space-4); font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; resize: vertical; }
.editor-status { margin: 0; padding: 0 var(--space-4); font-size: var(--step--1); color: var(--ink-mute); min-height: 0; }
.editor-status:not(:empty) { padding: var(--space-2) var(--space-4); border-top: 1px solid var(--rule); }

.target-group { margin-bottom: var(--space-5); }
.target-group .check-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.field-align { align-self: center; }
.sticky-actions { position: sticky; bottom: 0; z-index: 2; margin: 0 calc(-1 * var(--space-4)); padding: var(--space-3) var(--space-4); background: var(--glass-strong); backdrop-filter: blur(12px); border-top: 1px solid var(--rule); }

.danger-zone summary { color: var(--error); }
.danger-zone .form { margin-top: var(--space-3); }

@media (max-width: 960px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .doc-card { position: static; }
}
@media (max-width: 720px) {
  .choice-group-2, .upload-row { grid-template-columns: minmax(0, 1fr); }
  .readiness { flex-direction: column; align-items: stretch; }
  .lesson-stage-page, .lesson-stage-external, .lesson-stage-classroom { padding: var(--space-4); }
  .editor-area { padding: var(--space-4); }
  .lesson-pdf { height: 60vh; min-height: 320px; }
  .sticky-actions { position: static; margin: 0; padding: var(--space-3) 0 0; background: none; backdrop-filter: none; flex-direction: column; align-items: stretch; }
}
.doc-card .summary dt, .doc-card .summary dd { border: 0; padding: 0; }
.doc-card .summary dd { padding-bottom: var(--space-3); border-bottom: 1px solid var(--rule); }
.doc-card .summary dd:last-of-type { border-bottom: 0; padding-bottom: 0; }
.doc-card .summary { border-top: 0; }
.doc-card .summary dd { font-weight: 500; }

/* ------------------------------------------------------------------ Percorsi e formazione (Push 006) */
.path-steps { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-2); counter-reset: step; }
.path-steps li { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.path-steps li.is-warning { border-color: var(--error-line); background: var(--error-soft); }
.step-no { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1.5px solid var(--rule-strong); font-weight: 700; font-size: var(--step--1); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.step-main { display: grid; min-width: 0; margin-right: auto; }
.step-main small { color: var(--ink-mute); font-size: var(--step--1); }
.step-actions { display: flex; align-items: center; gap: var(--space-2); }
.step-actions form { margin: 0; }
.icon-btn { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--rule-strong); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; }
.icon-btn:hover { border-color: var(--ink-soft); }
.path-steps-learner li.is-done .step-no { background: var(--gold); border-color: var(--gold); color: #2b1d00; }
.path-steps-learner li.is-in_progress .step-no, .path-steps-learner li.is-open .step-no { border-color: var(--ink); color: var(--ink); }
.path-steps-learner li.is-in_progress { box-shadow: inset 3px 0 0 var(--ink); }
.path-steps-learner li.is-locked { background: transparent; border-style: dashed; color: var(--ink-mute); }
.path-steps-learner li.is-locked strong { color: var(--ink-soft); font-weight: 500; }
.path-steps-learner li.is-skipped { opacity: 0.6; }
.rule-form { margin-top: var(--space-5); padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px dashed var(--rule-strong); border-radius: var(--radius-panel); }
.rule-form .subhead { margin-top: 0; }

.progress { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 999px; background: var(--surface-3); overflow: hidden; color: var(--accent); }
.progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
.progress::-webkit-progress-value { background: var(--brass); border-radius: 999px; }
.progress::-moz-progress-bar { background: var(--brass); border-radius: 999px; }
.path-progress { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-4) 0 var(--space-5); max-width: 560px; }
.path-progress span { flex: none; color: var(--ink-soft); font-size: var(--step--1); }

.stat-focus { border-color: var(--ink); }
.course-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.course-card { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--ink); border-radius: var(--radius-panel); }
.course-card.is-optional { border-top-color: var(--rule-strong); }
.course-card.is-overdue { border-top-color: var(--error); }
.course-card h3 { font-size: var(--step-1); }
.course-card h3 a { text-decoration: none; }
.course-card h3 a:hover { text-decoration: underline; }
.course-tags { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.course-meta, .course-due, .course-note { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.course-note { color: var(--ink-mute); font-style: italic; }
.course-card .btn { margin-top: auto; }

.learn-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; }
.learn-side { position: sticky; top: var(--space-4); border-top: 3px solid var(--ink); }
.learn-side h2 { font-size: var(--step-1); margin-bottom: var(--space-3); }
.criteria { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-2); font-size: var(--step--1); color: var(--ink-soft); }
.criteria li { display: grid; grid-template-columns: 18px 1fr; gap: var(--space-2); align-items: start; }
.criteria li::before { content: ""; width: 14px; height: 14px; margin-top: 2px; border: 1.5px solid var(--rule-strong); border-radius: 50%; }
.criteria li.met { color: var(--ink); }
.criteria li.met::before { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='white' stroke-width='2'/%3E%3C/svg%3E") center/12px no-repeat; }
.ack-form { gap: var(--space-3); }
.ack-check { padding: var(--space-3); border: 1px solid var(--rule); border-radius: var(--radius-field); background: var(--paper); font-size: var(--step--1) !important; line-height: 1.5; }
.ack-check:has(input:disabled) { opacity: 0.6; cursor: not-allowed; }
.ack-check.has-error { border-color: var(--error); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }
.ack-seal { margin-bottom: var(--space-4); padding: var(--space-4); border: 1px solid var(--gold-line); border-radius: var(--radius-field); background: var(--gold-soft); }
.ack-seal p { margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: var(--step-0); line-height: 1.45; }
.ack-seal small { color: var(--ink-mute); }
.player-note { margin: 0; padding: var(--space-2) var(--space-4); font-size: var(--step--1); color: var(--warn); background: var(--warn-soft); }
.completion-seal { border-left-color: var(--brass); }

.pdf-viewer { background: var(--surface-3); }
.pdf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-2) var(--space-4); background: var(--surface); border-bottom: 1px solid var(--rule); font-size: var(--step--1); color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.pdf-pages { height: 72vh; min-height: 420px; overflow-y: auto; padding: var(--space-4); display: grid; gap: var(--space-4); align-content: start; outline: none; }
.pdf-pages:focus-visible { box-shadow: inset 0 0 0 2px var(--focus); }
.pdf-page { width: 100%; max-width: 900px; margin: 0 auto; background: var(--doc); box-shadow: 0 1px 3px rgba(22, 38, 61, 0.15); }
.pdf-page canvas { display: block; width: 100%; height: auto; }

.training-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); margin-bottom: var(--space-5); padding: var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--brass); border-radius: var(--radius-panel); }
.training-card.is-overdue { border-left-color: var(--error); }
.training-card h2 { font-size: var(--step-1); margin-bottom: var(--space-2); }
.training-card p { margin: 0; color: var(--ink-soft); }
.training-card .btn { flex: none; }

@media (max-width: 960px) {
  .learn-layout { grid-template-columns: minmax(0, 1fr); }
  .learn-side { position: static; }
}
@media (max-width: 720px) {
  .path-steps li { flex-wrap: wrap; }
  .step-actions { width: 100%; justify-content: flex-end; }
  .training-card { flex-direction: column; align-items: stretch; }
  .pdf-pages { height: 65vh; padding: var(--space-2); }
}

/* Navigazione: voce "Organizzazione" con sottosezioni, account nel menu utente */
.account-link { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: inherit; padding: 4px 8px 4px 4px; border-radius: 999px; }
.account-link:hover { background: var(--paper); color: inherit; }
.account-link.is-current { box-shadow: inset 0 0 0 1px var(--rule-strong); }
.subnav { background: var(--surface); border-bottom: 1px solid var(--rule); }
.subnav-inner { display: flex; gap: var(--space-1); max-width: 1180px; margin: 0 auto; padding: 0 clamp(var(--space-4), 4vw, var(--space-7)); overflow-x: auto; scrollbar-width: none; }
.subnav a { padding: var(--space-3) var(--space-3); font-size: var(--step--1); font-weight: 500; color: var(--ink-soft); text-decoration: none; white-space: nowrap; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.topbar .identity, .usermenu { flex: none; }
.mainnav { flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
@media (max-width: 1440px) {
  .who { display: none; }
}
@media (max-width: 1365px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; height: auto; padding-top: var(--space-3); padding-bottom: 0; row-gap: var(--space-2); }
  .mainnav { grid-column: 1 / -1; grid-row: 2; margin: 0 calc(-1 * var(--space-3)); }
  .mainnav a { padding-top: var(--space-2); padding-bottom: var(--space-3); }
}
.criteria li.is-ready { color: var(--ink); font-weight: 600; }
.criteria li.is-ready::before { border-color: var(--ink); border-width: 2px; }
#piano .stat-row, .section > .stat-row { margin-bottom: var(--space-4); }
.player-note { max-width: none; }
.ack-form .hint, .hint { font-size: var(--step--1); color: var(--ink-mute); }
.ack-form .hint { margin: 0; }

/* ------------------------------------------------------------------ Test (Push 007) */
.test-card { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); margin: var(--space-5) 0; padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: var(--radius-panel); }
.test-card h2 { font-size: var(--step-1); margin-bottom: var(--space-2); }
.test-card p { margin: 0; color: var(--ink-soft); }
.test-card .btn, .test-card form { flex: none; }

.q-preview { margin-bottom: var(--space-3); padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.q-head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.q-no { flex: none; display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--paper); border: 1px solid var(--rule); font-size: var(--step--1); font-weight: 700; font-variant-numeric: tabular-nums; }
.q-meta { color: var(--ink-mute); font-size: var(--step--1); }
.q-score { margin-left: auto; font-size: var(--step--1); font-weight: 600; }
.q-prompt { font-weight: 600; margin: 0 0 var(--space-3); max-width: none; }
legend.q-prompt { float: left; width: 100%; padding: 0; font-family: var(--font-body); font-size: var(--step-1); line-height: 1.45; }
legend.q-prompt + * { clear: both; }
.q-image { display: block; max-width: 100%; max-height: 420px; margin: 0 0 var(--space-3); border: 1px solid var(--rule); border-radius: var(--radius-field); }
.q-thumb { max-height: 48px; vertical-align: middle; border-radius: 4px; border: 1px solid var(--rule); }
.q-options { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
ul.q-options { list-style: none; padding: 0; }
ul.q-options li { padding: 4px 10px; border-radius: 6px; border: 1px solid transparent; }
ul.q-options li.is-correct { border-color: var(--ok-line); background: var(--ok-soft); color: var(--ok); font-weight: 600; }
ul.q-options li.is-correct::before { content: "✓ "; }
ol.q-options li.is-correct { color: var(--ok); }
.q-key, .q-explanation { margin: var(--space-2) 0 0; font-size: var(--step--1); color: var(--ink-soft); max-width: none; }
.q-explanation { padding: var(--space-2) var(--space-3); background: var(--brass-soft); border-radius: var(--radius-field); }
.tag-danger { border-color: var(--error-line); color: var(--error); }
.q-row { position: relative; }
.q-row .q-preview { padding-right: 180px; }
.q-actions { position: absolute; top: var(--space-4); right: var(--space-5); display: flex; align-items: center; gap: var(--space-3); }
.q-actions form { margin: 0; }
.q-answer { border-left: 4px solid var(--rule-strong); }
.q-answer.is-ok { border-left-color: var(--ok); }
.q-answer.is-ko { border-left-color: var(--error); }
.q-answer.is-pending { border-left-color: var(--info); background: var(--surface-2); }
.q-given { display: grid; grid-template-columns: 100px 1fr; gap: 4px var(--space-4); margin: 0; font-size: var(--step--1); }
.q-given dt { color: var(--ink-mute); }
.q-given dd { margin: 0; }
.open-answer { display: block; padding: var(--space-3); background: var(--paper); border-radius: var(--radius-field); font-size: var(--step-0); white-space: pre-wrap; }
.grade-box { margin-top: var(--space-3); padding-top: var(--space-3); border-top: 1px dashed var(--rule-strong); }
.check-stack { display: grid; gap: var(--space-2); align-content: start; }
.inline-choices { display: flex; gap: var(--space-5); }
.grant-form { display: flex; gap: var(--space-2); align-items: center; }
.grant-form input { min-width: 0; flex: 1; height: 34px; padding: 0 10px; border: 1px solid var(--rule-strong); border-radius: var(--radius-field); font: inherit; font-size: var(--step--1); }

.test-facts { margin-bottom: var(--space-5); }
.disclaimer { margin-bottom: var(--space-4); padding: var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--warn); border-radius: var(--radius-panel); }
.disclaimer h2 { font-size: var(--step-1); margin-bottom: var(--space-3); }
.disclaimer p { line-height: 1.65; max-width: none; }
.disclaimer small { color: var(--ink-mute); }

.test-player { position: relative; -webkit-user-select: none; user-select: none; }
.test-player input, .test-player textarea { -webkit-user-select: text; user-select: text; }
.player-bar { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin: calc(-1 * var(--space-5)) 0 var(--space-4); padding: var(--space-3) 0; background: rgba(243, 245, 248, 0.95); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); }
.player-bar small { display: block; color: var(--ink-mute); font-size: var(--step--1); }
.timer { font: 600 var(--step-2)/1 var(--font-body); font-variant-numeric: tabular-nums; padding: var(--space-2) var(--space-3); border: 1px solid var(--rule-strong); border-radius: var(--radius-field); background: var(--surface); }
.timer.is-low { color: var(--error); border-color: var(--error); background: var(--error-soft); }
.watermark { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; gap: 80px 120px; padding: 60px; transform: rotate(-12deg); opacity: 0.06; font-weight: 700; font-size: 18px; color: var(--ink); white-space: nowrap; }
.test-player > *:not(.watermark) { position: relative; z-index: 1; }
.question-screen { margin-top: var(--space-4); padding: var(--space-5) var(--space-6); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.question-screen > .q-no { margin-bottom: var(--space-3); }
.answer { border: 0; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.option { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border: 1px solid var(--rule-strong); border-radius: var(--radius-field); background: var(--surface); cursor: pointer; }
.option:hover { border-color: var(--ink-soft); }
.option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); background: var(--accent-soft); }
.option input { margin-top: 3px; accent-color: var(--accent); }
.option-row { display: flex; gap: var(--space-3); }
.option-row .option { flex: 1; }
.match-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
.order-row { grid-template-columns: 90px minmax(0, 1fr); }
.match-row select, .answer-text { width: 100%; min-height: 42px; padding: 8px 12px; border: 1px solid var(--rule-strong); border-radius: var(--radius-field); font: inherit; background: var(--surface); }
textarea.answer-text { min-height: 160px; resize: vertical; line-height: 1.5; }
.summary-grid { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.summary-grid a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--rule-strong); text-decoration: none; font-weight: 600; }
.summary-grid a.is-done { background: var(--solid); color: var(--on-solid); border-color: var(--solid); }
.summary-grid a.is-blank { border-style: dashed; color: var(--ink-mute); }

.result-card { margin-bottom: var(--space-5); padding: var(--space-6); background: var(--surface); border: 1px solid var(--rule); border-top: 4px solid var(--ink-soft); border-radius: var(--radius-panel); text-align: center; }
.result-card.is-passed { border-top-color: var(--brass); }
.result-card.is-failed { border-top-color: var(--error); }
.result-card.is-grading { border-top-color: var(--info); }
.result-card p { margin-left: auto; margin-right: auto; }
.result-label { display: inline-block; margin-bottom: var(--space-3); padding: 2px 12px; border-radius: 999px; font-size: var(--step--1); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; background: var(--paper); }
.is-passed .result-label { background: var(--gold-soft); color: var(--gold-ink); }
.is-failed .result-label { background: var(--error-soft); color: var(--error); }
.result-score { font: 600 3rem/1 var(--font-display); margin: var(--space-4) auto; }
.result-score small { display: block; margin-top: var(--space-2); font: 400 var(--step--1) var(--font-body); color: var(--ink-mute); }
.path-steps-learner li.is-test .step-no { border-color: var(--info); color: var(--info); }
.path-steps-learner li.is-test { box-shadow: inset 3px 0 0 var(--info); }
.final-test .step-no { font-size: 14px; }

@media (max-width: 720px) {
  .test-card { flex-direction: column; align-items: stretch; }
  .q-row .q-preview { padding-right: var(--space-5); padding-bottom: 56px; }
  .q-actions { top: auto; bottom: var(--space-3); right: var(--space-5); }
  .question-screen { padding: var(--space-4); }
  .match-row { grid-template-columns: minmax(0, 1fr); }
  .order-row { grid-template-columns: 80px minmax(0, 1fr); }
  .q-given { grid-template-columns: minmax(0, 1fr); }
  .grant-form { flex-direction: column; align-items: stretch; }
  .player-bar { margin-top: calc(-1 * var(--space-4)); }
}
.test-player { overflow: clip; }
.subnav a:first-child { padding-left: 0; }

/* Protocollo anti-AI */
.badge-warn { background: var(--warn-soft); color: var(--warn); text-decoration: none; }
.result-card.is-review { border-top-color: var(--warn); }
.is-review .result-label { background: var(--warn-soft); color: var(--warn); }
.result-card.is-invalidated { border-top-color: var(--ink-mute); }
.integrity-panel { padding: var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.integrity-panel .section-head { margin-bottom: var(--space-3); }
.risk { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); }
.risk p { margin: 0; }
.risk-value { font: 600 1.75rem/1 var(--font-display); }
.risk-meter { width: 180px; height: 12px; }
.risk-flags { list-style: none; margin: 0 0 var(--space-4); padding: 0; display: grid; gap: var(--space-2); }
.risk-flags li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: var(--space-3); align-items: start; padding: var(--space-2) var(--space-3); border: 1px solid var(--rule); border-radius: var(--radius-field); background: var(--paper); }
.risk-flags small { display: block; color: var(--ink-soft); }
.risk-weight { font-weight: 700; color: var(--warn); font-variant-numeric: tabular-nums; }
.event-log { margin-bottom: var(--space-4); }
.event-log summary, .weights summary, .q-variants summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.event-log ol { margin: var(--space-3) 0 0; padding-left: var(--space-5); max-height: 320px; overflow: auto; font-size: var(--step--1); }
.event-log time { color: var(--ink-mute); font-variant-numeric: tabular-nums; }
.decision { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border-left: 4px solid var(--ink-soft); background: var(--paper); border-radius: var(--radius-field); }
.decision.is-valid { border-left-color: var(--ok); }
.decision.is-invalid { border-left-color: var(--error); }
.decision p { margin: 0 0 var(--space-2); max-width: none; }
.decision-note { margin: var(--space-2) 0; padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-field); white-space: normal; }
.review-form { margin-top: var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--rule); }
.review-form .inline-choices { flex-wrap: wrap; }
.contest { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--rule); }
.contest h3 { font-size: var(--step-0); margin-bottom: var(--space-1); }
.integrity-outcome .contest-form { margin-top: var(--space-4); }
.protocol-state { margin-bottom: var(--space-5); }
.weights { margin-top: var(--space-3); }
.weights .facts { margin-top: var(--space-3); }
.q-variants { margin-top: var(--space-2); font-size: var(--step--1); }
.q-variants ul { margin: var(--space-2) 0 0; padding-left: var(--space-5); }
@media (max-width: 720px) {
  .risk { flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .risk-meter { width: 100%; }
}

/* Esito: azioni finali separate dal modulo di contestazione */
.result-next { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--rule); }
.result-next p { margin: 0; flex: 1 1 260px; }

/* ---------- Efficacia della formazione ---------- */

.badge-eff.eff-1, .eff-score.score-1 { background: var(--error-soft); color: var(--error); }
.badge-eff.eff-2, .eff-score.score-2 { background: var(--warn-soft); color: var(--warn); }
.badge-eff.eff-3, .eff-score.score-3,
.badge-eff.eff-4, .eff-score.score-4 { background: var(--ok-soft); color: var(--ok); }
.table td .badge-eff ~ small { display: block; }

.eff-layout { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.eff-main { display: grid; gap: var(--space-5); min-width: 0; }
.eff-context { padding: var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.eff-context h2 { font-size: var(--step-1); margin: 0 0 var(--space-4); }
.eff-context h3 { font-family: var(--font-body); font-size: var(--step--1); font-weight: 600; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .04em; margin: var(--space-5) 0 var(--space-2); }

.facts-list { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-4); margin: 0; font-size: var(--step--1); }
.facts-list dt { color: var(--ink-mute); }
.facts-list dd { margin: 0; overflow-wrap: anywhere; }
.eff-context .facts-list { grid-template-columns: 1fr; gap: 2px; }
.eff-context .facts-list dd { margin-bottom: var(--space-3); }
.eff-outcome .facts-list { font-size: var(--step-0); margin-top: var(--space-4); }

.eff-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); font-size: var(--step--1); }
.eff-steps li { display: grid; gap: 1px; padding: var(--space-2) var(--space-3); border-left: 3px solid var(--rule); }
.eff-steps li small { color: var(--ink-mute); }
.eff-steps li.is-done { border-left-color: var(--ok); }
.eff-steps li.is-cancelled { border-left-color: var(--rule-strong); color: var(--ink-mute); }
.eff-steps li.is-current { background: var(--paper); border-left-color: var(--brass); font-weight: 600; }

.eff-score { display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; font-weight: 700; flex: none; }
.eff-score-line { display: flex; align-items: flex-start; gap: var(--space-3); margin: 0; }
.eff-score-line p { margin: 0; }
.eff-score-line small { display: block; color: var(--ink-soft); font-size: var(--step-0); }
.eff-outcome .notice { margin-top: var(--space-4); }

.score-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.score-choice { position: relative; display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius-field); background: var(--surface); cursor: pointer; font-weight: 400; }
.score-choice input { position: absolute; opacity: 0; pointer-events: none; }
.score-choice small { display: block; color: var(--ink-soft); margin-top: 2px; }
.score-choice:hover { border-color: var(--rule-strong); }
.score-choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); background: var(--accent-soft); }
.score-choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.eff-cancel summary { cursor: pointer; font-weight: 600; color: var(--ink-soft); }
.eff-cancel[open] summary { margin-bottom: var(--space-4); }

.eff-table td.num, .eff-table th.num { white-space: nowrap; }
.eff-bar { display: inline-block; vertical-align: middle; width: 64px; height: 6px; margin-left: var(--space-2); }

@media (max-width: 900px) {
  .eff-layout { grid-template-columns: 1fr; }
  .eff-context { order: 2; }
}
@media (max-width: 560px) {
  .score-choices { grid-template-columns: 1fr; }
}

/* ---------- Attestati: miniature e anteprima ---------- */

.sheet-fit { position: relative; display: block; width: 100%; aspect-ratio: 297 / 210; overflow: hidden; background: var(--doc); border: 1px solid var(--rule); border-radius: 4px; }
.sheet-fit iframe { position: absolute; top: 0; left: 0; width: 1123px; height: 794px; border: 0; transform-origin: 0 0; transform: scale(.2); pointer-events: none; }

.tpl-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-3); margin-top: var(--space-2); }
.tpl-card { position: relative; display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-2); border: 1px solid var(--rule); border-radius: var(--radius-field); background: var(--surface); cursor: pointer; font-weight: 400; }
.tpl-card input { position: absolute; opacity: 0; pointer-events: none; }
.tpl-card:hover { border-color: var(--rule-strong); }
.tpl-card:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); background: var(--accent-soft); }
.tpl-card:has(input:checked) .tpl-card-text strong::after { content: " ✓"; color: var(--ok); }
.tpl-card:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.tpl-card-text { display: flex; flex-direction: column; gap: 2px; padding: 0 var(--space-1) var(--space-1); }
.tpl-card-text small { color: var(--ink-soft); font-size: var(--step--1); line-height: 1.4; }
.tpl-empty { display: flex; align-items: center; justify-content: center; aspect-ratio: 297 / 210; border: 1px dashed var(--rule-strong); border-radius: 4px; color: var(--ink-mute); font-size: var(--step--1); background: var(--paper); }

.tpl-tabs { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.tpl-tab { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-4); border: 1px solid var(--rule); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: var(--step--1); }
.tpl-tab:hover { border-color: var(--rule-strong); }
.tpl-tab.is-active { background: var(--solid); border-color: var(--solid); color: var(--on-solid); }
.tpl-tab.is-active .badge { background: var(--surface); }

.tpl-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--space-5); align-items: start; }
.tpl-stage { padding: var(--space-4); background: var(--surface-3); border-radius: var(--radius-panel); }
.tpl-stage .sheet-fit { border: 0; border-radius: 0; box-shadow: 0 2px 18px rgba(22, 38, 61, .18); }
.tpl-side { display: grid; gap: var(--space-3); }
.tpl-side h2 { margin-bottom: 0; }
.tpl-side h3 { font-family: var(--font-body); font-size: var(--step--1); font-weight: 600; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .04em; margin: var(--space-2) 0 0; }
.tpl-side p { margin: 0; }
.btn-block { width: 100%; justify-content: center; }
.tpl-chosen { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }
.tpl-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); font-size: var(--step--1); }
.tpl-checks li { display: grid; gap: 1px; padding-left: 22px; position: relative; }
.tpl-checks li::before { position: absolute; left: 0; top: 0; font-weight: 700; }
.tpl-checks li.is-ok::before { content: "✓"; color: var(--ok); }
.tpl-checks li.is-warn::before { content: "!"; color: var(--warn); }
.tpl-checks small { color: var(--ink-mute); }
.tpl-none { margin-top: var(--space-2); }
.tpl-back { font-size: var(--step--1); }

@media (max-width: 960px) {
  .tpl-layout { grid-template-columns: 1fr; }
  .tpl-stage { padding: var(--space-2); }
}

/* ---------- Attestati emessi e verifica pubblica ---------- */
.cert-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em; }
code.hash { font-size: 11px; overflow-wrap: anywhere; word-break: break-all; }
.cert-revoke summary { cursor: pointer; font-weight: 600; color: var(--error); }
.cert-revoke[open] summary { margin-bottom: var(--space-4); }
.cert-reissue { display: grid; gap: var(--space-3); margin-top: var(--space-5); }
.cert-reissue p { margin: 0; }
.cert-revoke { margin-top: var(--space-5); }

.verify-result { margin: var(--space-4) 0; padding: var(--space-4) var(--space-5); border-radius: var(--radius-panel); border: 1px solid var(--rule); }
.verify-result p { margin: 0; }
.verify-state { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; }
.verify-why { margin-top: var(--space-2) !important; color: var(--ink-soft); }
.verify-result.is-valid { background: var(--ok-soft); border-color: var(--ok); }
.verify-result.is-valid .verify-state { color: var(--ok); }
.verify-result.is-expired { background: var(--warn-soft); border-color: var(--warn); }
.verify-result.is-expired .verify-state { color: var(--warn); }
.verify-result.is-revoked, .verify-result.is-altered { background: var(--error-soft); border-color: var(--error); }
.verify-result.is-revoked .verify-state, .verify-result.is-altered .verify-state { color: var(--error); }
.verify-data { margin-bottom: var(--space-4); }
.filters-end { margin-left: auto; }

/* Impostazioni › Attestati */
.level-choices { display: grid; gap: var(--space-3); margin-top: var(--space-3); }
.level-choice { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-3) var(--space-4); border: 1px solid var(--rule); border-radius: var(--radius-field); background: var(--surface); cursor: pointer; font-weight: 400; }
.level-choice input { margin-top: 3px; }
.level-choice small { display: block; color: var(--ink-soft); margin-top: 2px; }
.level-choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 4px var(--accent-soft); background: var(--accent-soft); }
.level-choice.is-disabled { cursor: not-allowed; opacity: .7; }
.signing-cert { margin-top: var(--space-6); display: grid; gap: var(--space-4); }
.signing-cert h2 { margin-bottom: 0; }
.cert-replace { font-family: var(--font-body); font-size: var(--step--1); font-weight: 600; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .04em; margin: var(--space-2) 0 0; }
.level-choices + .error, .level-choices ~ .hint { margin-top: var(--space-3); }

/* ---------------------------------------------------------------- Calendario e registro presenze */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 320px); gap: var(--space-5); align-items: start; }
.cal-month { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); padding: var(--space-4); }
.cal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--space-3); }
.cal-head h2 { margin: 0; font-family: var(--font-display); font-size: var(--step-2); }
.cal-nav { display: flex; gap: var(--space-2); }
.cal-grid { border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays span { padding: var(--space-1) var(--space-2); font-size: var(--step--1); font-weight: 600; color: var(--ink-mute); text-transform: uppercase; letter-spacing: .04em; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); background: var(--paper); }
.cal-day { position: relative; min-height: 96px; padding: var(--space-1); border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); display: flex; flex-direction: column; gap: 3px; }
.cal-day.is-out { background: var(--surface-2); }
.cal-day.is-out .cal-num { color: var(--ink-mute); opacity: .7; }
.cal-num { font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); padding: 0 2px; }
.cal-day.is-today .cal-num { background: var(--solid); color: var(--on-solid); border-radius: 999px; min-width: 22px; text-align: center; align-self: flex-start; }
.cal-event { display: flex; gap: 4px; align-items: baseline; padding: 2px 5px; border-radius: 4px; font-size: 0.75rem; line-height: 1.3; text-decoration: none; color: var(--ink); background: var(--info-soft); border-left: 3px solid var(--info); overflow: hidden; }
.cal-event.mode-online { background: var(--brass-soft); border-left-color: var(--brass); }
.cal-event.is-mine { box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.cal-event.is-closed { background: var(--surface-3); border-left-color: var(--rule-strong); color: var(--ink-soft); }
.cal-event.is-cancelled { background: transparent; border-left-color: var(--rule); color: var(--ink-mute); text-decoration: line-through; }
.cal-event:hover, .cal-event:focus-visible { filter: brightness(.96); }
.cal-time { font-variant-numeric: tabular-nums; flex: none; }
.cal-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-add { position: absolute; top: 2px; right: 4px; width: 20px; height: 20px; line-height: 18px; text-align: center; border-radius: 999px; color: var(--ink-mute); text-decoration: none; opacity: 0; }
.cal-day:hover .cal-add, .cal-add:focus-visible { opacity: 1; background: var(--paper); }
.cal-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); align-items: center; margin: var(--space-3) 0 0; font-size: var(--step--1); color: var(--ink-soft); }
.cal-key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: -8px; background: var(--info-soft); border-left: 3px solid var(--info); vertical-align: -1px; }
.cal-key.mode-online { background: var(--brass-soft); border-left-color: var(--brass); }
.cal-key.is-mine { background: transparent; box-shadow: inset 0 0 0 1px var(--ink); border-left: 0; }
.cal-key.is-closed { background: var(--surface-3); border-left-color: var(--rule-strong); }
.cal-side { display: flex; flex-direction: column; gap: var(--space-4); }
.cal-side .panel h2 { font-size: var(--step-1); margin: 0 0 var(--space-3); }
.session-list { list-style: none; margin: 0; padding: 0; }
.session-list li { display: flex; flex-direction: column; gap: 1px; padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
.session-list li:last-child { border-bottom: 0; }
.session-list a { text-decoration: none; color: var(--ink); }
.session-list a:hover strong { text-decoration: underline; }
.session-list small { font-size: var(--step--1); color: var(--ink-soft); }
.session-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-5); align-items: start; margin-bottom: var(--space-5); }
.session-layout .panel h2 { font-size: var(--step-1); margin: 0 0 var(--space-3); }
.session-layout .panel form + form, .session-layout .panel p + form { margin-top: var(--space-3); }
.mono-small { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; word-break: break-all; }
.section-head .count { font-family: var(--font-body); font-size: var(--step-0); font-weight: 500; color: var(--ink-mute); margin-left: var(--space-2); }
.enroll-panel, .eff-cancel { margin-top: var(--space-4); }
.enroll-panel summary, .close-panel h2 { font-weight: 600; }
.pick-list { max-height: 320px; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--space-2) var(--space-4); padding: var(--space-3); border: 1px solid var(--rule); border-radius: var(--radius-field); margin: var(--space-3) 0; }
.pick-list.has-error { border-color: var(--error); }

.sig-pad { max-width: 600px; }
.sig-pad canvas { display: block; width: 100%; height: auto; aspect-ratio: 3 / 1; background: var(--doc); border: 1px dashed var(--rule-strong); border-radius: var(--radius-field); touch-action: none; cursor: crosshair; background-image: linear-gradient(transparent calc(75% - 1px), var(--rule) calc(75% - 1px), var(--rule) 75%, transparent 75%); }
.sig-pad.is-signed canvas { border-style: solid; border-color: var(--ink-soft); }
.sig-pad.has-error canvas { border-color: var(--error); }
.sig-foot { display: flex; justify-content: space-between; align-items: center; margin-top: var(--space-1); font-size: var(--step--1); color: var(--ink-mute); }
.sig-view { display: block; width: 150px; height: 50px; }
.sig-cell { min-width: 180px; }
.sig-cell small { display: block; color: var(--ink-mute); }
.sig-cell .btn { margin-top: var(--space-1); }
.sig-dialog { width: min(680px, calc(100vw - 32px)); border: 0; border-radius: var(--radius-panel); padding: var(--space-5); box-shadow: 0 20px 60px rgba(22, 38, 61, .3); }
.sig-dialog::backdrop { background: rgba(22, 38, 61, .45); }
.sig-dialog h2 { margin: 0 0 var(--space-2); font-size: var(--step-1); }
.register-table td { vertical-align: middle; }
.register-table tr.has-error td { background: var(--error-soft); }
.attendance-choices { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; border: 0; padding: 0; margin: 0; }
.att-choice { position: relative; }
.att-choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.att-choice span { display: inline-block; padding: 4px 10px; border: 1px solid var(--rule-strong); border-radius: 999px; font-size: var(--step--1); background: var(--surface); }
.att-choice input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }
.att-present input:checked + span { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); font-weight: 600; }
.att-partial input:checked + span { background: var(--warn-soft); border-color: var(--warn); color: var(--warn); font-weight: 600; }
.att-absent input:checked + span { background: var(--error-soft); border-color: var(--error); color: var(--error); font-weight: 600; }
.att-minutes { display: inline-flex; gap: var(--space-1); align-items: center; font-size: var(--step--1); color: var(--ink-soft); }
.att-minutes input { width: 72px; padding: 3px 6px; }
.close-panel { margin-top: var(--space-5); }
.close-panel h2 { font-size: var(--step-1); margin: 0 0 var(--space-3); }
.classroom-sessions { list-style: none; margin: var(--space-3) 0 0; padding: 0; }
.classroom-sessions li { display: flex; justify-content: space-between; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--rule); }
.classroom-sessions li form { margin: 0; }
.classroom-sessions small { display: block; color: var(--ink-soft); }

@media (max-width: 1100px) {
  .cal-layout { grid-template-columns: 1fr; }
  .cal-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 900px) {
  .session-layout { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .cal-day { min-height: 64px; }
  .cal-title { display: none; }
  .cal-event { justify-content: center; padding: 2px; }
  .cal-weekdays span { padding: var(--space-1); text-align: center; }
  .classroom-sessions li { flex-direction: column; align-items: flex-start; }
}
.stat-row + .form .table-wrap { margin-top: var(--space-5); }
@media (max-width: 720px) {
  .cal-event { font-size: 0.625rem; padding: 1px; border-left-width: 2px; }
  .cal-time { overflow: hidden; }
}
.classroom-program { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--rule); }

/* ---------------------------------------------------------------- Notifiche */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; color: var(--ink-soft); text-decoration: none; }
.bell:hover, .bell.is-current { background: var(--paper); color: var(--ink); }
.bell-count { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--error); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; box-shadow: 0 0 0 2px var(--surface); }
.count-pill { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--solid); color: var(--on-solid); font-size: 11px; line-height: 18px; text-align: center; }
.notif-list { list-style: none; margin: var(--space-4) 0 0; padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); overflow: hidden; }
.notif-list li + li { border-top: 1px solid var(--rule); }
.notif a { display: grid; gap: 2px; padding: var(--space-3) var(--space-5) var(--space-3) var(--space-6); color: var(--ink); text-decoration: none; position: relative; }
.notif a:hover { background: var(--surface-2); }
.notif.is-unread a { background: var(--accent-soft); }
.notif.is-unread a::before { content: ""; position: absolute; left: var(--space-4); top: 22px; width: 8px; height: 8px; border-radius: 999px; background: var(--brass); }
.notif strong { font-weight: 600; }
.notif:not(.is-unread) strong { font-weight: 500; }
.notif-kind { font-size: 0.6875rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-mute); }
.notif-body { color: var(--ink-soft); font-size: var(--step--1); }
.notif small { color: var(--ink-mute); font-size: 0.75rem; }
.pager { display: flex; gap: var(--space-3); align-items: center; justify-content: center; margin-top: var(--space-4); }
.pref-list { list-style: none; margin: 0 0 var(--space-4); padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.pref-list li { padding: var(--space-3) var(--space-4); }
.pref-list li + li { border-top: 1px solid var(--rule); }
.pref-list small { display: block; color: var(--ink-soft); font-size: var(--step--1); }
.notif-admin { margin-top: var(--space-6); }
.notif-admin h2 { font-size: var(--step-1); margin: 0 0 var(--space-2); }
.notif-admin .actions { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.notif-admin .actions form { margin: 0; }
.stat-row-compact { margin: var(--space-4) 0; }
.head-actions form { margin: 0; }
.page-head > .head-actions { flex: none; align-items: flex-start; }

/* ---------------------------------------------------------------- Guida */
.help-link { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; margin-right: 4px; border-radius: 999px; border: 1.5px solid var(--rule-strong); color: var(--ink-soft); font-weight: 700; font-size: 15px; text-decoration: none; line-height: 1; }
.help-link:hover, .help-link.is-current { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.ui-help { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 999px; border: 1.5px solid var(--rule-strong); font-weight: 700; font-size: 12px; vertical-align: 1px; }
.guide-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-5); margin-bottom: var(--space-4); }
.guide-hero .lead { max-width: 62ch; }
.guide-search { display: flex; gap: var(--space-2); max-width: 640px; margin-bottom: var(--space-6); }
.guide-search input { flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius-field); font: inherit; background: var(--surface); }
.guide-search input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.guide-results { list-style: none; margin: 0 0 var(--space-6); padding: 0; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.guide-results li { padding: var(--space-3) var(--space-4); }
.guide-results li + li { border-top: 1px solid var(--rule); }
.guide-results small { margin-left: var(--space-2); color: var(--ink-mute); font-size: 0.75rem; text-transform: uppercase; letter-spacing: .05em; }
.guide-results p { margin: 4px 0 0; color: var(--ink-soft); font-size: var(--step--1); }
.guide-results mark, .guide-body mark { background: var(--brass-soft); color: inherit; padding: 0 1px; border-radius: 2px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-5); align-items: start; }
.guide-cat { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); padding: var(--space-4) var(--space-5); }
.guide-cat h2 { margin: 0 0 var(--space-2); font-size: 0.8125rem; font-family: var(--font-body); font-weight: 650; letter-spacing: .01em; color: var(--gold-ink); }
.guide-cat ul { list-style: none; margin: 0; padding: 0; }
.guide-cat li + li { border-top: 1px solid var(--rule); }
.guide-cat a { display: grid; gap: 2px; padding: var(--space-3) 0; text-decoration: none; color: var(--ink); }
.guide-cat a:hover strong { text-decoration: underline; }
.guide-cat a span { color: var(--ink-soft); font-size: var(--step--1); }
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: var(--space-7); align-items: start; }
.guide-article { max-width: 72ch; }
.guide-article > h1 { margin-bottom: var(--space-4); }
.guide-body { font-size: 1rem; line-height: 1.65; }
.guide-body .guide-lead { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.55; }
.guide-body h2 { font-size: var(--step-1); margin: var(--space-6) 0 var(--space-2); scroll-margin-top: 90px; }
.guide-body ul, .guide-body ol { padding-left: 1.3em; }
.guide-body li { margin: 6px 0; }
.guide-steps { counter-reset: step; list-style: none; padding-left: 0 !important; }
.guide-steps > li { counter-increment: step; position: relative; padding-left: 2.4em; margin: 10px 0; }
.guide-steps > li::before { content: counter(step); position: absolute; left: 0; top: 1px; width: 1.65em; height: 1.65em; border-radius: 999px; background: var(--solid); color: var(--on-solid); font-size: 0.8125rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.guide-defs dt, .guide-faq dt { font-weight: 600; margin-top: var(--space-3); }
.guide-defs dd, .guide-faq dd { margin: 2px 0 0; color: var(--ink-soft); }
.guide-faq dt { margin-top: var(--space-4); }
.guide-tip, .guide-warn { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border-radius: var(--radius-field); background: var(--accent-soft); border-left: 4px solid var(--accent); font-size: var(--step-0); }
.guide-warn { background: var(--warn-soft); border-left-color: var(--warn); }
.guide-tip strong, .guide-warn strong { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.guide-warn strong { color: var(--warn); }
.guide-body .ui { display: inline-block; padding: 0 6px; border: 1px solid var(--rule-strong); border-radius: 4px; background: var(--surface); font-size: 0.875em; font-weight: 600; white-space: nowrap; }
.guide-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); margin: var(--space-3) 0; background: var(--surface); }
.guide-table th, .guide-table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
.guide-table th { background: var(--paper); font-weight: 600; }
.guide-pager { display: flex; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-7); padding-top: var(--space-4); border-top: 1px solid var(--rule); }
.guide-pager a { display: grid; text-decoration: none; color: var(--ink); font-weight: 600; max-width: 48%; }
.guide-pager a.is-next { text-align: right; margin-left: auto; }
.guide-pager small { color: var(--ink-mute); font-weight: 400; }
.guide-side { position: sticky; top: var(--space-5); display: grid; gap: var(--space-5); }
.guide-side h2 { font-size: 0.75rem; font-family: var(--font-body); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-mute); margin: 0 0 var(--space-2); }
.guide-side ol, .guide-side ul { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule); }
.guide-side li a { display: block; padding: 4px 0 4px var(--space-3); color: var(--ink-soft); text-decoration: none; font-size: var(--step--1); }
.guide-side li a:hover { color: var(--ink); }
.guide-search-side { margin: 0; }
@media (max-width: 960px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-side { position: static; }
  .guide-toc, .guide-search-side { display: none; }
}
@media (max-width: 720px) {
  .guide-hero { flex-direction: column; }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-table { display: block; overflow-x: auto; }
}
@media print {
  .guide-side, .guide-pager, .breadcrumb { display: none; }
  .guide-layout { display: block; }
}

/* ---------------------------------------------------------------- Logo di Formaxia «Esagono» */
.fxa { display: inline-flex; align-items: center; gap: .45em; line-height: 0; vertical-align: middle; }
.fxa-mark { width: 44px; height: 44px; overflow: visible; flex: none; }
.fxa-word { height: 26px; width: auto; flex: none; }
.fxa-xs .fxa-mark { width: 18px; height: 18px; } .fxa-xs .fxa-word { height: 12px; } .fxa-xs { gap: .3em; }
.fxa-sm .fxa-mark { width: 30px; height: 30px; } .fxa-sm .fxa-word { height: 18px; }
.fxa-lg .fxa-mark { width: 112px; height: 112px; } .fxa-lg .fxa-word { height: 58px; } .fxa-lg { gap: .55em; }
.fxa-sym, .fxa-hex { transform-box: view-box; transform-origin: 48px 48px; }
.fxa-facet { transform-box: fill-box; transform-origin: 100% 100%; }
.fxa-f1 { transform-box: fill-box; transform-origin: 50% 100%; }
.fxa-f2, .fxa-f3 { transform-box: fill-box; transform-origin: 0 50%; }
.fxa-idot { transform-box: fill-box; transform-origin: center bottom; }
/* Ingresso completo (login, installazione): l'esagono si apre, la F si disegna, l'angolo oro scatta; poi respira. */
.fxa-anim-intro .fxa-hex { animation: fxa-hex .8s cubic-bezier(.3, 1.4, .5, 1) both; }
.fxa-anim-intro .fxa-f1 { animation: fxa-grow-y .45s .45s cubic-bezier(.2, .8, .2, 1) both; }
.fxa-anim-intro .fxa-f2 { animation: fxa-grow-x .4s .7s cubic-bezier(.2, .8, .2, 1) both; }
.fxa-anim-intro .fxa-f3 { animation: fxa-grow-x .4s .85s cubic-bezier(.2, .8, .2, 1) both; }
.fxa-anim-intro .fxa-facet { animation: fxa-pop .5s 1.1s cubic-bezier(.3, 1.6, .5, 1) both; }
.fxa-anim-intro .fxa-sym { animation: fxa-breathe 6s 1.8s ease-in-out infinite; }
.fxa-anim-intro .fxa-letters { animation: fxa-word .7s .4s cubic-bezier(.2, .8, .2, 1) both; }
.fxa-anim-intro .fxa-idot { animation: fxa-drop .9s .95s cubic-bezier(.3, 1.5, .5, 1) both; }
/* Ingresso rapido a ogni pagina (barra superiore). */
.fxa-anim-load .fxa-hex { animation: fxa-hex .55s cubic-bezier(.3, 1.4, .5, 1) both; }
.fxa-anim-load .fxa-f1 { animation: fxa-grow-y .3s .25s both; }
.fxa-anim-load .fxa-f2 { animation: fxa-grow-x .28s .4s both; }
.fxa-anim-load .fxa-f3 { animation: fxa-grow-x .28s .5s both; }
.fxa-anim-load .fxa-facet { animation: fxa-pop .35s .65s cubic-bezier(.3, 1.6, .5, 1) both; }
.fxa-anim-load .fxa-idot { animation: fxa-drop .7s .3s cubic-bezier(.3, 1.5, .5, 1) both; }
/* Passaggio del mouse: l'esagono fa un giro. */
a:hover > .fxa .fxa-sym, a:focus-visible > .fxa .fxa-sym, .fxa-spin-hover:hover .fxa-sym { animation: fxa-turn .9s cubic-bezier(.5, 0, .3, 1); }
/* Attesa. */
.fxa-spin .fxa-sym { animation: fxa-turn 1.1s cubic-bezier(.6, 0, .4, 1) infinite; }
@keyframes fxa-hex { from { transform: rotate(-60deg) scale(0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fxa-grow-y { from { transform: scaleY(0); } to { transform: none; } }
@keyframes fxa-grow-x { from { transform: scaleX(0); } to { transform: none; } }
@keyframes fxa-pop { from { transform: scale(0); } to { transform: none; } }
@keyframes fxa-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.035); } }
@keyframes fxa-word { from { opacity: 0; transform: translateX(-140px); } to { opacity: 1; transform: none; } }
@keyframes fxa-drop { 0% { transform: translateY(-900px) scale(.6); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes fxa-turn { to { transform: rotate(360deg); } }

/* Barra superiore: simbolo di Formaxia accanto al logo aziendale. */
.identity { display: flex; align-items: center; gap: var(--space-3); }
.fxa-home { display: inline-flex; text-decoration: none; padding: 4px; margin: -4px; border-radius: 10px; }
.fxa-home:focus-visible { outline: 2px solid var(--focus); }
.identity-sep { width: 1px; height: 26px; background: var(--rule); }
.footer .fxa { margin-right: 6px; vertical-align: -2px; }
.footer-brand { display: inline-flex; align-items: center; gap: 6px; }

/* Indicatore di caricamento tra una pagina e l'altra. */
.page-loader { position: fixed; top: 14px; left: 50%; z-index: 100; display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px 8px 10px; border-radius: 999px; background: var(--surface); box-shadow: 0 8px 30px rgba(15, 27, 51, .18), 0 0 0 1px var(--rule); font-size: var(--step--1); font-weight: 600; color: var(--ink); transform: translate(-50%, -80px); opacity: 0; transition: transform .25s ease, opacity .25s ease; pointer-events: none; }
.page-loader.is-visible { transform: translate(-50%, 0); opacity: 1; }
.page-loader .fxa-mark { width: 26px; height: 26px; }

/* Accesso: il logo animato è il protagonista del pannello. */
.auth-formaxia { margin: auto 0; }
.auth-formaxia .auth-claim { margin-top: var(--space-5); }
.auth-mobile-logo { display: none; }
@media (max-width: 900px) {
  .auth-formaxia { display: none; }
  .auth-mobile-logo { display: flex; justify-content: center; margin-bottom: var(--space-5); }
}
.setup-brand .fxa { margin-bottom: 4px; }
.error-logo { display: block; margin-bottom: var(--space-5); }

@media (prefers-reduced-motion: reduce) {
  .fxa *, .fxa { animation: none !important; }
  .page-loader { transition: none; }
}
.setup-brand { align-items: center; }

/* ---------------------------------------------------------------- Auditor e report */
.auditor-banner { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: center; align-items: center; padding: 8px 16px; background: #1E3A8A; color: #fff; font-size: var(--step--1); }
.auditor-banner span { opacity: .85; }
/* In sola lettura nessun modulo di modifica è proposto (il server li rifiuta comunque). */
.is-auditor main form[method="post"]:not([action="/profilo/password"]):not([action^="/profilo/sicurezza"]):not([action="/notifiche/lette"]):not([action="/profilo/notifiche"]) { display: none !important; }
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.report-card { display: grid; gap: 6px; padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); text-decoration: none; color: var(--ink); }
.report-card:hover { border-color: var(--ink-soft); box-shadow: 0 6px 20px rgba(15, 27, 51, .08); }
.report-card strong { font-size: var(--step-1); }
.report-card span { color: var(--ink-soft); font-size: var(--step--1); }
.report-card small { color: var(--gold-ink); font-weight: 650; font-size: 0.8125rem; letter-spacing: .01em; }
.report-filters { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: flex-end; margin-bottom: var(--space-5); padding: var(--space-4); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); }
.report-filters .field { margin: 0; min-width: 150px; }
.report-filters select, .report-filters input { min-width: 0; }
.report-filters .actions { margin: 0; padding: 0; border: 0; display: flex; gap: var(--space-2); }
.stat-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.file-section { margin-top: var(--space-6); }
.file-section h2 { font-size: var(--step-1); }
.credentials-box { padding: var(--space-4) var(--space-5); border: 2px dashed var(--brass); border-radius: var(--radius-panel); background: var(--brass-soft); }
.credentials-box code { font-size: 1.05rem; padding: 2px 6px; background: var(--surface); border-radius: 4px; }
.views-list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; font-size: var(--step--1); }
.views-list li { display: flex; gap: var(--space-3); padding: 5px 0; border-bottom: 1px solid var(--rule); }
.views-list time { color: var(--ink-mute); white-space: nowrap; font-variant-numeric: tabular-nums; }
.views-list code { word-break: break-all; }
@media (max-width: 900px) { .stat-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media print { .report-filters, .head-actions { display: none; } }
.db-integrity { margin-top: var(--space-6); } .db-integrity h2 { font-size: var(--step-1); margin: 0 0 var(--space-2); }

/* ---------------------------------------------------------------- Panoramica 1.0 */
.todo-list { list-style: none; margin: 0 0 var(--space-5); padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--space-3); }
.todo-list a { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--rule); border-left: 4px solid var(--brass); border-radius: var(--radius-field); color: var(--ink); text-decoration: none; }
.todo-list a:hover { border-color: var(--ink-soft); border-left-color: var(--brass); }
.todo-count { font-family: var(--font-display); font-size: var(--step-2); font-weight: 600; min-width: 1.4em; }
.area-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--space-3); }
.area-grid a { display: grid; align-content: start; gap: 4px; height: 100%; padding: var(--space-4); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); color: var(--ink); text-decoration: none; }
.area-grid a:hover { border-color: var(--ink-soft); box-shadow: 0 6px 20px rgba(15, 27, 51, .07); }
.area-grid span { color: var(--ink-soft); font-size: var(--step--1); }
.dash-side h2 { font-size: var(--step-1); margin: 0 0 var(--space-3); }
.dash-notifs { list-style: none; margin: 0 0 var(--space-3); padding: 0; }
.dash-notifs li { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); display: grid; gap: 2px; font-size: var(--step--1); }
.dash-notifs li.is-unread a { font-weight: 600; }
.dash-notifs a { color: var(--ink); text-decoration: none; }
.dash-notifs a:hover { text-decoration: underline; }
.dash-notifs small { color: var(--ink-mute); }
.dash-help { margin-top: var(--space-5); padding: var(--space-3) var(--space-4); background: var(--paper); border-radius: var(--radius-field); font-size: var(--step--1); }
.dash-help p { margin: 4px 0 0; }
.dash-version { margin: var(--space-4) 0 0; color: var(--ink-mute); font-size: var(--step--1); }
.quality-preview { margin-top: var(--space-4); padding: var(--space-3) var(--space-4); background: var(--paper); border-left: 3px solid var(--brass); border-radius: var(--radius-field); }
.quality-preview p { margin: 4px 0 0; font-size: var(--step--1); color: var(--ink-soft); }
.settings-body > form + form { margin-top: var(--space-6); }
.settings-body fieldset > .checkbox + .form-grid { margin-top: var(--space-3); }

/* Verifica di sicurezza interna: riga nel piè di pagina */
.check-list { padding-left: 1.1em; display: grid; gap: var(--space-3); margin: var(--space-5) 0; }
.footer a { color: inherit; }

/* ---------------------------------------------------------------- Analisi */
.eyebrow { margin: 0 0 6px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-strong); }
.an-tabs { margin-bottom: var(--space-5); overflow-x: auto; scrollbar-width: none; }
.an-tabs a { white-space: nowrap; }
.an-filters { margin-bottom: var(--space-5); }
.chart { display: block; width: 100%; height: auto; overflow: visible; }
.chart-card h2, .an-hero h2, .an-index h2 { margin-bottom: 4px; }
.chart-card > .muted { margin: 0 0 var(--space-3); font-size: var(--step--1); }
.chart-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: var(--space-2) 0 0; font-size: var(--step--1); color: var(--ink-mute); }
.chart-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: -10px; }
.dot-blue { background: var(--accent); } .dot-sky { background: var(--accent-2); } .dot-gold { background: var(--gold); } .dot-green { background: var(--ok); } .dot-navy { background: var(--solid); }
.dot-dashed { background: none !important; border: 2px dashed var(--gold); }
.an-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: var(--space-4); margin-bottom: var(--space-4); align-items: stretch; }
.an-ring { display: flex; align-items: center; gap: var(--space-5); }
.an-ring .chart-ring { flex: none; }
.an-ring p { margin: 6px 0 0; }
.an-kpis { margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.an-kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: var(--space-4); }
.an-kpis .kpi-label { line-height: 1.35; }
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-bottom: var(--space-4); }
.an-grid-radar { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.an-grid > .panel, .an-hero > .panel { margin: 0; }
.an-list { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: 2px; }
.an-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.an-list li:last-child { border-bottom: 0; }
.an-list small { grid-column: 1 / -1; color: var(--ink-mute); font-size: var(--step--1); }
.an-list a { font-weight: 600; text-decoration: none; }
.an-index { display: flex; flex-direction: column; align-items: center; text-align: center; }
.an-index .an-list { width: 100%; text-align: left; }
.an-data, .an-method { margin-top: var(--space-5); }
.an-data .table-wrap + .table-wrap { margin-top: var(--space-3); }
.heatmap td, .heatmap th[scope="row"] { vertical-align: middle; }
.heatmap td small, .heatmap th small { display: block; font-weight: 400; color: inherit; opacity: .75; font-size: 11px; }
.heat-na { background: var(--surface); }
.heat-0 { background: var(--scale-0); color: var(--scale-0-ink); } .heat-1 { background: var(--scale-1); color: var(--scale-1-ink); } .heat-2 { background: var(--scale-2); color: var(--scale-2-ink); }
.heat-3 { background: var(--scale-3); color: var(--scale-3-ink); } .heat-4 { background: var(--scale-4); color: var(--scale-4-ink); } .heat-5 { background: var(--scale-5); color: var(--scale-5-ink); }
.heat-legend { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-3) 0 0; font-size: 12px; }
.heat-legend span { padding: 3px 9px; border-radius: 999px; }
.meter { display: inline-block; width: 64px; height: 8px; border-radius: 4px; background: var(--surface-3); vertical-align: middle; overflow: hidden; }
.meter-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--error)); border-radius: 4px; }
.w-0 { width: 0; } .w-10 { width: 10%; } .w-20 { width: 20%; } .w-30 { width: 30%; } .w-40 { width: 40%; } .w-50 { width: 50%; } .w-60 { width: 60%; } .w-70 { width: 70%; } .w-80 { width: 80%; } .w-90 { width: 90%; } .w-100 { width: 100%; }
.segmented-links { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--surface-3); gap: 2px; }
.segmented-links a { padding: 6px 14px; border-radius: 9px; font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); text-decoration: none; }
.segmented-links a[aria-current="true"] { background: var(--surface); color: var(--accent-strong); box-shadow: var(--shadow-1); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; }
@media (max-width: 1000px) {
  .an-hero, .an-grid, .an-grid-radar { grid-template-columns: minmax(0, 1fr); }
  .an-kpis, .an-kpis-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) { .an-ring { flex-direction: column; text-align: center; } }
.chart.chart-ring { width: 148px; height: 148px; flex: none; }
.table tbody th { text-transform: none; letter-spacing: normal; font-size: inherit; color: var(--ink); background: transparent; font-weight: 600; }

/* ---------------------------------------------------------------- Scheda personale */
.person-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap;
  margin-bottom: var(--space-5); padding: clamp(20px, 3vw, 32px); border-radius: 22px; color: #fff;
  background:
    radial-gradient(520px 260px at 92% -20%, rgba(96, 165, 250, .45), transparent 60%),
    radial-gradient(420px 240px at -5% 120%, rgba(224, 169, 59, .28), transparent 60%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='64' viewBox='0 0 56 64'%3E%3Cpath d='M28 2 54 17v30L28 62 2 47V17Z' fill='none' stroke='%23ffffff' stroke-opacity='.06' stroke-width='1.2'/%3E%3C/svg%3E"),
    linear-gradient(135deg, #0f2a5c 0%, #1d4ed8 100%);
  box-shadow: 0 24px 48px -20px rgba(15, 42, 92, .55);
}
.person-hero h1 { color: #fff; margin: 0 0 6px; font-size: clamp(1.75rem, 1.2rem + 1.6vw, 2.5rem); }
.person-hero .eyebrow { color: #bfdbfe; }
.person-hero-main { display: flex; align-items: center; gap: var(--space-5); min-width: 0; }
.person-hero-meta { margin: 0; color: #dbe7ff; }
.person-hero .badge { background: rgba(255, 255, 255, .16); color: #fff; }
.person-hero .head-actions .btn-quiet { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; box-shadow: none; }
.person-hero .head-actions .btn-quiet:hover { background: #fff; color: var(--navy); border-color: #fff; }
.avatar-xl { width: 84px; height: 84px; flex: none; font-size: 30px; font-weight: 800; letter-spacing: -.02em; background: linear-gradient(135deg, #fff, #dbe7ff); color: var(--navy); box-shadow: 0 0 0 4px rgba(255, 255, 255, .22), 0 10px 24px -8px rgba(0, 0, 0, .4); }
.chips { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); font-size: var(--step--1); }
.person-kpis { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: var(--space-4); margin-bottom: var(--space-4); }
.person-ring { display: flex; align-items: center; gap: var(--space-5); margin: 0; }
.ring-legend { list-style: none; margin: var(--space-2) 0 0; padding: 0; display: grid; gap: 4px; color: var(--ink-soft); font-size: var(--step--1); }
.ring-legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }
.dot-red { background: var(--error); }
.person-tiles { margin: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kpi-value small { font-size: .55em; color: var(--ink-mute); font-weight: 700; }
.kpi-value.kpi-text { font-size: 1.35rem; }
.person-admin-title { margin-top: var(--space-7); }
.chart-card h3 { font-size: 1.0625rem; margin: 0 0 var(--space-3); }
.comp-table td { vertical-align: middle; }
.level-pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: var(--step--1); font-weight: 600; white-space: nowrap; }
.level-0 { background: var(--surface-3); color: var(--ink-mute); } .level-1 { background: var(--scale-1); color: var(--scale-1-ink); } .level-2 { background: var(--scale-2); color: var(--scale-2-ink); }
.level-3 { background: var(--scale-3); color: var(--scale-3-ink); } .level-4 { background: var(--scale-5); color: var(--scale-5-ink); }
.evidence { display: flex; flex-wrap: wrap; gap: 4px; }
.evidence span { padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
.assess-cell { display: grid; grid-template-columns: 130px minmax(140px, 1fr); gap: 6px; min-width: 300px; }
.assess-cell select, .assess-cell input { width: 100%; min-height: 36px; padding: 4px 8px; border: 1px solid var(--rule-strong); border-radius: 8px; font: inherit; font-size: var(--step--1); background: var(--surface); color: var(--ink); }
.assess-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); flex-wrap: wrap; margin-top: var(--space-3); }
.assess-actions .hint { margin: 0; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 2px; background: linear-gradient(180deg, var(--info-line), transparent); }
.tl-item { position: relative; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: var(--space-3); padding: 8px 0; }
.tl-icon { position: relative; z-index: 1; width: 36px; height: 36px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); color: var(--accent); border: 1px solid #dbe5f5; box-shadow: var(--shadow-1); }
.tl-icon svg { width: 18px; height: 18px; }
.tl-title { margin: 6px 0 0; font-weight: 600; }
.tl-title a { text-decoration: none; }
.tl-meta { margin: 2px 0 0; color: var(--ink-mute); font-size: var(--step--1); }
.tl-completed .tl-icon, .tl-test_passed .tl-icon { color: var(--ok); border-color: var(--ok-line); background: var(--ok-soft); }
.tl-certificate .tl-icon, .tl-assessment .tl-icon { color: var(--gold-ink); border-color: var(--gold-line); background: var(--gold-soft); }
.tl-test_failed .tl-icon, .tl-revoked .tl-icon, .tl-test_invalidated .tl-icon { color: var(--error); border-color: var(--error-line); background: var(--error-soft); }
.tl-effectiveness .tl-icon, .tl-classroom .tl-icon { color: var(--navy); }
@media (max-width: 1000px) { .person-kpis { grid-template-columns: minmax(0, 1fr); } .person-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .person-hero-main { flex-direction: column; align-items: flex-start; } .person-ring { flex-direction: column; text-align: center; } .assess-cell { grid-template-columns: 1fr; min-width: 200px; } }
.chart.chart-radar { max-width: 480px; margin: 0 auto; }

/* ---------------------------------------------------------------- Guida: schermate, diagrammi, documentazione */
.guide-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: calc(-1 * var(--space-2)) 0 var(--space-5); }
.guide-shot { margin: var(--space-5) 0; }
.guide-shot img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 10px 30px -18px rgba(15, 42, 92, .45); background: var(--doc); }
.guide-shot figcaption, .guide-flow figcaption { margin-top: var(--space-2); color: var(--ink-mute); font-size: var(--step--1); line-height: 1.5; }
.guide-flow figcaption strong { color: var(--ink); margin-right: 4px; }
.guide-flow { margin: var(--space-5) 0; }
.guide-flow-canvas { padding: var(--space-4); background: linear-gradient(180deg, #f8fafd, #eef2f8); border: 1px solid var(--rule); border-radius: 14px; overflow-x: auto; text-align: center; }
.guide-flow-canvas svg { max-width: 100%; height: auto; }
.guide-callouts { counter-reset: callout; list-style: none; padding-left: 0 !important; margin: calc(-1 * var(--space-2)) 0 var(--space-5); font-size: var(--step--1); }
.guide-callouts > li { counter-increment: callout; position: relative; padding-left: 2.2em; margin: 6px 0; }
.guide-callouts > li::before { content: counter(callout); position: absolute; left: 0; top: 0; width: 1.6em; height: 1.6em; border-radius: 50%; background: var(--solid); color: var(--on-solid); font-size: 0.8125rem; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.doc-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-4); }
.doc-card { display: grid; gap: 6px; align-content: start; padding: var(--space-4) var(--space-5); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); box-shadow: var(--shadow-sm, 0 1px 2px rgba(15, 27, 51, .06)); }
.doc-card strong { font-size: var(--step-0); }
.doc-card > span:not(.doc-kind):not(.doc-card-actions) { color: var(--ink-soft); font-size: var(--step--1); }
.doc-card.is-manual { background: linear-gradient(135deg, #0F2A5C, #1f4fb8); border-color: transparent; color: #fff; }
.doc-card.is-manual > span:not(.doc-kind):not(.doc-card-actions) { color: rgba(255, 255, 255, .82); }
.doc-card.is-manual .doc-kind { color: #f5d38a; }
.doc-card.is-manual .btn-quiet { background: rgba(255, 255, 255, .12); color: #fff; border-color: rgba(255, 255, 255, .3); }
.doc-kind { font-size: 0.8125rem; letter-spacing: .01em; font-weight: 650; color: var(--gold-ink); }
.doc-card-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-top: var(--space-2); }
.guide-docs-teaser { margin-top: var(--space-7); }
.doc-meta { color: var(--ink-mute); font-size: var(--step--1); margin: calc(-1 * var(--space-3)) 0 var(--space-4); }
.doc-body h2 { border-top: 1px solid var(--rule); padding-top: var(--space-5); }
.doc-body h3 { font-size: var(--step-0); margin: var(--space-5) 0 var(--space-2); scroll-margin-top: 90px; }
.doc-body pre.doc-code { background: #0f1b33; color: #e6edf7; padding: var(--space-3) var(--space-4); border-radius: 10px; overflow-x: auto; font-size: 0.8125rem; line-height: 1.55; }
.doc-body p code, .doc-body li code, .doc-body td code { overflow-wrap: anywhere; }
.doc-body td:first-child code { white-space: nowrap; overflow-wrap: normal; }
.doc-body code { font-size: 0.875em; background: var(--surface-3); padding: 1px 5px; border-radius: 4px; }
.doc-body pre code { background: none; padding: 0; color: inherit; }
.doc-body blockquote { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border-left: 4px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.doc-body hr { border: 0; border-top: 1px solid var(--rule); margin: var(--space-5) 0; }
@media print {
  .guide-actions, .guide-docs-teaser, .subnav { display: none !important; }
  .guide-shot, .guide-flow, .guide-table, pre { break-inside: avoid; }
  .guide-flow-canvas { background: #fff; }
  .doc-body pre.doc-code { background: #f2f5f9; color: #1e2b3f; }
}

/* ---------------------------------------------------------------- Attività pianificate */
.sched-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.sched-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-4); padding: var(--space-4) 0; border-top: 1px solid var(--rule); }
.sched-item:first-child { border-top: 0; padding-top: 0; }
.sched-main h3 { font-size: var(--step-0); margin: 0 0 2px; }
.sched-main h3 small { font-weight: 400; margin-left: .35em; }
.sched-main p { margin: 0; }
.sched-last { margin-top: var(--space-2) !important; font-size: var(--step--1); }
.sched-side { display: grid; justify-items: end; align-content: start; gap: var(--space-2); text-align: right; min-width: 9.5rem; }
.sched-next { margin: 0; font-size: var(--step--1); }
.field-narrow input { max-width: 8rem; }
@media (max-width: 560px) {
  .sched-item { grid-template-columns: 1fr; }
  .sched-side { justify-items: start; text-align: left; grid-auto-flow: column; align-items: center; justify-content: space-between; }
}

/* ---------------------------------------------------------------- Caricamento delle domande */
.q-add { display: grid; gap: var(--space-3); margin-top: var(--space-4); }
.q-add > details > summary .muted, .q-more > summary .muted { font-weight: 400; font-size: var(--step--1); margin-left: .4em; }
.q-more { margin: var(--space-3) 0; }
.q-more > summary { cursor: pointer; font-weight: 600; }
.q-more > .form-grid { margin-top: var(--space-3); }
.q-import-steps { margin: 0 0 var(--space-4); }
.q-import textarea { font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace); font-size: .8125rem; }
.import-actions { margin: var(--space-4) 0; }
.q-import-error .q-preview { border-color: var(--warn); background: var(--warn-soft); }
.q-import-error .q-no { background: var(--warn); color: var(--paper); }
.q-errors { margin: var(--space-2) 0 0; padding-left: 1.2em; color: var(--ink); }
.q-errors li { margin: 2px 0; }

.readiness-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
.readiness-actions form { margin: 0; }

/* ==========================================================================
 * Open Badge (v2.9): tessere, pannello nell'attestato, configurazione sul test,
 * pagina pubblica del badge.
 * ========================================================================== */
.btn-linkedin { display: inline-flex; align-items: center; gap: 8px; background: #0a66c2; border-color: #0a66c2; color: #fff; }
.btn-linkedin:hover, .btn-linkedin:focus-visible { background: #004182; border-color: #004182; color: #fff; }
.btn-linkedin svg { flex: none; }

.ob-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: var(--space-4); }
.ob-tile {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 14px 16px;
  border: 1px solid var(--rule); border-radius: var(--radius-panel); background: var(--card-bg);
  box-shadow: var(--shadow-1); color: var(--ink); text-align: center; text-decoration: none;
  transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s, border-color .3s;
}
.ob-tile:hover, .ob-tile:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--rule-strong); }
.ob-tile-art img { display: block; width: 120px; height: 120px; filter: drop-shadow(0 10px 14px rgba(13, 26, 51, .24)); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.ob-tile:hover .ob-tile-art img { transform: rotate(-4deg) scale(1.06); }
.ob-tile-name { font-family: var(--font-display); font-weight: 650; line-height: 1.2; text-wrap: balance; }
.ob-tile-meta { color: var(--ink-mute); font-size: var(--step--1); }
.ob-tile.is-off .ob-tile-art img { filter: grayscale(1) opacity(.5); }

.ob-panel { display: flex; align-items: center; gap: var(--space-5); margin-top: var(--space-5); }
.ob-panel-art { flex: none; width: 132px; height: 132px; filter: drop-shadow(0 14px 18px rgba(13, 26, 51, .24)); }
.ob-panel-body h2 { margin: 0 0 6px; font-family: var(--font-display); }
.ob-panel-body .muted { margin: 0 0 var(--space-4); }
@media (max-width: 640px) {
  .ob-panel { flex-direction: column; text-align: center; }
  .ob-panel .actions { justify-content: center; }
}

.ob-config { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; margin-top: var(--space-5); }
.ob-config > .panel h2 { margin-top: 0; }
.ob-preview-art { display: grid; place-items: center; margin: -4px 0 var(--space-4); padding: var(--space-4) 0; border-radius: 16px; background: radial-gradient(closest-side, var(--accent-soft), transparent 78%); }
.ob-preview-art img { width: 240px; height: 240px; filter: drop-shadow(0 18px 24px rgba(13, 26, 51, .28)); transition: opacity .2s; }
.ob-backfill { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); margin-top: var(--space-4); }
.ob-backfill p { margin: 0; flex: 1 1 320px; }
.ob-revoke { display: inline-block; text-align: left; }
.ob-revoke > summary { list-style: none; }
.ob-revoke > summary::-webkit-details-marker { display: none; }
.ob-revoke[open] > summary { margin-bottom: 8px; }
.ob-revoke form { display: grid; gap: 6px; min-width: 240px; }
@media (max-width: 960px) {
  .ob-config { grid-template-columns: minmax(0, 1fr); }
}

/* Pagina pubblica */
.ob-shell { display: flex; flex-direction: column; min-height: 100vh; max-width: 1100px; margin: 0 auto; padding: 18px 16px 32px; }
.ob-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 52px; }
.ob-top-logo img { display: block; max-width: 210px; max-height: 44px; }
.ob-top-company { font-family: var(--font-display); font-size: 1.15rem; letter-spacing: -.01em; }
.ob-main { flex: 1; }
.ob-hero { display: grid; grid-template-columns: minmax(0, 380px) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: center; padding: clamp(20px, 5vw, 56px) 0 clamp(24px, 4vw, 44px); }
.ob-art { position: relative; display: grid; place-items: center; }
.ob-art img { position: relative; width: 100%; max-width: 340px; height: auto; filter: drop-shadow(0 30px 38px rgba(13, 26, 51, .34)); animation: ob-float 7s ease-in-out infinite; }
.ob-halo {
  position: absolute; inset: 4%; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--brass) 60%, transparent) 0%, color-mix(in srgb, var(--accent) 22%, transparent) 46%, transparent 70%);
  filter: blur(26px); animation: ob-pulse 7s ease-in-out infinite;
}
@keyframes ob-float { 0%, 100% { transform: translateY(0) rotate(-1.5deg); } 50% { transform: translateY(-12px) rotate(1.5deg); } }
@keyframes ob-pulse { 0%, 100% { opacity: .7; transform: scale(.95); } 50% { opacity: 1; transform: scale(1.04); } }
.ob-hero.is-revoked .ob-art img, .ob-hero.is-altered .ob-art img { filter: grayscale(1) opacity(.55); animation: none; }
.ob-hero.is-revoked .ob-halo, .ob-hero.is-altered .ob-halo { display: none; }
.ob-hero.is-expired .ob-art img { filter: grayscale(.6) drop-shadow(0 20px 30px rgba(13, 26, 51, .25)); }

.ob-state { display: inline-flex; align-items: center; gap: 9px; margin: 0; padding: 6px 13px 6px 11px; border: 1px solid var(--ok-line); border-radius: 999px; background: var(--ok-soft); color: var(--ok); font-size: var(--step--1); font-weight: 650; }
.ob-state-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 22%, transparent); }
.ob-hero.is-expired .ob-state { border-color: var(--warn-line); background: var(--warn-soft); color: var(--warn); }
.ob-hero.is-revoked .ob-state, .ob-hero.is-altered .ob-state { border-color: var(--error-line); background: var(--error-soft); color: var(--error); }
.ob-intro h1 { margin: 18px 0 12px; font-family: var(--font-display); font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.03; letter-spacing: -.025em; text-wrap: balance; }
.ob-holder { margin: 0; font-size: var(--step-1); }
.ob-issuer { margin: 4px 0 0; color: var(--ink-soft); }
.ob-why { margin: 16px 0 0; color: var(--ink-mute); max-width: 52ch; }
.ob-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.ob-hint { margin: 12px 0 0; color: var(--ink-mute); font-size: var(--step--1); }

.ob-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.ob-card { padding: 24px; border: 1px solid var(--rule); border-radius: var(--radius-panel); background: var(--card-bg); box-shadow: var(--shadow-2); }
.ob-card h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: var(--step-1); }
.ob-card h3 { margin: 20px 0 6px; color: var(--gold-ink); font-size: var(--step--1); font-weight: 650; letter-spacing: .04em; }
.ob-card p { margin: 0; }
.ob-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.ob-tags li { padding: 4px 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: var(--step--1); font-weight: 600; }
.ob-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 9px 18px; margin: 0; }
.ob-facts dt { color: var(--ink-mute); }
.ob-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ob-facts small { display: block; color: var(--ink-mute); font-weight: 400; }
.ob-tech { grid-column: 1 / -1; }
.ob-tech > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; cursor: pointer; list-style: none; }
.ob-tech > summary::-webkit-details-marker { display: none; }
.ob-tech > summary::after { content: "+"; margin-left: auto; color: var(--ink-mute); font-size: 1.3rem; line-height: 1; }
.ob-tech[open] > summary::after { content: "–"; }
.ob-tech > summary h2 { margin: 0; }
.ob-tech > summary span { color: var(--ink-mute); font-size: var(--step--1); }
.ob-tech[open] > summary { margin-bottom: 16px; }
.ob-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 18px 0 0; padding: 0; list-style: none; }
.ob-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding-top: 40px; color: var(--ink-mute); font-size: var(--step--1); text-align: center; }
@media (max-width: 820px) {
  .ob-hero { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .ob-art img { max-width: 260px; }
  .ob-why { margin-inline: auto; }
  .ob-actions { justify-content: center; }
  .ob-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 480px) {
  .ob-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .ob-facts dd { margin-bottom: 8px; }
  .ob-card { padding: 20px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .ob-art img, .ob-halo { animation: none; }
  .ob-tile, .ob-tile-art img { transition: none; }
}
.settings-body > section.panel + section.panel { margin-top: var(--space-4); }

/* =====================================================================================
   Academy — vetrina pubblica, registrazione, gestione, analitiche web, mappa
   ===================================================================================== */

/* Utilità condivise */
.btn-lg { min-height: 52px; padding: 0 26px; font-size: var(--step-1); }
.btn-ghost-light { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(6px); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .6); }
.badge-danger { background: var(--error-soft); color: var(--error); }
.notice-warn { color: var(--ink); }
.code-block { margin: var(--space-3) 0 0; padding: 12px 14px; border-radius: var(--radius-field); background: var(--surface-2); border: 1px solid var(--rule); font: 500 .8125rem/1.6 ui-monospace, "SFMono-Regular", Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.choice-group-wide { grid-template-columns: minmax(0, 1fr); }
.setting-danger { border-color: var(--error-line); }
.filters-inline { display: flex; gap: var(--space-2); align-items: center; padding: 0; border: 0; background: none; box-shadow: none; }
.filters-inline input { min-width: 240px; }

/* ----------------------------------------------------------------- layout pubblico */
body.pub { background: var(--paper); }
.pub-wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
.pub-narrow { max-width: 760px; }
.pub-top { position: sticky; top: 0; z-index: 40; background: var(--glass-strong); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.pub-top-inner { width: min(1180px, 100% - 32px); margin-inline: auto; display: flex; align-items: center; gap: var(--space-5); min-height: 68px; }
.pub-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.pub-brand-logo { max-height: 34px; max-width: 140px; width: auto; }
.pub-brand-name { font: 700 1.0625rem/1.15 var(--font-display); letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pub-nav { display: flex; gap: 4px; margin-right: auto; }
.pub-nav a { padding: 8px 12px; border-radius: 999px; color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.pub-nav a:hover, .pub-nav a[aria-current] { color: var(--ink); background: var(--accent-soft); }
.pub-actions { display: flex; align-items: center; gap: 10px; }
.pub-login { color: var(--ink); font-weight: 600; text-decoration: none; padding: 8px 6px; }
.pub-login:hover { color: var(--accent-strong); }
.pub-main { min-height: 60vh; }
.pub-main > .pub-wrap > .notice { margin-top: var(--space-5); }

/* Hero scuro con il campo di esagoni */
.pub-hero { position: relative; isolation: isolate; overflow: hidden; color: #eef3ff; background: radial-gradient(1200px 600px at 85% -10%, rgba(61, 211, 255, .22), transparent 60%), radial-gradient(900px 500px at 10% 120%, rgba(227, 167, 47, .18), transparent 60%), linear-gradient(160deg, #0a1633 0%, #0f2a5c 55%, #12306b 100%); }
.pub-hero .hexfield { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.pub-hero-inner { padding: clamp(64px, 10vw, 128px) 0 clamp(56px, 8vw, 104px); max-width: 860px; }
.pub-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 var(--space-5); padding: 6px 14px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: var(--step--1); font-weight: 600; letter-spacing: .02em; }
.pub-dot { width: 8px; height: 8px; border-radius: 50%; background: #3dd3ff; box-shadow: 0 0 0 4px rgba(61, 211, 255, .2); }
.fx-anim .pub-dot { animation: pubPulse 2.4s ease-in-out infinite; }
@keyframes pubPulse { 50% { box-shadow: 0 0 0 9px rgba(61, 211, 255, 0); } }
.pub-hero-title { margin: 0; font: 800 clamp(2.4rem, 1.4rem + 4.4vw, 4.6rem)/1.02 var(--font-display); letter-spacing: -.035em; color: #fff; text-wrap: balance; }
.pub-hero-lead { margin: var(--space-5) 0 0; max-width: 640px; font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem); line-height: 1.55; color: rgba(232, 240, 255, .86); text-wrap: pretty; }
.pub-hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: var(--space-6); }
.pub-hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: var(--space-6) 0 0; padding: 0; list-style: none; color: rgba(232, 240, 255, .82); font-size: var(--step--1); font-weight: 600; }
.pub-hero-points li::before { content: ""; display: inline-block; width: 16px; height: 16px; margin-right: 8px; vertical-align: -3px; border-radius: 50%; background: rgba(61, 211, 255, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.6L12 5.4' fill='none' stroke='%233dd3ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }

/* Numeri */
.pub-proof { border-bottom: 1px solid var(--rule); background: var(--surface); }
.pub-proof-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--space-4); padding: var(--space-6) 0; }
.pub-proof-grid div { display: flex; flex-direction: column; gap: 2px; }
.pub-proof-grid strong { font: 800 clamp(1.8rem, 1.4rem + 1.4vw, 2.6rem)/1 var(--font-display); letter-spacing: -.03em; color: var(--ink); }
.pub-proof-grid span { color: var(--ink-mute); font-size: var(--step--1); font-weight: 600; }

/* Sezioni */
.pub-section { padding: clamp(48px, 7vw, 88px) 0; }
.pub-section-tight { padding-top: var(--space-6); }
.pub-section-head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-6); flex-wrap: wrap; }
.pub-section h2, .pub-h2 { margin: 0; font: 750 clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem)/1.12 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.pub-h2 { margin: var(--space-7) 0 var(--space-4); font-size: clamp(1.35rem, 1.1rem + .8vw, 1.75rem); }
.pub-kicker { margin: 0 0 6px; color: var(--accent-strong); font-size: var(--step--1); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pub-kicker a { color: inherit; text-decoration: none; }
.pub-more { font-weight: 700; text-decoration: none; }
.pub-empty { padding: var(--space-7); border: 1px dashed var(--rule-strong); border-radius: var(--radius-panel); text-align: center; color: var(--ink-soft); background: var(--surface); }
.pub-count { margin: 0 0 var(--space-4); color: var(--ink-mute); font-weight: 600; font-size: var(--step--1); }
.fx-anim .fx-rise { opacity: 0; transform: translateY(26px); }
.fx-anim .fx-rise.fx-risen { opacity: 1; transform: none; transition: opacity .7s var(--ease-out), transform .8s var(--ease-out); }

/* Schede dei corsi */
.pub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-5); }
.pub-card { position: relative; border-radius: var(--radius-panel); background: var(--card-bg); border: 1px solid var(--rule); box-shadow: var(--shadow-2); overflow: hidden; transform: perspective(900px) rotateX(var(--ry, 0)) rotateY(var(--rx, 0)); transition: transform .35s var(--ease-out), box-shadow .3s, border-color .3s; }
.pub-card:hover { box-shadow: var(--shadow-3); border-color: var(--rule-hover); }
.pub-card.is-lit::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px circle at var(--mx) var(--my), var(--lit-glow), transparent 60%); }
.pub-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.pub-card-media { position: relative; aspect-ratio: 1200 / 630; background: var(--surface-3); overflow: hidden; }
.pub-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease-out); }
.pub-card:hover .pub-card-media img { transform: scale(1.04); }
.pub-card-media.is-generated, .pub-course-media.is-generated { display: grid; place-items: center; background: radial-gradient(circle at 80% 10%, rgba(61, 211, 255, .35), transparent 50%), linear-gradient(140deg, var(--brand, #0f2a5c), #12306b 60%, #1f45c8); }
.pub-card-mono { font: 800 3.4rem/1 var(--font-display); letter-spacing: -.04em; color: rgba(255, 255, 255, .92); text-shadow: 0 6px 30px rgba(0, 0, 0, .25); }
.pub-chip { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 999px; background: var(--glass-strong); color: var(--ink); font-size: .75rem; font-weight: 700; backdrop-filter: blur(6px); }
.pub-card-body { display: flex; flex-direction: column; gap: 6px; padding: var(--space-5); flex: 1; }
.pub-card-area { margin: 0; color: var(--accent-strong); font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.pub-card-title { margin: 0; font: 700 1.25rem/1.2 var(--font-display); letter-spacing: -.015em; color: var(--ink); }
.pub-card-sub { margin: 0; color: var(--ink-soft); font-size: var(--step-0); line-height: 1.5; flex: 1; }
.pub-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: var(--space-3) 0 0; color: var(--ink-mute); font-size: var(--step--1); font-weight: 600; }
.pub-free { color: var(--ok); }

/* Come funziona */
.pub-steps-band { background: var(--surface); border-block: 1px solid var(--rule); }
.pub-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-5); margin: var(--space-6) 0 0; padding: 0; list-style: none; counter-reset: s; }
.pub-steps li { position: relative; padding: var(--space-5); border-radius: var(--radius-panel); background: var(--surface-2); border: 1px solid var(--rule); }
.pub-steps h3 { margin: var(--space-3) 0 6px; font: 700 1.15rem/1.2 var(--font-display); }
.pub-steps p { margin: 0; color: var(--ink-soft); }
.pub-step-n { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, var(--btn-from), var(--btn-to)); color: #fff; font: 800 1.05rem/1 var(--font-display); box-shadow: 0 8px 20px -8px var(--accent-glow); }

/* Docente e chiusura */
.pub-author { display: flex; align-items: center; gap: var(--space-6); padding: var(--space-6); border-radius: var(--radius-panel); background: var(--surface); border: 1px solid var(--rule); }
.pub-author-mark { flex: none; display: grid; place-items: center; width: 108px; height: 108px; clip-path: polygon(25% 3%, 75% 3%, 100% 50%, 75% 97%, 25% 97%, 0 50%); background: linear-gradient(140deg, var(--navy), var(--accent)); color: #fff; font: 800 2.2rem/1 var(--font-display); }
.pub-author h2 { font-size: clamp(1.4rem, 1.2rem + .8vw, 1.9rem); }
.pub-author-role { margin: 4px 0 var(--space-4); color: var(--ink-soft); }
.pub-final { padding: 0 0 clamp(48px, 7vw, 88px); }
.pub-final-inner { padding: clamp(36px, 5vw, 64px); border-radius: 28px; text-align: center; color: #eef3ff; background: radial-gradient(700px 300px at 50% -20%, rgba(61, 211, 255, .3), transparent 70%), linear-gradient(150deg, #0a1633, #0f2a5c 60%, #1f45c8); box-shadow: var(--shadow-3); }
.pub-final-inner h2 { color: #fff; }
.pub-final-inner p { color: rgba(232, 240, 255, .82); margin: var(--space-3) 0 var(--space-5); }

/* Intestazioni delle pagine interne */
.pub-pagehead { padding: clamp(36px, 5vw, 64px) 0 var(--space-5); background: linear-gradient(180deg, var(--surface), transparent); }
.pub-pagehead h1, .pub-course-hero h1 { margin: 0; font: 800 clamp(2rem, 1.3rem + 2.6vw, 3.3rem)/1.06 var(--font-display); letter-spacing: -.03em; text-wrap: balance; }
.pub-lead { margin: var(--space-3) 0 0; color: var(--ink-soft); font-size: clamp(1.02rem, .95rem + .35vw, 1.2rem); max-width: 720px; }
.pub-crumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--space-4); color: var(--ink-mute); font-size: var(--step--1); }
.pub-crumbs a { color: var(--ink-mute); text-decoration: none; }
.pub-crumbs a:hover { color: var(--accent-strong); }
.pub-search { display: flex; gap: 10px; margin-top: var(--space-5); max-width: 640px; }
.pub-search input { flex: 1; min-width: 0; min-height: 48px; padding: 0 16px; border-radius: var(--radius-field); border: 1px solid var(--rule-strong); background: var(--field-bg); color: var(--ink); font: inherit; }
.pub-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-4); }
.pub-filters a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--rule-strong); color: var(--ink-soft); font-weight: 600; font-size: var(--step--1); text-decoration: none; background: var(--surface); }
.pub-filters a:hover { border-color: var(--accent); color: var(--accent-strong); }
.pub-filters a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--paper); }

/* Pagina del corso */
.pub-course-hero { padding: clamp(32px, 5vw, 64px) 0 var(--space-6); background: linear-gradient(180deg, var(--surface), var(--paper)); border-bottom: 1px solid var(--rule); }
.pub-course-hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.pub-course-media { aspect-ratio: 1200 / 630; border-radius: var(--radius-panel); overflow: hidden; box-shadow: var(--shadow-3); background: var(--surface-3); }
.pub-course-media img { width: 100%; height: 100%; object-fit: cover; }
.pub-facts { display: flex; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-5) 0 0; padding: 0; list-style: none; }
.pub-facts li { display: flex; flex-direction: column; min-width: 110px; padding: 10px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--rule); }
.pub-facts strong { font: 750 1.2rem/1.2 var(--font-display); }
.pub-facts span { color: var(--ink-mute); font-size: .75rem; font-weight: 600; }
.pub-course-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: clamp(24px, 4vw, 56px); align-items: start; }
.pub-course-side { position: sticky; top: 92px; display: grid; gap: var(--space-4); }
.pub-panel { position: relative; padding: var(--space-5); border-radius: var(--radius-panel); background: var(--card-bg); border: 1px solid var(--rule); box-shadow: var(--shadow-2); }
.pub-outcomes { margin-bottom: var(--space-6); }
.pub-outcomes h2 { margin: 0 0 var(--space-3); font: 700 1.3rem/1.2 var(--font-display); }
.pub-outcomes ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 24px; margin: 0; padding: 0; list-style: none; }
.pub-outcomes li { position: relative; padding-left: 28px; }
.pub-outcomes li::before { content: ""; position: absolute; left: 0; top: .3em; width: 18px; height: 18px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.6L12 5.4' fill='none' stroke='%2317804a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.pub-prose { font-size: 1.0625rem; line-height: 1.75; color: var(--ink); }
.pub-prose h2 { margin: var(--space-6) 0 var(--space-3); font: 750 1.5rem/1.2 var(--font-display); letter-spacing: -.02em; }
.pub-prose h3 { margin: var(--space-5) 0 var(--space-2); font: 700 1.2rem/1.25 var(--font-display); }
.pub-prose p, .pub-prose ul, .pub-prose ol { margin: 0 0 var(--space-4); }
.pub-prose ul, .pub-prose ol { padding-left: 1.3em; }
.pub-prose li + li { margin-top: 6px; }
.pub-legal { font-size: 1rem; }
.pub-legal h1 { font: 800 clamp(1.8rem, 1.3rem + 2vw, 2.6rem)/1.1 var(--font-display); letter-spacing: -.03em; margin: 0 0 var(--space-5); }
.pub-version, .pub-social { margin-top: var(--space-6); color: var(--ink-mute); font-size: var(--step--1); display: flex; flex-wrap: wrap; gap: 8px; }
.pub-syllabus { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.pub-syllabus li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: var(--space-4); align-items: start; padding: var(--space-4); border-radius: 16px; background: var(--surface); border: 1px solid var(--rule); }
.pub-syllabus h3 { margin: 0; font: 650 1.05rem/1.3 var(--font-body); }
.pub-syllabus p { margin: 4px 0 0; color: var(--ink-soft); font-size: var(--step-0); }
.pub-syl-n { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-strong); font: 800 .95rem/1 var(--font-display); }
.pub-syllabus .is-test .pub-syl-n { background: var(--gold-soft); color: var(--gold-ink); }
.pub-syl-meta { color: var(--ink-mute); font-size: var(--step--1); font-weight: 600; white-space: nowrap; }
.pub-enroll-price { margin: 0 0 var(--space-3); font: 800 2.2rem/1 var(--font-display); letter-spacing: -.03em; color: var(--ok); }
.pub-enroll-note { color: var(--ink-soft); }
.pub-enroll-login { margin: var(--space-3) 0 0; text-align: center; color: var(--ink-mute); font-size: var(--step--1); }
.pub-enroll-list { margin: var(--space-5) 0 0; padding: var(--space-4) 0 0; border-top: 1px solid var(--rule); list-style: none; display: grid; gap: 8px; color: var(--ink-soft); font-size: var(--step-0); }
.pub-enroll-list li::before { content: "✓"; margin-right: 8px; color: var(--ok); font-weight: 800; }
.pub-badge-box { display: flex; gap: var(--space-4); align-items: center; }
.pub-badge-box img { flex: none; width: 96px; height: 96px; filter: drop-shadow(0 10px 18px rgba(13, 26, 51, .22)); }
.pub-badge-name { margin: 0; font: 700 1.05rem/1.25 var(--font-display); }
.pub-badge-note { margin: 4px 0 0; color: var(--ink-mute); font-size: var(--step--1); }

/* Piè di pagina pubblico */
.pub-foot { margin-top: var(--space-7); padding: var(--space-7) 0 var(--space-5); background: var(--surface); border-top: 1px solid var(--rule); }
.pub-foot-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)); gap: var(--space-6); }
.pub-foot-grid nav { display: flex; flex-direction: column; gap: 8px; }
.pub-foot-grid nav a { color: var(--ink-soft); text-decoration: none; }
.pub-foot-grid nav a:hover { color: var(--accent-strong); }
.pub-foot-name { margin: 0; font: 750 1.25rem/1.2 var(--font-display); }
.pub-foot-tag { margin: 8px 0 0; color: var(--ink-mute); max-width: 420px; }
.pub-foot-h { margin: 0 0 4px; font-size: .75rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-mute); }
.pub-foot-legal { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--rule); color: var(--ink-mute); font-size: .8125rem; }
.pub-foot-legal a { color: var(--ink-mute); }

@media (max-width: 980px) {
  .pub-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub-course-hero-grid, .pub-course-grid { grid-template-columns: minmax(0, 1fr); }
  .pub-course-side { position: static; }
  .pub-course-media { order: -1; }
}
@media (max-width: 720px) {
  .pub-top-inner { gap: var(--space-3); min-height: 60px; }
  .pub-nav { display: none; }
  .pub-brand { margin-right: auto; }
  .pub-brand-name { max-width: 40vw; }
  .pub-login { display: none; }
  .pub-actions .theme-toggle { display: none; }
  .pub-foot-grid { grid-template-columns: minmax(0, 1fr); }
  .pub-author { flex-direction: column; text-align: center; }
  .pub-syllabus li { grid-template-columns: 36px minmax(0, 1fr); }
  .pub-syl-meta { grid-column: 2; }
  .pub-search { flex-direction: column; }
}
@media (max-width: 480px) {
  .pub-steps { grid-template-columns: minmax(0, 1fr); }
  .pub-grid { grid-template-columns: minmax(0, 1fr); }
  .pub-hero-cta .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .pub-card, .pub-card-media img { transition: none; transform: none !important; }
}

/* ----------------------------------------------------------------- registrazione */
.hp-field { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.auth-academy { margin: 0; font: 800 clamp(2rem, 1.4rem + 2vw, 3rem)/1.05 var(--font-display); letter-spacing: -.03em; color: #fff; }
.auth-product a { color: #9fd8ff; font-weight: 600; }
.consents { display: grid; gap: 10px; margin: var(--space-4) 0; padding: 0; border: 0; }
.consents .checkbox { align-items: flex-start; }
.consents .checkbox.has-error span { color: var(--error); }
.pow-status { margin: var(--space-3) 0 0; display: flex; align-items: center; gap: 8px; color: var(--ink-mute); font-size: .8125rem; }
.pow-status::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--rule-strong); flex: none; }
.pow-status[data-state="working"]::before { background: var(--gold); }
.fx-anim .pow-status[data-state="working"]::before { animation: pubPulseGold 1.2s ease-in-out infinite; }
.pow-status[data-state="done"]::before { background: var(--ok); }
.pow-status[data-state="error"] { color: var(--error); }
.pow-status[data-state="error"]::before { background: var(--error); }
@keyframes pubPulseGold { 50% { opacity: .35; } }
.auth-icon { display: grid; place-items: center; width: 84px; height: 84px; margin: 0 0 var(--space-4); border-radius: 24px; background: var(--accent-soft); color: var(--accent-strong); }
.auth-icon.is-ok { background: var(--ok-soft); color: var(--ok); }
.auth-steps { margin: var(--space-4) 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--ink-soft); }
.reveal-field { display: flex; gap: 8px; }
.reveal-field input { flex: 1; min-width: 0; }

/* ----------------------------------------------------------------- gestione Academy */
.ac-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-5) 0; }
.ac-toolbar > p { margin: 0; max-width: 680px; }
.ac-course-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin: var(--space-4) 0; }
.ac-course-head h2 { margin: 0; }
.ac-course-actions, .ac-inline-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ac-course-actions form, .ac-inline-actions form, .ac-inline-form { display: inline; }
.ac-inline-form { display: block; margin-top: var(--space-3); }
.ac-cover-preview, .ac-og-preview { display: block; max-width: 360px; width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; margin: 6px 0 10px; border-radius: 12px; border: 1px solid var(--rule); }
.ac-jump { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--space-5) 0; }
.ac-jump a { padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); color: var(--ink-soft); font-size: var(--step--1); font-weight: 600; text-decoration: none; }
.ac-jump a:hover { border-color: var(--accent); color: var(--accent-strong); }
.form > .panel + .panel, .form > .panel + .actions, section.panel[id] { margin-top: var(--space-4); scroll-margin-top: 90px; }
.ac-mail-previews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-4); }
.ac-mail-previews figure { margin: 0; }
.ac-mail-previews iframe { width: 100%; height: 560px; border: 1px solid var(--rule); border-radius: 14px; background: #eef1f5; }
.ac-mail-previews figcaption { margin-top: 6px; color: var(--ink-mute); font-size: var(--step--1); }
.ac-pause { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-4); border-left: 4px solid var(--ok); }
.ac-pause.is-paused { border-left-color: var(--error); background: var(--error-soft); }
.ac-pause h2 { margin: 0 0 4px; }
.ac-pause p { margin: 0; }
.ac-reasons { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.ac-reasons li { padding: 6px 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--rule); font-size: var(--step--1); }
.ac-layers { display: grid; gap: 8px; padding-left: 1.3em; }
.ac-flags { display: grid; gap: 8px; margin-top: var(--space-4); }
.serp { margin-top: var(--space-4); padding: var(--space-4); max-width: 640px; border-radius: 14px; background: var(--surface); border: 1px solid var(--rule); font-family: Arial, sans-serif; }
.serp-url { margin: 0; color: var(--ink-soft); font-size: 13px; }
.serp-title { margin: 4px 0; color: #1a0dab; font-size: 19px; line-height: 1.3; }
.serp-desc { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
:root[data-theme="dark"] .serp-title { color: #8ab4f8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .serp-title { color: #8ab4f8; } }
@media (max-width: 820px) { .ac-mail-previews { grid-template-columns: minmax(0, 1fr); } }

/* ----------------------------------------------------------------- analitiche web */
.wa-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); margin: var(--space-5) 0 var(--space-3); }
.wa-periods { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.wa-periods > a, .wa-custom > summary { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--rule-strong); background: var(--surface); color: var(--ink-soft); font-size: var(--step--1); font-weight: 600; text-decoration: none; cursor: pointer; list-style: none; }
.wa-custom > summary::-webkit-details-marker { display: none; }
.wa-periods > a[aria-current], .wa-custom[open] > summary { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.wa-custom { position: relative; }
.wa-custom form { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px; border-radius: 14px; background: var(--glass-strong); border: 1px solid var(--rule); box-shadow: var(--shadow-3); backdrop-filter: blur(12px); white-space: nowrap; }
.wa-custom label { display: flex; gap: 6px; align-items: center; font-size: var(--step--1); }
.wa-head-right { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: var(--step--1); }
.wa-live { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--rule); font-weight: 600; }
.wa-live i { width: 9px; height: 9px; border-radius: 50%; background: var(--ink-mute); }
.wa-live.is-active i { background: var(--ok); box-shadow: 0 0 0 0 rgba(23, 128, 74, .5); }
.fx-anim .wa-live.is-active i { animation: waLive 1.8s infinite; }
@keyframes waLive { 70% { box-shadow: 0 0 0 8px rgba(23, 128, 74, 0); } 100% { box-shadow: 0 0 0 0 rgba(23, 128, 74, 0); } }
.wa-views { display: flex; gap: 2px; margin: 0 0 var(--space-5); border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: thin; }
.wa-views a { padding: 10px 14px; color: var(--ink-soft); font-weight: 600; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.wa-views a:hover { color: var(--ink); }
.wa-views a[aria-current] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.wa-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.wa-kpi { position: relative; display: flex; flex-direction: column; gap: 4px; padding: var(--space-4) var(--space-4) var(--space-3); border-radius: 18px; background: var(--card-bg); border: 1px solid var(--rule); box-shadow: var(--shadow-1); overflow: hidden; }
.wa-kpi > span { color: var(--ink-mute); font-size: .78rem; font-weight: 600; }
.wa-kpi strong { font: 800 clamp(1.5rem, 1.2rem + .9vw, 2rem)/1.05 var(--font-display); letter-spacing: -.03em; color: var(--ink); }
.wa-kpi.is-lit::after, .wa-card.is-lit::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(360px circle at var(--mx) var(--my), var(--lit-glow), transparent 60%); }
.wa-delta { align-self: flex-start; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--surface-3); color: var(--ink-soft); }
.wa-delta.is-up { background: var(--ok-soft); color: var(--ok); }
.wa-delta.is-down { background: var(--error-soft); color: var(--error); }
.wa-delta.is-new { background: var(--info-soft); color: var(--info); }
.wa-grid { display: grid; gap: var(--space-4); margin-bottom: var(--space-4); }
.wa-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wa-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wa-grid-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.wa-card { position: relative; padding: var(--space-5); border-radius: var(--radius-panel); background: var(--card-bg); border: 1px solid var(--rule); box-shadow: var(--shadow-2); min-width: 0; margin-bottom: var(--space-4); overflow: hidden; }
.wa-grid > .wa-card { margin-bottom: 0; }
.wa-card h2 { margin: 0 0 var(--space-4); font: 700 1.1rem/1.2 var(--font-display); letter-spacing: -.01em; }
.wa-card h3 { margin: var(--space-5) 0 var(--space-3); font-size: 1rem; }
.wa-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: var(--space-2) 0 0; color: var(--ink-mute); font-size: var(--step--1); }
.wa-sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
.wa-sw-1 { background: #2f5bea; }
.wa-sw-2 { background: #e3a72f; }
.wa-sw-ok { background: var(--accent); border-radius: 50%; }
.wa-sw-bad { background: var(--error); border-radius: 50%; }
.wa-now { display: flex; align-items: baseline; gap: 10px; margin: 0 0 var(--space-4); }
.wa-now strong { font: 800 3rem/1 var(--font-display); letter-spacing: -.04em; color: var(--ok); }
.wa-now span { color: var(--ink-mute); font-size: var(--step--1); }
.wa-bars { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.wa-bars li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(60px, 1fr) auto; align-items: center; gap: 10px; font-size: var(--step--1); }
.wa-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-weight: 500; }
.wa-bar-track, .wa-funnel-track { display: block; height: 10px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.wa-bar-fill { display: block; height: 100%; width: var(--w, 0%); border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.fx-anim .wa-bar-fill { animation: waGrow .9s var(--ease-out) both; transform-origin: left; }
@keyframes waGrow { from { transform: scaleX(0); } }
.wa-bar-value { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wa-bar-value small { margin-left: 6px; color: var(--ink-mute); font-weight: 500; }
.wa-funnel { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.wa-funnel-text { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; font-size: var(--step--1); }
.wa-funnel-text strong { font-variant-numeric: tabular-nums; }
.wa-funnel-track { height: 14px; }
.wa-funnel li:nth-child(n+4) .wa-bar-fill { background: linear-gradient(90deg, var(--gold), #f4be4f); }
.wa-funnel li:nth-child(n+6) .wa-bar-fill { background: linear-gradient(90deg, var(--ok), #3fbf7a); }
.wa-funnel small { display: block; margin-top: 3px; }
.wa-pages td small, .table td small { display: block; color: var(--ink-mute); }
.wa-page-title { display: block; max-width: 520px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-heat { display: grid; gap: 3px; overflow-x: auto; }
.wa-heat-row { display: grid; grid-template-columns: 40px repeat(24, minmax(14px, 1fr)); gap: 3px; align-items: center; }
.wa-heat-row > span { font-size: .72rem; color: var(--ink-mute); }
.wa-heat-hours > span { text-align: left; }
.wa-heat i { display: block; aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); }
.wa-heat i.wa-h1 { background: color-mix(in srgb, var(--accent) 18%, var(--surface-3)); }
.wa-heat i.wa-h2 { background: color-mix(in srgb, var(--accent) 38%, var(--surface-3)); }
.wa-heat i.wa-h3 { background: color-mix(in srgb, var(--accent) 58%, var(--surface-3)); }
.wa-heat i.wa-h4 { background: color-mix(in srgb, var(--accent) 78%, var(--surface-3)); }
.wa-heat i.wa-h5 { background: var(--accent); }
.wa-utm { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--rule); }
.wa-utm-out { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: var(--space-3) 0 0; }
.wa-utm-out code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--rule); overflow-wrap: anywhere; font-size: .8125rem; }
.wa-tips { display: grid; gap: 8px; padding-left: 1.2em; }
@media (max-width: 1100px) { .wa-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .wa-grid-2, .wa-grid-2-1, .wa-grid-3 { grid-template-columns: minmax(0, 1fr); } .wa-custom form { position: static; margin-top: 8px; white-space: normal; } }
@media (max-width: 520px) { .wa-bars li { grid-template-columns: minmax(0, 1fr) auto; } .wa-bar-track { grid-column: 1 / -1; grid-row: 2; } }

/* ----------------------------------------------------------------- mappa del mondo */
.wa-map { position: relative; margin: 0 -8px; }
.c-map { display: block; width: 100%; height: auto; }
.map-c { fill: var(--surface-3); stroke: var(--card-bg); stroke-width: .6; transition: fill .2s; }
.map-c:hover { stroke: var(--ink); stroke-width: 1; }
.map-l1 { fill: color-mix(in srgb, var(--accent) 22%, var(--surface-3)); }
.map-l2 { fill: color-mix(in srgb, var(--accent) 40%, var(--surface-3)); }
.map-l3 { fill: color-mix(in srgb, var(--accent) 58%, var(--surface-3)); }
.map-l4 { fill: color-mix(in srgb, var(--accent) 78%, var(--surface-3)); }
.map-l5 { fill: var(--accent); }
.map-p { fill: var(--gold); fill-opacity: .78; stroke: var(--card-bg); stroke-width: 1.2; }
.map-p:hover { fill-opacity: 1; stroke: var(--ink); }
.map-p-ok { fill: var(--accent-2); }
.map-p-bad { fill: var(--error); }
.fx-anim .map-points circle { animation: mapPop .7s var(--ease-spring) both; }
@keyframes mapPop { from { r: 0; opacity: 0; } }
.map-legend { display: flex; align-items: center; gap: 4px; margin-top: var(--space-2); color: var(--ink-mute); font-size: .75rem; }
.map-legend i { width: 26px; height: 10px; border-radius: 3px; }
.map-legend span:first-child { margin-right: 4px; }
.map-legend span:last-child { margin-left: 4px; }
.map-legend .map-l1 { background: color-mix(in srgb, var(--accent) 22%, var(--surface-3)); }
.map-legend .map-l2 { background: color-mix(in srgb, var(--accent) 40%, var(--surface-3)); }
.map-legend .map-l3 { background: color-mix(in srgb, var(--accent) 58%, var(--surface-3)); }
.map-legend .map-l4 { background: color-mix(in srgb, var(--accent) 78%, var(--surface-3)); }
.map-legend .map-l5 { background: var(--accent); }
.pub-proof-grid { display: flex; flex-wrap: wrap; gap: var(--space-5) clamp(32px, 6vw, 88px); }
.pub-final-inner p { margin-inline: auto; }
@media (max-width: 980px) { .pub-course-side { order: -1; } }
@media (max-width: 720px) { .pub-brand-logo + .pub-brand-name { display: none; } .pub-brand-logo { max-width: 46vw; } }
.auth-logo img { width: auto; height: auto; object-fit: contain; }
.auth-academy + .auth-claim { margin-top: var(--space-4); font: 500 clamp(1.05rem, .95rem + .45vw, 1.35rem)/1.5 var(--font-body); letter-spacing: 0; color: rgba(232, 240, 255, .84); background: none; -webkit-text-fill-color: currentColor; max-width: 30ch; }

/* =====================================================================================
 * Strato «Atelier» (v3.1): struttura, superfici, tipografia e movimento.
 * Viene dopo tutte le sezioni e usa solo le variabili dei due temi.
 * ===================================================================================== */

html { background: var(--paper); scrollbar-color: var(--rule-strong) transparent; }
body {
  position: relative;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 450;
  letter-spacing: -0.003em;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05", "ss01";
}
::selection { background: color-mix(in srgb, var(--accent) 24%, transparent); color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
a { color: var(--ink); text-decoration-color: color-mix(in srgb, currentColor 32%, transparent); text-decoration-thickness: 1px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
strong, b { font-weight: 700; }
code, .mono { font-family: var(--font-mono); font-size: .84em; font-weight: 500; background: var(--surface-3); color: var(--ink-soft); padding: 2px 6px; border-radius: 6px; }
kbd { font: 600 11px/1 var(--font-body); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--rule-strong); border-bottom-width: 2px; background: var(--surface); color: var(--ink-mute); }

/* Fondo: velature calde in alto e grana leggera, nessun motivo geometrico */
body::before, body::after { content: ""; position: fixed; pointer-events: none; z-index: -1; }
body::before {
  inset: 0;
  background:
    radial-gradient(60vw 40vh at 100% -6%, var(--aurora-a), transparent 70%),
    radial-gradient(46vw 34vh at 30% -10%, var(--aurora-c), transparent 70%),
    radial-gradient(40vw 40vh at 0% 110%, var(--aurora-b), transparent 70%);
}
body::after {
  inset: 0; opacity: var(--grain); mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .6 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] body::after { mix-blend-mode: screen; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::after { mix-blend-mode: screen; } }

/* Tipografia: Fraunces per titoli e numeri, Manrope per il testo */
h1, h2, h3, .stat-value, .kpi-value, .auth-claim {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 50;
  color: var(--ink);
}
h1 { font-size: clamp(1.85rem, 1.2rem + 1.8vw, 2.6rem); font-weight: 560; letter-spacing: -0.022em; line-height: 1.08; }
h2 { font-weight: 580; letter-spacing: -0.014em; line-height: 1.18; }
h3 { font-family: var(--font-body); font-weight: 700; letter-spacing: -0.01em; font-variation-settings: normal; }
legend { font-family: var(--font-display); font-weight: 580; font-variation-settings: "SOFT" 50; }
.lead { color: var(--ink-soft); font-size: 1.03rem; line-height: 1.6; }
.muted, .breadcrumb, .breadcrumb a { color: var(--ink-mute); }
.breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; letter-spacing: .01em; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }

/* ------------------------------------------------------------------ Struttura dell'applicazione */
.app-shell { display: grid; grid-template-columns: var(--sb-w) minmax(0, 1fr); min-height: 100vh; transition: grid-template-columns .35s var(--ease-out); }
.app-shell:not(:has(.sidebar)) { grid-template-columns: minmax(0, 1fr); }
.app-main { display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }
.app-main > main { flex: 1 0 auto; }
:root[data-rail] { --sb-w: 84px; }

/* Barra laterale: sempre scura, in entrambi i temi */
.sidebar {
  position: sticky; top: 0; z-index: 60; height: 100vh;
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px 12px 14px;
  color: var(--sb-ink);
  background:
    radial-gradient(240px 200px at 0% 0%, rgba(124, 99, 255, .30), transparent 70%),
    radial-gradient(260px 220px at 100% 100%, rgba(255, 120, 80, .14), transparent 70%),
    linear-gradient(180deg, var(--sb-bg-2), var(--sb-bg));
  border-right: 1px solid var(--sb-line);
  overflow: hidden;
  color-scheme: dark;
}
.sb-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 8px; }
.sb-brand { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; color: var(--sb-ink); text-decoration: none; }
.sb-brand:hover { color: #fff; }
.sb-mark {
  flex: none; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(145deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .03));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1), 0 10px 24px -12px rgba(0, 0, 0, .8);
}
.sb-mark .fxa-mark { width: 28px; height: 28px; }
.sb-brand-text { display: grid; min-width: 0; line-height: 1.2; }
.sb-brand-text strong { font: 600 1.02rem/1.2 var(--font-display); font-variation-settings: "SOFT" 80; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-brand-text small { color: var(--sb-mute); font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.sb-close { display: none; margin-left: auto; width: 38px; height: 38px; border: 0; border-radius: 11px; background: rgba(255, 255, 255, .06); color: var(--sb-ink); cursor: pointer; place-items: center; }
.sb-company { margin: 2px 4px 6px; padding: 10px 12px; border-radius: 14px; background: #fff; display: flex; justify-content: center; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .9); }
.sb-company img { display: block; max-height: 30px; max-width: 100%; width: auto; }
.sb-nav { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; margin: 0 -6px; padding: 0 6px 8px; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .14) transparent; }
.sb-group + .sb-group { margin-top: 6px; }
.sb-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.sb-label { margin: 10px 0 3px; padding: 0 12px; color: var(--sb-mute); font-size: 10.5px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; display: flex; align-items: center; gap: 10px; }
.sb-label::after { content: ""; flex: 1; height: 1px; background: var(--sb-line); }
.sb-link {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 38px; padding: 0 12px;
  border-radius: 12px; color: var(--sb-mute); font-weight: 620; font-size: 14px; text-decoration: none; white-space: nowrap;
  transition: background-color .2s ease, color .2s ease;
}
.sb-link .ico { flex: none; opacity: .9; transition: transform .35s var(--ease-spring), color .2s ease; }
.sb-link span { overflow: hidden; text-overflow: ellipsis; }
.sb-link:hover { background: var(--sb-hover); color: var(--sb-ink); }
.sb-link:hover .ico { transform: translateX(1px) scale(1.06); }
.sb-link[aria-current="page"] {
  color: #fff;
  background: linear-gradient(90deg, var(--sb-active), rgba(124, 99, 255, .06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
}
.sb-link[aria-current="page"] .ico { color: var(--sb-accent); opacity: 1; }
.sb-link[aria-current="page"]::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: linear-gradient(180deg, var(--sb-accent), #ff6b3d); }
.sb-link:focus-visible { outline-color: var(--sb-accent); }
.sb-foot { display: grid; gap: 4px; padding-top: 8px; border-top: 1px solid var(--sb-line); }
.sb-help { display: flex; align-items: center; gap: 12px; padding: 7px 8px; border-radius: 13px; background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); color: var(--sb-ink); text-decoration: none; transition: background-color .2s ease; }
.sb-help:hover { background: rgba(255, 255, 255, .09); color: #fff; }
.sb-help-ico { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, #ff8a5c, #ff5f8f); color: #fff; }
.sb-help-text { display: grid; line-height: 1.25; min-width: 0; }
.sb-help-text strong { font-size: 13.5px; }
.sb-help-text small { color: var(--sb-mute); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-rail { display: flex; align-items: center; gap: 12px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 10px; background: transparent; color: var(--sb-mute); font: 600 12.5px/1 var(--font-body); cursor: pointer; white-space: nowrap; }
.sb-rail:hover { color: var(--sb-ink); background: var(--sb-hover); }
.sb-rail .ico { flex: none; }

/* Menu ridotto a icone */
:root[data-rail] .sb-brand-text, :root[data-rail] .sb-link span, :root[data-rail] .sb-help-text, :root[data-rail] .sb-rail span, :root[data-rail] .sb-company { display: none; }
:root[data-rail] .sb-head { justify-content: center; padding-inline: 0; }
:root[data-rail] .sb-brand { flex: none; }
:root[data-rail] .sb-label { padding: 0 8px; margin: 10px 0 6px; font-size: 0; gap: 0; }
:root[data-rail] .sb-link, :root[data-rail] .sb-rail, :root[data-rail] .sb-help { justify-content: center; padding: 0; }
:root[data-rail] .sb-help { background: transparent; box-shadow: none; padding: 4px 0; }
:root[data-rail] .sb-link[aria-current="page"]::before { left: -12px; }
:root[data-rail] .sb-rail .ico { transform: scaleX(-1); }
@media (hover: hover) {
  :root[data-rail] .sb-link:hover::after {
    content: attr(data-tip); position: fixed; left: calc(var(--sb-w) - 6px); transform: translateY(0);
    padding: 7px 11px; border-radius: 9px; background: #0b0913; color: #fff; font-size: 12.5px; font-weight: 650;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .7); pointer-events: none; z-index: 90; white-space: nowrap;
    animation: fx-fade .15s ease both;
  }
}

/* Barra dell'applicazione */
.appbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  height: var(--appbar-h); padding: 0 clamp(16px, 2.6vw, 36px);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.appbar-menu { display: none; place-items: center; width: 40px; height: 40px; margin-left: -6px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; }
.appbar-menu:hover { background: var(--surface-3); }
.appbar-context { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1; font-size: 14px; }
.appbar-group { color: var(--ink-mute); font-weight: 600; white-space: nowrap; }
.appbar-sep { color: var(--rule-hover); }
.appbar-page { font-weight: 750; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar-search {
  display: flex; align-items: center; gap: 10px; width: min(340px, 30vw); height: 40px; padding: 0 8px 0 13px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--surface); color: var(--ink-mute);
  font: 550 13.5px/1 var(--font-body); cursor: pointer; box-shadow: var(--shadow-1);
  transition: border-color .2s ease, box-shadow .2s ease, color .2s ease;
}
.appbar-search span { flex: 1; text-align: left; }
.appbar-search:hover { border-color: var(--rule-hover); color: var(--ink-soft); box-shadow: var(--shadow-2); }
.appbar-tools { display: flex; align-items: center; gap: 4px; }
.tool, .theme-toggle {
  position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink-soft); cursor: pointer; text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.tool:hover, .theme-toggle:hover, .tool.is-current { background: var(--surface-3); color: var(--ink); }
.tool.is-current { color: var(--accent); }
.theme-toggle .ti { display: none; grid-area: 1 / 1; }
:root[data-theme-pref="auto"] .theme-toggle .ti-auto, :root:not([data-theme-pref]) .theme-toggle .ti-auto,
:root[data-theme-pref="light"] .theme-toggle .ti-light, :root[data-theme-pref="dark"] .theme-toggle .ti-dark { display: block; animation: fx-icon .5s var(--ease-spring) both; }
@keyframes fx-icon { from { transform: rotate(-90deg) scale(.4); opacity: 0; } }
.bell-count {
  position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; font: 800 10.5px/1 var(--font-body);
  background: linear-gradient(135deg, #ff7a4d, #f0386b); color: #fff; box-shadow: 0 0 0 2px var(--paper);
}
.bell.is-ringing .ico { animation: fx-ring 1.1s ease 2; transform-origin: 50% 15%; }
@keyframes fx-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(14deg); } 30% { transform: rotate(-12deg); } 45% { transform: rotate(8deg); } 60% { transform: rotate(-5deg); } 75% { transform: rotate(2deg); } }

.acct { position: relative; margin-left: 6px; }
.acct > summary { list-style: none; }
.acct > summary::-webkit-details-marker { display: none; }
.acct-trigger { display: flex; align-items: center; gap: 10px; padding: 3px 12px 3px 3px; border-radius: 999px; border: 1px solid var(--rule); background: var(--surface); cursor: pointer; box-shadow: var(--shadow-1); transition: border-color .2s ease, box-shadow .2s ease; }
.acct-trigger:hover, .acct[open] .acct-trigger, .acct-trigger.is-current { border-color: var(--rule-hover); box-shadow: var(--shadow-2); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font: 750 12.5px/1 var(--font-body); letter-spacing: .02em;
  color: #fff; background: linear-gradient(140deg, #7b5cff 0%, #c450d8 55%, #ff7a4d 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25);
}
.avatar-lg { width: 52px; height: 52px; font-size: 16px; }
.who { display: grid; line-height: 1.2; min-width: 0; }
.who strong { font-size: 13.5px; font-weight: 700; color: var(--ink); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.who small { font-size: 11.5px; color: var(--ink-mute); white-space: nowrap; }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 70; width: 300px; padding: 8px;
  border-radius: 18px; background: var(--surface); border: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  box-shadow: var(--shadow-3); display: grid; gap: 2px;
  animation: fx-menu .22s var(--ease-out) both; transform-origin: 90% 0;
}
@keyframes fx-menu { from { opacity: 0; transform: translateY(-6px) scale(.97); } }
.acct-head { display: flex; gap: 12px; align-items: center; padding: 10px 10px 14px; margin-bottom: 4px; border-bottom: 1px solid var(--rule); }
.acct-head > span:last-child { display: grid; min-width: 0; line-height: 1.3; }
.acct-head strong { font-size: 15px; }
.acct-head small { color: var(--ink-mute); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-role { justify-self: start; margin-top: 6px; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 11.5px; font-weight: 700; }
.acct-menu a, .acct-menu button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--ink); font: 600 14px/1.2 var(--font-body); text-decoration: none; cursor: pointer; text-align: left;
}
.acct-menu a .ico, .acct-menu button .ico { color: var(--ink-mute); }
.acct-menu a:hover, .acct-menu button:hover { background: var(--surface-3); color: var(--ink); }
.acct-menu form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--rule); }
.acct-menu button:hover { color: var(--error); }
.acct-menu button:hover .ico { color: var(--error); }
.acct-count { margin-left: auto; min-width: 22px; padding: 2px 7px; border-radius: 999px; background: var(--coral-soft); color: var(--coral-ink); font-size: 11.5px; font-weight: 800; text-align: center; }

/* Ricerca rapida */
.cmdk { position: fixed; inset: 0; z-index: 200; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.cmdk-scrim { position: absolute; inset: 0; background: rgba(12, 9, 22, .48); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fx-fade .2s ease both; }
.cmdk-box { position: relative; width: min(620px, 100%); max-height: 70vh; display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow-3), 0 0 0 1px rgba(255, 255, 255, .04); overflow: hidden; animation: fx-menu .25s var(--ease-out) both; transform-origin: 50% 0; }
.cmdk-field { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--rule); color: var(--ink-mute); }
.cmdk-field input { flex: 1; min-width: 0; height: 58px; border: 0; outline: 0; background: transparent; color: var(--ink); font: 550 16px/1 var(--font-body); }
.cmdk-field input::-webkit-search-cancel-button { display: none; }
.cmdk-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.cmdk-list a { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 620; }
.cmdk-list a .ico { color: var(--ink-mute); }
.cmdk-list a small { margin-left: auto; color: var(--ink-mute); font-size: 12px; font-weight: 600; }
.cmdk-list a:hover, .cmdk-list a.is-active { background: var(--accent-soft); color: var(--accent-strong); }
.cmdk-list a.is-active .ico, .cmdk-list a:hover .ico { color: var(--accent); }
.cmdk-empty { margin: 0; padding: 24px; text-align: center; color: var(--ink-mute); }
.cmdk-hint { display: flex; gap: 18px; margin: 0; padding: 10px 16px; border-top: 1px solid var(--rule); color: var(--ink-mute); font-size: 12px; background: var(--surface-2); max-width: none; }
.cmdk-hint kbd { margin-right: 4px; }
:root.cmdk-on { overflow: hidden; }

/* Pagina */
.page { width: 100%; max-width: 1320px; margin: 0 auto; padding: clamp(24px, 3vw, 40px) clamp(16px, 3vw, 44px) 72px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--space-5); margin-bottom: 28px; }
.page-head h1 { margin-bottom: 6px; }
.page-head .lead { margin: 0; max-width: 72ch; }
.page-head .head-actions, .page-head > .btn, .page-head > form { flex: none; }
.narrow { max-width: 720px; }
.section-title { font: 580 1.25rem/1.2 var(--font-display); font-variation-settings: "SOFT" 50; letter-spacing: -.012em; margin: var(--space-6) 0 var(--space-3); }
.section-head h2 { font-size: 1.35rem; }
.subsection, .group-title { font: 700 .95rem/1.3 var(--font-body); color: var(--ink); letter-spacing: -.005em; }
.footer {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
  padding: 18px clamp(16px, 3vw, 44px); border-top: 1px solid var(--line);
  color: var(--ink-mute); font-size: 12.5px; background: transparent;
}
.footer a { color: var(--ink-soft); }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; }

/* Superfici: carta pulita, bordo sottile, ombra morbida */
.panel, .doc-card, .setting-block, .credential-card, .external-card, .filters, .table-wrap, .stat, .kpi,
.area-grid a, .todo-list a, .training-card, .notif-list, .report-card, .q-preview, .an-card, .chart-card, .team-list, .level-editor, .signer-list li, .upload-box, .lesson-stage {
  background: var(--card-bg);
  border: 1px solid var(--rule);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-1);
}
.empty, .readiness { background: var(--surface-2); border: 1.5px dashed var(--rule-strong); border-radius: var(--radius-panel); box-shadow: none; }
.readiness.is-ready { border-style: solid; border-color: var(--ok-line); background: var(--ok-soft); }
.panel { padding: 24px 26px; }
.panel h2 { font-size: 1.2rem; }
:is(.area-grid a, .todo-list a, .doc-card, .report-card, .stat-link, .kpi, .course-card) { transition: transform .35s var(--ease-out), box-shadow .3s ease, border-color .3s ease; }
:is(.area-grid a, .todo-list a, .doc-card, .report-card, .stat-link, .course-card):hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--rule-hover); }

/* Luce discreta che segue il cursore (classe messa da fx.js) */
.is-lit:not(.readiness, .notice, .empty) { background: radial-gradient(380px circle at var(--mx) var(--my), var(--lit-glow), transparent 70%), var(--card-bg); }
@keyframes fx-fade { from { opacity: 0; } }

/* ------------------------------------------------------------------ Pulsanti */
.btn {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 42px; padding: 0 20px; gap: 8px;
  border-radius: 999px; font: 680 14.5px/1 var(--font-body); letter-spacing: -0.005em; white-space: nowrap;
  transition: transform .3s var(--ease-spring), box-shadow .25s ease, background-color .2s ease, border-color .2s ease, color .2s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  color: var(--on-accent); border: 0;
  background: linear-gradient(180deg, var(--btn-from), var(--btn-to));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -1px 0 rgba(0, 0, 0, .12), 0 8px 20px -10px var(--accent-glow), 0 1px 2px rgba(28, 22, 48, .14);
}
.btn-primary:hover { color: var(--on-accent); background: linear-gradient(180deg, var(--btn-to), var(--btn-to)); transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 14px 28px -12px var(--accent-glow), 0 1px 2px rgba(28, 22, 48, .14); }
.btn-primary[disabled], .btn-primary[aria-disabled="true"] { background: var(--surface-3); color: var(--ink-mute); box-shadow: none; transform: none; }
.btn-quiet { background: var(--surface); color: var(--ink); border: 1px solid var(--rule-strong); box-shadow: var(--shadow-1); }
.btn-quiet:hover { background: var(--surface); color: var(--ink); border-color: var(--ink); transform: translateY(-1px); }
.btn-danger { background: var(--error); color: #fff; border: 0; box-shadow: 0 8px 20px -10px color-mix(in srgb, var(--error) 70%, transparent); }
.btn-danger:hover { color: #fff; filter: brightness(.94); }
.btn-small { min-height: 34px; padding: 0 14px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 0 28px; font-size: 1rem; }
.btn-block { width: 100%; }
.fx-wave { position: absolute; left: var(--wx); top: var(--wy); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: currentColor; opacity: .22; pointer-events: none; z-index: -1; animation: fx-wave .6s var(--ease-out) forwards; }
@keyframes fx-wave { to { transform: scale(26); opacity: 0; } }
.link-quiet { color: var(--ink-mute); font-weight: 600; }

/* ------------------------------------------------------------------ Campi */
.field { gap: 7px; }
.field label, .field legend { color: var(--ink); font-weight: 680; font-size: 13.5px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="url"], .field input[type="number"],
.field input[type="date"], .field input[type="datetime-local"], .field input[type="time"], .field input[type="search"], .field input[type="tel"], .field select, .field textarea,
.assess-cell select, .assess-cell input {
  min-height: 44px; padding: 10px 14px;
  background-color: var(--field-bg); color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: var(--radius-field);
  font: 500 15px/1.4 var(--font-body);
  transition: border-color .2s ease, box-shadow .25s ease, background-color .2s ease;
}
.field select { padding-right: 38px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23857f96' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; }
.field select[multiple] { background-image: none; padding-right: 14px; }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--rule-hover); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--accent); background-color: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-soft); }
.hint, .field .hint { color: var(--ink-mute); font-size: 12.5px; }
input::placeholder, textarea::placeholder { color: var(--ink-mute); opacity: .75; }
.checkbox input, .choice input, input[type="radio"], input[type="checkbox"] { accent-color: var(--accent); }
.choice, .option, .score-choice, .tpl-card, .level-choice { border-radius: 16px; background: var(--surface); transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease; }
.choice { border-color: var(--rule-strong); }
.choice:hover, .option:hover { border-color: var(--rule-hover); }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
fieldset { border-top-color: var(--rule); }
.actions { border-top-color: var(--rule); }
.segmented { border-radius: 999px; padding: 3px; gap: 2px; background: var(--surface-3); border: 0; }
.segment span { border: 0 !important; border-radius: 999px; padding: 7px 13px; font-weight: 650; }
.segment input:checked + span { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-2); }
.segment-0 input:checked + span { background: var(--surface); color: var(--ink-mute); }
.field input[type="file"]::file-selector-button { border-radius: 999px; background: var(--surface); border: 1px solid var(--rule-strong); font-weight: 650; }

/* ------------------------------------------------------------------ Filtri e tabelle */
.filters { padding: 16px; gap: 12px; }
.table-wrap { overflow: auto; }
.table th {
  background: var(--surface-2); color: var(--ink-mute);
  font-size: 11.5px; font-weight: 750; letter-spacing: .07em; text-transform: uppercase;
  padding: 12px 16px; border-bottom: 1px solid var(--rule);
}
.table td { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.table tbody tr { transition: background-color .15s ease; }
.table tbody tr:hover { background: color-mix(in srgb, var(--accent) 4%, var(--surface)); }
.row-link { color: var(--ink); font-weight: 700; text-decoration: none; }
.row-link:hover { color: var(--accent); text-decoration: underline; }
.table code, .lesson-ident code, .doc-card code { background: var(--surface-3); color: var(--ink-soft); }
.pagination a { font-weight: 650; }

/* ------------------------------------------------------------------ Etichette, avvisi, schede */
.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; letter-spacing: .005em; }
.badge-active, .badge-review, .badge-suspended, .badge-danger { display: inline-flex; align-items: center; gap: 6px; }
.badge-active::before, .badge-review::before, .badge-suspended::before, .badge-danger::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-review { background: var(--info-soft); color: var(--info); }
.badge-draft { background: var(--surface); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--rule-strong); }
.tag { border-radius: 6px; border-color: var(--rule-strong); color: var(--ink-soft); background: var(--surface); padding: 1px 7px; }
.status-pill { border-radius: 999px; font-weight: 700; }
.notice {
  position: relative; display: grid; gap: 4px;
  padding: 14px 18px 14px 50px; border-radius: 16px; border: 1px solid var(--info-line); border-left-width: 1px;
  background: var(--info-soft); color: var(--ink); box-shadow: none;
}
.notice::before {
  content: ""; position: absolute; left: 16px; top: 15px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--info) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 9v5' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='6' r='1.2' fill='white'/%3E%3C/svg%3E") center/20px no-repeat;
}
.notice-success { background: var(--ok-soft); border-color: var(--ok-line); }
.notice-success::before { background-color: var(--ok); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m6 10.2 2.6 2.6L14 7.4' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.notice-warn { background: var(--warn-soft); border-color: var(--warn-line); }
.notice-warn::before { background-color: var(--warn); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 5.5v5.5' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3Ccircle cx='10' cy='14.2' r='1.2' fill='white'/%3E%3C/svg%3E"); }
.notice-error { background: var(--error-soft); border-color: var(--error-line); }
.notice-error::before { background-color: var(--error); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='m7 7 6 6M13 7l-6 6' stroke='white' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E"); }
.notice-info { background: var(--info-soft); border-color: var(--info-line); }
.fx-anim .notice[role="status"], .fx-anim .notice[role="alert"] { animation: fx-pop .55s var(--ease-spring) both .1s; }
@keyframes fx-pop { from { opacity: 0; transform: translateY(-6px) scale(.985); } }

/* Schede delle sezioni: barra a pillola */
.tabs {
  display: flex; width: fit-content; max-width: 100%; gap: 2px; padding: 4px; margin-bottom: 28px;
  border: 1px solid var(--rule); border-radius: 999px; background: var(--surface-3);
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 16px; margin: 0; border: 0; border-radius: 999px; color: var(--ink-soft); font-weight: 650; font-size: 14px; white-space: nowrap; text-decoration: none; transition: color .2s ease, background-color .2s ease, box-shadow .2s ease; }
.tabs a:hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.tabs a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow-2); }
.disclosure summary { transition: color .2s ease; }
.disclosure summary:hover { color: var(--accent); }
.disclosure-boxed { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); box-shadow: var(--shadow-1); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.progress::-webkit-progress-bar { background: var(--surface-3); border-radius: 999px; }
.progress::-webkit-progress-value { border-radius: 999px; background: linear-gradient(90deg, var(--accent), #c450d8 60%, var(--coral)); }
.progress::-moz-progress-bar { border-radius: 999px; background: linear-gradient(90deg, var(--accent), #c450d8 60%, var(--coral)); }

/* ------------------------------------------------------------------ Numeri in evidenza */
.stat { position: relative; padding: 20px 22px; gap: 4px; }
.stat-value { font-weight: 560; font-size: 2.4rem; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.stat-value.stat-text { font-family: var(--font-body); font-variation-settings: normal; font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.stat-label { color: var(--ink-mute); font-size: 13px; font-weight: 600; }
.stat-alert { border-color: var(--warn-line); background: linear-gradient(180deg, var(--warn-soft), var(--surface) 120%); }
.stat-alert .stat-value { color: var(--warn); }
.stat-link:hover { color: inherit; }
.stat-row:not(:last-child) { margin-bottom: var(--space-5); }

/* Panoramica */
.welcome { gap: clamp(var(--space-5), 4vw, var(--space-7)); }
.welcome h1 { font-size: clamp(2.2rem, 1.4rem + 2.4vw, 3.2rem); margin-bottom: 8px; font-weight: 520; }
.welcome h1 .wave { font-style: italic; font-weight: 500; background: linear-gradient(100deg, var(--accent) 10%, #c450d8 55%, var(--coral) 95%); -webkit-background-clip: text; background-clip: text; color: transparent; padding-right: .06em; }
.kpi-row { list-style: none; margin: var(--space-5) 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { position: relative; display: grid; gap: 4px; padding: 18px 18px 16px; }
.kpi-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; margin-bottom: 8px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.kpi-icon svg { width: 19px; height: 19px; }
.kpi-value { font-weight: 560; font-size: 2.2rem; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.kpi-label { color: var(--ink-mute); font-size: 13px; font-weight: 600; }
.kpi.is-warn .kpi-icon { background: var(--error-soft); color: var(--error); }
.kpi.is-gold .kpi-icon { background: var(--gold-soft); color: var(--gold-ink); }
.kpi.is-ok .kpi-icon { background: var(--ok-soft); color: var(--ok); }
.dash-side { position: sticky; top: calc(var(--appbar-h) + 20px); }
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dash-side { position: static; } }
.training-card { position: relative; overflow: hidden; border-left: 1px solid var(--rule); padding-left: var(--space-5); }
.training-card::before { content: none; }
.training-card.is-overdue { border-color: var(--error-line); background: linear-gradient(90deg, var(--error-soft), var(--surface) 40%); }
.todo-list a { border-left: 1px solid var(--rule); }
.todo-list li:has(> a) { display: block; }
.todo-list li:has(> a)::before { content: none; }
.todo-count { min-width: 32px; height: 32px; padding: 0 9px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--coral-soft); color: var(--coral-ink); font: 800 14px/1 var(--font-body); }
.area-grid { gap: var(--space-4); }
.area-grid a { gap: 6px; padding: 22px; color: var(--ink); text-decoration: none; }
.area-grid strong { font: 600 1.15rem/1.2 var(--font-display); font-variation-settings: "SOFT" 50; letter-spacing: -.01em; }
.area-grid span { color: var(--ink-mute); }
.area-grid .area-icon { width: 44px; height: 44px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; color: var(--accent); background: var(--accent-soft); transition: transform .45s var(--ease-spring), background-color .3s ease, color .3s ease; }
.area-grid a:hover .area-icon { transform: rotate(-6deg) scale(1.06); background: var(--accent); color: #fff; }
.area-grid .area-icon svg { width: 22px; height: 22px; }
.dash-help { background: var(--surface-2); border: 1px solid var(--rule); border-radius: 16px; }
.dash-notifs li { border-bottom-color: var(--rule); }

/* ------------------------------------------------------------------ Grafici: tema e disegno */
.chart .c-grid { stroke: var(--rule); }
.chart .c-track { fill: var(--surface-3); stroke: var(--surface-3); }
.chart circle.c-track { fill: none; }
.chart .c-text { fill: var(--ink-mute); font-family: var(--font-body); }
.chart .c-ink { fill: var(--ink); }
.chart .c-web[fill="#F8FAFD"] { fill: var(--surface-2); }
.chart .c-dot { fill: var(--surface); }
.chart [stroke="#0F2A5C"] { stroke: var(--accent); }
.chart [fill="#0F2A5C"] { fill: var(--accent); }
.fx-anim .chart.fx-wait .c-line { stroke-dasharray: 1; stroke-dashoffset: 1; }
.fx-anim .chart.fx-seen .c-line { stroke-dasharray: 1; animation: fx-draw 1.6s var(--ease-out) forwards .1s; }
.fx-anim .chart.fx-wait :is(.c-fill, .c-dot, .c-area) { opacity: 0; }
.fx-anim .chart.fx-seen :is(.c-fill, .c-dot) { animation: fx-fade .8s ease forwards .9s; opacity: 0; }
.fx-anim .chart.fx-seen .c-area { transform-box: view-box; transform-origin: 50% 50%; animation: fx-bloom 1.1s var(--ease-spring) forwards .15s; opacity: 0; }
.fx-anim .chart.fx-wait :is(.c-bar, .c-hbar) { transform: scaleY(0); }
.fx-anim .chart.fx-seen .c-bar { transform-box: fill-box; transform-origin: 50% 100%; animation: fx-grow-y .9s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 28ms); }
.fx-anim .chart.fx-seen .c-hbar { transform-box: fill-box; transform-origin: 0 50%; animation: fx-grow-x 1s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms); }
.fx-anim .chart.fx-seen .c-ring { animation: fx-ring-fill 1.4s var(--ease-out) both .1s; }
@keyframes fx-draw { to { stroke-dashoffset: 0; } }
@keyframes fx-bloom { from { transform: scale(.2); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fx-grow-y { from { transform: scaleY(0); } to { transform: none; } }
@keyframes fx-grow-x { from { transform: scaleX(0); } to { transform: none; } }
@keyframes fx-ring-fill { from { stroke-dasharray: 0 999; } }
.meter-fill { transform-origin: 0 50%; }
.fx-anim .meter-fill { animation: fx-grow-x 1s var(--ease-out) both .3s; }

/* ------------------------------------------------------------------ Pannelli del marchio (scuri in entrambi i temi) */
.atelier-dark, .person-hero, .doc-card.is-manual {
  position: relative; overflow: hidden; isolation: isolate; color: #f1eefb;
  background:
    radial-gradient(520px 300px at 100% 0%, rgba(255, 122, 77, .32), transparent 62%),
    radial-gradient(480px 300px at 0% 100%, rgba(124, 92, 255, .45), transparent 62%),
    linear-gradient(150deg, #241a45 0%, #15112a 70%);
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 30px 60px -32px rgba(21, 17, 42, .8), inset 0 1px 0 rgba(255, 255, 255, .08);
}
.atelier-dark::after, .person-hero::after, .doc-card.is-manual::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .16) 1px, transparent 1.2px);
  background-size: 18px 18px;
  -webkit-mask: radial-gradient(120% 90% at 85% 10%, #000, transparent 70%); mask: radial-gradient(120% 90% at 85% 10%, #000, transparent 70%);
}
.auditor-banner { background: linear-gradient(90deg, #2a1f52, #4b2fbf); color: #fff; }

/* ------------------------------------------------------------------ Documenti: restano carta anche di notte */
.guide-flow-canvas, .guide-shot img, .sheet-fit, .pdf-page, .sig-pad canvas { color-scheme: light; }
.guide-flow-canvas { background: var(--doc-canvas); border-color: var(--doc-border); }
.guide-shot img, .qr { border-color: var(--doc-border); }

/* ------------------------------------------------------------------ Logo Formaxia nei colori «Atelier» */
.fxa-light .fxa-hex { fill: var(--logo-hex); stroke: var(--logo-hex); transition: fill .3s ease, stroke .3s ease; }
.fxa-light .fxa-letters { fill: var(--ink); }

/* ------------------------------------------------------------------ Caricamento tra le pagine */
.page-loader {
  position: fixed; top: 0; left: 0; right: 0; transform: none; width: auto; height: 3px; padding: 0; gap: 0; border-radius: 0; z-index: 300;
  background: linear-gradient(90deg, var(--accent), #c450d8, var(--coral), var(--accent));
  background-size: 300% 100%; box-shadow: 0 0 14px var(--accent-glow); opacity: 0;
  transition: opacity .2s ease; animation: fx-sheen 1.2s linear infinite;
}
.page-loader > * { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.page-loader.is-visible { opacity: 1; transform: none; }
@keyframes fx-sheen { to { background-position: -300% 0; } }

/* ------------------------------------------------------------------ Telefono e tablet: menu a scomparsa */
@media (max-width: 1100px) {
  :root { --sb-w: 0px; }
  :root[data-rail] { --sb-w: 0px; }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); height: auto; transform: translateX(-104%); transition: transform .38s var(--ease-out); box-shadow: 30px 0 60px -20px rgba(0, 0, 0, .5); }
  :root.sb-open .sidebar { transform: none; }
  :root[data-rail] .sb-brand-text, :root[data-rail] .sb-link span, :root[data-rail] .sb-help-text, :root[data-rail] .sb-company { display: revert; }
  :root[data-rail] .sb-link { justify-content: flex-start; padding: 0 12px; }
  :root[data-rail] .sb-label { font-size: 10.5px; padding: 0 12px; gap: 10px; }
  :root[data-rail] .sb-head { justify-content: flex-start; }
  :root[data-rail] .sb-brand { flex: 1; }
  .sb-close { display: grid; }
  .sb-rail { display: none; }
  .sb-scrim { position: fixed; inset: 0; z-index: 55; background: rgba(12, 9, 22, .5); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); animation: fx-fade .25s ease both; }
  .appbar-menu { display: grid; }
  .appbar-search { width: auto; }
  .appbar-search span, .appbar-search kbd { display: none; }
  .appbar-search { width: 40px; height: 40px; padding: 0; justify-content: center; border: 0; background: transparent; box-shadow: none; color: var(--ink-soft); }
}
@media (max-width: 1240px) { .who { display: none; } .acct-trigger { padding: 3px; } }
@media (max-width: 600px) {
  .appbar { gap: 6px; padding: 0 12px; }
  .appbar-group, .appbar-sep { display: none; }
  .appbar-tools { gap: 0; }
  .appbar-tools .theme-toggle { display: none; }
  .page-head { flex-direction: column; align-items: stretch; }
  .acct-menu { position: fixed; left: 10px; right: 10px; top: calc(var(--appbar-h) + 4px); width: auto; }
  .footer { flex-direction: column; }
}

/* ------------------------------------------------------------------ Installazione */
.setup { grid-template-columns: minmax(280px, 340px) 1fr; background: var(--paper); }
.setup-rail {
  color: #f1eefb;
  background:
    radial-gradient(300px 260px at 0% 0%, rgba(124, 99, 255, .4), transparent 70%),
    radial-gradient(320px 280px at 100% 100%, rgba(255, 120, 80, .2), transparent 70%),
    linear-gradient(180deg, #1f1838, #15112a);
}
.stepper .mark { border-color: rgba(255, 255, 255, .25); color: #c9c3e0; }
.stepper li.is-done .mark { background: linear-gradient(135deg, #ff8a5c, #ff5f8f); border-color: transparent; color: #fff; box-shadow: 0 0 0 4px rgba(255, 120, 90, .18); }
.stepper li.is-current .mark { background: #fff; border-color: #fff; color: #15112a; box-shadow: 0 0 0 5px rgba(124, 99, 255, .35); }
.stepper .name { color: #f1eefb; }
.stepper .desc, .setup-brand span, .setup-credit { color: #a7a1c2; }
.stepper li:not(:last-child)::after { background: rgba(255, 255, 255, .14); }
.setup-main { max-width: 820px; }
.setup-main h1 { font-size: clamp(2rem, 1.4rem + 1.6vw, 2.7rem); }

/* ------------------------------------------------------------------ Pagina di errore */
.error-page { grid-template-columns: minmax(0, 1fr); }
.error-page .band { display: none; }
.error-page main { justify-self: center; text-align: left; }
.error-page .status {
  font-family: var(--font-display); font-variation-settings: "SOFT" 100; font-weight: 400; font-style: italic;
  font-size: clamp(6rem, 3rem + 10vw, 11rem); letter-spacing: -0.04em;
  background: linear-gradient(120deg, var(--accent) 10%, #c450d8 55%, var(--coral) 95%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ------------------------------------------------------------------ Accesso */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(400px, 1fr) minmax(0, 1.12fr); background: var(--paper); }
.auth-main { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(24px, 4vw, 64px) clamp(20px, 5vw, 80px); background: transparent; order: 0; }
.auth-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: auto; padding-bottom: 32px; }
.auth-tools { position: static; }
.auth-panel { position: relative; width: 100%; max-width: 420px; margin: 0 auto; padding: 0; background: transparent; border: 0; box-shadow: none; }
.auth-panel::before { content: none; }
.auth-panel:has(.enroll) { max-width: 560px; }
.auth-panel h1 { font-size: clamp(2.2rem, 1.7rem + 1.2vw, 2.9rem); font-weight: 520; margin-bottom: 8px; }
.auth-panel h1 em, .auth-claim em { font-style: italic; color: var(--accent); }
.auth-lead { color: var(--ink-soft); font-size: 1rem; }
.auth-panel .form { gap: 18px; }
.auth-panel .btn-primary { min-height: 50px; font-size: 15.5px; }
.auth-help { text-align: left; color: var(--ink-mute); font-size: 13px; margin: 18px 0 0; }
.auth-credit { margin: auto 0 0; padding-top: 32px; text-align: left; color: var(--ink-mute); font-size: 12.5px; max-width: none; }
.auth-credit a { color: var(--ink-soft); }
.auth-mobile-logo { display: none; }
.auth-brand {
  position: relative; overflow: hidden; isolation: isolate; order: 1;
  margin: 12px 12px 12px 0; border-radius: 30px; color: #f4f1fd; min-height: calc(100vh - 24px);
  background:
    radial-gradient(70% 55% at 85% 8%, rgba(255, 128, 86, .55), transparent 62%),
    radial-gradient(60% 60% at 10% 92%, rgba(124, 92, 255, .75), transparent 62%),
    radial-gradient(50% 45% at 55% 50%, rgba(200, 80, 216, .28), transparent 70%),
    linear-gradient(155deg, #2b1f55 0%, #17122d 60%, #0f0b1e 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06), 0 40px 80px -40px rgba(21, 17, 42, .7);
}
.auth-brand::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .12; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.auth-brand .constellation { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.auth-brand-inner { position: sticky; top: 12px; min-height: calc(100vh - 24px); padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; pointer-events: none; }
.auth-brand-inner a, .auth-brand-inner img { pointer-events: auto; }
.auth-logo { align-self: flex-start; background: #fff; padding: 10px 14px; border-radius: 14px; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .6); }
.auth-logo img { display: block; max-height: 40px; max-width: 200px; }
.auth-company { align-self: flex-start; padding: 8px 14px; border-radius: 999px; background: rgba(255, 255, 255, .1); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: #fff; font: 700 14px/1.2 var(--font-body); letter-spacing: .01em; }
.auth-formaxia { display: grid; gap: 22px; max-width: 620px; }
.auth-claim {
  margin: 0; color: #fff; font-weight: 420; letter-spacing: -0.03em; line-height: 1.02;
  font-size: clamp(2.6rem, 1.4rem + 3.4vw, 4.8rem); font-variation-settings: "SOFT" 100; text-wrap: balance;
}
.auth-claim em { color: #ffb08e; font-weight: 400; }
.auth-academy { margin: 0; color: #fff; font: 700 13px/1 var(--font-body); letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.auth-product { margin: 0; color: rgba(241, 238, 251, .72); font-size: 13px; letter-spacing: .01em; }
.auth-product a { color: #ffd0bd; font-weight: 700; }
.auth-cards { position: relative; height: 210px; max-width: 520px; }
.auth-card {
  position: absolute; display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 18px;
  background: rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 24px 40px -20px rgba(0, 0, 0, .6);
  color: #fff; font-size: 13.5px; line-height: 1.3;
}
.auth-card strong { display: block; font-size: 14px; }
.auth-card small { color: rgba(255, 255, 255, .7); }
.auth-card-ico { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: linear-gradient(135deg, #8e74ff, #5b3df5); }
.auth-card-ico.is-coral { background: linear-gradient(135deg, #ff9a6c, #ff5f8f); }
.auth-card-ico.is-mint { background: linear-gradient(135deg, #5be3b0, #1fa97a); }
.auth-card:nth-child(1) { left: 0; top: 0; }
.auth-card:nth-child(2) { left: 30%; top: 74px; }
.auth-card:nth-child(3) { left: 8%; top: 148px; }
.fx-anim .auth-card { animation: fx-float 7s ease-in-out infinite; }
.fx-anim .auth-card:nth-child(2) { animation-delay: -2.3s; }
.fx-anim .auth-card:nth-child(3) { animation-delay: -4.6s; }
@keyframes fx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.auth-ring { --p: 82; position: relative; width: 38px; height: 38px; border-radius: 50%; background: conic-gradient(#ffb08e calc(var(--p) * 1%), rgba(255, 255, 255, .15) 0); display: grid; place-items: center; font-size: 10.5px; font-weight: 800; }
.auth-ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #2b2150; }
.auth-ring span { position: relative; }
.fx-anim .auth-claim { animation: fx-rise-big 1s var(--ease-out) both .25s; }
.fx-anim .auth-panel { animation: fx-rise-big .8s var(--ease-out) both .1s; }
@keyframes fx-rise-big { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@media (max-width: 960px) {
  .auth { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .auth-brand { order: -1; margin: 10px 10px 0; min-height: 0; border-radius: 24px; }
  .auth-brand-inner { position: static; min-height: 0; padding: 20px 22px 24px; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 16px; }
  .auth-formaxia { gap: 0; }
  .auth-claim { display: block; font-size: clamp(1.7rem, 1.1rem + 3vw, 2.3rem); }
  .auth-cards, .auth-product, .auth-academy { display: none; }
  .auth-main { padding: 24px 20px 32px; }
  .auth-top { padding-bottom: 24px; }
  .auth-company { max-width: 45vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .auth-logo { padding: 6px 10px; border-radius: 10px; }
  .auth-logo img { max-height: 30px; width: auto; }
}

/* ------------------------------------------------------------------ Entrata della pagina e passaggio tra pagine */
.fx-anim main.page > .fx-enter { animation: fx-enter .6s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 45ms + 30ms); }
@keyframes fx-enter { from { opacity: 0; transform: translateY(10px); } }
@keyframes fx-rise { from { opacity: 0; transform: translateY(8px); } }
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fx-vt-out .18s ease both; }
::view-transition-new(root) { animation: fx-vt-in .32s var(--ease-out) both; }
.sidebar { view-transition-name: fx-sidebar; }
::view-transition-group(fx-sidebar), ::view-transition-old(fx-sidebar), ::view-transition-new(fx-sidebar) { animation: none; }
@keyframes fx-vt-out { to { opacity: 0; } }
@keyframes fx-vt-in { from { opacity: 0; transform: translateY(6px); } }
html.fx-theming::view-transition-old(root) { animation: none; z-index: 1; }
html.fx-theming::view-transition-new(root) { animation: fx-reveal .7s cubic-bezier(.7, 0, .25, 1) both; z-index: 2; }
html.fx-theming::view-transition-new(fx-sidebar) { animation: fx-reveal .7s cubic-bezier(.7, 0, .25, 1) both; }
@keyframes fx-reveal { from { clip-path: circle(0 at var(--fx-x, 100%) var(--fx-y, 0)); } to { clip-path: circle(150vmax at var(--fx-x, 100%) var(--fx-y, 0)); } }

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--rule-hover); }
.sidebar ::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, .12); }

@media print {
  .sidebar, .appbar, .footer, .cmdk, .sb-scrim { display: none !important; }
  .app-shell { display: block; }
  body::before, body::after { display: none; }
}

/* Riduci movimento: tutto fermo, nessuna transizione tra pagine */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

/* Campi fuori da .field (ricerche, filtri in linea): stesso disegno, specificità minima */
:where(input[type="text"], input[type="search"], input[type="email"], input[type="password"], input[type="url"], input[type="number"], input[type="date"], input[type="tel"], select, textarea):not([class*="cmdk"]) {
  min-height: 42px; padding: 9px 14px; border: 1px solid var(--rule-strong); border-radius: var(--radius-field);
  background-color: var(--field-bg); color: var(--ink); font: 500 15px/1.4 var(--font-body);
}
:where(input, select, textarea):focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent); }
.cmdk-field input { min-height: 0; padding: 0; border: 0; background: transparent; box-shadow: none !important; }

/* Schede con il filo superiore: il filo diventa una sfumatura viola-corallo */
.doc-card, .course-card, .learn-side, .result-card { position: relative; border-top: 1px solid var(--rule); overflow: hidden; }
.doc-card::before, .course-card::before, .learn-side::before, .result-card::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: linear-gradient(90deg, var(--accent), #c450d8 55%, var(--coral)); }
.doc-card { position: sticky; top: calc(var(--appbar-h) + 16px); }
.learn-side { position: sticky; top: calc(var(--appbar-h) + 16px); }
.doc-card.is-manual::before { content: none; }
.course-card.is-optional::before { background: var(--rule-strong); }
.course-card.is-overdue::before { background: linear-gradient(90deg, var(--error), var(--coral)); }
.eyebrow { color: var(--coral-ink); font-weight: 800; letter-spacing: .14em; font-size: 11.5px; }
:root[data-theme="dark"] .eyebrow { color: var(--coral); }
.person-hero .eyebrow { color: #ffc3aa; }
.kpi-row { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* La colonna del menu resta scura per tutta l'altezza della pagina */
@media (min-width: 1101px) {
  .app-shell:has(.sidebar) { background: linear-gradient(90deg, var(--sb-bg) var(--sb-w), transparent var(--sb-w)); }
}
.kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1360px) { .welcome .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .kpi-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Logo con la firma «Powered by Eugenio Damaso»: la scritta resta della stessa altezza, la firma si aggiunge sotto. */
.fxa-with-by { align-items: flex-start; }
.fxa-with-by .fxa-word { height: calc(26px * 2290 / 1600); }
.fxa-sm.fxa-with-by .fxa-word { height: calc(18px * 2290 / 1600); }
.fxa-lg.fxa-with-by .fxa-word { height: calc(58px * 2290 / 1600); }
.fxa-with-by .fxa-mark { margin-top: calc(26px * -0.18); }
.fxa-sm.fxa-with-by .fxa-mark { margin-top: calc(18px * -0.18); }
.fxa-lg.fxa-with-by .fxa-mark { margin-top: calc(58px * -0.18); }
.fxa-light .fxa-by path:first-child { fill: var(--ink-mute); }
.fxa-light .fxa-by path:last-child { fill: var(--ink); }
.auth-top .fxa-md .fxa-mark { width: 40px; height: 40px; }
.auth-top .fxa-md.fxa-with-by .fxa-word { height: calc(24px * 2290 / 1600); }
.fxa-anim-intro .fxa-by { animation: fxa-by .7s 1.2s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes fxa-by { from { opacity: 0; transform: translateY(80px); } }

/* ---------- Importa un corso (3.3) ---------- */
.ci-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; margin: 4px 0 8px; }
.ci-grid-3 { grid-template-columns: repeat(3, 1fr); margin-top: 22px; }
.ci-card { position: relative; padding: 22px 22px 20px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-panel); box-shadow: var(--shadow-1, 0 1px 2px rgba(20,14,40,.05)); display: grid; gap: 12px; align-content: start; }
.ci-card h2 { font-size: var(--step-1); margin: 0; }
.ci-card p { margin: 0; }
.ci-skill { background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--coral) 14%, transparent), transparent 60%),
    radial-gradient(110% 90% at 0% 100%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--surface); border-color: color-mix(in srgb, var(--accent) 28%, var(--rule)); }
.ci-skill .btn { justify-self: start; display: inline-flex; align-items: center; gap: 8px; }
.ci-skill .btn .ico { width: 16px; height: 16px; transform: rotate(90deg); }
.ci-ver { font: 600 11px/1 var(--font-mono, monospace); padding: 3px 6px; border-radius: 6px; background: rgba(255,255,255,.18); }
.ci-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.ci-ico .ico { width: 20px; height: 20px; }
.ci-ico-accent { background: linear-gradient(135deg, var(--accent), #c450d8 60%, var(--coral)); color: #fff; }
.ci-ico-ok { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 8px; background: linear-gradient(135deg, var(--accent), #c450d8 60%, var(--coral)); color: #fff; box-shadow: 0 14px 34px -12px color-mix(in srgb, var(--accent) 70%, transparent); }
.ci-ico-ok .ico { width: 30px; height: 30px; }
.ci-upload .upload-box { margin-top: 4px; }
.ci-steps { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: none; }
.ci-steps li { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px; border-radius: 16px; background: var(--surface-2, var(--surface)); border: 1px solid var(--rule); }
.ci-steps p { margin: 4px 0 0; color: var(--ink-soft); font-size: var(--step--1); }
.ci-n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--font-display, serif); color: var(--accent-strong); background: var(--accent-soft); }
.ci-desc { max-width: 78ch; color: var(--ink-soft); margin: 18px 0 0; }
.ci-dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: var(--step--1); }
.ci-dl dt { color: var(--ink-soft); }
.ci-dl dd { margin: 0; font-weight: 600; }
.ci-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ci-confirm { margin-top: 24px; padding: 20px 22px; border-radius: var(--radius-panel); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--rule)); background: var(--accent-soft); display: grid; gap: 10px; }
.ci-confirm p { margin: 0; }
.ci-done { max-width: 640px; margin: 48px auto; text-align: center; display: grid; gap: 10px; justify-items: center; }
.ci-done-actions { justify-content: center; flex-wrap: wrap; margin: 10px 0 6px; }
.ci-done-actions .ico { width: 14px; height: 14px; }
@media (max-width: 1100px) { .ci-steps { grid-template-columns: repeat(2, 1fr); } .ci-grid-3 { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .ci-grid { grid-template-columns: 1fr; } .ci-steps { grid-template-columns: 1fr; } }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; border: 0; }
.prose pre { background: #17122b; color: #e9e5ff; padding: 16px 18px; border-radius: 14px; line-height: 1.55; }
.prose img { max-width: 100%; height: auto; border-radius: 14px; }

/* =====================================================================================
 * Vetrina Academy «Atelier»: barra a pillola, hero immersivo con costellazione,
 * schede dei corsi editoriali, bande scure in prugna.
 * ===================================================================================== */
body.pub { background: transparent; }
.btn-light { background: #fff; color: #1c1630; border: 0; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6); }
.btn-light:hover { background: #fff; color: var(--accent-strong); transform: translateY(-1px); }
.btn-light .ico { transition: transform .3s var(--ease-out); }
.btn-light:hover .ico { transform: translateX(3px); }
.btn-ghost-light { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .28); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.btn-ghost-light:hover { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .5); }

/* Barra superiore: pillola di vetro sospesa */
.pub-top { position: sticky; top: 0; z-index: 40; padding: 10px 0 0; background: transparent; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.pub-top-inner {
  width: min(1200px, 100% - 24px); min-height: 60px; padding: 0 10px 0 18px; gap: var(--space-4);
  border-radius: 999px; background: color-mix(in srgb, var(--surface) 82%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  border: 1px solid var(--rule); box-shadow: var(--shadow-2);
}
.pub-brand-name { font: 600 1.08rem/1.15 var(--font-display); font-variation-settings: "SOFT" 80; letter-spacing: -.01em; }
.pub-nav a { padding: 8px 14px; font-weight: 650; font-size: 14.5px; }
.pub-nav a:hover, .pub-nav a[aria-current] { color: var(--ink); background: var(--surface-3); }
.pub-login { font-weight: 650; }
.pub-wrap { width: min(1200px, 100% - 32px); }

/* Hero immersivo */
.pub-hero {
  position: relative; isolation: isolate; overflow: hidden; color: #f4f1fd;
  margin: -70px 12px 0; padding-top: 70px; border-radius: 0 0 34px 34px;
  background:
    radial-gradient(60% 70% at 88% 4%, rgba(255, 128, 86, .5), transparent 62%),
    radial-gradient(55% 70% at 4% 100%, rgba(124, 92, 255, .7), transparent 62%),
    radial-gradient(40% 50% at 55% 55%, rgba(200, 80, 216, .22), transparent 70%),
    linear-gradient(160deg, #2b1f55 0%, #17122d 62%, #0f0b1e 100%);
}
.pub-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .12; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
.pub-hero .constellation { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.pub-hero-inner { max-width: none; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 72px); align-items: center; padding: clamp(56px, 8vw, 112px) 0 clamp(64px, 8vw, 112px); }
.pub-eyebrow { border-color: rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .07); color: #fff; }
.pub-dot { background: #ffb08e; box-shadow: 0 0 0 4px rgba(255, 176, 142, .22); }
@keyframes pubPulse { 50% { box-shadow: 0 0 0 9px rgba(255, 176, 142, 0); } }
.pub-hero-title { font: 420 clamp(2.6rem, 1.3rem + 4.6vw, 5.2rem)/1 var(--font-display); font-variation-settings: "SOFT" 100; letter-spacing: -.035em; color: #fff; }
.pub-hero-lead { color: rgba(241, 238, 251, .82); }
.pub-hero-points { color: rgba(241, 238, 251, .8); }
.pub-hero-points li::before { background: rgba(255, 176, 142, .18) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.4l2.6 2.6L12 5.4' fill='none' stroke='%23ffb08e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.pub-hero-visual { position: relative; min-height: 380px; }
.pub-hero-card {
  position: absolute; width: min(330px, 92%); display: grid; gap: 6px; padding: 18px 20px; border-radius: 20px; color: #fff;
  background: rgba(255, 255, 255, .1); -webkit-backdrop-filter: blur(18px) saturate(150%); backdrop-filter: blur(18px) saturate(150%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16), 0 30px 50px -24px rgba(0, 0, 0, .7);
}
.pub-hero-card strong { font: 520 1.3rem/1.2 var(--font-display); font-variation-settings: "SOFT" 80; letter-spacing: -.01em; }
.pub-hero-card-area { font-size: 11px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; color: #ffc3aa; }
.pub-hero-card-meta { color: rgba(255, 255, 255, .7); font-size: 13px; font-weight: 600; }
.pub-hero-card-bar { height: 6px; margin-top: 8px; border-radius: 999px; background: rgba(255, 255, 255, .14); overflow: hidden; }
.pub-hero-card-bar span { display: block; width: 64%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #9a84ff, #ff9a74); }
.pub-hero-card-1 { top: 6%; right: 2%; }
.pub-hero-card-2 { top: 38%; left: 0; }
.pub-hero-card-2 .pub-hero-card-bar span { width: 38%; }
.pub-hero-card-3 { top: 70%; right: 8%; }
.pub-hero-card-3 .pub-hero-card-bar span { width: 86%; }
.pub-hero-chip { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; background: #fff; color: #1c1630; font-size: 13px; font-weight: 750; box-shadow: 0 20px 40px -18px rgba(0, 0, 0, .7); }
.pub-hero-chip .ico { color: #ff6b3d; }
.pub-hero-chip-badge { top: 0; left: 6%; }
.pub-hero-chip-cert { bottom: 0; left: 24%; }
.pub-hero-chip-cert .ico { color: #5b3df5; }
.fx-anim .pub-hero-card, .fx-anim .pub-hero-chip { animation: fx-float 8s ease-in-out infinite; }
.fx-anim .pub-hero-card-2 { animation-delay: -2.6s; }
.fx-anim .pub-hero-card-3 { animation-delay: -5.2s; }
.fx-anim .pub-hero-chip-badge { animation-delay: -1.3s; }
.fx-anim .pub-hero-chip-cert { animation-delay: -4s; }

/* Numeri: una tessera che si sovrappone al bordo del hero */
.pub-proof { position: relative; z-index: 2; margin-top: -44px; background: transparent; border: 0; }
.pub-proof-grid { padding: 22px clamp(18px, 3vw, 36px); border-radius: 24px; background: var(--surface); border: 1px solid var(--rule); box-shadow: var(--shadow-3); gap: var(--space-5); }
.pub-proof-grid div { padding-left: 16px; border-left: 2px solid var(--rule); }
.pub-proof-grid div:first-child { border-left-color: var(--accent); }
.pub-proof-grid strong { font: 520 clamp(2rem, 1.5rem + 1.6vw, 2.9rem)/1 var(--font-display); font-variation-settings: "SOFT" 60; letter-spacing: -.03em; }

/* Sezioni */
.pub-section h2, .pub-h2 { font: 520 clamp(1.8rem, 1.3rem + 1.6vw, 2.7rem)/1.08 var(--font-display); font-variation-settings: "SOFT" 60; letter-spacing: -.025em; }
.pub-kicker { color: var(--coral-ink); letter-spacing: .14em; font-size: 12px; font-weight: 800; }
:root[data-theme="dark"] .pub-kicker { color: var(--coral); }
.pub-more { color: var(--accent); }

/* Schede dei corsi */
.pub-grid { gap: 22px; }
.pub-card { border-radius: 22px; box-shadow: var(--shadow-1); transform: none; }
.pub-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); border-color: var(--rule-hover); }
.pub-card-media { margin: 8px 8px 0; border-radius: 16px; }
.pub-card-media.is-generated, .pub-course-media.is-generated {
  background:
    radial-gradient(70% 90% at 90% 0%, rgba(255, 128, 86, .55), transparent 60%),
    radial-gradient(70% 90% at 0% 100%, rgba(124, 92, 255, .8), transparent 60%),
    linear-gradient(150deg, #2b1f55, #15112a);
}
.pub-card-mono { font: 400 4rem/1 var(--font-display); font-style: italic; font-variation-settings: "SOFT" 100; letter-spacing: -.04em; color: #fff; }
.pub-chip { top: 12px; left: 12px; background: rgba(255, 255, 255, .92); color: #1c1630; }
.pub-card-area { color: var(--coral-ink); letter-spacing: .12em; }
:root[data-theme="dark"] .pub-card-area { color: var(--coral); }
.pub-card-title { font: 560 1.35rem/1.18 var(--font-display); font-variation-settings: "SOFT" 60; }
.pub-card-meta span + span::before { content: "·"; margin-right: 14px; color: var(--rule-hover); }
.pub-card-meta { gap: 6px 14px; }
.pub-free { color: var(--ok); }

/* Come funziona */
.pub-steps-band { margin: 0 12px; border-radius: 34px; background: var(--surface); border: 1px solid var(--rule); }
.pub-steps li { background: transparent; border: 0; border-top: 1px solid var(--rule); border-radius: 0; padding: var(--space-5) 0 0; }
.pub-step-n { width: auto; height: auto; background: none; box-shadow: none; border-radius: 0; color: var(--accent); font: 400 3rem/1 var(--font-display); font-style: italic; font-variation-settings: "SOFT" 100; }
.pub-steps h3 { font: 700 1.1rem/1.25 var(--font-body); }

/* Docente */
.pub-author { border-radius: 28px; box-shadow: var(--shadow-1); }
.pub-author-mark { clip-path: none; border-radius: 50%; background: linear-gradient(140deg, #7b5cff 0%, #c450d8 55%, #ff7a4d 100%); font: 500 2.3rem/1 var(--font-display); font-style: italic; box-shadow: 0 20px 40px -20px var(--accent-glow); }

/* Chiusura scura con costellazione */
.pub-final-inner {
  position: relative; isolation: isolate; overflow: hidden; border-radius: 34px; color: #f4f1fd;
  background:
    radial-gradient(60% 90% at 90% 0%, rgba(255, 128, 86, .45), transparent 62%),
    radial-gradient(60% 90% at 5% 100%, rgba(124, 92, 255, .7), transparent 62%),
    linear-gradient(160deg, #2b1f55, #15112a);
}
.pub-final-inner .constellation { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.pub-final-inner h2 { color: #fff; }
.pub-final-inner p { color: rgba(241, 238, 251, .8); }
.pub-final-inner .btn-primary { background: #fff; color: #1c1630; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6); }
.pub-final-inner .btn-primary:hover { color: var(--accent-strong); }

/* Pagine interne e corso */
.pub-pagehead { background: transparent; }
.pub-pagehead h1, .pub-course-hero h1 { font: 480 clamp(2.2rem, 1.4rem + 2.8vw, 3.8rem)/1.04 var(--font-display); font-variation-settings: "SOFT" 80; letter-spacing: -.03em; }
.pub-course-hero { background: transparent; border-bottom: 0; }
.pub-course-media { border-radius: 24px; }
.pub-facts li { border-radius: 16px; }
.pub-facts strong { font: 560 1.25rem/1.2 var(--font-display); }
.pub-panel { border-radius: 22px; }
.pub-enroll-price { font: 500 2.6rem/1 var(--font-display); font-style: italic; color: var(--ok); }
.pub-syllabus li { border-radius: 18px; }
.pub-syl-n { border-radius: 50%; font: 600 1rem/1 var(--font-display); }
.pub-outcomes h2, .pub-prose h2 { font: 560 1.55rem/1.2 var(--font-display); font-variation-settings: "SOFT" 60; }
.pub-legal h1 { font: 500 clamp(2rem, 1.4rem + 2vw, 3rem)/1.08 var(--font-display); }
.pub-filters a { border-radius: 999px; }
.pub-filters a[aria-current] { background: var(--accent); border-color: var(--accent); color: #fff; }
.pub-search input { border-radius: 999px; padding: 0 20px; min-height: 50px; }
.pub-search .btn { min-height: 50px; }

/* Piè di pagina pubblico */
.pub-foot { margin: var(--space-7) 12px 12px; border-radius: 34px; background: #15112a; color: #c9c3e0; border: 0; }
.pub-foot-name { color: #fff; font: 520 1.5rem/1.2 var(--font-display); }
.pub-foot-tag, .pub-foot-h, .pub-foot-legal, .pub-foot-legal a { color: #a7a1c2; }
.pub-foot-grid nav a { color: #e6e2f5; }
.pub-foot-grid nav a:hover { color: #ffb08e; }
.pub-foot-legal { border-top-color: rgba(255, 255, 255, .1); }

@media (max-width: 980px) {
  .pub-hero-inner { grid-template-columns: minmax(0, 1fr); }
  .pub-hero-visual { min-height: 300px; }
}
@media (max-width: 720px) {
  .pub-top-inner { padding: 0 8px 0 14px; min-height: 54px; }
  .pub-hero { margin: -64px 8px 0; padding-top: 64px; border-radius: 0 0 26px 26px; }
  .pub-hero-visual { display: none; }
  .pub-proof { margin-top: -28px; }
  .pub-proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pub-steps-band, .pub-foot { margin-inline: 8px; border-radius: 26px; }
}
:root[data-theme="dark"] .pub-brand-logo { background: #fff; padding: 4px 8px; border-radius: 10px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pub-brand-logo { background: #fff; padding: 4px 8px; border-radius: 10px; } }
.pub-section .pub-h2 { margin: var(--space-7) 0 var(--space-4); font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); }
.auth-academy + .auth-claim { margin-top: var(--space-4); font: 420 clamp(1.6rem, 1.1rem + 1.4vw, 2.4rem)/1.15 var(--font-display); font-variation-settings: "SOFT" 100; letter-spacing: -.02em; color: #fff; max-width: 24ch; }
