/* ==========================================================================
   Not Easy English — Materiali pubblici (foglio condiviso)
   --------------------------------------------------------------------------
   Serve l'indice (/materiali/inglese/index.html) e le schede dei materiali.
   Va linkato SEMPRE dopo styles/tokens.css.

   DUE GRUPPI DI REGOLE, e la separazione è un vincolo, non una convenzione:

   1) CHROME PUBBLICO (header, footer, wrap, testata) — SOLO token, nessun
      colore hardcodato. È in-brand "Bold contemporaneo": Space Grotesk + Inter.

   2) AREA CONTENUTI, tutta sotto il selettore .bitesize — font Fredoka e
      pastelli hardcodati. È l'ECCEZIONE ACCETTATA E CONFINATA decisa da Andrea
      il 22 ago 2026 (vedi CLAUDE.md): NON è debito e non va "corretta".
      I colori letterali stanno TUTTI e SOLO qui dentro.

   NON modificare styles/tokens.css né styles/app-shell.css.
   app-shell.css non è collegato ad alcuna pagina pubblica, per decisione
   architetturale su SEO e velocità: non collegarlo nemmeno qui.
   ========================================================================== */

/* === SELF-HOSTED FONTS — inizio === */
/* Fredoka, servita dal nostro dominio: il browser non contatta Google Fonts.
   STA QUI E NON IN tokens.css DI PROPOSITO: è parte dell'eccezione Bitesize e
   deve restare confinata al foglio delle sole 8 pagine dei materiali, che sono
   le uniche a usarla. Un solo file (font VARIABILE, asse wght 400-600), stessa
   unicode-range di Google. Percorso ASSOLUTO: le pagine stanno due livelli
   sotto la radice. Licenza e provenienza in assets/fonts/LICENSE.txt. */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/assets/fonts/fredoka.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* === fine === */

[hidden] { display: none !important; }

/* ==========================================================================
   1 · CHROME PUBBLICO — solo token
   ========================================================================== */

html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--font-ui);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* Mobile-first: colonna piena, cap ~460px; più larga su desktop per la lettura. */
.wrap {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.wordmark { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; }
.wordmark .en { color: var(--primary); }

/* ---------- Header pubblico (come index.html di radice) ---------- */
.pub-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255,255,255,0.88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: max(16px, env(safe-area-inset-top)) 18px 14px;
  display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; text-decoration: none; color: var(--ink); }
.auth { display: flex; align-items: center; gap: 8px; }
.link-action { background: none; border: none; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); padding: 8px 6px; text-decoration: none; }
.btn--sm { padding: 9px 15px; font-size: 14px; }
.hi-area { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); }
.hi-name { font-size: 13.5px; font-weight: 600; }
.avatar { border-radius: 999px; display: flex; align-items: center; justify-content: center; background: var(--ink); color: #fff; font-family: var(--font-display); font-weight: 500; overflow: hidden; flex-shrink: 0; }

.content { flex: 1; }

/* .back-home = indice · .back-link = schede. Stesse regole, due nomi già in uso. */
.back-home,
.back-link {
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none; color: var(--muted);
  font-size: 14px; font-weight: 600;
  padding: 18px 18px 0;
}
.back-home:hover,
.back-link:hover { color: var(--ink); }

/* ---------- Testata pagina (in-brand) ---------- */
.mat-head { padding: 18px 18px 4px; }
.mat-head .eyebrow { margin-bottom: 8px; }
.mat-head h1 { font-family: var(--font-display); font-weight: 600; font-size: 30px; letter-spacing: -0.01em; margin: 0; line-height: 1.1; }
.mat-head p { font-size: 14.5px; color: var(--muted); line-height: 1.5; margin: 12px 0 0; }

/* ---------- Footer pubblico (come index.html di radice) ---------- */
.pub-footer { padding: 34px 18px 40px; margin-top: 28px; border-top: 1px solid var(--border); }
.pub-footer p { font-size: 13px; color: var(--muted); margin-top: 10px; line-height: 1.5; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 18px; }
.foot-links a { font-size: 13px; color: var(--ink); font-weight: 500; text-decoration: none; }
.foot-copy { font-size: 12px; color: var(--muted); margin-top: 22px; opacity: 0.8; }

/* Breakpoint unico: 900px. */
@media (min-width: 900px) {
  .wrap { max-width: 760px; }
}

/* ==========================================================================
   2 · AREA CONTENUTI — stile Bitesize, tutto sotto .bitesize
   ECCEZIONE ACCETTATA E CONFINATA: qui i pastelli letterali sono ammessi.
   ========================================================================== */

.bitesize { font-family: 'Fredoka', var(--font-ui); color: #2a2a33; padding: 18px 0 0; }
.bitesize h2 { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 20px; line-height: 1.2; margin: 0 0 14px; color: #2a2a33; padding: 0 18px; }
.bitesize h3 { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 16px; line-height: 1.25; margin: 0 0 8px; color: #2a2a33; }
/* Scoped a .sheet e NON a `.bitesize p`: sull'indice un `p` generico avrebbe
   cambiato i margini di .mat-empty, e l'indice deve restare identico. */
.bitesize .sheet p { font-size: 14.5px; line-height: 1.6; margin: 0 0 12px; }

/* ---------- Riga chip filtro: scorrevole in orizzontale su mobile ---------- */
.bitesize .fbar {
  display: flex; gap: 8px; align-items: center;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding: 0 18px 18px; margin: 0;
  scrollbar-width: none;
}
.bitesize .fbar::-webkit-scrollbar { display: none; }
.bitesize .fchip {
  flex: 0 0 auto; cursor: pointer;
  font-family: 'Fredoka', sans-serif; font-weight: 500; font-size: 13px; line-height: 1.4;
  padding: 7px 14px; border-radius: 999px; border: none;
  background: #F4F3F0; color: #5A5A63;
}
.bitesize .fchip.is-active { background: #2348F0; color: #fff; }

/* ---------- Indice: sezioni e card ---------- */
.bitesize .mat-sec { margin-bottom: 26px; }
.bitesize .mat-grid { display: grid; grid-template-columns: 1fr; gap: 14px; padding: 0 18px; }
.bitesize .mcard { display: block; text-decoration: none; color: #2a2a33; background: #fff; border: 2px solid #EFE9FB; border-radius: 18px; padding: 16px 16px 14px; }
.bitesize a.mcard:hover { border-color: #2348F0; }
.bitesize .mcard .mtitle { font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 16.5px; line-height: 1.25; }
.bitesize .mcard .msub { font-size: 13.5px; line-height: 1.45; color: #5A5A63; margin: 6px 0 12px; }
.bitesize .mcard .mmeta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bitesize .mcard .open { display: inline-block; margin-top: 12px; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13px; color: #2348F0; }
.bitesize .mat-empty { padding: 0 18px; font-size: 14px; color: #5A5A63; line-height: 1.5; }

/* ---------- Pill: il COLORE distingue il TIPO ----------
   Il livello resta NEUTRO di proposito: è una scala ordinata e si legge
   meglio come testo. Nessun token CEFR è stato aggiunto a tokens.css. */
.bitesize .pill { font-family: 'Fredoka', sans-serif; font-weight: 500; font-size: 12px; padding: 4px 11px; border-radius: 999px; line-height: 1.4; }
.bitesize .pill--grammatica { background: #E6F0FB; color: #1A3A99; }
.bitesize .pill--vocaboli   { background: #E6F7F1; color: #0E7C66; }
.bitesize .pill--dialogo    { background: #FFF0E6; color: #B3471B; }
.bitesize .pill--cefr       { background: #F4F3F0; color: #5A5A63; }

/* ==========================================================================
   2b · SCHEDE — blocchi comuni ai materiali
   ========================================================================== */

/* Riga pill sopra il titolo della scheda. Vive in .bitesize perché i colori
   delle pill sono pastelli confinati; il titolo accanto resta in-brand. */
.bitesize.sheet-pills { padding: 0 0 12px; display: flex; flex-wrap: wrap; gap: 8px; }

/* Corpo della scheda: un solo contenitore .bitesize con padding orizzontale. */
.bitesize .sheet { padding: 0 18px; }
.bitesize .sheet-block { margin-bottom: 26px; }

/* ---------- Controllo velocità voce ---------- */
.bitesize .speed-ctl {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #F4F3F0; border-radius: 18px; padding: 12px 14px; margin-bottom: 18px;
}
.bitesize .speed-ctl label { font-size: 13.5px; color: #5A5A63; font-weight: 500; }
.bitesize .speed-ctl select {
  font-family: 'Fredoka', sans-serif; font-size: 13.5px; color: #2a2a33;
  background: #fff; border: 2px solid #EFE9FB; border-radius: 999px;
  padding: 6px 12px; cursor: pointer;
}

/* ---------- Card errore ----------
   scroll-margin-top: la card è il bersaglio del rimando "Rivedi l'errore N ↑"
   e l'header è sticky. Senza, arrivando dall'ancora la card finisce sotto
   l'header e sembra che il link abbia sbagliato mira. */
.bitesize .mk-card { background: #fff; border: 2px solid #EFE9FB; border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; scroll-margin-top: 86px; }
.bitesize .mk-num {
  display: inline-block; font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 11.5px;
  letter-spacing: 0.04em; color: #5A5A63; background: #F4F3F0;
  border-radius: 999px; padding: 3px 10px; margin-bottom: 10px;
}
.bitesize .mk-row { display: flex; align-items: center; gap: 8px; padding: 3px 0; }
.bitesize .mk-icon { flex-shrink: 0; font-size: 15px; width: 20px; text-align: center; }
.bitesize .mk-wrong { color: #C0341E; text-decoration: line-through; text-decoration-color: rgba(192,52,30,0.5); font-size: 15px; }
.bitesize .mk-right { color: #2a2a33; font-weight: 600; font-size: 15px; }
.bitesize .mk-it { color: #5A5A63; font-style: italic; font-size: 14px; padding: 3px 0 3px 28px; }
.bitesize .mk-explain { background: #F4F3F0; border-radius: 12px; padding: 10px 12px; margin-top: 10px; font-size: 13.5px; line-height: 1.55; color: #4a4a52; }
.bitesize .mk-explain strong { color: #1A3A99; font-weight: 600; }

/* Pulsante audio */
.bitesize .speak-btn {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; margin-left: auto;
  border: 2px solid #EFE9FB; background: #fff; color: #2348F0;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 15px; transition: transform 0.1s ease, background 0.15s ease;
}
.bitesize .speak-btn:hover { background: #E6F0FB; }
.bitesize .speak-btn:active { transform: scale(0.92); }
.bitesize .speak-btn.playing { background: #2348F0; color: #fff; border-color: #2348F0; }

/* ---------- "Come te lo ricordi" ---------- */
.bitesize .recall { background: #E6F7F1; border-radius: 18px; padding: 16px; margin-bottom: 26px; }
.bitesize .recall h3 { color: #0E7C66; }
.bitesize .recall p:last-child { margin-bottom: 0; }

/* ---------- Recap a punteggio ---------- */
.bitesize .quiz-score {
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 14px; color: #1A3A99;
  background: #E6F0FB; border-radius: 999px; padding: 7px 14px;
  display: inline-block; margin-bottom: 16px;
}
.bitesize .q { background: #fff; border: 2px solid #EFE9FB; border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; }
.bitesize .q-tipo { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; color: #5A5A63; margin-bottom: 6px; }
.bitesize .q-text { font-size: 15px; font-weight: 600; line-height: 1.4; margin-bottom: 12px; }
.bitesize .q-opts { display: flex; flex-direction: column; gap: 8px; }
.bitesize .opt {
  font-family: 'Fredoka', sans-serif; font-size: 14px; line-height: 1.4; text-align: left;
  background: #F4F3F0; color: #2a2a33; border: 2px solid transparent;
  border-radius: 12px; padding: 10px 12px; cursor: pointer; width: 100%;
}
.bitesize .opt:hover { border-color: #EFE9FB; background: #EFEEEA; }
/* Dopo la risposta: nessun hover, nessun cursore attivo. */
.bitesize .q.is-done .opt { cursor: default; }
.bitesize .q.is-done .opt:hover { background: #F4F3F0; border-color: transparent; }
.bitesize .opt.is-right { background: #DCEFD8; color: #0E7C66; font-weight: 600; border-color: #0E7C66; }
.bitesize .opt.is-wrong { background: #FBEAE7; color: #C0341E; font-weight: 600; border-color: #C0341E; }
.bitesize .q.is-done .opt.is-right:hover { background: #DCEFD8; border-color: #0E7C66; }
.bitesize .q.is-done .opt.is-wrong:hover { background: #FBEAE7; border-color: #C0341E; }
/* Dopo la risposta si rimanda alla card, NON si ripete la sua spiegazione:
   duplicarla significava ristampare nella stessa pagina un testo letto poche
   righe sopra. */
.bitesize .q-ref { margin-top: 12px; font-size: 13.5px; }
.bitesize .q-ref a { color: #2348F0; font-weight: 600; text-decoration: none; }
.bitesize .q-ref a:hover { text-decoration: underline; }

.bitesize .quiz-summary { background: #E6F0FB; border-radius: 18px; padding: 16px; margin-top: 18px; }
.bitesize .quiz-summary p { font-weight: 600; color: #1A3A99; margin-bottom: 12px; }
.bitesize .quiz-restart {
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13.5px;
  background: #fff; color: #2348F0; border: 2px solid #2348F0;
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
}
.bitesize .quiz-restart:hover { background: #2348F0; color: #fff; }

/* Senza JavaScript le domande restano LEGGIBILI: il JS aggiunge .js-on e
   solo allora le opzioni prendono l'aspetto di pulsanti cliccabili. */
.bitesize .quiz:not(.js-on) .opt { cursor: default; background: transparent; border: none; padding: 4px 0; }
.bitesize .quiz:not(.js-on) .opt::before { content: "· "; color: #5A5A63; }
.bitesize .quiz:not(.js-on) .quiz-score,
.bitesize .quiz:not(.js-on) .quiz-restart { display: none; }

/* ==========================================================================
   2c · SCHEDE FORMATO «FRASI» — flashcard, dettato, abbinamento
   Aggiunte in M3. Solo aggiunte: nessuna regola preesistente è stata alterata,
   perché le stesse regole servono l'indice e le schede «errori».
   ========================================================================== */

/* ---------- Interruttore flashcard ---------- */
.bitesize .flash-bar { margin-bottom: 18px; }
.bitesize .flash-btn {
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13.5px;
  background: #fff; color: #2348F0; border: 2px solid #2348F0;
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
}
.bitesize .flash-btn:hover { background: #2348F0; color: #fff; }
.bitesize .flash-btn[aria-pressed="true"] { background: #2348F0; color: #fff; }
.bitesize .flash-hint { font-size: 13px; color: #5A5A63; margin: 8px 0 0; }

/* ---------- Riga frase ---------- */
.bitesize .ph-row {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 2px solid #EFE9FB; border-radius: 18px;
  padding: 12px 14px; margin-bottom: 12px;
}
.bitesize .ph-num {
  flex: 0 0 auto; font-family: 'Fredoka', sans-serif; font-weight: 600;
  font-size: 11.5px; color: #5A5A63; background: #F4F3F0;
  border-radius: 999px; padding: 3px 9px;
}
.bitesize .ph-body { flex: 1 1 auto; min-width: 0; }
.bitesize .ph-en { font-weight: 600; font-size: 15px; line-height: 1.3; color: #2a2a33; }
.bitesize .ph-it { font-size: 13.5px; line-height: 1.4; color: #5A5A63; margin-top: 3px; }

/* Flashcard attiva: l'inglese è coperto da un segnaposto cliccabile, ma il
   pulsante audio resta attivo — è il punto dell'esercizio. */
.bitesize .ph-row.is-masked .ph-en { display: none; }
.bitesize .ph-reveal {
  font-family: 'Fredoka', sans-serif; font-size: 13.5px; text-align: left;
  background: #F4F3F0; color: #5A5A63;
  border: 2px dashed #EFE9FB; border-radius: 12px;
  padding: 7px 12px; cursor: pointer; width: 100%;
}
.bitesize .ph-reveal:hover { border-color: #2348F0; color: #2348F0; }

/* ---------- Dettato ---------- */
.bitesize .dict-row {
  background: #fff; border: 2px solid #EFE9FB; border-radius: 18px;
  padding: 12px 14px; margin-bottom: 12px;
}
.bitesize .dict-top { display: flex; align-items: center; gap: 10px; }
.bitesize .dict-input {
  flex: 1 1 auto; min-width: 0;
  font-family: 'Fredoka', sans-serif; font-size: 14.5px; color: #2a2a33;
  background: #F4F3F0; border: 2px solid transparent; border-radius: 12px;
  padding: 9px 12px;
}
.bitesize .dict-input:focus { outline: none; border-color: #2348F0; background: #fff; }
.bitesize .dict-input:disabled { color: #5A5A63; }
.bitesize .dict-check {
  flex: 0 0 auto;
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13px;
  background: #2348F0; color: #fff; border: none;
  border-radius: 999px; padding: 8px 14px; cursor: pointer;
}
.bitesize .dict-check:hover { background: #1A3A99; }
.bitesize .dict-check:disabled { background: #EFE9FB; color: #5A5A63; cursor: default; }
.bitesize .dict-fb { margin-top: 10px; font-size: 13.5px; line-height: 1.5; border-radius: 12px; padding: 9px 12px; }
.bitesize .dict-fb--ok { background: #DCEFD8; color: #0E7C66; }
.bitesize .dict-fb--no { background: #FBEAE7; color: #C0341E; }
.bitesize .dict-sol { display: block; margin-top: 6px; color: #2a2a33; font-weight: 600; }
.bitesize .dict-retry {
  margin-top: 10px;
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13px;
  background: #fff; color: #2348F0; border: 2px solid #2348F0;
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.bitesize .dict-retry:hover { background: #2348F0; color: #fff; }

/* ---------- Abbinamento ---------- */
.bitesize .match-score {
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 14px; color: #1A3A99;
  background: #E6F0FB; border-radius: 999px; padding: 7px 14px;
  display: inline-block; margin-bottom: 14px;
}
/* Due colonne SEMPRE, anche su mobile: l'esercizio è un confronto fra due
   elenchi e impilarli lo renderebbe illeggibile. */
.bitesize .match-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bitesize .match-col { display: flex; flex-direction: column; gap: 8px; }
.bitesize .match-item {
  font-family: 'Fredoka', sans-serif; font-size: 13.5px; line-height: 1.35; text-align: left;
  background: #fff; color: #2a2a33; border: 2px solid #EFE9FB;
  border-radius: 12px; padding: 9px 11px; cursor: pointer; width: 100%;
}
.bitesize .match-item:hover { border-color: #2348F0; }
.bitesize .match-item.is-picked { border-color: #2348F0; background: #E6F0FB; }
.bitesize .match-item.is-wrong { background: #FBEAE7; border-color: #C0341E; color: #C0341E; }
.bitesize .match-item.is-locked {
  background: #DCEFD8; border-color: #0E7C66; color: #0E7C66;
  font-weight: 600; cursor: default;
}
.bitesize .match-item.is-locked:hover { border-color: #0E7C66; }
.bitesize .match-done { background: #DCEFD8; border-radius: 18px; padding: 14px 16px; margin-top: 14px; }
.bitesize .match-done p { color: #0E7C66; font-weight: 600; margin-bottom: 0; }
.bitesize .match-restart {
  margin-top: 14px;
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13px;
  background: #fff; color: #2348F0; border: 2px solid #2348F0;
  border-radius: 999px; padding: 7px 14px; cursor: pointer;
}
.bitesize .match-restart:hover { background: #2348F0; color: #fff; }

/* Senza JavaScript gli esercizi NON spariscono. I campi del dettato restano
   VISIBILI e semplicemente inerti (nessun handler li ascolta); dell'abbinamento
   restano visibili le dodici voci come testo. Si nascondono solo i due comandi
   che senza JS non vogliono dire nulla: contatore e «Ricomincia». */
.bitesize .ex:not(.js-on) .dict-check { background: #EFE9FB; color: #5A5A63; cursor: default; }
.bitesize .ex:not(.js-on) .match-restart,
.bitesize .ex:not(.js-on) .match-score { display: none; }
.bitesize .ex:not(.js-on) .match-item { cursor: default; border-style: dashed; }
.bitesize .ex:not(.js-on) .match-item:hover { border-color: #EFE9FB; }

/* ==========================================================================
   2d · SCHEDA FORMATO «DIALOGO» — modalità, bolle, audio continuo
   Aggiunte in M4. Solo aggiunte: nessuna regola preesistente alterata.
   Il quiz di comprensione RIUSA le regole del recap (.quiz/.q/.opt/.q-ref):
   non ne servono di nuove.
   ========================================================================== */

/* ---------- Selettore di modalità: tre stati mutuamente esclusivi ---------- */
.bitesize .mode-bar { margin-bottom: 16px; }
.bitesize .mode-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.bitesize .mode-btn {
  flex: 0 0 auto; cursor: pointer;
  font-family: 'Fredoka', sans-serif; font-weight: 500; font-size: 13.5px; line-height: 1.4;
  padding: 8px 15px; border-radius: 999px; border: 2px solid #EFE9FB;
  background: #fff; color: #5A5A63;
}
.bitesize .mode-btn:hover { border-color: #2348F0; color: #2348F0; }
.bitesize .mode-btn.is-active {
  background: #2348F0; color: #fff; border-color: #2348F0; font-weight: 600;
}
.bitesize .mode-hint { font-size: 13px; color: #5A5A63; margin: 10px 0 0; }

/* ---------- Controlli dell'audio continuo ---------- */
.bitesize .dlg-play { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.bitesize .dlg-play-btn {
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13.5px;
  background: #2348F0; color: #fff; border: 2px solid #2348F0;
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
}
.bitesize .dlg-play-btn:hover { background: #1A3A99; border-color: #1A3A99; }
.bitesize .dlg-stop-btn {
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 13.5px;
  background: #fff; color: #5A5A63; border: 2px solid #EFE9FB;
  border-radius: 999px; padding: 8px 16px; cursor: pointer;
}
.bitesize .dlg-stop-btn:hover { border-color: #C0341E; color: #C0341E; }

/* ---------- Legenda dei due ruoli ---------- */
.bitesize .dlg-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; font-size: 13px; color: #5A5A63; }
.bitesize .dlg-legend-item { display: flex; align-items: center; gap: 6px; }
.bitesize .dlg-dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.bitesize .dlg-dot--traveler { background: #1A3A99; }
.bitesize .dlg-dot--staff { background: #0E7C66; }

/* ---------- Le bolle ---------- */
.bitesize .dlg { margin-bottom: 26px; }
/* scroll-margin-top: durante l'audio continuo la pagina scorre sulla battuta in
   corso, e l'header è sticky. Senza questo, la bolla finirebbe sotto l'header. */
.bitesize .dlg-row { display: flex; margin-bottom: 12px; scroll-margin-top: 86px; }
.bitesize .dlg-row--traveler { justify-content: flex-end; }
.bitesize .dlg-row--staff { justify-content: flex-start; }
.bitesize .dlg-bubble {
  max-width: 88%;
  background: #fff; border: 2px solid #EFE9FB; border-radius: 18px;
  padding: 12px 14px;
}
.bitesize .dlg-row--traveler .dlg-bubble { border-top-right-radius: 6px; }
.bitesize .dlg-row--staff .dlg-bubble { border-top-left-radius: 6px; }
.bitesize .dlg-who {
  font-family: 'Fredoka', sans-serif; font-weight: 600; font-size: 11.5px;
  letter-spacing: 0.04em; margin-bottom: 7px;
}
.bitesize .dlg-row--traveler .dlg-who { color: #1A3A99; }
.bitesize .dlg-row--staff .dlg-who { color: #0E7C66; }
.bitesize .dlg-main { display: flex; align-items: flex-start; gap: 10px; }
.bitesize .dlg-texts { flex: 1 1 auto; min-width: 0; }
.bitesize .dlg-en { font-weight: 600; font-size: 15px; line-height: 1.35; color: #2a2a33; }
.bitesize .dlg-it { font-size: 13.5px; line-height: 1.4; color: #5A5A63; margin-top: 4px; }

/* Battuta in corso durante l'audio continuo. NON rivela il testo nascosto:
   si sente la voce e si vede quale bolla parla — è l'esercizio. */
.bitesize .dlg-row.is-speaking .dlg-bubble { border-color: #2348F0; background: #E6F0FB; }

/* Segnaposto: rivelano UNA battuta o UNA traduzione alla volta. */
.bitesize .dlg-reveal-en,
.bitesize .dlg-reveal-it {
  font-family: 'Fredoka', sans-serif; font-size: 13px; text-align: left;
  background: #F4F3F0; color: #5A5A63;
  border: 2px dashed #EFE9FB; border-radius: 12px;
  padding: 6px 11px; cursor: pointer; width: 100%; margin-top: 4px;
}
.bitesize .dlg-reveal-en:hover,
.bitesize .dlg-reveal-it:hover { border-color: #2348F0; color: #2348F0; }

/* ---------- Le tre modalità ----------
   Il mascheramento vive QUI, guidato da una classe sul contenitore: senza
   JavaScript nessuna classe viene applicata e la pagina resta leggibile
   per intero, inglese e italiano. */
.bitesize .dlg.mode-listen .dlg-row:not(.is-shown-it) .dlg-it { display: none; }
.bitesize .dlg.mode-roleplay .dlg-it { display: none; }
.bitesize .dlg.mode-roleplay .dlg-row--traveler:not(.is-shown-en) .dlg-en { display: none; }

/* ---------- Frasi da portare via ---------- */
.bitesize .takeaway { list-style: none; padding: 0; margin: 0 0 26px; display: flex; flex-direction: column; gap: 8px; }
.bitesize .takeaway li {
  background: #fff; border: 2px solid #EFE9FB; border-radius: 12px;
  padding: 9px 12px; font-size: 14.5px; line-height: 1.4;
}

/* Senza JavaScript i comandi del dialogo restano visibili ma inerti: la sezione
   non deve sparire. Si spegne solo l'aspetto «attivo» del pulsante play. */
.bitesize .dlg-shell:not(.js-on) .dlg-play-btn {
  background: #EFE9FB; color: #5A5A63; border-color: #EFE9FB; cursor: default;
}
.bitesize .dlg-shell:not(.js-on) .mode-btn { cursor: default; }

/* ---------- Chiusura ---------- */
.bitesize .closing { background: #F4F3F0; border-radius: 18px; padding: 16px; margin-bottom: 8px; }
.bitesize .closing p { margin-bottom: 14px; }

@media (min-width: 900px) {
  .bitesize .mat-grid { grid-template-columns: repeat(2, 1fr); }
  .bitesize .match-grid { gap: 14px; }
}
