/* ==========================================================================
   NM OS™ — Design System "sistema operativo premium"
   Tema CHIARO predefinito (:root) · tema DARK con [data-theme="dark"]
   Unbounded / Inter / JetBrains Mono · nessun colore hard-coded fuori da qui
   ========================================================================== */

:root {
  /* ---------- TEMA CHIARO (predefinito) ---------- */
  /* Superfici */
  --bg: #F6F7FB;
  --surface: #FFFFFF;
  --surface-2: #EEF1F7;
  --surface-3: #E3E8F0;
  --border: rgba(15,23,42,0.10);
  --border-strong: rgba(15,23,42,0.18);

  /* Accento lime: --lime/--accent = riempimenti (sempre con testo scuro sopra),
     --accent-ink = testo/link/icone lime su fondo chiaro (AA) */
  --lime: #C8FF00;
  --lime-hover: #D9FF4D;
  --accent: var(--lime);
  --accent-hover: var(--lime-hover);
  --accent-ink: #4A7500;
  --lime-ink: var(--accent-ink);
  --accent-bar: var(--accent-ink);        /* riempimento barre/ring quando non c'è una fase */
  --lime-glow: rgba(124,185,0,0.30);
  --lime-soft: rgba(124,185,0,0.12);
  --lime-line: rgba(92,138,0,0.35);
  --on-lime: #05060A;

  /* Violet */
  --violet: #6D28D9;
  --violet-glow: rgba(109,40,217,0.25);
  --violet-soft: rgba(109,40,217,0.10);
  --violet-line: rgba(109,40,217,0.35);
  --on-violet: #FFFFFF;

  /* Fasi (riempimenti). Il testo in colore fase passa da color-mix con --fase-ink-mix */
  --f-setup: #4B5563;
  --f-valida: #0891B2;
  --f-costruisci: #65A30D;
  --f-vendi: #EA580C;
  --f-duplica: #7C3AED;
  --f-case: #B45309;
  --fase-ink-mix: 70%;

  /* Testo */
  --text: #0B0F19;
  --text-2: #4B5563;
  --text-muted: #5F6B7D;
  --text-3: var(--text-muted);

  /* Stato */
  --ok: #047857;
  --warn: #B45309;
  --err: #B91C1C;

  /* Ombre: morbide e grigie; glow lime solo su CTA/attivi */
  --shadow-card: 0 1px 2px rgba(15,23,42,0.04), 0 8px 30px rgba(15,23,42,0.06);
  --shadow-pop: 0 20px 60px rgba(15,23,42,0.18);
  --shadow-lime: 0 0 0 1px var(--lime-line), 0 8px 30px rgba(15,23,42,0.08), 0 0 24px var(--lime-glow);
  --shadow-violet: 0 0 0 1px var(--violet-line), 0 8px 30px rgba(15,23,42,0.08);
  --shadow-btn: 0 6px 20px rgba(15,23,42,0.12);
  --shadow-player: 0 20px 60px rgba(15,23,42,0.18);
  --shadow-drawer: 0 0 80px rgba(15,23,42,0.25);
  --glow-k: 0;                               /* moltiplicatore dei glow decorativi (0 = spenti) */
  --glow-text: none;
  --glow-text-sm: none;
  --glow-text-lg: none;

  /* Overlay, topbar, griglia, mesh del hero */
  --overlay: rgba(15,23,42,0.45);
  --topbar-bg: rgba(246,247,251,0.80);
  --grid-line: rgba(15,23,42,0.05);
  --mesh-1: rgba(101,163,13,0.14);
  --mesh-2: rgba(109,40,217,0.12);
  --mesh-3: rgba(8,145,178,0.10);
  --scroll-thumb: #C9D1DE;
  --scroll-thumb-hover: #AEB8C8;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  /* Terminali / blocchi codice / player: restano SCURI in entrambi i temi (voluto) */
  --code-bg: #0C0E16;
  --code-bg-2: #131626;
  --code-border: rgba(255,255,255,0.08);
  --code-text: #A3A9B8;
  --code-title: #F5F7FA;
  --code-muted: #6B7280;
  --code-accent: #C8FF00;
  --code-accent-line: rgba(200,255,0,0.45);
  --code-accent-soft: rgba(200,255,0,0.10);
  --player-bg-1: #0C0E16;
  --player-bg-2: #05060A;
  --player-glow: rgba(200,255,0,0.10);

  /* Tipografia */
  --font-display: 'Unbounded', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Forma */
  --r-card: 16px;
  --r-sm: 10px;
  --r-pill: 999px;

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --t-fast: 160ms;
  --t-med: 320ms;
  --t-slow: 400ms;

  /* Layout */
  --nav-w: 248px;
  --content-max: 1240px;
  --gutter: clamp(16px, 3vw, 40px);

  color-scheme: light;
}

/* ---------- TEMA DARK (identico all'originale) ---------- */
:root[data-theme="dark"] {
  --bg: #05060A;
  --surface: #0C0E16;
  --surface-2: #131626;
  --surface-3: #1A1E33;
  --border: rgba(255,255,255,0.08);
  --border-strong: rgba(255,255,255,0.16);

  --lime: #C8FF00;
  --lime-hover: #D9FF4D;
  --accent-ink: #C8FF00;
  --accent-bar: var(--lime);
  --lime-glow: rgba(200,255,0,0.35);
  --lime-soft: rgba(200,255,0,0.10);
  --lime-line: rgba(200,255,0,0.38);
  --on-lime: #05060A;

  --violet: #8B5CF6;
  --violet-glow: rgba(139,92,246,0.35);
  --violet-soft: rgba(139,92,246,0.12);
  --violet-line: rgba(139,92,246,0.40);
  --on-violet: #FFFFFF;

  --f-setup: #A3A9B8;
  --f-valida: #00E5FF;
  --f-costruisci: #C8FF00;
  --f-vendi: #FF6B35;
  --f-duplica: #8B5CF6;
  --f-case: #FBBF24;
  --fase-ink-mix: 100%;

  --text: #F5F7FA;
  --text-2: #A3A9B8;
  --text-muted: #6B7280;

  --ok: #34D399;
  --warn: #FBBF24;
  --err: #F87171;

  --shadow-card: none;
  --shadow-pop: 0 30px 80px rgba(0,0,0,.6);
  --shadow-lime: 0 0 0 1px rgba(200,255,0,0.35), 0 0 24px var(--lime-glow);
  --shadow-violet: 0 0 0 1px rgba(139,92,246,0.4), 0 0 24px var(--violet-glow);
  --shadow-btn: 0 6px 20px rgba(0,0,0,.4);
  --shadow-player: 0 20px 60px rgba(0,0,0,.5), 0 0 0 1px rgba(200,255,0,0.06);
  --shadow-drawer: 0 0 80px rgba(0,0,0,.7);
  --glow-k: 1;
  --glow-text: 0 0 18px var(--lime-glow);
  --glow-text-sm: 0 0 14px var(--lime-glow);
  --glow-text-lg: 0 0 22px var(--lime-glow);

  --overlay: rgba(5,6,10,.8);
  --topbar-bg: rgba(5,6,10,0.72);
  --grid-line: rgba(255,255,255,0.035);
  --mesh-1: rgba(200,255,0,0.16);
  --mesh-2: rgba(139,92,246,0.22);
  --mesh-3: rgba(0,229,255,0.10);
  --scroll-thumb: #1A1E33;
  --scroll-thumb-hover: #262b48;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23A3A9B8' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");

  color-scheme: dark;
}

/* ==========================================================================
   SKIN "GAMING" — variabili
   Si attiva con data-skin="gaming" su <html> (predefinita; l'alternativa è
   data-skin="essenziale", che semplicemente non definisce nulla di tutto questo).
   È una PELLE: non cambia i colori di base né il contrasto, aggiunge angoli tagliati,
   doppio bordo, micro-griglia, glow sugli stati attivi e l'HUD.
   Convive con il tema chiaro/scuro: il tema decide i colori, la skin la forma.
   ========================================================================== */
:root[data-skin="gaming"] {
  --cut: 12px;                                   /* profondità dell'angolo tagliato */
  --cut-sm: 8px;
  --hud-h: 60px;
  --grid-micro: rgba(15,23,42,0.055);            /* micro-griglia di sfondo */
  --grid-micro-step: 26px;
  --skin-line: color-mix(in srgb, var(--accent-ink) 26%, transparent);
  --skin-line-2: color-mix(in srgb, var(--accent-ink) 14%, transparent);
  --skin-glow: 0 0 0 1px var(--skin-line), 0 0 18px color-mix(in srgb, var(--accent-ink) 18%, transparent);
  --skin-scan: color-mix(in srgb, var(--accent-ink) 40%, transparent);
  --hud-bg: color-mix(in srgb, var(--surface) 92%, var(--accent-ink));
  --xp-fill: linear-gradient(90deg, color-mix(in srgb, var(--accent-ink) 70%, #ffffff), var(--accent-ink));
  --combo-ink: #C2410C;
  --combo-soft: rgba(234,88,12,0.12);
}
:root[data-theme="dark"][data-skin="gaming"] {
  --grid-micro: rgba(200,255,0,0.045);
  --skin-line: rgba(200,255,0,0.30);
  --skin-line-2: rgba(200,255,0,0.14);
  --skin-glow: 0 0 0 1px var(--skin-line), 0 0 22px var(--lime-glow);
  --skin-scan: rgba(200,255,0,0.55);
  --hud-bg: color-mix(in srgb, var(--surface) 88%, #000);
  --xp-fill: linear-gradient(90deg, #8FBF00, var(--lime));
  --combo-ink: #FF8A4C;
  --combo-soft: rgba(255,107,53,0.14);
}

/* Reset ----------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}
img, svg, video, iframe { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, textarea, select { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
h1 { font-size: clamp(26px, 3.6vw, 40px); font-weight: 800; }
h2 { font-size: clamp(20px, 2.4vw, 26px); }
h3 { font-size: 17px; }
p { margin: 0; }
::selection { background: var(--lime); color: var(--on-lime); }
:focus-visible { outline: 2px solid var(--accent-ink); outline-offset: 3px; border-radius: 6px; }

/* Scrollbar ------------------------------------------------------------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--scroll-thumb-hover); }

/* Utility ---------------------------------------------------------------- */
.mono { font-family: var(--font-mono); }
.muted { color: var(--text-muted); }
.sec { color: var(--text-2); }
.lime { color: var(--accent-ink); }
.violet { color: var(--violet); }
.fase-ink { color: color-mix(in srgb, var(--fase-c, var(--f-costruisci)) var(--fase-ink-mix), #000); }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.eyebrow.lime { color: var(--accent-ink); }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.auto { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* Wordmark ---------------------------------------------------------------- */
.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
  color: var(--text);
}
.wordmark .os { color: var(--accent-ink); text-shadow: var(--glow-text); }
.wordmark .cursor {
  display: inline-block;
  width: .55em; height: .12em;
  background: var(--accent-ink);
  margin-left: .12em;
  box-shadow: 0 0 calc(10px * var(--glow-k)) var(--lime-glow);
  animation: cursor-blink 1.1s steps(1) infinite;
  vertical-align: -0.02em;
}
.wordmark.lg { font-size: 30px; }
.title-cursor::after {
  content: '_';
  color: var(--accent-ink);
  animation: cursor-blink 1.1s steps(1) infinite;
  margin-left: .06em;
}

/* Layout: shell ----------------------------------------------------------- */
.shell { display: grid; grid-template-columns: var(--nav-w) 1fr; min-height: 100vh; }
.nav {
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  background: linear-gradient(180deg, var(--surface) 0%, var(--bg) 100%);
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 30;
  /* Quando le voci non ci stanno in altezza (1366×768, 1280×720, menu mobile) la barra scorre da sola:
     niente contenuto irraggiungibile in fondo. Barra sottile e invisibile finché non ci si passa sopra. */
  overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin; scrollbar-color: transparent transparent;
}
.nav:hover, .nav:focus-within { scrollbar-color: var(--scroll-thumb) transparent; }
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav::-webkit-scrollbar-thumb { background: transparent; border: 0; border-radius: 999px; }
.nav:hover::-webkit-scrollbar-thumb, .nav:focus-within::-webkit-scrollbar-thumb { background: var(--scroll-thumb); }
.nav > * { flex-shrink: 0; }
.nav-brand { padding: 4px 8px 18px; display: flex; align-items: center; justify-content: space-between; }
.nav-section { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); padding: 14px 10px 6px; }
.nav a.item, .nav button.item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 12px;
  color: var(--text-2); font-weight: 500; font-size: 14px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  border: 1px solid transparent;
}
.nav a.item svg { width: 18px; height: 18px; flex: none; opacity: .8; }
.nav a.item:hover { background: var(--surface-2); color: var(--text); transform: translateX(2px); }
.nav a.item.active { background: var(--lime-soft); color: var(--accent-ink); border-color: var(--lime-line); box-shadow: inset 0 0 0 1px var(--lime-soft), 0 0 20px var(--lime-soft); }
.nav a.item.active svg { opacity: 1; }
.nav-footer { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.nav-user { display: flex; align-items: center; gap: 10px; padding: 8px 4px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  background: conic-gradient(from 200deg, var(--lime), var(--violet), var(--lime));
  display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 13px; color: var(--on-lime);
  box-shadow: 0 0 calc(18px * var(--glow-k)) var(--lime-glow);
}
.nav-user .name { font-weight: 600; font-size: 14px; }
.nav-user .plan { font-family: var(--font-mono); font-size: 10px; color: var(--accent-ink); letter-spacing: .1em; }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px var(--gutter);
  background: var(--topbar-bg);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar .crumbs { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; min-width: 0; overflow: hidden; white-space: nowrap; }
.topbar .crumbs a:hover { color: var(--text); }
.topbar .crumbs .sep { opacity: .5; }
.topbar .crumbs .cur { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; }
.content { padding: 28px var(--gutter) 80px; max-width: var(--content-max); margin: 0 auto; }
.burger { display: none; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); place-items: center; }
.burger svg { width: 20px; height: 20px; }
.nav-overlay { display: none; position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(4px); z-index: 25; }

/* Toggle tema (sole / luna) ------------------------------------------------- */
.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  display: grid; place-items: center;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast), transform var(--t-fast) var(--ease);
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle:hover { color: var(--accent-ink); border-color: var(--lime-line); background: var(--lime-soft); transform: translateY(-1px); }
.theme-toggle .ico-sun, .theme-toggle .ico-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: block; }
:root:not([data-theme="dark"]) .theme-toggle .ico-moon { display: block; }

/* Hero / gradient mesh ---------------------------------------------------- */
.hero {
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  padding: clamp(24px, 4vw, 44px);
  isolation: isolate;
  box-shadow: var(--shadow-card);
}
.hero::before {
  content: ''; position: absolute; inset: -40%;
  background:
    radial-gradient(40% 40% at 20% 30%, var(--mesh-1), transparent 60%),
    radial-gradient(35% 45% at 80% 20%, var(--mesh-2), transparent 60%),
    radial-gradient(45% 45% at 60% 90%, var(--mesh-3), transparent 60%);
  animation: mesh-drift 18s ease-in-out infinite alternate;
  z-index: -1;
  filter: blur(20px);
}
.hero::after {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(70% 70% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(70% 70% at 50% 40%, #000 30%, transparent 100%);
}
.hero[data-fase] { --fase-c: var(--f-costruisci); }
.hero .hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; }
.hero .lead { color: var(--text-2); font-size: 16px; max-width: 60ch; }
.hero h1 { margin: 10px 0 12px; }

/* Card -------------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  padding: 20px;
  position: relative;
  box-shadow: var(--shadow-card);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease), background var(--t-med) var(--ease);
}
.card.hover:hover, a.card:hover { transform: translateY(-2px); border-color: var(--border-strong); background: var(--surface-2); }
.card.glow { box-shadow: var(--shadow-lime); border-color: var(--lime-line); }
.card.glow-violet { box-shadow: var(--shadow-violet); border-color: var(--violet-line); }
.card.compact { padding: 14px 16px; }
.card-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-title h3 { font-size: 15px; }
.card[data-fase] { --fase-c: var(--f-costruisci); }
.card[data-fase]::before {
  content: ''; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px;
  background: var(--fase-c); box-shadow: 0 0 calc(14px * var(--glow-k)) var(--fase-c); opacity: .9;
}
.card.locked { opacity: .55; filter: saturate(.6); }
.card.locked:hover { transform: none; }

/* Badge fase / pill ------------------------------------------------------ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600;
  padding: 4px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--border-strong);
  color: var(--text-2); background: color-mix(in srgb, var(--text) 4%, transparent);
  white-space: nowrap;
}
.badge svg { width: 12px; height: 12px; }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 calc(8px * var(--glow-k)) currentColor; }
.badge[data-fase] {
  --fase-c: var(--f-costruisci);
  color: color-mix(in srgb, var(--fase-c) var(--fase-ink-mix), #000);
  border-color: color-mix(in srgb, var(--fase-c) 40%, transparent);
  background: color-mix(in srgb, var(--fase-c) 12%, transparent);
}
.badge.lime { color: var(--accent-ink); border-color: var(--lime-line); background: var(--lime-soft); }
.badge.violet { color: var(--violet); border-color: var(--violet-line); background: var(--violet-soft); }
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }
.badge.type-CONCETTO { --fase-c: var(--f-valida); color: color-mix(in srgb, var(--fase-c) var(--fase-ink-mix), #000); border-color: color-mix(in srgb, var(--fase-c) 35%, transparent); background: color-mix(in srgb, var(--fase-c) 12%, transparent); }
.badge.type-PRATICA { color: var(--accent-ink); border-color: var(--lime-line); background: var(--lime-soft); }
.badge.type-SFIDA { --fase-c: var(--f-vendi); color: color-mix(in srgb, var(--fase-c) var(--fase-ink-mix), #000); border-color: color-mix(in srgb, var(--fase-c) 40%, transparent); background: color-mix(in srgb, var(--fase-c) 12%, transparent); }
.code { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); letter-spacing: .04em; }
.code.lime { color: var(--accent-ink); }
.fase-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--fase-c, var(--accent-bar)); box-shadow: 0 0 calc(10px * var(--glow-k)) var(--fase-c, var(--accent-bar)); display: inline-block; }

/* Buttons ----------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: var(--r-pill);
  font-weight: 600; font-size: 14px; line-height: 1;
  border: 1px solid var(--border-strong);
  background: var(--surface-2); color: var(--text);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease), background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast);
  white-space: nowrap; user-select: none;
}
.btn svg { width: 16px; height: 16px; }
.btn:hover { transform: translateY(-2px); background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(0); }
.btn.primary { background: var(--lime); color: var(--on-lime); border-color: var(--lime); box-shadow: 0 0 22px var(--lime-glow); }
.btn.primary:hover { background: var(--lime-hover); box-shadow: 0 0 30px var(--lime-glow), var(--shadow-btn); }
.btn.violet { background: var(--violet); color: var(--on-violet); border-color: var(--violet); box-shadow: 0 0 22px var(--violet-glow); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-2); }
.btn.ghost:hover { color: var(--text); border-color: var(--border-strong); }
.btn.outline-lime { background: transparent; color: var(--accent-ink); border-color: var(--lime-line); }
.btn.outline-lime:hover { background: var(--lime-soft); box-shadow: 0 0 18px var(--lime-glow); }
.btn.sm { padding: 8px 13px; font-size: 13px; }
.btn.xs { padding: 6px 10px; font-size: 12px; }
.btn.lg { padding: 14px 24px; font-size: 15px; }
.btn.icon { padding: 9px; width: 38px; height: 38px; border-radius: 10px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.done { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); box-shadow: none; }

/* Progress ---------------------------------------------------------------- */
.progress { height: 8px; background: var(--surface-3); border-radius: 999px; overflow: hidden; position: relative; }
.progress > i {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background: var(--fase-c, var(--accent-bar));
  box-shadow: 0 0 calc(12px * var(--glow-k)) var(--fase-c, var(--accent-bar));
  transition: width 900ms var(--ease);
}
.progress.thin { height: 4px; }
.progress.lg { height: 12px; }
.progress > i.lime { background: var(--accent-bar); box-shadow: 0 0 calc(12px * var(--glow-k)) var(--lime-glow); }

.ring { --size: 64px; --stroke: 6px; --pct: 0; width: var(--size); height: var(--size); position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: var(--stroke); stroke-linecap: round; }
.ring .track { stroke: var(--surface-3); }
.ring .bar { stroke: var(--fase-c, var(--accent-bar)); filter: drop-shadow(0 0 calc(6px * var(--glow-k)) var(--fase-c, var(--accent-bar))); transition: stroke-dashoffset 1s var(--ease); }
.ring .label { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-mono); font-size: calc(var(--size) * .22); font-weight: 600; }

/* Stat -------------------------------------------------------------------- */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .num { font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.02em; line-height: 1; }
.stat .num.lime { color: var(--accent-ink); text-shadow: var(--glow-text-lg); }
.stat .lbl { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; }

/* Tabs -------------------------------------------------------------------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 12px 14px; font-weight: 600; font-size: 14px; color: var(--text-muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
  transition: color var(--t-fast), border-color var(--t-fast);
  display: inline-flex; align-items: center; gap: 8px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent-ink); border-bottom-color: var(--accent-ink); text-shadow: var(--glow-text-sm); }
.tab .n { font-family: var(--font-mono); font-size: 11px; background: var(--surface-3); padding: 1px 7px; border-radius: 999px; color: var(--text-2); }
.tab-panel { display: none; animation: fade-up var(--t-slow) var(--ease); }
.tab-panel.active { display: block; }

/* Phase map (dashboard) --------------------------------------------------- */
.fase-map { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.fase-tile {
  --fase-c: var(--f-costruisci);
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  padding: 18px; cursor: pointer; text-align: left;
  box-shadow: var(--shadow-card);
  transition: transform var(--t-med) var(--ease), border-color var(--t-med), box-shadow var(--t-med);
}
.fase-tile::after { content: ''; position: absolute; inset: 0; background: radial-gradient(80% 60% at 100% 0%, color-mix(in srgb, var(--fase-c) 18%, transparent), transparent 70%); opacity: .8; pointer-events: none; }
.fase-tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--fase-c) 50%, transparent); }
.fase-tile.active { border-color: var(--fase-c); box-shadow: 0 0 0 1px color-mix(in srgb, var(--fase-c) 40%, transparent), 0 0 calc(26px * var(--glow-k)) color-mix(in srgb, var(--fase-c) 30%, transparent); }
.fase-tile .idx { font-family: var(--font-mono); font-size: 11px; color: color-mix(in srgb, var(--fase-c) var(--fase-ink-mix), #000); letter-spacing: .16em; }
.fase-tile .name { font-family: var(--font-display); font-weight: 800; font-size: 18px; margin: 6px 0 4px; color: var(--text); }
.fase-tile .desc { font-size: 12.5px; color: var(--text-2); min-height: 36px; }
.fase-tile .progress { margin-top: 12px; }
.fase-tile .pct { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); margin-top: 6px; }

/* Module cards ------------------------------------------------------------ */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.mod-card { display: flex; flex-direction: column; gap: 12px; min-height: 190px; padding-left: 22px; }
.mod-card .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.mod-card .id { font-family: var(--font-mono); font-size: 12px; color: color-mix(in srgb, var(--fase-c) var(--fase-ink-mix), #000); letter-spacing: .12em; }
.mod-card h3 { font-size: 16px; margin-top: 6px; }
.mod-card .obj { color: var(--text-2); font-size: 13px; flex: 1; }
.mod-card .meta { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.mod-card .lock { position: absolute; top: 14px; right: 14px; color: var(--text-muted); }
.mod-card .lock svg { width: 16px; height: 16px; }

/* Lesson list ------------------------------------------------------------- */
.lesson-list { display: flex; flex-direction: column; gap: 8px; }
.lesson-row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast), background var(--t-fast);
}
.lesson-row:hover { transform: translateX(3px); border-color: var(--border-strong); background: var(--surface-2); }
.lesson-row.current { border-color: var(--lime-line); box-shadow: 0 0 20px var(--lime-soft); }
.lesson-row .check {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--border-strong);
  display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted);
}
.lesson-row .check svg { width: 14px; height: 14px; }
.lesson-row.done .check { background: var(--lime); border-color: var(--lime); color: var(--on-lime); box-shadow: 0 0 calc(14px * var(--glow-k)) var(--lime-glow); }
.lesson-row .ttl { font-weight: 600; font-size: 14.5px; }
.lesson-row .sub { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.lesson-row .right { display: flex; gap: 8px; align-items: center; }

/* Player (sempre scuro: è video) ------------------------------------------ */
.player {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  background: #000; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-player);
  color: var(--code-title);
}
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .placeholder {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px;
  background:
    radial-gradient(50% 60% at 50% 40%, var(--player-glow), transparent 70%),
    linear-gradient(180deg, var(--player-bg-1), var(--player-bg-2));
}
.player .placeholder .play {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 16px;
  background: var(--code-accent); display: grid; place-items: center; color: var(--on-lime);
  box-shadow: 0 0 40px var(--code-accent-soft); animation: glow-pulse 2.4s ease-in-out infinite;
}
.player .placeholder .play svg { width: 28px; height: 28px; margin-left: 4px; }
.player .placeholder .t { font-family: var(--font-display); font-weight: 700; font-size: 18px; color: var(--code-title); }
.player .placeholder .s { color: var(--code-muted); font-size: 13px; margin-top: 6px; font-family: var(--font-mono); }
.player .placeholder .muted { color: var(--code-text); }
.player .kbd { background: var(--code-bg-2); border-color: var(--code-border); color: var(--code-title); }

/* Video di benvenuto W00 (dashboard) ------------------------------------- */
.welcome-card { padding: 0; overflow: hidden; }
.welcome-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr); align-items: center; }
.welcome-grid .player { border-radius: 0; border: 0; box-shadow: none; align-self: stretch; height: 100%; }
.welcome-grid .player .placeholder .t { font-size: 17px; }
.welcome-body { padding: 24px 26px; min-width: 0; }
.welcome-body h2 { font-size: 24px; line-height: 1.15; }
.welcome-row {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 16px; padding: 12px 16px;
  border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text);
  font: inherit; text-align: left; cursor: pointer; box-shadow: var(--shadow-card);
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.welcome-row:hover { border-color: var(--lime-line); background: var(--lime-soft); transform: translateY(-1px); }
.welcome-row .ico { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--lime); color: var(--on-lime); box-shadow: 0 0 calc(14px * var(--glow-k)) var(--lime-glow); }
.welcome-row .ico svg { width: 16px; height: 16px; margin-left: 2px; }
.welcome-row .t { display: block; font-weight: 600; font-size: 14px; }
.welcome-row .s { display: block; font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: .06em; margin-top: 2px; }
.welcome-row .muted svg { width: 16px; height: 16px; display: block; }

/* Scaletta / checklist / prompt ---------------------------------------- */
.steps { counter-reset: step; display: flex; flex-direction: column; gap: 10px; }
.step {
  display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-card);
}
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--font-mono); font-size: 12px; color: var(--accent-ink);
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: var(--lime-soft); border: 1px solid var(--lime-line);
}
.step p { font-size: 14.5px; }

.check-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.check-item:hover { border-color: var(--border-strong); }
.check-item input { position: absolute; opacity: 0; pointer-events: none; }
.check-item .box {
  width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border-strong); flex: none; margin-top: 1px;
  display: grid; place-items: center; transition: all var(--t-fast) var(--ease);
}
.check-item .box svg { width: 13px; height: 13px; opacity: 0; transform: scale(.5); transition: all var(--t-fast) var(--ease); color: var(--on-lime); }
.check-item.checked .box { background: var(--lime); border-color: var(--lime); box-shadow: 0 0 calc(12px * var(--glow-k)) var(--lime-glow); }
.check-item.checked .box svg { opacity: 1; transform: scale(1); }
.check-item.checked .txt { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--text-muted); }

/* Blocchi prompt / codice: SEMPRE scuri (anche nel tema chiaro, voluto) */
.prompt-box { background: var(--code-bg); border: 1px solid var(--code-border); border-radius: 14px; overflow: hidden; color: var(--code-text); color-scheme: dark; }
.prompt-box .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--code-bg-2); border-bottom: 1px solid var(--code-border); }
.prompt-box .head .t { font-weight: 600; font-size: 13.5px; color: var(--code-title); }
.prompt-box pre {
  margin: 0; padding: 16px; white-space: pre-wrap; word-break: break-word;
  font-family: var(--font-mono); font-size: 12.5px; line-height: 1.6; color: var(--code-text);
  max-height: 340px; overflow: auto;
}
.prompt-box .btn.outline-lime { color: var(--code-accent); border-color: var(--code-accent-line); }
.prompt-box .btn.outline-lime:hover { background: var(--code-accent-soft); box-shadow: none; }
.prompt-box ::selection { background: var(--code-accent); color: var(--on-lime); }

textarea.notes {
  width: 100%; min-height: 220px; resize: vertical;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px; font-family: var(--font-body); font-size: 14px; line-height: 1.6; color: var(--text);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea.notes::placeholder, .input::placeholder, .search::placeholder { color: var(--text-muted); opacity: 1; }
textarea.notes:focus { outline: none; border-color: var(--lime-line); box-shadow: 0 0 0 3px var(--lime-soft); }

/* Inputs / search ---------------------------------------------------------- */
.input, .search {
  width: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 14px; font-size: 14px; color: var(--text); transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.input:focus, .search:focus { outline: none; border-color: var(--lime-line); box-shadow: 0 0 0 3px var(--lime-soft); }
.search-wrap { position: relative; }
.search-wrap svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.search-wrap .search { padding-left: 40px; }
select.input { appearance: none; -webkit-appearance: none; background-image: var(--select-arrow); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 13px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  transition: all var(--t-fast) var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--lime-soft); color: var(--accent-ink); border-color: var(--lime-line); }

/* Switch ------------------------------------------------------------------- */
.switch { display: inline-flex; align-items: center; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; }
.switch button { padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--text-muted); transition: all var(--t-fast); }
.switch button.active { background: var(--lime); color: var(--on-lime); box-shadow: 0 0 calc(16px * var(--glow-k)) var(--lime-glow); }

/* Toast / modal ------------------------------------------------------------ */
.toast-wrap { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; pointer-events: none; width: min(420px, calc(100vw - 32px)); }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--lime-line); color: var(--text);
  padding: 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-pop), 0 0 24px var(--lime-soft);
  animation: toast-in var(--t-slow) var(--ease);
}
.toast svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; }
.toast.out { animation: toast-out var(--t-med) var(--ease) forwards; }
.modal-bg { position: fixed; inset: 0; background: var(--overlay); backdrop-filter: blur(6px); z-index: 90; display: grid; place-items: center; padding: 16px; animation: fade-in var(--t-med); }
.modal { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border-strong); border-radius: 20px; padding: 24px; box-shadow: var(--shadow-pop); animation: fade-up var(--t-slow) var(--ease); }

/* Streak / sistema ---------------------------------------------------------- */
.streak-days { display: flex; gap: 6px; }
.streak-days .d { flex: 1; aspect-ratio: 1; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; color: var(--text-muted); border: 1px solid transparent; }
.streak-days .d.on { background: var(--lime); color: var(--on-lime); box-shadow: 0 0 calc(12px * var(--glow-k)) var(--lime-glow); }
.streak-days .d.today { border-color: color-mix(in srgb, var(--accent-ink) 60%, transparent); }
:root:not([data-theme="dark"]) .streak-days .d { color: var(--text-2); } /* AA su surface-3 nel chiaro */
.sys-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
/* La riga va a capo da sola: il testo del pezzo non deve mai finire sotto «Fai verificare». */
.sys-item { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; cursor: pointer; box-shadow: var(--shadow-card); transition: all var(--t-fast); }
.sys-item > .sys-testo { flex: 1 1 120px; min-width: 0; }
.sys-item .t, .sys-item .s { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sys-item:hover { border-color: var(--border-strong); }
.sys-item .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-muted); flex: none; }
.sys-item .ico svg { width: 16px; height: 16px; }
.sys-item.on .ico { background: var(--lime-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--lime-line); }
.sys-item .t { font-weight: 600; font-size: 13.5px; }
.sys-item .s { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); letter-spacing: .06em; }
.sys-item.on .s { color: var(--accent-ink); }

/* Tool / stack cards ---------------------------------------------------------- */
.tool-card { display: flex; flex-direction: column; gap: 12px; }
.tool-card .logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--border); font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--accent-ink);
}
.tool-card .plan { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 4px; }
.tool-card .plan b { color: var(--text); font-weight: 600; }
.tool-card .plan b.lime { color: var(--accent-ink); }
.tool-card .plan .k { color: var(--text-muted); }
.disclosure { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: color-mix(in srgb, var(--warn) 8%, transparent); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 14px; font-size: 13.5px; color: var(--text-2); }
.disclosure svg { width: 18px; height: 18px; color: var(--warn); flex: none; margin-top: 2px; }
.disclosure b { color: var(--text); }
.callout { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13.5px; color: var(--text-2); display: flex; gap: 12px; align-items: flex-start; }
.callout svg { width: 18px; height: 18px; flex: none; margin-top: 1px; color: var(--accent-ink); }
.callout.violet svg { color: var(--violet); }
.callout.warn { border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.callout.warn svg { color: var(--warn); }
.kbd { font-family: var(--font-mono); font-size: 11px; padding: 2px 6px; border-radius: 5px; background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-2); }

/* Section headers ---------------------------------------------------------- */
.section { margin-top: 36px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { display: flex; align-items: center; gap: 10px; }
.section-head .sub { color: var(--text-muted); font-size: 13.5px; margin-top: 4px; }

/* Calendar ---------------------------------------------------------------- */
.event { display: grid; grid-template-columns: 64px 1fr auto; gap: 16px; align-items: center; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-card); }
.event .date { text-align: center; border-right: 1px solid var(--border); padding-right: 14px; }
.event .date .dd { font-family: var(--font-display); font-weight: 800; font-size: 24px; color: var(--accent-ink); line-height: 1; }
.event .date .mm { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .1em; }
.event .t { font-weight: 600; }
.event .s { color: var(--text-muted); font-size: 13px; margin-top: 3px; }

/* Empty state ------------------------------------------------------------- */
.empty { text-align: center; padding: 48px 20px; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: 16px; }

/* Animations ------------------------------------------------------------ */
@keyframes cursor-blink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes glow-pulse { 0%, 100% { box-shadow: 0 0 22px var(--lime-glow); } 50% { box-shadow: 0 0 44px var(--lime-glow), 0 0 0 6px var(--lime-soft); } }
@keyframes mesh-drift { 0% { transform: translate(0,0) rotate(0deg) scale(1); } 100% { transform: translate(6%, -4%) rotate(8deg) scale(1.08); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px); } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.fade-up { animation: fade-up var(--t-slow) var(--ease) both; }
.fade-up[data-delay="1"] { animation-delay: 60ms; }
.fade-up[data-delay="2"] { animation-delay: 120ms; }
.fade-up[data-delay="3"] { animation-delay: 180ms; }
.fade-up[data-delay="4"] { animation-delay: 240ms; }
.fade-up[data-delay="5"] { animation-delay: 300ms; }
.stagger > * { animation: fade-up var(--t-slow) var(--ease) both; }
.stagger > *:nth-child(1) { animation-delay: 40ms; }
.stagger > *:nth-child(2) { animation-delay: 80ms; }
.stagger > *:nth-child(3) { animation-delay: 120ms; }
.stagger > *:nth-child(4) { animation-delay: 160ms; }
.stagger > *:nth-child(5) { animation-delay: 200ms; }
.stagger > *:nth-child(6) { animation-delay: 240ms; }
.stagger > *:nth-child(7) { animation-delay: 280ms; }
.stagger > *:nth-child(8) { animation-delay: 320ms; }
.stagger > *:nth-child(9) { animation-delay: 360ms; }
.stagger > *:nth-child(10) { animation-delay: 400ms; }
.stagger > *:nth-child(n+11) { animation-delay: 440ms; }
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 12px; min-height: 80px; border: 1px solid var(--border); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1100px) {
  .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
  .fase-map { grid-template-columns: repeat(2, 1fr); }
  .hero .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .welcome-grid { grid-template-columns: 1fr; }
  .welcome-grid .player { height: auto; }
  .shell { grid-template-columns: 1fr; }
  .nav { position: fixed; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-104%); transition: transform var(--t-med) var(--ease); box-shadow: var(--shadow-drawer); }
  .nav.open { transform: translateX(0); }
  .nav-overlay.open { display: block; }
  .burger { display: grid; }
  .grid.cols-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 14.5px; }
  /* Sotto i 640 px il percorso di navigazione non ci sta accanto all'avanzamento e al tema:
     restava una sillaba tagliata a metà. Meglio niente: la pagina la dice già il titolo. */
  .topbar .crumbs { display: none; }
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .fase-map { grid-template-columns: 1fr 1fr; gap: 10px; }
  .fase-tile { padding: 14px; }
  .fase-tile .name { font-size: 15px; }
  .fase-tile .desc { display: none; }
  .mod-grid { grid-template-columns: 1fr; }
  .lesson-row { grid-template-columns: 30px 1fr; }
  .lesson-row .right { grid-column: 2; justify-content: flex-start; }
  .event { grid-template-columns: 56px 1fr; }
  .event .btn { grid-column: 2; justify-self: start; }
  .content { padding: 20px 16px 90px; }
  .hero { padding: 22px 18px; border-radius: 18px; }
  .btn.lg { width: 100%; }
  .card { padding: 16px; }
  .tabs { gap: 2px; }
  .tab { padding: 10px 10px; font-size: 13px; }
  .lesson-nav { flex-direction: column; }
  .lesson-nav .btn { width: 100%; }
  .welcome-body { padding: 18px 16px; }
  .welcome-body h2 { font-size: 20px; }
  .welcome-body .btn.lg { width: 100%; }
  .welcome-row { flex-wrap: wrap; }
  .welcome-row .badge { margin-left: auto; }
  .welcome-grid .player .placeholder { padding: 16px; }
  .welcome-grid .player .placeholder .play { width: 56px; height: 56px; margin-bottom: 10px; }
  .welcome-grid .player .placeholder .play svg { width: 22px; height: 22px; }
  .welcome-grid .player .placeholder .muted { display: none; }
}

/* ==========================================================================
   Blocco 2 — quiz, attestato (A4 landscape + stampa), live, supporto, sistema
   ========================================================================== */
/* Quiz ------------------------------------------------------------------- */
.quiz-box { padding: 26px; }
.quiz-q { font-size: clamp(18px, 2.2vw, 24px); line-height: 1.3; }
.quiz-opts { display: grid; gap: 10px; }
.quiz-opt { display: flex; align-items: center; gap: 12px; text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); font-size: 15px; transition: all var(--t-fast); }
.quiz-opt:hover:not(:disabled) { border-color: var(--lime-line); background: var(--lime-soft); transform: translateY(-1px); }
.quiz-opt:disabled { cursor: default; opacity: .85; }
.quiz-opt .k { flex: none; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; background: var(--surface-3); color: var(--text-2); }
.quiz-opt.ok { border-color: color-mix(in srgb, var(--ok) 50%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); opacity: 1; }
.quiz-opt.ok .k { background: var(--ok); color: #fff; }
.quiz-opt.ko { border-color: color-mix(in srgb, var(--err) 45%, transparent); background: color-mix(in srgb, var(--err) 8%, transparent); opacity: 1; }
.quiz-opt.ko .k { background: var(--err); color: #fff; }
.quiz-result-grid { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.quiz-card .tool-card .logo { width: 48px; height: 48px; }

/* Sistema ---------------------------------------------------------------- */
.sys-item .sys-edit { flex: none; opacity: .7; }
.sys-item:hover .sys-edit { opacity: 1; }
.sys-link { display: block; }
.sys-link .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--lime-soft); color: var(--accent-ink); flex: none; }
.sys-link .ico svg { width: 15px; height: 15px; }

/* Live ------------------------------------------------------------------- */
.live-cd { min-width: 110px; }
@media (max-width: 640px) { .live-cd { grid-column: 2; text-align: left !important; display: flex; gap: 10px; align-items: center; } .live-cd .cd { margin-top: 0 !important; } }

/* Supporto --------------------------------------------------------------- */
.faq-item { border-top: 1px solid var(--border); }
.faq-item:first-child { border-top: 0; }
.faq-item summary { cursor: pointer; padding: 11px 0; font-weight: 600; font-size: 14px; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-family: var(--font-mono); color: var(--accent-ink); }
.faq-item[open] summary::after { content: '–'; }
.thread { display: flex; flex-direction: column; gap: 8px; }
.thread .msg { max-width: 92%; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); font-size: 13.5px; }
.thread .msg.me { align-self: flex-start; }
.thread .msg.admin { align-self: flex-end; background: var(--lime-soft); border-color: var(--lime-line); }
.thread .who { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
.thread .txt { white-space: pre-wrap; word-break: break-word; }

/* Attestato (A4 landscape 297×210 mm) ----------------------------------- */
.attestato-wrap { overflow-x: auto; }
.attestato {
  --att-ink: #0B0F19; --att-sec: #4B5563; --att-muted: #5F6B7D; --att-lime: #4A7500; --att-lime-fill: #C8FF00; --att-border: rgba(15,23,42,0.14);
  width: 297mm; min-height: 210mm; margin: 0 auto; padding: 16mm 18mm 14mm; box-sizing: border-box; position: relative;
  background: #FFFFFF; color: var(--att-ink); border: 1px solid var(--att-border); border-radius: 4px; box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column; justify-content: space-between; font-family: var(--font-body);
  background-image: linear-gradient(rgba(15,23,42,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15,23,42,0.035) 1px, transparent 1px);
  background-size: 12mm 12mm;
}
.attestato::before { content: ''; position: absolute; inset: 7mm; border: 1.5px solid var(--att-lime); border-radius: 3px; pointer-events: none; }
.attestato::after { content: ''; position: absolute; left: 7mm; right: 7mm; top: 7mm; height: 6px; background: var(--att-lime-fill); border-radius: 3px 3px 0 0; }
.att-head { display: flex; justify-content: space-between; align-items: center; }
.att-mark { font-family: var(--font-display); font-weight: 800; font-size: 26px; color: var(--att-ink); }
.att-mark .os { color: var(--att-lime); }
.att-mark .cursor { display: inline-block; width: .55em; height: 1em; background: var(--att-lime); vertical-align: -.15em; margin-left: 2px; animation: cursor-blink 1s steps(1) infinite; }
.att-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--att-muted); }
.att-body { text-align: center; padding: 8mm 10mm; }
.att-eyebrow { font-family: var(--font-mono); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--att-lime); }
.att-name { font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 4vw, 44px); letter-spacing: -0.01em; margin: 10px 0 14px; color: var(--att-ink); }
.att-text { font-size: 16px; line-height: 1.6; color: var(--att-sec); max-width: 190mm; margin: 0 auto; }
.att-text b { color: var(--att-ink); }
.att-meta { display: flex; justify-content: center; gap: 40px; margin-top: 12mm; flex-wrap: wrap; }
.att-k { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--att-muted); }
.att-v { font-size: 15px; font-weight: 600; margin-top: 4px; color: var(--att-ink); }
.att-v.small { font-size: 12.5px; font-weight: 500; }
.att-foot { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; }
.att-sign { text-align: left; }
.att-sig { font-family: 'Unbounded', var(--font-display); font-weight: 700; font-size: 22px; color: var(--att-ink); border-bottom: 1px solid var(--att-ink); padding: 0 12px 4px 0; margin-bottom: 6px; display: inline-block; font-style: italic; }
.att-disclaimer { max-width: 120mm; font-size: 10.5px; line-height: 1.5; color: var(--att-muted); text-align: right; }
@media (max-width: 900px) { .attestato { width: 100%; min-height: 0; padding: 22px 18px; background-size: 40px 40px; } .attestato::before { inset: 8px; } .attestato::after { left: 8px; right: 8px; top: 8px; } .att-body { padding: 18px 0; } .att-meta { gap: 18px; margin-top: 22px; } .att-foot { flex-direction: column; align-items: flex-start; } .att-disclaimer { text-align: left; } }
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { background: #fff !important; }
  .nav, .topbar, .nav-overlay, .toast-wrap, .no-print, .callout.no-print { display: none !important; }
  .shell { display: block !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .attestato-wrap { overflow: visible; margin: 0 !important; }
  .attestato { width: 297mm; height: 210mm; min-height: 210mm; margin: 0; border: 0; border-radius: 0; box-shadow: none; page-break-after: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .att-mark .cursor { animation: none; }
}

/* ==========================================================================
   FIX — icona nei blocchi "vuoto"
   Le SVG inline non hanno width/height: dentro .empty (a tutta larghezza) il
   lucchetto arrivava a metà schermo su mobile. Le limitiamo a 64px.
   ========================================================================== */
.empty > svg, .empty > :not(h1,h2,h3,p,div,a,button) { width: 64px; height: 64px; margin: 0 auto 4px; color: var(--text-muted); }

/* Il burger nella topbar è in un flex row accanto ai crumbs: senza flex:none si schiacciava
   a 17px su mobile (area di tocco fuori norma). */
.burger { flex: none; }

/* Le SVG inline nei titoli non hanno width/height: dentro un flex row si gonfiavano fino a
   100px su schermi stretti (o collassavano a zero). Dimensione fissa e niente shrink. */
h1 > svg, h2 > svg, h3 > svg, h4 > svg { width: 20px; height: 20px; flex: none; }
.card-title h3 > svg, .section-head h2 > svg { width: 18px; height: 18px; flex: none; }

/* ==========================================================================
   DASHBOARD A SESSIONI — aree, card sessione, missione, achievement, extra
   (struttura comune alle due skin: la skin gaming ci aggiunge solo la forma)
   ========================================================================== */
.missione { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.missione .mis-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--lime-soft); color: var(--accent-ink); border: 1px solid var(--lime-line); flex: none; }
.missione .mis-ico svg { width: 22px; height: 22px; }
.missione .mis-body { min-width: 0; }
.missione .mis-body h3 { font-size: 18px; margin-top: 2px; }
.missione .mis-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
@media (max-width: 720px) { .missione { grid-template-columns: 1fr; } .missione .btn { width: 100%; justify-content: center; } }

.area { margin-top: 34px; }
.area-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.area-head .area-ix { font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: color-mix(in srgb, var(--fase-c, var(--accent-ink)) var(--fase-ink-mix), var(--text)); }
.area-head h2 { font-size: clamp(19px, 2.2vw, 24px); }
.area-head .area-desc { color: var(--text-muted); font-size: 13.5px; flex-basis: 100%; }
.area-head .area-stat { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.area-head .area-bar { width: 130px; }

.ses-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.ses-card { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; --fase-c: var(--accent-bar); }
.ses-card .ses-top { display: flex; align-items: flex-start; gap: 12px; }
.ses-card .ses-state { margin-left: auto; flex: none; }
.ses-card .ses-state:empty { display: none; }
.ses-card .ses-n { font-family: var(--font-display); font-weight: 800; font-size: 26px; line-height: 1; letter-spacing: -0.03em; color: color-mix(in srgb, var(--fase-c) var(--fase-ink-mix), var(--text)); flex: none; min-width: 44px; }
.ses-card h3 { font-size: 16px; line-height: 1.25; }
.ses-card .ses-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ses-card .ses-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); margin-top: auto; }
.ses-card .ses-meta .xp { color: var(--accent-ink); font-weight: 600; }
.ses-card .ses-chapters { display: flex; gap: 4px; }
.ses-card .ses-chapters i { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-3); transition: background var(--t-med) var(--ease); }
.ses-card .ses-chapters i.on { background: var(--fase-c); }
.ses-card .ses-chapters i.cur { background: color-mix(in srgb, var(--fase-c) 45%, var(--surface-3)); }
.ses-card.done { border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.ses-card .ses-state svg { width: 14px; height: 14px; }

.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.ach { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 16px 12px; border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.ach .ach-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.ach .ach-ico svg { width: 20px; height: 20px; }
.ach .ach-t { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.ach .ach-s { font-size: 11.5px; color: var(--text-2); line-height: 1.35; }
.ach .ach-xp { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; color: var(--text-muted); }
.ach.locked { opacity: .62; filter: grayscale(1); }
.ach.on { border-color: var(--lime-line); }
.ach.on .ach-ico { background: var(--lime-soft); color: var(--accent-ink); border-color: var(--lime-line); }
.ach.on .ach-xp { color: var(--accent-ink); }
.ach:hover { transform: translateY(-2px); }

.extra-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }

/* ==========================================================================
   PAGINA SESSIONE — player + capitoli
   ========================================================================== */
/* Desktop: player e schede a sinistra, capitoli in colonna a destra.
   Mobile: player, POI i capitoli, POI le schede del capitolo (grid-template-areas). */
.ses-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "player side" "panel side"; gap: 22px; align-items: start; }
.ses-player { grid-area: player; min-width: 0; }
.ses-side { grid-area: side; min-width: 0; position: sticky; top: 136px; }
.ses-panel { grid-area: panel; min-width: 0; }
@media (max-width: 1080px) {
  .ses-layout { grid-template-columns: 1fr; grid-template-areas: "player" "side" "panel"; gap: 16px; }
  .ses-side { position: static; }
}
.cap-list { display: flex; flex-direction: column; gap: 6px; max-height: 62vh; overflow: auto; padding-right: 4px; }
@media (max-width: 1080px) { .cap-list { max-height: none; } }
.cap-row { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--surface); transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.cap-row:hover { border-color: var(--border-strong); background: var(--surface-2); }
.cap-row .cap-n { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 11px; font-weight: 600; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); flex: none; }
.cap-row .cap-n svg { width: 13px; height: 13px; }
.cap-row .cap-t { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.cap-row .cap-s { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); margin-top: 3px; display: flex; gap: 10px; flex-wrap: wrap; }
.cap-row .cap-ts { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); flex: none; }
.cap-row.done .cap-n { background: var(--lime-soft); color: var(--accent-ink); border-color: var(--lime-line); }
.cap-row.current { border-color: var(--lime-line); background: var(--lime-soft); }
.cap-row.current .cap-t { font-weight: 600; }
.cap-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.cap-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ==========================================================================
   SKIN GAMING — componenti
   ========================================================================== */
/* micro-griglia di sfondo */
:root[data-skin="gaming"] body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(var(--grid-micro) 1px, transparent 1px), linear-gradient(90deg, var(--grid-micro) 1px, transparent 1px);
  background-size: var(--grid-micro-step) var(--grid-micro-step);
  mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 60% at 50% 0%, #000 0%, transparent 78%);
}
:root[data-skin="gaming"] .shell { position: relative; z-index: 1; }
/* Menu mobile aperto: lo z-index della shell crea un contesto di impilamento e la velatura (.nav-overlay, figlia di body)
   finiva SOPRA la barra laterale, rendendola sfocata e non cliccabile. Mentre il menu è aperto la shell rinuncia al contesto. */
:root[data-skin="gaming"] .shell:has(> .nav.open) { z-index: auto; }

/* angoli tagliati + doppio bordo sulle superfici principali */
:root[data-skin="gaming"] .card,
:root[data-skin="gaming"] .hero,
:root[data-skin="gaming"] .ach,
:root[data-skin="gaming"] .empty,
:root[data-skin="gaming"] .hud {
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  border-radius: 0;
}
:root[data-skin="gaming"] .card { position: relative; }
:root[data-skin="gaming"] .card::after {
  content: ''; position: absolute; inset: 4px; pointer-events: none; border: 1px solid var(--skin-line-2);
  clip-path: polygon(calc(var(--cut) - 4px) 0, 100% 0, 100% calc(100% - var(--cut) + 4px), calc(100% - var(--cut) + 4px) 100%, 0 100%, 0 calc(var(--cut) - 4px));
}
:root[data-skin="gaming"] .card.compact::after,
:root[data-skin="gaming"] .ses-card::after { inset: 3px; }
:root[data-skin="gaming"] .card.glow { box-shadow: var(--skin-glow); }
:root[data-skin="gaming"] .btn { border-radius: 4px; }
:root[data-skin="gaming"] .btn.primary:hover { box-shadow: var(--skin-glow); }
:root[data-skin="gaming"] .badge { border-radius: 3px; }
:root[data-skin="gaming"] .cap-row { border-radius: 0; clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm)); }
:root[data-skin="gaming"] .cap-row.current { box-shadow: inset 0 0 0 1px var(--skin-line); }
:root[data-skin="gaming"] .ses-card.done { box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 30%, transparent); }
:root[data-skin="gaming"] .ach.on { box-shadow: var(--skin-glow); }
:root[data-skin="gaming"] .nav a.item.active { box-shadow: inset 2px 0 0 var(--accent-ink); }

/* HUD sticky ------------------------------------------------------------- */
.hud {
  position: sticky; top: 64px; z-index: 19;   /* sotto la topbar, che è sticky a 0 */
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 10px 16px; margin-bottom: 20px;
  background: var(--hud-bg, var(--surface)); border: 1px solid var(--border);
  border-radius: var(--r-card);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
:root[data-skin="gaming"] .hud { border-color: var(--skin-line); box-shadow: var(--skin-glow); }
.hud .hud-lvl { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* Contrasto AA: #05060A su #4A7500 sarebbe 3.7:1 — in tema chiaro il numero va bianco (5.4:1). */
.lvl-badge {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  font-family: var(--font-display); font-weight: 800; font-size: 15px; line-height: 1;
  color: #FFFFFF; background: var(--accent-ink); border-radius: 10px;
}
:root[data-theme="dark"] .lvl-badge { color: var(--on-lime); }
:root[data-skin="gaming"] .lvl-badge { border-radius: 0; clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.hud .lvl-txt { min-width: 0; }
.hud .lvl-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud .lvl-k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); }
.hud .hud-xp { flex: 1 1 200px; min-width: 160px; }
.hud .hud-xp .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.hud .hud-xp .xp-n { font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: var(--accent-ink); }
.hud .hud-xp .xp-next { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-muted); }
.xp-track { height: 9px; margin-top: 5px; background: var(--surface-3); border-radius: 999px; overflow: hidden; position: relative; }
:root[data-skin="gaming"] .xp-track { border-radius: 0; clip-path: polygon(3px 0, 100% 0, 100% calc(100% - 3px), calc(100% - 3px) 100%, 0 100%, 0 3px); }
.xp-track > i { display: block; height: 100%; width: 0; background: var(--xp-fill, var(--accent-bar)); transition: width 900ms var(--ease); }
:root[data-skin="gaming"] .xp-track > i { box-shadow: 0 0 12px var(--lime-glow); }
.hud .hud-chip { display: flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--border); border-radius: var(--r-pill); font-family: var(--font-mono); font-size: 12px; font-weight: 600; white-space: nowrap; }
:root[data-skin="gaming"] .hud .hud-chip { border-radius: 3px; }
.hud .hud-chip svg { width: 15px; height: 15px; }
.hud .hud-chip.combo { color: var(--combo-ink, var(--warn)); border-color: color-mix(in srgb, var(--combo-ink, var(--warn)) 34%, transparent); background: var(--combo-soft, transparent); }
.hud .hud-chip.combo.hot svg { animation: flame-pulse 1.4s ease-in-out infinite; }
.hud .hud-chip.sys { color: var(--accent-ink); border-color: var(--lime-line); background: var(--lime-soft); }
@keyframes flame-pulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.16); opacity: 1; } }
@media (max-width: 720px) {
  .hud { gap: 10px 12px; padding: 10px 12px; }
  .hud .hud-xp { flex-basis: 100%; order: 3; }
  .hud .hud-chip { font-size: 11px; padding: 5px 9px; }
}

/* transizione "scan" all'ingresso delle sezioni ------------------------- */
:root[data-skin="gaming"] .scan-in { position: relative; animation: scan-fade 520ms var(--ease) both; }
:root[data-skin="gaming"] .scan-in::after {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--skin-scan);
  box-shadow: 0 0 14px var(--skin-scan); pointer-events: none; animation: scan-sweep 620ms var(--ease) forwards;
}
@keyframes scan-sweep { 0% { top: 0; opacity: 1; } 90% { opacity: 1; } 100% { top: 100%; opacity: 0; } }
@keyframes scan-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* modale LIVELLO SU ------------------------------------------------------ */
.levelup { text-align: center; max-width: 400px; }
.levelup .lu-k { font-family: var(--font-mono); font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--accent-ink); }
.levelup .lu-n { font-family: var(--font-display); font-weight: 800; font-size: 68px; line-height: 1; letter-spacing: -0.04em; margin: 6px 0 2px; color: var(--accent-ink); text-shadow: var(--glow-text-lg); }
.levelup .lu-name { font-family: var(--font-display); font-weight: 800; font-size: 24px; margin-bottom: 8px; }
.levelup .lu-ring { width: 108px; height: 108px; margin: 4px auto 10px; border-radius: 50%; border: 2px solid var(--lime-line); display: grid; place-items: center; animation: lu-pop 620ms var(--ease) both; }
:root[data-skin="gaming"] .levelup .lu-ring { border-radius: 0; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
@keyframes lu-pop { 0% { transform: scale(.6) rotate(-6deg); opacity: 0; } 60% { transform: scale(1.06); opacity: 1; } 100% { transform: scale(1); } }
.ach-pop { display: flex; align-items: center; gap: 12px; text-align: left; padding: 10px 12px; border: 1px solid var(--lime-line); background: var(--lime-soft); border-radius: var(--r-sm); }
:root[data-skin="gaming"] .ach-pop { border-radius: 0; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }

/* voce «Candidati per il mio team» in fondo alla sidebar (BRIEF-CEO §14) --
   Separata dal corso: tratteggio sopra, colore violetto (mai il lime del percorso), testo obbligatorio sotto. */
:root { --violet-ink: #6D28D9; }
:root[data-theme="dark"] { --violet-ink: #A78BFA; }   /* AA sul fondo scuro */
.nav-lavora { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border-strong); }
.nav-lavora-card {
  display: grid; grid-template-columns: 26px 1fr; align-items: center; column-gap: 9px; row-gap: 6px;
  padding: 10px; border-radius: 12px;
  border: 1px solid var(--violet-line); background: var(--violet-soft); color: var(--text);
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.nav-lavora-card:hover { transform: translateX(2px); border-color: var(--violet-ink); }
.nav-lavora-card:focus-visible { outline: 2px solid var(--violet-ink); outline-offset: 2px; }
.nav-lavora-card.active { border-color: var(--violet-ink); box-shadow: inset 2px 0 0 var(--violet-ink); }
.nav-lavora-card .ico { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--surface); color: var(--violet-ink); border: 1px solid var(--violet-line); }
.nav-lavora-card .ico svg { width: 16px; height: 16px; }
.nav-lavora-card .t { font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--violet-ink); }
.nav-lavora-card .s { grid-column: 1 / -1; font-size: 11.5px; line-height: 1.35; color: var(--text-2); }
:root[data-skin="gaming"] .nav-lavora-card { border-radius: 0; clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm)); }
:root[data-skin="gaming"] .nav-lavora-card .ico { border-radius: 3px; }
.nav-lavora .nav-lavora-nota { font-size: 11px; line-height: 1.45; color: var(--text-2); padding: 8px 4px 0; }   /* testo obbligatorio: deve restare leggibile */

/* pagina candidatura.html ------------------------------------------------- */
#candForm [hidden], .cand-esterna[hidden] { display: none !important; }   /* .callout e .cand-esterna sono flex: senza questa regola `hidden` non nasconde */
.cand-avviso { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border: 1px solid var(--violet-line); border-left: 4px solid var(--violet-ink); background: var(--violet-soft); border-radius: 14px; color: var(--text); font-size: 14.5px; line-height: 1.55; }
.cand-avviso svg { width: 22px; height: 22px; flex: none; color: var(--violet-ink); margin-top: 1px; }
.cand-avviso b { color: var(--violet-ink); }
:root[data-skin="gaming"] .cand-avviso { border-radius: 0; clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm)); }
.cand-hero .eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--violet-ink); }
.cand-hero .eyebrow svg { width: 15px; height: 15px; }
.cand-hero h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.1; }
.cand-hero .lead { max-width: 64ch; }
.cand-bio { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cand-bio li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; font-size: 14.5px; line-height: 1.55; color: var(--text); }
.cand-bio li svg { width: 18px; height: 18px; color: var(--violet-ink); margin-top: 3px; }
.cand-nota { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.cand-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cand-list li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.cand-list li svg { width: 16px; height: 16px; margin-top: 3px; }
.cand-list.si li svg { color: var(--ok); }
.cand-list.no li svg { color: var(--err); }
.cand-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; counter-reset: passo; }
.cand-step { padding: 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.cand-step .n { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; color: var(--violet-ink); }
.cand-step h3 { font-size: 15px; margin: 6px 0 6px; }
.cand-step p { font-size: 13.5px; color: var(--text-2); line-height: 1.55; margin: 0; }
:root[data-skin="gaming"] .cand-step { border-radius: 0; clip-path: polygon(var(--cut-sm) 0, 100% 0, 100% calc(100% - var(--cut-sm)), calc(100% - var(--cut-sm)) 100%, 0 100%, 0 var(--cut-sm)); }
.cand-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 18px; }
.cand-form .span-2 { grid-column: 1 / -1; }
.cand-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.cand-field > label, .cand-field > .lbl { font-size: 13.5px; font-weight: 600; color: var(--text); }
.cand-field .opz { font-weight: 400; color: var(--text-2); }
.cand-field .hint { font-size: 12.5px; color: var(--text-2); }
.cand-field textarea.input { min-height: 140px; resize: vertical; line-height: 1.55; }
.cand-field [aria-invalid="true"] { border-color: var(--err); }
.cand-count { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-2); text-align: right; }
.cand-radio { display: flex; flex-wrap: wrap; gap: 8px; }
.cand-radio label { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 13.5px; cursor: pointer; color: var(--text); }
.cand-radio label:has(input:checked) { border-color: var(--violet-ink); background: var(--violet-soft); }
.cand-radio label:has(input:focus-visible) { outline: 2px solid var(--violet-ink); outline-offset: 2px; }
.cand-radio input { accent-color: var(--violet-ink); margin: 0; }
:root[data-skin="gaming"] .cand-radio label { border-radius: 4px; }
.cand-consenso { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-size: 13.5px; line-height: 1.5; color: var(--text); cursor: pointer; }
.cand-consenso input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--violet-ink); }
.cand-consenso .req { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-2); display: block; margin-top: 4px; }
.cand-consenso a { color: var(--violet-ink); text-decoration: underline; }
:root[data-skin="gaming"] .cand-consenso { border-radius: 0; }
.cand-ricevuta { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: start; }
.cand-ricevuta .big { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); }
.cand-ricevuta .big svg { width: 28px; height: 28px; }
.cand-riepilogo { display: grid; grid-template-columns: 190px 1fr; gap: 6px 14px; font-size: 13.5px; margin: 0; }
.cand-riepilogo dt { color: var(--text-2); }
.cand-riepilogo dd { margin: 0; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.cand-esterna { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 16px; border: 1px dashed var(--border-strong); border-radius: 14px; font-size: 13.5px; color: var(--text-2); }
.cand-esterna a { color: var(--violet-ink); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.cand-esterna a svg { width: 14px; height: 14px; }
@media (max-width: 900px) { .cand-steps { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .cand-form { grid-template-columns: 1fr; }
  .cand-riepilogo { grid-template-columns: 1fr; gap: 2px; }
  .cand-riepilogo dd { margin-bottom: 8px; }
  .cand-ricevuta { grid-template-columns: 1fr; }
}

/* interruttori dell'aspetto (pagina Account) ---------------------------- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--border); }
.seg { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-pill); }
:root[data-skin="gaming"] .seg { border-radius: 4px; }
.seg button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: var(--r-pill); font-size: 13px; font-weight: 600; color: var(--text-muted); white-space: nowrap; }
.seg button svg { width: 15px; height: 15px; flex: none; }
:root[data-skin="gaming"] .seg button { border-radius: 3px; }
.seg button.active { background: var(--accent-ink); color: #FFFFFF; }
:root[data-theme="dark"] .seg button.active { color: var(--on-lime); }
@media (max-width: 560px) {
  .switch-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .seg { align-self: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .xp-track > i, .hud .hud-chip.combo.hot svg, .levelup .lu-ring { animation: none !important; transition: none !important; }
  :root[data-skin="gaming"] .scan-in, :root[data-skin="gaming"] .scan-in::after { animation: none !important; }
}

/* ==========================================================================
   ASSISTENTE REVISIONE (blocco 4) — revisione.html + card «Il tuo sistema»
   Nessun colore hard-coded: tutto dalle variabili del tema. Contrasto AA in
   chiaro e in scuro, layout leggibile fino a 375px.
   ========================================================================== */

.rev-hero .rev-hero-body { max-width: 78ch; }
.eyebrow svg { width: 14px; height: 14px; vertical-align: -3px; }
.rev-hero .eyebrow { display: inline-flex; align-items: center; gap: 7px; }
.card-title h3 svg, .section-head h2 svg { width: 17px; height: 17px; flex: none; }
.rev-esito h4 svg, .rev-s svg { width: 15px; height: 15px; }
.rev-hero h1 { font-size: clamp(26px, 4vw, 40px); line-height: 1.1; }

/* scelta del tipo ---------------------------------------------------------- */
.rev-tipi { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.rev-tipo {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 14px; text-align: left; background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-card);
  transition: border-color var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast);
}
:root[data-skin="gaming"] .rev-tipo { border-radius: 0; clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.rev-tipo:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.rev-tipo .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-muted); margin-bottom: 6px; }
.rev-tipo .ico svg { width: 16px; height: 16px; }
.rev-tipo .t { font-weight: 600; font-size: 14px; }
.rev-tipo .s { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--text-muted); text-transform: uppercase; }
.rev-tipo.on { border-color: var(--lime-line); box-shadow: var(--shadow-lime); }
.rev-tipo.on .ico { background: var(--lime-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--lime-line); }
.rev-tipo .badge.xs { position: absolute; top: 10px; right: 10px; font-size: 10px; padding: 2px 6px; }
.rev-tipo .badge.xs svg { width: 11px; height: 11px; }

.rev-card .rev-lista { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px 18px; }
.rev-lista { list-style: none; display: grid; gap: 6px; }
.rev-lista li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--text-2); }
.rev-lista li svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent-ink); }

/* barra di avanzamento in stile gaming ------------------------------------- */
.rev-run { margin-top: 18px; padding: 16px; border: 1px solid var(--lime-line); border-radius: 14px; background: var(--surface-2); }
:root[data-skin="gaming"] .rev-run { border-radius: 0; clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px); }
.rev-run-bar { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
:root[data-skin="gaming"] .rev-run-bar { border-radius: 2px; }
.rev-run-bar > i { display: block; height: 100%; width: 4%; background: linear-gradient(90deg, var(--accent-ink), var(--lime)); transition: width 700ms var(--ease); }
.rev-run-passi { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; }
.rev-run-passi li { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-muted); }
.rev-run-passi .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--border-strong); flex: none; }
.rev-run-passi li.cur { color: var(--text); font-weight: 600; }
.rev-run-passi li.cur .dot { background: var(--accent-ink); animation: rev-pulse 1.1s ease-in-out infinite; }
.rev-run-passi li.done { color: var(--ok); }
.rev-run-passi li.done .dot { background: var(--ok); box-shadow: none; }
@keyframes rev-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5); opacity: .55; } }

/* punteggio ---------------------------------------------------------------- */
.rev-ring { position: relative; width: var(--size, 148px); height: var(--size, 148px); flex: none; }
.rev-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.rev-ring .track { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.rev-ring .bar { fill: none; stroke: var(--rev-c, var(--accent-ink)); stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset 1100ms var(--ease); }
.rev-ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.rev-ring .n { font-family: var(--font-display); font-weight: 800; font-size: 40px; line-height: 1; color: var(--rev-c, var(--text)); }
.rev-ring .d { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); letter-spacing: .1em; }

.rev-score-grid { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; }
.rev-score .rev-url { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; margin-top: 6px; word-break: break-all; }
.rev-score .rev-url svg { width: 13px; height: 13px; }
.rev-split { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.rev-split > div { padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
:root[data-skin="gaming"] .rev-split > div { border-radius: 0; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.rev-split .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.rev-split .v { font-family: var(--font-display); font-weight: 800; font-size: 22px; line-height: 1.2; margin-top: 2px; }
.rev-split .v span { font-family: var(--font-mono); font-size: 11px; font-weight: 400; color: var(--text-muted); }
.rev-split .w { font-size: 11.5px; color: var(--text-muted); }

/* suggerimenti ------------------------------------------------------------- */
.rev-sugg { display: grid; gap: 10px; }
.rev-s { display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 14px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong); border-radius: 12px; background: var(--surface-2); }
:root[data-skin="gaming"] .rev-s { border-radius: 0; }
.rev-s.imp-alto { border-left-color: var(--err); }
.rev-s.imp-medio { border-left-color: var(--warn); }
.rev-s.imp-basso { border-left-color: var(--text-muted); }
.rev-s .n { font-family: var(--font-mono); font-size: 13px; font-weight: 600; color: var(--text-muted); padding-top: 2px; }
.rev-s h4 { font-size: 14.5px; margin: 8px 0 6px; }
.rev-s p { font-size: 13px; color: var(--text-2); margin: 0 0 4px; line-height: 1.55; }
.rev-s p b { color: var(--text); }
.rev-s.imp-alto .badge.imp { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, transparent); background: color-mix(in srgb, var(--err) 10%, transparent); }
.rev-s.imp-medio .badge.imp { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: color-mix(in srgb, var(--warn) 10%, transparent); }

/* frasi a rischio ---------------------------------------------------------- */
.rev-rischio { padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); border-radius: 12px; background: color-mix(in srgb, var(--warn) 7%, transparent); }
:root[data-skin="gaming"] .rev-rischio { border-radius: 0; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.rev-rischio .frase { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; color: var(--text); font-style: italic; }
.rev-rischio .frase svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--warn); }
.rev-rischio .motivo { font-size: 12px; color: var(--warn); font-weight: 600; margin: 6px 0 0 24px; }
.rev-rischio .alt { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: var(--text-2); margin: 8px 0 0 24px; }
.rev-rischio .alt svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--ok); }

/* elenco dei controlli ----------------------------------------------------- */
.rev-check { display: grid; gap: 6px; }
.rev-c { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
:root[data-skin="gaming"] .rev-c { border-radius: 0; }
.rev-c .i { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--text-muted); }
.rev-c .i svg { width: 13px; height: 13px; }
.rev-c.ok .i { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.rev-c.ko .i { background: color-mix(in srgb, var(--err) 14%, transparent); color: var(--err); }
.rev-c.ko { border-color: color-mix(in srgb, var(--err) 26%, transparent); }
.rev-c .t { font-weight: 600; font-size: 13.5px; }
.rev-c .m { font-size: 12.5px; color: var(--text-2); line-height: 1.5; }
.rev-c .p { font-size: 11px; color: var(--text-muted); margin-left: auto; flex: none; padding-top: 3px; }
.rev-c.na { opacity: .7; }

/* storico ------------------------------------------------------------------ */
.rev-spark { display: flex; align-items: flex-end; gap: 4px; height: 56px; padding: 0 2px; border-bottom: 1px solid var(--border); }
.rev-spark > i { display: block; width: 12px; border-radius: 3px 3px 0 0; opacity: .85; }
:root[data-skin="gaming"] .rev-spark > i { border-radius: 0; }
.rev-storico { display: grid; gap: 4px; }
.rev-riga { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 8px 10px; border: 1px solid transparent; border-radius: 10px; color: var(--text); background: transparent; }
.rev-riga:hover { background: var(--surface-2); border-color: var(--border); }
.rev-riga .pt { font-family: var(--font-display); font-weight: 800; font-size: 18px; width: 40px; flex: none; }
.rev-riga .d { display: block; font-size: 12.5px; }
.rev-riga .u { display: block; font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rev-riga svg { width: 15px; height: 15px; margin-left: auto; flex: none; }

/* «Il tuo sistema»: stato verificato + pulsante «Fai verificare» ------------ */
.sys-item.verificato { border-color: color-mix(in srgb, var(--ok) 38%, transparent); }
.sys-item.verificato .ico { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ok) 35%, transparent); }
.sys-item .sys-ver { display: inline-flex; align-items: center; gap: 4px; color: var(--ok); font-weight: 600; }
.sys-item .sys-ver svg { width: 11px; height: 11px; }
.sys-item .sys-actions { flex: none; }
.sys-item .sys-verifica svg { width: 14px; height: 14px; }

/* La card "Extra" della dashboard ha un pulsante con dentro il titolo della sessione:
   sotto i 400px sforava in orizzontale. Qui va a capo invece di allargare la pagina. */
.extra-grid .btn { max-width: 100%; white-space: normal; text-align: left; height: auto; min-height: 26px; line-height: 1.35; }

/* varianti mancanti riusate qui -------------------------------------------- */
.callout.ok { border-color: color-mix(in srgb, var(--ok) 30%, transparent); background: color-mix(in srgb, var(--ok) 7%, transparent); }
.callout.ok svg { color: var(--ok); }
.btn.loading { opacity: .7; pointer-events: none; }

@media (max-width: 900px) {
  .rev-score-grid { grid-template-columns: 1fr; gap: 18px; justify-items: center; text-align: center; }
  .rev-score-grid .rev-split { text-align: left; }
  .rev-score-grid > div:last-child { width: 100%; }
  .rev-score-grid .row { justify-content: center; }
}
@media (max-width: 560px) {
  .rev-tipi { grid-template-columns: 1fr 1fr; }
  .rev-tipo { padding: 11px; }
  .rev-tipo .t { font-size: 13px; }
  .rev-card .rev-lista { grid-template-columns: 1fr; }
  .rev-ring { --size: 124px; }
  .rev-ring .n { font-size: 34px; }
  .rev-s { grid-template-columns: 1fr; gap: 4px; }
  .rev-s .n { display: none; }
  .rev-run-passi { gap: 6px 12px; }
  .sys-item .sys-actions { width: calc(100% - 46px); margin-left: 46px !important; flex-wrap: wrap; }
  .sys-item .sys-verifica .lbl { display: inline; }
  .rev-c .p { display: none; }
  .rev-spark > i { width: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .rev-ring .bar, .rev-run-bar > i { transition: none !important; }
  .rev-run-passi li.cur .dot { animation: none !important; }
}

/* ==========================================================================
   CONTENUTI PRO MENSILI e COPILOTA (15/09/2026)
   Calendario dei 12 mesi, card delle edizioni, scheda in markdown sicuro, conto del passaggio a PRO,
   pagina «Copilota in arrivo». Solo variabili del tema: valgono chiaro/scuro e skin gaming/essenziale.
   ========================================================================== */
.eyebrow.violet { color: var(--violet-ink, var(--violet)); }
.pro-cosa .row svg, .cop-inc svg, .pro-teaser svg { width: 18px; height: 18px; flex: none; color: var(--accent-ink); }
.pro-cosa .row { align-items: center; }
.pro-num { font-family: var(--font-display); font-weight: 800; font-size: 28px; line-height: 1.1; margin: 6px 0 2px; color: var(--text); }
.pro-ed { display: flex; flex-direction: column; min-width: 0; }
.pro-ed h3 { font-size: 16px; line-height: 1.3; }
.pro-ed.locked { background: var(--surface-2); }
.pro-ed.locked h3 { color: var(--text-2); }
.pro-cal { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.pro-mese { display: grid; grid-template-columns: 190px 1fr; gap: 14px; align-items: start; padding: 14px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.pro-mese.in_corso { border-color: var(--lime-line); box-shadow: 0 0 0 1px var(--lime-line) inset; }
.pro-mese.passato { background: var(--surface-2); }
.pro-mese-k { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.pro-mese-k .mono { font-size: 11px; letter-spacing: .16em; color: var(--accent-ink); font-weight: 600; }
.pro-mese-k .badge { align-self: flex-start; }
.pro-mese-body { display: grid; gap: 10px; min-width: 0; }
.pro-vuoto { font-size: 13px; color: var(--text-muted); padding: 12px 14px; border: 1px dashed var(--border); border-radius: 12px; }
.pro-teaser { align-items: center; }
.pro-teaser .btn { flex: none; }
.pro-upgrade { border-color: var(--violet-line); }
.pro-conto { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 560px; }
.pro-conto > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); font-size: 12.5px; }
.pro-conto b { font-family: var(--font-mono); font-size: 15px; color: var(--text); }
.pro-conto .tot { border-color: var(--violet-line); background: var(--violet-soft); }
.pro-conto .tot b { color: var(--violet-ink, var(--violet)); }
.pro-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
.pro-chiusa { max-width: 720px; }
.md { font-size: 15px; line-height: 1.65; color: var(--text-2); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md h2 { font-size: 20px; margin: 22px 0 8px; color: var(--text); }
.md h3 { font-size: 16.5px; margin: 18px 0 6px; color: var(--text); }
.md h4 { font-size: 14.5px; margin: 14px 0 6px; color: var(--text); }
.md p { margin: 0 0 12px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 4px 0; }
.md li.md-check { list-style: none; margin-left: -22px; display: flex; gap: 10px; align-items: flex-start; }
.md .md-box { flex: none; width: 18px; height: 18px; margin-top: 3px; border: 1.5px solid var(--border-strong, var(--border)); border-radius: 5px; display: grid; place-items: center; font-size: 12px; color: var(--accent-ink); }
.md strong { color: var(--text); }
.md a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.md code { font-family: var(--font-mono); font-size: .88em; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); }
.md pre { background: var(--code-bg); color: var(--code-text); border: 1px solid var(--code-border); border-radius: 12px; padding: 12px 14px; overflow-x: auto; margin: 0 0 12px; color-scheme: dark; }
.md pre code { background: none; border: 0; padding: 0; color: inherit; font-size: 12.5px; white-space: pre-wrap; }
.md blockquote { margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--lime-line); background: var(--surface-2); border-radius: 0 12px 12px 0; }
.md blockquote p:last-child { margin-bottom: 0; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
.md .md-table { overflow-x: auto; margin: 0 0 12px; border: 1px solid var(--border); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.md th, .md td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
.md th { background: var(--surface-2); color: var(--text); font-weight: 600; }
.md tr:last-child td { border-bottom: 0; }
.cop-inc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cop-inc > div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--lime-line); border-radius: 12px; background: var(--lime-soft); font-size: 12.5px; }
.cop-inc b { font-family: var(--font-display); font-size: 17px; color: var(--text); }
.cop-lista { margin: 0; padding-left: 18px; display: grid; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.cop-lista b { color: var(--text); }
@media (max-width: 1080px) { .pro-layout { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .pro-mese { grid-template-columns: 1fr; gap: 8px; }
  .pro-mese-k { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
  .pro-conto { grid-template-columns: 1fr; }
  .cop-inc { grid-template-columns: 1fr; }
  .pro-teaser { flex-wrap: wrap; }
}
