:root {
  /* Charte VAV : bleu nuit #0a0f27, bleus #153a5b / #1f5a85 / #7c90ad, gris #e6e7e4, sable #e3caab / #efe4d2 */
  --navy: #0a0f27;
  --bg: #F6F4EF;
  --surface: #FFFFFF;
  --surface-2: #ECEDEA;
  --ink: #0a0f27;
  --ink-soft: #46516B;
  --ink-faint: #66738F;
  --border: #DCDDD8;
  --accent: #1f5a85;
  --accent-soft: color-mix(in srgb, var(--accent) 9%, var(--surface));
  --accent-ink: color-mix(in srgb, var(--accent) 62%, #0a0f27);
  --on-accent: #FFFFFF;
  --sand: #e3caab;
  --sand-soft: #efe4d2;
  --before: #8a6a3d;
  --before-soft: #efe4d2;
  --danger: #B23B3B;
  --danger-soft: #F7E6E6;
  --ok: #1F7A4D;
  --ok-soft: #E4F2EA;
  --warn-soft: #efe4d2;
  --shadow: 0 1px 2px rgba(10, 15, 39, 0.05), 0 8px 24px -12px rgba(10, 15, 39, 0.16);
  --radius: 12px;
  --font-body: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Newsreader', Georgia, 'Times New Roman', serif;
  --font-mono: 'Spline Sans Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #080c1e; --surface: #0f1630; --surface-2: #16203f; --ink: #EEF0F4; --ink-soft: #A9B3C8;
    --ink-faint: #8B97B1; --border: #232d4d;
    --accent-soft: color-mix(in srgb, var(--accent) 24%, var(--surface));
    --accent-ink: color-mix(in srgb, var(--accent) 40%, #fff);
    --sand-soft: #2a2a30; --before-soft: #2a2a30; --before: #e3caab;
    --danger: #E17272; --danger-soft: #3A2320; --ok: #56C28C; --ok-soft: #12352a; --warn-soft: #2a2a30;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 12px 28px -14px rgba(0, 0, 0, 0.6);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55;
  -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.18; margin: 0 0 .5em; text-wrap: balance; }
h1 { font-style: italic; font-weight: 600; font-size: clamp(28px, 4vw, 40px); }
h2 { font-weight: 600; font-size: 22px; }
h3 { font-weight: 600; font-size: 18px; }
p { margin: 0 0 1em; }
a { color: var(--accent-ink); }
img { max-width: 100%; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-faint); }
.soft { color: var(--ink-soft); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.icon.fill { fill: currentColor; stroke: none; }

/* ---------- Boutons, champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-size: 15px; font-weight: 600; cursor: pointer;
  padding: 10px 18px; border-radius: 9px; border: 1px solid transparent; background: var(--accent); color: var(--on-accent);
  text-decoration: none; transition: filter .15s, background .15s, border-color .15s; line-height: 1.2;
}
.btn:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--border); }
.btn.ghost:hover { border-color: var(--ink-faint); filter: none; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn.block { display: flex; width: 100%; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-ink); text-decoration: underline; cursor: pointer; font-size: inherit; }
label.fld { display: block; margin-bottom: 14px; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
label.fld > span { display: block; margin-bottom: 5px; }
label.fld small { display: block; font-weight: 400; color: var(--ink-faint); margin-top: 4px; font-size: 12.5px; }
input[type='text'], input[type='email'], input[type='password'], input[type='number'], input[type='date'], input[type='datetime-local'], input[type='url'], select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px;
}
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input[type='checkbox'], input[type='radio'] { accent-color: var(--accent); width: 17px; height: 17px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
@media (max-width: 640px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.card + .card { margin-top: 16px; }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-ink);
  background: var(--accent-soft); display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px; border-radius: 5px; margin-bottom: 14px;
}
.label { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 10px; border-radius: 99px; background: var(--surface-2); color: var(--ink-soft); border: 1px solid var(--border); }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.warn { background: var(--warn-soft); }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.chip.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
button.chip { cursor: pointer; font-family: inherit; }
button.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.err { color: var(--danger); font-size: 14px; margin: 8px 0; }
.notice { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); border-radius: 10px; padding: 12px 16px; margin: 0 0 18px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; }

/* ---------- Barre de progression ---------- */
.meter { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 6px; transition: width .4s ease; }
.meter.sm { height: 6px; }

/* ---------- Structure générale ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.topbar-in { max-width: 1240px; margin: 0 auto; padding: 10px 20px; display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-head); font-style: italic; font-weight: 600; font-size: 20px; white-space: nowrap; }
.brand img { height: 30px; width: auto; border-radius: 4px; }
.nav { display: flex; gap: 4px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav a { padding: 7px 12px; border-radius: 8px; text-decoration: none; color: var(--ink-soft); font-size: 14.5px; font-weight: 500; white-space: nowrap; }
.nav a:hover { background: var(--surface-2); }
.nav a.on { background: var(--accent-soft); color: var(--accent-ink); }
.gprog { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.gprog .meter { flex: 1; height: 8px; }
.gprog b { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.usermenu { position: relative; }
.usermenu > button { background: none; border: 1px solid var(--border); border-radius: 99px; padding: 5px 12px 5px 6px; display: flex; align-items: center; gap: 8px; cursor: pointer; color: var(--ink); font-size: 14px; }
.avatar { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--on-accent); display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.usermenu .pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); min-width: 200px; padding: 8px; }
.usermenu .pop .who { padding: 8px 10px; font-size: 13px; color: var(--ink-faint); border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.usermenu .pop button { width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 6px; cursor: pointer; font-size: 14px; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.usermenu .pop button:hover { background: var(--surface-2); }
@media (max-width: 1140px) {
  .topbar-in { flex-wrap: wrap; gap: 8px 14px; padding: 8px 14px; }
  .nav { order: 3; flex-basis: 100%; }
  .gprog { min-width: 0; flex: 1; justify-content: flex-end; }
  .brand span { font-size: 17px; }
}
@media (max-width: 640px) { .usermenu > button span.nm { display: none; } }
.wrap { max-width: 1240px; margin: 0 auto; padding: 28px 20px 80px; }
.wrap.narrow { max-width: 860px; }
.page-head { margin-bottom: 22px; }
.page-head p { color: var(--ink-soft); max-width: 62ch; }

/* ---------- Connexion ---------- */
.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 440px; }
.login-card .brand { justify-content: center; margin-bottom: 8px; font-size: 26px; }
.login-card .tagline { text-align: center; color: var(--ink-soft); margin-bottom: 22px; }
.code-input { font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase; }

/* ---------- Accueil ---------- */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 8px 0 28px; }
.hero-tile { background: var(--surface); padding: 24px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.hero-tile.lead { background: var(--navy); color: #EEF0F4; }
.hero-tile.lead .label { color: var(--sand); }
.hero-tile.lead .meter { background: rgba(255,255,255,.16); }
.hero-tile.lead .meter > i { background: var(--sand); }
.hero-tile.lead .muted { color: #A9B3C8; }
.hero-tile.lead .btn { background: var(--sand); color: var(--navy); }
.hero-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: clamp(30px, 4vw, 44px); font-weight: 600; line-height: 1; color: var(--accent-ink); }
.hero-tile.lead .hero-value { color: var(--sand); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; } }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 28px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 12px; }
.step b { font-family: var(--font-mono); background: var(--accent); color: var(--on-accent); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; font-size: 14px; }
.step p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }
.section-title { font-family: var(--font-head); font-weight: 600; font-size: 22px; margin: 34px 0 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.testis { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.testi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.testi q { display: block; font-family: var(--font-head); font-style: italic; font-size: 18px; line-height: 1.4; quotes: '\00ab\00a0' '\00a0\00bb'; margin-bottom: 12px; }
.testi .who { font-size: 13.5px; color: var(--ink-faint); }
.testi .who b { color: var(--ink); }

.module { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.module > summary { list-style: none; cursor: pointer; padding: 18px 20px; display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; }
.module > summary::-webkit-details-marker { display: none; }
.mnum { width: 44px; height: 44px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; }
.module.done .mnum { background: var(--accent); color: var(--on-accent); }
.module h3 { margin: 0 0 2px; }
.module .desc { font-size: 14px; color: var(--ink-soft); margin: 0; }
.mmeta { text-align: right; min-width: 110px; }
.mmeta .meter { margin-top: 6px; }
.lessons { border-top: 1px solid var(--border); }
.lrow { display: flex; align-items: center; gap: 12px; padding: 12px 20px; text-decoration: none; color: var(--ink); border-bottom: 1px solid var(--border); font-size: 15px; }
.lrow:last-child { border-bottom: 0; }
.lrow:hover { background: var(--surface-2); }
.lrow .st { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; flex: none; font-size: 12px; color: var(--ink-faint); }
.lrow.done .st { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.lrow.locked { color: var(--ink-faint); cursor: not-allowed; }
.lrow .t { flex: 1; }
.lrow .d { font-size: 13px; color: var(--ink-faint); font-family: var(--font-mono); }
.lrow.current { background: var(--accent-soft); }

/* ---------- Leçon ---------- */
.lesson-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .lesson-layout { grid-template-columns: 1fr; } }
.outline { position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px; }
@media (max-width: 1000px) { .outline { position: static; max-height: none; order: 2; } }
.outline details > summary { list-style: none; cursor: pointer; padding: 10px 12px; font-weight: 600; font-size: 14px; display: flex; gap: 8px; align-items: center; border-radius: 8px; }
.outline details > summary::-webkit-details-marker { display: none; }
.outline details > summary:hover { background: var(--surface-2); }
.outline .o-lesson { display: flex; gap: 10px; align-items: flex-start; padding: 7px 12px 7px 20px; text-decoration: none; color: var(--ink-soft); font-size: 13.5px; border-radius: 8px; }
.outline .o-lesson:hover { background: var(--surface-2); }
.outline .o-lesson.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.outline .o-lesson .st { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border); flex: none; margin-top: 3px; display: grid; place-items: center; }
.outline .o-lesson.done .st { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.outline .o-lesson.done .st svg { width: 10px; height: 10px; stroke-width: 3.5; }
.outline .o-lesson.locked { color: var(--ink-faint); }
.lesson-title { margin-bottom: 18px; }
.crumbs { font-size: 13.5px; color: var(--ink-faint); margin-bottom: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.req { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin: 16px 0 22px; font-size: 14px; }
.req .item { display: flex; gap: 8px; align-items: center; color: var(--ink-soft); }
.req .item .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; color: var(--on-accent); }
.req .item.ok { color: var(--ink); }
.req .item.ok .dot { background: var(--accent); border-color: var(--accent); }
.req .item.ok .dot svg { width: 11px; height: 11px; stroke-width: 3.5; }
.req .end { margin-left: auto; }
.pending-video { background: var(--surface-2); border: 1px dashed var(--border); border-radius: var(--radius); padding: 40px 24px; text-align: center; color: var(--ink-soft); aspect-ratio: 16 / 9; display: grid; place-content: center; gap: 6px; }
.embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Lecteur */
.player { background: #000; border-radius: var(--radius); overflow: hidden; position: relative; display: flex; flex-direction: column; box-shadow: var(--shadow); color: #fff; }
.player .stage { position: relative; background: #000; }
.player video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.player:fullscreen, .player:-webkit-full-screen { border-radius: 0; }
.player:fullscreen .stage { flex: 1; min-height: 0; display: flex; }
.player:fullscreen video { aspect-ratio: auto; height: 100%; object-fit: contain; }
.player .big-play { position: absolute; inset: 0; margin: auto; width: 74px; height: 74px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(4px); }
.player .big-play svg { width: 32px; height: 32px; margin-left: 4px; }
.player .big-play:hover { background: #1f5a85; }
.player .controls { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #111; }
.player .controls button { background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; border-radius: 6px; display: grid; place-items: center; font-size: 13px; font-weight: 600; min-width: 34px; }
.player .controls button:hover { background: rgba(255, 255, 255, .14); }
.player .time { font-family: var(--font-mono); font-size: 12.5px; white-space: nowrap; opacity: .9; }
.player .seek { position: relative; flex: 1; height: 22px; display: flex; align-items: center; }
.player .seek .track { position: absolute; left: 0; right: 0; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.player .seek .seen { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255, 255, 255, .38); }
.player .seek .cur { position: absolute; left: 0; top: 0; bottom: 0; background: #e3caab; }
.player .seek input { position: absolute; inset: 0; width: 100%; margin: 0; opacity: 0; cursor: pointer; height: 22px; }
.player .seek .mk { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: #e3caab; border: 2px solid #111; pointer-events: none; }
.player .seek .mk.done { background: #56C28C; }
.player .seek:focus-within .track { outline: 2px solid #fff; }
.cp-overlay { position: absolute; inset: 0; background: rgba(12, 16, 13, .92); display: grid; place-items: center; padding: 18px; overflow: auto; z-index: 2; }
.cp-box { max-width: 560px; width: 100%; }
.cp-box .tag { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: #e3caab; margin-bottom: 8px; }
.cp-box h4 { font-family: var(--font-head); font-size: clamp(18px, 2.6vw, 24px); font-weight: 600; margin: 0 0 14px; color: #fff; }
.cp-opt { display: block; width: 100%; text-align: left; padding: 11px 14px; margin-bottom: 8px; border-radius: 9px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); color: #fff; font-size: 15px; cursor: pointer; }
.cp-opt:hover:not(:disabled) { background: rgba(255, 255, 255, .14); }
.cp-opt.good { border-color: #56C28C; background: rgba(86, 194, 140, .22); }
.cp-opt.bad { border-color: #E17272; background: rgba(225, 114, 114, .2); }
.cp-msg { margin: 10px 0; font-size: 14.5px; }
.cp-msg.good { color: #8FE3B5; }
.cp-msg.bad { color: #F3A5A5; }
@media (max-width: 560px) { .player .controls { gap: 4px; padding: 6px 8px; } .player .time { font-size: 11px; } .cp-opt { padding: 9px 12px; font-size: 14px; } }

/* ---------- Texte de leçon ---------- */
.prose { font-size: 17px; line-height: 1.65; }
.prose h2 { font-size: 24px; margin: 1.6em 0 .5em; }
.prose h3 { margin: 1.4em 0 .4em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1em; }
.prose li { margin-bottom: .35em; }
.prose blockquote { margin: 1.1em 0; padding: 14px 18px; background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: 0 10px 10px 0; font-family: var(--font-head); font-size: 19px; font-style: italic; }
.prose blockquote p:last-child { margin: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1.1em 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 600; }
.prose code { font-family: var(--font-mono); font-size: .9em; background: var(--surface-2); padding: 1px 6px; border-radius: 4px; }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }
.block-section { margin-top: 34px; }
.challenge { background: var(--warn-soft); border-radius: var(--radius); padding: 18px 22px; }
.challenge h3 { margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.resources a { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); text-decoration: none; margin-bottom: 8px; color: var(--ink); }
.resources a:hover { border-color: var(--accent); }

/* Quiz */
.quiz-q { margin-bottom: 20px; }
.quiz-q > p { font-weight: 600; margin-bottom: 8px; }
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 9px; margin-bottom: 8px; cursor: pointer; background: var(--surface); }
.opt:hover { border-color: var(--accent); }
.opt input { margin-top: 3px; }
.opt.good { border-color: var(--ok); background: var(--ok-soft); }
.opt.bad { border-color: var(--danger); background: var(--danger-soft); }
.expl { font-size: 14.5px; color: var(--ink-soft); margin: 4px 0 0 4px; }

/* Notes & questions */
.savedot { font-size: 12.5px; color: var(--ink-faint); margin-top: 4px; min-height: 18px; }
.thread { margin-top: 14px; }
.msg { background: var(--surface-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; font-size: 15px; white-space: pre-wrap; }
.msg.reply { background: var(--accent-soft); margin-left: 24px; }
.msg .who { font-size: 12.5px; color: var(--ink-faint); margin-bottom: 4px; }

.lnav { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--border); flex-wrap: wrap; }

/* ---------- Tableaux, cartes de listes ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-faint); padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-2); }
.tbl td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
a.tile { display: block; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: border-color .15s, transform .15s; }
a.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
a.tile h3 { margin-bottom: 6px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; }
.kpi b { display: block; font-family: var(--font-mono); font-size: 28px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi.lead { background: var(--navy); border-color: transparent; color: #A9B3C8; }
.kpi.lead b { color: var(--sand); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 8px; }
.bars .b { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 3px; position: relative; opacity: .9; }
.bars .b span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; font-family: var(--font-mono); color: var(--ink-soft); }
.bars-x { display: flex; gap: 6px; font-size: 10.5px; color: var(--ink-faint); font-family: var(--font-mono); margin-top: 4px; }
.bars-x span { flex: 1; text-align: center; }

/* ---------- Modale et toasts ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(10, 14, 11, .55); z-index: 60; display: grid; place-items: center; padding: 16px; overflow: auto; }
.modal { background: var(--surface); border-radius: 14px; width: 100%; max-width: 640px; max-height: calc(100vh - 32px); overflow: auto; padding: 24px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); }
.modal.wide { max-width: 980px; }
.modal h2 { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; width: min(92vw, 460px); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 10px; font-size: 14.5px; box-shadow: var(--shadow); animation: up .25s ease; }
.toast.ok { background: var(--accent); color: var(--on-accent); }
.toast.err { background: var(--danger); color: #fff; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Certificat ---------- */
.cert { background: #fff; color: #0a0f27; border: 10px double #0a0f27; border-radius: 6px; padding: 56px 40px; text-align: center; max-width: 900px; margin: 0 auto; box-shadow: var(--shadow); }
.cert .brand-name { font-family: var(--font-mono); letter-spacing: .18em; text-transform: uppercase; font-size: 13px; color: #8a6a3d; }
.cert h1 { font-size: clamp(30px, 5vw, 52px); margin: 18px 0 10px; color: #0a0f27; }
.cert .who { font-family: var(--font-head); font-style: italic; font-size: clamp(30px, 5vw, 46px); margin: 22px 0 6px; color: #1f5a85; border-bottom: 1px solid #e3caab; display: inline-block; padding: 0 30px 6px; }
.cert p { color: #4B524A; }
.cert .sign { margin-top: 44px; display: flex; justify-content: space-around; gap: 20px; font-size: 14px; }
.cert .sign div { border-top: 1px solid #7B8177; padding-top: 6px; min-width: 200px; }
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; }
  .topbar, .no-print, .toasts { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .cert { box-shadow: none; }
}

/* ---------- Simulateur intégré ---------- */
.frame-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.frame-wrap iframe { display: block; width: 100%; height: 1500px; border: 0; }
@media (max-width: 760px) { .frame-wrap iframe { height: 2300px; } }

/* ---------- Admin ---------- */
.admin-tabs { display: flex; flex-wrap: wrap; gap: 2px 4px; flex: 1; }
.admin-tabs a { padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--ink-soft); font-size: 14.5px; font-weight: 500; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.admin-tabs a:hover { background: var(--surface-2); }
.admin-tabs a.on { background: var(--accent-soft); color: var(--accent-ink); }
.badge { background: var(--danger); color: #fff; border-radius: 99px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.code { font-family: var(--font-mono); font-size: 13.5px; letter-spacing: .06em; background: var(--surface-2); padding: 3px 8px; border-radius: 6px; user-select: all; }
.mod-admin { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; }
.mod-admin > header { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.mod-admin > header h3 { margin: 0; flex: 1; min-width: 200px; }
.les-admin { display: flex; gap: 10px; align-items: center; padding: 9px 16px; border-bottom: 1px solid var(--border); font-size: 14.5px; flex-wrap: wrap; }
.les-admin:last-child { border-bottom: 0; }
.les-admin .t { flex: 1; min-width: 180px; }
.les-admin.off { opacity: .55; }
.icon-btn { background: none; border: 1px solid var(--border); border-radius: 7px; width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer; color: var(--ink-soft); }
.icon-btn:hover { border-color: var(--ink-faint); color: var(--ink); }
.editor-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; }
.editor-tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-size: 14.5px; color: var(--ink-soft); border-bottom: 2px solid transparent; white-space: nowrap; font-weight: 500; }
.editor-tabs button.on { color: var(--accent-ink); border-bottom-color: var(--accent); }
.qcard { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 12px; background: var(--surface); }
.qopt { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.qopt input[type='text'] { flex: 1; }
textarea.big { min-height: 260px; font-family: var(--font-mono); font-size: 13.5px; }
.uploadbar { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.uploadbar i { display: block; height: 100%; background: var(--accent); width: 0; }
.stack > * + * { margin-top: 14px; }

.prose-video { margin: 1.2em 0; max-width: 360px; }
.prose-video video { width: 100%; max-height: 520px; border-radius: 12px; background: #000; display: block; }
.prose-video figcaption { margin-top: 8px; font-size: 14px; color: var(--ink-faint); }
