/* ===== Révisions IESN · design system inspiré de Moodle 4 (thème Boost) =====
   Couleurs, typographie et composants calqués sur l'interface Moodle de l'école :
   barre de navigation blanche, tiroir « Index du cours », navigation secondaire,
   sections et activités à icônes colorées, quiz Moodle. Fonctionne hors ligne. */
:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
  --font-text: var(--font);
  --mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --bg: #ffffff; --page: #ffffff; --surface: #ffffff; --surface-solid: #ffffff; --surface-2: #f8f9fa; --surface-3: #e9ecef;
  --text: #1d2125; --muted: #6a737b; --border: #dee2e6; --border-strong: #ced4da;
  --primary: #0f6cbf; --primary-dark: #0c589c; --primary-ink: #ffffff; --primary-soft: #e7f0f9; --link: #0f6cbf;
  --ok: #357a32; --ok-soft: #d7e4d6; --ko: #ca3120; --ko-soft: #f4d6d2; --partial: #f0ad4e; --partial-ink: #8a5a0e; --partial-soft: #fcefdc;
  --info-blue: #008196; --info-soft: #cce6ea;
  --formulation: #e7f3f5; --formulation-border: #b8dce2; --info: #f8f9fa; --code-bg: #f8f9fa; --accent: #6f42c1;
  --act-admin: #5d63f6; --act-assess: #eb66a2; --act-collab: #f7634d; --act-comm: #11a676; --act-content: #399be2; --act-interface: #a378ff;
  --radius: .5rem; --radius-sm: .375rem;
  --shadow: 0 .125rem .25rem rgba(0,0,0,.075); --shadow-lg: 0 .5rem 1rem rgba(0,0,0,.15);
  --navbar-h: 60px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16181b; --page: #16181b; --surface: #1f2226; --surface-solid: #1f2226; --surface-2: #24282d; --surface-3: #2c3137;
    --text: #e3e6e8; --muted: #9aa4ad; --border: #343a40; --border-strong: #495057;
    --primary: #4c9be0; --primary-dark: #3b85c6; --primary-ink: #0b1620; --primary-soft: #1b2c3d; --link: #6cb0ec;
    --ok: #7cc777; --ok-soft: #1f3320; --ko: #f08070; --ko-soft: #3d201c; --partial: #f0ad4e; --partial-ink: #f3c27a; --partial-soft: #3a2d17;
    --info-blue: #4cc3d6; --info-soft: #173a40; --formulation: #18282c; --formulation-border: #2b4a51; --info: #24282d; --code-bg: #1a1d21;
    --shadow: 0 .125rem .25rem rgba(0,0,0,.4); --shadow-lg: 0 .5rem 1rem rgba(0,0,0,.5);
  }
}
:root[data-theme="dark"] {
  --bg: #16181b; --page: #16181b; --surface: #1f2226; --surface-solid: #1f2226; --surface-2: #24282d; --surface-3: #2c3137;
  --text: #e3e6e8; --muted: #9aa4ad; --border: #343a40; --border-strong: #495057;
  --primary: #4c9be0; --primary-dark: #3b85c6; --primary-ink: #0b1620; --primary-soft: #1b2c3d; --link: #6cb0ec;
  --ok: #7cc777; --ok-soft: #1f3320; --ko: #f08070; --ko-soft: #3d201c; --partial: #f0ad4e; --partial-ink: #f3c27a; --partial-soft: #3a2d17;
  --info-blue: #4cc3d6; --info-soft: #173a40; --formulation: #18282c; --formulation-border: #2b4a51; --info: #24282d; --code-bg: #1a1d21;
  --shadow: 0 .125rem .25rem rgba(0,0,0,.4); --shadow-lg: 0 .5rem 1rem rgba(0,0,0,.5);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font: 400 .9375rem/1.5 var(--font); }
a { color: var(--primary); }
code, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--code-bg); padding: .1em .35em; border-radius: 4px; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; overflow-x: auto; line-height: 1.45; }
pre code { background: none; padding: 0; }
h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.7rem; margin: .2em 0 .5em; }
h2 { font-size: 1.3rem; margin-top: 1.6em; }
h3 { font-size: 1.08rem; margin-top: 1.3em; }
button { font: inherit; cursor: pointer; }
input, select { font: inherit; color: inherit; }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; height: 56px; padding: 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); font-weight: 700; white-space: nowrap; }
.logo { width: 30px; height: 30px; border-radius: 7px; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 800; }
.topnav { display: flex; gap: 4px; margin-left: 8px; overflow-x: auto; flex: 1; }
.topnav a { text-decoration: none; color: var(--muted); padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-size: .95rem; }
.topnav a.active, .topnav a:hover { color: var(--text); background: var(--surface-2); }
.theme-btn, .menu-btn { border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; width: 36px; height: 36px; }
.menu-btn { display: none; }
.theme-btn { margin-left: auto; }
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar { width: 280px; flex-shrink: 0; border-right: 1px solid var(--border); background: var(--surface); padding: 16px 10px; position: sticky; top: 56px; height: calc(100vh - 56px); overflow-y: auto; }
.sidebar:empty { display: none; }
.sidebar h4 { margin: 4px 10px 8px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sidebar a { display: flex; gap: 8px; align-items: baseline; padding: 7px 10px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: .93rem; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.sidebar .num { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 1.6em; }
.sidebar .sep { height: 1px; background: var(--border); margin: 10px 8px; }
main { flex: 1; min-width: 0; padding: 28px 32px 60px; outline: none; }
.page { max-width: 920px; margin: 0 auto; }
.page.wide { max-width: 1180px; }

/* Generic UI */
.muted { color: var(--muted); }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--surface); color: var(--text); padding: 8px 16px; border-radius: 8px; text-decoration: none; font-size: .95rem; line-height: 1.3; }
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.small { padding: 5px 11px; font-size: .88rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.chip { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.ko { background: var(--ko-soft); color: var(--ko); border-color: transparent; }
.chip.partial { background: var(--partial-soft); color: var(--partial); border-color: transparent; }
.chip.new { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 99px; transition: width .4s; }
.bar.ok > span { background: var(--ok); } .bar.ko > span { background: var(--ko); } .bar.partial > span { background: var(--partial); }
.table-wrap { overflow-x: auto; margin: 12px 0; }
table { border-collapse: collapse; width: 100%; font-size: .94rem; }
th, td { border: 1px solid var(--border); padding: 7px 10px; text-align: left; vertical-align: top; }
th { background: var(--surface-2); }
.notice { border-left: 4px solid var(--primary); background: var(--primary-soft); padding: 12px 16px; border-radius: 6px; margin: 14px 0; }
.attention { border-left: 4px solid var(--partial); background: var(--partial-soft); padding: 10px 14px; border-radius: 6px; }

/* Home */
.hero { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 22px; }
.hero p { margin: 0; color: var(--muted); max-width: 620px; }
.course-card { display: flex; flex-direction: column; gap: 10px; }
.course-card h3 { margin: 0; font-size: 1.08rem; }
.course-card p { margin: 0; color: var(--muted); font-size: .93rem; flex: 1; }
.course-card .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.course-card .btns { margin-top: 4px; }
.feature { border: 2px solid var(--primary); background: linear-gradient(135deg, var(--primary-soft), var(--surface) 70%); grid-column: 1 / -1; }
.feature h3 { font-size: 1.25rem; }
.section-title { margin: 30px 0 12px; font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* Course content */
.chapter-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.chapter-head .src { font-size: .88rem; color: var(--muted); }
.chapter-head .src p { margin: 0; }
.content { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 8px 28px 24px; }
.content h2 { border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.content li { margin: 3px 0; }
.chapter-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* Moodle-like quiz */
.quiz-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 22px; align-items: start; }
.que { display: flex; gap: 14px; margin-bottom: 18px; }
.que .info { width: 140px; flex-shrink: 0; background: var(--info); border: 1px solid var(--border); border-radius: 6px; padding: 10px; font-size: .84rem; align-self: flex-start; }
.que .info h3 { margin: 0 0 6px; font-size: .95rem; }
.que .info h3 b { font-size: 1.15rem; }
.que .info .state { margin-bottom: 4px; }
.que .info .flag { border: none; background: none; color: var(--primary); padding: 0; margin-top: 6px; font-size: .84rem; text-align: left; }
.que .info .flag.on { color: var(--ko); font-weight: 600; }
.que .body { flex: 1; min-width: 0; }
.formulation { background: var(--formulation); border: 1px solid var(--formulation-border); border-radius: 6px; padding: 14px 18px; }
.formulation .qtext p { margin: 0 0 10px; white-space: pre-wrap; }
.formulation .qtext pre { background: var(--surface); }
.formulation .prompt { margin: 6px 0 4px; font-size: .93rem; }
.answer .opt { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; border-radius: 5px; }
.answer .opt input { margin-top: 5px; }
.answer .opt .lettre { color: var(--muted); min-width: 1.4em; }
.answer .opt.correct { background: var(--ok-soft); }
.answer .opt.incorrect { background: var(--ko-soft); }
.answer .opt .mark { margin-left: auto; font-weight: 700; }
.answer .opt.correct .mark { color: var(--ok); } .answer .opt.incorrect .mark { color: var(--ko); }
.answer input[type=text] { padding: 7px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); min-width: 220px; max-width: 100%; }
.answer input[type=text].correct { border-color: var(--ok); background: var(--ok-soft); }
.answer input[type=text].incorrect { border-color: var(--ko); background: var(--ko-soft); }
.answer table.assoc td { background: var(--surface); }
.answer table.assoc td:first-child { width: 55%; }
.answer select { padding: 6px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); max-width: 100%; }
.answer select.correct { border-color: var(--ok); background: var(--ok-soft); }
.answer select.incorrect { border-color: var(--ko); background: var(--ko-soft); }
.outcome { margin-top: 10px; background: var(--partial-soft); border: 1px solid transparent; border-radius: 6px; padding: 12px 16px; font-size: .95rem; }
.outcome .feedback { font-weight: 600; margin-bottom: 4px; }
.outcome .feedback.ok { color: var(--ok); } .outcome .feedback.ko { color: var(--ko); } .outcome .feedback.partial { color: var(--partial); }
.outcome .right { margin: 4px 0; }
.outcome .expl { margin-top: 6px; color: var(--text); }
.outcome .remed { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.outcome .remed p { margin: 6px 0 0; }
.check-btn { margin-top: 12px; }
.quiz-nav-block { position: sticky; top: 76px; }
.quiz-nav-block h4 { margin: 0 0 10px; font-size: .95rem; }
.qn-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.qn { width: 34px; height: 40px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); position: relative; font-size: .85rem; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding-top: 3px; color: var(--text); overflow: hidden; }
.qn::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 11px; background: transparent; border-top: 1px solid var(--border); }
.qn.answered::after { background: #8f959e; }
.qn.correct::after { background: var(--ok); } .qn.incorrect::after { background: var(--ko); } .qn.partial::after { background: var(--partial); }
.qn.current { outline: 2px solid var(--primary); outline-offset: 1px; font-weight: 700; }
.qn.flagged::before { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 9px 9px 0; border-color: transparent var(--ko) transparent transparent; }
.timer { font-variant-numeric: tabular-nums; font-weight: 600; margin: 10px 0; }
.timer.low { color: var(--ko); }
.quiz-pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.summary-table td:last-child { width: 40%; }
.review-head table { max-width: 560px; }
.review-head th { width: 40%; font-weight: 600; }
.setup label.row { display: flex; gap: 10px; align-items: center; padding: 6px 0; }
.setup fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; margin: 0 0 14px; }
.setup legend { font-weight: 600; padding: 0 6px; }
.chapters-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 2px 16px; }

/* Théorique */
.lesson-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.lesson-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
.lesson-card:hover { border-color: var(--primary); }
.lesson-card .top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.lesson-card .ico { font-size: 1.5rem; }
.lesson-card h3 { margin: 0; font-size: 1.02rem; }
.lesson-card p { margin: 0; font-size: .88rem; color: var(--muted); flex: 1; }
.lesson-card.reco { border: 2px solid var(--accent); }
.reco-box { border: 2px solid var(--accent); background: var(--surface); border-radius: var(--radius); padding: 16px 20px; margin: 16px 0 22px; display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.reco-box .lbl { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 700; }
.reco-box h3 { margin: 2px 0 2px; }
.reco-box p { margin: 0; color: var(--muted); font-size: .93rem; }
.lesson-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); margin: 14px 0; }
.lesson-section > summary { cursor: pointer; padding: 14px 20px; font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; }
.lesson-section > summary::after { content: "▾"; color: var(--muted); }
.lesson-section:not([open]) > summary::after { content: "▸"; }
.lesson-section > div { padding: 0 20px 16px; }
.help-box { border: 2px solid var(--partial); background: var(--partial-soft); border-radius: var(--radius); padding: 14px 18px; margin: 14px 0; }
.help-box h3 { margin: 0 0 6px; color: var(--partial); }
.help-box p { margin: 6px 0; }
.help-box .missed { margin-top: 10px; font-size: .9rem; }
.help-box .missed li { margin-bottom: 6px; }
.master-box { border: 2px solid var(--ok); background: var(--ok-soft); border-radius: var(--radius); padding: 12px 18px; margin: 14px 0; }
.schema { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.schema .case { border: 2px solid var(--primary); border-radius: 8px; padding: 8px 14px; min-width: 120px; text-align: center; background: var(--primary-soft); }
.schema .case span { display: block; font-family: var(--mono); font-size: .85rem; color: var(--muted); }
.schema .case b { display: block; font-size: 1.3rem; font-family: var(--mono); }
.schema .case small { color: var(--muted); }
.widget { border: 1px dashed var(--primary); border-radius: 8px; padding: 12px 16px; margin: 14px 0; background: var(--surface-2); }
.widget h4 { margin: 0 0 8px; font-size: .95rem; color: var(--primary); }
.widget .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.widget input, .widget select { width: 90px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); }
.widget .out { margin-top: 10px; font-family: var(--mono); font-size: .92rem; white-space: pre-wrap; }
.mastery-row { display: grid; grid-template-columns: 200px 1fr 120px; gap: 12px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .93rem; }
.mastery-row:last-child { border-bottom: none; }
.adapt-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 8px; z-index: 50; font-size: .93rem; box-shadow: var(--shadow); }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin: 12px 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; min-width: 130px; }
.stat b { display: block; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.stat span { font-size: .85rem; color: var(--muted); }

@media (max-width: 960px) {
  .quiz-layout { grid-template-columns: 1fr; }
  .quiz-nav-block { position: static; order: -1; }
}
@media (max-width: 800px) {
  .menu-btn { display: block; }
  .topnav { display: none; }
  .sidebar { position: fixed; left: 0; top: 56px; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .sidebar:empty { display: block; }
  main { padding: 18px 16px 50px; }
  .content { padding: 4px 16px 18px; }
  .que { flex-direction: column; gap: 8px; }
  .que .info { width: auto; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
  .que .info h3, .que .info .state, .que .info .flag { margin: 0; }
  .mastery-row { grid-template-columns: 1fr 90px; }
  .mastery-row .bar { grid-column: 1 / -1; grid-row: 2; }
}
.mobile-nav { display: none; }
@media (min-width: 801px) { body.no-side .sidebar { display: none; } }
@media (max-width: 800px) { .mobile-nav { display: block; } }

/* ---------- Exercices de code & examen ---------- */
.page-head { margin-bottom: 18px; }
.eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--primary); font-weight: 700; }
.lead { font-size: 1.05rem; color: var(--muted); max-width: 72ch; }
.kpis { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 16px; min-width: 110px; }
.kpi b { display: block; font-size: 1.5rem; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: .85rem; }
.legend { color: var(--muted); font-size: .9rem; margin: 6px 0 4px; }
.exo-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.exo-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.exo-card h3 { margin: 0; font-size: 1.02rem; }
.exo-foot { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.exo-foot .go { color: var(--primary); font-size: .9rem; }
.stars { color: var(--partial); letter-spacing: 1px; font-size: .85rem; }
.chip.accent { background: var(--accent); color: #fff; border-color: transparent; }
.chip.tiny { font-size: .7rem; padding: 0 6px; }
.sidebar .num.dot { min-width: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--border); flex-shrink: 0; align-self: center; }
.sidebar .num.dot.ok { background: var(--ok); } .sidebar .num.dot.partial { background: var(--partial); } .sidebar .num.dot.ko { background: var(--ko); }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); }
.exo-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.exo-enonce { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; }
.exo-enonce h1 { font-size: 1.4rem; margin: 8px 0 10px; }
.exo-code { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.imposes { border: 1px dashed var(--primary); background: var(--primary-soft); border-radius: 8px; padding: 10px 12px; margin: 12px 0; }
.imposes .lbl, .sol .lbl { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.imposes pre { margin: 4px 0 6px; background: var(--surface); }
.imposes small { color: var(--muted); }
.sol { margin-top: 12px; }
.code-card { padding: 0; overflow: hidden; }
.code-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface-2); font-family: var(--mono); font-size: .85rem; }
.code-bar .kbd-hint { margin-left: auto; font-family: inherit; font-size: .78rem; }
.btn.ghost { background: transparent; }
.editor { display: flex; background: var(--code-bg); font-family: var(--mono); font-size: .9rem; line-height: 1.5; }
.editor .gutter { margin: 0; border: 0; border-radius: 0; background: transparent; color: var(--muted); opacity: .6; text-align: right; padding: 12px 8px 12px 12px; user-select: none; overflow: hidden; min-width: 3em; font-size: inherit; line-height: inherit; }
.editor textarea { flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent; color: var(--text); padding: 12px 12px 12px 4px; font: inherit; line-height: inherit; tab-size: 4; white-space: pre; overflow-x: auto; overflow-y: hidden; min-height: 180px; }
.editor.ro textarea { opacity: .85; }
.code-answer .editor { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.run-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--border); }
.code-answer .run-row { border-top: 0; padding: 8px 0; }
.run-row .grow { flex: 1; min-width: 200px; display: flex; gap: 6px; align-items: center; font-size: .88rem; color: var(--muted); }
.run-row input { flex: 1; min-width: 0; padding: 7px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font-family: var(--mono); font-size: .88rem; }
.small { font-size: .85rem; }
.console { font-family: var(--mono); font-size: .88rem; }
.console pre.out { margin: 0; border: 0; padding: 0; background: none; white-space: pre-wrap; }
.console .ret { margin-top: 6px; }
.run-err { background: var(--ko-soft); color: var(--ko); border-left: 3px solid var(--ko); padding: 8px 10px; border-radius: 6px; margin-top: 6px; font-family: system-ui, sans-serif; }
.run-err.small { padding: 4px 8px; font-size: .82rem; }
.warn { background: var(--partial-soft); color: var(--partial); padding: 6px 10px; border-radius: 6px; margin-top: 6px; font-size: .85rem; }
.res-head { display: flex; gap: 14px; align-items: center; margin-bottom: 10px; }
.res-head .score { font-size: 1.1rem; white-space: nowrap; }
.res-head .score b { font-size: 1.7rem; }
.res-head > div:last-child { flex: 1; }
.res-head.ok .score b { color: var(--ok); } .res-head.partial .score b { color: var(--partial); } .res-head.ko .score b { color: var(--ko); }
.res-table { font-size: .85rem; width: 100%; }
.res-table td { vertical-align: top; }
.res-table pre { margin: 0; padding: 4px 6px; font-size: .82rem; max-width: 34ch; white-space: pre-wrap; border: 0; }
.res-table tr.t-ok td:first-child { color: var(--ok); font-weight: 700; }
.res-table tr.t-ko td:first-child { color: var(--ko); font-weight: 700; }
.conseils { margin-top: 10px; background: var(--surface-2); border-radius: 8px; padding: 8px 12px; font-size: .88rem; }
.conseils ul { margin: 4px 0 0; padding-left: 20px; }
.bravo { margin-top: 10px; padding: 10px 12px; background: var(--ok-soft); color: var(--ok); border-radius: 8px; font-weight: 600; }
.pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.precheck:not(:empty) { margin-top: 8px; border: 1px solid var(--border); border-radius: 8px; padding: 10px; background: var(--surface); }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; cursor: pointer; background: var(--surface); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice small { display: block; color: var(--muted); }
.choice input { margin-top: 5px; }
.btn.big { padding: 12px 22px; font-size: 1.05rem; }
details.right summary { cursor: pointer; color: var(--primary); }
@media (max-width: 1000px) {
  .exo-grid { grid-template-columns: 1fr; }
  .exo-enonce { position: static; max-height: none; }
  .code-bar .kbd-hint { display: none; }
}


/* =====================================================================
   Couche Moodle 4 (Boost)
   ===================================================================== */
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.875rem; font-weight: 700; margin: 0 0 .5rem; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.17rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
code { background: var(--surface-2); color: #c7254e; border: 1px solid var(--border); padding: .05em .3em; border-radius: 3px; font-size: .875em; }
:root[data-theme="dark"] code { color: #ff8fa8; }
pre { background: var(--code-bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
pre code { color: inherit; border: 0; }
:focus-visible { outline: 0; box-shadow: 0 0 0 .2rem rgba(15,108,191,.75); border-radius: 2px; }

/* Barre de navigation */
.topbar { position: fixed; top: 0; left: 0; right: 0; height: var(--navbar-h); z-index: 1030; display: flex; align-items: center; gap: 0; padding: 0 1rem;
  background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 2px 4px rgba(0,0,0,.08); }
.layout { padding-top: var(--navbar-h); display: flex; min-height: 100vh; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--text); font-weight: 700; font-size: 1.05rem; margin-right: 1rem; }
.brand:hover { text-decoration: none; }
.logo { width: 34px; height: 34px; border-radius: 6px; background: #f98012; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.05rem; }
.logo-text small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); line-height: 1; }
.topnav { display: flex; align-self: stretch; gap: 0; margin: 0; flex: 1; overflow-x: auto; scrollbar-width: none; }
.topnav a { display: flex; align-items: center; padding: 0 1rem; color: var(--text); border-bottom: 3px solid transparent; border-top: 3px solid transparent; white-space: nowrap; font-size: .9375rem; border-radius: 0; background: none; }
.topnav a:hover { background: var(--surface-2); text-decoration: none; }
.topnav a.active { border-bottom-color: var(--primary); background: none; color: var(--text); }
.nav-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.theme-btn { display: flex; align-items: center; gap: .45rem; height: auto; width: auto; border: 0; background: none; color: var(--text); font-size: .875rem; padding: .25rem .4rem; margin: 0; border-radius: var(--radius-sm); }
.theme-btn:hover { background: var(--surface-2); }
.theme-btn .switch { width: 2rem; height: 1.1rem; border-radius: 1rem; background: var(--surface-3); border: 1px solid var(--border-strong); position: relative; transition: background .15s; }
.theme-btn .switch::after { content: ""; position: absolute; top: 1px; left: 1px; width: calc(1.1rem - 4px); height: calc(1.1rem - 4px); border-radius: 50%; background: #adb5bd; transition: transform .15s, background .15s; }
:root[data-theme="dark"] .theme-btn .switch { background: var(--primary); border-color: var(--primary); }
:root[data-theme="dark"] .theme-btn .switch::after { transform: translateX(.9rem); background: #fff; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .switch { background: var(--primary); border-color: var(--primary); } :root:not([data-theme="light"]) .theme-btn .switch::after { transform: translateX(.9rem); background: #fff; } }
.avatar { width: 35px; height: 35px; border-radius: 50%; background: var(--surface-3); color: var(--text); display: grid; place-items: center; font-weight: 600; font-size: .85rem; }
.menu-btn { display: none; border: 1px solid var(--border); background: var(--surface); color: var(--text); width: 36px; height: 36px; border-radius: var(--radius-sm); margin-right: .5rem; }

/* Tiroir « Index du cours » */
.sidebar { position: sticky; top: var(--navbar-h); height: calc(100vh - var(--navbar-h)); width: 285px; flex-shrink: 0; overflow-y: auto; background: var(--surface-2); border-right: 1px solid var(--border); padding: .75rem .5rem 2rem; }
.sidebar h4 { margin: .9rem .5rem .35rem; font-size: .8rem; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 700; }
.sidebar .drawer-title { margin: .2rem .5rem .6rem; font-size: 1.1rem; font-weight: 700; color: var(--text); }
.sidebar a { display: flex; gap: .5rem; align-items: center; padding: .3rem .5rem; border-radius: var(--radius-sm); color: var(--text); font-size: .875rem; }
.sidebar a:hover { background: var(--surface-3); text-decoration: none; }
.sidebar a.active { background: var(--primary-soft); color: var(--text); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
.sidebar .num { color: var(--muted); min-width: 1.4em; }
.ci-section { margin-bottom: .25rem; }
.ci-head { display: flex; align-items: center; gap: .35rem; padding: .35rem .5rem; font-weight: 700; font-size: .875rem; color: var(--text); cursor: pointer; border-radius: var(--radius-sm); user-select: none; }
.ci-head:hover { background: var(--surface-3); }
.ci-head .chev { width: 1em; color: var(--muted); transition: transform .15s; display: inline-block; }
.ci-section.closed .chev { transform: rotate(-90deg); }
.ci-section.closed .ci-items { display: none; }
.ci-items a { padding-left: 1.65rem; }
.ic { width: 18px; height: 18px; border-radius: 4px; display: inline-grid; place-items: center; font-size: 11px; color: #fff; flex-shrink: 0; }
.sidebar .num.dot { min-width: 0; width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.sidebar .num.dot.ok { background: var(--ok); } .sidebar .num.dot.partial { background: var(--partial); } .sidebar .num.dot.ko { background: var(--ko); }
.sidebar .sep { height: 1px; background: var(--border); margin: .6rem .5rem; }

main { flex: 1; min-width: 0; padding: 1.5rem 2rem 4rem; background: var(--page); }
.page { max-width: 1100px; margin: 0 auto; }
.page.wide { max-width: 1300px; }

/* En-tête de page Moodle */
.crumbs { font-size: .875rem; color: var(--muted); margin-bottom: .4rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.crumbs a { color: var(--link); }
.crumbs .sepc { color: var(--muted); }
.page-header { margin-bottom: 1rem; }
.page-header h1 { display: flex; align-items: center; gap: .75rem; }
.page-header .act-icon { width: 44px; height: 44px; font-size: 22px; border-radius: 8px; }
.secondary-nav { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin: 0 0 1.5rem; overflow-x: auto; scrollbar-width: thin; }
.secondary-nav a { padding: .55rem 1rem; color: var(--text); border-bottom: 3px solid transparent; white-space: nowrap; font-size: .9375rem; }
.secondary-nav a:hover { background: var(--surface-2); text-decoration: none; }
.secondary-nav a.active { border-bottom-color: var(--primary); }
.eyebrow { font-size: .8rem; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.lead { font-size: 1rem; color: var(--text); }

/* Boutons, cartes, badges (Bootstrap / Boost) */
.btn { display: inline-flex; align-items: center; gap: .35rem; font-weight: 400; font-size: .9375rem; line-height: 1.5; padding: .375rem .75rem; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: #ced4da; color: #1d2125; transition: background .15s, border-color .15s; cursor: pointer; text-decoration: none; }
.btn:hover { background: #b8bfc6; text-decoration: none; }
:root[data-theme="dark"] .btn { background: #3a4047; color: var(--text); } :root[data-theme="dark"] .btn:hover { background: #474e56; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); filter: none; }
.btn.outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn.outline:hover { background: var(--primary); color: #fff; }
.btn.small { padding: .25rem .5rem; font-size: .8203rem; }
.btn.big { padding: .5rem 1rem; font-size: 1.05rem; }
.btn.ghost { background: transparent; border-color: var(--border); }
.btn:disabled { opacity: .65; cursor: not-allowed; }
.btns { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; box-shadow: none; }
.chip { display: inline-block; font-size: .75em; font-weight: 700; padding: .3em .55em; border-radius: .25rem; background: var(--surface-3); color: var(--text); border: 0; white-space: nowrap; line-height: 1; }
.chip.ok { background: var(--ok); color: #fff; } .chip.ko { background: var(--ko); color: #fff; } .chip.partial { background: var(--partial); color: #1d2125; }
.chip.new { background: var(--primary); color: #fff; } .chip.accent { background: var(--accent); color: #fff; }
.chip.info { background: var(--info-blue); color: #fff; }
.chip.tiny { font-size: .68em; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); border: 0; overflow: hidden; }
.bar > span { background: var(--primary); }
.bar.ok > span { background: var(--ok); } .bar.ko > span { background: var(--ko); } .bar.partial > span { background: var(--partial); }
table { border-collapse: collapse; }
th, td { border: 0; border-top: 1px solid var(--border); padding: .6rem .75rem; }
th { background: transparent; font-weight: 700; border-bottom: 2px solid var(--border); }
.table-wrap table tr:nth-child(even) td { background: rgba(0,0,0,.02); }
.notice { background: var(--info-soft); border: 1px solid #b3d9df; border-left-width: 1px; color: var(--text); border-radius: var(--radius-sm); padding: .75rem 1.25rem; }
:root[data-theme="dark"] .notice { border-color: #24545c; }
.attention { background: var(--partial-soft); border: 1px solid #f7d6a3; border-radius: var(--radius-sm); }
.toast { background: #1d2125; color: #fff; border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); }
.muted { color: var(--muted); }
.section-title { font-size: 1.17rem; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; margin: 2rem 0 .75rem; }

/* Icônes d'activité Moodle 4 */
.act-icon { width: 36px; height: 36px; border-radius: 6px; display: inline-grid; place-items: center; color: #fff; font-size: 17px; flex-shrink: 0; line-height: 1; }
.c-content { background: var(--act-content); } .c-assess { background: var(--act-assess); } .c-interface { background: var(--act-interface); }
.c-collab { background: var(--act-collab); } .c-comm { background: var(--act-comm); } .c-admin { background: var(--act-admin); }
.act-icon svg, .ic svg { width: 60%; height: 60%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Page de cours : sections et activités */
.course-section { border-bottom: 1px solid var(--border); padding: 1rem 0 1.25rem; }
.course-section:first-of-type { padding-top: .25rem; }
.cs-head { display: flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; }
.cs-head h3 { margin: 0; font-size: 1.32rem; }
.cs-head .chev { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); color: var(--text); transition: transform .15s; font-size: .8rem; }
.course-section.closed .chev { transform: rotate(-90deg); }
.course-section.closed .cs-body { display: none; }
.cs-summary { color: var(--muted); margin: .4rem 0 .6rem 2.25rem; font-size: .9rem; }
.activity { display: flex; align-items: center; gap: .85rem; padding: .6rem .75rem; margin: .4rem 0 0 2.25rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.activity:hover { background: var(--surface-2); }
.activity .a-body { flex: 1; min-width: 0; }
.activity .a-type { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .02em; }
.activity .a-name { font-weight: 400; font-size: .9375rem; color: var(--link); }
.activity .a-desc { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.compl { font-size: .8rem; padding: .3rem .55rem; border-radius: var(--radius-sm); border: 1px solid var(--border); white-space: nowrap; color: var(--muted); background: var(--surface); }
.compl.done { background: var(--ok-soft); border-color: transparent; color: var(--ok); font-weight: 600; }
.compl.mid { background: var(--partial-soft); border-color: transparent; color: var(--partial-ink); }

/* Tableau de bord / Mes cours */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.mcard { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); display: flex; flex-direction: column; transition: box-shadow .15s; }
.mcard:hover { box-shadow: var(--shadow-lg); }
.mcard-img { height: 120px; display: block; }
.mcard-body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.mcard .cat { font-size: .8rem; color: var(--muted); }
.mcard h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.mcard h3 a { color: var(--link); }
.mcard .prog { font-size: .8rem; color: var(--muted); margin-top: auto; padding-top: .5rem; }
.block { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.block h3, .block h4 { margin: 0 0 .6rem; font-size: 1.1rem; }
.dash-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.25rem; align-items: start; }
.timeline-item { display: flex; gap: .7rem; padding: .55rem 0; border-top: 1px solid var(--border); align-items: center; }
.timeline-item:first-of-type { border-top: 0; }
.timeline-item .when { font-size: .78rem; color: var(--muted); }

/* Contenus (synthèses et énoncés de labos) */
.content { background: var(--surface); border: 0; border-radius: 0; padding: 0; }
.content h2 { border-bottom: 0; padding-bottom: 0; font-size: 1.4rem; margin-top: 1.8rem; }
.content img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 4px; }
.content .note { background: var(--info-soft); border-left: 4px solid var(--info-blue); padding: .7rem 1rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: .9rem 0; }
.content .note > b:first-child { display: block; margin-bottom: .25rem; }
.content .note p { margin: .3rem 0; }
.content pre.pseudo { background: var(--partial-soft); border-color: #f7d6a3; font-family: var(--mono); }
.content pre.c-code { position: relative; }
.try-btn { position: absolute; top: 6px; right: 6px; font-family: var(--font); }
.resources { display: flex; flex-direction: column; gap: .35rem; margin: .6rem 0 0; }
.res-link { display: flex; align-items: center; gap: .6rem; padding: .4rem .6rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.res-link:hover { background: var(--surface-2); text-decoration: none; }
.res-link .ext { font-size: .7rem; font-weight: 700; color: #fff; padding: .2rem .35rem; border-radius: 3px; text-transform: uppercase; }
.ext.pdf { background: #d9534f; } .ext.pptx { background: #e07c24; } .ext.docx { background: #2b6cb0; } .ext.png, .ext.jpg { background: #6f42c1; }

/* Quiz : quelques retouches Boost */
.que .info { background: var(--info); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.formulation { border-radius: var(--radius-sm); }
.outcome { background: var(--partial-soft); border-radius: var(--radius-sm); }
.qn { border-radius: 3px; }
.qn.current { outline: 2px solid var(--primary); }
.setup fieldset { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.setup legend { font-size: 1.05rem; font-weight: 700; padding: 0 .4rem; }
.choice { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.kpi { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.kpi b { color: var(--primary); }
.hero { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.hero h1 { font-size: 1.875rem; }
.course-card { border-radius: var(--radius); }
.feature { border: 1px solid var(--border); background: var(--surface); grid-column: auto; }
.reco-box { border: 1px solid var(--primary); border-left-width: 4px; border-radius: var(--radius-sm); background: var(--surface); }
.reco-box .lbl { color: var(--primary); }
.lesson-card.reco { border: 2px solid var(--primary); }
.help-box { border-radius: var(--radius-sm) !important; }
input[type=radio], input[type=checkbox] { accent-color: var(--primary); }
.answer input[type=text], .answer select, .run-row input, .setup select, .term-input input { border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); padding: .375rem .75rem; color: var(--text); }

/* Exercices */
.exo-card { border-radius: var(--radius); }
.exo-card:hover { border-color: var(--primary); }
.imposes { border: 1px solid #b3d9df; background: var(--info-soft); border-radius: var(--radius-sm); }
.imposes .lbl, .sol .lbl { color: var(--info-blue); }
.imposes pre { background: var(--surface); }
.exo-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); }
.exo-enonce { top: calc(var(--navbar-h) + 16px); max-height: calc(100vh - var(--navbar-h) - 32px); }
.run-err { border-left: 4px solid var(--ko); border-radius: var(--radius-sm); }

@media (max-width: 1100px) { .dash-cols { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .menu-btn { display: block; }
  .topnav { display: none; }
  .logo-text small { display: none; }
  .theme-btn .lbl-txt { display: none; }
  .sidebar { position: fixed; top: var(--navbar-h); left: 0; z-index: 1020; height: calc(100vh - var(--navbar-h)); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-lg); background: var(--surface-2); }
  .sidebar.open { transform: none; }
  main { padding: 1rem 1rem 3rem; }
  .activity { margin-left: 0; }
  .cs-summary { margin-left: 0; }
  .exo-grid { grid-template-columns: 1fr; }
}

/* ===== Éditeur type Visual Studio Code (thème Dark+) ===== */
.vsc { --v-bg: #1e1e1e; --v-side: #252526; --v-act: #333333; --v-tab: #2d2d2d; --v-border: #3c3c3c; --v-fg: #cccccc; --v-dim: #8b8b8b; --v-blue: #007acc;
  border: 1px solid #000; border-radius: 8px; overflow: hidden; background: var(--v-bg); color: var(--v-fg); font-family: "Segoe UI", system-ui, sans-serif; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.vsc svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.vsc-titlebar { height: 30px; background: #3c3c3c; display: flex; align-items: center; position: relative; font-size: 12px; color: #cccccc; }
.vsc-dots { display: flex; gap: 7px; padding-left: 12px; }
.vsc-dots i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; } .vsc-dots i:nth-child(2) { background: #febc2e; } .vsc-dots i:nth-child(3) { background: #28c840; }
.vsc-title { position: absolute; left: 50%; transform: translateX(-50%); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 70%; }
.vsc-main { display: flex; }
.vsc-activity { width: 46px; background: var(--v-act); display: flex; flex-direction: column; align-items: center; padding-top: 6px; gap: 4px; flex-shrink: 0; }
.vsc-activity span { width: 46px; height: 42px; display: grid; place-items: center; color: #858585; cursor: pointer; border-left: 2px solid transparent; }
.vsc-activity span svg { width: 22px; height: 22px; }
.vsc-activity span.on { color: #fff; border-left-color: #fff; }
.vsc-activity span:hover { color: #fff; }
.vsc-area { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.vsc-tabs { display: flex; background: var(--v-side); height: 35px; align-items: stretch; }
.vsc-tab { display: flex; align-items: center; gap: 6px; padding: 0 14px; background: var(--v-bg); color: #fff; border-top: 1px solid var(--v-blue); font-size: 13px; }
.vsc-c { color: #519aba; font-weight: 700; font-size: 11px; }
.vsc-dirty { color: #fff; opacity: 0; font-size: 10px; } .vsc.dirty .vsc-dirty { opacity: 1; }
.vsc-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; padding-right: 8px; }
.vsc-btn { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 0; border-radius: 3px; background: transparent; color: var(--v-fg); font: inherit; font-size: 12px; cursor: pointer; }
.vsc-btn:hover { background: rgba(255,255,255,.1); }
.vsc-btn.primary { background: #0e639c; color: #fff; } .vsc-btn.primary:hover { background: #1177bb; }
.vsc-btn svg { width: 14px; height: 14px; }
.vsc-btn[data-act="run"] svg { color: #89d185; fill: #89d185; }
.vsc-crumb { height: 22px; display: flex; align-items: center; gap: 4px; padding: 0 14px; color: #a9a9a9; font-size: 12px; background: var(--v-bg); }
.vsc-crumb b { font-weight: 400; color: #cccccc; }
.vsc-fnname { color: #dcdcaa; }
.vsc-cm { flex: 1; min-height: 0; }
.vsc .CodeMirror { font-family: Consolas, "Cascadia Code", "Courier New", monospace; font-size: 14px; line-height: 19px; height: auto; }
.vsc-sash { height: 4px; cursor: ns-resize; background: transparent; border-top: 1px solid var(--v-border); }
.vsc-sash:hover { background: var(--v-blue); }
.vsc-panel { background: var(--v-bg); }
.vsc-ptabs { display: flex; gap: 18px; padding: 0 14px; height: 32px; align-items: center; font-size: 11px; letter-spacing: .02em; }
.vsc-ptabs span[data-p] { cursor: pointer; color: #969696; height: 100%; display: flex; align-items: center; gap: 5px; border-bottom: 1px solid transparent; }
.vsc-ptabs span[data-p].on { color: #e7e7e7; border-bottom-color: #e7e7e7; }
.vsc-count { background: #4d4d4d; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 10px; font-weight: 600; } .vsc-count.has { background: #c44; }
.vsc-pbody { display: none; height: 190px; overflow: auto; font-size: 13px; }
.vsc-pbody.on { display: block; }
.vsc-pb { padding: 3px 14px; cursor: pointer; white-space: nowrap; } .vsc-pb:hover { background: #2a2d2e; }
.vsc-term { display: flex; flex-direction: column; height: 100%; }
.vsc-term-out { flex: 1; overflow: auto; padding: 6px 14px; font-family: Consolas, "Cascadia Code", monospace; white-space: pre-wrap; color: #cccccc; font-size: 13px; line-height: 1.45; }
.vsc-term-in { display: flex; align-items: center; gap: 8px; padding: 6px 14px; border-top: 1px solid var(--v-border); }
.vsc-term-in label { font-size: 11px; color: var(--v-dim); white-space: nowrap; text-transform: uppercase; letter-spacing: .03em; }
.vsc-term-in input { flex: 1; min-width: 0; background: #3c3c3c; border: 1px solid #3c3c3c; color: #ccc; padding: 4px 8px; font-family: Consolas, monospace; font-size: 13px; border-radius: 2px; }
.vsc-term-in input:focus { outline: 1px solid var(--v-blue); }
.vsc-ps { color: #4ec9b0; } .vsc-err { color: #f48771; } .vsc-warn { color: #cca700; } .vsc-dim { color: var(--v-dim); } .vsc-ret { color: #dcdcaa; } .vsc-ok { color: #89d185; }
.vsc-status { height: 22px; background: var(--v-blue); color: #fff; display: flex; align-items: center; gap: 14px; padding: 0 10px; font-size: 12px; white-space: nowrap; overflow: hidden; }
.vsc-status svg { width: 13px; height: 13px; vertical-align: -2px; }
.vsc-status .vsc-sp { flex: 1; }
.vsc-squig-err { text-decoration: underline wavy #f14c4c; text-decoration-skip-ink: none; text-underline-offset: 3px; }
.vsc-squig-warn { text-decoration: underline wavy #cca700; text-decoration-skip-ink: none; text-underline-offset: 3px; }
.vsc-line-err { background: rgba(244,135,113,.18); }
/* tests dans le panneau */
.vsc-pbody[data-p="tests"] { padding: 8px 14px; }
.vsc .res-head { color: var(--v-fg); }
.vsc .res-table { background: transparent; border-color: var(--v-border); color: var(--v-fg); }
.vsc .res-table th { background: #252526; border-color: var(--v-border); color: #ccc; }
.vsc .res-table td { border-color: var(--v-border); background: transparent !important; }
.vsc .res-table pre { background: #252526; color: #d4d4d4; }
.vsc .conseils { background: #252526; color: var(--v-fg); }
.vsc .run-err { background: rgba(244,135,113,.12); color: #f48771; }
.vsc .bar { background: #3c3c3c; }
/* thème CodeMirror « vscode » (Dark+) */
.cm-s-vscode.CodeMirror { background: #1e1e1e; color: #d4d4d4; }
.cm-s-vscode .CodeMirror-gutters { background: #1e1e1e; border-right: 0; }
.cm-s-vscode .CodeMirror-linenumber { color: #858585; padding: 0 12px 0 18px; }
.cm-s-vscode .CodeMirror-cursor { border-left: 2px solid #aeafad; }
.cm-s-vscode .CodeMirror-activeline-background { background: #282828; box-shadow: inset 0 0 0 1px #2c2c2c; }
.cm-s-vscode .CodeMirror-activeline .CodeMirror-linenumber { color: #c6c6c6; }
.cm-s-vscode div.CodeMirror-selected, .cm-s-vscode.CodeMirror-focused div.CodeMirror-selected { background: #264f78; }
.cm-s-vscode .CodeMirror-matchingbracket { color: #d4d4d4 !important; outline: 1px solid #888; background: rgba(0,100,0,.3); }
.cm-s-vscode span.cm-keyword { color: #c586c0; }
.cm-s-vscode span.cm-type, .cm-s-vscode span.cm-builtin, .cm-s-vscode span.cm-atom { color: #569cd6; }
.cm-s-vscode span.cm-number { color: #b5cea8; }
.cm-s-vscode span.cm-string, .cm-s-vscode span.cm-string-2 { color: #ce9178; }
.cm-s-vscode span.cm-comment { color: #6a9955; }
.cm-s-vscode span.cm-meta { color: #c586c0; }
.cm-s-vscode span.cm-def { color: #dcdcaa; }
.cm-s-vscode span.cm-variable { color: #9cdcfe; }
.cm-s-vscode span.cm-variable-2, .cm-s-vscode span.cm-variable-3 { color: #4ec9b0; }
.cm-s-vscode span.cm-operator { color: #d4d4d4; }
.cm-s-vscode span.cm-qualifier { color: #569cd6; }
.cm-s-vscode span.cm-bracket { color: #ffd700; }
.vsc.small .vsc-activity, .vsc.small .vsc-crumb { display: none; }
@media (max-width: 700px) { .vsc-activity, .vsc-crumb { display: none; } .vsc-status span:nth-child(n+5) { display: none; } .vsc-btn span { display: none; } .vsc-title { display: none; } }
#app:focus, #app:focus-visible { outline: 0; box-shadow: none; }
.course-head { margin-bottom: 0; }
@media (max-width: 800px) { .course-title { font-size: 1.35rem; } .page-header h1 { font-size: 1.45rem; } .page-header .act-icon { width: 36px; height: 36px; } }

/* ===== Exercices pratiques (Architecture, OS, Labo) ===== */
pre.term, .term-box { background: #1e1e1e; color: #d4d4d4; border: 1px solid #333; border-radius: 6px; font-family: var(--mono); font-size: .9rem; }
pre.term { padding: 10px 12px; white-space: pre-wrap; word-break: break-word; }
pre.term .pr, .term-box .pr { color: #6a9955; font-weight: 600; }
pre.term .muted { color: #8a8a8a; font-style: italic; }
.term-box { padding: 0; overflow: hidden; margin: 12px 0; }
.term-box .tb-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #2d2d2d; color: #ccc; font-size: .78rem; }
.term-box .tb-bar i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: #ff5f56; }
.term-box .tb-bar i:nth-child(2) { background: #ffbd2e; } .term-box .tb-bar i:nth-child(3) { background: #27c93f; }
.term-box .tb-bar span { margin-left: 6px; }
.term-box .tb-body { padding: 10px 12px; }
.term-box .tb-hist { white-space: pre-wrap; word-break: break-word; margin: 0 0 4px; color: #9cdcfe; }
.term-box .tb-hist .ok { color: #6a9955; } .term-box .tb-hist .ko { color: #f48771; }
.term-box .tb-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.term-box .tb-line input { flex: 1 1 180px; min-width: 0; background: transparent; border: 0; color: #fff; font: inherit; outline: none; padding: 2px 0; caret-color: #fff; }
.pra-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 18px 20px; margin: 12px 0; }
.pra-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; margin-bottom: 10px; }
.pra-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.pra-dots span { width: 22px; height: 6px; border-radius: 3px; background: var(--surface-3); }
.pra-dots span.ok { background: var(--ok); } .pra-dots span.ko { background: var(--ko); } .pra-dots span.cur { background: var(--primary); }
.pra-q { font-size: 1.05rem; }
.pra-q code { font-size: .92em; }
.pra-input { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.pra-input input { flex: 1 1 220px; min-width: 0; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font-family: var(--mono); font-size: 1rem; }
.pra-input input.correct { border-color: var(--ok); background: var(--ok-soft); } .pra-input input.incorrect { border-color: var(--ko); background: var(--ko-soft); }
.niv-chip { font-size: .78rem; padding: 2px 8px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.fiche-pages { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 16px 0; }
.fiche-pages img { width: 100%; max-width: 820px; height: auto; border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow); background: #fff; }
.ia-btn { display: inline-flex; align-items: center; gap: 6px; }

/* ===== Assistant IA ===== */
.tuteur-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font: 600 .95rem var(--font); box-shadow: var(--shadow-lg); cursor: pointer; }
.tuteur-fab svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tuteur-fab:hover { background: var(--primary-dark); }
.tuteur-fab.off { opacity: .55; }
body.tuteur-ouvert .tuteur-fab { display: none; }
.tuteur { position: fixed; right: 0; top: 56px; bottom: 0; width: 390px; max-width: 100vw; z-index: 70; display: none; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); }
body.tuteur-ouvert .tuteur { display: flex; }
.tu-head { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.tu-head > div { flex: 1; min-width: 0; }
.tu-head small { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tu-x { border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; width: 32px; height: 32px; border-radius: 6px; cursor: pointer; }
.tu-x:hover { background: var(--surface-2); color: var(--text); }
.tu-list { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.tu-msg { max-width: 92%; padding: 8px 12px; border-radius: 12px; font-size: .93rem; line-height: 1.45; overflow-wrap: anywhere; }
.tu-msg p { margin: 0 0 6px; } .tu-msg p:last-child { margin-bottom: 0; }
.tu-msg ul, .tu-msg ol { margin: 4px 0 6px; padding-left: 20px; }
.tu-msg pre { margin: 6px 0; padding: 8px 10px; font-size: .82rem; }
.tu-msg.bot { align-self: flex-start; background: var(--surface-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.tu-msg.me { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 4px; }
.tu-msg.sys { align-self: stretch; max-width: none; background: var(--partial-soft); border: 1px solid var(--partial); }
.tu-dots { display: inline-flex; gap: 4px; }
.tu-dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: tu-b 1s infinite ease-in-out; }
.tu-dots span:nth-child(2) { animation-delay: .15s; } .tu-dots span:nth-child(3) { animation-delay: .3s; }
@keyframes tu-b { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.tu-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; }
.tu-chip { border: 1px solid var(--border-strong); background: var(--surface); color: var(--primary); border-radius: 999px; padding: 4px 10px; font-size: .82rem; cursor: pointer; }
.tu-chip:hover { background: var(--primary-soft); }
.tu-form { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); }
.tu-form textarea { flex: 1; min-width: 0; resize: none; padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: .93rem var(--font); }
.tu-foot { padding: 0 14px 10px; font-size: .75rem; color: var(--muted); }
@media (min-width: 1100px) { body.tuteur-ouvert #main { margin-right: 390px; } }
@media (max-width: 600px) { .tuteur { top: 0; width: 100vw; } .tuteur-fab span { display: none; } .tuteur-fab { padding: 12px; } }
@media print { .tuteur, .tuteur-fab { display: none !important; } }

.qtext pre.term, .formulation pre.term, .pra-q pre.term { background: #1e1e1e; color: #d4d4d4; border-color: #333; }
.qtext pre.term .pr, .pra-q pre.term .pr { color: #6a9955; }

/* ---- SQL (ODS) ---- */
textarea.sql-in { width: 100%; min-height: 120px; resize: vertical; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: .92rem/1.5 var(--mono, ui-monospace, Consolas, monospace); tab-size: 4; box-sizing: border-box; }
textarea.sql-in.correct { border-color: var(--ok, #357a32); } textarea.sql-in.incorrect { border-color: var(--ko, #ca3120); }
.sql-res table { font-size: .88rem; } .sql-res td, .sql-res th { white-space: nowrap; }
.sql-cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 10px; } .sql-cmp > div { min-width: 0; }
@media (max-width: 700px) { .sql-cmp { grid-template-columns: 1fr; } }
.sql-schema { margin: .5rem 0 1rem; } .sql-schema summary { cursor: pointer; font-weight: 600; } .sql-schema ul { margin: .4rem 0; padding-left: 1.2rem; }
#sqlEx { max-width: 100%; }
:not(pre) > code { overflow-wrap: anywhere; }

/* ---- Page Assistant IA ---- */
body.page-assistant main { padding: 0; }
body.page-assistant #chead { display: none; }
.coach { display: grid; grid-template-columns: 290px minmax(0, 1fr); height: calc(100vh - var(--navbar-h, 56px)); min-height: 420px; }
.coach-side { border-right: 1px solid var(--border); background: var(--surface-2); padding: 14px 12px 24px; overflow-y: auto; }
.coach-side h4 { margin: 18px 4px 6px; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.co-new { width: 100%; justify-content: center; }
.co-conv { display: flex; align-items: stretch; border-radius: 8px; }
.co-conv a { flex: 1; min-width: 0; padding: 7px 8px; color: var(--text); text-decoration: none; border-radius: 8px; }
.co-conv a b { display: block; font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-conv small, .co-plan small { color: var(--muted); font-size: .75rem; }
.co-conv:hover, .co-conv.actif { background: var(--surface-3); }
.co-del { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0 8px; opacity: 0; border-radius: 8px; }
.co-conv:hover .co-del, .co-conv.actif .co-del, .co-del:focus { opacity: 1; } .co-del:hover { color: var(--ko, #ca3120); }
.co-plan { display: block; padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); margin-bottom: 6px; color: var(--text); text-decoration: none; }
.co-plan b { display: block; font-size: .85rem; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.co-plan .bar { display: block; margin-bottom: 4px; }
.co-det { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 10px; } .co-det summary { cursor: pointer; font-weight: 600; font-size: .88rem; }
.co-date { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .84rem; margin: 5px 0; } .co-date input { font: inherit; font-size: .8rem; padding: 3px 4px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--surface); color: var(--text); }
.co-profil { white-space: pre-wrap; font-size: .72rem; max-height: 340px; overflow: auto; }
.coach-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--page); }
.co-head { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--border); }
.co-titre { flex: 1; min-width: 0; } .co-titre b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .co-titre small { color: var(--muted); font-size: .8rem; }
.co-focus { font-size: .84rem; color: var(--muted); white-space: nowrap; } .co-focus select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.co-menu { display: none; }
.co-list { flex: 1; overflow-y: auto; padding: 20px max(20px, calc((100% - 860px) / 2)); display: flex; flex-direction: column; gap: 14px; }
.co-list .tu-msg { font-size: .97rem; line-height: 1.6; max-width: 100%; position: relative; }
.co-list .tu-msg.bot { padding: 12px 16px 12px; }
.co-list .tu-msg.me { max-width: 80%; }
.co-list .md-h { margin: 14px 0 6px; font-size: 1rem; } .co-list .md-h:first-child { margin-top: 0; }
.tu-msg .md-h { margin: 8px 0 4px; font-size: .95rem; }
.co-list li.todo { list-style: none; margin-left: -20px; } .co-list li.todo input { margin-right: 8px; transform: scale(1.15); accent-color: var(--primary); }
.co-list li.todo.fait { color: var(--muted); text-decoration: line-through; }
.co-planbar { margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--border); }
.co-copy { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: .74rem; color: var(--muted); cursor: pointer; opacity: 0; } .tu-msg:hover .co-copy, .co-copy:focus { opacity: 1; }
.co-form { display: flex; gap: 10px; align-items: flex-end; padding: 12px max(20px, calc((100% - 860px) / 2)) 4px; border-top: 1px solid var(--border); }
.co-form textarea { flex: 1; min-width: 0; resize: vertical; min-height: 56px; max-height: 40vh; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); color: var(--text); font: .97rem/1.45 var(--font); }
.co-btns { display: flex; flex-direction: column; gap: 6px; }
.co-foot { font-size: .74rem; color: var(--muted); text-align: center; padding: 2px 0 8px; }
.co-accueil { max-width: 760px; margin: 0 auto; } .co-accueil h2 { margin-top: 0; }
.co-actions { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin: 16px 0; }
.co-action { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: 500 .92rem var(--font); cursor: pointer; }
.co-action:hover { border-color: var(--primary); background: var(--surface-2); } .co-action span { font-size: 1.2rem; }
.co-planform { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-size: .9rem; }
.co-planform > b { flex-basis: 100%; } .co-planform input[type=date], .co-planform select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.co-chk { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 14px; } .co-chk label { white-space: nowrap; }
@media (max-width: 860px) {
  .coach { grid-template-columns: 1fr; position: relative; }
  .coach-side { position: absolute; inset: 0 auto 0 0; width: min(300px, 86vw); z-index: 20; transform: translateX(-105%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .coach.menu .coach-side { transform: none; }
  .co-menu { display: inline-flex; }
  .co-head { padding: 8px 12px; gap: 8px; } .co-titre small { display: none; } .co-focus { font-size: 0; } .co-focus select { font-size: .85rem; max-width: 120px; }
  .co-list { padding: 14px 12px; } .co-form { padding: 10px 12px 4px; } .co-list .tu-msg.me { max-width: 90%; }
}
[hidden] { display: none !important; }
body.page-assistant .tuteur-fab, body.page-assistant .tuteur { display: none !important; }

/* ---- Connexion et comptes ---- */
html.ecran-connexion .topbar, html.ecran-connexion .layout, html.ecran-connexion .tuteur-fab { display: none !important; }
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--surface-2); }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px 24px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; gap: 14px; }
.login-card h1 { margin: 6px 0 0; font-size: 1.4rem; }
.login-card label:not(.row) { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; }
.login-card input:not([type=checkbox]), .form-grid input, .form-grid select, .admin-new input, .admin-new select { font: inherit; font-size: 1rem; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); color: var(--text); min-width: 0; }
.login-card .row { display: flex; gap: 8px; align-items: center; font-size: .9rem; }
.login-card .btn { justify-content: center; padding: 11px; font-size: 1rem; }
.login-logo { display: flex; align-items: center; gap: 12px; } .login-logo small { display: block; color: var(--muted); font-size: .8rem; }
.login-err { color: var(--ko, #ca3120); font-size: .9rem; min-height: 1.2em; }
.compte-menu { position: relative; }
button.avatar { border: 0; cursor: pointer; font: 600 .85rem var(--font); }
.compte-pop { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 80; display: flex; flex-direction: column; }
.compte-pop .cp-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; } .compte-pop .cp-head small { display: block; color: var(--muted); }
.compte-pop a, .compte-pop button { display: block; text-align: left; padding: 9px 10px; border-radius: 6px; color: var(--text); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer; }
.compte-pop a:hover, .compte-pop button:hover { background: var(--surface-2); }
.form-grid, .admin-new { display: grid; gap: 12px; } .form-grid label, .admin-new label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; }
.admin-new { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; margin-bottom: 16px; } .admin-new h3, .admin-new #newMsg { grid-column: 1 / -1; }
.admin-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.admin-user { display: flex; flex-direction: column; gap: 8px; } .au-top { display: flex; align-items: center; gap: 10px; } .au-id { flex: 1; min-width: 0; } .au-id small { display: block; color: var(--muted); }
.admin-user .btns { margin: 0; flex-wrap: wrap; } .au-msg:empty { display: none; }
.btn.danger { color: var(--ko, #ca3120); border-color: currentColor; }

/* ---- Mobile / application ---- */
@media (max-width: 600px) {
  main { padding: 1rem 12px 5rem; }
  .btn { min-height: 40px; }
  .topbar { padding-left: max(8px, env(safe-area-inset-left)); padding-right: max(8px, env(safe-area-inset-right)); }
  .admin-list { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 1.3rem; }
  input, select, textarea { font-size: 16px !important; } /* évite le zoom auto sur iPhone */
}
@media (display-mode: standalone) { .tuteur-fab { bottom: max(18px, env(safe-area-inset-bottom)); } }

/* Tables de vérité */
.tv-wrap{overflow-x:auto;margin:8px 0;-webkit-overflow-scrolling:touch}
table.tv{border-collapse:collapse;font-family:ui-monospace,Consolas,monospace;font-size:.92rem}
table.tv th,table.tv td{border:1px solid var(--border,#dee2e6);padding:4px 9px;text-align:center;white-space:nowrap}
table.tv th{background:#f5f6f8;font-weight:600}
table.tv .tv-var{background:#eef3fb}
table.tv td.tv-V{color:#0f6b34}
table.tv td.tv-F{color:#b42318}
table.tv .tv-fin{font-weight:700;background:#fff7e6}
table.tv td.tv-cache{color:#888;background:#fafafa}
table.tv tr.tv-hl td{background:#fff1c2}
.tv-symb{display:flex;flex-wrap:wrap;gap:6px;margin:6px 0}
.tv-symb .btn{min-width:42px;font-size:1.05rem;padding:6px 10px}
details.tv-ex,details.tv-loi{border:1px solid var(--border,#dee2e6);border-radius:8px;padding:8px 12px;margin:8px 0;background:#fff}
details.tv-ex summary,details.tv-loi summary{cursor:pointer}
.maj-bandeau{position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));z-index:3000;display:flex;flex-wrap:wrap;align-items:center;gap:8px;background:#fff;border:1px solid #f98012;border-radius:10px;box-shadow:0 6px 24px rgba(0,0,0,.18);padding:10px 12px}
.maj-bandeau span{flex:1 1 200px}
#apkBandeau{bottom:calc(84px + env(safe-area-inset-bottom,0px))}
.mdp-ligne{display:flex;gap:6px;align-items:stretch}
.mdp-ligne input{flex:1;min-width:0}
.mdp-oeil{border:1px solid #ced4da;background:#fff;border-radius:6px;padding:0 10px;cursor:pointer;font-size:1rem}
.login-aide{margin-top:8px}
.login-aide summary{cursor:pointer;color:#0f6cbf}
.login-aide p{margin:6px 0}
