/* ============================================================================
   AI Academy — sistema visivo

   Continuità con `corso-completo.html`: stessa famiglia serif per il testo di
   studio, stessa gamma cromatica verde-inchiostro. Qui però si legge *e* si
   agisce, quindi accanto alla tipografia editoriale c'è un vero sistema di
   componenti: stati, profondità, movimento.

   Principi:
   · Una sola scala di spaziatura (4px) e una sola di raggio.
   · Il colore porta significato: verde = superato, ambra = in corso, rosso =
     fallito. Mai decorativo.
   · Il movimento accompagna un cambio di stato, non lo annuncia: 120–200 ms.
   · Ogni elemento interattivo ha uno stato di focus visibile da tastiera.
   ========================================================================== */

:root {
  /* superfici */
  --ground:      #F2F4F3;
  --surface:     #FFFFFF;
  --surface-2:   #F7F9F8;
  --surface-alt: #E9EDEB;
  --code-bg:     #EFF2F1;

  /* inchiostri */
  --ink:         #101615;
  --ink-soft:    #2E3B38;
  --muted:       #67746F;
  --faint:       #93A09B;

  /* tratti */
  --line:        #DCE3E0;
  --line-soft:   #E9EEEC;
  --line-strong: #C4CFCA;

  /* semantica */
  --accent:      #0E6B59;
  --accent-ink:  #0A5546;
  --accent-soft: #DEEDE7;
  --ok:          #0E6B59;
  --ok-soft:     #DEEDE7;
  --warn:        #A4600F;
  --warn-soft:   #F7EAD6;
  --bad:         #A32F3C;
  --bad-soft:    #F7E2E4;
  --gold:        #8A6D08;
  --gold-soft:   #F6EFD3;
  --info:        #1B6E8C;
  --info-soft:   #DCEDF3;

  /* tipografia */
  --serif: Charter, "Bitstream Charter", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* scala di spaziatura */
  --s1: .25rem; --s2: .5rem;  --s3: .75rem; --s4: 1rem;
  --s5: 1.5rem; --s6: 2rem;   --s7: 3rem;   --s8: 4rem;

  /* forma e profondità */
  --r1: 6px; --r2: 10px; --r3: 14px; --r4: 20px;
  --shadow-1: 0 1px 2px rgba(16, 22, 21, .05);
  --shadow-2: 0 1px 2px rgba(16, 22, 21, .05), 0 4px 12px rgba(16, 22, 21, .05);
  --shadow-3: 0 2px 4px rgba(16, 22, 21, .06), 0 12px 32px rgba(16, 22, 21, .09);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);

  --ease: cubic-bezier(.2, .7, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { color-scheme: dark; }
}
:root[data-theme="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ground:      #0D1211;
    --surface:     #151B1A;
    --surface-2:   #1A2120;
    --surface-alt: #1F2726;
    --code-bg:     #1A2120;

    --ink:         #E9EEEC;
    --ink-soft:    #C2CCC9;
    --muted:       #8B9995;
    --faint:       #6A7873;

    --line:        #29332F;
    --line-soft:   #202826;
    --line-strong: #3A4642;

    --accent:      #4FB79C;
    --accent-ink:  #6ECFB4;
    --accent-soft: #16302A;
    --ok:          #4FB79C;
    --ok-soft:     #16302A;
    --warn:        #D9A05F;
    --warn-soft:   #33260F;
    --bad:         #DB8892;
    --bad-soft:    #331A1E;
    --gold:        #D7BC44;
    --gold-soft:   #322B0F;
    --info:        #6BB6D0;
    --info-soft:   #122B33;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .3);
    --shadow-3: 0 2px 4px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .45);
  }
}

:root[data-theme="dark"] {
  --ground:      #0D1211;
  --surface:     #151B1A;
  --surface-2:   #1A2120;
  --surface-alt: #1F2726;
  --code-bg:     #1A2120;
  --ink:         #E9EEEC;
  --ink-soft:    #C2CCC9;
  --muted:       #8B9995;
  --faint:       #6A7873;
  --line:        #29332F;
  --line-soft:   #202826;
  --line-strong: #3A4642;
  --accent:      #4FB79C;
  --accent-ink:  #6ECFB4;
  --accent-soft: #16302A;
  --ok:          #4FB79C;
  --ok-soft:     #16302A;
  --warn:        #D9A05F;
  --warn-soft:   #33260F;
  --bad:         #DB8892;
  --bad-soft:    #331A1E;
  --gold:        #D7BC44;
  --gold-soft:   #322B0F;
  --info:        #6BB6D0;
  --info-soft:   #122B33;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 12px rgba(0, 0, 0, .3);
  --shadow-3: 0 2px 4px rgba(0, 0, 0, .5), 0 12px 32px rgba(0, 0, 0, .45);
}

/* ------------------------------------------------------------------ reset */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-ink); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r1); }

code, pre, kbd { font-family: var(--mono); }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

/* ----------------------------------------------------------------- layout */

.shell { max-width: 76rem; margin: 0 auto; padding: 0 var(--s5) var(--s8); }
.narrow { max-width: 48rem; margin-inline: auto; }

header.top {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.top-inner {
  max-width: 76rem; margin: 0 auto; padding: var(--s3) var(--s5);
  display: flex; align-items: center; gap: var(--s5);
}
/* Il marchio Claude resta nel suo colore: è un riferimento al prodotto di cui
   il corso tratta, non un elemento del sistema di colori della piattaforma —
   che usa il verde per significare stato (superato, in corso, fallito). */
.brand {
  display: inline-flex; align-items: center; gap: var(--s2);
  font-family: var(--serif); font-size: 1.06rem; font-weight: 600;
  letter-spacing: -.015em; color: var(--ink); text-decoration: none; white-space: nowrap;
}
.brand:hover { color: var(--ink); }
.brand:hover .mark { transform: rotate(22deg); }
.brand .mark {
  width: 1.6rem; height: 1.6rem; display: block; flex: 0 0 auto;
  transition: transform .35s var(--ease);
}
.brand .brand-name em { font-style: normal; color: var(--muted); font-weight: 500; }

@media (max-width: 34rem) {
  .brand .brand-name em { display: none; }
}

nav.main { display: flex; gap: 2px; margin-left: auto; }
nav.main a {
  position: relative; padding: var(--s2) var(--s3); border-radius: var(--r1);
  font-size: .88rem; font-weight: 500; color: var(--muted); text-decoration: none;
  transition: color .15s var(--ease), background .15s var(--ease);
  white-space: nowrap;
}
nav.main a:hover { background: var(--surface-alt); color: var(--ink); }
nav.main a.on { color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.userchip {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: var(--s1) var(--s1) var(--s1) var(--s3);
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); font-size: .84rem; box-shadow: var(--shadow-1);
}
.userchip .score {
  font-family: var(--mono); font-weight: 600; color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.userchip .who { color: var(--muted); max-width: 8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userchip button {
  border: 0; background: var(--surface-alt); color: var(--muted);
  border-radius: 999px; padding: var(--s1) var(--s2); font-size: .76rem; cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.userchip button:hover { background: var(--line); color: var(--ink); }

@media (max-width: 46rem) {
  .top-inner { flex-wrap: wrap; gap: var(--s3); }
  nav.main { order: 3; width: 100%; margin-left: 0; overflow-x: auto; }
  .userchip .who { display: none; }
}

/* ------------------------------------------------------------ tipografia */

h1, h2, h3, h4 { font-family: var(--serif); letter-spacing: -.018em; line-height: 1.22; font-weight: 600; }
h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.1rem); margin: var(--s6) 0 var(--s2); }
h2 { font-size: 1.3rem; margin: var(--s6) 0 var(--s3); }
h3 { font-size: 1.05rem; margin: var(--s5) 0 var(--s2); }

.lede { color: var(--muted); font-size: 1.02rem; margin: 0 0 var(--s5); max-width: 62ch; }
.eyebrow {
  font-family: var(--mono); font-size: .7rem; letter-spacing: .11em;
  text-transform: uppercase; color: var(--faint); margin: 0 0 var(--s1); font-weight: 500;
}
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.num-t { font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* -------------------------------------------------------------- componenti */

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r3); padding: var(--s4) var(--s5);
  box-shadow: var(--shadow-1);
}
.card.flush { padding: 0; overflow: hidden; }

.grid { display: grid; gap: var(--s3); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s4); }
.stack { display: grid; gap: var(--s3); }

button, .btn {
  font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer;
  padding: .55rem 1.05rem; border-radius: var(--r2);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  transition: transform .12s var(--ease), border-color .15s var(--ease),
              background .15s var(--ease), box-shadow .15s var(--ease);
  box-shadow: var(--shadow-1);
}
button:hover, .btn:hover { border-color: var(--line-strong); color: var(--ink); box-shadow: var(--shadow-2); }
button:active, .btn:active { transform: translateY(1px); box-shadow: var(--shadow-1); }
button:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; transform: none; }

.btn-primary, button.primary {
  background: linear-gradient(150deg, var(--accent), var(--accent-ink));
  border-color: transparent; color: #fff; font-weight: 600;
}
.btn-primary:hover, button.primary:hover { filter: brightness(1.07); color: #fff; }
button.ghost, .btn.ghost { background: transparent; border-color: transparent; color: var(--muted); box-shadow: none; }
button.ghost:hover, .btn.ghost:hover { background: var(--surface-alt); color: var(--ink); box-shadow: none; }
button.wide, .btn.wide { width: 100%; }
button.big, .btn.big { padding: .7rem 1.4rem; font-size: .95rem; }

.tag {
  display: inline-flex; align-items: center; gap: var(--s1);
  font-family: var(--mono); font-size: .68rem; letter-spacing: .05em; font-weight: 500;
  padding: .2rem .45rem; border-radius: var(--r1);
  background: var(--surface-alt); color: var(--muted); text-transform: uppercase;
  white-space: nowrap;
}
.tag.ok   { background: var(--ok-soft);   color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.bad  { background: var(--bad-soft);  color: var(--bad); }
.tag.gold { background: var(--gold-soft); color: var(--gold); }
.tag.info { background: var(--info-soft); color: var(--info); }
/* Un tag puo' essere un collegamento — il codice di una prova porta alla sua
   pagina: resta un tag, non diventa un link sottolineato. */
a.tag { text-decoration: none; }
a.tag:hover { filter: brightness(.95); }

/* Link a un modulo dal lato esame: un pulsantino con il codice.
   I moduli di supporto sono smorzati — coprono il dominio solo in parte, e
   mandare a ripassarli con la stessa enfasi del modulo principale fa perdere
   tempo a chi ha appena scoperto di essere sotto soglia. */
.mod-links { display: inline-flex; gap: .25rem; margin-left: .4rem; vertical-align: baseline; flex-wrap: wrap; }
.mod-link {
  display: inline-block; font-family: var(--mono); font-size: .68rem; font-weight: 600;
  padding: .05rem .32rem; border-radius: var(--r1); text-decoration: none;
  background: var(--info-soft); color: var(--info);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 30%, transparent);
  transition: background .12s var(--ease);
}
.mod-link:hover { background: color-mix(in srgb, var(--info) 22%, transparent); }
.mod-link.sup {
  background: transparent; color: var(--faint); font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--line);
}
.mod-link.sup:hover { color: var(--muted); background: var(--surface-alt); }

/* Etichetta di preparazione a una certificazione Anthropic: contorno, non
   riempimento, per non competere con i tag di stato del modulo. */
.tag.cert {
  background: transparent; color: var(--info);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--info) 45%, transparent);
}

.bar {
  height: 6px; border-radius: 999px; background: var(--surface-alt);
  overflow: hidden; box-shadow: inset 0 0 0 1px var(--line-soft);
}
.bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-ink));
  transition: width .5s var(--ease);
}

/* anello di progresso, usato sulle schede modulo */
.ring { --p: 0; width: 2.6rem; height: 2.6rem; position: relative; flex: 0 0 auto; }
.ring::before {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-alt) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 3px));
}
.ring > span {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--mono); font-size: .72rem; font-weight: 600; color: var(--ink);
}

input, textarea, select {
  font: inherit; width: 100%; padding: .6rem .75rem;
  border: 1px solid var(--line); border-radius: var(--r2);
  background: var(--surface); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { font-family: var(--mono); font-size: .82rem; line-height: 1.55; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
label { display: block; font-size: .82rem; color: var(--muted); margin: 0 0 var(--s1); font-weight: 500; }
.field { margin-bottom: var(--s3); }
.hint-text { font-size: .78rem; color: var(--faint); margin-top: var(--s1); }

.notice {
  padding: var(--s3) var(--s4); border-radius: var(--r2); font-size: .89rem;
  border: 1px solid var(--line); background: var(--surface-2);
}
.notice.error { border-color: color-mix(in srgb, var(--bad) 40%, var(--line)); background: var(--bad-soft); color: var(--bad); }
.notice.ok    { border-color: color-mix(in srgb, var(--ok) 40%, var(--line));  background: var(--ok-soft);  color: var(--accent-ink); }
.notice.warn  { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: var(--warn-soft); color: var(--warn); }

/* toast: sostituisce alert() — non blocca e non è modale */
#toasts {
  position: fixed; right: var(--s4); bottom: var(--s4); z-index: 200;
  display: grid; gap: var(--s2); max-width: min(26rem, calc(100vw - 2rem));
}
.toast {
  display: flex; gap: var(--s2); align-items: flex-start;
  padding: var(--s3) var(--s4); border-radius: var(--r2);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-3); font-size: .88rem;
  animation: toast-in .22s var(--ease);
}
.toast.error { border-left: 3px solid var(--bad); }
.toast.ok    { border-left: 3px solid var(--ok); }
.toast.info  { border-left: 3px solid var(--info); }
.toast .x { margin-left: auto; cursor: pointer; color: var(--faint); background: none; border: 0; box-shadow: none; padding: 0 var(--s1); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* stati di caricamento */
.spinner { display: grid; place-items: center; padding: var(--s8) var(--s4); color: var(--muted); gap: var(--s3); }
.spinner::before {
  content: ""; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--surface-alt) 25%, var(--line-soft) 37%, var(--surface-alt) 63%);
  background-size: 400% 100%; animation: shimmer 1.3s ease-in-out infinite;
  border-radius: var(--r1);
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.empty { text-align: center; padding: var(--s7) var(--s4); color: var(--muted); }
.empty .ic { font-size: 2rem; display: block; margin-bottom: var(--s2); opacity: .55; }

.view-in { animation: view-in .22s var(--ease); }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------------- auth */

.auth-wrap { max-width: 25rem; margin: clamp(2rem, 8vh, 5rem) auto; }
.auth-wrap .card { padding: var(--s6); box-shadow: var(--shadow-3); }
.auth-logo {
  width: 3.4rem; height: 3.4rem; display: block; margin: 0 auto var(--s4);
  animation: logo-in .5s var(--ease);
}
@keyframes logo-in {
  from { opacity: 0; transform: rotate(-30deg) scale(.85); }
  to { opacity: 1; transform: none; }
}
.tabs {
  display: flex; gap: 2px; margin-bottom: var(--s5);
  background: var(--surface-alt); padding: 3px; border-radius: var(--r2);
}
.tabs button {
  flex: 1; border: 0; background: transparent; box-shadow: none;
  border-radius: calc(var(--r2) - 3px); padding: .45rem; font-size: .88rem; color: var(--muted);
}
.tabs button:hover { box-shadow: none; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.tabs button.on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); }

/* --------------------------------------------------------------- percorso */

.hero {
  display: grid; grid-template-columns: 1fr auto; gap: var(--s5); align-items: center;
  padding: var(--s5); margin: var(--s5) 0 var(--s6);
  border-radius: var(--r4); border: 1px solid var(--line);
  background:
    radial-gradient(120% 140% at 100% 0%, var(--accent-soft) 0%, transparent 55%),
    var(--surface);
  box-shadow: var(--shadow-2);
}
.hero h1 { margin: var(--s1) 0 var(--s3); }
.hero .score-big {
  font-family: var(--mono); font-size: clamp(2rem, 1.4rem + 2.4vw, 2.8rem);
  font-weight: 700; line-height: 1; color: var(--accent);
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
@media (max-width: 40rem) {
  .hero { grid-template-columns: 1fr; }
  .hero .side { text-align: left; }
}

/* Le prove di un percorso, in testa alla pagina dei moduli: se un percorso si
   chiude con un esame, deve vedersi prima di cominciare. */
.prove-percorso {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem;
  margin: 0 0 var(--s3); font-size: .82rem; color: var(--muted);
}
.prove-percorso .tag.prova { text-decoration: none; }
.prove-percorso .tag.prova:hover { filter: brightness(.95); }

/* Notifica in barra: quante revisioni aspettano il docente. */
.pallino {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.15rem; height: 1.15rem; padding: 0 .3rem; margin-left: .3rem;
  border-radius: 999px; background: var(--warn); color: #fff;
  font-family: var(--mono); font-size: .68rem; font-weight: 700; line-height: 1;
  vertical-align: middle;
}

/* --- l'ingresso e il catalogo ----------------------------------------------
   Tre livelli — profilo, percorso, moduli — e a ogni livello si deve capire
   dove si è e come si torna indietro. Le carte sono grandi perché la scelta è
   grande: entra chi non conosce ancora il catalogo, e deve poter decidere
   leggendo, non provando. */

.lead {
  margin: var(--s3) 0 0;
  max-width: 62ch;
  font-family: var(--serif);
  font-size: 1.05rem; line-height: 1.6;
  color: var(--ink-soft);
}
.sep { color: var(--faint); padding: 0 .15rem; }

/* Bottone che si comporta da collegamento: le vie di fuga non sono azioni
   principali, e non devono avere il peso visivo di un bottone. */
button.link {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; font-size: .9rem;
  color: var(--accent-ink); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--accent) 40%, transparent);
}
button.link:hover { text-decoration-color: currentColor; }
button.link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--r1); }

.fuga { display: flex; flex-wrap: wrap; gap: var(--s5); margin: var(--s6) 0 0; }
.fuga-fondo {
  margin-top: calc(var(--s8) * 1.2);
  padding-top: var(--s5);
  border-top: 1px solid var(--line);
}

/* --- briciole --------------------------------------------------------------- */
.briciole {
  display: flex; align-items: center; flex-wrap: wrap; gap: .35rem;
  margin: 0 0 var(--s5);
  font-size: .82rem;
}
.briciole .sep { color: var(--faint); }
.briciola {
  background: none; border: 0; padding: .1rem .15rem; cursor: pointer;
  font: inherit; font-size: inherit; color: var(--muted);
  border-radius: var(--r1);
}
a.briciola { text-decoration: none; }
.briciola:hover { color: var(--ink); }
.briciola:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.briciola.qui { color: var(--ink); font-weight: 600; cursor: default; }

/* --- livello 1: chi sei ------------------------------------------------------ */
.ingresso { margin-top: var(--s6); }
.ingresso h1 {
  margin: var(--s1) 0 0;
  font-size: 2.1rem; line-height: 1.1; letter-spacing: -.025em;
}

.profili {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(21rem, 1fr));
  margin-top: var(--s6);
}

.profilo-card {
  position: relative; display: flex; flex-direction: column;
  align-items: stretch; justify-content: flex-start;
  width: 100%; text-align: left; cursor: pointer; font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: var(--r4);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent) 7%, transparent), transparent 60%),
    var(--surface);
  padding: var(--s6) var(--s5) var(--s5);
  box-shadow: var(--shadow-1);
  transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease);
}
.profilo-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  box-shadow: var(--shadow-3);
}
.profilo-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.profilo-card .glifo {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.9rem; height: 2.9rem; flex: 0 0 auto; align-self: flex-start;
  border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink);
  font-family: var(--mono); font-size: 1.15rem; line-height: 1; letter-spacing: -.02em;
  margin-bottom: var(--s4);
}
.profilo-card h2 {
  margin: 0 0 var(--s2);
  font-size: 1.45rem; line-height: 1.15; letter-spacing: -.02em;
}
.profilo-card > .muted { margin: 0; font-size: .92rem; line-height: 1.55; max-width: 44ch; }

.elenco-percorsi {
  list-style: none; margin: var(--s5) 0 var(--s5); padding: 0;
  display: flex; flex-direction: column; gap: .3rem;
  font-size: .88rem;
}
.elenco-percorsi li {
  display: flex; align-items: center; gap: var(--s2);
  padding-left: 1.1rem; position: relative; color: var(--ink-soft);
}
.elenco-percorsi li::before {
  content: "›"; position: absolute; left: 0; color: var(--accent); font-weight: 700;
}
.elenco-percorsi li.atteso { color: var(--faint); }
.elenco-percorsi li.atteso::before { color: var(--faint); }
.elenco-percorsi li .tag { font-size: .62rem; padding: .05rem .35rem; }

/* --- livello 2: i percorsi --------------------------------------------------- */
.catalogo-head h1 {
  margin: var(--s1) 0 0;
  font-size: 1.9rem; line-height: 1.12; letter-spacing: -.025em;
}

.percorsi {
  display: grid; gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  margin-top: var(--s6);
}

.percorso-card {
  position: relative; display: flex; flex-direction: column;
  align-items: stretch; justify-content: flex-start;
  width: 100%; text-align: left; font: inherit; color: inherit;
  border: 1px solid var(--line); border-radius: var(--r3);
  background: var(--surface);
  padding: var(--s5) var(--s5) var(--s4) calc(var(--s5) + 4px);
  overflow: hidden;
  box-shadow: var(--shadow-1);
}
button.percorso-card { cursor: pointer; }
button.percorso-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-3);
}
button.percorso-card { transition: transform .16s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease); }
button.percorso-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* La spina colorata riprende il colore della prima sezione del percorso:
   la stessa tinta che si ritrova poi accanto ai titoli di sezione. */
.percorso-card .spina {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--spina, var(--accent));
}

.pc-testa { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: var(--s3); }
.tag.ramo { background: var(--surface-alt); color: var(--muted); }
.tag.prova { background: var(--accent-soft); color: var(--accent-ink); font-family: var(--mono); }

.percorso-card h3 {
  margin: 0 0 var(--s2);
  font-family: var(--serif);
  font-size: 1.28rem; line-height: 1.2; letter-spacing: -.015em;
}
.pc-sommario { margin: 0; font-size: .9rem; line-height: 1.55; color: var(--ink-soft); }
.pc-nota {
  margin: var(--s3) 0 0; padding-left: var(--s3);
  border-left: 2px solid var(--line);
  font-size: .82rem; line-height: 1.5; color: var(--muted);
}
.pc-meta { display: block; margin: var(--s4) 0 var(--s2); font-size: .84rem; color: var(--muted); }
.pc-meta b { color: var(--ink); font-weight: 600; }
.pc-prova { display: flex; align-items: center; flex-wrap: wrap; gap: .3rem; font-size: .8rem; color: var(--muted); }

.pc-piede {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  margin-top: auto; padding-top: var(--s4);
}
.profilo-card .pc-piede { border-top: 1px solid var(--line-soft); }
.pc-avanz { display: flex; align-items: center; gap: var(--s2); }
.pc-vai {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .85rem; font-weight: 600; color: var(--accent-ink); white-space: nowrap;
}
.pc-vai em { font-style: normal; transition: transform .16s var(--ease); }
button.percorso-card:hover .pc-vai em,
.profilo-card:hover .pc-vai em { transform: translateX(3px); }

/* Un percorso annunciato non deve somigliare a uno aperto: bordo tratteggiato,
   niente ombra, niente invito ad agire. */
.percorso-card.previsto {
  border-style: dashed; box-shadow: none;
  background: transparent; color: var(--muted);
}
.percorso-card.previsto h3 { color: var(--muted); }
.percorso-card.previsto .pc-sommario { color: var(--faint); }

@media (max-width: 40rem) {
  .ingresso h1 { font-size: 1.65rem; }
  .catalogo-head h1 { font-size: 1.5rem; }
  .profilo-card { padding: var(--s5) var(--s4) var(--s4); }
}

/* --- parte: il livello sopra le sezioni ------------------------------------
   Due percorsi con obiettivi diversi — il corso e la certificazione — e il
   titolo deve dirlo prima che si guardi quale sezione si sta leggendo. */
.parte { margin-top: var(--s8); }
/* Con un percorso solo, il titolo lo porta gia' l'intestazione: la parte resta
   senza testata e le sezioni cominciano subito. */
.parte.nuda { margin-top: var(--s5); }
.parte + .parte { margin-top: calc(var(--s8) * 1.6); }

.parte-head {
  position: relative;
  padding: var(--s5) var(--s5) var(--s4);
  margin-bottom: var(--s2);
  border-top: 2px solid var(--ink);
  background: linear-gradient(180deg, var(--surface-alt), transparent);
  border-radius: 0 0 var(--r3) var(--r3);
}
.parte-head h2 {
  margin: .1rem 0 .35rem;
  font-size: 1.65rem; line-height: 1.15; letter-spacing: -.02em;
}
.parte-head .eyebrow { margin: 0; }
.parte-head .muted { margin: 0; max-width: 62ch; }
.parte-tot {
  position: absolute; top: var(--s5); right: var(--s5);
  font-family: var(--mono); font-size: .78rem; color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .parte-head h2 { font-size: 1.3rem; }
  .parte-tot { position: static; display: block; margin-top: var(--s3); }
}

/* --- sezione collassabile -------------------------------------------------- */
details.sezione > summary {
  cursor: pointer; list-style: none;
  border-radius: var(--r2);
  transition: background .12s var(--ease);
}
details.sezione > summary::-webkit-details-marker { display: none; }
details.sezione > summary:hover { background: var(--surface-alt); }
details.sezione > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.track-head {
  display: flex; align-items: center; gap: var(--s2);
  margin: var(--s6) 0 var(--s3);
  padding: var(--s2) var(--s2) var(--s2) 0;
}
.track-head h2 { margin: 0; font-size: 1rem; letter-spacing: -.01em; }
.track-head .dot { width: .55rem; height: .55rem; border-radius: 50%; flex: 0 0 auto; }
.track-head .line { flex: 1; height: 1px; background: var(--line); }
.track-head .count { font-family: var(--mono); font-size: .76rem; color: var(--faint); }

/* Il chevron ruota all'apertura: è l'unico segnale che la sezione è cliccabile. */
.track-head .chev {
  display: inline-block; width: 1rem; text-align: center;
  color: var(--faint); font-size: 1.1rem; line-height: 1;
  transition: transform .15s var(--ease);
}
details.sezione[open] > summary .chev { transform: rotate(90deg); }

/* I totali restano leggibili anche a sezione chiusa: chiudere non deve
   nascondere a che punto sei. */
.track-head .tot { display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; }
.track-head .tot .count { white-space: nowrap; }
.bar.mini { width: 4rem; height: 5px; flex: 0 0 auto; }

@media (max-width: 640px) {
  .track-head .tot .muted { display: none; }
  .bar.mini { display: none; }
}

.mod {
  display: grid; grid-template-columns: auto 1fr auto; gap: var(--s4);
  align-items: center; padding: var(--s4);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r3); text-decoration: none; color: inherit;
  box-shadow: var(--shadow-1);
  transition: transform .15s var(--ease), box-shadow .15s var(--ease), border-color .15s var(--ease);
  position: relative; overflow: hidden;
}
.mod::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: transparent; transition: background .15s var(--ease);
}
.mod:not(.locked):hover {
  transform: translateY(-2px); box-shadow: var(--shadow-2);
  border-color: var(--line-strong); color: inherit;
}
.mod.passed::before { background: var(--ok); }
.mod.in_progress::before { background: var(--warn); }
.mod.failed::before { background: var(--bad); }
.mod.locked { opacity: .55; cursor: default; }
.mod .num {
  font-family: var(--mono); font-size: .95rem; font-weight: 600;
  color: var(--faint); min-width: 2.2rem;
}
.mod.passed .num { color: var(--accent); }
.mod h3 { margin: 0 0 var(--s1); font-size: 1.02rem; }
.mod p { margin: 0 0 var(--s2); font-size: .87rem; color: var(--muted); line-height: 1.5; }
.mod .meta { display: flex; gap: var(--s1); flex-wrap: wrap; align-items: center; }
.mod .side { display: grid; gap: var(--s1); justify-items: end; text-align: right; min-width: 4.5rem; }
.mod .pct { font-family: var(--mono); font-size: 1.05rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.mod.passed .pct { color: var(--accent); }
.mod .lock { font-size: 1rem; opacity: .5; }

@media (max-width: 40rem) {
  .mod { grid-template-columns: auto 1fr; }
  .mod .side { grid-column: 2; justify-items: start; text-align: left; }
}

/* ----------------------------------------------------------------- lezione */

.reader { display: grid; grid-template-columns: 15rem 1fr; gap: var(--s7); align-items: start; }
@media (max-width: 62rem) { .reader { grid-template-columns: 1fr; gap: var(--s5); } }

.toc { position: sticky; top: 4.6rem; font-size: .86rem; }
.toc-list { display: grid; gap: 1px; }
.toc a {
  display: block; padding: var(--s2) var(--s3); border-radius: var(--r1);
  color: var(--muted); text-decoration: none; border-left: 2px solid transparent;
  transition: background .14s var(--ease), color .14s var(--ease);
  line-height: 1.35;
}
.toc a:hover { background: var(--surface-alt); color: var(--ink); }
.toc a.on { border-left-color: var(--accent); color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.toc a .k {
  display: block; font-family: var(--mono); font-size: .64rem;
  letter-spacing: .08em; text-transform: uppercase; opacity: .65; margin-bottom: 1px;
}
.toc a .done { color: var(--accent); }

/* prosa: classi prodotte dal renderer Markdown del corso */
.prose { font-family: var(--serif); font-size: 1.075rem; line-height: 1.75; max-width: 42rem; color: var(--ink-soft); }
.prose > :first-child { margin-top: 0; }
.prose .h1 { font-size: 1.5rem; margin: var(--s6) 0 var(--s3); color: var(--ink); }
.prose .h2 { font-size: 1.24rem; margin: var(--s6) 0 var(--s2); color: var(--ink); }
.prose .h3 { font-size: 1.06rem; margin: var(--s5) 0 var(--s2); color: var(--ink); }
.prose .h4 { font-size: .98rem; margin: var(--s4) 0 var(--s1); color: var(--ink); }
.prose p { margin: 0 0 var(--s4); }
.prose ul, .prose ol { margin: 0 0 var(--s4); padding-left: 1.35rem; }
.prose li { margin: var(--s1) 0; }
.prose li::marker { color: var(--faint); }
.prose li.task { list-style: none; margin-left: -1.2rem; display: flex; gap: var(--s2); align-items: baseline; }
.prose li.task .box {
  width: .85rem; height: .85rem; border: 1.5px solid var(--line-strong);
  border-radius: 4px; flex: 0 0 auto; display: inline-block; translate: 0 .1rem;
}
.prose li.task .box.done { background: var(--accent); border-color: var(--accent); }
.prose code {
  font-size: .84em; background: var(--code-bg); padding: .1em .34em;
  border-radius: 5px; border: 1px solid var(--line-soft); color: var(--ink);
}
.prose figure.code {
  margin: var(--s4) 0; background: var(--code-bg); border: 1px solid var(--line);
  border-radius: var(--r2); overflow: hidden; position: relative;
}
.prose figure.code[data-lang]::before {
  content: attr(data-lang); position: absolute; top: 0; right: 0;
  font-family: var(--mono); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); padding: .2rem .5rem; background: var(--surface-alt);
  border-bottom-left-radius: var(--r1);
  border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.prose pre { margin: 0; padding: var(--s4); overflow-x: auto; }
.prose pre code {
  background: none; border: 0; padding: 0; font-size: .81rem; line-height: 1.6;
  font-family: var(--mono); white-space: pre; color: var(--ink-soft);
}
.prose blockquote {
  margin: var(--s4) 0; padding: var(--s1) var(--s4);
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 var(--r2) var(--r2) 0; color: var(--ink-soft);
}
.prose blockquote p { margin: var(--s3) 0; }
.prose table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: .87rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: .45rem .6rem; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-alt); font-weight: 600; color: var(--ink); }
.prose .scroll { overflow-x: auto; margin: var(--s4) 0; border-radius: var(--r2); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: var(--s6) 0; }

.lesson-nav {
  display: flex; justify-content: space-between; gap: var(--s3);
  margin-top: var(--s7); padding-top: var(--s4); border-top: 1px solid var(--line);
}
.lesson-nav .btn { max-width: 48%; }
.lesson-nav .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* -------------------------------------------------------------------- quiz */

.quiz-wrap { max-width: 44rem; margin: 0 auto; }
.quiz-head {
  position: sticky; top: 3.5rem; z-index: 30;
  background: color-mix(in srgb, var(--ground) 92%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: var(--s3) 0; margin-bottom: var(--s5);
  border-bottom: 1px solid var(--line-soft);
}
.pips { display: flex; gap: 3px; flex-wrap: wrap; }
.pips i {
  flex: 1; min-width: .7rem; max-width: 2rem; height: 4px; border-radius: 999px;
  background: var(--line); display: block; transition: background .2s var(--ease);
}
.pips i.done { background: var(--accent); }
.pips i.on { background: var(--ink); }

.question .prompt {
  font-family: var(--serif); font-size: 1.2rem; line-height: 1.5;
  margin-bottom: var(--s4); color: var(--ink);
}
.question .prompt p { margin: 0 0 var(--s2); }
.question .prompt p:last-child { margin-bottom: 0; }

.opt {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4); margin-bottom: var(--s2);
  border: 1px solid var(--line); border-radius: var(--r2);
  background: var(--surface); cursor: pointer;
  transition: border-color .13s var(--ease), background .13s var(--ease), transform .13s var(--ease);
  box-shadow: var(--shadow-1);
}
.opt:hover { border-color: var(--accent); transform: translateX(2px); }
.opt.sel { border-color: var(--accent); background: var(--accent-soft); }
.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.static { cursor: default; box-shadow: none; }
.opt.static:hover { transform: none; border-color: var(--line); }
.opt.static.correct:hover { border-color: var(--ok); }
.opt.static.wrong:hover { border-color: var(--bad); }
.opt .mark {
  flex: 0 0 auto; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  border: 1.5px solid var(--line-strong); display: grid; place-items: center;
  font-size: .68rem; font-family: var(--mono); color: transparent;
  transition: background .13s var(--ease), border-color .13s var(--ease);
}
.opt.multi .mark { border-radius: 5px; }
.opt.sel .mark { background: var(--accent); border-color: var(--accent); color: #fff; }
.opt.correct .mark { background: var(--ok); border-color: var(--ok); color: #fff; }
.opt.wrong .mark { background: var(--bad); border-color: var(--bad); color: #fff; }
.opt .body { flex: 1; min-width: 0; }
.opt .body p { margin: 0; }
.opt .fb {
  font-size: .84rem; color: var(--muted); margin-top: var(--s2);
  padding-top: var(--s2); border-top: 1px dashed var(--line);
}

.timer {
  font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--accent);
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.timer.low { color: var(--bad); animation: pulse .9s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* ------------------------------------------------------------- validatore */

.checks { display: grid; gap: var(--s2); margin-top: var(--s4); }
.check {
  display: grid; grid-template-columns: 1.3rem 1fr auto; gap: var(--s3);
  align-items: start; padding: var(--s3); border-radius: var(--r2);
  background: var(--surface); border: 1px solid var(--line); font-size: .89rem;
}
.check.pass { border-color: color-mix(in srgb, var(--ok) 35%, var(--line)); background: color-mix(in srgb, var(--ok-soft) 45%, var(--surface)); }
.check.fail { border-color: color-mix(in srgb, var(--bad) 30%, var(--line)); }
.check .icon { font-weight: 700; font-size: .95rem; }
.check.pass .icon { color: var(--ok); }
.check.fail .icon { color: var(--bad); }
.check .hint { font-size: .84rem; color: var(--muted); margin-top: var(--s1); line-height: 1.5; }
.check .pts { font-family: var(--mono); font-size: .76rem; color: var(--faint); white-space: nowrap; }

/* --------------------------------------------------------------- risultato */

.result-hero {
  text-align: center; padding: var(--s7) var(--s4) var(--s5);
  border-radius: var(--r4); border: 1px solid var(--line); margin-bottom: var(--s5);
  background: radial-gradient(90% 120% at 50% 0%, var(--ok-soft) 0%, transparent 60%), var(--surface);
}
.result-hero.fail { background: radial-gradient(90% 120% at 50% 0%, var(--bad-soft) 0%, transparent 60%), var(--surface); }
.result-hero .big {
  font-family: var(--mono); font-size: clamp(2.6rem, 2rem + 3vw, 3.6rem); font-weight: 700;
  line-height: 1; color: var(--accent); letter-spacing: -.04em;
  font-variant-numeric: tabular-nums;
}
.result-hero.fail .big { color: var(--bad); }

.badge-pop {
  display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line)); border-radius: var(--r2);
  background: var(--gold-soft); margin-bottom: var(--s2);
  animation: badge-in .35s var(--ease);
}
@keyframes badge-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
.badge-pop .ic { font-size: 1.7rem; }

.review-card {
  margin-bottom: var(--s3); border-left: 3px solid var(--line);
  transition: border-color .15s var(--ease);
}
.review-card.ok { border-left-color: var(--ok); }
.review-card.ko { border-left-color: var(--bad); }

/* ------------------------------------------------------------------ video */

.video-stage {
  position: relative; aspect-ratio: 16 / 9; width: 100%;
  border-radius: var(--r3); overflow: hidden;
  border: 1px solid var(--line); box-shadow: var(--shadow-2);
  background: var(--surface);
}
.slide {
  position: absolute; inset: 0; padding: clamp(1.2rem, 3.5vw, 2.6rem);
  display: flex; flex-direction: column; justify-content: center;
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-2) 100%);
  opacity: 0; transition: opacity .35s var(--ease);
  container-type: inline-size;
}
.slide.on { opacity: 1; }
.slide .s-eyebrow {
  font-family: var(--mono); font-size: clamp(.6rem, 1.3cqw, .72rem); letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .6em; font-weight: 600;
}
.slide h2 {
  font-family: var(--serif); font-size: clamp(1.1rem, 3.6cqw, 2rem); line-height: 1.18;
  margin: 0 0 .5em; color: var(--ink); letter-spacing: -.02em;
}
.slide ul { margin: 0; padding-left: 1.1em; display: grid; gap: .45em; }
.slide li {
  font-size: clamp(.78rem, 2cqw, 1.02rem); line-height: 1.45; color: var(--ink-soft);
  opacity: 0; transform: translateY(6px);
  animation: bullet-in .4s var(--ease) forwards;
}
.slide.on li:nth-child(1) { animation-delay: .1s; }
.slide.on li:nth-child(2) { animation-delay: .25s; }
.slide.on li:nth-child(3) { animation-delay: .4s; }
.slide.on li:nth-child(4) { animation-delay: .55s; }
.slide.on li:nth-child(5) { animation-delay: .7s; }
.slide.on li:nth-child(6) { animation-delay: .85s; }
@keyframes bullet-in { to { opacity: 1; transform: none; } }
.slide .s-quote {
  font-family: var(--serif); font-size: clamp(.95rem, 2.6cqw, 1.4rem); line-height: 1.4;
  font-style: italic; color: var(--ink); border-left: 3px solid var(--accent);
  padding-left: .8em;
}
.slide .s-code {
  font-family: var(--mono); font-size: clamp(.6rem, 1.5cqw, .8rem); line-height: 1.55;
  background: var(--code-bg); border: 1px solid var(--line); border-radius: var(--r2);
  padding: .9em 1em; overflow: hidden; white-space: pre; color: var(--ink-soft);
  max-height: 72%;
}
.slide .s-foot {
  position: absolute; left: clamp(1.2rem, 3.5vw, 2.6rem); right: clamp(1.2rem, 3.5vw, 2.6rem);
  bottom: clamp(.7rem, 2vw, 1.2rem);
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono); font-size: clamp(.55rem, 1.1cqw, .68rem); color: var(--faint);
  border-top: 1px solid var(--line-soft); padding-top: .6em;
}
.slide.cover {
  justify-content: center; align-items: flex-start;
  background: linear-gradient(150deg, var(--accent-soft), var(--surface) 70%);
}
.slide.cover h2 { font-size: clamp(1.3rem, 4.6cqw, 2.6rem); }
.slide .s-logo { width: clamp(1.6rem, 4.5cqw, 2.6rem); height: auto; margin-bottom: .7em; display: block; }

.video-bar {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); border: 1px solid var(--line); border-top: 0;
  border-radius: 0 0 var(--r3) var(--r3); background: var(--surface);
  margin-top: -1px;
}
.video-bar .track {
  flex: 1; height: 5px; border-radius: 999px; background: var(--surface-alt);
  cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px var(--line-soft);
}
.video-bar .track > i {
  position: absolute; inset: 0 auto 0 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-ink));
  transition: width .25s linear;
}
.video-bar .track .ticks { position: absolute; inset: 0; display: flex; }
.video-bar .track .ticks span { flex: 1; border-right: 1px solid var(--ground); }
.video-bar .track .ticks span:last-child { border-right: 0; }
.video-bar .time { font-family: var(--mono); font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.video-bar button { padding: .4rem .7rem; }
.video-bar .play { width: 2.4rem; height: 2.4rem; border-radius: 50%; padding: 0; font-size: .9rem; }

.narration {
  margin-top: var(--s3); padding: var(--s3) var(--s4);
  border-radius: var(--r2); background: var(--surface-2); border: 1px solid var(--line-soft);
  font-family: var(--serif); font-size: .96rem; line-height: 1.6; color: var(--ink-soft);
}
.narration .lbl {
  font-family: var(--mono); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--faint); display: block; margin-bottom: var(--s1);
}

/* ---------------------------------------------------------------- tabelle */

table.data { border-collapse: collapse; width: 100%; font-size: .87rem; }
table.data th, table.data td { border-bottom: 1px solid var(--line-soft); padding: .55rem .6rem; text-align: left; }
table.data thead th {
  font-size: .7rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--faint); font-weight: 600; white-space: nowrap;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface);
}
table.data tbody tr { transition: background .12s var(--ease); }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data td.num { font-family: var(--mono); text-align: right; font-variant-numeric: tabular-nums; }
.scrollx { overflow-x: auto; border-radius: var(--r2); }

.cellstate {
  display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem;
  border-radius: var(--r1); font-size: .7rem; font-family: var(--mono); font-weight: 600;
}
.cellstate.passed { background: var(--ok); color: #fff; }
.cellstate.failed { background: var(--bad-soft); color: var(--bad); }
.cellstate.in_progress { background: var(--warn-soft); color: var(--warn); }
.cellstate.available { background: var(--surface-alt); color: var(--muted); }
.cellstate.locked { background: transparent; color: var(--line); }

.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: var(--s3); }
.badge-card {
  padding: var(--s4) var(--s3); border: 1px solid var(--line); border-radius: var(--r3);
  background: var(--surface); text-align: center; box-shadow: var(--shadow-1);
  transition: transform .15s var(--ease);
}
.badge-card:not(.off):hover { transform: translateY(-2px); }
.badge-card.off { opacity: .35; box-shadow: none; }
.badge-card .ic { font-size: 1.8rem; display: block; margin-bottom: var(--s1); }
.badge-card .t { font-weight: 600; font-size: .89rem; }
.badge-card .d { font-size: .77rem; color: var(--muted); margin-top: var(--s1); line-height: 1.4; }

.rank { font-family: var(--mono); font-weight: 600; color: var(--faint); }
.rank.top { color: var(--gold); }
tr.me td { background: var(--accent-soft) !important; font-weight: 600; }

.stat {
  padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r3);
  background: var(--surface); box-shadow: var(--shadow-1);
}
.stat .v {
  font-family: var(--mono); font-size: 1.75rem; font-weight: 700; line-height: 1.1;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
.stat .v small { font-size: .9rem; color: var(--faint); font-weight: 500; }


/* --- docenza · revisioni ----------------------------------------------------
   Un corso su strumenti e normativa invecchia in silenzio. Questa vista esiste
   perche il silenzio diventi un numero: cosa e cambiato, da quanto, e cosa ha
   deciso il docente. */
.riepilogo-revisioni { margin-bottom: var(--s6); }
.riepilogo-revisioni h2 { font-size: 1.35rem; letter-spacing: -.02em; }

.sezione-revisioni {
  margin: var(--s7) 0 var(--s4);
  font-size: .78rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}

.card.revisione { padding: var(--s5); }
.card.revisione.attenzione { border-left: 3px solid var(--warn); }
.card.revisione h3 { font-size: 1.02rem; line-height: 1.3; }
.card.revisione h3 .mono { color: var(--muted); margin-right: .3rem; }

.blocco-fonti { margin: var(--s3) 0; padding-left: var(--s3); border-left: 2px solid var(--line); }
.blocco-fonti.novita { border-left-color: var(--bad); }
.titolino {
  margin: 0 0 var(--s2);
  font-size: .74rem; letter-spacing: .05em; text-transform: uppercase; color: var(--muted);
}
ul.fonti { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
ul.fonti li { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; font-size: .85rem; }
ul.fonti .fonte-nome { font-weight: 600; }
ul.fonti .mono { font-family: var(--mono); font-size: .74rem; color: var(--muted); }
ul.fonti .trovato { color: var(--bad); }

.decisione {
  margin: var(--s3) 0 0; padding: var(--s2) var(--s3);
  background: var(--surface-alt); border-radius: var(--r1);
}

.azioni-revisione {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2);
  margin-top: var(--s4); padding-top: var(--s3); border-top: 1px solid var(--line-soft);
}
/* Gli input della pagina sono a larghezza piena: qui devono stare in riga con
   i bottoni, altrimenti la scheda diventa alta il doppio per tre controlli. */
.azioni-revisione .nota { flex: 1 1 14rem; min-width: 10rem; width: auto; }
.azioni-revisione .rinvio { flex: 0 0 10.5rem; width: 10.5rem; }
.azioni-revisione button { font-size: .82rem; padding: .4rem .8rem; }

@media (max-width: 40rem) {
  .azioni-revisione { flex-direction: column; align-items: stretch; }
}
