/* Voidlabs IA — nuit violette, accents cyan (même famille que Crates). */
:root {
  --bg: #0b0918;
  --bg-2: #110e22;
  --panel: #161230;
  --panel-2: #1c1740;
  --line: rgba(160, 140, 255, 0.14);
  --line-2: rgba(160, 140, 255, 0.28);
  --text: #eeebff;
  --muted: #a39dcc;
  --faint: #6f6a99;
  --violet: #9a6cff;
  --cyan: #5fe8f0;
  --red: #ff6b7d;
  --green: #6be3a0;
  --amber: #ffc46b;
  --radius: 12px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); }
button { font: inherit; color: inherit; cursor: pointer; }
svg { width: 20px; height: 20px; fill: currentColor; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }

/* Boutons et champs */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 650; white-space: nowrap; text-decoration: none; color: var(--text);
  transition: background .15s, border-color .15s, transform .08s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: linear-gradient(135deg, var(--violet), #6d5cff); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: rgba(255, 255, 255, .04); border-color: var(--line); }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.btn.danger { color: var(--red); border-color: rgba(255, 107, 125, .35); background: transparent; }
.btn.success { color: var(--green); border-color: rgba(107, 227, 160, .4); background: rgba(107, 227, 160, .08); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 40px; padding: 0; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], textarea, select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: rgba(5, 4, 14, .6); color: var(--text); font: inherit; outline: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--cyan); }
.msg { min-height: 20px; margin: 4px 0 10px; font-size: 13px; color: var(--red); }
.msg.ok { color: var(--green); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 14px; }

/* Connexion */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background: radial-gradient(800px 500px at 80% -10%, rgba(154, 108, 255, .2), transparent), radial-gradient(600px 400px at 0% 110%, rgba(95, 232, 240, .1), transparent); }
.login-card { width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 28px; }
.login-logo { width: 52px; height: 52px; }
.login-card h1 { margin: 12px 0 2px; font-size: 26px; letter-spacing: .3px; }
.login-card p.muted { margin: 0 0 22px; }
.login-card .login-foot { margin: 16px 0 0; font-size: 13px; text-align: center; }

/* Structure */
.app { display: grid; grid-template-columns: 264px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; background: var(--bg-2); border-right: 1px solid var(--line); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-weight: 800; font-size: 18px; letter-spacing: .3px; color: var(--text); text-decoration: none; }
.brand img { width: 32px; height: 32px; }
.brand b { color: var(--cyan); }
.nav { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border-radius: 10px; color: var(--muted); font-weight: 600; text-decoration: none; }
.nav:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.nav.active { background: rgba(154, 108, 255, .16); color: var(--text); }
.side-modules { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; }
.side-modules .label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); font-weight: 700; padding: 0 12px 6px; }
.side-mod { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 13.5px; }
.side-mod:hover { background: rgba(255, 255, 255, .04); color: var(--text); }
.side-mod.active { color: var(--text); background: rgba(255, 255, 255, .05); }
.side-mod .num { flex: none; width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: rgba(154, 108, 255, .14); color: var(--violet); }
.side-mod.complete .num { background: rgba(107, 227, 160, .16); color: var(--green); }
.side-mod .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { margin-top: auto; padding: 16px 8px 0; display: flex; flex-direction: column; gap: 12px; }
.side-progress { font-size: 12px; color: var(--muted); }
.who { font-size: 13px; color: var(--muted); font-weight: 600; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 28px; background: rgba(11, 9, 24, .86); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 4px; min-width: 0; flex: 1; overflow: hidden; font-weight: 600; }
.crumbs a { color: var(--muted); text-decoration: none; padding: 4px 6px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; max-width: 260px; }
.crumbs a:hover { background: rgba(255, 255, 255, .05); color: var(--text); }
.crumbs span.cur { color: var(--text); padding: 4px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.crumbs .sep { color: var(--faint); }
.view { padding: 28px; flex: 1; }
.scrim { display: none; }

/* Barres de progression */
.bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--violet), var(--cyan)); transition: width .4s; }

/* Accueil */
.hero { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 20px; padding: 32px; margin-bottom: 28px;
  background: radial-gradient(600px 300px at 100% 0%, rgba(154, 108, 255, .25), transparent), radial-gradient(500px 260px at 0% 100%, rgba(95, 232, 240, .1), transparent), var(--panel); }
.hero h1 { margin: 0 0 8px; font-size: 30px; line-height: 1.2; letter-spacing: -.3px; }
.hero p { margin: 0 0 22px; color: var(--muted); max-width: 640px; }
.hero .stats { display: flex; flex-wrap: wrap; gap: 26px; margin-bottom: 22px; }
.hero .stat b { display: block; font-size: 22px; }
.hero .stat span { font-size: 12.5px; color: var(--muted); }
.hero .bar { max-width: 520px; margin-bottom: 22px; height: 8px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); font-weight: 700; margin: 0 0 14px; }
.modules { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.mod-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.mod-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.mod-card .head { display: flex; align-items: center; gap: 10px; }
.mod-card .num { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: rgba(154, 108, 255, .16); color: var(--violet); }
.mod-card.complete .num { background: rgba(107, 227, 160, .16); color: var(--green); }
.mod-card h3 { margin: 0; font-size: 16.5px; line-height: 1.3; }
.mod-card p { margin: 0; color: var(--muted); font-size: 13.5px; flex: 1; }
.mod-card .meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--faint); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .3px; background: rgba(255, 196, 107, .14); color: var(--amber); }
.tag.green { background: rgba(107, 227, 160, .14); color: var(--green); }
.tag.violet { background: rgba(154, 108, 255, .16); color: var(--violet); }
.tag.red { background: rgba(255, 107, 125, .14); color: var(--red); }

/* Module */
.mod-head { max-width: 820px; margin-bottom: 26px; }
.mod-head .kicker { color: var(--violet); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.mod-head h1 { margin: 6px 0 8px; font-size: 28px; line-height: 1.2; }
.mod-head p { color: var(--muted); margin: 0 0 16px; }
.lessons { max-width: 820px; display: flex; flex-direction: column; gap: 8px; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--text); }
.lesson-row:hover { border-color: var(--line-2); background: var(--panel-2); }
.lesson-row .dot { flex: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--faint); }
.lesson-row.done .dot { border-color: var(--green); background: var(--green); color: #0b0918; }
.lesson-row .t { flex: 1; min-width: 0; font-weight: 600; }
.lesson-row .info { display: flex; gap: 10px; align-items: center; font-size: 12.5px; color: var(--faint); white-space: nowrap; }

/* Leçon */
.lesson-wrap { display: grid; grid-template-columns: minmax(0, 760px) 220px; gap: 48px; justify-content: center; }
.toc { position: sticky; top: 86px; align-self: start; font-size: 13px; }
.toc .label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); font-weight: 700; margin-bottom: 8px; }
.toc a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line); color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc a:hover, .toc a.on { color: var(--text); border-left-color: var(--cyan); }
.lesson-top .kicker { color: var(--violet); font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; text-decoration: none; }
.lesson-top h1 { margin: 6px 0 10px; font-size: 32px; line-height: 1.2; letter-spacing: -.3px; }
.lesson-top .info { display: flex; gap: 12px; align-items: center; color: var(--faint); font-size: 13px; margin-bottom: 26px; }

.prose { font-size: 16px; line-height: 1.7; }
.prose h2 { font-size: 22px; margin: 40px 0 12px; line-height: 1.3; scroll-margin-top: 80px; }
.prose h3 { font-size: 18px; margin: 30px 0 10px; scroll-margin-top: 80px; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; }
.prose li { margin: 4px 0; }
.prose li > p { margin: 0 0 6px; }
.prose strong { color: #fff; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }
.prose code { font-family: var(--mono); font-size: .88em; padding: 2px 6px; border-radius: 6px; background: rgba(154, 108, 255, .14); color: #d9ccff; }
.prose pre { position: relative; margin: 0 0 18px; padding: 16px 18px; border-radius: 12px; background: #07060f; border: 1px solid var(--line); overflow-x: auto; line-height: 1.55; }
.prose pre code { padding: 0; background: none; color: #dcd8f5; font-size: 13.5px; }
.prose pre .lang { position: absolute; top: 8px; right: 10px; font: 600 11px var(--mono); color: var(--faint); text-transform: lowercase; pointer-events: none; }
.prose pre .copy { position: absolute; top: 6px; right: 6px; height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--panel); color: var(--muted); font-size: 12px; opacity: 0; transition: opacity .15s; }
.prose pre:hover .copy, .prose pre .copy:focus { opacity: 1; }
.prose pre:hover .lang { opacity: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 14.5px; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--muted); font-weight: 650; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; }
.prose blockquote { margin: 0 0 18px; padding: 12px 18px; border-left: 3px solid var(--line-2); background: rgba(255, 255, 255, .025); border-radius: 0 10px 10px 0; color: var(--muted); }
.prose blockquote > :last-child { margin-bottom: 0; }
/* Encadrés GitHub : > [!NOTE], [!TIP], [!IMPORTANT], [!WARNING], [!CAUTION] */
.prose blockquote[class^="markdown-alert"] { color: var(--text); border-left-width: 3px; }
.prose blockquote[class^="markdown-alert"]::before { display: block; font-weight: 750; font-size: 13px; text-transform: uppercase; letter-spacing: .8px; margin-bottom: 6px; }
.prose .markdown-alert-note { border-color: var(--cyan); background: rgba(95, 232, 240, .06); }
.prose .markdown-alert-note::before { content: "À savoir"; color: var(--cyan); }
.prose .markdown-alert-tip { border-color: var(--green); background: rgba(107, 227, 160, .06); }
.prose .markdown-alert-tip::before { content: "Astuce"; color: var(--green); }
.prose .markdown-alert-important { border-color: var(--violet); background: rgba(154, 108, 255, .08); }
.prose .markdown-alert-important::before { content: "Important"; color: var(--violet); }
.prose .markdown-alert-warning { border-color: var(--amber); background: rgba(255, 196, 107, .06); }
.prose .markdown-alert-warning::before { content: "Attention"; color: var(--amber); }
.prose .markdown-alert-caution { border-color: var(--red); background: rgba(255, 107, 125, .06); }
.prose .markdown-alert-caution::before { content: "Danger"; color: var(--red); }
.prose .exercise { margin: 26px 0; padding: 18px 20px 4px; border-radius: 14px; border: 1px solid rgba(95, 232, 240, .3); background: linear-gradient(180deg, rgba(95, 232, 240, .07), rgba(95, 232, 240, .02)); }
.prose .exercise-title { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--cyan); margin-bottom: 10px; font-size: 14px; text-transform: uppercase; letter-spacing: .8px; }
.prose .exercise-title::before { content: ""; width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.2L4 16.8V20h3.2l5.3-5.3a4 4 0 0 0 5.2-5.4l-2.4 2.4-2.6-.6-.6-2.6z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14.7 6.3a4 4 0 0 0-5.4 5.2L4 16.8V20h3.2l5.3-5.3a4 4 0 0 0 5.2-5.4l-2.4 2.4-2.6-.6-.6-2.6z' fill='none' stroke='black' stroke-width='2' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat; }
.prose details.solution { margin: -10px 0 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.prose details.solution summary { cursor: pointer; padding: 12px 16px; font-weight: 650; color: var(--muted); }
.prose details.solution[open] summary { border-bottom: 1px solid var(--line); color: var(--text); }
.prose details.solution > :not(summary) { margin-left: 16px; margin-right: 16px; }
.prose details.solution > :nth-child(2) { margin-top: 14px; }

/* Quiz */
.quiz-box { margin: 30px 0; padding: 22px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--panel); }
.quiz-box > h3 { margin: 0 0 4px !important; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.quiz-box > .hint { color: var(--faint); font-size: 13px; margin-bottom: 18px; }
.q { margin: 0 0 20px; }
.q-prompt { font-weight: 650; margin-bottom: 10px; }
.q-prompt .multi { font-weight: 500; color: var(--faint); font-size: 13px; }
.choice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; margin-bottom: 6px; border-radius: 10px; border: 1px solid var(--line); cursor: pointer; font-size: 15px; line-height: 1.5; }
.choice:hover { background: rgba(255, 255, 255, .03); }
.choice input { margin: 4px 0 0; accent-color: var(--violet); }
.choice.right { border-color: rgba(107, 227, 160, .6); background: rgba(107, 227, 160, .08); }
.choice.wrong { border-color: rgba(255, 107, 125, .6); background: rgba(255, 107, 125, .07); }
.q-expl { margin-top: 8px; padding: 10px 14px; border-radius: 10px; background: rgba(255, 255, 255, .03); font-size: 14.5px; color: var(--muted); }
.q-expl > :last-child { margin-bottom: 0; }
.q-expl .verdict { font-weight: 700; margin-right: 6px; }
.q-expl .verdict.ok { color: var(--green); }
.q-expl .verdict.ko { color: var(--red); }
.quiz-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.quiz-score { font-weight: 700; }

.lesson-end { margin: 40px 0 10px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.lesson-end .done-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); text-decoration: none; color: var(--text); min-width: 0; }
.pager a:hover { border-color: var(--line-2); }
.pager a span { font-size: 12px; color: var(--faint); }
.pager a b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pager a.next { text-align: right; grid-column: 2; }

/* Pages simples (compte, admin) */
.page { max-width: 980px; }
.page h1 { margin: 0 0 6px; font-size: 26px; }
.page > p.muted { margin: 0 0 24px; }
.card { padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); margin-bottom: 18px; }
.card h2 { margin: 0 0 14px; font-size: 17px; }
.card.narrow { max-width: 480px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.table th { color: var(--faint); font-weight: 650; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.table tr.click { cursor: pointer; }
.table tr.click:hover td { background: rgba(255, 255, 255, .025); }
.table .bar { width: 120px; display: inline-block; vertical-align: middle; margin-right: 8px; }
.table-wrap { overflow-x: auto; }
.linkbox { display: flex; gap: 8px; margin-top: 12px; }
.linkbox input { font-family: var(--mono); font-size: 12.5px; }
.empty { padding: 30px; text-align: center; color: var(--faint); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 11px 18px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); box-shadow: 0 10px 40px rgba(0, 0, 0, .4); font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); }
.toast.error { border-color: rgba(255, 107, 125, .5); color: var(--red); }

/* Recherche (barre latérale) */
.search { position: relative; margin: 0 4px 10px; }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--faint); pointer-events: none; }
input[type=search] { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(5, 4, 14, .6); color: var(--text); font: inherit; outline: none; }
input[type=search]:focus { border-color: var(--cyan); }
.search input { padding-left: 32px; font-size: 14px; }
.results { display: flex; flex-direction: column; gap: 10px; max-width: 820px; }
.result { display: block; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; }
.result:hover { border-color: var(--line-2); background: var(--panel-2); }
.result-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.result p { margin: 0; color: var(--muted); font-size: 14px; }
.result mark { background: rgba(95, 232, 240, .2); color: var(--text); border-radius: 4px; padding: 0 2px; }
.note-text { white-space: pre-wrap; }

/* Notes de leçon */
.note-card { padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.note-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.note-status { font-size: 12.5px; }
.note-card textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.card.notice { border-color: rgba(255, 196, 107, .35); background: rgba(255, 196, 107, .06); font-size: 14px; }

/* Glossaire */
.glossary-tools { display: flex; flex-direction: column; gap: 12px; max-width: 820px; margin-bottom: 18px; }
.letters { display: flex; flex-wrap: wrap; gap: 4px; }
.letters a { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; background: rgba(255, 255, 255, .04); color: var(--muted); text-decoration: none; font-weight: 700; font-size: 13px; }
.letters a:hover { color: var(--text); background: rgba(154, 108, 255, .16); }
.terms { max-width: 820px; }
.letter { font-size: 22px; font-weight: 800; color: var(--violet); margin: 22px 0 6px; scroll-margin-top: 80px; }
.term { padding: 12px 16px; border-radius: 12px; border: 1px solid transparent; scroll-margin-top: 90px; transition: border-color .4s, background .4s; }
.term h3 { margin: 0 0 4px; font-size: 16.5px; }
.term h3 a { color: var(--text); text-decoration: none; }
.term .prose { font-size: 15px; }
.term .prose > :last-child { margin-bottom: 0; }
.term.flash { border-color: var(--cyan); background: rgba(95, 232, 240, .06); }

/* Fiche mémo */
.memo-page { max-width: 860px; }
.kicker-link { color: var(--violet); font-weight: 700; font-size: 13px; text-decoration: none; }
.prose.memo { font-size: 15px; line-height: 1.6; }
.prose.memo h2 { font-size: 18px; margin: 26px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.print-only { display: none; }

/* Attestation */
.criteria { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 10px; }
.criteria li { display: flex; gap: 10px; align-items: flex-start; color: var(--muted); }
.criteria li.ok { color: var(--text); }
.check-dot { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-size: 12px; font-weight: 800; }
.criteria li.ok .check-dot { border-color: var(--green); background: var(--green); color: #0b0918; }
.certificate { max-width: 760px; text-align: center; padding: 44px 36px; border-radius: 20px; border: 1px solid var(--line-2);
  background: radial-gradient(500px 260px at 50% 0%, rgba(154, 108, 255, .22), transparent), var(--panel); }
.certificate p { margin: 0 0 6px; color: var(--muted); }
.cert-logo { width: 56px; height: 56px; }
.cert-kicker { margin: 14px 0 22px; font-size: 12.5px; text-transform: uppercase; letter-spacing: 2px; color: var(--violet); font-weight: 750; }
.cert-name { font-size: 34px; font-weight: 800; letter-spacing: -.3px; margin-bottom: 8px; }
.cert-title { font-size: 22px; font-weight: 700; color: var(--cyan); margin: 6px 0 22px; }
.cert-detail { font-size: 14px; }
.certificate .cert-verify { margin-top: 26px; font-size: 12px; color: var(--faint); word-break: break-all; }

/* Statistiques des quiz */
.qstat { border-top: 1px solid var(--line); }
.qstat summary { display: flex; align-items: center; gap: 14px; padding: 12px 4px; cursor: pointer; list-style: none; }
.qstat summary::-webkit-details-marker { display: none; }
.qstat .t { flex: 1; min-width: 0; font-weight: 600; }
.qstat .meta { font-size: 12.5px; white-space: nowrap; }
.rate { flex: none; width: 56px; text-align: center; padding: 3px 0; border-radius: 8px; font-weight: 800; font-size: 13px; }
.rate.low { background: rgba(255, 107, 125, .16); color: var(--red); }
.rate.mid { background: rgba(255, 196, 107, .14); color: var(--amber); }
.rate.high { background: rgba(107, 227, 160, .14); color: var(--green); }
.picks { display: flex; flex-direction: column; gap: 8px; padding: 4px 4px 12px 74px; }
.pick { display: grid; grid-template-columns: 28px 120px 1fr auto; gap: 10px; align-items: center; font-size: 14px; color: var(--muted); }
.pick.good { color: var(--text); }
.pick-n { font-weight: 700; text-align: right; }

/* Page publique */
.public { min-height: 100vh; background: radial-gradient(900px 520px at 85% -10%, rgba(154, 108, 255, .22), transparent), radial-gradient(700px 420px at -10% 40%, rgba(95, 232, 240, .08), transparent), var(--bg); }
.pub-bar { max-width: 1080px; margin: 0 auto; padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; }
.pub-bar .brand { padding: 0; }
.pub-hero { max-width: 1080px; margin: 0 auto; padding: 64px 24px 40px; }
.pub-kicker { color: var(--cyan); font-weight: 750; font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 14px; }
.pub-hero h1 { margin: 0 0 18px; font-size: 54px; line-height: 1.05; letter-spacing: -1.2px; }
.pub-hero h1 span { background: linear-gradient(90deg, var(--violet), var(--cyan)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pub-hero > p { max-width: 660px; font-size: 18px; color: var(--muted); margin: 0 0 28px; }
.pub-hero .stats { display: flex; flex-wrap: wrap; gap: 34px; margin-top: 44px; }
.pub-hero .stat b { display: block; font-size: 28px; }
.pub-hero .stat span { color: var(--muted); font-size: 13px; }
.pub-section { max-width: 1080px; margin: 0 auto; padding: 36px 24px; }
.pub-section h2 { font-size: 26px; margin: 0 0 18px; letter-spacing: -.3px; }
.pub-section > p { max-width: 720px; color: var(--muted); font-size: 16px; margin: 0 0 26px; }
.features, .tools { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.feature, .tool { padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); }
.feature h3 { margin: 0 0 6px; font-size: 16.5px; }
.feature p { margin: 0; color: var(--muted); font-size: 14.5px; }
.tool b { display: block; color: var(--cyan); margin-bottom: 4px; }
.tool span { color: var(--muted); font-size: 14.5px; }
.pub-program { display: flex; flex-direction: column; gap: 8px; }
.pub-mod { border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.pub-mod summary { display: flex; align-items: center; gap: 14px; padding: 14px 16px; cursor: pointer; list-style: none; }
.pub-mod summary::-webkit-details-marker { display: none; }
.pub-mod .num { flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: rgba(154, 108, 255, .16); color: var(--violet); }
.pub-mod .t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pub-mod .t span { color: var(--muted); font-size: 13.5px; }
.pub-mod .meta { color: var(--faint); font-size: 13px; white-space: nowrap; }
.pub-mod ol { margin: 0; padding: 0 16px 14px 62px; display: flex; flex-direction: column; gap: 6px; }
.pub-mod li { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.pub-foot { max-width: 1080px; margin: 0 auto; padding: 30px 24px 50px; color: var(--faint); font-size: 13px; }
.pub-foot a { color: var(--muted); }
.pub-verify { max-width: 820px; margin: 0 auto; padding: 40px 24px; }
.pub-verify .certificate { margin: 0 auto; }
.verified { text-align: center; color: var(--green); font-weight: 700; margin: 0 0 18px; }

/* Vitrine : bienfaits, comparaison, tarif, questions, demande d'inscription */
input[type=email] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: rgba(5, 4, 14, .6); color: var(--text); font: inherit; outline: none; }
input[type=email]:focus { border-color: var(--cyan); }
.pub-link { color: var(--muted); font-weight: 650; text-decoration: none; padding: 0 6px; }
.pub-link:hover { color: var(--text); }
.benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.benefit { padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--panel); border-top: 2px solid var(--violet); }
.benefit:nth-child(3n+2) { border-top-color: var(--cyan); }
.benefit:nth-child(3n) { border-top-color: var(--green); }
.benefit h3 { margin: 0 0 8px; font-size: 17px; }
.benefit p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.compare { width: 100%; min-width: 620px; border-collapse: collapse; font-size: 14.5px; }
.compare th, .compare td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare th { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--faint); }
.compare td:first-child { font-weight: 700; color: var(--text); white-space: nowrap; }
.compare td:nth-child(2) { color: var(--faint); }
.compare td:nth-child(3) { color: var(--text); }
.compare th:nth-child(3) { color: var(--cyan); }
.price-wrap { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 28px; align-items: start; }
.price-card { padding: 28px; border-radius: 20px; border: 1px solid var(--line-2);
  background: radial-gradient(420px 220px at 100% 0%, rgba(154, 108, 255, .22), transparent), var(--panel); }
.price-label { color: var(--cyan); font-weight: 750; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.price { font-size: 52px; font-weight: 800; letter-spacing: -1px; line-height: 1.1; margin: 8px 0 6px; font-variant-numeric: tabular-nums; }
.price-note { margin: 0 0 18px; color: var(--muted); font-size: 13.5px; }
.includes { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-direction: column; gap: 9px; }
.includes li { position: relative; padding-left: 26px; font-size: 14.5px; color: var(--muted); }
.includes li strong { color: var(--text); }
.includes li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: rgba(107, 227, 160, .16); color: var(--green); }
.price-side h3 { margin: 4px 0 6px; font-size: 16.5px; }
.price-side p { margin: 0 0 20px; color: var(--muted); font-size: 14.5px; max-width: 60ch; }
.faqs { display: flex; flex-direction: column; gap: 8px; max-width: 820px; }
.faq { border-radius: 12px; border: 1px solid var(--line); background: var(--panel); }
.faq summary { padding: 14px 16px; cursor: pointer; font-weight: 650; }
.faq p { margin: 0; padding: 0 16px 16px; color: var(--muted); font-size: 14.5px; }
.req-box { max-width: 640px; padding: 24px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--panel); }
.req-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.req-form textarea { resize: vertical; }
.req-form .check { align-items: flex-start; }
.req-form .check input { margin-top: 4px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.req-done b { display: block; font-size: 18px; color: var(--green); margin-bottom: 6px; }
.req-done p { margin: 0; color: var(--muted); }
/* Demandes (page Élèves) */
.req-list { display: flex; flex-direction: column; gap: 10px; }
.req-item { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.req-item.done { opacity: .6; }
.req-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 6px; }
.req-msg { margin: 6px 0 10px; color: var(--muted); font-size: 14px; white-space: pre-wrap; }
@media (max-width: 860px) {
  .price-wrap { grid-template-columns: 1fr; }
  .req-grid { grid-template-columns: 1fr; }
  .price { font-size: 44px; }
  .benefits { grid-template-columns: 1fr; }
}

@media (max-width: 1180px) {
  .lesson-wrap { grid-template-columns: minmax(0, 760px); }
  .toc { display: none; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 30; left: 0; top: 0; width: 280px; max-width: 86vw; transform: translateX(-100%); transition: transform .2s; }
  .app.menu-open .side { transform: none; }
  .app.menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(0, 0, 0, .5); }
  .menu-btn { display: inline-flex; }
  .top { padding: 8px 16px; }
  .view { padding: 20px 16px; }
  .hero { padding: 22px; }
  .hero h1 { font-size: 24px; }
  .lesson-top h1 { font-size: 26px; }
  .prose { font-size: 15.5px; }
  .pager { grid-template-columns: 1fr; }
  .pager a.next { grid-column: auto; }
  .table .hide-sm { display: none; }
  .pub-hero { padding: 36px 16px 24px; }
  .pub-hero h1 { font-size: 38px; }
  .pub-hero > p { font-size: 16px; }
  .pub-section { padding: 26px 16px; }
  .pub-bar { padding: 14px 16px; }
  .pub-mod .meta { display: none; }
  .pub-mod ol { padding-left: 36px; }
  .picks { padding-left: 4px; }
  .pick { grid-template-columns: 24px 60px 1fr; }
  .pick .tag { display: none; }
  .qstat .meta { display: none; }
  .certificate { padding: 30px 18px; }
  .cert-name { font-size: 26px; }
}

/* Impression (fiches mémo, attestation, notes) : noir sur blanc, sans le menu. */
@media print {
  :root { --text: #111; --muted: #333; --faint: #666; --line: #ccc; --line-2: #bbb; --violet: #5b32c8; --cyan: #0b6b73; --panel: #fff; }
  html { color-scheme: light; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .side, .top, .scrim, .toast, .no-print, .pub-bar, .note-card, .lesson-end { display: none !important; }
  .print-only { display: block; }
  .print-brand { font-size: 9pt; color: #666; margin-bottom: 6pt; }
  .app { display: block; }
  .view { padding: 0; }
  .card, .result, .certificate, .prose pre { background: #fff !important; border-color: #ccc; }
  .prose strong { color: #000; }
  .prose code { background: #eee; color: #111; }
  .prose pre code { color: #111; }
  .prose pre .copy, .prose pre .lang { display: none; }
  .prose.memo h2 { break-after: avoid; }
  .prose pre, .prose table, .prose blockquote { break-inside: avoid; }
  .certificate { border: 2px solid #5b32c8; padding: 60px 40px; margin-top: 40px; }
  .public { background: #fff; }
  a { color: #111; text-decoration: none; }
}
