/* ==========================================================================
   RÉVISION FS2 MOBTER — thème « carnet technique » (chargé en dernier)
   Bleu nuit + or, titres Cormorant Garamond, texte Public Sans, fonds unis.
   Polices hébergées sur le site (fonts/, licence SIL OFL) : aucun appel extérieur.
   ========================================================================== */
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/CormorantGaramond.woff2") format("woff2"); font-weight: 500 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/CormorantGaramond-Italic.woff2") format("woff2"); font-weight: 500 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Public Sans"; src: url("../fonts/PublicSans.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }

:root {
  --bg: #FBFAF7; --surface: #FFFFFF; --surface-2: #F4F1EA; --text: #1E2433; --muted: #5A6375; --border: #E6E1D6;
  --ink: #1B2A4A; --primary: #1B2A4A; --primary-2: #2A3D66; --on-primary: #FBFAF7;
  --gold: #8A6A24; --gold-soft: #F4EEE1; --accent: #8A6A24; --navy: #1B2A4A; --navy-2: #2A3D66;
  --good: #15803D; --good-bg: #ECF8F0; --mid: #B45309; --mid-bg: #FEF3E2; --bad: #C62828; --bad-bg: #FDEDED;
  --info-bg: #F4EEE1; --track: #E9E4D8;
  --shadow: 0 1px 2px rgba(20, 30, 50, .05);
  --radius: 12px;
  --font-d: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --font-t: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1626; --surface: #152038; --surface-2: #1A2741; --text: #D9DCE3; --muted: #A9B1C0; --border: #26324D;
    --ink: #ECE6D8; --primary: #C8A75A; --primary-2: #D6B872; --on-primary: #0E1626;
    --gold: #C8A75A; --gold-soft: #1A2741; --accent: #C8A75A; --navy: #0E1626; --navy-2: #152038;
    --good: #4ADE80; --good-bg: #12301F; --mid: #FBBF24; --mid-bg: #33270F; --bad: #F87171; --bad-bg: #3A1A1A;
    --info-bg: #1A2741; --track: #26324D; --shadow: none; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1626; --surface: #152038; --surface-2: #1A2741; --text: #D9DCE3; --muted: #A9B1C0; --border: #26324D;
  --ink: #ECE6D8; --primary: #C8A75A; --primary-2: #D6B872; --on-primary: #0E1626;
  --gold: #C8A75A; --gold-soft: #1A2741; --accent: #C8A75A; --navy: #0E1626; --navy-2: #152038;
  --good: #4ADE80; --good-bg: #12301F; --mid: #FBBF24; --mid-bg: #33270F; --bad: #F87171; --bad-bg: #3A1A1A;
  --info-bg: #1A2741; --track: #26324D; --shadow: none; color-scheme: dark;
}

/* ---------- Base : fond uni, typographie ---------- */
body { background: var(--bg); color: var(--text); font-family: var(--font-t); font-size: 16px; line-height: 1.55; letter-spacing: 0; }
body[data-subj]::before, body::before { content: none !important; display: none !important; }
body[data-subj] .main { background: none; }
a { color: var(--ink); text-underline-offset: 3px; }
h1, h2, h3, .h1, .h2, .h3, .brand, .tile-l, .subj-head .h1 { font-family: var(--font-d); color: var(--ink); letter-spacing: 0; text-transform: none; }
.h1, h1 { font-size: 2.1rem; font-weight: 600; line-height: 1.12; margin: 8px 0 12px; }
.h2, h2 { font-size: 1.6rem; font-weight: 600; line-height: 1.2; margin: 30px 0 12px; }
.h3, h3 { font-size: 1.3rem; font-weight: 600; }
.subj-head .h1 { text-transform: none; }
.h2-atelier::after { content: none; display: none; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
::selection { background: var(--gold-soft); }

/* Marques qui remplacent les emojis porteurs de sens (js/ui-clean.js) */
.mk { font-weight: 800; font-family: var(--font-t); }
.mk-ok { color: var(--good); } .mk-ko { color: var(--bad); } .mk-warn { color: var(--mid); } .mk-ask { color: var(--mid); } .mk-muted { color: var(--muted); }

/* ---------- Barre du haut ---------- */
.topbar { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--border); box-shadow: none; }
.brand { color: var(--ink); gap: 0; letter-spacing: 0; }
.brand-mark { display: none; }
.brand-name { display: flex; flex-direction: column; font-family: var(--font-d); font-size: 1.45rem; font-weight: 700; line-height: 1; color: var(--ink); white-space: nowrap; }
.brand-name small { font-family: var(--font-t); font-size: .62rem; font-weight: 700; letter-spacing: .2em; color: var(--gold); margin-top: 3px; }
.brand-sub { display: none; }
.top-search input { background: var(--surface-2); border: 1px solid var(--border); color: var(--text); border-radius: 10px; }
.top-search input::placeholder { color: var(--muted); }
.top-search .ts-ic { color: var(--muted); }
.theme-btn { background: transparent !important; color: var(--ink) !important; border: 1px solid var(--border) !important; border-radius: 10px !important; }

/* ---------- Navigation ---------- */
.sidebar { background: var(--bg); border-right: 1px solid var(--border); }
.sidebar a { color: var(--text); border-radius: 8px; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a.active { background: var(--gold-soft); color: var(--ink); font-weight: 700; }
.side-title { font-family: var(--font-t); font-size: .72rem; letter-spacing: .18em; color: var(--gold); font-weight: 700; }
.side-subjects a > span:first-child:empty { display: none; }
.bottom-nav { background: var(--surface); border-top: 1px solid var(--border); }
.bottom-nav a { color: var(--muted); font-weight: 500; font-size: .72rem; }
.bottom-nav a.active { color: var(--ink); font-weight: 700; }
.bottom-nav a.active span.ic { background: transparent; padding: 0; }
.bottom-nav a.active span.ic svg { stroke-width: 2.1; }

/* ---------- Éléments communs ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
a.card:hover { border-color: var(--ink); transform: none; box-shadow: var(--shadow); }
.btn { border-radius: 10px; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--ink); box-shadow: none; }
.btn:hover { border-color: var(--ink); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: none; }
.btn.primary:hover { background: var(--primary-2); border-color: var(--primary-2); }
.btn.ghost { background: transparent; }
.chip { background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.chip:hover, .chip.on { border-color: var(--ink); color: var(--ink); }
.pill { background: var(--surface-2); color: var(--ink); }
.bar { background: var(--track); height: 6px; }
.bar span { background: var(--ink); }
.bar.good span { background: var(--good); } .bar.mid span { background: var(--mid); } .bar.bad span { background: var(--bad); }
.crumbs, .crumbs a { color: var(--muted); }
.toast { background: var(--ink); color: var(--bg); border-radius: 10px; }
.disclaimer { background: transparent; border: 0; border-top: 1px solid var(--border); border-radius: 0; color: var(--muted); font-size: .85rem; padding: 14px 0 0; }

/* Encadrés de cours : fond teinté, sans bande latérale */
.box { border-left: 0; border-radius: 10px; padding: 14px 16px; }
.box.retenir { background: var(--gold-soft); }
.box.retenir > b:first-child, .box.retenir > strong:first-child { color: var(--gold); font-family: var(--font-t); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; }
.box.piege { background: var(--bad-bg); }
.box.explic { background: var(--surface-2); }
.box.methode { background: var(--surface-2); }
figure { border-radius: 12px; border-color: var(--border); }
.lesson-body th, .tw th { background: var(--surface-2); color: var(--ink); }

/* ---------- Matières (accueil, cours, QCM) ---------- */
.subj { border-left: 1px solid var(--border) !important; }
.subj::after, .subj-head::after { content: none !important; display: none !important; }
.subj-ic { display: none !important; }
.subj:hover { transform: none; }
.subj-head { background: none; border: 0; padding: 0; box-shadow: none; }
.subj-head .h1, .subj-head p { color: inherit; }
.lesson-list a:hover { background: var(--surface-2); }
.num { color: var(--gold); font-weight: 700; }

/* ---------- QCM : réponses entourées en vert ou en rouge ---------- */
.q-card { border-radius: 14px; box-shadow: var(--shadow); }
.q-text { font-family: var(--font-d); font-size: 1.6rem; font-weight: 600; line-height: 1.18; color: var(--ink); }
.choice { border: 1px solid var(--border); border-radius: 12px; }
.choice:hover:not([disabled]) { border-color: var(--ink); background: var(--surface-2); }
.choice .letter { border-radius: 50%; background: var(--track); color: var(--ink); width: 30px; height: 30px; }
.choice.correct { border: 3px solid var(--good); background: var(--good-bg); padding: 10px 12px; }
.choice.correct .letter { background: var(--good); color: var(--surface); }
.choice.wrong { border: 3px solid var(--bad); background: var(--bad-bg); padding: 10px 12px; }
.choice.wrong .letter { background: var(--bad); color: var(--surface); }
.choice.picked { border: 2px solid var(--ink); }
.choice.dim { opacity: .6; }
.feedback { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.feedback.ok { border-color: var(--border); }
.feedback.ko { border-color: var(--border); }
.fb-title { font-family: var(--font-d); font-size: 1.6rem; font-weight: 700; }
.fb-sec { background: var(--surface-2); border-left: 0; }
.fb-sec.retenir { background: var(--gold-soft); }
.fb-sec.retenir b:first-child, .fb-sec.retenir strong:first-child { color: var(--gold); }
.fb-sec.attention { background: var(--mid-bg); }
.fb-sec.dev { background: var(--surface-2); border-left: 0; }
.progress { background: var(--track); }
.progress span { background: var(--ink); }

/* ---------- Résultats ---------- */
.res-head { box-shadow: var(--shadow); }
.res-title { border-color: var(--ink); font-family: var(--font-d); letter-spacing: .06em; }
.res-pct { font-family: var(--font-d); color: var(--ink); }
.prio { border-left: 1px solid var(--border); box-shadow: var(--shadow); }
.prio.bad, .prio.mid, .prio.good { border-left-color: var(--border); }
.prio.bad .prio-h { color: var(--bad); } .prio.mid .prio-h { color: var(--mid); } .prio.good .prio-h { color: var(--good); }
.review-cta { border-left: 1px solid var(--border); }

/* ---------- Ancien accueil « atelier » (remplacé) ---------- */
.atelier, .hazard, .servante, .atelier-outils { display: none !important; }

/* ==========================================================================
   Nouvel accueil
   ========================================================================== */
.home { display: flex; flex-direction: column; gap: 30px; max-width: 720px; margin: 0 auto; }
.home-hello p { margin: 0 0 4px; color: var(--muted); font-size: .95rem; }
.home-hello h1 { margin: 0; font-size: 2.35rem; line-height: 1.08; }
.home-resume { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.eyebrow { margin: 0; font-size: .75rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.home-resume h2 { margin: 0; font-size: 1.6rem; line-height: 1.15; }
.home-resume .meta { font-size: .85rem; color: var(--muted); }
.btn-main { display: flex; align-items: center; justify-content: center; text-align: center; gap: 8px; min-height: 50px; padding-top: 10px; padding-bottom: 10px; border-radius: 10px; background: var(--primary); color: var(--on-primary); font-weight: 700; text-decoration: none; border: 0; cursor: pointer; font-size: 1rem; padding: 0 18px; }
.btn-main:hover { background: var(--primary-2); }
.btn-line { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--ink); color: var(--ink); font-weight: 600; text-decoration: none; background: transparent; white-space: nowrap; }
.btn-line:hover { background: var(--surface-2); }
.home-today { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 14px; background: var(--gold-soft); }
.home-today .ic-round { width: 44px; height: 44px; flex: none; border-radius: 50%; background: var(--surface); color: var(--gold); display: grid; place-items: center; }
.home-today .txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.home-today .txt b { color: var(--ink); }
.home-today .txt span { font-size: .85rem; color: var(--muted); }
.home-uv { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.home-uv .lbl { flex-basis: 100%; font-size: .85rem; color: var(--muted); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.sec-head h2 { margin: 0; }
.sec-head span { font-size: .85rem; color: var(--muted); }
.subj-list { display: flex; flex-direction: column; }
.subj-row { display: flex; flex-direction: column; gap: 6px; padding: 14px 4px; border-top: 1px solid var(--border); text-decoration: none; color: var(--text); }
.subj-row:hover { background: var(--surface-2); }
.subj-row .top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.subj-row .name { font-weight: 600; font-size: 1.02rem; color: var(--ink); }
.subj-row .pct { font-size: .85rem; font-weight: 700; color: var(--ink); white-space: nowrap; }
.subj-row .pct.none { color: var(--muted); font-weight: 500; }
.subj-row .meta { font-size: .85rem; color: var(--muted); }
.subj-row .bar { margin: 0; height: 4px; }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 700px) { .tools-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tool-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); }
.tool-card:hover { border-color: var(--ink); }
.tool-card svg { width: 22px; height: 22px; }
.tool-card b { font-size: .92rem; }
.tool-card span { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.tools-more { display: block; text-align: center; margin-top: 10px; font-weight: 600; min-height: 44px; line-height: 44px; }
.home-quote { margin: 0; padding-top: 16px; border-top: 1px solid var(--border); font-family: var(--font-d); font-style: italic; font-weight: 600; font-size: 1.35rem; line-height: 1.35; color: var(--ink); }
.home-suggest { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
.home-suggest .txt { flex: 1; min-width: 0; }
.home-suggest .txt b { display: block; color: var(--ink); }
.home-suggest .txt span { font-size: .85rem; color: var(--muted); }
@media (max-width: 420px) { .home-suggest { flex-wrap: wrap; } .home-suggest .btn-line { flex: 1; } }
.home-foot-note { margin: 0; font-size: .8rem; color: var(--muted); line-height: 1.5; }

/* ---------- Boîte de dialogue (signaler, proposer) ---------- */
dialog { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--text); max-width: min(520px, calc(100% - 32px)); }
dialog::backdrop { background: rgba(14, 22, 38, .55); }
dialog textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); color: var(--text); font: inherit; }
dialog textarea:focus { outline: 2px solid var(--gold); border-color: transparent; }

/* ---------- Page introuvable ---------- */
.notfound { max-width: 560px; margin: 8vh auto; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.notfound .code { font-family: var(--font-d); font-size: 5.5rem; font-weight: 700; line-height: 1; color: var(--gold); }
.notfound h1 { margin: 0; }
.notfound p { margin: 0; color: var(--muted); }
.notfound .acts { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 8px; }

/* ---------- Transfert de progression ---------- */
.transfer { max-width: 560px; margin: 6vh auto; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Corrections fines ---------- */
/* Chiffres alignés (Cormorant dessine par défaut des chiffres « bas de casse ») */
h1, h2, h3, .h1, .h2, .h3, .q-text, .fb-title, .res-pct, .brand-name, .notfound .code { font-variant-numeric: lining-nums; }
/* Sur téléphone, le nom reste visible à gauche de la recherche */
@media (max-width: 700px) {
  .brand > span.brand-name { display: flex !important; font-size: 1.15rem; }
  .brand-name small { font-size: .55rem; letter-spacing: .16em; }
  .top-search { min-width: 0; }
}
.nl-ic:empty, .tool > span:empty, .lesson-sims a > span:empty { display: none; }
.nav-list a { gap: 12px; }
.main:focus, .main:focus-visible { outline: none; }

/* ---------- Espace administrateur ---------- */
.admin-tabs { margin: 4px 0 20px; }
.admin-tabs .chip b { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 4px; border-radius: 10px; background: var(--ink); color: var(--bg); font-size: .72rem; }
.admin-tabs .chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.admin-tabs .chip.on b { background: var(--gold); color: var(--surface); }
.admin-search, .qe-form { display: flex; flex-direction: column; gap: 8px; }
.qe-form label.small, .admin-search label.small { margin-top: 8px; }
.qe-ta { width: 100%; box-sizing: border-box; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); color: var(--text); font: inherit; resize: vertical; }
.qe-ta:focus, .qe-form .sync-in:focus { outline: 2px solid var(--gold); border-color: transparent; }
.qe-sel { width: 100%; justify-content: flex-start; }
.qe-choices { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin: 10px 0 0; display: flex; flex-direction: column; gap: 8px; }
.qe-row { display: flex; align-items: center; gap: 8px; }
.qe-row .sync-in { flex: 1; min-width: 0; }
.qe-good-l { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--ink); min-width: 52px; min-height: 44px; }
.qe-good-l input { width: 20px; height: 20px; accent-color: var(--good); }
.rep-done { opacity: .65; }

/* ---------- Passage unslop (finitions) ---------- */
/* Graisses 600 au plus (au lieu de 800 / 900) */
.act,
.atelier-plaque small,
.badge,
.brand b,
.brand-mark,
.cal-d,
.cal-m,
.choice .letter,
.exo-title,
.exp-steps li::before,
.fb-title,
.flow i,
.ftab td.f-name,
.h1,
.memo-h,
.memo-key,
.mk,
.num,
.prio-h,
.res-pct,
.res-subj,
.res-title,
.side-title,
.sr-ic,
.steps li::before,
.subj-score,
.sys-h h3,
.tile-l { font-weight: 600; }
/* Écriture normale au lieu des MAJUSCULES espacées */
.act,
.badge,
.box.retenir > b:first-child, .box.retenir > strong:first-child,
.brand-sub,
.eyebrow,
.ftab td.f-lab::before,
.ftab td.f-more::before,
.h2,
.lesson-body th, .tw th,
.panne small,
.pc-deck,
.subj-head .h1,
.sys-sub,
.today-h small::first-letter { text-transform: none; letter-spacing: normal; }

/* Chiffres alignés partout (Cormorant dessine par défaut des chiffres « bas de casse ») */
* { font-variant-numeric: lining-nums !important; }
.num-c, .res-pct, .tbl td, .subj-row .pct, .bar + .meta { font-variant-numeric: lining-nums tabular-nums !important; }

/* Surtitres et petits intitulés en écriture normale */
.eyebrow { text-transform: none; letter-spacing: normal; font-size: .85rem; font-weight: 600; }
.side-title { text-transform: none; letter-spacing: normal; font-size: .8rem; font-weight: 600; }
.brand-name small { letter-spacing: .06em; }
.box.retenir > b:first-child, .box.retenir > strong:first-child { font-size: .9rem; }

/* Onglets Leçons / Exercices : neutres, l'onglet actif se détache par sa surface */
.seg-tabs a, .seg-tabs a:not(.on):last-child { background: transparent; color: var(--muted); }
.seg-tabs a.on { background: var(--surface); color: var(--ink); box-shadow: none; border: 1px solid var(--border); }

/* Titres de section sans barre latérale, en-têtes de systèmes sans dégradé */
.sec-title { padding-left: 0; border-left: 0; }
.sys-h { background: var(--surface-2); }

/* Barres de progression : une seule couleur, le pourcentage dit le niveau */
.bar.good span, .bar.mid span, .bar.bad span, .bar.none span { background: var(--ink); }
.res-pct.good, .res-pct.mid, .res-pct.bad { color: var(--ink); }

/* Boutons d'une matière : pas de bouton orphelin en demi-largeur */
.subj-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.subj-actions .btn { flex: 1 1 140px; justify-content: center; text-align: center; }
.subj-actions .btn.primary, .subj-actions .pill { flex-basis: 100%; }

/* Survol : changement de fond, sans déplacement */
.lesson-list a:hover, .subj:hover, .tile:hover, a.card:hover { transform: none; }
.mk { font-weight: 700; }
/* Élément actif de la barre latérale : fond seul, sans trait sur le côté */
.sidebar a.active { box-shadow: none; border-radius: 8px; font-weight: 600; }

/* ---------- Mentions légales ---------- */
.legal { max-width: 760px; }
.legal-sec { padding-top: 4px; }
.legal-sec p { margin: 8px 0; }
.legal-tbl td, .legal-tbl th { vertical-align: top; font-size: .92rem; }
.legal-list { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.legal-item h4 { margin: 0 0 6px; font-size: 1rem; color: var(--ink); }
.legal-item p { margin: 4px 0; font-size: .92rem; }

/* ==========================================================
   Couleurs et emojis par matière : chaque matière retrouve sa couleur
   (REV.add color, posée en --c sur ses éléments et --sc sur la page)
   et son emoji, pour se repérer d'un coup d'œil entre les matières.
   Aplats et teintes légères, sans dégradé ni motif de fond.
   ========================================================== */
/* listes de matières (accueil, Cours, QCM, fiches) */
.subj { border-left: 6px solid var(--c) !important; }
.subj-ic { display: grid !important; background: color-mix(in srgb, var(--c) 14%, var(--surface)); box-shadow: none; }
.subj:hover { border-color: var(--c); border-left-color: var(--c); }
.subj-row { border-left: 5px solid var(--c); padding-left: 12px; border-radius: 0 10px 10px 0; }
.subj-row .bar span { background: var(--c) !important; }
.subj-emoji { margin-right: 8px; }

/* en-tête d'une matière : bandeau teinté de sa couleur avec son emoji */
.subj-head { background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); border-bottom: 4px solid var(--c); border-radius: 16px; padding: 20px 16px; }
.subj-head .h1 { color: var(--ink); }

/* barre latérale : emoji devant chaque matière */
#side-subjects a > span:first-child { display: inline-block; width: 1.6em; text-align: center; }

/* leçons, QCM, aide-mémoires, exercices, systèmes : repère de couleur de la matière */
.lesson-body h3, .lesson-body h2.lh3 { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.q-head { border-bottom: 3px solid var(--c); }
.progress span { background: var(--c); }
.memo { border-top: 4px solid var(--c); }
.memo-h { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.exo-card { border-left: 5px solid var(--c); }
.sys-h { background: color-mix(in srgb, var(--c) 12%, var(--surface)); }
.sys-sub { color: color-mix(in srgb, var(--c) 80%, var(--ink)); }
.rev-lesson, .lesson.fiche { border-top: 4px solid var(--c); }
.deck { border-top: 4px solid var(--c); }
article.lesson { border-top: 4px solid var(--c); padding-top: 8px; }

/* ==========================================================================
   Accueil « atelier » (version 207) : la mise en page d'origine, en plus sobre
   Plaque « Révision FS2 », outils, servante à 4 tiroirs, bande jaune et noire, postes de l'atelier.
   Aplats sans dégradé ni reflet, survol sans mouvement, graisses 600 au plus.
   ========================================================================== */
@font-face { font-family: "Oswald"; src: url("../fonts/Oswald.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }
.home-atelier { max-width: 900px; gap: 26px; }
.home-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 4px; }
.home-steps b { color: var(--ink); font-weight: 600; }
.home-atelier .home-uv .lbl { flex-basis: auto; margin-right: 4px; }
.home-atelier .home-uv .btn-line { min-height: 44px; }

.atelier2 {
  border-radius: 16px; overflow: hidden; color: #e5e9f0; text-align: center;
  background: #2a3343 radial-gradient(circle, rgba(255, 255, 255, .09) 1.4px, transparent 1.8px) 0 0 / 18px 18px;
  padding: 22px 16px 0;
}
.plaque {
  position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 30px 10px; border-radius: 10px; background: #e7eaef; color: #1b2230;
  border: 1px solid #9aa3b1; box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}
.plaque small { font-size: .74rem; font-weight: 600; color: #3b475d; letter-spacing: 0; }
.plaque h1 { margin: 0; font-family: "Oswald", "Arial Narrow", sans-serif; font-weight: 600; font-size: 2.3rem; line-height: 1.1; text-transform: uppercase; letter-spacing: .04em; color: #1b2230; }
.rivet { position: absolute; width: 8px; height: 8px; border-radius: 50%; background: #8a93a2; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6); }
.rivet:nth-child(1) { left: 7px; top: 7px; } .rivet:nth-child(2) { right: 7px; top: 7px; }
.rivet:nth-child(3) { left: 7px; bottom: 7px; } .rivet:nth-child(4) { right: 7px; bottom: 7px; }
.atelier2-sub { margin: 12px auto 0; max-width: 46ch; color: #cbd2dc; font-size: .95rem; }
.atelier2-outils { height: 150px; margin: 6px 0 0; background: url("../img/deco/atelier-outils.svg") center bottom / contain no-repeat; opacity: .9; }
.servante2 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; padding: 10px; margin: 0 -6px; background: #9f1d1d; border-radius: 12px 12px 0 0; }
.tiroir {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  min-height: 92px; padding: 12px 12px 24px; border-radius: 8px; background: #c62828; color: #fff; text-decoration: none;
  border: 1px solid rgba(0, 0, 0, .2); transition: background-color .15s;
}
.tiroir:hover { background: #d33a3a; }
.tiroir:focus-visible { outline: 3px solid #f5b301; outline-offset: 2px; }
.tiroir-ic { display: block; margin-bottom: 4px; opacity: .95; }
.tiroir b { font-family: "Oswald", "Arial Narrow", sans-serif; font-weight: 500; font-size: 1.15rem; line-height: 1.15; letter-spacing: .01em; }
.tiroir > span:not(.tiroir-ic) { font-size: .78rem; color: #fde2e2; }
.poignee { position: absolute; left: 50%; bottom: 8px; width: 44%; height: 6px; transform: translateX(-50%); border-radius: 3px; background: #e5e7eb; }
.hazard2 { height: 14px; margin: 0 -16px; background: repeating-linear-gradient(-45deg, #f5b301 0 14px, #1b2230 14px 28px); }

.postes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 6px; }
.poste {
  display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 76px;
  background: var(--surface); border: 1px solid var(--border); border-left: 5px solid var(--c); border-radius: 10px;
  color: var(--text); text-decoration: none; transition: border-color .15s, background-color .15s;
}
.poste:hover { background: var(--surface-2); }
.poste-ic { flex: none; width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.35rem; border-radius: 10px; background: color-mix(in srgb, var(--c) 14%, transparent); }
.poste-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.poste-txt b { font-weight: 600; color: var(--ink); line-height: 1.25; }
.poste-txt .meta { font-size: .8rem; color: var(--muted); }
.poste .bar { height: 4px; margin: 4px 0 0; }
.poste .bar span { background: var(--c) !important; }
.poste-etat { flex: none; align-self: flex-start; font-size: .75rem; font-weight: 600; padding: 3px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--muted); }
.poste-etat.mid { background: var(--mid-bg); color: var(--mid); }
.poste-etat.ok { background: var(--good-bg); color: var(--good); }

.og-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 6px; }
.og { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 6px 6px; }
.og h3 { margin: 0 10px 6px; font-family: var(--font-t); font-size: .82rem; font-weight: 600; color: var(--gold); }
.og ul { list-style: none; margin: 0; padding: 0; }
.og li a { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 10px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.og li a:hover { background: var(--surface-2); }
.og li a svg { flex: none; color: var(--muted); }
.og li + li a { border-top: 1px solid var(--border); border-radius: 0; }

@media (max-width: 860px) { .og-grid { grid-template-columns: 1fr; } }
@media (max-width: 700px) {
  .postes { grid-template-columns: 1fr; }
  .home-atelier .home-uv .lbl { flex-basis: 100%; }
  .home-atelier .home-uv .btn-line { flex: 1 1 auto; justify-content: center; }
  .servante2 { grid-template-columns: 1fr 1fr; }
  .atelier2-outils { height: 90px; }
  .plaque h1 { font-size: 1.7rem; }
  .plaque { padding: 10px 22px 8px; }
}
