/* MaYoMath — interface claire et nette (fond blanc, bleu franc, cartes), tableau quadrillé façon tablette. */
:root {
  --bg: #ffffff;
  --bg-2: #f6f8fa;
  --surface: #ffffff;
  --ink: #1f2328;
  --ink-2: #59636e;
  --ink-3: #818b98;
  --line: #d1d9e0;
  --line-2: #eef1f4;
  --blue: #1865f2;
  --blue-2: #1452c7;
  --blue-soft: #eef4ff;
  --navy: #0b2149;
  --green: #00a60e;
  --green-soft: #e6f6e7;
  --orange: #ff8a00;
  --orange-soft: #fff3e3;
  --red: #d92916;
  --purple: #6b4cd8;
  --hl-mark: rgba(24, 101, 242, .14);
  --hint-bg: #fff8e1;
  --shadow: 0 1px 0 rgba(31, 35, 40, .04);
  --radius: 6px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  --pen: "Kalam", "Comic Sans MS", cursive;
  /* tableau : identique dans les deux thèmes */
  --board: #26272a;
  --pen-white: #f3f2ee;
  --pen-yellow: #f4c542;
  --pen-blue: #8fd0ff;
  --pen-red: #ff7a6b;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0d1117; --bg-2: #151b23; --surface: #151b23;
  --ink: #f0f6fc; --ink-2: #9198a1; --ink-3: #7d8590;
  --line: #3d444d; --line-2: #262c36;
  --blue: #5b8cff; --blue-2: #7aa2ff; --blue-soft: #18233d; --navy: #0d1630;
  --green: #3ccf4e; --green-soft: #15291a; --orange: #ffa53d; --orange-soft: #2c2214; --red: #ff6b5b; --purple: #9b85ff;
  --hl-mark: rgba(91, 140, 255, .22); --hint-bg: #2a2614;
  --shadow: none;
  --board: #1f2023;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 16px; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; cursor: pointer; color: inherit; }
img { max-width: 100%; }
::selection { background: var(--hl-mark); }
h1, h2, h3 { letter-spacing: -.01em; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- Commun ---------- */
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; letter-spacing: -.02em; text-decoration: none; color: var(--navy); }
:root[data-theme="dark"] .logo { color: var(--ink); }
.logo-dot { width: 26px; height: 26px; border-radius: 7px; background: var(--blue); position: relative; flex: none; }
.logo-dot::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 6px; height: 3px; border-radius: 2px; background: #fff; box-shadow: 0 -6px 0 rgba(255, 255, 255, .55); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 7px 16px; border-radius: 6px; border: 1px solid var(--blue); background: var(--blue); color: #fff; font-weight: 600; font-size: 15px; text-decoration: none; line-height: 1.2; transition: background .12s, box-shadow .12s, border-color .12s; }
.btn:hover { background: var(--blue-2); border-color: var(--blue-2); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--blue); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: var(--surface); color: var(--blue); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--blue); background: var(--blue-soft); }
.btn.yellow { background: var(--green); border-color: var(--green); color: #fff; }
.btn.yellow:hover { filter: brightness(.93); }
.btn.small { min-height: 32px; padding: 5px 12px; font-size: 14px; }
.btn.big { min-height: 44px; padding: 10px 20px; font-size: 16px; }
.btn.light { background: #fff; color: var(--navy); border-color: #fff; }
.btn.light:hover { background: #e9efff; }
.btn.outline-light { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); }
.btn.outline-light:hover { background: rgba(255, 255, 255, .1); }
.link-plain { font-weight: 700; color: var(--blue); text-decoration: none; }
.link-plain:hover { text-decoration: underline; }
.eyebrow { font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--blue); margin: 0 0 10px; }
.muted { color: var(--ink-2); font-size: 15px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.badge.ok { background: var(--green-soft); color: var(--green); }

.theme-toggle { width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); display: inline-grid; place-items: center; padding: 0; flex: none; }
.theme-toggle:hover { border-color: var(--blue); color: var(--blue); }
:root[data-theme="dark"] .theme-toggle .i-moon, :root:not([data-theme="dark"]) .theme-toggle .i-sun { display: none; }

/* ---------- Landing ---------- */
.top { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(180%) blur(8px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1160px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 32px; }
.top-links { display: flex; gap: 22px; flex: 1; }
.top-links a { text-decoration: none; color: var(--ink); font-weight: 500; font-size: 14px; }
.top-links a:hover { color: var(--blue); }
.top-actions { display: flex; align-items: center; gap: 14px; font-size: 14px; }
.link-arrow { font-weight: 600; color: var(--blue); text-decoration: none; }
.link-arrow::after { content: " →"; transition: margin .15s; }
.link-arrow:hover::after { margin-left: 3px; }

.hero { padding: 72px 0 0; border-bottom: 1px solid var(--line); background: var(--bg); overflow: hidden; }
.hero h1 { font-weight: 600; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.1; letter-spacing: -.025em; margin: 0 0 18px; max-width: 880px; }
.hero .lead { font-size: 19px; line-height: 1.55; color: var(--ink-2); max-width: 720px; margin: 0 0 28px; }
.hero-ctas { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }

/* aperçu du produit (reproduction fidèle de l'appli) */
.product { margin: 56px 0 -1px; border: 1px solid var(--line); border-bottom: 0; border-radius: 12px 12px 0 0; background: var(--bg-2); overflow: hidden; box-shadow: 0 -20px 60px -40px rgba(31, 35, 40, .35); }
.p-top { display: flex; align-items: center; gap: 18px; padding: 10px 16px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 13px; }
.p-logo { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; }
.p-logo .logo-dot { width: 18px; height: 18px; border-radius: 5px; }
.p-logo .logo-dot::after { left: 4px; right: 4px; bottom: 4px; height: 2px; box-shadow: 0 -4px 0 rgba(255,255,255,.55); }
.p-crumbs { color: var(--ink-2); flex: 1; }
.p-crumbs i { font-style: normal; color: var(--ink-3); margin: 0 4px; }
.p-crumbs b { color: var(--ink); font-weight: 600; }
.p-user { font-weight: 600; color: var(--ink-2); }
.p-body { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 16px; padding: 16px; }
.p-main { display: grid; gap: 12px; min-width: 0; }
.p-board, .mini-board, .board-scroll {
  background-color: var(--board);   /* tableau uni, sans carreaux (fondatrice, 8 nov. 2026) */
}
.p-board { position: relative; border-radius: 10px; padding: 18px 22px 58px; font-family: var(--pen); font-weight: 300; color: var(--pen-white); font-size: 21px; line-height: 1.3; }
.p-board .c { margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-board .c-title { display: inline-block; font-size: 1.15em; border-bottom: 2px solid var(--pen-yellow); margin-bottom: 10px; }
.p-board .c-y { color: var(--pen-yellow); }
/* puce des étapes : une goutte (celle du logo), à la craie jaune */
.p-board .c-step::before { content: ""; display: inline-block; width: .42em; height: .42em; margin: 0 .5em .12em .12em; background: var(--pen-yellow); border-radius: 0 50% 50% 50%; transform: rotate(45deg); vertical-align: middle; }
.p-board .c-f { text-align: center; }
.p-board .c-box { display: table; margin: 4px auto 0; border: 2px solid var(--pen-yellow); border-radius: 16px 10px 18px 9px; padding: 0 14px; }
.p-board .katex { font-size: .84em; }
.p-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 6px; align-items: center; padding: 8px 10px; background: rgba(22,23,25,.92); border-top: 1px solid #3b3c41; border-radius: 0 0 10px 10px; font-family: var(--font); }
.pb { min-width: 30px; height: 26px; border-radius: 5px; background: #34353a; border: 1px solid #4a4b51; color: #ddd; font-size: 11px; display: grid; place-items: center; padding: 0 8px; }
.p-speak { margin-left: auto; color: #bdbdbd; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.p-speak i { width: 7px; height: 7px; border-radius: 50%; background: var(--pen-yellow); box-shadow: 0 0 0 4px rgba(244,197,66,.2); }
.p-dock { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.p-dock-h { font-weight: 600; margin-bottom: 10px; }
.p-line { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px; margin-bottom: 6px; font-size: 16px; background: var(--bg); }
.p-line span { font-size: 11px; font-weight: 600; color: var(--ink-3); }
.p-line.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--hl-mark); }
.p-actions { display: flex; gap: 8px; margin-top: 10px; }
.pbtn { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 5px; background: var(--blue); color: #fff; }
.pbtn.ghost { background: var(--bg); color: var(--blue); border: 1px solid var(--line); }
.p-side { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; align-self: start; font-size: 13px; }
.p-side-h { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin-bottom: 8px; }
.p-side-h.sep { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.p-notion { display: flex; gap: 9px; padding: 8px; border-radius: 6px; border: 1px solid transparent; margin-bottom: 2px; }
.p-notion.on { background: var(--blue-soft); border-color: var(--blue); }
.p-notion b { display: block; font-weight: 600; font-size: 13px; }
.p-notion span { color: var(--ink-3); font-size: 12px; }
.p-notion .mlvl { margin-top: 2px; }
.p-lv { display: flex; gap: 4px; margin: 4px 0 6px; }
.p-lv i { flex: 1; height: 8px; border-radius: 3px; background: var(--line-2); }
.p-lv i.on { background: var(--blue); }
.p-small { color: var(--ink-3); font-size: 12px; }
.caret { display: inline-block; width: 2px; height: 18px; background: var(--blue); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.section { padding: 88px 0; }
.section.alt { background: var(--bg-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-head { margin-bottom: 36px; }
.section h2, .final h2 { font-weight: 600; font-size: clamp(26px, 3vw, 36px); line-height: 1.2; letter-spacing: -.02em; margin: 0 0 10px; }
.sec-head p, .final p { color: var(--ink-2); font-size: 17px; margin: 0; }
.body { color: var(--ink-2); font-size: 17px; line-height: 1.6; margin: 0 0 16px; max-width: 520px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; }

/* programme : chapitres par classe */
.cycle { font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); margin: 0 0 12px; }
.courses { display: grid; gap: 16px; margin-bottom: 36px; }
.courses.c4 { grid-template-columns: repeat(4, 1fr); }
.courses.c3 { grid-template-columns: repeat(3, 1fr); margin-bottom: 0; }
.course { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.course h4 { margin: 0; padding: 12px 16px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--line); background: var(--bg-2); }
.course h4 span { font-weight: 400; color: var(--ink-3); font-size: 13px; margin-left: 4px; }
.course ul { list-style: none; margin: 0; padding: 8px 0; }
.course a { display: block; padding: 6px 16px; font-size: 14.5px; color: var(--ink); text-decoration: none; }
.course a:hover { color: var(--blue); background: var(--bg-2); }
.course em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--green); background: var(--green-soft); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: 1px; }

/* onglets : déroulé d'une leçon */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 32px; overflow-x: auto; scrollbar-width: none; }
.tab { border: 0; background: none; padding: 10px 14px; font-size: 15px; font-weight: 500; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--blue); }
.panel { display: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 56px; align-items: center; min-height: 300px; }
.panel.on { display: grid; }
.panel-text h3 { font-size: 22px; font-weight: 600; margin: 0 0 12px; letter-spacing: -.01em; }
.panel-text p { color: var(--ink-2); font-size: 16.5px; line-height: 1.6; margin: 0 0 12px; }
.panel-text .small { font-size: 14px; color: var(--ink-3); }
.mini-board { border-radius: 10px; padding: 22px 26px; color: var(--pen-white); font-family: var(--pen); font-weight: 300; font-size: 23px; line-height: 1.3; min-height: 250px; }
.mini-board .l { margin-bottom: 8px; }
.mini-board .l.t { display: inline-block; border-bottom: 2px solid var(--pen-yellow); font-size: 1.12em; margin-bottom: 12px; }
.mini-board .l.y { color: var(--pen-yellow); }
.mini-board .l.b { color: var(--pen-blue); }
.mini-board .l.f { text-align: center; }
.mini-board .l.box { display: table; margin: 6px auto 0; border: 2px solid var(--pen-yellow); border-radius: 18px 12px 20px 10px; padding: 0 16px; }
.mini-board .katex { font-size: .84em; }
.mode-field { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.mf-line { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 5px; padding: 9px 12px; margin-bottom: 8px; font-size: 19px; background: var(--bg); }
.mf-line span { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.mf-line.on { border-color: var(--blue); box-shadow: 0 0 0 3px var(--hl-mark); }
.mf-keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 14px; }
.mf-keys b { font-weight: 400; border: 1px solid var(--line); border-radius: 5px; background: var(--bg-2); height: 40px; display: grid; place-items: center; font-size: 15px; }
.result-card, .levels-card, .progress-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.rc-score { padding: 12px 14px; border-radius: 6px; font-size: 15px; color: var(--ink-2); margin-bottom: 12px; }
.rc-score.ko { background: var(--orange-soft); }
.rc-score b { font-size: 28px; color: var(--orange); font-weight: 700; }
.rc-score span { display: block; color: var(--ink); font-weight: 600; margin-top: 4px; }
.rc-err, .rc-ok { padding: 10px 12px; border-radius: 5px; background: var(--bg-2); margin-top: 8px; font-size: 14.5px; }
.rc-err { border-left: 3px solid var(--red); }
.rc-ok { border-left: 3px solid var(--green); }
.rc-err b, .rc-ok b { display: block; font-weight: 600; }
.rc-err span, .rc-ok span { color: var(--ink-2); }
.lc-row { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 14px; padding: 9px 4px; font-size: 14.5px; color: var(--ink-2); }
.lc-row + .lc-row { border-top: 1px solid var(--line-2); }
.lc-row.cur { color: var(--ink); font-weight: 600; }
.lc-row i { height: 8px; border-radius: 4px; background: var(--line-2); position: relative; overflow: hidden; }
.lc-row i.done { background: var(--blue); }
.lc-row i.half::after { content: ""; position: absolute; inset: 0 45% 0 0; background: var(--blue); border-radius: 4px; }

/* suivi des progrès */
.pc-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.pc-h b { font-weight: 600; }
.pc-h span { color: var(--ink-3); font-size: 13px; }
.pc-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; font-size: 15px; }
.pc-row + .pc-row { border-top: 1px solid var(--line-2); }
.pc-row span { flex: 1; }
.pc-row em { font-style: normal; color: var(--ink-3); font-size: 13px; }
.pc-err { margin: 10px 0 14px; padding: 10px 12px; border-radius: 5px; background: var(--bg-2); border-left: 3px solid var(--orange); font-size: 14px; }
.pc-err b { display: block; font-weight: 600; }
.pc-err span { color: var(--ink-2); }

.final { padding: 72px 0; border-top: 1px solid var(--line); }
.final-in { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.foot { border-top: 1px solid var(--line); background: var(--bg-2); padding: 48px 0 24px; font-size: 14px; color: var(--ink-2); }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.foot-brand p { margin: 10px 0 0; max-width: 280px; }
.foot h4 { font-size: 13px; font-weight: 600; color: var(--ink); margin: 4px 0 10px; }
.foot-grid a { display: block; text-decoration: none; color: var(--ink-2); margin-bottom: 8px; }
.foot-grid a:hover { color: var(--blue); }
.foot-bottom { display: flex; justify-content: space-between; margin-top: 32px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }
.foot .logo { font-size: 17px; }
.foot .logo-dot { width: 20px; height: 20px; border-radius: 5px; }
.foot .logo-dot::after { left: 4px; right: 4px; bottom: 4px; height: 2px; box-shadow: 0 -4px 0 rgba(255,255,255,.55); }

/* ---------- App : barre du haut ---------- */
.app-body { background: var(--bg-2); min-height: 100vh; }
.topbar { display: flex; align-items: center; gap: 18px; padding: 10px 22px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.crumbs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); flex: 1; }
.crumbs b { color: var(--ink); font-weight: 700; }
.crumbs .sep { color: var(--ink-3); }
.demo-pill { font-size: 12px; font-weight: 700; color: var(--orange); background: var(--orange-soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.who { font-size: 14px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.guest-bar { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 10px 20px; background: var(--blue-soft); color: var(--ink); font-size: 15px; border-bottom: 1px solid var(--line); text-align: center; }

/* ---------- App : choix ---------- */
.setup { max-width: 860px; margin: 0 auto; padding: 44px 24px 80px; }
.setup h1 { font-weight: 600; font-size: clamp(28px, 3.6vw, 38px); line-height: 1.15; margin: 0 0 8px; }
.setup .sub { color: var(--ink-2); margin: 0 0 28px; font-size: 17px; }
.setup .hint { margin-bottom: 26px; }
.field { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 16px; box-shadow: var(--shadow); }
.field > label { display: block; margin-bottom: 12px; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lv-groups { display: flex; flex-direction: column; gap: 18px; }
.lv-cycle { margin: 0 0 8px; font-size: 13px; font-weight: 700; color: var(--blue); }
.chip { padding: 9px 15px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 15px; color: var(--ink); transition: border-color .1s, background .1s; }
.chip:hover { border-color: var(--blue); color: var(--blue); }
.chip.soon { cursor: default; color: var(--ink-3); background: var(--bg-2); border-style: dashed; display: inline-flex; align-items: center; gap: 8px; }
.chip.soon:hover { border-color: var(--line); color: var(--ink-3); }
.chip.soon em { font-style: normal; font-size: 11px; font-weight: 600; color: var(--ink-3); }
.chip.on { background: var(--blue-soft); color: var(--blue); border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.input { width: 100%; padding: 10px 12px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 16px; color: var(--ink); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--hl-mark); }
textarea.input { resize: vertical; min-height: 70px; }

/* ---------- App : studio ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; padding: 22px; max-width: 1400px; margin: 0 auto; }
.board-wrap { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.board { position: relative; border-radius: 12px; box-shadow: 0 18px 40px -26px rgba(11, 33, 73, .6); height: min(64vh, 640px); min-height: 380px; display: flex; flex-direction: column; overflow: hidden; background: var(--board); }
.board-scroll { flex: 1; overflow-y: auto; padding: 30px 38px 84px; scroll-behavior: smooth; background-attachment: local; }
.board-scroll::-webkit-scrollbar { width: 8px; } .board-scroll::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 8px; }
.chalk { font-family: var(--pen); font-weight: 300; color: var(--pen-white); font-size: clamp(22px, 2.3vw, 30px); line-height: 1.25; margin: 0 0 12px; clip-path: inset(0 100% 0 0); cursor: pointer; }
.chalk.done { clip-path: none; }
.paused .chalk.writing { animation-play-state: paused; }
/* construction faite devant l'élève : chaque partie de la figure apparaît quand la voix en parle */
.k-fig [data-ph] { transition: opacity .45s ease; }
/* rapporteur au tableau */
.protr-body { fill: rgba(140, 190, 255, .10); stroke: var(--pen-blue); stroke-width: 1.6; }
.protr-tick { stroke: var(--pen-blue); stroke-width: 1; }
.protr-num { fill: var(--pen-blue); font-size: 10px; font-family: system-ui, sans-serif; }
.protr-num.out { opacity: .55; font-size: 9px; }
.protr-centre { fill: var(--pen-yellow); }
.sq-body { fill: rgba(255, 196, 120, .16); stroke: #ffb35c; stroke-width: 1.6; }
.sq-tick { stroke: #ffb35c; stroke-width: 1; }
/* caché jusqu'à sa phase : « visibility » cache aussi le nom écrit en KaTeX (bloc HTML), que l'opacité ne cache pas toujours */
.k-fig [data-wait], .k-fig [data-wait] * { opacity: 0; visibility: hidden; }
   /* bouton pause : la craie s'arrête */
.chalk.writing { animation: chalkwrite var(--dur, 1.5s) linear forwards; }
@keyframes chalkwrite { to { clip-path: inset(0 0 0 0); } }
.chalk:hover { opacity: .85; }
.chalk.k-title { display: table; font-size: clamp(27px, 2.8vw, 36px); border-bottom: 2.5px solid var(--pen-yellow); padding-bottom: 2px; margin-bottom: 18px; }
.chalk.k-question { color: var(--pen-yellow); }
.chalk.k-formula { text-align: center; font-size: clamp(24px, 2.5vw, 31px); padding: 8px 0; }
.chalk.k-highlight { display: table; margin: 10px auto 18px; border: 2.5px solid var(--pen-yellow); border-radius: 22px 14px 24px 12px; padding: 4px 20px; }
.chalk.k-step::before { content: ""; display: inline-block; width: .42em; height: .42em; margin: 0 .5em .12em .12em; background: var(--pen-yellow); border-radius: 0 50% 50% 50%; transform: rotate(45deg); vertical-align: middle; }
.chalk.k-statement { border: 1.5px solid rgba(255,255,255,.3); border-radius: 10px; padding: 10px 14px; font-size: clamp(21px, 2.1vw, 27px); }
.chalk.k-statement::before { content: "Énoncé : "; color: var(--pen-yellow); }
.chalk.k-error { color: var(--pen-red); }
.chalk.k-student { color: var(--pen-blue); font-size: clamp(21px, 2.1vw, 27px); }
.chalk.k-student { padding-left: 18px; border-left: 2px solid rgba(143, 208, 255, .45); margin-bottom: 6px; }
.chalk.k-label { font-family: var(--font); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .55); margin: 14px 0 6px; }
.chalk .katex { font-size: .86em; color: inherit; }
.board-empty { color: rgba(255,255,255,.5); font-family: var(--pen); font-size: 25px; }
.board-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(22, 23, 25, .92); border-top: 1px solid #3b3c41; }
.ctrl { width: 38px; height: 34px; border-radius: 6px; border: 1px solid #4a4b51; background: #34353a; color: #eee; display: grid; place-items: center; font-size: 14px; }
.ctrl:hover { background: #44454b; }
.ctrl.off { opacity: .45; }
.speed { color: #e6e6e6; font-size: 13px; font-weight: 700; background: #34353a; border: 1px solid #4a4b51; border-radius: 6px; padding: 8px 12px; white-space: nowrap; }
.speed:hover { background: #44454b; }
.tutor-face { margin-left: auto; display: flex; align-items: center; gap: 8px; color: #bdbdbd; font-size: 13px; font-weight: 700; }
.tutor-face .av { width: 9px; height: 9px; border-radius: 50%; background: #55565c; font-size: 0; }
.speaking .av { background: var(--pen-yellow); animation: talk .7s infinite alternate; }
@keyframes talk { from { box-shadow: 0 0 0 0 rgba(244,197,66,.6); } to { box-shadow: 0 0 0 6px rgba(244,197,66,0); } }

.dock { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.dock h3 { margin: 0 0 8px; font-weight: 600; font-size: 20px; line-height: 1.3; }
.dock .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.loading { display: flex; align-items: center; gap: 12px; color: var(--ink-2); }
.dots span { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--blue); margin-right: 4px; animation: dot 1s infinite; }
.dots span:nth-child(2) { animation-delay: .15s; } .dots span:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .35; } 50% { transform: translateY(-4px); opacity: 1; } }

.score { display: flex; align-items: center; gap: 18px; padding: 14px 16px; border-radius: var(--radius); }
.score.ok { background: var(--green-soft); }
.score.ko { background: var(--orange-soft); }
.score .num { font-size: 34px; font-weight: 600; line-height: 1; white-space: nowrap; }
.score.ok .num { color: var(--green); }
.score.ko .num { color: var(--orange); }
.score .num small { font-size: 16px !important; color: var(--ink-2); font-weight: 700; }
.score b { font-size: 17px; }
.err-list { margin: 14px 0 0; padding: 0; list-style: none; }
.err-list li { margin-bottom: 10px; padding: 10px 14px; border-radius: 4px; background: var(--bg-2); border-left: 4px solid var(--red); }
.err-list small { color: var(--ink-2); display: block; font-size: 15px; margin-top: 2px; }
.strength { margin: 12px 0 0; padding: 10px 14px; border-radius: 4px; background: var(--bg-2); border-left: 4px solid var(--green); }
.hint { background: var(--hint-bg); border-radius: 4px; border-left: 4px solid #f2b400; padding: 10px 14px; margin-top: 12px; font-size: 15px; }

/* barre latérale : notions + maîtrise */
.side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; align-self: start; position: sticky; top: 76px; box-shadow: var(--shadow); }
.side h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.m-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--ink-2); margin-bottom: 10px; }
.m-legend span { display: inline-flex; align-items: center; gap: 5px; }
.mlvl { display: inline-block; width: 14px; height: 14px; border-radius: 3px; flex: none; border: 1.5px solid var(--line); background: var(--surface); }
.mlvl.m1 { border-color: #c8b9f5; background: #f3effe; }
.mlvl.m2 { border-color: #a58cf0; background: #d9cdfb; }
.mlvl.m3 { border-color: #7b5be0; background: #9d84f0; }
.mlvl.m4 { border-color: var(--purple); background: var(--purple); }
.notion { width: 100%; text-align: left; border: 1px solid transparent; border-radius: 6px; background: transparent; padding: 10px 10px; margin-bottom: 4px; transition: background .1s; }
.notion:hover { background: var(--bg-2); }
.notion.active { background: var(--blue-soft); border-color: var(--blue); }
.notion .t { font-weight: 700; font-size: 15px; line-height: 1.3; display: flex; gap: 9px; align-items: flex-start; }
.notion .t .mlvl { margin-top: 2px; }
.notion .s { font-size: 13.5px; color: var(--ink-2); margin: 4px 0 0 23px; }
.bar { height: 6px; border-radius: 3px; background: var(--line-2); margin: 8px 0 0 23px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--purple); border-radius: 3px; transition: width .6s; }
.m-txt { font-size: 12px; color: var(--ink-3); margin: 4px 0 0 23px; font-weight: 700; }
/* sous le tableau : documents du chapitre et révision, en grille */
.lesson-docs { margin-top: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.lesson-docs h4 { margin: 0 0 10px; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); }
.lesson-docs .docs { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.lesson-docs .docs:last-child { margin-bottom: 0; }
.side .ex-block { margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.lvl-dots { display: flex; gap: 4px; margin: 8px 0; }
.lvl-dots i { flex: 1; height: 10px; border-radius: 3px; background: var(--line-2); }
.lvl-dots i.on { background: var(--blue); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 6px; font-size: 15px; z-index: 50; max-width: calc(100% - 32px); box-shadow: var(--shadow); }

/* ---------- Éditeur mathématique ---------- */
.seg { display: flex; margin: 6px 0 18px; border-bottom: 1px solid var(--line); gap: 18px; flex-wrap: wrap; }
.seg button { border: 0; border-bottom: 3px solid transparent; background: transparent; padding: 8px 2px; margin-bottom: -1px; font-weight: 700; color: var(--ink-2); }
.seg button.on { color: var(--blue); border-bottom-color: var(--blue); }
.seg button:not(.on):hover { color: var(--ink); }
.me { display: flex; flex-direction: column; gap: 10px; }
.me-lines { display: flex; flex-direction: column; gap: 8px; }
.me-lines:empty { display: none; }
.me-line { display: grid; grid-template-columns: 24px minmax(0, 1fr) 34px; align-items: center; gap: 8px; }
.me-n { font-size: 13px; font-weight: 700; color: var(--ink-3); text-align: center; }
.me-del { width: 34px; height: 34px; border-radius: 4px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: 18px; line-height: 1; }
.me-del:hover { border-color: var(--red); color: var(--red); }
math-field { display: block; width: 100%; color: var(--ink); font-size: 22px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); --caret-color: var(--blue); --selection-background-color: var(--hl-mark); --contains-highlight-background-color: var(--blue-soft); --primary: var(--blue); --placeholder-color: var(--blue); }
math-field:focus-within { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--hl-mark); }
math-field::part(menu-toggle) { display: none; }
.me-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.palette { border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); padding: 10px; }
.pal-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: thin; }
.pal-tab { flex: none; border: 0; border-radius: 999px; background: transparent; padding: 5px 12px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.pal-tab:hover { color: var(--blue); }
.pal-tab.on { background: var(--blue); color: #fff; }
.pal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.pal-btn { height: 44px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 4px; font-size: 17px; display: grid; place-items: center; padding: 0 4px; overflow: hidden; }
.pal-btn:hover { border-color: var(--blue); background: var(--blue-soft); }
.pal-btn:active { transform: translateY(1px); }
kbd { font: 12px var(--font); font-weight: 700; background: var(--bg-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 3px; padding: 1px 5px; }

/* ---------- Connexion ---------- */
.auth { min-height: calc(100vh - 58px); display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: min(430px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px 28px 24px; box-shadow: var(--shadow); }
.auth-pen { font-weight: 600; font-size: 26px; line-height: 1.2; color: var(--ink); margin: 0 0 12px; }
.f { display: block; margin-bottom: 16px; }
.f > span:first-child { display: block; font-size: 14px; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.f small { display: block; margin-top: 6px; }
.pw { position: relative; display: block; }
.pw .input { padding-right: 90px; }
.pw-eye { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 14px; font-weight: 700; color: var(--blue); padding: 6px; }
.auth-err { color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); border-radius: 4px; padding: 8px 12px; margin: 0 0 14px; font-size: 15px; }
.auth-switch { margin: 18px 0 0; text-align: center; }
.auth-switch a { color: var(--blue); font-weight: 700; }
.auth-or { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 13px; margin: 18px 0 14px; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .split, .panel.on { grid-template-columns: 1fr; gap: 32px; }
  .courses.c4, .courses.c3 { grid-template-columns: 1fr 1fr; }
  .p-body { grid-template-columns: 1fr; }
  .p-side { display: none; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .studio { grid-template-columns: minmax(0, 1fr) 270px; gap: 14px; padding: 14px; }
  .top-links { display: none; }
  .top-in { justify-content: space-between; }
}
@media (max-width: 760px) {
  .studio { grid-template-columns: 1fr; }
  .side { position: static; }
}
@media (max-width: 560px) {
  .wrap, .top-in { padding-left: 16px; padding-right: 16px; }
  .top-actions { gap: 10px; }
  .link-plain#nav-login { display: none; }
  .hero { padding-top: 44px; }
  .product { margin-top: 36px; }
  .p-top .p-crumbs, .p-user { display: none; }
  .p-board { font-size: 17px; padding: 14px 14px 52px; }
  .mini-board { font-size: 19px; padding: 18px; min-height: 0; }
  .section { padding: 60px 0; }
  .courses.c4, .courses.c3 { grid-template-columns: 1fr; }
  .lc-row { grid-template-columns: 110px 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .who, .topbar .crumbs { display: none; }
  .topbar { gap: 10px; padding: 10px 12px; }
  .topbar .logo { margin-right: auto; }
  .board { height: 58vh; }
  .board-scroll { padding: 22px 20px 72px; }
  .chalk { font-size: 22px; }
  .chalk.k-title { font-size: 26px; }
  .tutor-face { display: none; }
  .board-bar { gap: 6px; padding: 8px 10px; }
  .ctrl { width: 34px; height: 32px; }
  .speed { padding: 6px 7px; font-size: 11.5px; }
  .dock { padding: 16px; }
  .guest-bar { font-size: 14px; }
}
.m-now { font-weight: 700; }
.m-gain { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.m-gain.up { color: var(--green); background: var(--green-soft); }
.m-gain.down { color: var(--orange); background: var(--orange-soft); }

/* fiches PDF : bien visibles */
.chap-list { flex-direction: column; align-items: stretch; gap: 8px; }
.chap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 8px 8px 0; border-bottom: 1px solid var(--line-2); }
.chap:last-child { border-bottom: 0; }
.chap-docs { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.exam-name { font-weight: 600; min-width: 100px; display: inline-block; }
.exam-sess { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.exam-sess summary { cursor: pointer; font-weight: 600; }
.exam-sess[open] summary { margin-bottom: 8px; }
.chap-pdf { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; font-size: 13px; font-weight: 600; text-decoration: none;
  color: var(--blue); background: var(--blue-soft); border: 1px solid var(--line); border-radius: 4px; white-space: nowrap; }
.chap-pdf:hover { border-color: var(--blue); }
.docs { display: grid; gap: 8px; margin-bottom: 18px; }
.fiche-top { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--blue);
  border-radius: var(--radius); background: var(--blue-soft); text-decoration: none; color: var(--ink); }
.fiche-top:hover { box-shadow: 0 0 0 3px var(--hl-mark); }
.fiche-ic { flex: none; width: 32px; height: 38px; border-radius: 4px; background: var(--red); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center; }
.fiche-top b { display: block; font-size: 14px; }
.fiche-top small { display: block; color: var(--blue); font-size: 12.5px; font-weight: 600; margin-top: 2px; }

/* lecteur de documents (lecture seule) */
.reader { position: fixed; inset: 0; z-index: 100; background: rgba(13, 17, 23, .86); display: flex; flex-direction: column; }
.reader-bar { display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--bg); border-bottom: 1px solid var(--line); }
.reader-bar b { font-size: 15px; }
.reader-bar .muted { flex: 1; font-size: 13px; }
.reader-pages { flex: 1; overflow-y: auto; padding: 24px 16px 48px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.reader-pages .loading { color: #e6e6e6; }
.reader-page { width: min(860px, 100%); height: auto; background: #fff; box-shadow: 0 8px 30px rgba(0, 0, 0, .35); border-radius: 2px;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; pointer-events: none; }
body.reading { overflow: hidden; }
button.fiche-top, button.chap-pdf { font: inherit; cursor: pointer; text-align: left; width: 100%; }
button.chap-pdf { width: auto; }
@media print { body.reading .reader, body.reading .reader * { display: none !important; } }

/* logo MaYoMath (flacon) : bien visible */
.logo { gap: 10px; }
.logo-img { height: 72px; width: auto; flex: none; display: block; margin: -6px 0; }
.top .logo, .topbar .logo { font-size: 24px; }
.topbar .logo-img { height: 56px; margin: -4px 0; }
.p-logo .logo-img { height: 34px; margin: -4px 0; }
.foot .logo-img { height: 64px; }
:root[data-theme="dark"] .logo-img { filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .7)); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-img { filter: drop-shadow(0 0 1.5px rgba(255, 255, 255, .7)); } }
@media (max-width: 700px) {
  .logo-img { height: 54px; margin: -4px 0; }
  .topbar .logo-img { height: 46px; }
  .top .logo, .topbar .logo { font-size: 21px; }
}

/* vidéo résumé : astuces au tableau */
.chalk.k-tip { color: var(--pen-green, #a7e9a1); border-left: 3px solid var(--pen-green, #a7e9a1); padding-left: 14px; }
.chalk.k-tip::before { content: "Astuce · "; font-weight: 600; }
.vid-bar { height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 6px 0 14px; }
.vid-bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .3s; }
.fiche-ic.vid { background: #1f6feb; }
.fiche-ic.quiz { background: #8a4fff; }
button.fiche-top.active { outline: 2px solid var(--blue); }
/* quiz */
.quiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.quiz-head h3 { margin: 0; }
.quiz-dots { display: flex; gap: 5px; }
.quiz-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.quiz-dots i.done { background: var(--blue); }
.quiz-dots i.on { background: var(--blue); box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 30%, transparent); }
.quiz-q { font-size: 18px; font-weight: 600; margin: 12px 0; }
.quiz-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quiz-choice { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: inherit; font: inherit; cursor: pointer; }
.quiz-choice:hover { border-color: var(--blue); }
.quiz-choice b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--blue) 15%, transparent); color: var(--blue); font-size: 13px; }
@media (max-width: 700px) { .quiz-choices { grid-template-columns: 1fr; } }
.quiz-choice.sel { border-color: var(--blue); background: color-mix(in srgb, var(--blue) 12%, var(--bg)); }
.quiz-choice.good { border-color: #2e9e5b; background: color-mix(in srgb, #2e9e5b 14%, var(--bg)); }
.quiz-choice.bad { border-color: #d64545; background: color-mix(in srgb, #d64545 12%, var(--bg)); }
.quiz-choice:disabled { cursor: default; }
.quiz-dots i.ok { background: #2e9e5b; }
.quiz-dots i.ko { background: #d64545; }
.quiz-fb { margin: 0; font-weight: 600; align-self: center; }
.quiz-fb.ok { color: #2e9e5b; } .quiz-fb.ko { color: #d64545; }

/* ardoise (écriture à la main) */
.pad-toggle { margin: 10px 0 0; }
.pad { margin-top: 10px; border: 1.5px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.pad-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; background: var(--bg); border-bottom: 1px solid var(--line); }
.pad-t { font: inherit; font-size: 13px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: transparent; color: inherit; cursor: pointer; min-height: 34px; }
.pad-t.on { border-color: var(--blue); color: var(--blue); font-weight: 600; }
.pad-colors { display: inline-flex; gap: 6px; margin: 0 4px; }
.pad-c { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; background: var(--c); cursor: pointer; padding: 0; box-shadow: inset 0 0 0 2px #fff; }
.pad-c.on { border-color: var(--blue); }
.pad-canvas { display: block; width: 100%; height: 300px; touch-action: none; cursor: crosshair; background: #fff; }
.pad-help { margin: 0; padding: 6px 10px; font-size: 12px; color: #59636e; background: #f6f8fa; }
.chalk.k-sketch { clip-path: none; cursor: default; }
.chalk.k-sketch img { display: block; max-width: 100%; max-height: 420px; border-radius: 8px; background: #fff; margin: 4px 0 14px; }

/* minuteur d'exercice */
.ans-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ans-head h3 { margin: 0; }
.ex-timer { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 12px; border-radius: 99px; border: 1.5px solid var(--line); font-variant-numeric: tabular-nums; }
.ex-timer .ic { font-size: 14px; }
.ex-timer b { font-size: 17px; }
.ex-timer small { color: var(--ink-2); font-size: 12px; }
.ex-timer.over { border-color: #e8912d; color: #c26a00; }
.time-line { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.time-line.over b { color: #c26a00; }

/* droite graduée (intervalles) */
.chalk.k-axis { max-width: 640px; margin: 6px auto 18px; }
.ax-note { text-align: center; margin-bottom: 4px; }
.ax-wrap { position: relative; padding-bottom: 30px; }
.ax-wrap svg { display: block; width: 100%; height: 52px; overflow: visible; }
.ax-line { stroke: var(--pen-white); stroke-width: 2; }
.ax-arrow { fill: var(--pen-white); }
.ax-seg { stroke: var(--pen-yellow); stroke-width: 7; stroke-linecap: butt; opacity: .9; }
.ax-br { fill: var(--pen-yellow); font: 400 34px KaTeX_Main, "Times New Roman", serif; }
.ax-labels { position: absolute; left: 0; right: 0; top: 50px; height: 28px; }
.ax-lab { position: absolute; transform: translateX(-50%); font-size: .8em; white-space: nowrap; }

/* figures au tableau : tableaux de signes / variations, courbes */
.chalk.k-fig { max-width: 680px; margin: 8px auto 20px; cursor: pointer; }
.fig-cap { text-align: center; margin-bottom: 6px; font-size: .9em; }
.tb-wrap { position: relative; width: 100%; }
.tb-wrap svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tb-labs { position: absolute; inset: 0; }
.tb-lab, .tb-sign, .tb-zero { position: absolute; transform: translate(-50%, -50%); white-space: nowrap; font-size: .78em; }
.tb-sign { font-family: KaTeX_Main, "Times New Roman", serif; font-size: .95em; color: var(--pen-yellow); }
.tb-zero { font-family: KaTeX_Main, "Times New Roman", serif; font-size: .9em; background: var(--board, #20242b); padding: 0 3px; }
.tb-final { font-weight: 600; }
.tb-frame { fill: none; stroke: rgba(255,255,255,.7); stroke-width: 1.5; }
.tb-line { stroke: rgba(255,255,255,.7); stroke-width: 1.2; }
.tb-dot { stroke: rgba(255,255,255,.45); stroke-width: 1.2; stroke-dasharray: 3 4; }
.tb-dbl { stroke: rgba(255,255,255,.85); stroke-width: 1.4; }
.tb-arrow { stroke: var(--pen-yellow); stroke-width: 2; }
.tb-head { fill: var(--pen-yellow); }
.gr-wrap { margin: 0 auto; position: relative; container-type: inline-size; }
.gr-wrap > svg { display: block; width: 100%; height: auto; }
.gr-grid { stroke: rgba(255,255,255,.12); stroke-width: 1; }
.gr-axis { stroke: rgba(255,255,255,.8); stroke-width: 1.6; }
.gr-head { fill: rgba(255,255,255,.8); }
.gr-tick { fill: rgba(255,255,255,.7); font: 13px KaTeX_Main, "Times New Roman", serif; }
.gr-curve { fill: none; stroke: var(--pen-yellow); stroke-width: 3; stroke-linejoin: round; }
.gr-curve.c2 { stroke: var(--pen-blue); }
.gr-h { stroke: var(--pen-red); stroke-width: 1.6; stroke-dasharray: 6 5; }
.gr-name { fill: var(--pen-yellow); font: italic 18px KaTeX_Main, "Times New Roman", serif; }
.gr-name.c2 { fill: var(--pen-blue); }
.gr-curve.c3 { stroke: #d6a4ff; }
.gr-name.c3 { fill: #d6a4ff; }
.gr-axname { fill: rgba(255,255,255,.85); font: italic 14px KaTeX_Main, "Times New Roman", serif; paint-order: stroke; stroke: var(--board); stroke-width: 4px; }
.gr-pt { fill: var(--pen-white); }

/* lectures graphiques */
.gr-read { fill: none; stroke: #7ce38b; stroke-width: 2.2; stroke-dasharray: 7 6; }
.gr-rpt { fill: #7ce38b; }
.gr-rlab { fill: #7ce38b; font: 700 15px KaTeX_Main, "Times New Roman", serif; paint-order: stroke; stroke: var(--board); stroke-width: 4px; }
.gr-hi { fill: none; stroke: #7ce38b; stroke-width: 6; stroke-linejoin: round; opacity: .85; }
.gr-span { stroke: #7ce38b; stroke-width: 7; }
.gr-br { fill: #7ce38b; font: 400 26px KaTeX_Main, "Times New Roman", serif; }
/* tableaux de conversion et opérations posées : rouge et bleu de la craie (lisibles sur le tableau sombre) */
.board .katex [style*="color:red"] { color: var(--pen-red) !important; }
.board .katex [style*="color:blue"] { color: var(--pen-blue) !important; }
.gr-hlab { fill: var(--pen-red); font: italic 15px KaTeX_Main, "Times New Roman", serif; }
.gr-read0 { stroke-width: 4; }
.gr-cah { fill: var(--pen-yellow); }
.gr-cah.c2 { fill: var(--pen-blue); }
.gr-sparrow { fill: #7ce38b; }

/* encadré Méthode */
.chalk.k-method { border: 2px solid var(--pen-blue); border-radius: 12px; padding: 8px 14px 10px; margin: 10px 0 16px; background: rgba(143, 208, 255, .06); }
/* accroche de l'introduction : un peu d'histoire, puis à quoi ça sert (fondatrice, 10 nov. 2026) */
.chalk.k-histoire, .chalk.k-usage { border-radius: 12px; padding: 8px 14px 10px; margin: 12px 0 16px; font-size: clamp(20px, 2vw, 26px); }
.chalk.k-histoire { border: 2px solid var(--pen-yellow); background: rgba(255, 214, 102, .06); }
.chalk.k-usage { border: 2px solid var(--pen-green, #a7e9a1); background: rgba(167, 233, 161, .06); }
.chalk.k-histoire::before, .chalk.k-usage::before { display: block; font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; }
.chalk.k-histoire::before { content: "Un peu d'histoire"; color: var(--pen-yellow); }
.chalk.k-usage::before { content: "À quoi ça sert ?"; color: var(--pen-green, #a7e9a1); }
html[data-lang="ar"] .chalk.k-histoire::before { content: "لمحة تاريخية"; letter-spacing: 0; }
html[data-lang="ar"] .chalk.k-usage::before { content: "ما فائدة هذا الدرس؟"; letter-spacing: 0; }
.chalk.k-method::before { content: "Méthode"; display: block; font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pen-blue); margin-bottom: 4px; }
.gr-path { fill: none; stroke: #ffb35c; stroke-width: 3; stroke-dasharray: 2 0; marker-end: none; }
.gr-plab { fill: #ffb35c; font: 700 15px KaTeX_Main, "Times New Roman", serif; paint-order: stroke; stroke: var(--board); stroke-width: 4px; }

.chip .chip-sub { display: block; font-size: 11px; font-weight: 600; color: var(--ink-3); margin-top: 2px; }
.chip.on .chip-sub { color: var(--blue); }

/* figures de géométrie et diagrammes (primaire) */
.geo-line { stroke-width: 2.6; stroke-linejoin: round; }
.geo-arrow { stroke-width: 2.6; }
.geo-mark { fill: none; stroke-width: 2; }
.geo-pt { fill: var(--pen-white); font: italic 18px KaTeX_Main, "Times New Roman", serif; paint-order: stroke; stroke: var(--board); stroke-width: 4px; }
.geo-lab { font: 15px KaTeX_Main, "Times New Roman", serif; paint-order: stroke; stroke: var(--board); stroke-width: 4px; }
.ch-bar { opacity: .85; }
.pie { stroke: var(--board); stroke-width: 2; opacity: .9; }

/* progression et fin de l'explication */
/* exercice adaptatif : présenté comme dans la fiche PDF (sans voix) */
.chalk.k-excard { clip-path: none; font-family: "KaTeX_Main", "Latin Modern Roman", Georgia, "Times New Roman", serif; font-weight: 400;
  background: #fbfaf6; color: #1b1b1b; border-radius: 8px; padding: 18px 22px 20px; margin: 4px 0 16px; box-shadow: 0 6px 18px -10px rgba(0,0,0,.55);
  font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; cursor: default; border-left: 5px solid #2f5ea8; }
.chalk.k-excard:hover { opacity: 1; }
.k-excard .exc-title { font-family: Inter, system-ui, sans-serif; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: #2f5ea8; margin-bottom: 8px; text-transform: uppercase; }
.k-excard .katex { color: #1b1b1b; }
/* jauge de l'explication */
.seek { flex: 1; min-width: 80px; max-width: 320px; accent-color: var(--pen-yellow); cursor: pointer; }
.seek:disabled { opacity: .35; cursor: default; }
/* plein écran : le tableau seul, en grand (il couvre la fenêtre, et l'écran entier si le navigateur l'accepte) */
body.board-max { overflow: hidden; }
body.board-max .board { position: fixed; inset: 0; z-index: 1000; height: 100vh; min-height: 0; border-radius: 0; box-shadow: none; }
body.board-max .board-scroll { padding: 40px 8vw 96px; }
/* la figure garde ses proportions (les noms posés par-dessus restent à leur place) : largeur limitée par la hauteur */
body.board-max .gr-wrap { max-width: min(1100px, 100%, calc(72vh * var(--ar, 1.6))) !important; }
.bprog { margin-left: 6px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,.6); white-space: nowrap; }
.bprog.end { color: #7ce38b; }
.board-end { margin: 18px 0 8px; padding: 8px 14px; border-top: 2px dashed rgba(124,227,139,.6); color: #7ce38b; font: 700 15px var(--font); letter-spacing: .06em; text-transform: uppercase; text-align: center; }
.ctrl.ctrl-next { width: auto; padding: 0 12px; font-size: 13px; font-weight: 700; }
.ctrl.ctrl-next:disabled { opacity: .35; cursor: default; }
/* « Notion suivante » : seulement en plein écran (hors plein écran, le bouton est sous le tableau) */
#ctrl-next { display: none; }
body.board-max #ctrl-next { display: grid; }
.me-text[hidden] { display: none !important; }

/* une égalité ou une inégalité ne se coupe jamais en fin de ligne : chaque formule reste d'un seul tenant */
.katex { white-space: nowrap; }

/* page d'accueil : grand logo à droite du titre (au-dessus, en plus petit, sur téléphone) */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 40px; align-items: center; }
.hero-grid .hero-text { grid-column: 1; grid-row: 1; }
.hero-logo { grid-column: 2; grid-row: 1; width: auto; height: clamp(220px, 26vw, 340px); transform: rotate(-4deg); }
@media (max-width: 820px) {
  .hero-grid { grid-template-columns: 1fr; gap: 18px; }
  .hero-logo { grid-column: 1; grid-row: 1; height: 150px; justify-self: start; }
  .hero-grid .hero-text { grid-row: 2; }
}
/* arbre pondéré (probabilités) */
.tr-wrap { margin: 6px auto; }
.tr-br { stroke: rgba(255,255,255,.8); stroke-width: 1.6; }
.tr-root { fill: rgba(255,255,255,.85); }
.tr-n { font-size: .95em; }
.tr-p { font-size: .8em; color: #f6d77a; }
.tr-end { transform: translate(0, -50%); font-size: .75em; color: #bfe3c8; }
.ch-hist { stroke: #1f2a24; stroke-width: 1.2; }
.sugg { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.sugg .chip { border: 1px solid var(--blue); background: var(--blue-soft); color: var(--blue); border-radius: 999px;
  padding: 6px 12px; font: inherit; font-size: .9em; cursor: pointer; text-align: left; }
.sugg .chip:hover { background: var(--blue); color: #fff; }
.geo-tex { position: absolute; transform: translate(-50%, -50%); line-height: 1; white-space: nowrap; pointer-events: none;
  text-shadow: 0 0 3px var(--board), 0 0 3px var(--board); }
/* « Poser une question » */
.ask-btn { border: 1px solid #7ce38b; background: transparent; color: #7ce38b; border-radius: 999px; padding: 4px 12px;
  font: inherit; font-size: .85em; font-weight: 600; cursor: pointer; }
.ask-btn:hover { background: #7ce38b; color: #1f2a24; }
.ask-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-start;
  justify-content: center; padding: 6vh 16px; z-index: 50; }
.ask-overlay[hidden] { display: none; }
.ask-card { background: var(--surface); color: var(--ink); width: min(720px, 100%); max-height: 86vh; overflow: auto;
  border-radius: 10px; padding: 18px 20px; box-shadow: 0 10px 40px rgba(0, 0, 0, .3); }
.ask-head { display: flex; justify-content: space-between; align-items: center; }
.ask-head h3 { margin: 0; }
.ask-close { border: 0; background: transparent; font-size: 20px; cursor: pointer; color: inherit; }
.ask-hint { margin: 6px 0 10px; font-size: .9em; }
.ask-row { display: flex; gap: 8px; align-items: stretch; }
.ask-row textarea { flex: 1; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--bg); color: var(--ink); resize: vertical; }
.ask-answer { margin-top: 14px; }
.ask-q { font-weight: 600; margin-bottom: 8px; }
.ask-step { margin: 6px 0; line-height: 1.55; }
.ask-step.k-highlight, .ask-step.k-method { background: var(--blue-soft); border-left: 3px solid var(--blue); padding: 6px 10px; border-radius: 4px; }
.ask-fig { background: var(--board); border-radius: 6px; padding: 8px; margin: 8px 0; }
.ask-step.k-title { font-weight: 700; color: var(--blue); margin-top: 12px; font-size: 1.05em; }
.ask-step.k-text:first-of-type { font-style: italic; }
.ask-step.k-question { font-weight: 600; }

/* choix de la difficulté pendant les exercices */
.ex-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.diff-pick { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.diff-pick select { font: inherit; padding: 7px 10px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }


/* ---------- Cours en arabe : seul le CONTENU est en arabe (fondatrice, 9 nov. 2026 : on ne change jamais la présentation
   de la page). Le tableau s'écrit de droite à gauche ; ailleurs (notions, question, corrigés, chapitres), chaque texte
   arabe se lit de droite à gauche à sa place, l'interface reste en français et à gauche. Formules : de gauche à droite. */
html[data-lang="ar"] .board-scroll {
  direction: rtl; text-align: right;
  font-family: "Noto Naskh Arabic", "Amiri", "Geeza Pro", serif;
}
html[data-lang="ar"] .dock *, html[data-lang="ar"] .side *, html[data-lang="ar"] .lesson-docs *,
html[data-lang="ar"] .chap-list *, html[data-lang="ar"] .modal-body *, html[data-lang="ar"] .ask-card * {
  unicode-bidi: plaintext; text-align: start;
}
html[data-lang="ar"] .board-scroll { font-size: 1.08em; line-height: 1.9; }
html[data-lang="ar"] .katex, html[data-lang="ar"] .katex-display, html[data-lang="ar"] svg, html[data-lang="ar"] canvas {
  direction: ltr; unicode-bidi: isolate;
}
html[data-lang="ar"] input, html[data-lang="ar"] textarea { unicode-bidi: plaintext; }
html[data-lang="ar"] math-field { direction: ltr; }
/* en arabe, la craie écrit de droite à gauche */
html[data-lang="ar"] .chalk:not(.done):not(.k-sketch):not(.k-excard) { clip-path: inset(0 0 0 100%); }
html[data-lang="ar"] .chalk.k-step::before { margin: 0 .12em .12em .5em; }
html[data-lang="ar"] .chalk.k-statement::before { content: "التمرين: "; }
html[data-lang="ar"] .chalk.k-tip::before { content: "نصيحة · "; }
html[data-lang="ar"] .chalk.k-tip { border-left: 0; padding-left: 0; border-right: 3px solid var(--pen-green, #a7e9a1); padding-right: 14px; }
html[data-lang="ar"] .chalk.k-method::before { content: "طريقة"; letter-spacing: 0; }
html[data-lang="ar"] .chalk[dir="ltr"]:not(.done):not(.k-sketch):not(.k-excard) { clip-path: inset(0 100% 0 0); }
html[data-lang="ar"] .ask-step.k-highlight, html[data-lang="ar"] .ask-step.k-method { border-left: 0; border-right: 3px solid var(--blue); }

/* scripts Scratch (collège) : blocs aux couleurs de Scratch 3 */
.scr { display: inline-flex; flex-direction: column; align-items: flex-start; font: 600 15px/1.2 "Helvetica Neue", Arial, sans-serif; color: #fff; margin: 6px 0; }
.scr-b { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; border-radius: 5px; margin-bottom: 2px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.15); white-space: nowrap; }
.scr-hat { border-radius: 16px 16px 5px 5px; padding-top: 10px; }
.scr-cblock { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 2px; }
.scr-c { border-left: 14px solid; padding: 2px 0 0 0; min-height: 22px; display: flex; flex-direction: column; align-items: flex-start; }
.scr-gap { height: 22px; }
.scr-foot { width: 70px; height: 14px; border-radius: 0 0 5px 5px; font-size: 11px; text-align: right; padding-right: 6px; margin-bottom: 2px; }
.scr-in { display: inline-block; min-width: 18px; padding: 1px 8px; border-radius: 12px; background: #fff; color: #575e75; text-align: center; }
.scr-v { background: #FF8C1A; color: #fff; border: 1px solid rgba(0,0,0,.15); }
.scr-se { background: #5CB1D6; color: #fff; border: 1px solid rgba(0,0,0,.15); }
.scr-op { background: #59C059; color: #fff; border: 1px solid rgba(0,0,0,.18); }
.scr-l { background: #FF661A; color: #fff; }
.scr-bool { display: inline-block; padding: 1px 12px; background: #59C059; clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%); }
.scr-menu { display: inline-block; padding: 1px 7px; border-radius: 4px; background: rgba(0,0,0,.14); border: 1px solid rgba(0,0,0,.18); }
.scr-flag { color: #4cbf56; background: #fff; border-radius: 4px; padding: 0 3px; font-size: 13px; }
.scr-tag { font-weight: 800; margin-right: 2px; }

/* ---------- Page de choix : onglets, carte « Reprendre », cartes de chapitre, tuiles (fondatrice, 10 nov. 2026) ---------- */
.pick { padding: 0; overflow: hidden; }
.pick-tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; background: var(--bg-2); }
.pick-tabs:empty { display: none; }
.pick-tab { display: inline-flex; align-items: center; gap: 8px; padding: 14px 14px 12px; border: 0; border-bottom: 2px solid transparent; background: none;
  font: inherit; font-weight: 600; font-size: 15px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.pick-tab:hover { color: var(--ink); }
.pick-tab.on { color: var(--ink); border-bottom-color: var(--blue); }
.pick-count { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 10px; background: var(--line-2); color: var(--ink-2); }
#pick-body { padding: 18px 20px 20px; }
.resume-card { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; margin-bottom: 18px;
  border: 1px solid var(--blue); border-radius: 10px; background: var(--blue-soft, var(--bg-2)); }
.resume-card.first { border-color: var(--line); background: var(--bg-2); }
.resume-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.resume-k { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--blue); }
.resume-card.first .resume-k { color: var(--ink-2); }
.resume-txt b { font-size: 16px; }
.resume-txt small { color: var(--ink-2); font-size: 13.5px; }
.resume-go, .chap-go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.resume-go svg, .chap-go svg { width: 16px; height: 16px; flex: none; }
.chap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.chap-card { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  transition: border-color .12s, transform .12s; }
.chap-card:hover { border-color: var(--blue); }
.chap-card.soon { border-style: dashed; background: var(--bg-2); color: var(--ink-3); }
.chap-head { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.chap-head:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; border-radius: 4px; }
.chap-n { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-3, var(--ink-2)); }
.chap-card h3 { margin: 0; font-size: 16.5px; line-height: 1.3; font-weight: 700; color: var(--ink); text-align: start; }
.chap-card h3[dir="auto"]:dir(rtl) { font-size: 18px; }
.chap-card.soon h3 { color: var(--ink-3); }
.chap-bar { height: 6px; border-radius: 3px; background: var(--line-2); overflow: hidden; }
.chap-bar i { display: block; height: 100%; background: var(--blue); border-radius: 3px; }
.chap-state { font-size: 13px; color: var(--ink-2); min-height: 18px; }
/* Verrouillage (acces.py) */
.i-lock { width: 15px; height: 15px; vertical-align: -2px; margin-right: 6px; flex: none; }
.chap-card.locked { background: var(--bg-2); color: var(--ink-3); }
.chap-card.locked h3 { color: var(--ink-3); }
.chap-card.locked .chap-state { color: var(--ink-3); display: flex; align-items: center; }
.free-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .03em; margin-right: 4px; }
.lock-note { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; color: var(--ink-2); }
.lock-note .i-lock { margin-top: 2px; }
.tile.locked { opacity: .7; }
.tile-lock { display: inline-flex; align-items: center; font-size: 13px; color: var(--ink-3); }
.admin-link { margin-left: 8px; }
.chap-go { width: 100%; margin-top: auto; }
.chap-docs2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding-top: 10px; border-top: 1px solid var(--line-2); font-size: 13px; }
.chap-docs-k { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-3, var(--ink-2)); }
.chap-docs-k svg { width: 14px; height: 14px; }
.doc-link { border: 0; background: none; padding: 2px 0; font: inherit; font-size: 13px; font-weight: 600; color: var(--blue); cursor: pointer; }
.doc-link:hover { text-decoration: underline; }
.pick-other { margin-top: 18px; color: var(--ink-2); font-size: 14px; }
.pick-other summary { cursor: pointer; display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.pick-other summary::-webkit-details-marker { display: none; }
.pick-other summary svg { width: 15px; height: 15px; }
.tile-section + .tile-section { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line-2); }
.tile-section h3 { margin: 0 0 4px; font-size: 16px; }
.tile-section > .muted { margin: 0 0 12px; font-size: 14px; }
.tile-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tf { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 16px; padding: 5px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tf.on { border-color: var(--blue); color: var(--blue); background: var(--blue-soft, var(--bg-2)); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.tile[hidden] { display: none; }
.tile b { font-size: 15px; }
.tile small { font-size: 12.5px; color: var(--ink-2); line-height: 1.35; }
.tile-btns { display: flex; gap: 6px; margin-top: 10px; }
.tile-btn { flex: 1; height: 30px; border-radius: 6px; border: 1px solid var(--blue); background: var(--blue); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tile-btn.ghost { background: transparent; color: var(--blue); border-color: var(--line); }
.tile-btn:hover { filter: brightness(1.08); }
@media (max-width: 640px) {
  #pick-body { padding: 14px; }
  .resume-card { flex-direction: column; align-items: stretch; }
  .chap-grid { grid-template-columns: 1fr; }
  .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Décor mathématique des marges vides (deco.js) : π, spirale d'or, gaussienne. Vert lisible en clair comme en sombre. */
:root { --deco: #138a50; --deco-a: .8; }
:root[data-theme="dark"] { --deco: #3ccf86; --deco-a: .6; }
.deco { position: fixed; left: 0; right: 0; bottom: 20px; z-index: 1; pointer-events: none; display: none; color: var(--deco); }
.deco.on { display: block; }
.deco-col { position: absolute; top: 0; bottom: 0; opacity: var(--deco-a); visibility: hidden; }
.deco.cotes .deco-col { visibility: visible; }
.deco-bas { position: absolute; bottom: 0; display: flex; justify-content: center; align-items: flex-end; gap: 24px; opacity: 0; transition: opacity .6s; }
.deco-mid { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.deco-cote { display: none; overflow: hidden; }
.deco.cotes-bas .deco-cote { display: block; }
.deco-e { font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.6; word-break: break-all; }
.deco-cf { font-family: Georgia, "Times New Roman", serif; font-size: 15px; white-space: nowrap; display: flex !important; align-items: center; }
.deco:not(.cotes-bas) .deco-cf { display: none !important; }
.cf-row { display: flex; align-items: flex-start; }
.cf-a { margin-top: .78em; padding-right: 4px; }
.cf-f { display: flex; flex-direction: column; align-items: stretch; }
.cf-n { border-bottom: 1px solid currentColor; text-align: center; padding: 0 3px; line-height: 1.25; }
.cf-d { display: flex; justify-content: flex-start; padding-top: 2px; }
.cf-fin { padding-left: 6px; }
.deco.vide-bas .deco-bas { opacity: var(--deco-a); }
.deco-g { overflow: hidden; }
.deco-pi { font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.6; word-break: break-all; transition: opacity 1s; }
.deco-d { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.deco-sp { width: 100%; max-width: 180px; height: auto; }
.deco-eq { font-family: Georgia, "Times New Roman", serif; font-size: 17px; white-space: nowrap; }
.deco-phi { width: 100%; flex: 1 1 0; min-height: 0; overflow: hidden; font-family: ui-monospace, Menlo, monospace; font-size: 13px; line-height: 1.6; white-space: normal; word-break: break-all; }
.deco-ga { height: auto; transition: opacity 1s; }
.deco-eq { transition: opacity 1.2s; }
.deco-eq sup { font-size: 12px; }
.deco-frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: 13px; line-height: 1.15; }
.deco-frac span:first-child { border-bottom: 1px solid currentColor; padding: 0 2px; }
.deco-sq { fill: none; stroke: currentColor; stroke-opacity: .55; stroke-width: .9; opacity: 0; transition: opacity .6s; }
.deco-line { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.deco-axe { stroke: currentColor; stroke-opacity: .4; }
.deco-sd { stroke: currentColor; stroke-opacity: .3; stroke-dasharray: 3 3; }
.deco-aire { fill: currentColor; fill-opacity: .1; stroke: none; opacity: 0; transition: opacity 1.5s; }
@media print { .deco { display: none !important; } }

/* ---------- Style dynamique (fondatrice, 12 nov. 2026, pilote 6e chapitre 1) : cartes animées qui relancent l'attention ---------- */
.chalk.k-hook, .chalk.k-defi, .chalk.k-reveal, .chalk.k-fun { display: block; border-radius: 16px; padding: 12px 18px 14px; margin: 14px 0 18px; clip-path: none; }
.chalk.k-hook::before, .chalk.k-defi::before, .chalk.k-reveal::before, .chalk.k-fun::before { display: block; font-family: var(--font); font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; }
.chalk.k-hook { font-size: clamp(25px, 2.6vw, 33px); text-align: center; color: var(--pen-yellow); border: 2.5px solid var(--pen-yellow); background: radial-gradient(circle at 50% 0%, rgba(244,197,66,.18), rgba(244,197,66,.03)); }
.chalk.k-hook::before { content: "💥"; font-size: 22px; letter-spacing: 0; color: var(--pen-yellow); }
.chalk.k-defi { border: 2.5px dashed #ff9f43; background: rgba(255,159,67,.08); position: relative; overflow: hidden; }
.chalk.k-defi::before { content: "⚡  Défi : à toi de jouer !"; color: #ff9f43; }
.chalk.k-defi.think::after { content: ""; position: absolute; left: 0; bottom: 0; height: 5px; width: 100%; background: #ff9f43; transform-origin: left; animation: thinkbar var(--think, 5s) linear forwards; }
@keyframes thinkbar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.chalk.k-reveal { border: 2.5px solid #4cd964; background: rgba(76,217,100,.09); }
.chalk.k-reveal::before { content: "✅  Réponse"; color: #4cd964; }
.chalk.k-fun { border: 2.5px solid #c58cff; background: rgba(197,140,255,.09); }
.chalk.k-fun::before { content: "🤯  Le savais-tu ?"; color: #c58cff; }
/* entrée en scène : les cartes surgissent au lieu de s'écrire à la craie */
.chalk.k-hook.writing, .chalk.k-reveal.writing { animation: popin .55s cubic-bezier(.2,1.6,.4,1) forwards; }
.chalk.k-defi.writing { animation: shakein .6s ease-out forwards; }
.chalk.k-fun.writing { animation: slidein .55s ease-out forwards; }
@keyframes popin { 0% { opacity: 0; transform: scale(.6); } 70% { opacity: 1; transform: scale(1.04); } 100% { opacity: 1; transform: scale(1); } }
@keyframes shakein { 0% { opacity: 0; transform: translateX(0); } 20% { opacity: 1; transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } 100% { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .chalk.k-hook.writing, .chalk.k-reveal.writing, .chalk.k-defi.writing, .chalk.k-fun.writing { animation: none; opacity: 1; } }
.ask-step.k-hook, .ask-step.k-defi, .ask-step.k-reveal, .ask-step.k-fun { border-left: 3px solid var(--blue); padding: 6px 10px; border-radius: 4px; background: var(--blue-soft); }
.chalk.k-hook:not(.done):not(.writing), .chalk.k-defi:not(.done):not(.writing), .chalk.k-reveal:not(.done):not(.writing), .chalk.k-fun:not(.done):not(.writing) { opacity: 0; }
html[data-lang="ar"] .chalk.k-defi::before { content: "⚡  تحد: دورك الآن!"; letter-spacing: 0; }
html[data-lang="ar"] .chalk.k-reveal::before { content: "✅  الجواب"; letter-spacing: 0; }
html[data-lang="ar"] .chalk.k-fun::before { content: "🤯  هل تعلم؟"; letter-spacing: 0; }
html[data-lang="ar"] .chalk.k-defi.think::after { left: auto; right: 0; transform-origin: right; }

/* Tablette et téléphone : la colonne du tableau est étroite. Les boutons gardent leur taille, la jauge et le texte
   « Fin de l'explication » prennent la place qui reste (points de suspension si besoin) : rien ne sort de la barre. */
@media (max-width: 960px) {
  .board-bar .ctrl, .board-bar .speed { flex: none; }
  .board-bar .seek { min-width: 0; flex: 1 1 30px; }
  .board-bar .bprog { min-width: 0; margin-left: 0; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; }
  .tutor-face { display: none; }
  .board, #pick { scroll-margin-top: 80px; }   /* remontée vers le tableau (voirTableau) : sous la barre du haut, collée */
}
/* Téléphone à l'horizontale (écran peu haut) : le tableau tient dans l'écran, barre de commandes comprise. */
@media (max-height: 500px) and (max-width: 960px) {
  .board { height: calc(100vh - 86px); height: calc(100dvh - 86px); min-height: 0; }   /* 86 px : la barre du haut, collée */
  .board-scroll { padding-top: 14px; padding-bottom: 60px; }
  .chalk { font-size: 20px; }
  .chalk.k-title { font-size: 23px; }
}
/* Lecteur de documents sur téléphone : titre et bouton « Fermer » sur une ligne, la mention « lecture seule » dessous ;
   pages plus larges (on zoome avec deux doigts). */
@media (max-width: 560px) {
  .reader-bar { flex-wrap: wrap; gap: 4px 12px; padding: 10px 14px; }
  .reader-bar b { flex: 1 1 0; min-width: 0; }
  .reader-bar .muted { order: 3; flex: 1 1 100%; font-size: 12px; }
  .reader-pages { padding: 12px 6px 40px; gap: 12px; }
}
/* Inscription : champ piège anti-robots (hors de l'écran, jamais vu ni atteint au clavier) ; étape du code reçu par e-mail */
.hp { position: absolute !important; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.code-info { margin: 0 0 16px; color: var(--ink-2); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.code-input { font-size: 26px; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.code-ok { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); border-radius: 4px; padding: 8px 12px; margin: 0 0 14px; font-size: 15px; }
.link-btn { border: 0; background: none; padding: 4px 2px; font: inherit; font-weight: 700; color: var(--blue); cursor: pointer; }
.link-btn:disabled { color: var(--ink-3); cursor: default; }
/* « Mot de passe oublié ? » sous le mot de passe, aligné à droite */
.forgot-line { margin: -6px 0 12px; text-align: right; font-size: 14px; }
/* Accueil : choix du système (« / ») et accueil de chaque système (« /maroc », « /france ») — data-sys sur <html> */
html[data-sys="choix"] .only-ma:not(.only-choix), html[data-sys="choix"] .only-fr:not(.only-choix) { display: none !important; }
html[data-sys="ma"] .only-fr:not(.only-ma), html[data-sys="ma"] .only-choix:not(.only-ma) { display: none !important; }
html[data-sys="fr"] .only-ma:not(.only-fr), html[data-sys="fr"] .only-choix:not(.only-fr) { display: none !important; }
.sys-pill { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); margin-left: 10px; }
.sys-change { font-size: 13px; color: var(--blue); margin-left: 12px; text-decoration: none; white-space: nowrap; }
.sys-change:hover { text-decoration: underline; }
.hero.choix { padding-bottom: 24px; }
.sys-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 8px; }
.sys-card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 26px 28px 24px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.sys-card:hover { border-color: var(--blue); box-shadow: 0 0 0 3px var(--hl-mark); }
.sys-card.reco { border: 2px solid var(--blue); }
.sys-card h2 { margin: 0; font-size: 24px; }
.sys-card p { margin: 0; color: var(--ink-2); }
.sys-reco { display: none; align-self: flex-start; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); }
.sys-card.reco .sys-reco { display: inline-block; }
.sys-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.sys-tags i { font-style: normal; font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.sys-go { margin-top: 8px; font-weight: 700; color: var(--blue); }
.sys-note { color: var(--ink-3); font-size: 14px; margin: 14px 0 0; }
.course.soon { opacity: .55; }
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 20px 22px; }
.plan.best { border: 2px solid var(--blue); }
.plan-k { display: block; font-size: 13px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .04em; }
.plan b { display: block; font-size: 30px; margin: 6px 0 8px; }
.plan p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.plan-pay { color: var(--ink-3); font-size: 14px; margin: 14px 0 0; }
@media (max-width: 760px) {
  .sys-cards, .plans { grid-template-columns: 1fr; }
  .sys-card { padding: 20px; }
  .sys-change { margin-left: auto; margin-right: 8px; font-size: 12px; }
  .hero.choix { padding-top: 24px; }
  .hero.choix .hero-logo { height: 84px; }
  .hero.choix h1 { font-size: 28px; }
  .hero.choix .lead { margin-bottom: 4px; }
}
/* téléphone : « Changer de système » passe de l'en-tête (trop étroit) au-dessous des boutons de l'accueil */
.sys-change-m { display: none; }
@media (max-width: 560px) {
  .top .sys-change { display: none; }
  .sys-change-m { display: inline-block; margin-top: 14px; font-size: 14px; color: var(--blue); }
}
.top-actions .btn { white-space: nowrap; }
@media (max-width: 560px) { .top .sys-pill { display: none; } }
