/* chapitre-khan.css — ESSAI (08/11/2026) : la page d'un chapitre « à la Khan Academy ».
   N'agit QUE si <body class="chap-khan"> (pour l'instant : Divisibilite7).
   Pour annuler : retirer la classe. CSS (+ chapitre-khan.js) : aucun moteur touché.

   Décision du chef (08/11) : « tenons le bâton par le milieu » — pas la liste des autres
   chapitres, mais un MENU LATÉRAL des rubriques de CE chapitre, séries PDF et banques d'abord.
   Ce que Khan fait et qu'on reprend :
   fil d'Ariane, grand titre, « N compétences », UNE rangée de carrés pour tout le chapitre,
   puis des cartes de leçon sobres. Ce que Khan n'a pas et qu'on GARDE : les séries,
   le PDF, les fiches « التمكّن », la révision — rangés en deux listes de lignes, chacune
   avec son texte explicatif, au lieu de grands carrés. */

body.chap-khan {
  --kc-ink: #0f172a; --kc-mut: #64748b; --kc-bd: #dbe3ee; --kc-acc: #0f766e; --kc-soft: #e6f4f2; --kc-blue: #0e6ea8;
}

/* ── la page : menu des chapitres (à droite en RTL) + contenu ─────────────── */
body.chap-khan .layout {
  display: grid !important; grid-template-columns: 250px minmax(0, 1fr); gap: 28px;
  max-width: 1240px; margin: 0 auto; padding: 0 16px; align-items: start;
}
body.chap-khan .layout > .main { min-width: 0; padding: 0; }

/* 23/11 (le chef) : le menu prend la hauteur de l'écran ; --kc-k (1 → 0.6) est calculé par chapitre-khan.js (« ajuste »)
   pour que tout tienne sans défilement, et réduit paddings et tailles de police en proportion. */
body.chap-khan .kc-side { position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 80px); max-height: calc(100dvh - 80px); overflow: auto; }
body.chap-khan .kc-det > summary {
  list-style: none; cursor: pointer; padding: 14px 4px 12px; font: 900 15px Cairo, sans-serif; color: var(--kc-ink);
  border-bottom: 1px solid var(--kc-bd); margin-bottom: 6px; pointer-events: none;
}
body.chap-khan .kc-det > summary::-webkit-details-marker { display: none; }
body.chap-khan .kc-side nav a {
  display: block; padding: calc(9px * var(--kc-k, 1)) 12px; border-radius: 10px; text-decoration: none; color: var(--kc-ink); font-family: Cairo, sans-serif;
}
body.chap-khan .kc-side nav a span { display: block; font-size: max(12px, calc(14.5px * var(--kc-k, 1))); font-weight: 800; line-height: calc(1.15 + 0.35 * var(--kc-k, 1)); }
/* 23/11 (le chef) : le texte sous chaque titre rallongeait le menu, « الفروض » sortait de l'écran pour certains :
   on le garde dans le DOM (source de la bulle) mais on le cache ; la bulle est posée par chapitre-khan.js (.kc-bulle). */
body.chap-khan .kc-side nav a small { display: none; }
.kc-bulle { position: fixed; z-index: 9999; max-width: 230px; padding: 7px 11px; border-radius: 9px; background: #1e293b; color: #fff;
  font: 600 12.5px/1.5 Cairo, sans-serif; direction: rtl; text-align: right; pointer-events: none; box-shadow: 0 4px 14px rgba(0,0,0,.25);
  opacity: 0; transition: opacity .12s; }
.kc-bulle.kc-vue { opacity: 1; }
body.chap-khan .kc-side nav a:hover { background: #eaeef5; }
body.chap-khan .kc-side nav a.kc-top { margin-bottom: 0; }
body.chap-khan .kc-sep .kc-sep-ico { font-size: 26px; line-height: 1; vertical-align: middle; }
body.chap-khan .kc-sep { font: 800 11px Cairo, sans-serif; color: var(--kc-mut); margin: calc(14px * var(--kc-k, 1)) 12px calc(4px * var(--kc-k, 1)); }

/* ── l'en-tête du chapitre ────────────────────────────────────────────────── */
body.chap-khan #pk-tete { margin: 0 0 18px !important; }
body.chap-khan #pk-tete .pk-card:first-child { padding: 18px 22px; }
body.chap-khan .kc-fil { font: 700 13px Cairo, sans-serif; color: var(--kc-mut); margin-bottom: 6px; }
body.chap-khan .kc-fil a { color: var(--kc-blue); text-decoration: none; }
body.chap-khan .kc-fil b { color: var(--kc-ink); }
body.chap-khan #pk-tete .pk-h1 { font-size: 34px; font-weight: 900; margin: 2px 0 4px; line-height: 1.2; }
body.chap-khan .kc-compte { font: 700 15px Cairo, sans-serif; color: var(--kc-ink); margin: 8px 0 10px; }
body.chap-khan .kc-carres { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0 0 14px; }
body.chap-khan .kc-lecon { display: inline-flex; flex-wrap: wrap; gap: 4px; }
body.chap-khan .kc-lecon .pk-sq { width: 15px; height: 15px; border-radius: 4px; }
body.chap-khan .kc-pastilles { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
body.chap-khan .kc-pastilles a {
  padding: 6px 12px; border-radius: 999px; background: #f1f5f9; border: 1px solid var(--kc-bd);
  font: 800 12.5px Cairo, sans-serif; color: var(--kc-ink); text-decoration: none;
}
body.chap-khan .kc-pastilles a:hover { background: var(--kc-soft); border-color: #a6dad3; }
body.chap-khan .kc-pastilles a small { color: var(--kc-mut); font-weight: 700; }

/* ── les rubriques du site : le MENU de gauche les porte ; ici, il ne reste que les
      accordéons (مراجعة, التمكّن, اختر لي), en LIGNES FINES, sans gros boutons ───── */
body.chap-khan .devoirs-grid { display: none !important; }     /* les liens sont dans le menu */
body.chap-khan .pt-outils-btn { margin-bottom: 14px; }
body.chap-khan .pt-plus-zone { margin: 4px 0 16px; }
body.chap-khan .pt-sous { font: 900 15px Cairo, sans-serif; color: var(--kc-ink); border-bottom: 1px solid var(--kc-bd); padding: 6px 2px 8px; margin: 0 0 10px; }
body.chap-khan #pt-muraja-plus { display: grid !important; grid-template-columns: 1fr; gap: 8px; margin: 0; }
body.chap-khan .rev-band, body.chap-khan .acc3-band, body.chap-khan .cta-choix {
  --c: #0f766e;
  display: flex !important; flex-direction: row !important; align-items: center !important; gap: 12px !important;
  box-sizing: border-box; width: 100%; min-height: 0 !important; margin: 0 !important; padding: 10px 16px !important;
  background: #fff !important; color: var(--kc-ink) !important; text-align: start !important;
  border: 1px solid var(--kc-bd) !important; border-inline-start: 6px solid var(--c) !important; border-radius: 12px !important;
  box-shadow: none !important; cursor: pointer; font-family: Cairo, sans-serif;
}
body.chap-khan .rev-band:hover, body.chap-khan .acc3-band:hover, body.chap-khan .cta-choix:hover { background: #f8fafc !important; transform: none; }
body.chap-khan .rev-band-ico, body.chap-khan .acc3-band-ico, body.chap-khan .cta-choix .cc-ico { font-size: 22px !important; }
body.chap-khan .rev-band-txt, body.chap-khan .acc3-band-txt, body.chap-khan .cta-choix .cc-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
body.chap-khan .rev-band-title, body.chap-khan .acc3-band-title, body.chap-khan .cta-choix .cc-txt b { font-size: 15px !important; font-weight: 900 !important; color: var(--kc-ink) !important; }
body.chap-khan .rev-band-sub, body.chap-khan .acc3-band-sub { font-size: 11.5px !important; font-weight: 800; color: var(--c) !important; opacity: 1 !important; margin: 0 !important; }
body.chap-khan .cta-choix .cc-txt small, body.chap-khan .mc-txt { display: none !important; }
body.chap-khan .rev-band-arrow, body.chap-khan .acc3-band-arrow { color: var(--c); font-size: 13px; }
body.chap-khan .cta-choix .cc-go { background: var(--c) !important; color: #fff !important; border-radius: 10px; padding: 5px 16px; font-weight: 900; }
body.chap-khan .rev-band { --c: #2563eb; } body.chap-khan .acc3-band { --c: #d97706; } body.chap-khan .cta-choix { --c: #0d7a86; }
body.chap-khan #pt-muraja-plus > .rev-wrap, body.chap-khan #pt-muraja-plus > .acc3-wrap { display: contents; }
body.chap-khan #pt-muraja-plus .rev-band, body.chap-khan #pt-muraja-plus .acc3-band, body.chap-khan #pt-muraja-plus > .cta-choix { grid-row: auto !important; }
body.chap-khan #pt-muraja-plus .rev-wrap > :not(.rev-band), body.chap-khan #pt-muraja-plus .acc3-wrap > :not(.acc3-band) { grid-column: 1 / -1; grid-row: auto !important; }

/* ── les trois portes : de simples ONGLETS soulignés (comme Apprendre / S'entraîner) ── */
body.chap-khan .pt-portes {
  display: flex; gap: 0; position: static; margin: 22px 0 14px; padding: 0; background: none; border-bottom: 2px solid var(--kc-bd);
}
body.chap-khan .pt-porte {
  flex: 1; flex-direction: row; justify-content: center; gap: 8px; padding: 12px 8px; border: 0; border-bottom: 4px solid transparent;
  border-radius: 0; background: none; color: var(--kc-mut); margin-bottom: -2px;
}
body.chap-khan .pt-porte b { font-size: 15px; font-weight: 900; }
body.chap-khan .pt-porte small { display: none; }
body.chap-khan .pt-porte .pt-ico { font-size: 20px; }
body.chap-khan .pt-porte.on { background: none; color: var(--kc-blue); border-bottom-color: var(--kc-blue); box-shadow: none; }

/* ── les leçons : cartes sobres ───────────────────────────────────────────── */
body.chap-khan #pk-app { display: grid; grid-template-columns: 1fr; gap: 16px; }
body.chap-khan #pk-app > section[id^="lecon-"] {
  display: grid !important; grid-template-columns: 1fr; gap: 12px; align-items: start;
  padding: 20px 22px !important; margin: 0 !important; border: 1px solid var(--kc-bd) !important;
  border-radius: 16px !important; background: #fff !important; box-shadow: none !important;
}
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-head { grid-column: 1; flex: none; gap: 14px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-ico { width: 52px; height: 52px; font-size: 28px; border-radius: 14px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-h2 { font-size: 21px; font-weight: 900; margin: 0; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-squares { display: flex; flex-wrap: wrap; gap: 5px; margin: 0; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-squares .pk-sq,
body.chap-khan #pk-app > section[id^="lecon-"] .pk-squares .pk-sq:nth-child(n+4) { display: inline-block; width: 18px; height: 18px; border-radius: 5px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn {
  display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 10px 14px; font-size: 15.5px; font-weight: 900; border-radius: 12px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn[data-toggle] {
  grid-column: 1 / -1; min-height: 0; padding: 8px 12px; font-size: 13px; font-weight: 800; border-radius: 10px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-bt-zone { grid-column: 1; flex: none; }

/* ── téléphone : le menu des chapitres se replie en tête de page ──────────── */
@media (max-width: 800px) {
  body.chap-khan .layout { grid-template-columns: 1fr; gap: 10px; padding: 0 10px; }
  body.chap-khan .kc-side { position: static; max-height: none; }
  body.chap-khan .kc-det > summary { pointer-events: auto; background: #fff; border: 1px solid var(--kc-bd); border-radius: 12px; padding: 12px 14px; margin: 8px 0; }
  body.chap-khan .kc-det > summary::after { content: " ▾"; }
  body.chap-khan .kc-det[open] > summary::after { content: " ▴"; }
  body.chap-khan #pk-tete .pk-h1 { font-size: 26px; }
    body.chap-khan #pk-app > section[id^="lecon-"] { padding: 14px !important; }
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-h2 { font-size: 18px; }
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions { grid-template-columns: 1fr; }
  body.chap-khan .pt-porte b { font-size: 13px; }
  body.chap-khan .pt-porte .pt-ico { display: none; }
  body.chap-khan .kc-lecon .pk-sq { width: 16px; height: 16px; }
}

/* ── MOBILE (le chef, 08/11 : « tout ça doit être adapté au mobile ») : rien ne dépasse de l'écran ── */
body.chap-khan { overflow-x: hidden; }
body.chap-khan .layout > *, body.chap-khan .main > * { min-width: 0; max-width: 100%; }
@media (max-width: 800px) {
  body.chap-khan .layout { padding: 0 8px; }
  body.chap-khan .kc-det > summary { display: block; font-size: 15px; }
  body.chap-khan .kc-side nav { background: #fff; border: 1px solid var(--kc-bd); border-radius: 12px; padding: 6px; margin-bottom: 8px; }
  body.chap-khan .kc-side nav a { padding: 10px 10px; }
  body.chap-khan .kc-side nav a span { font-size: 15px; }
  body.chap-khan #pk-tete .pk-card:first-child { padding: 14px 14px; }
  body.chap-khan .kc-carres { gap: 6px 12px; }
  body.chap-khan .kc-lecon { gap: 3px; }
  body.chap-khan .kc-lecon .pk-sq { width: 12px; height: 12px; border-radius: 3px; }
  body.chap-khan .kc-pastilles { gap: 6px; }
  body.chap-khan .kc-pastilles a { font-size: 12px; padding: 6px 10px; }
  body.chap-khan .pt-portes { margin: 14px 0 10px; }
  body.chap-khan .pt-porte { padding: 10px 2px; }
  body.chap-khan .pt-porte b { font-size: 12.5px; line-height: 1.25; }
  body.chap-khan .rev-band, body.chap-khan .acc3-band, body.chap-khan .cta-choix { padding: 10px 12px !important; }
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-ico { width: 42px; height: 42px; font-size: 22px; }
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-squares { gap: 4px; }
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-squares .pk-sq,
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-squares .pk-sq:nth-child(n+4) { width: 14px; height: 14px; border-radius: 4px; }
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn { min-height: 48px; font-size: 15px; }
}
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn { width: 100%; box-sizing: border-box; }
@media (max-width: 800px) {
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions { display: flex !important; flex-direction: column; gap: 8px; }
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn { width: 100% !important; flex: none; }
}

/* ── « méthode Thea » : le panneau de test d'un paragraphe de التمكّن ───────────────────── */
body.chap-khan .acc3-tbl.kc-t > :not(.acc3-tbl-h):not(.kc-test) { display: none; }
body.chap-khan .acc3-tbl.kc-t.kc-open > :not(.acc3-tbl-h):not(.kc-test) { display: revert; }
body.chap-khan .kc-test { background: #fff; padding: 14px 16px 16px; border-bottom: 1px solid var(--kc-bd); font-family: Cairo, sans-serif; }
body.chap-khan .kc-test-h b { display: block; font-size: 14px; font-weight: 800; color: var(--kc-ink); }
body.chap-khan .kc-test-h small { display: block; font-size: 12px; font-weight: 600; color: var(--kc-mut); margin-top: 2px; line-height: 1.6; }
body.chap-khan .kc-test-r { display: flex; align-items: center; gap: 12px; margin: 12px 0; flex-wrap: wrap; }
body.chap-khan .kc-test-r > span { font-size: 13.5px; font-weight: 800; color: var(--kc-ink); }
body.chap-khan .kc-chips { display: flex; gap: 8px; }
body.chap-khan .kc-chips button {
  min-width: 52px; padding: 8px 14px; border-radius: 12px; border: 2px solid var(--kc-bd); background: #f1f5f9;
  font: 900 15px Cairo, sans-serif; color: var(--kc-ink); cursor: pointer;
}
body.chap-khan .kc-chips button.on { background: #667eea; border-color: #667eea; color: #fff; }
body.chap-khan .kc-test-a { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
body.chap-khan .kc-go {
  display: inline-block; padding: 12px 26px; border-radius: 999px; background: #667eea; color: #fff; text-decoration: none;
  font: 900 15px Cairo, sans-serif;
}
body.chap-khan .kc-go.sec { background: #fff; color: #4f5fd0; border: 2px solid #667eea; padding: 10px 22px; }
body.chap-khan .kc-voir { margin-inline-start: auto; background: none; border: 0; color: var(--kc-blue); font: 800 13px Cairo, sans-serif; cursor: pointer; }
@media (max-width: 800px) {
  body.chap-khan .kc-go { flex: 1 1 100%; text-align: center; }
  body.chap-khan .kc-voir { margin-inline-start: 0; }
}
body.chap-khan .kc-sel { flex: 1; min-width: 180px; max-width: 100%; padding: 9px 12px; border: 2px solid var(--kc-bd); border-radius: 12px; background: #fff; font: 700 14px Cairo, sans-serif; color: var(--kc-ink); }
body.chap-khan .kc-rapide { border: 1px solid var(--kc-bd); border-radius: 16px; margin-bottom: 14px; }
/* titre du paragraphe / du thème PLUS GRAND que le titre du panneau de test (le chef, 08/11) */
body.chap-khan .acc3-tbl.kc-t > .acc3-tbl-h { padding-block: 11px; }
body.chap-khan .acc3-tbl.kc-t > .acc3-tbl-h > span:first-child { font-size: 18px !important; font-weight: 900 !important; line-height: 1.35; }
body.chap-khan .acc3-tbl.kc-t > .acc3-tbl-h .acc3-tbl-n { font-size: 13px !important; }
@media (max-width: 800px) { body.chap-khan .acc3-tbl.kc-t > .acc3-tbl-h > span:first-child { font-size: 16px !important; } }
/* 08/11 (le chef : « supprime ce texte ») : « السنة السابعة أساسي · وحدة » — le fil d'Ariane le dit déjà */
body.chap-khan #pk-tete .pk-kicker { display: none; }

/* ── les zones du menu, chacune sur son fond clair (le chef, 08/11) — CSS SEUL : le menu est une suite de
      séparateurs (.kc-sep, les seuls <div> de <nav>) et de liens ; chaque lien prend la couleur du DERNIER
      séparateur qui le précède (le sélecteur ~ + l'ordre des règles). Rien à changer dans le JS. ── */
body.chap-khan .kc-side nav > .kc-sep {
  margin: 10px 0 0 !important; padding: 8px 14px 2px; border-radius: 14px 14px 0 0; border: 1px solid; border-bottom: 0; }
body.chap-khan .kc-side nav > .kc-sep:first-child { margin-top: 0 !important; }
body.chap-khan .kc-side nav > a { margin: 0; border-radius: 0; border: 1px solid; border-top: 0; border-bottom: 0; }
body.chap-khan .kc-side nav > a:last-child,
body.chap-khan .kc-side nav > a:has(+ .kc-sep) { border-radius: 0 0 14px 14px; border-bottom: 1px solid; padding-bottom: 11px; }
body.chap-khan .kc-side nav > a:hover { filter: brightness(.97); }
body.chap-khan .kc-side nav > a.kc-top { box-shadow: none; }   /* la couleur de la ZONE suffit : plus de surlignage des 4 premiers */
/* 1 التعلّم : vert clair */
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(1), body.chap-khan .kc-side nav > .kc-sep:nth-of-type(1) ~ a { background: #e3f4e8 !important; border-color: #b5dec1 !important; }
/* 2 ركن الإتقان (place d'honneur, 24/11) : or clair, titre plus grand, entrées plus hautes */
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(2), body.chap-khan .kc-side nav > .kc-sep:nth-of-type(2) ~ a { background: #fffaea !important; border-color: #efdca0 !important; }
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(2) { color: #8a6a1f; }
/* 3 البنوك : lavande claire */
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(3), body.chap-khan .kc-side nav > .kc-sep:nth-of-type(3) ~ a { background: #e9e6fb !important; border-color: #c9c2f0 !important; }
/* 4 للفرض : pêche claire */
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(4), body.chap-khan .kc-side nav > .kc-sep:nth-of-type(4) ~ a { background: #fdeed9 !important; border-color: #f0d3a4 !important; }
/* 5 الأدوات : gris-bleu clair */
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(5), body.chap-khan .kc-side nav > .kc-sep:nth-of-type(5) ~ a { background: #e6eef7 !important; border-color: #c4d3e4 !important; }

/* 24/11 (le chef) : l'en-tete de chaque zone (grande icone + titre) a un fond PLUS FONCE que ses entrees : c'est un TITRE, pas un lien */
body.chap-khan .kc-side nav > .kc-sep { display: flex; align-items: center; gap: 8px; padding: 8px 14px; font-size: 14px; font-weight: 900; cursor: default; user-select: none; }
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(1) { background: #b7e0c4 !important; color: #14532d; }
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(2) { background: #f3dc8f !important; color: #713f12; }
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(3) { background: #cbc3f2 !important; color: #3b2a8c; }
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(4) { background: #f5d09a !important; color: #7c2d12; }
body.chap-khan .kc-side nav > .kc-sep:nth-of-type(5) { background: #c3d4e8 !important; color: #1e3a5f; }

/* cible d'une entree du menu : un clignotement qui montre ou l'on est arrive */
@keyframes kcflash { 0%,60% { box-shadow: 0 0 0 4px #667eea66; } 100% { box-shadow: 0 0 0 0 transparent; } }
body.chap-khan .kc-flash { animation: kcflash 1.6s ease-out; scroll-margin-top: 12px; }

/* 09/11 (le chef) : Gemini en GRAND tout en haut du menu ; les outils ont leur propre zone ; l'ancien bouton « الأدوات » disparait */
body.chap-khan .pt-outils-btn { display: none; }
body.chap-khan .kc-gemini { display: block; text-decoration: none; color: #fff; margin: 0 0 12px; padding: 16px 16px 14px; border-radius: 16px;
  background: linear-gradient(135deg, #5b7cfa, #a24df0); box-shadow: 0 6px 18px rgba(102,80,240,.28); text-align: center; }
body.chap-khan .kc-gemini b { display: block; font: 800 20px Cairo, sans-serif; }
body.chap-khan .kc-gemini small { display: block; margin-top: 4px; font: 600 13px Cairo, sans-serif; opacity: 1; color: #fff !important; -webkit-text-fill-color: #fff !important; text-shadow: 0 1px 3px rgba(40,20,120,.55); }
/* 19/11 (le chef) : « le texte en dessous est illisible » — une regle !important du site grise tous les <small> ; ici le texte reste BLANC sur le degrade */
body.chap-khan .kc-gemini b { color: #fff !important; -webkit-text-fill-color: #fff !important; }
body.chap-khan .kc-gemini:hover { filter: brightness(1.06); transform: translateY(-1px); }

/* ── cartes de leçon : plus élégantes (le chef, 09/11 : « grossière, mastok ») ───────────── */
body.chap-khan #pk-app > section[id^="lecon-"] {
  gap: 14px; padding: 22px 24px !important; border-radius: 20px !important; border: 1px solid #e3eaf3 !important;
  background: linear-gradient(180deg,#ffffff 0%,#f8fbfd 100%) !important;
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -12px rgba(15,118,110,.18) !important;
  transition: box-shadow .2s, transform .2s;
}
body.chap-khan #pk-app > section[id^="lecon-"]:hover { box-shadow: 0 2px 4px rgba(15,23,42,.05), 0 14px 32px -12px rgba(15,118,110,.28) !important; transform: translateY(-1px); }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-ico { background: linear-gradient(135deg,#e6f4f2,#d4ece8); box-shadow: inset 0 0 0 1px rgba(15,118,110,.12); }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-squares { gap: 4px; padding: 2px 0; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-squares .pk-sq,
body.chap-khan #pk-app > section[id^="lecon-"] .pk-squares .pk-sq:nth-child(n+4) { width: 14px; height: 14px; border-radius: 50%; border-width: 1.5px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions { grid-template-columns: 1.5fr 1fr; gap: 10px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn {
  min-height: 46px; padding: 8px 16px; font-size: 15px; font-weight: 800; border-radius: 999px; border: 0;
  background: linear-gradient(135deg,#14917f,#0f766e); color: #fff; box-shadow: 0 6px 14px -6px rgba(15,118,110,.55);
  transition: transform .15s, box-shadow .15s, filter .15s; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 18px -6px rgba(15,118,110,.6); filter: none; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn.sec {
  background: #e6f4f2; color: #0f766e; box-shadow: none; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn.sec:hover { background: #d4ece8; box-shadow: none; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn[data-toggle] {
  min-height: 0; padding: 7px 14px; font-size: 13px; font-weight: 700; background: transparent; color: #64748b; border: 1px dashed #cbd5e1; border-radius: 999px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn[data-toggle]:hover { color: #0f766e; border-color: #0f766e; background: #f1f8f7; }
@media (max-width: 800px) {
  body.chap-khan #pk-app > section[id^="lecon-"] { padding: 16px !important; border-radius: 16px !important; }
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn { min-height: 46px; }
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn[data-toggle] { min-height: 0 !important; }
}

/* ── en tableau : les leçons côte à côte, boutons à leur taille (le chef, 09/11) ─────────── */
@media (min-width: 801px) {
  body.chap-khan #pk-app { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
  body.chap-khan #pk-app > :not(section[id^="lecon-"]) { grid-column: 1 / -1; }
  body.chap-khan #pk-app > section[id^="lecon-"]:has(.pk-bt-zone, .pk-skills) { grid-column: 1 / -1; }
}
body.chap-khan #pk-app > section[id^="lecon-"] { padding: 18px 20px !important; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-h2 { font-size: 18px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions { display: flex !important; flex-wrap: wrap; gap: 8px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn { width: auto !important; flex: 0 0 auto; min-height: 38px; padding: 6px 16px; font-size: 14px; }
body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn[data-toggle] { padding: 5px 12px; font-size: 12.5px; }
@media (max-width: 800px) {
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions { flex-direction: row !important; }
  body.chap-khan #pk-app > section[id^="lecon-"] .pk-lesson-actions .pk-btn { width: auto !important; min-height: 40px; }
}

@media (min-width: 801px) {
  body.chap-khan #pk-app { align-items: stretch; }
  body.chap-khan #pk-app > section[id^="lecon-"] { align-content: space-between; }
}

/* ── « scène » (le chef, 09/11) : UNE rubrique à la fois, un filigrane au départ ─────────────────────────────── */
body.kc-scene .pt-portes { display: none; }
body.kc-scene .pt-plus-zone .pt-sous { display: none; }
body.kc-scene:not([data-kc="taallom"]) #pt-taallom,
body.kc-scene:not([data-kc="bahth"]) #pt-bahth,
body.kc-scene:not([data-kc="muraja"]) #pt-muraja,
body.kc-scene:not([data-kc="acc3"]) .acc3-wrap,
body.kc-scene:not([data-kc="rev"]) .rev-wrap,
body.kc-scene:not([data-kc="choix"]):not([data-kc="muraja"]) .cta-choix { display: none !important; }
body.kc-scene[data-kc] .kc-filigrane { display: none; }
body.chap-khan #kc-ancre { scroll-margin-top: 70px; }
.kc-filigrane { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px;
  min-height: 320px; margin: 18px 0; padding: 30px 16px; border: 2px dashed #d3dde9; border-radius: 22px; background: rgba(255,255,255,.55); color: #94a3b8; }
.kc-filigrane img { width: 150px; height: auto; opacity: .22; filter: grayscale(.6); }
.kc-filigrane b { font-size: 19px; font-weight: 800; color: #94a3b8; }
.kc-filigrane small { font-size: 13px; color: #b3bfce; }
body.chap-khan .kc-side nav a.kc-on { background: #e6f4f2; box-shadow: inset -3px 0 0 #0f766e; }
body.chap-khan .kc-side nav a.kc-on span { color: #0f766e; }
@media (max-width: 800px) { .kc-filigrane { min-height: 180px; padding: 18px 12px; } .kc-filigrane img { width: 96px; } .kc-filigrane b { font-size: 16px; } }

/* ── 10/11 (le chef) : DEUX menus séparés — leçon à droite, Gemini + outils à gauche (comme maths-et-tiques) ── */
body.chap-khan .layout.kc-deux { grid-template-columns: 240px minmax(0, 1fr) 220px; max-width: 1400px; }
body.chap-khan .kc-side.kc-gauche nav > .kc-sep:nth-of-type(1), body.chap-khan .kc-side.kc-gauche nav > .kc-sep:nth-of-type(1) ~ a { background: #e6eef7 !important; border-color: #c4d3e4 !important; }
body.chap-khan .kc-gauche nav > a:first-child { border-radius: 14px 14px 0 0; border-top: 1px solid #c4d3e4; }
@media (max-width: 800px) {
  body.chap-khan .layout.kc-deux { grid-template-columns: 1fr; }
  body.chap-khan .layout.kc-deux > .kc-gauche { order: 1; }
  body.chap-khan .layout.kc-deux > .main { order: 2; }
}
