/* ═══════════════════════════════════════════
   ENRICHED LESSON — Texte / Vocab / Flashcards / Fiche
   (uses tokens from style.css :root)
════════════════════════════════════════════ */
.el-tabs{display:flex;gap:6px;overflow-x:auto;margin-bottom:18px;padding-bottom:2px}
.el-tab{flex:0 0 auto;display:flex;align-items:center;gap:7px;padding:9px 14px;border:1px solid var(--border);background:var(--surface);border-radius:10px;font-size:.86rem;font-weight:600;color:var(--text-2);cursor:pointer;transition:var(--ease);white-space:nowrap}
.el-tab:hover{border-color:var(--green-mid);background:var(--green-light)}
.el-tab.active{background:var(--green);color:#fff;border-color:var(--green)}
.el-tab svg{width:16px;height:16px}
.el-panel{display:none;animation:elFade .25s ease}
.el-panel.active{display:block}
@keyframes elFade{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}
.el-hint{display:flex;align-items:center;gap:8px;color:var(--text-muted);font-size:.88rem;margin-bottom:12px}
.el-hint svg{width:16px;height:16px}

/* Texte */
.el-passage{font-family:'Amiri','Noto Sans Arabic',serif;direction:rtl;text-align:right;font-size:1.85rem;line-height:2.6;color:var(--text);padding:8px 6px;background:var(--surface);border:1px solid var(--border);border-radius:var(--r);box-shadow:var(--shadow-sm)}
.el-w{cursor:pointer;border-radius:6px;padding:0 3px;transition:background .12s}
.el-w:hover{background:var(--green-light)}
.el-w.on{background:var(--gold-mid);color:#000}
.el-gloss{position:sticky;bottom:8px;margin-top:14px;background:var(--green-dark);color:#fff;border-radius:var(--r-sm);padding:12px 16px;display:flex;align-items:center;gap:14px;min-height:54px;box-shadow:var(--shadow-md)}
.el-gloss-ar{font-family:'Amiri',serif;font-size:1.5rem;color:var(--gold-mid)}
.el-gloss-fr{font-size:1rem;font-weight:600}
.el-gloss-hint{color:rgba(255,255,255,.6);font-size:.85rem}
.el-fullfr{margin-top:12px;background:var(--green-light);border:1px dashed var(--green-mid);border-radius:var(--r-sm);padding:14px 16px;font-size:.98rem;color:var(--text-2);display:none}
.el-fullfr.show{display:block}

/* Vocab */
.el-vgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:12px}
.el-vcard{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);padding:14px;transition:var(--ease)}
.el-vcard:hover{box-shadow:var(--shadow-md);border-color:var(--green-mid)}
.el-vc-top{display:flex;justify-content:space-between;align-items:baseline;gap:8px}
.el-vc-ar{font-family:'Amiri',serif;font-size:1.7rem;color:var(--green-dark);direction:rtl}
.el-vc-fr{font-size:.95rem;font-weight:700;color:var(--text)}
.el-vc-meta{margin-top:8px;display:flex;flex-wrap:wrap;gap:6px}
.el-pill{font-size:.74rem;padding:3px 9px;border-radius:6px;font-weight:600;direction:rtl}
.el-pill.pl{background:var(--blue-light);color:var(--blue)}
.el-pill.syn{background:var(--gold-light);color:#7a5b00}
.el-vc-ex{margin-top:10px;border-top:1px dashed var(--border);padding-top:9px}
.el-vc-ex .ar{font-family:'Amiri',serif;font-size:1.15rem;color:var(--text);direction:rtl;text-align:right;display:block}
.el-vc-exfr{font-size:.82rem;color:var(--text-muted);margin-top:2px;display:block}

/* Flashcards */
#el-fc{max-width:460px;margin:0 auto}
.el-fc-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;font-size:.85rem;color:var(--text-muted)}
.el-fc-dir{display:flex;gap:6px}
.el-fc-dir button{font-size:.78rem;padding:5px 11px;border-radius:6px;border:1px solid var(--border);background:var(--surface);cursor:pointer;font-weight:600;color:var(--text-2)}
.el-fc-dir button.on{background:var(--green);color:#fff;border-color:var(--green)}
.el-flashcard{perspective:1200px;height:270px;margin-bottom:16px;cursor:pointer}
.el-fc-inner{position:relative;width:100%;height:100%;transition:transform .5s;transform-style:preserve-3d}
.el-flashcard.flip .el-fc-inner{transform:rotateY(180deg)}
.el-fc-face{position:absolute;inset:0;backface-visibility:hidden;-webkit-backface-visibility:hidden;border-radius:var(--r);box-shadow:var(--shadow-lg);display:flex;flex-direction:column;align-items:center;justify-content:center;padding:22px;text-align:center}
.el-fc-front{background:linear-gradient(135deg,var(--green-dark),var(--green));color:#fff}
.el-fc-big{font-family:'Amiri',serif;font-size:3.2rem;direction:rtl;line-height:1.3}
span.el-fc-big:not(.ar){font-family:'Inter',sans-serif;font-weight:800;font-size:2rem;direction:ltr}
.el-fc-flip{margin-top:14px;font-size:.8rem;color:rgba(255,255,255,.7);display:flex;align-items:center;gap:6px}
.el-fc-flip svg{width:15px;height:15px}
.el-fc-back{background:var(--surface);border:2px solid var(--green-mid);transform:rotateY(180deg);color:var(--text)}
.el-fc-big-fr{font-size:1.7rem;font-weight:800;color:var(--green-dark)}
.el-fc-sub{margin-top:6px;font-size:.9rem;color:var(--text-muted)}
.el-fc-sub .ar{font-family:'Amiri',serif;font-size:1.2rem}
.el-fc-ex{margin-top:14px;border-top:1px dashed var(--border);padding-top:10px;width:100%}
.el-fc-ex .ar{font-family:'Amiri',serif;font-size:1.4rem;direction:rtl;display:block}
.el-fc-exfr{font-size:.82rem;color:var(--text-muted);display:block}
.el-fc-rate{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.el-fc-rate button{padding:12px 6px;border-radius:var(--r-sm);border:none;font-weight:700;font-size:.85rem;cursor:pointer;color:#fff;display:flex;flex-direction:column;align-items:center;gap:4px}
.el-fc-rate button svg{width:20px;height:20px}
.el-fc-rate .r-no{background:var(--red)}.el-fc-rate .r-mid{background:var(--gold)}.el-fc-rate .r-ok{background:var(--green)}
.el-fc-legend{display:flex;justify-content:center;gap:16px;margin-top:14px;font-size:.78rem;color:var(--text-muted)}
.el-fc-legend span{display:flex;align-items:center;gap:5px}
.el-fc-legend .dot{width:9px;height:9px;border-radius:50%}
.el-fc-done{text-align:center;padding:30px 10px}
.el-fc-done svg{width:46px;height:46px;color:var(--gold)}
.el-fc-done h3{color:var(--green-dark);margin:8px 0}
.el-fc-done p{color:var(--text-muted);margin-bottom:16px}
.el-fc-done .btn-primary{display:inline-flex;align-items:center;gap:8px}

@media(max-width:600px){.el-passage{font-size:1.5rem;line-height:2.3}.el-fc-big{font-size:2.5rem}}

/* ═══════════ WIZARD (parcours guidé) ═══════════ */
.wz-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:14px;flex-wrap:wrap}
.wz-trail{display:flex;align-items:center;gap:0;flex:1;min-width:0;overflow-x:auto;padding:4px 0}
.wz-dot{width:34px;height:34px;border-radius:50%;border:2px solid var(--border-2);background:var(--surface);color:var(--text-faint);display:inline-flex;align-items:center;justify-content:center;cursor:pointer;flex-shrink:0;transition:var(--ease)}
.wz-dot svg{width:15px;height:15px}
.wz-dot.done{background:var(--green);border-color:var(--green);color:#fff}
.wz-dot.now{border-color:var(--green);color:var(--green);box-shadow:0 0 0 4px var(--green-light)}
.wz-dot.open:hover{border-color:var(--green-mid)}
.wz-dot.lock{opacity:.45;cursor:default}
.wz-line{width:14px;height:2px;background:var(--border-2);flex-shrink:0}
.wz-consult{font-size:.82rem;padding:8px 12px}
.wz-step-title{display:flex;align-items:baseline;gap:10px;margin-bottom:12px}
.wz-step-title h3{color:var(--green-dark);font-size:1.15rem}
.wz-step-num{font-size:.76rem;font-weight:700;color:var(--text-faint);text-transform:uppercase;letter-spacing:.04em}
.wz-body{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);box-shadow:var(--shadow);padding:20px;min-height:220px}
.wz-nav{display:flex;justify-content:space-between;gap:10px;margin-top:14px}
.wz-nav .btn-primary:disabled{opacity:.45;cursor:default}
.btn-primary,.btn-ghost{display:inline-flex;align-items:center;gap:8px;border-radius:var(--r-sm);padding:10px 16px;font-size:.88rem;font-weight:600;cursor:pointer;font-family:inherit;transition:var(--ease)}
.btn-primary{background:var(--green);color:#fff;border:none}
.btn-primary:hover:not(:disabled){background:var(--green-2)}
.btn-ghost{background:var(--surface);color:var(--text-2);border:1px solid var(--border)}
.btn-ghost:hover{border-color:var(--green-mid);background:var(--green-light)}
.btn-primary svg,.btn-ghost svg{width:16px;height:16px}

/* Exercices */
.exo-count{font-size:.78rem;font-weight:700;color:var(--text-faint);text-transform:uppercase;letter-spacing:.04em;margin-bottom:10px}
.exo-prompt{margin-bottom:6px}
.exo-prompt-ar{font-family:'Amiri',serif;direction:rtl;text-align:right;font-size:2rem;color:var(--text);display:flex;align-items:center;gap:10px;flex-direction:row-reverse;justify-content:flex-start}
.exo-prompt-fr{font-size:1.05rem;font-weight:600}
.exo-sub{font-size:.88rem;color:var(--text-muted)}
.exo-fb{margin-top:10px}
.opts{display:grid;gap:10px;margin-top:14px}
.opt{display:flex;align-items:center;gap:12px;padding:13px 15px;border:2px solid var(--border);border-radius:var(--r-sm);background:var(--surface);cursor:pointer;font-size:1rem;transition:var(--ease);text-align:left;font-family:inherit}
.opt:hover:not(:disabled){border-color:var(--green-mid);background:var(--green-light)}
.opt .let{width:26px;height:26px;border-radius:50%;background:var(--bg);display:flex;align-items:center;justify-content:center;font-weight:700;font-size:.82rem;flex-shrink:0}
.opt .ar{font-family:'Amiri',serif;font-size:1.5rem}
.opt.correct{border-color:var(--green);background:var(--green-light)}
.opt.correct .let{background:var(--green);color:#fff}
.opt.wrong{border-color:var(--red);background:var(--red-light)}
.opt.wrong .let{background:var(--red);color:#fff}
.opt:disabled{cursor:default}
.match-wrap{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.match-col{display:flex;flex-direction:column;gap:8px}
.match-item{padding:12px;border:2px solid var(--border);border-radius:var(--r-sm);cursor:pointer;text-align:center;transition:var(--ease);background:var(--surface);font-family:inherit;font-size:.95rem}
.match-item.ar{font-family:'Amiri',serif;font-size:1.5rem}
.match-item:hover:not(.done){border-color:var(--green-mid)}
.match-item.sel{border-color:var(--gold);background:var(--gold-light)}
.match-item.done{border-color:var(--green);background:var(--green-light);cursor:default;opacity:.6}
.match-item.wrong{border-color:var(--red);background:var(--red-light)}
.feedback{border-radius:var(--r-sm);padding:13px 15px;display:flex;gap:10px;font-size:.9rem;align-items:flex-start}
.feedback svg{width:18px;height:18px;flex-shrink:0;margin-top:1px}
.feedback.ok{background:var(--green-light);border:1px solid var(--green-mid);color:var(--green-dark)}
.feedback.no{background:var(--red-light);border:1px solid #fecaca;color:#991b1b}
.ex-intro{text-align:center;padding:24px 10px}
.ex-intro svg.big-ic{width:42px;height:42px;color:var(--green)}

/* Tuiles */
.tiles-slots{display:flex;flex-wrap:wrap;gap:7px;justify-content:center;margin:16px 0 12px;min-height:52px}
.tile-slot{min-width:42px;height:50px;border-bottom:3px solid var(--border-2);display:inline-flex;align-items:center;justify-content:center;font-family:'Amiri',serif;font-size:1.8rem;padding:0 4px}
.tile-slot.filled{border-bottom-color:var(--green);color:var(--green-dark)}
.tiles-bank{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:8px}
.tile{min-width:46px;height:52px;padding:0 10px;border:2px solid var(--border);border-radius:var(--r-sm);background:var(--surface);font-size:1.7rem;cursor:pointer;transition:var(--ease);display:inline-flex;align-items:center;justify-content:center}
.tile:hover:not(:disabled){border-color:var(--green-mid);background:var(--green-light)}
.tile.used{opacity:.25;cursor:default}
.tile.wrong{border-color:var(--red);background:var(--red-light);animation:tileShake .3s}
.tile.bank-word{font-size:1.35rem;height:auto;padding:8px 14px}
@keyframes tileShake{0%,100%{transform:translateX(0)}25%{transform:translateX(-4px)}75%{transform:translateX(4px)}}

/* Cloze */
.cloze-passage{font-size:1.55rem;line-height:2.4}
.cloze-blank{min-width:64px;border:none;border-bottom:3px dashed var(--gold);background:var(--gold-light);border-radius:6px 6px 0 0;font-family:'Amiri',serif;font-size:1.4rem;padding:0 10px;cursor:pointer;color:var(--text-muted)}
.cloze-blank.active{background:var(--gold-mid);color:#000}
.cloze-blank.filled{background:var(--green-light);border-bottom:3px solid var(--green);color:var(--green-dark);cursor:default}

/* Boutons audio */
.tts-btn{display:inline-flex;align-items:center;gap:6px;border:1px solid var(--border);background:var(--surface);color:var(--green);border-radius:8px;padding:5px 9px;cursor:pointer;font-size:.8rem;font-weight:600;font-family:inherit;transition:var(--ease);vertical-align:middle}
.tts-btn svg{width:15px;height:15px}
.tts-btn:hover{border-color:var(--green-mid);background:var(--green-light)}
.tts-btn.tts-playing{background:var(--green);color:#fff;border-color:var(--green)}
.tts-btn.tts-big{padding:9px 14px;font-size:.88rem;margin-bottom:12px}
.tts-btn.sm{padding:2px 6px}
.tts-btn.sm svg{width:13px;height:13px}
body.tts-off .tts-btn{display:none}

/* Flashcard : 4 notes */
.el-fc-rate{display:grid;grid-template-columns:repeat(4,1fr);gap:8px}
.el-fc-rate button{padding:11px 4px;border-radius:var(--r-sm);border:none;font-weight:700;font-size:.8rem;cursor:pointer;color:#fff;display:flex;flex-direction:column;align-items:center;gap:4px;font-family:inherit}
.el-fc-rate button svg{width:18px;height:18px}
.el-fc-rate .r-no{background:var(--red)}
.el-fc-rate .r-hard{background:#d97706}
.el-fc-rate .r-ok{background:var(--green)}
.el-fc-rate .r-easy{background:var(--green-dark)}

/* Bibliothèque (mode consultation) */
.lib-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--r);box-shadow:var(--shadow);padding:20px}
.lib-h{display:flex;align-items:center;gap:8px;color:var(--green-dark);font-size:1.02rem;margin:20px 0 10px}
.lib-h:first-child{margin-top:0}
.lib-h svg{width:16px;height:16px}

/* ═══════════ RÉVISION DU JOUR (SRS) ═══════════ */
.srs-card{background:linear-gradient(135deg,var(--green-dark),var(--green));color:#fff;border-radius:var(--r);box-shadow:var(--shadow-md);padding:16px 18px;display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:10px;flex-wrap:wrap}
.srs-card-left{display:flex;align-items:center;gap:12px;min-width:0}
.srs-icon{width:44px;height:44px;border-radius:12px;background:rgba(255,255,255,.14);display:flex;align-items:center;justify-content:center;flex-shrink:0}
.srs-icon svg{width:22px;height:22px}
.srs-icon.hot{background:var(--gold)}
.srs-card-text strong{display:block;font-size:1rem}
.srs-card-text small{color:rgba(255,255,255,.75);font-size:.83rem}
.srs-card-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.srs-card .btn-primary{background:#fff;color:var(--green-dark)}
.srs-card .btn-primary:hover{background:var(--gold-light)}
.srs-card .btn-ghost{background:rgba(255,255,255,.12);border-color:rgba(255,255,255,.25);color:#fff}
.srs-card .btn-ghost:hover{background:rgba(255,255,255,.22)}
.srs-chips{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:18px}
.srs-chip{display:inline-flex;align-items:center;gap:6px;font-size:.78rem;font-weight:600;color:var(--text-muted);background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:4px 11px}
.srs-chip svg{width:13px;height:13px}
.srs-chip.green{color:var(--green-dark);border-color:var(--green-mid);background:var(--green-light)}

#srs-overlay{position:fixed;inset:0;background:rgba(15,23,42,.55);z-index:900;display:flex;align-items:flex-start;justify-content:center;padding:24px 14px;overflow-y:auto}
.srs-panel{background:var(--bg);border-radius:var(--r);box-shadow:var(--shadow-lg);width:100%;max-width:640px;padding:18px;margin:auto 0}
.srs-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.srs-head-title{display:flex;align-items:center;gap:8px;font-weight:800;color:var(--green-dark)}
.srs-head-title svg{width:18px;height:18px}
.srs-head-count{margin-left:auto;font-size:.8rem;color:var(--text-muted)}
.srs-close{padding:6px 9px}
.srs-body{background:var(--surface);border:1px solid var(--border);border-radius:var(--r-sm);padding:18px;margin-top:12px;min-height:260px}
.srs-lesson-tag{display:flex;align-items:center;gap:6px;font-size:.75rem;color:var(--text-faint);margin-bottom:10px}
.srs-lesson-tag svg{width:13px;height:13px}
.qbar{height:7px;background:var(--border);border-radius:20px;overflow:hidden}
.qbar-fill{height:100%;background:var(--green);transition:width .3s;width:0}
.unit-review-btn{padding:5px 9px;font-size:.75rem;margin-left:8px}
.unit-review-btn svg{width:14px;height:14px}
.final-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap;margin-top:10px}
.fluency-timer{text-align:center;font-size:2rem;font-weight:800;color:var(--green-dark);margin-bottom:12px;font-variant-numeric:tabular-nums}

@media(max-width:600px){
  .wz-dot{width:30px;height:30px}
  .cloze-passage{font-size:1.3rem}
  .tile{min-width:42px;height:48px;font-size:1.5rem}
  .el-fc-rate{grid-template-columns:repeat(2,1fr)}
  .srs-card{flex-direction:column;align-items:stretch}
  .srs-card-actions{justify-content:stretch}
  .srs-card-actions .btn-primary{flex:1;justify-content:center}
}
