/* =====================================================================
   styles.css — Cours d'allemand intensif A1
   Design moderne, clair et pédagogique. Responsive.
   ===================================================================== */
:root {
  --blue: #1d4ed8;
  --blue-dark: #1e3a8a;
  --blue-light: #dbeafe;
  --red: #b91c1c;
  --gold: #f59e0b;
  --green: #16a34a;
  --green-light: #dcfce7;
  --rose: #fee2e2;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.14);
  --radius: 16px;
  --radius-sm: 10px;
  --mod-color: var(--blue);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 1100px; margin: 0 auto; padding: 0 20px 80px; }

h1, h2, h3 { line-height: 1.2; }
a { color: var(--blue); text-decoration: none; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 600; font-size: 15px; cursor: pointer; transition: .15s;
  font-family: inherit;
}
.btn.big { padding: 15px 32px; font-size: 17px; }
.btn.small { padding: 8px 16px; font-size: 14px; }
.btn-primary { background: var(--blue); color: #fff; box-shadow: 0 6px 18px rgba(29,78,216,.3); }
.btn-primary:hover { background: var(--blue-dark); transform: translateY(-1px); }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-link { background: none; border: none; color: var(--blue); cursor: pointer; font-size: 15px; font-weight: 600; padding: 6px 0; font-family: inherit; }
.btn-link:hover { text-decoration: underline; }
.btn-check { background: var(--ink); color: #fff; }
.btn-check:hover { background: #000; }
.btn-audio {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--blue-light); color: var(--blue-dark);
  border: none; border-radius: 999px; padding: 4px 10px;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: .15s; font-family: inherit;
}
.btn-audio:hover { background: var(--blue); color: #fff; }
.btn-audio.big { font-size: 16px; padding: 12px 24px; }

/* ====================================================================
   HERO / APERÇU
   ==================================================================== */
.hero {
  text-align: center; padding: 56px 24px 40px; margin-top: 24px;
  background: linear-gradient(180deg, #fff, #f1f5f9);
  border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.hero-flag { display: flex; justify-content: center; gap: 0; margin-bottom: 22px; }
.hero-flag span { width: 46px; height: 8px; border-radius: 2px; }
.hero-flag span:nth-child(1) { background: #111; }
.hero-flag span:nth-child(2) { background: var(--red); }
.hero-flag span:nth-child(3) { background: var(--gold); }
.hero-eyebrow { color: var(--muted); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 0 0 8px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); margin: 0 0 10px; letter-spacing: -.02em; }
.hero-slogan { font-size: 20px; color: var(--blue); font-weight: 600; margin: 0 0 16px; }
.hero-desc { max-width: 680px; margin: 0 auto 28px; color: var(--muted); font-size: 16px; }

.stats-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 28px 0; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 20px; min-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.stat-ic { font-size: 22px; }
.stat-n { font-size: 26px; font-weight: 800; color: var(--ink); }
.stat-l { font-size: 12.5px; color: var(--muted); }

.global-prog { max-width: 560px; margin: 24px auto 8px; text-align: left; }
.global-prog-head { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); margin-bottom: 6px; font-weight: 600; }
.bar { height: 12px; background: #e7edf5; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), #3b82f6); border-radius: 999px; transition: width .4s ease; }

.hero-cta { margin-top: 26px; }
.hero-audio-info { font-size: 13px; color: var(--muted); margin: 12px 0 0; }

/* ---------- Sections ---------- */
.section { margin: 56px 0 0; }
.section-title { font-size: 26px; margin: 0 0 24px; letter-spacing: -.01em; }

/* Méthode */
.method-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.method-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.method-ic { font-size: 28px; margin-bottom: 8px; }
.method-card h3 { margin: 0 0 6px; font-size: 16px; }
.method-card p { margin: 0; color: var(--muted); font-size: 14px; }

/* Modules */
.module { border-top: 3px solid var(--mod-color); padding-top: 28px; border-radius: 4px; }
.module-head { margin-bottom: 22px; }
.module-badge {
  display: inline-block; background: var(--mod-color); color: #fff;
  padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; margin-bottom: 10px;
}
.module-head h2 { font-size: 24px; margin: 4px 0 8px; }
.module-head p { color: var(--muted); margin: 0; max-width: 760px; }

.lecon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.lecon-card {
  display: flex; gap: 14px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  color: var(--ink); transition: .18s; position: relative; overflow: hidden;
}
.lecon-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--mod-color); opacity: .6; }
.lecon-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--mod-color); }
.lecon-card.done { background: linear-gradient(180deg, #fff, var(--green-light)); }
.lecon-num {
  flex: 0 0 44px; height: 44px; border-radius: 12px; background: var(--blue-light); color: var(--blue-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 18px;
}
.lecon-card.done .lecon-num { background: var(--green); color: #fff; }
.lecon-num .check { font-size: 12px; }
.lecon-info { min-width: 0; }
.lecon-info h3 { margin: 0 0 2px; font-size: 16px; }
.lecon-de { margin: 0 0 8px; color: var(--mod-color); font-size: 13.5px; font-weight: 600; font-style: italic; }
.lecon-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { background: #f1f5f9; color: var(--muted); font-size: 11.5px; padding: 3px 9px; border-radius: 6px; font-weight: 600; }
.lecon-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--muted); }

/* Grammaire aperçu */
.gram-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.gram-col { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.gram-col h3 { margin: 0 0 12px; color: var(--blue); }
.gram-col ul { margin: 0; padding-left: 18px; }
.gram-col li { margin-bottom: 8px; color: var(--ink); }

/* Compétences */
.comp { background: linear-gradient(135deg, var(--blue-dark), var(--blue)); color: #fff; border-radius: 28px; padding: 36px; }
.comp .section-title { color: #fff; }
.comp-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.comp-list li { padding-left: 30px; position: relative; }
.comp-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 22px; height: 22px; background: rgba(255,255,255,.2); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; }

.footer { text-align: center; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }

/* ====================================================================
   PAGE LEÇON
   ==================================================================== */
.lesson-top { display: flex; justify-content: space-between; align-items: center; padding: 24px 0 8px; }
.lesson-top-mod { font-size: 13px; color: var(--muted); font-weight: 600; }
.delf-quit { color: var(--muted); font-size: 13px; text-decoration: none; }
.delf-quit:hover { color: #b91c1c; text-decoration: underline; }

.lesson-head { border-radius: 24px; padding: 32px; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--mod-color); box-shadow: var(--shadow); }
.lesson-num { display: inline-block; background: var(--mod-color); color: #fff; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.lesson-head h1 { margin: 0 0 6px; font-size: 30px; }
.lesson-head h1 .de { color: var(--mod-color); font-weight: 600; font-size: 20px; font-style: italic; }
.lesson-theme { color: var(--muted); margin: 0 0 18px; font-size: 14px; }
.objectifs { background: var(--blue-light); border-radius: var(--radius); padding: 16px 20px; }
.objectifs h3 { margin: 0 0 8px; font-size: 15px; color: var(--blue-dark); }
.objectifs ul { margin: 0; padding-left: 20px; }
.objectifs li { margin-bottom: 4px; font-size: 14.5px; }

.lesson-tabs { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; gap: 8px; background: rgba(248,250,252,.92); backdrop-filter: blur(8px); padding: 12px 0; margin: 14px 0; border-bottom: 1px solid var(--line); }
.lesson-tabs a { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--ink); }
.lesson-tabs a:hover { border-color: var(--blue); color: var(--blue); }

.lesson-section { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; margin-bottom: 22px; box-shadow: var(--shadow); scroll-margin-top: 70px; }
.lesson-section > h2 { margin: 0 0 18px; font-size: 22px; }
.ls-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
.ls-head h2 { margin: 0; font-size: 22px; }

/* Vocabulaire */
.voc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.voc-card { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; background: #fff; transition: .15s; }
.voc-card:hover { border-color: var(--blue); box-shadow: var(--shadow); }
.voc-top { display: flex; justify-content: space-between; align-items: center; }
.voc-de { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; }
.voc-fr { color: var(--muted); font-size: 14px; margin-top: 2px; }
.voc-ex { margin-top: 8px; font-size: 13px; color: var(--blue-dark); font-style: italic; border-left: 3px solid var(--blue-light); padding-left: 10px; }

/* Grammaire (leçon) */
.gram-block { margin-bottom: 26px; padding-bottom: 22px; border-bottom: 1px dashed var(--line); }
.gram-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.gram-block h3 { margin: 0 0 8px; font-size: 18px; color: var(--blue-dark); }
.gram-intro { color: var(--ink); margin: 0 0 14px; }
.table-wrap { overflow-x: auto; margin: 14px 0; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.gram-table { width: 100%; border-collapse: collapse; font-size: 14.5px; min-width: 360px; }
.gram-table th { background: var(--ink); color: #fff; padding: 10px 14px; text-align: left; font-weight: 600; }
.gram-table td { padding: 9px 14px; border-top: 1px solid var(--line); }
.gram-table td.first { font-weight: 700; color: var(--blue-dark); }
.gram-table tbody tr:nth-child(even) { background: #f8fafc; }
.gram-note { background: #fffbeb; border-left: 4px solid var(--gold); padding: 12px 16px; border-radius: 8px; font-size: 14px; margin: 14px 0 0; }

/* Dialogue */
.dlg-lieu { color: var(--muted); font-size: 14px; margin: 0 0 18px; }
.conv { display: flex; flex-direction: column; gap: 14px; }
.conv-row { display: flex; }
.conv-row.right { justify-content: flex-end; }
.bubble { max-width: 78%; background: #f1f5f9; border-radius: 18px; padding: 12px 16px; }
.conv-row.right .bubble { background: var(--blue-light); }
.conv-loc { font-weight: 700; font-size: 12.5px; color: var(--mod-color); margin-bottom: 3px; }
.conv-de { display: flex; align-items: center; gap: 8px; font-size: 15.5px; font-weight: 500; }
.conv-fr { color: var(--muted); font-size: 13.5px; margin-top: 3px; font-style: italic; }

/* ====================================================================
   EXERCICES
   ==================================================================== */
.exo-progress { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.exo-progress .bar { flex: 1; }
.exo-progress-label { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }

.exo { border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; background: #fff; transition: .2s; }
.exo.exo-ok { border-color: var(--green); background: linear-gradient(180deg, #fff, #f6fef9); }
.exo.exo-ko { border-color: #fca5a5; }
.exo-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.exo-num { font-weight: 800; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.exo-type { font-size: 11.5px; background: var(--blue-light); color: var(--blue-dark); padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.exo-consigne { font-weight: 600; margin: 0 0 14px; }
.exo-question { font-size: 17px; margin: 0 0 14px; }
.exo-question strong { color: var(--blue-dark); }
.exo-indice { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.exo-actions { margin-top: 16px; }

.exo-feedback { display: none; margin-top: 14px; padding: 12px 16px; border-radius: 10px; font-size: 14.5px; }
.exo-feedback.show { display: block; }
.exo-feedback.juste { background: var(--green-light); color: #14532d; }
.exo-feedback.faux { background: var(--rose); color: #7f1d1d; }
.exo-feedback.neutre { background: #fef9c3; color: #713f12; }
.exo-explication { margin-top: 8px; font-size: 13.5px; opacity: .9; }

/* QCM */
.qcm-options { display: grid; gap: 10px; }
.qcm-opt { text-align: left; padding: 13px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 15px; cursor: pointer; transition: .12s; font-family: inherit; }
.qcm-opt:hover { border-color: var(--blue); background: #f8fbff; }
.qcm-opt.sel { border-color: var(--blue); background: var(--blue-light); }
.qcm-opt.correct { border-color: var(--green); background: var(--green-light); font-weight: 600; }
.qcm-opt.wrong { border-color: var(--red); background: var(--rose); }
.qcm-opt:disabled { cursor: default; }

/* Écoute */
.ecoute-player { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.ecoute-hint { font-size: 13px; color: var(--muted); }

/* Texte à trous */
.trou-phrase { font-size: 17px; line-height: 2.2; }
.trou-input, .conj-input { border: none; border-bottom: 2px solid var(--blue); background: var(--blue-light); border-radius: 6px 6px 0 0; padding: 4px 8px; font-size: 15px; font-family: inherit; margin: 0 4px; min-width: 70px; }
.trou-input:focus, .conj-input:focus, .trad-input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.trou-input.ok, .conj-input.ok, .trad-input.ok { background: var(--green-light); border-color: var(--green); }
.trou-input.ko, .conj-input.ko, .trad-input.ko { background: var(--rose); border-color: var(--red); }

/* Association */
.assoc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.assoc-col { display: flex; flex-direction: column; gap: 10px; }
.assoc-tile { padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; font-size: 15px; cursor: pointer; text-align: center; transition: .12s; font-family: inherit; font-weight: 500; }
.assoc-tile:hover:not(:disabled) { border-color: var(--blue); }
.assoc-tile.active { border-color: var(--blue); background: var(--blue-light); box-shadow: 0 0 0 3px rgba(29,78,216,.15); }
.assoc-tile.matched { color: #fff; cursor: default; font-weight: 600; }
.assoc-tile:disabled { opacity: 1; }
.assoc-tile.c1 { background: #2563eb; border-color: #2563eb; }
.assoc-tile.c2 { background: #16a34a; border-color: #16a34a; }
.assoc-tile.c3 { background: #db2777; border-color: #db2777; }
.assoc-tile.c4 { background: #f59e0b; border-color: #f59e0b; }
.assoc-tile.c5 { background: #7c3aed; border-color: #7c3aed; }
.assoc-tile.c6 { background: #0891b2; border-color: #0891b2; }

/* Conjugaison */
.conj-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.conj-row { display: flex; align-items: center; gap: 10px; }
.conj-pron { min-width: 78px; font-weight: 600; color: var(--blue-dark); font-size: 14.5px; }
.conj-input { flex: 1; background: #f8fafc; border: 1.5px solid var(--line); border-radius: 8px; }
.conj-input.ok { background: var(--green-light); }
.conj-input.ko { background: var(--rose); }

/* Remise en ordre */
.ordre-answer { min-height: 54px; border: 2px dashed var(--line); border-radius: 12px; padding: 10px; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-content: flex-start; }
.ordre-answer.empty::before { content: attr(data-placeholder); color: var(--muted); font-size: 14px; align-self: center; }
.ordre-pool { display: flex; flex-wrap: wrap; gap: 8px; }
.ordre-chip { padding: 8px 14px; border: 1.5px solid var(--blue); background: #fff; color: var(--blue-dark); border-radius: 10px; font-size: 15px; cursor: pointer; font-family: inherit; font-weight: 500; transition: .12s; }
.ordre-chip:hover { background: var(--blue-light); }
.ordre-chip.used { opacity: .25; pointer-events: none; }
.ordre-chip.placed { background: var(--blue); color: #fff; border-color: var(--blue); }

/* Traduction */
.trad-source { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; margin-bottom: 12px; padding: 12px 16px; background: #f1f5f9; border-radius: 10px; }
.trad-flag { font-size: 20px; }
.trad-input { width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 10px; font-size: 15px; font-family: inherit; }

/* Complétion */
.completion { text-align: center; margin-top: 24px; padding: 28px; background: linear-gradient(135deg, var(--green-light), #fff); border: 2px solid var(--green); border-radius: var(--radius); }
.comp-emoji { font-size: 44px; }
.completion h3 { margin: 6px 0; }
.completion p { color: var(--muted); margin: 0 0 16px; }
.comp-score { font-weight: 800; color: var(--green); }

/* Navigation leçon */
.lesson-nav { display: flex; justify-content: space-between; gap: 14px; margin-top: 28px; }
.lesson-nav .btn { max-width: 48%; }

/* ---------- Hero : actions secondaires ---------- */
.hero-secondary { margin-top: 14px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.pill { background: var(--red); color: #fff; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 800; margin-left: 4px; }

/* ---------- Bandeau test de module ---------- */
.module-test {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-top: 18px; padding: 18px 22px; border-radius: var(--radius);
  background: linear-gradient(135deg, #fff, #f1f5f9); border: 1px dashed var(--mod-color);
}
.module-test h3 { margin: 0 0 2px; font-size: 17px; }
.module-test p { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ====================================================================
   PRODUCTION ÉCRITE / ORALE
   ==================================================================== */
.production-input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; font-family: inherit; resize: vertical; min-height: 90px;
}
.production-input:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.production-meta { display: flex; gap: 14px; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.wordcount { font-weight: 700; }
.wordcount.ok { color: var(--green); }
.wordcount.over { color: #b45309; }
.exam-recap .recap-list { list-style: none; margin: 14px 0 0; padding: 0; }
.recap-item { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.recap-item.warn { border-color: #f2c14e; background: rgba(242, 193, 78, .08); }
.recap-label { font-weight: 600; }
.recap-val { color: var(--muted); font-weight: 700; white-space: nowrap; }
.recap-item.warn .recap-val { color: #b45309; }
.production-modele { margin-top: 14px; background: var(--green-light); border: 1px solid #86efac; border-radius: 12px; padding: 14px 16px; }
.production-modele.hidden, .production-checklist.hidden, .oral-transcript.hidden, .fc-back.hidden,
.btn.hidden, .rev-rate.hidden, .test-result.hidden { display: none; }
.modele-head { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #14532d; font-size: 14px; margin-bottom: 6px; }
.modele-text { margin: 0; font-size: 15.5px; font-weight: 500; }
.production-checklist { margin-top: 12px; background: #f8fafc; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.checklist-title { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; }
.checklist-item { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 3px 0; cursor: pointer; }
.prod-report { margin-top: 8px; font-size: 13.5px; display: grid; gap: 4px; }
.kw { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 600; margin: 0 2px; }
.kw.ok { background: var(--green-light); color: #14532d; }
.kw.ko { background: var(--rose); color: #7f1d1d; text-decoration: line-through; opacity: .8; }

/* Oral */
.btn-mic { background: var(--red); color: #fff; }
.btn-mic:hover { background: #991b1b; }
.btn-mic.listening { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(185,28,28,.5);} 50% { box-shadow: 0 0 0 10px rgba(185,28,28,0);} }
.oral-transcript { margin-top: 12px; padding: 12px 16px; background: var(--blue-light); border-radius: 10px; font-size: 15px; }
.oral-label { font-weight: 700; color: var(--blue-dark); }
.oral-self { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.oral-self-label { font-size: 13px; color: var(--muted); }
.btn-self { border: 1.5px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: 13.5px; font-weight: 600; cursor: pointer; font-family: inherit; }
.btn-self.ok { color: var(--green); border-color: #86efac; }
.btn-self.ok:hover { background: var(--green-light); }
.btn-self.ko { color: var(--red); border-color: #fca5a5; }
.btn-self.ko:hover { background: var(--rose); }
.btn-self.big { padding: 14px 22px; font-size: 15px; }

/* ====================================================================
   RÉVISION (flashcards)
   ==================================================================== */
.revision { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); margin-top: 14px; }
.revision-head { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.revision .bar { margin-bottom: 24px; }
.flashcard { border: 1px solid var(--line); border-radius: 20px; padding: 40px 24px; text-align: center; background: linear-gradient(180deg, #fff, #f8fafc); box-shadow: var(--shadow); margin-bottom: 22px; min-height: 200px; display: flex; flex-direction: column; justify-content: center; }
.fc-de { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 34px; font-weight: 800; color: var(--ink); }
.fc-hint { color: var(--muted); font-size: 14px; margin: 14px 0 0; }
.fc-back { border-top: 1px dashed var(--line); margin-top: 22px; padding-top: 22px; }
.fc-fr { font-size: 24px; font-weight: 700; color: var(--blue-dark); }
.fc-ex { font-style: italic; color: var(--muted); margin: 10px 0 0; }
.rev-rate { display: flex; gap: 12px; justify-content: center; }
.rev-rate .btn-self { flex: 1; max-width: 240px; justify-content: center; }
.revision-empty { text-align: center; padding: 30px 10px; }
.revision-empty h2 { margin: 6px 0; }
.rev-summary { font-size: 17px; }
.rev-summary .su { color: var(--green); font-weight: 700; }
.rev-summary .arev { color: var(--red); font-weight: 700; }
.rev-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

/* ====================================================================
   TEST NOTÉ
   ==================================================================== */
.test-head { border-radius: 24px; padding: 30px; background: #fff; border: 1px solid var(--line); border-top: 5px solid var(--mod-color); box-shadow: var(--shadow); margin-top: 8px; }
.test-head h1 { margin: 8px 0 6px; font-size: 28px; }
.test-head p { color: var(--muted); margin: 0; font-size: 14.5px; }
.test-list { margin-top: 20px; }
.test-list .exo { background: #fff; }
.test-submit { text-align: center; margin: 24px 0; }
.test-result { text-align: center; padding: 32px; border-radius: var(--radius); margin-top: 10px; }
.test-result.pass { background: linear-gradient(135deg, var(--green-light), #fff); border: 2px solid var(--green); }
.test-result.fail { background: linear-gradient(135deg, #fef3c7, #fff); border: 2px solid var(--gold); }
.test-result h2 { margin: 10px 0; }
.test-result p { color: var(--ink); }
.score-detail { font-weight: 600; }
.score-ring { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; color: #fff; }
.score-ring.pass { background: conic-gradient(var(--green) 0, var(--green) 100%); }
.score-ring.fail { background: conic-gradient(var(--gold) 0, var(--gold) 100%); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .module-test { flex-direction: column; align-items: flex-start; }
  .oral-self { margin-left: 0; }
  .fc-de { font-size: 28px; }
  .gram-grid, .comp-list, .conj-list { grid-template-columns: 1fr; }
  .bubble { max-width: 90%; }
  .lesson-nav { flex-direction: column; }
  .lesson-nav .btn { max-width: 100%; justify-content: center; }
  .hero { padding: 40px 18px 32px; }
  .lesson-section, .lesson-head { padding: 20px; }
}

/* ====================================================================
   THÈME SOMBRE (synchronisé avec Telegram) + ajustements Mini App
   Activé via [data-tg-scheme="dark"] posé par js/telegram.js.
   ==================================================================== */
:root[data-tg-scheme="dark"] {
  --bg: #0e1621;
  --card: #17212b;
  --ink: #eef3f8;
  --muted: #9fb0c0;
  --line: #2a3a4d;
  --blue: #5ea4f2;
  --blue-dark: #9cc6ff;
  --blue-light: #1b2c41;
  --green: #3fce6a;
  --green-light: #16301f;
  --rose: #3a2020;
  --red: #f1707a;
  --gold: #e3a008;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 20px rgba(0, 0, 0, .35);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, .55);
}

[data-tg-scheme="dark"] .hero { background: linear-gradient(180deg, var(--card), #0b121b); }
[data-tg-scheme="dark"] .stat,
[data-tg-scheme="dark"] .voc-card,
[data-tg-scheme="dark"] .lesson-head,
[data-tg-scheme="dark"] .exo,
[data-tg-scheme="dark"] .test-head,
[data-tg-scheme="dark"] .test-list .exo,
[data-tg-scheme="dark"] .qcm-opt,
[data-tg-scheme="dark"] .assoc-tile,
[data-tg-scheme="dark"] .ordre-chip,
[data-tg-scheme="dark"] .btn-ghost,
[data-tg-scheme="dark"] .btn-self,
[data-tg-scheme="dark"] .lesson-tabs a { background: var(--card); color: var(--ink); }

[data-tg-scheme="dark"] .qcm-opt:hover { background: #20303f; }
[data-tg-scheme="dark"] .lesson-tabs { background: rgba(14, 22, 33, .92); }
[data-tg-scheme="dark"] .bubble,
[data-tg-scheme="dark"] .trad-source { background: #22303c; }
[data-tg-scheme="dark"] .conv-row.right .bubble { background: var(--blue-light); }
[data-tg-scheme="dark"] .tag { background: #22303c; color: var(--muted); }
[data-tg-scheme="dark"] .conj-input { background: #0e1621; }
[data-tg-scheme="dark"] .production-checklist { background: #13202b; }
[data-tg-scheme="dark"] .flashcard { background: linear-gradient(180deg, var(--card), #10202c); }
[data-tg-scheme="dark"] .module-test { background: linear-gradient(135deg, var(--card), #10202c); }
[data-tg-scheme="dark"] .lecon-card.done { background: linear-gradient(180deg, var(--card), #122a1d); }
[data-tg-scheme="dark"] .exo.exo-ok { background: linear-gradient(180deg, var(--card), #122a1d); }
[data-tg-scheme="dark"] .completion,
[data-tg-scheme="dark"] .test-result.pass { background: linear-gradient(135deg, #122a1d, var(--card)); }
[data-tg-scheme="dark"] .test-result.fail { background: linear-gradient(135deg, #2a2410, var(--card)); }

[data-tg-scheme="dark"] .gram-table th { background: #22303c; color: #fff; }
[data-tg-scheme="dark"] .gram-table tbody tr:nth-child(even) { background: #13202b; }

[data-tg-scheme="dark"] .btn-check { background: var(--blue); color: #08121d; }
[data-tg-scheme="dark"] .btn-check:hover { background: #7bb4f5; }
[data-tg-scheme="dark"] .btn-primary { color: #08121d; }

[data-tg-scheme="dark"] input,
[data-tg-scheme="dark"] textarea { color: var(--ink); }
[data-tg-scheme="dark"] .trad-input,
[data-tg-scheme="dark"] .production-input { background: #0e1621; border-color: var(--line); }
[data-tg-scheme="dark"] .trad-input::placeholder,
[data-tg-scheme="dark"] .production-input::placeholder { color: #5d7286; }

[data-tg-scheme="dark"] .exo-feedback.juste { color: #9ae6b4; }
[data-tg-scheme="dark"] .exo-feedback.faux { color: #feb2b2; }
[data-tg-scheme="dark"] .exo-feedback.neutre { background: #2c2814; color: #fde68a; }
[data-tg-scheme="dark"] .gram-note { background: #2a2410; color: #f5e6c8; }
[data-tg-scheme="dark"] .production-modele { background: #13301f; border-color: #1f7a44; }
[data-tg-scheme="dark"] .modele-head,
[data-tg-scheme="dark"] .kw.ok { color: #9ae6b4; }

/* Ajustements quand l'app tourne dans Telegram */
.has-main-button #app { padding-bottom: 96px; }
html.in-telegram .hero { margin-top: 8px; }
html.in-telegram .lesson-top a.btn-link { display: none; }

/* Indicateur de synchronisation cloud (Telegram) */
.sync-badge { color: var(--green); font-weight: 600; font-size: 13px; margin: 6px 0; }

/* ====================================================================
   PHOTOS, PARCOURS SÉQUENTIEL, GROUPES D'EXERCICES, EXAMEN FINAL
   ==================================================================== */
/* Cartes leçon : photo en bannière + verrouillage */
.lecon-card { flex-direction: column; gap: 0; padding: 0; align-items: stretch; }
.lecon-card::before { display: none; }
.lecon-banner { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(135deg, #dbeafe, #bfdbfe); overflow: hidden; }
.lecon-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lock-badge { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; background: rgba(15, 23, 42, .45); color: #fff; }
.lecon-card.done .lecon-banner::after { content: "✓"; position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; background: var(--green); color: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.lecon-card.locked { cursor: default; opacity: .9; }
.lecon-card.locked .lecon-banner img { filter: grayscale(1) brightness(.65); }
.lecon-card.locked:hover { transform: none; box-shadow: var(--shadow); border-color: var(--line); }
.lecon-body { padding: 14px 16px; }
.lecon-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.lecon-titles h3 { margin: 0; font-size: 16px; }
.lecon-titles .lecon-de { margin: 2px 0 0; }

/* Hero photo + intro de leçon */
.lesson-hero { margin: 0 0 18px; aspect-ratio: 40 / 13; border-radius: 14px; overflow: hidden; background: linear-gradient(135deg, #dbeafe, #bfdbfe); }
.lesson-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lesson-intro { margin: 14px 0 0; font-size: 15.5px; background: #f8fafc; border-left: 4px solid var(--mod-color); padding: 12px 16px; border-radius: 8px; }

/* Groupes d'exercices (compréhension / approfondi / production) */
.exo-group { margin-top: 26px; padding-top: 18px; border-top: 2px dashed var(--line); }
.exo-group:first-of-type { border-top: none; padding-top: 0; margin-top: 6px; }
.exo-group-title { margin: 0 0 2px; font-size: 18px; }
.exo-group-sub { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }
.exo-group-comp .exo-group-title { color: #0891b2; }
.exo-group-appro .exo-group-title { color: var(--blue-dark); }
.exo-group-prod .exo-group-title { color: #b45309; }

/* Examen final */
.examen-final { text-align: center; border-radius: 24px; padding: 32px; border: 2px solid var(--line); }
.examen-final.unlocked { background: linear-gradient(135deg, #ede9fe, #fff); border-color: #7c3aed; }
.examen-final.locked { background: linear-gradient(135deg, #f1f5f9, #fff); }
.examen-ic { font-size: 44px; }
.examen-final h2 { margin: 6px 0 8px; }
.examen-final p { max-width: 640px; margin: 0 auto 16px; }
.examen-final.locked p { color: var(--muted); }

/* Notice « leçon verrouillée » */
.locked-notice { text-align: center; }
.locked-notice .comp-emoji { font-size: 44px; }
.locked-notice .btn { margin: 6px 6px 0; }

/* Adaptations thème sombre */
[data-tg-scheme="dark"] .lecon-banner,
[data-tg-scheme="dark"] .lesson-hero { background: linear-gradient(135deg, #1b2c41, #10202c); }
[data-tg-scheme="dark"] .lesson-intro { background: #13202b; }
[data-tg-scheme="dark"] .examen-final.unlocked { background: linear-gradient(135deg, #241b3d, var(--card)); border-color: #7c3aed; }
[data-tg-scheme="dark"] .examen-final.locked { background: var(--card); }

/* Panneau de fin de leçon : réussite (points atteints) vs reprise */
.completion.ok { background: linear-gradient(135deg, var(--green-light), #fff); border: 2px solid var(--green); }
.completion.ko { background: linear-gradient(135deg, #fef3c7, #fff); border: 2px solid var(--gold); }
.comp-score.ko { color: var(--gold); }
.comp-auto { font-weight: 600; color: var(--muted); margin: 6px 0 14px; }
[data-tg-scheme="dark"] .completion.ok { background: linear-gradient(135deg, #122a1d, var(--card)); }
[data-tg-scheme="dark"] .completion.ko { background: linear-gradient(135deg, #2a2410, var(--card)); }

/* ====================================================================
   TABLEAU DE BORD (statistiques)
   ==================================================================== */
.stat-bar { margin-bottom: 16px; }
.stat-bar-head { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.stats-lecons { display: flex; flex-direction: column; gap: 8px; }
.stats-lecon { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); transition: .12s; }
a.stats-lecon:hover { border-color: var(--blue); transform: translateX(2px); }
.stats-lecon.ok { border-color: #86efac; background: linear-gradient(90deg, var(--green-light), #fff); }
.stats-lecon.lock { opacity: .55; }
.sl-num { flex: 0 0 30px; height: 30px; border-radius: 8px; background: var(--blue-light); color: var(--blue-dark); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; }
.stats-lecon.ok .sl-num { background: var(--green); color: #fff; }
.sl-titre { flex: 1; font-weight: 600; font-size: 14.5px; }
.sl-etat { font-size: 13px; color: var(--muted); white-space: nowrap; }
[data-tg-scheme="dark"] .stats-lecon { background: var(--card); }
[data-tg-scheme="dark"] .stats-lecon.ok { background: linear-gradient(90deg, #122a1d, var(--card)); }

/* Leçons de grammaire : accent violet pour les distinguer */
.lecon-card.grammaire { --mod-color: #7c3aed; }
.lecon-card.grammaire .lecon-num { background: #ede9fe; color: #6d28d9; }
.lecon-card.grammaire.done .lecon-num { background: #7c3aed; color: #fff; }
[data-tg-scheme="dark"] .lecon-card.grammaire .lecon-num { background: #2e2150; color: #c4b5fd; }

/* ====================================================================
   SCHÉMAS COLORÉS DE STRUCTURE DE PHRASE
   ==================================================================== */
.schemas { margin: 16px 0; }
.schema-legende { font-size: 13.5px; font-weight: 600; margin: 14px 0 6px; }
.schema-phrase { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.schema-box { border-radius: 10px; padding: 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid var(--line); background: #fff; min-width: 56px; }
.schema-mot { font-weight: 700; font-size: 15px; }
.schema-role { font-size: 11px; opacity: .85; }
.schema-box.sujet { border-color: #2563eb; color: #1e3a8a; background: #eff6ff; }
.schema-box.verbe { border-color: #dc2626; color: #991b1b; background: #fef2f2; }
.schema-box.fin { border-color: #16a34a; color: #166534; background: #f0fdf4; }
.schema-box.conj { border-color: #d97706; color: #92400e; background: #fffbeb; }
.schema-box.objet, .schema-box.neutre { border-color: var(--line); color: var(--muted); background: #f8fafc; }
.schema-legendecouleur { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.schema-tag { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--line); }
.schema-tag.sujet { border-color: #2563eb; color: #1e3a8a; background: #eff6ff; }
.schema-tag.verbe { border-color: #dc2626; color: #991b1b; background: #fef2f2; }
.schema-tag.fin { border-color: #16a34a; color: #166534; background: #f0fdf4; }
.schema-tag.conj { border-color: #d97706; color: #92400e; background: #fffbeb; }
[data-tg-scheme="dark"] .schema-box { background: #0e1621; }
[data-tg-scheme="dark"] .schema-box.sujet { background: #10203a; color: #9cc6ff; }
[data-tg-scheme="dark"] .schema-box.verbe { background: #2a1414; color: #fca5a5; }
[data-tg-scheme="dark"] .schema-box.fin { background: #10241a; color: #86efac; }
[data-tg-scheme="dark"] .schema-box.conj { background: #2a2410; color: #fcd34d; }
[data-tg-scheme="dark"] .schema-box.objet, [data-tg-scheme="dark"] .schema-box.neutre { background: #17212b; }

/* Séparateur de niveau + état des examens */
.niveau-sep { margin: 48px 0 0; }
.niveau-titre { font-size: 28px; margin: 0; padding-bottom: 10px; border-bottom: 3px solid var(--blue); display: inline-block; }
.niveau-lock { font-size: 13px; font-weight: 600; color: var(--gold); border: none; display: inline; margin-left: 8px; }
.examen-final.reussi { background: linear-gradient(135deg, #dcfce7, #fff); border-color: var(--green); }
[data-tg-scheme="dark"] .examen-final.reussi { background: linear-gradient(135deg, #122a1d, var(--card)); border-color: var(--green); }

/* ===== Accueil du coach (onboarding) & test de placement ===== */
.onboarding { text-align: center; }
.coach-avatar { font-size: 56px; line-height: 1; margin-bottom: 6px; }
.onboarding h1 { margin: 6px 0 10px; }
.onboarding-intro { max-width: 640px; margin: 0 auto; color: var(--muted); font-size: 16px; }
.niveau-choix { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 6px; }
@media (max-width: 520px) { .niveau-choix { grid-template-columns: repeat(2, 1fr); } }
.niveau-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 12px; cursor: pointer; box-shadow: var(--shadow); transition: .15s;
  font: inherit; color: inherit;
}
.niveau-btn:hover { border-color: var(--blue); transform: translateY(-2px); }
.niveau-btn strong { font-size: 22px; color: var(--blue); }
.niveau-btn span { font-size: 12.5px; color: var(--muted); }

/* ===== Badge « niveau actuel » (en-tête) & nom du coach ===== */
.niveau-actuel {
  display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin: 0 auto 14px; padding: 7px 14px; border-radius: 999px;
  background: var(--blue-light, #eef2ff); border: 1px solid var(--line);
  font-size: 13.5px; color: var(--text);
}
.niveau-actuel strong { color: var(--blue); font-size: 15px; }
.niveau-actuel span { color: var(--muted); }
.niveau-actuel-link { margin-left: 4px; font-size: 12.5px; font-weight: 600; color: var(--blue); text-decoration: none; white-space: nowrap; }
.niveau-actuel-link:hover { text-decoration: underline; }
.coach-nom { margin: 0 0 2px; font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }

/* ===== Cours pédagogiques : grammaire & vocabulaire enrichis ===== */
.cours .exo-group-sub { margin-top: 2px; }
.cours-block { margin: 0 0 26px; padding-bottom: 4px; }
.cours-block + .cours-block { border-top: 1px dashed var(--line); padding-top: 22px; }
.cours-titre { font-size: 19px; margin: 0 0 10px; }
.cours-text { font-size: 15.5px; line-height: 1.7; margin: 10px 0; }
.cours-text strong, .cours-regle strong, .cours-astuce strong, .cours-attention strong, .cours-points strong { color: var(--blue); }
.hl-de { background: #fff7cc; border-radius: 5px; padding: 0 4px; font-weight: 600; color: #7c5e00; }
[data-tg-scheme="dark"] .hl-de { background: #4d3f00; color: #ffe88a; }
.cours-points { margin: 10px 0; padding-left: 20px; }
.cours-points li { margin: 6px 0; line-height: 1.6; }

/* Encadrés colorés */
.cours-regle, .cours-astuce, .cours-attention, .cours-exemples, .zika-conseil {
  border-radius: var(--radius-sm); padding: 14px 16px; margin: 14px 0; font-size: 14.5px; line-height: 1.65;
  border-left: 5px solid var(--blue); background: var(--blue-light, #eef2ff);
}
.cours-tag { display: inline-block; font-weight: 800; font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.cours-regle { border-left-color: var(--blue); background: #eef4ff; }
.cours-regle .cours-tag { color: var(--blue); }
.cours-astuce { border-left-color: var(--green, #059669); background: #ecfdf5; }
.cours-astuce .cours-tag { color: var(--green, #059669); }
.cours-attention { border-left-color: #e11d48; background: #fff1f3; }
.cours-attention .cours-tag { color: #e11d48; }
.cours-exemples { border-left-color: #7c3aed; background: #f6f2ff; }
.cours-exemples .cours-tag { color: #7c3aed; }
[data-tg-scheme="dark"] .cours-regle { background: #11203f; }
[data-tg-scheme="dark"] .cours-astuce { background: #0f2a1d; }
[data-tg-scheme="dark"] .cours-attention { background: #2a1218; }
[data-tg-scheme="dark"] .cours-exemples, [data-tg-scheme="dark"] .zika-conseil { background: #1c1633; }

/* Exemples : phrase allemande en gras + traduction */
.cours-ex-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 6px 0; border-top: 1px solid rgba(124,58,237,.15); }
.cours-ex-row:first-of-type { border-top: none; }
.cours-ex-de { font-weight: 700; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.cours-ex-fr { color: var(--muted); font-size: 13.5px; font-style: italic; }

/* Conseil de Zika */
.zika-conseil { border-left-color: #ea580c; background: #fff7ed; }
.zika-conseil .cours-tag { color: #ea580c; }

/* Genres colorés (vocabulaire) */
.genre-legende { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.art { font-weight: 800; }
.art-der { color: #2563eb; }
.art-die { color: #db2777; }
.art-das { color: #059669; }
.voc-nom { font-weight: 700; }
.voc-card.genre-der { border-left: 4px solid #2563eb; }
.voc-card.genre-die { border-left: 4px solid #db2777; }
.voc-card.genre-das { border-left: 4px solid #059669; }
.voc-ex { font-size: 13px; color: var(--muted); margin-top: 6px; font-style: italic; }

/* Barre de progression du niveau courant */
.niveau-prog { margin-top: 10px; }

/* ===== Peaufinage design : cours pédagogiques (v2) ===== */
.lesson-section.cours { padding: 26px 24px; }
.cours-titre { display: flex; align-items: baseline; gap: 8px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }

/* Encadrés : coins plus doux, ombre légère, tag en pastille */
.cours-regle, .cours-astuce, .cours-attention, .cours-exemples, .zika-conseil {
  border-radius: 14px; box-shadow: 0 1px 2px rgba(15,23,42,.04); position: relative;
}
.cours-tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  background: rgba(255,255,255,.65); box-shadow: 0 1px 2px rgba(15,23,42,.06);
}
[data-tg-scheme="dark"] .cours-tag { background: rgba(0,0,0,.25); }

/* Exemples numérotés, présentés comme des mini-cartes */
.cours-ex-row { align-items: flex-start; gap: 10px; padding: 9px 0; }
.cours-ex-num {
  flex: none; min-width: 24px; height: 24px; border-radius: 7px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
  background: #7c3aed; color: #fff;
}
.cours-ex-body { flex: 1; min-width: 0; }
.cours-ex-de { font-size: 15.5px; }
.cours-ex-de .btn-audio { transform: translateY(1px); }

/* Tableaux de cours : en-tête coloré + lignes alternées */
.cours .table-wrap { box-shadow: 0 1px 2px rgba(15,23,42,.05); }
.cours table { width: 100%; border-collapse: collapse; font-size: 14px; }
.cours thead th { background: var(--mod-color, #2563eb); color: #fff; font-weight: 700; }
.cours tbody tr:nth-child(even) { background: rgba(37,99,235,.05); }
[data-tg-scheme="dark"] .cours tbody tr:nth-child(even) { background: rgba(255,255,255,.04); }
.cours td, .cours th { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }

/* Cartes de vocabulaire : survol + petite pastille de genre */
.voc-card { transition: transform .12s, box-shadow .12s; }
.voc-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,23,42,.08); }
.voc-de { font-size: 16px; }
.genre-legende .art { padding: 1px 8px; border-radius: 999px; background: rgba(37,99,235,.08); }
.genre-legende .art-die { background: rgba(219,39,119,.08); }
.genre-legende .art-das { background: rgba(5,150,105,.08); }

/* Section « À toi de jouer » : accent ambré */
.lesson-section.cours h2 { scroll-margin-top: 70px; }
.production-input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 12px; font: inherit; resize: vertical; }
.production-input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ===== PWA : bouton d'installation (visible si installable) ===== */
.install-btn { display: none; }
html.can-install .install-btn { display: inline-flex; }

/* ===== Tableau de bord détaillé ===== */
.exam-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .exam-stats { grid-template-columns: repeat(2, 1fr); } }
.exam-stat {
  display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; text-align: center;
}
[data-tg-scheme="dark"] .exam-stat { background: var(--card); }
.exam-stat .es-niv { font-weight: 800; font-size: 13px; color: var(--muted); }
.exam-stat .es-score { font-size: 22px; font-weight: 800; }
.exam-stat .es-etat { font-size: 11.5px; color: var(--muted); }
.exam-stat.ok { border-color: var(--green, #059669); background: #ecfdf5; }
.exam-stat.ok .es-score { color: var(--green, #059669); }
.exam-stat.part { border-color: #f59e0b; }
[data-tg-scheme="dark"] .exam-stat.ok { background: #0f2a1d; }
.stats-niv-sep {
  font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--blue); margin: 14px 0 6px; padding-top: 8px; border-top: 1px solid var(--line);
}
.stats-niv-sep:first-child { border-top: none; padding-top: 0; }

/* ===== Temps d'étude : mini-graphique 7 jours ===== */
.time-chart { display: flex; align-items: flex-end; gap: 8px; height: 132px; margin: 10px 0 4px; padding: 6px 2px; }
.tc-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; }
.tc-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.tc-bar { width: 100%; border-radius: 6px 6px 0 0; background: linear-gradient(180deg, var(--blue), var(--blue-dark)); min-height: 4px; transition: height .3s; }
.tc-bar.vide { background: var(--line); }
.tc-val { font-size: 10px; color: var(--muted); }
.tc-day { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: capitalize; }

/* ===== Lignes de réglages (thème, rappel) ===== */
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.setting-row:last-of-type { border-bottom: none; }
.setting-label { font-weight: 600; }
.setting-ctrl { display: flex; align-items: center; gap: 8px; }
.time-input { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; background: var(--card); color: var(--ink); }

/* alias de variable (compat) */
:root { --text: var(--ink); }

/* ===== Gamification : points, objectif, badges, certificats ===== */
.goal-ring { width: 84px; height: 84px; border-radius: 50%; flex: none; display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--blue) calc(var(--p,0) * 1%), var(--line) 0); }
.goal-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: var(--card); }
.goal-ring.done { background: conic-gradient(var(--green) 100%, var(--green) 0); }
.goal-inner { position: relative; text-align: center; line-height: 1.05; }
.goal-num { display: block; font-size: 22px; font-weight: 800; color: var(--ink); }
.goal-lab { font-size: 10.5px; color: var(--muted); }

.hero-gamif { display: flex; align-items: center; gap: 16px; justify-content: center; margin: 12px auto 0; max-width: 440px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; box-shadow: var(--shadow); }
.gamif-pts { text-decoration: none; color: inherit; }
.gp-pts { font-size: 21px; font-weight: 800; color: var(--ink); }
.gp-rang { font-size: 12px; font-weight: 700; color: var(--gold); background: rgba(245,158,11,.14); padding: 2px 9px; border-radius: 999px; margin-left: 4px; }
.gp-lab { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.goal-wrap { display: flex; align-items: center; gap: 16px; margin: 6px 0 14px; }
.goal-text { font-size: 14px; color: var(--muted); }

.badge-grid, .niv-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 520px) { .badge-grid, .niv-grid { grid-template-columns: repeat(2, 1fr); } }
.badge, .niv-cert { text-align: center; padding: 14px 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--card); }
.badge.off { opacity: .5; filter: grayscale(.6); }
.badge.on { border-color: var(--gold); background: linear-gradient(180deg, rgba(245,158,11,.08), var(--card)); }
.badge-ic { display: block; font-size: 30px; line-height: 1; }
.badge-t { display: block; font-weight: 800; font-size: 13px; margin-top: 4px; }
.badge-d { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.niv-cert.off { opacity: .55; }
.niv-cert.on { border-color: var(--green); background: linear-gradient(180deg, var(--green-light), var(--card)); }
.nc-medal { display: block; font-size: 26px; }
.nc-code { display: block; font-weight: 800; font-size: 18px; color: var(--ink); }
.nc-lab { display: block; font-size: 11px; color: var(--muted); }
.nc-share { margin-top: 6px; }

.share-row { display: flex; flex-wrap: wrap; gap: 10px; }
.share-row .btn { flex: 1 1 auto; }
.time-input.num { width: 84px; }
.cours-ex-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.btn-audio.small { font-size: 12px; padding: 2px 9px; }

.toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: .25s; z-index: 9999; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== Multilingue & immersion ===================== */
.lang-picker .section-title { margin-bottom: 6px; }
.lang-cur { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; font-size: 14.5px; }
.lang-cur-lab { color: var(--muted, #64748b); }
.lang-cur-val { font-weight: 700; }
.lang-search { width: 100%; padding: 11px 14px; border: 1px solid var(--border, #e2e8f0); border-radius: 12px; font-size: 15px; margin: 8px 0 12px; background: var(--card, #fff); color: inherit; }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: 348px; overflow: auto; padding: 2px; }
.lang-opt { display: flex; align-items: center; gap: 9px; padding: 11px 12px; border: 1.5px solid var(--border, #e2e8f0); border-radius: 12px; background: var(--card, #fff); cursor: pointer; font-size: 14.5px; text-align: left; color: inherit; transition: border-color .15s, transform .08s; }
.lang-opt:hover { border-color: var(--blue, #2563eb); }
.lang-opt:active { transform: scale(.98); }
.lang-opt.on { border-color: var(--blue, #2563eb); background: #eef4ff; font-weight: 700; }
[data-tg-scheme="dark"] .lang-opt.on { background: #11203f; }
.lang-flag { font-size: 20px; line-height: 1; }
.lang-name { flex: 1; }
.lang-badge { color: #059669; font-weight: 800; }

.immersion-banner { background: linear-gradient(135deg, #fff7ed, #fef3c7); border: 1px solid #fcd34d; border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-size: 14px; line-height: 1.6; }
[data-tg-scheme="dark"] .immersion-banner { background: #2a2410; border-color: #7c5e00; color: #fde68a; }

.cours-article { background: var(--card, #fff); border: 1px solid var(--border, #eef0f4); border-radius: 14px; padding: 16px 18px; margin: 14px 0 18px; }
.cours-art-titre { font-size: 16px; margin: 0 0 10px; color: var(--blue, #2563eb); }
.cours-art-p { font-size: 15.5px; line-height: 1.78; margin: 0 0 13px; }
.cours-art-p:last-child { margin-bottom: 0; }
.cours-art-p strong { color: var(--blue, #2563eb); }
.cours-art-p em, .cours-text em, .cours-tag-body em { font-style: italic; }
.cours-tag-body { font-size: 14.5px; line-height: 1.65; }

.xl-tag { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--muted, #64748b); background: rgba(100, 116, 139, .12); border-radius: 6px; padding: 1px 7px; vertical-align: middle; }

.dash-home { margin-left: auto; }
.lesson-nav-3 { flex-wrap: wrap; }

/* Sens d'écriture droite→gauche (arabe, persan, ourdou…) */
[dir="rtl"] .lang-opt, [dir="rtl"] .cours-art-p, [dir="rtl"] .cours-tag-body, [dir="rtl"] .onboarding-intro { text-align: right; }
[dir="rtl"] .cours-regle, [dir="rtl"] .cours-astuce, [dir="rtl"] .cours-attention, [dir="rtl"] .cours-exemples, [dir="rtl"] .zika-conseil { border-left: none; border-right: 5px solid var(--blue); }
[dir="rtl"] .xl-tag { margin-left: 0; margin-right: 8px; }

/* Verrou de progression : bouton « suivant » tant que la leçon n'est pas validée */
.btn.is-locked { background: var(--muted, #94a3b8) !important; box-shadow: none !important; cursor: not-allowed; opacity: .8; }
[data-tg-scheme="dark"] .btn.is-locked { background: #475569 !important; }
/* Barre « langue choisie » dans l'accueil du coach */
.onb-lang { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--card, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: 12px; padding: 8px 14px; margin-bottom: 14px; font-size: 14px; }
.lang-intro { text-align: center; padding-bottom: 4px; }
.lang-intro h1 { margin: 6px 0 0; }

/* ===================== Jeu de rôle (tuteur ↔ utilisateur) ===================== */
.rp-scene { font-weight: 700; color: var(--blue, #2563eb); margin: 2px 0 6px; }
.rp-intro { font-size: 14px; color: var(--muted, #64748b); margin: 0 0 10px; }
.rp-conv { display: flex; flex-direction: column; gap: 10px; }
.rp-row { display: flex; gap: 8px; align-items: flex-end; max-width: 94%; }
.rp-zika { align-self: flex-start; }
.rp-user { align-self: flex-end; flex-direction: row-reverse; }
.rp-av { font-size: 22px; line-height: 1; flex: 0 0 auto; }
.rp-bubble { background: var(--card, #fff); border: 1px solid var(--border, #e2e8f0); border-radius: 14px; padding: 9px 13px; font-size: 15px; line-height: 1.5; }
.rp-zika .rp-bubble { border-bottom-left-radius: 4px; }
.rp-user .rp-bubble { background: var(--blue, #2563eb); color: #fff; border-color: transparent; border-bottom-right-radius: 4px; }
.rp-de { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.rp-fr { font-size: 13px; color: var(--muted, #64748b); margin-top: 2px; }
.rp-bubble.rp-good { background: #ecfdf5; border-color: #a7f3d0; color: #065f46; }
.rp-bubble.rp-bad { background: #fff1f3; border-color: #fecdd3; color: #9f1239; }
[data-tg-scheme="dark"] .rp-bubble.rp-good { background: #0f2a1d; color: #a7f3d0; }
[data-tg-scheme="dark"] .rp-bubble.rp-bad { background: #2a1218; color: #fecdd3; }
[data-tg-scheme="dark"] .rp-bubble { background: #16202c; }
.rp-options { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 2px; }
.rp-opt { text-align: left; padding: 11px 14px; border: 1.5px solid var(--border, #e2e8f0); border-radius: 12px; background: var(--card, #fff); color: inherit; font-size: 15px; cursor: pointer; transition: border-color .15s, transform .08s; }
.rp-opt:hover { border-color: var(--blue, #2563eb); }
.rp-opt:active { transform: scale(.99); }
[dir="rtl"] .rp-user { flex-direction: row; }
[dir="rtl"] .rp-opt { text-align: right; }

/* =====================================================================
   MENU / HUB d'applications (point d'entrée : le cours = une option)
   ===================================================================== */
.menu-top { margin-bottom: 4px; }
.menu-hero { text-align: center; padding: 16px 0 4px; }
.menu-hero .coach-avatar { font-size: 2.4rem; }
.menu-hero h1 { font-size: 1.5rem; margin: 8px 0 6px; }
.menu-sub { color: var(--muted); margin: 0; }
.menu-langbar { display: flex; align-items: center; gap: 14px; margin: 16px 0 2px; padding: 14px 16px; background: var(--blue-light); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); transition: border-color .15s, transform .12s; }
.menu-langbar:hover { border-color: var(--blue); transform: translateY(-2px); }
.menu-langbar-ic { font-size: 1.6rem; flex: 0 0 auto; }
.menu-langbar-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.menu-langbar-txt strong { font-size: 1rem; }
.menu-langbar-txt span { color: var(--muted); font-size: .84rem; margin-top: 2px; }
[data-tg-scheme="dark"] .menu-langbar { background: #15263f; }
.menu-grid { display: grid; gap: 14px; margin-top: 18px; }
.menu-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); text-decoration: none; color: var(--ink);
  transition: transform .15s, box-shadow .15s, border-color .15s; position: relative;
}
a.menu-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--blue); }
a.menu-card:active { transform: translateY(-1px); }
.menu-ic {
  flex: 0 0 auto; width: 58px; height: 58px; border-radius: 14px;
  display: grid; place-items: center; font-size: 1.9rem; background: var(--blue-light);
}
.menu-card-body { flex: 1; min-width: 0; }
.menu-card-body h2 { font-size: 1.12rem; margin: 0 0 4px; }
.menu-card-body p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.4; }
.menu-go { flex: 0 0 auto; font-size: 1.4rem; color: var(--blue); font-weight: 700; }
.menu-soon { opacity: .62; }
.menu-soon .menu-ic { background: var(--line); }
.menu-badge {
  flex: 0 0 auto; font-size: .72rem; font-weight: 700; color: var(--muted);
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; white-space: nowrap;
}
.menu-prog { margin-top: 10px; }
.menu-bar { height: 7px; background: var(--line); border-radius: 999px; overflow: hidden; }
.menu-bar > span { display: block; height: 100%; background: var(--blue); border-radius: 999px; }
.menu-prog small { color: var(--muted); font-size: .78rem; display: block; margin-top: 4px; }
[data-tg-scheme="dark"] .menu-ic { background: #1e293b; }
[data-tg-scheme="dark"] .menu-soon .menu-ic { background: #1e293b; }
[data-tg-scheme="dark"] .menu-badge { background: #0b121b; }
[dir="rtl"] .menu-go { transform: scaleX(-1); }

/* =====================================================================
   DEUTSCH FÜR DIE PFLEGE — parcours soignants (programme A2 → C2)
   ===================================================================== */
.menu-lockhint { margin: 8px 0 0; font-size: .82rem; color: #b45309; font-weight: 700; }
.pflege-hero { background: linear-gradient(160deg, #0d9488, #0f766e); color: #fff; border-color: #0f766e; }
.pflege-hero .hero-eyebrow { color: rgba(255,255,255,.85); }
.pflege-hero h1 { color: #fff; }
.pflege-hero .hero-desc { color: rgba(255,255,255,.92); }
.pflege-domaines { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; }
.pflege-dom-leg { font-size: .82rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; color: var(--muted); }
.pflege-niveau { margin-top: 24px; }
.pflege-niv-titre { font-size: 1.15rem; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 2px solid #99f6e4; }
.pflege-grid { display: grid; gap: 12px; }
.pflege-card { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); position: relative; }
.pflege-ic { flex: 0 0 auto; width: 56px; height: 56px; border-radius: 12px; display: grid; place-items: center; font-size: 1.4rem; background: #ccfbf1 center/cover no-repeat; position: relative; overflow: hidden; }
.pflege-ic > span { position: absolute; right: 2px; bottom: 2px; font-size: .95rem; line-height: 1; background: rgba(255,255,255,.92); border-radius: 7px; padding: 1px 3px; }
[data-tg-scheme="dark"] .pflege-ic > span { background: rgba(23,33,43,.92); }
.pflege-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 2px; }
.pflege-exam { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 16px; border-radius: var(--radius); border: 1.5px dashed #0d9488; background: #f0fdfa; text-decoration: none; color: var(--ink); }
a.pflege-exam:hover { background: #ccfbf1; }
.pflege-exam.locked { opacity: .6; }
.pflege-exam.done { border-style: solid; background: var(--green-light); border-color: var(--green); }
.pflege-exam-ic { font-size: 1.8rem; flex: 0 0 auto; }
.pflege-exam-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pflege-exam-body strong { font-size: 1.02rem; }
.pflege-exam-body span { color: var(--muted); font-size: .88rem; margin-top: 2px; }
[data-tg-scheme="dark"] .pflege-exam { background: #0f2a28; }
[data-tg-scheme="dark"] a.pflege-exam:hover { background: #134e4a; }
.glossar-search { width: 100%; padding: 12px 14px; margin: 14px 0; border: 1.5px solid var(--line); border-radius: 12px; font-size: 1rem; background: var(--card); color: var(--ink); }
.glossar-search:focus { outline: none; border-color: #0d9488; }
.glossar-list { display: grid; gap: 10px; }
.glossar-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; box-shadow: var(--shadow); }
.glossar-row .voc-de { grid-column: 1; }
.glossar-row .voc-fr { grid-column: 1; color: var(--muted); }
.glossar-row .voc-ex { grid-column: 1 / -1; font-size: .88rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 2px; }
.glossar-niv { grid-column: 2; grid-row: 1 / 3; align-self: start; font-size: .72rem; font-weight: 700; color: #0f766e; background: #ccfbf1; border-radius: 999px; padding: 3px 9px; }
[data-tg-scheme="dark"] .glossar-niv { background: #134e4a; color: #5eead4; }
.pflege-body { flex: 1; min-width: 0; }
.pflege-de { font-weight: 700; font-size: 1.02rem; }
.pflege-fr { color: var(--muted); font-size: .92rem; margin-top: 1px; }
.pflege-desc { margin: 8px 56px 8px 0; font-size: .9rem; line-height: 1.45; }
.pflege-tag { font-size: .72rem; font-weight: 700; color: #0f766e; background: #ccfbf1; border-radius: 999px; padding: 3px 9px; }
.pflege-card .menu-badge { position: absolute; top: 14px; right: 14px; }
[data-tg-scheme="dark"] .pflege-ic { background: #134e4a; }
[data-tg-scheme="dark"] .pflege-tag { background: #134e4a; color: #5eead4; }

/* Choix de langue obligatoire : indice quand aucune langue n'est encore choisie */
.lang-required { color: var(--blue-dark); font-weight: 700; font-size: .95rem; background: var(--blue-light); border-radius: 10px; padding: 10px 14px; }
[data-tg-scheme="dark"] .lang-required { background: #15263f; color: #bfdbfe; }

/* =====================================================================
   DICTÉE (par module, adaptée au niveau)
   ===================================================================== */
.dictee-voice { display: flex; align-items: center; gap: 14px; background: var(--blue-light); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; margin-bottom: 16px; }
.dictee-play { flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; border: none; background: var(--blue); color: #fff; font-size: 1.2rem; cursor: pointer; display: grid; place-items: center; }
.dictee-play:hover { background: var(--blue-dark); }
.dictee-voice-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dictee-voice-info strong { font-size: .95rem; }
.dictee-status { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.dictee-timer { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--blue-dark); background: var(--card); border-radius: 10px; padding: 5px 10px; }
.dictee-timer.done { color: var(--red); }
.dictee-input { width: 100%; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 1rem; line-height: 1.6; background: var(--card); color: var(--ink); resize: vertical; min-height: 160px; font-family: inherit; }
.dictee-input:focus { outline: none; border-color: var(--blue); }
.dictee-actions { margin-top: 14px; }
.dictee-result { margin-top: 18px; padding: 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card); text-align: center; }
.dictee-result.pass { background: linear-gradient(180deg, var(--card), var(--green-light)); }
.dictee-result.fail { background: linear-gradient(180deg, var(--card), var(--rose)); }
.dictee-coach { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 8px; }
.coach-avatar-sm { font-size: 1.4rem; }
.dictee-feedback { text-align: left; font-size: .92rem; color: var(--ink); background: var(--bg); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.dictee-correct { text-align: left; margin-top: 10px; }
.dictee-ref { line-height: 2.1; margin-top: 6px; }
.dw { padding: 1px 3px; border-radius: 4px; }
.dw-manquant { background: var(--rose); color: #991b1b; text-decoration: line-through; }
.dw-maj { background: #fef3c7; color: #92400e; }
[data-tg-scheme="dark"] .dw-manquant { background: #3a1518; color: #fecaca; }
[data-tg-scheme="dark"] .dw-maj { background: #3a2e10; color: #fde68a; }
.dictee-card { display: flex; align-items: center; gap: 14px; margin-top: 12px; padding: 14px 16px; border-radius: 14px; border: 1.5px dashed var(--blue); background: var(--blue-light); text-decoration: none; color: var(--ink); }
a.dictee-card:hover { background: #cfe0fb; }
.dictee-card.done { border-style: solid; background: var(--green-light); border-color: var(--green); }
.dictee-card.locked { opacity: .6; }
.dictee-card-ic { font-size: 1.6rem; flex: 0 0 auto; }
.dictee-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dictee-card-body strong { font-size: 1rem; }
.dictee-card-body span { color: var(--muted); font-size: .86rem; margin-top: 2px; }
[data-tg-scheme="dark"] .dictee-voice, [data-tg-scheme="dark"] .dictee-card { background: #15263f; }
[data-tg-scheme="dark"] a.dictee-card:hover { background: #1b3157; }
[data-tg-scheme="dark"] .dictee-feedback { background: #0b121b; }

/* Sélecteur de voix allemande (audios plus naturels) */
.voice-picker { margin-top: 8px; }
.voice-row { display: flex; gap: 10px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.voice-select { flex: 1; min-width: 200px; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; font-size: .95rem; background: var(--card); color: var(--ink); }
.voice-select:focus { outline: none; border-color: var(--blue); }

/* Toggle voix naturelles (ElevenLabs) */
.voice-cloud { display: flex; align-items: center; gap: 10px; margin: 10px 0; padding: 12px 14px; background: linear-gradient(135deg, #faf5ff, #f0f9ff); border: 1px solid var(--line); border-radius: 12px; cursor: pointer; font-size: .92rem; }
.voice-cloud input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--blue); }
[data-tg-scheme="dark"] .voice-cloud { background: #1a2238; }

/* === Blocs pedagogiques de lecon (einstieg / merke / achtung / kontrast) === */
.peda-block{margin-top:16px;padding:14px 16px;border-radius:14px;border:1px solid var(--bord,#e5e7eb)}
.peda-block .cours-tag{margin-bottom:6px}
.peda-einstieg{background:rgba(37,99,235,.06);border-color:rgba(37,99,235,.22)}
.peda-question{margin-top:10px;font-weight:600;font-style:italic}
.peda-merke{background:rgba(245,158,11,.09);border-color:rgba(245,158,11,.35)}
.peda-achtung{background:rgba(220,38,38,.06);border-color:rgba(220,38,38,.28)}
.peda-achtung-item{padding:8px 0;border-top:1px solid rgba(127,127,127,.18)}
.peda-achtung-item:first-of-type{border-top:0;padding-top:2px}
.peda-err{color:#b91c1c;text-decoration:line-through;text-decoration-color:rgba(185,28,28,.45)}
.peda-ok{color:#15803d;font-weight:600;margin-top:2px}
.peda-expl{margin-top:4px;font-size:.92em;opacity:.85}
.peda-kontrast{background:rgba(16,185,129,.06);border-color:rgba(16,185,129,.26)}
.peda-kontrast-grp{margin-top:8px}
.peda-kontrast-h{margin:6px 0 2px;font-size:.95em;font-weight:700}
.peda-list{margin:6px 0 0;padding-left:20px}
.peda-list li{margin:4px 0}

/* =====================================================================
   Polish ciblé — micro-finitions cohérentes avec l'identité existante.
   ===================================================================== */
/* Interactions plus douces */
.btn { transition: background .15s, color .15s, border-color .15s, transform .12s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(29, 78, 216, .34); }
/* Cartes de leçon : léger relief au survol + états plus nets */
.lecon-card { transition: transform .18s cubic-bezier(.2, .8, .2, 1), box-shadow .18s, border-color .18s; }
.lecon-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.lecon-card.done { border-color: rgba(22, 163, 74, .40); }
.lecon-card .check { color: var(--green); }
.lecon-card.locked { opacity: .96; }
.lecon-card.locked .lock { opacity: .85; }
/* Accessibilité : focus clavier visible et cohérent */
a:focus-visible, button:focus-visible, .btn:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--blue); outline-offset: 2px;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
.section-title { letter-spacing: -.01em; }
/* Respecte la préférence système « mouvement réduit » */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  html { scroll-behavior: auto; }
}

/* =====================================================================
   Examen DELF A2 — déroulé chronométré, copie corrigée, résultats
   ===================================================================== */
.delf-timer-wrap { position: sticky; top: 6px; z-index: 20; display: flex; justify-content: center; margin: 4px 0 12px; }
.delf-timer { font-variant-numeric: tabular-nums; font-weight: 800; font-size: 1.05rem; letter-spacing: .02em; padding: 6px 16px; border-radius: 999px; background: rgba(37, 99, 235, .12); color: #2563eb; border: 1px solid rgba(37, 99, 235, .3); box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.delf-timer.warn { background: rgba(217, 119, 6, .15); color: #d97706; border-color: rgba(217, 119, 6, .4); }
.delf-timer.crit { background: rgba(220, 38, 38, .16); color: #dc2626; border-color: rgba(220, 38, 38, .45); animation: delfPulse 1s infinite; }
@keyframes delfPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.delf-docs, .delf-ee, .delf-eo, .delf-eo-prep { display: flex; flex-direction: column; gap: 14px; }
.delf-doc { background: rgba(127, 127, 127, .07); border: 1px solid rgba(127, 127, 127, .16); border-radius: 14px; padding: 14px 16px; }
.delf-doc-t { margin: 0 0 8px; font-size: 1rem; font-weight: 700; }
.delf-text { white-space: pre-wrap; line-height: 1.55; padding: 10px 12px; background: rgba(127, 127, 127, .08); border-radius: 10px; font-size: .96rem; }
.delf-q { margin-top: 12px; }
.delf-q-t { font-weight: 600; margin: 8px 0 6px; }
.delf-points { margin: 4px 0 0; padding-left: 18px; opacity: .85; font-size: .92rem; }
.delf-points li { margin: 2px 0; }
.delf-rec-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.delf-rec-status { font-size: .85rem; opacity: .8; }
.btn-mic.listening { background: #dc2626; color: #fff; }

.delf-intro-body .delf-rules { line-height: 1.55; }
.delf-rules p { margin: 10px 0; }
ul.delf-epreuves { list-style: none; padding: 0; margin: 12px 0; display: flex; flex-direction: column; gap: 6px; }
ul.delf-epreuves li { background: rgba(127, 127, 127, .08); border-radius: 10px; padding: 8px 12px; }

.delf-scorecard { text-align: center; }
.delf-gauges { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0; }
.delf-gauge { border-radius: 12px; padding: 10px 4px; border: 1px solid rgba(127, 127, 127, .2); }
.delf-gauge-n { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.delf-gauge-n span { font-size: .7rem; font-weight: 600; opacity: .7; }
.delf-gauge-l { font-size: .78rem; margin-top: 4px; opacity: .85; }
.delf-gauge.good { background: rgba(22, 163, 74, .12); border-color: rgba(22, 163, 74, .35); color: #16a34a; }
.delf-gauge.mid { background: rgba(217, 119, 6, .1); border-color: rgba(217, 119, 6, .3); color: #d97706; }
.delf-gauge.elim { background: rgba(220, 38, 38, .12); border-color: rgba(220, 38, 38, .4); color: #dc2626; }
.delf-verdict { font-size: 1.15rem; font-weight: 800; padding: 12px; border-radius: 12px; margin: 8px 0; }
.delf-verdict small { font-weight: 500; opacity: .85; }
.delf-verdict.pass { background: rgba(22, 163, 74, .14); color: #16a34a; }
.delf-verdict.fail { background: rgba(220, 38, 38, .12); color: #dc2626; }
.delf-next { opacity: .9; }

.delf-copy { margin-top: 22px; text-align: left; }
.delf-copy-h { font-size: 1.1rem; margin: 0 0 10px; }
.delf-copy-sec { margin: 16px 0; }
.delf-copy-sec h3 { font-size: .98rem; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 2px solid rgba(127, 127, 127, .2); }
.delf-copy-q { padding: 8px 10px; border-radius: 10px; margin: 6px 0; border-left: 4px solid transparent; background: rgba(127, 127, 127, .06); }
.delf-copy-q.ok { border-left-color: #16a34a; }
.delf-copy-q.ko { border-left-color: #dc2626; }
.delf-copy-q .dq { font-weight: 600; margin: 0 0 4px; }
.delf-copy-q .da { margin: 0; font-size: .92rem; }
.delf-copy-prod { margin: 8px 0; }
.delf-copy-prod .dc { font-style: italic; opacity: .8; margin: 0 0 4px; font-size: .9rem; }
.delf-copy-prod .dp { white-space: pre-wrap; background: rgba(127, 127, 127, .08); border-radius: 8px; padding: 8px 10px; }
.delf-copy-fb { margin-top: 8px; padding: 10px 12px; border-radius: 10px; background: rgba(37, 99, 235, .08); border: 1px solid rgba(37, 99, 235, .2); font-size: .92rem; line-height: 1.5; }

.examen-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 10px; }
.delf-card.pending { outline: 2px dashed rgba(217, 119, 6, .5); }
.delf-pdf-row { margin-top: 18px; }

/* Dialogue oral examinateur ↔ candidat (oral 100 % voix) */
.delf-conv { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; max-height: 44vh; overflow-y: auto; padding: 4px; }
.delf-bubble { max-width: 85%; padding: 8px 12px; border-radius: 14px; line-height: 1.4; }
.delf-bubble .delf-bubble-who { display: block; font-size: .72rem; font-weight: 700; opacity: .7; margin-bottom: 2px; }
.delf-bubble.ex { align-self: flex-start; background: rgba(37, 99, 235, .1); border: 1px solid rgba(37, 99, 235, .2); border-bottom-left-radius: 4px; }
.delf-bubble.me { align-self: flex-end; background: rgba(22, 163, 74, .12); border: 1px solid rgba(22, 163, 74, .25); border-bottom-right-radius: 4px; }
.delf-bubble-t { white-space: pre-wrap; }
.delf-typed { width: 100%; margin-top: 6px; }
.delf-dialog .delf-rec-row { margin: 6px 0; }
