/* Formation juge-arbitre : interface du site. Charte : docs/charte.md */

:root {
  --navy: #0b2545; --navy2: #174a87; --orange: #e8590c; --blue: #1c6dd0; --lilac: #7048e8;
  --red: #c92a2a; --green: #2b8a3e; --ball: #d8f14a;
  --bg: #f4f6fa; --surface: #ffffff; --surface2: #eef3fa; --line: #d6dee8;
  --text: #1b1f24; --muted: #5b6678; --link: #1c6dd0; --focus: #1c6dd0;
  --header-h: 56px; --side-w: 17rem; --toc-w: 15rem; --lecture: 46rem;
  --radius: 10px; --shadow: 0 1px 2px rgba(11, 37, 69, .06), 0 4px 14px rgba(11, 37, 69, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1420; --surface: #152033; --surface2: #1b2a42; --line: #2a3a55;
    --text: #e6ebf2; --muted: #9aa8bd; --link: #74b0ff; --focus: #74b0ff; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d1420; --surface: #152033; --surface2: #1b2a42; --line: #2a3a55;
  --text: #e6ebf2; --muted: #9aa8bd; --link: #74b0ff; --focus: #74b0ff; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--header-h) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "DejaVu Sans", Arial, sans-serif;
}
a { color: var(--link); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 6px; }
.skip:focus { left: 8px; }

/* ---------------------------------------------------------------- en-tête */
.top {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  display: flex; align-items: center; gap: 10px; padding: 0 14px;
  background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.top a { color: #fff; text-decoration: none; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .2px; white-space: nowrap; }
.brand .logo { width: 26px; height: 26px; flex: none; }
.brand .lvl { background: var(--orange); border-radius: 6px; padding: 1px 7px; font-size: .78rem; }
.top nav { display: flex; gap: 4px; margin-left: 8px; }
.top nav a { padding: 6px 10px; border-radius: 8px; font-weight: 600; font-size: .95rem; opacity: .88; }
.top nav a:hover, .top nav a[aria-current="page"] { background: rgba(255, 255, 255, .12); opacity: 1; }
.top .spacer { flex: 1; }
.searchbtn {
  display: flex; align-items: center; gap: 8px; min-width: 15rem; padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, .25); border-radius: 8px; background: rgba(255, 255, 255, .08);
  color: #dfe7f3; font: inherit; font-size: .92rem; cursor: pointer; text-align: left;
}
.searchbtn:hover { background: rgba(255, 255, 255, .14); }
.searchbtn kbd { margin-left: auto; font: .75rem ui-monospace, monospace; border: 1px solid rgba(255, 255, 255, .3); border-radius: 4px; padding: 0 5px; }
.iconbtn {
  display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
  border: 0; border-radius: 8px; background: transparent; color: #fff; font-size: 1.15rem; cursor: pointer;
}
.iconbtn:hover { background: rgba(255, 255, 255, .12); }
.menubtn { display: none; }

/* ---------------------------------------------------------------- mise en page */
.layout { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w); gap: 0; max-width: 1500px; margin: 0 auto; }
.layout.notoc { grid-template-columns: var(--side-w) minmax(0, 1fr); }
.side {
  position: sticky; top: var(--header-h); align-self: start; height: calc(100vh - var(--header-h)); overflow-y: auto;
  padding: 18px 12px 30px 16px; border-right: 1px solid var(--line); font-size: .93rem;
}
.side h2 { font-size: .74rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 16px 8px 6px; }
.side h2:first-child { margin-top: 0; }
.side ol, .side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: flex; gap: 8px; align-items: baseline; padding: 6px 8px; border-radius: 8px; color: var(--text); text-decoration: none; line-height: 1.3; }
.side a:hover { background: var(--surface2); }
.side a[aria-current="page"] { background: var(--surface2); color: var(--link); font-weight: 700; box-shadow: inset 3px 0 0 var(--orange); }
.side .num { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface2); color: var(--muted); font-size: .76rem; font-weight: 800; border: 1px solid var(--line); }
.side a[aria-current="page"] .num { background: var(--orange); color: #fff; border-color: var(--orange); }

main { min-width: 0; padding: 22px 26px 60px; }
.crumbs { font-size: .85rem; color: var(--muted); margin: 0 0 12px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }

.toc { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 22px 16px 30px 8px; font-size: .84rem; }
.toc h2 { font-size: .74rem; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin: 0 0 8px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 3px 0 3px 10px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.toc li.h3 a { padding-left: 22px; font-size: .8rem; }
.toc li a:hover { color: var(--text); }
.toc li a.on { color: var(--link); border-left-color: var(--orange); font-weight: 600; }

/* ---------------------------------------------------------------- feuille de cours */
.fiche {
  max-width: 62rem; margin: 0 auto; background: #fff; color: #1b1f24; border-radius: var(--radius);
  padding: 22px 26px 26px; box-shadow: var(--shadow); color-scheme: light;
}
.fiche a { color: #1c6dd0; }
.fiche p, .fiche li { max-width: var(--lecture); }
.fiche .glance p, .fiche .glance li, .fiche td p, .fiche .box p { max-width: none; }
.fiche h2, .fiche h3 { scroll-margin-top: calc(var(--header-h) + 12px); }
.fiche .table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 4px 0 8px; }
.fiche .table-scroll table { margin: 0; min-width: 32rem; }
.fiche svg { max-width: 100%; height: auto; }
.fiche details.corr { transform: none; margin-top: 8px; padding: 8px 12px; border: 1px dashed #b8c2d1; border-radius: 8px; font-size: .9rem; color: #33415c; }
.fiche details.corr summary { cursor: pointer; font-weight: 700; color: #1c6dd0; }
.fiche details.corr p { margin: 8px 0 0; }
.fiche .foot { margin-top: 22px; }
/* les éléments de grille ne doivent jamais imposer leur largeur de contenu (débordement sur téléphone) */
.fiche .grid2 > *, .fiche .grid3 > *, .fiche .case > *, .fiche .vs > *, .fiche .fig2 > *, .fiche .method > *, .fiche .timeline > * { min-width: 0; }
.fiche .glance .gp { clear: both; }
/* décor de couverture toujours derrière le texte */
.fiche .cover > :not(.ball), .hero > :not(.ballx) { position: relative; z-index: 1; }

.pager { max-width: 62rem; margin: 18px auto 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pager a { display: block; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); }
.pager a:hover { border-color: var(--blue); }
.pager small { display: block; color: var(--muted); font-size: .78rem; }
.pager .next { text-align: right; grid-column: 2; }

.foot-site { max-width: 62rem; margin: 30px auto 0; font-size: .8rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; }

/* ---------------------------------------------------------------- pages d'accueil */
.page { max-width: 62rem; margin: 0 auto; }
.hero {
  background: linear-gradient(120deg, var(--navy) 0%, var(--navy2) 70%, var(--orange) 140%); color: #fff;
  border-radius: 14px; padding: 26px 26px 22px; position: relative; overflow: hidden;
}
.hero h1 { margin: 0 0 6px; font-size: 1.9rem; line-height: 1.2; }
.hero p { margin: 0; opacity: .92; max-width: 40rem; }
.hero .ballx { position: absolute; right: -36px; top: -36px; width: 140px; height: 140px; border-radius: 50%; background: var(--ball); opacity: .9; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 12px; margin: 16px 0; }
.tile {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-decoration: none; box-shadow: var(--shadow);
}
.tile:hover { border-color: var(--blue); }
.tile .k { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; color: var(--orange); }
.tile b { font-size: 1.02rem; line-height: 1.3; }
.tile span { color: var(--muted); font-size: .88rem; }
.tile .resume { font-size: .82rem; line-height: 1.4; }
.section-title { font-size: 1.15rem; margin: 26px 0 4px; color: var(--text); }
.section-sub { margin: 0 0 6px; color: var(--muted); font-size: .92rem; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .layout, .layout.notoc { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 760px) {
  :root { --header-h: 52px; }
  .layout, .layout.notoc { grid-template-columns: minmax(0, 1fr); }
  .menubtn { display: inline-flex; }
  .top nav { display: none; }
  .searchbtn { min-width: 0; width: 38px; height: 38px; padding: 0; justify-content: center; border: 0; background: transparent; font-size: 1.1rem; }
  .searchbtn .lbl, .searchbtn kbd { display: none; }
  .brand .txt { display: none; }
  .side {
    position: fixed; z-index: 50; top: var(--header-h); left: 0; bottom: 0; width: min(86vw, 20rem); height: auto;
    background: var(--surface); box-shadow: 4px 0 18px rgba(0, 0, 0, .25); transform: translateX(-105%); transition: transform .2s;
  }
  body.menu-open .side { transform: none; }
  body.menu-open::after { content: ""; position: fixed; inset: var(--header-h) 0 0 0; background: rgba(0, 0, 0, .35); z-index: 45; }
  .side .mobile-nav { display: block; }
  main { padding: 14px 12px 50px; }
  .fiche { padding: 14px 14px 18px; border-radius: 8px; }
  /* grilles des fiches imprimées : empilées sur téléphone */
  .fiche .grid2, .fiche .grid3, .fiche .case, .fiche .case.wide, .fiche .vs, .fiche .fig2, .fiche .timeline { grid-template-columns: minmax(0, 1fr); }
  .fiche .method { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fiche .pair { grid-template-columns: minmax(0, 1fr); }
  .fiche .reco { grid-template-columns: 34px minmax(0, 1fr); }
  .fiche .reco > :nth-child(n+3) { grid-column: 1 / -1; }
  .fiche .legend { flex-wrap: wrap; }
  .fiche .formula { white-space: normal; }
  .fiche .glance .gh span { display: none; }
  .fiche .cover .ball, .hero .ballx { width: 90px; height: 90px; right: -30px; top: -30px; opacity: .55; }
  .fiche .step { min-height: 0; border-radius: 8px !important; }
  .fiche .cover h1 { font-size: 1.6rem; }
  .fiche .flow, .fiche .nbrow { flex-wrap: wrap; }
  .fiche .calc { min-width: 0; }
  .pager { grid-template-columns: 1fr; }
  .pager .next { grid-column: 1; }
  .hero h1 { font-size: 1.5rem; }
}
.side .mobile-nav { display: none; }

@media print {
  .top, .side, .toc, .pager, .foot-site, .crumbs { display: none !important; }
  .layout { display: block; }
  .fiche { box-shadow: none; padding: 0; }
}

/* ---------------------------------------------------------------- schémas des cas : plus grands à l'écran */
@media (min-width: 761px) {
  .fiche .case { grid-template-columns: minmax(300px, 44%) minmax(0, 1fr); }
  .fiche .case.wide { grid-template-columns: minmax(340px, 50%) minmax(0, 1fr); }
  .fiche svg.br { max-height: 520px; }
}
.fiche #changements { scroll-margin-top: calc(var(--header-h) + 12px); }

/* ---------------------------------------------------------------- encadré « Exemple » (ajouté au lot 2) */
.fiche .box.exm { background: #ebfbee; border-left: 4px solid var(--green); }
.fiche .box.exm:before { content: "✎"; color: var(--green); }
.fiche .box.exm .lbl { color: var(--green); }

/* ---------------------------------------------------------------- S3 · les 111 questions */
.fiche .q111-bar { position: sticky; top: var(--header-h); z-index: 5; background: #fff; border: 1px solid #d6dee8; border-radius: 10px; padding: 10px 12px; margin: 12px 0; box-shadow: 0 4px 12px rgba(11,37,69,.06); }
.fiche .switch { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: #0b2545; cursor: pointer; }
.fiche .switch input { width: 18px; height: 18px; accent-color: #e8590c; }
.fiche .qfs { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: thin; }
.fiche .qf { flex: none; border: 1px solid #d6dee8; background: #f7f9fc; color: #1b1f24; border-radius: 18px; padding: 4px 11px; font: inherit; font-size: .84rem; cursor: pointer; white-space: nowrap; }
.fiche .qf span { color: #6c7a91; font-size: .76rem; margin-left: 3px; }
.fiche .qf.on { background: #0b2545; color: #fff; border-color: #0b2545; }
.fiche .qf.on span { color: #cfd8e6; }
.fiche .q111-count { margin: 4px 0 0; font-size: .8rem; color: #5b6678; }
.fiche .q111 { border: 1px solid #d6dee8; border-radius: 10px; margin: 8px 0; background: #fff; overflow: hidden; }
.fiche .q111 .qq { display: flex; gap: 10px; width: 100%; text-align: left; background: #f7f9fc; border: 0; padding: 10px 12px; font: inherit; color: #0b2545; font-weight: 600; cursor: pointer; }
.fiche .q111 .qn { flex: none; background: #e8590c; color: #fff; border-radius: 6px; padding: 1px 7px; font-size: .78rem; font-weight: 800; height: fit-content; margin-top: 2px; }
.fiche .q111 .qr { padding: 6px 14px 10px 14px; border-top: 1px solid #e3e8ef; }
.fiche .q111 .qr ul { margin: 4px 0; } .fiche .q111 .qr p { margin: 4px 0; }
.fiche.masquer .q111:not(.ouvert) .qr { display: none; }
.fiche.masquer .q111:not(.ouvert) .qq::after { content: "Voir la réponse"; margin-left: auto; flex: none; align-self: center; font-size: .75rem; color: #1c6dd0; font-weight: 700; }
.fiche .q111:target { outline: 3px solid #e8590c; }

/* ---------------------------------------------------------------- recherche globale */
.search { position: fixed; inset: 0; z-index: 80; background: rgba(5, 12, 24, .55); display: flex; justify-content: center; align-items: flex-start; padding: 8vh 12px 12px; }
.search[hidden] { display: none; }
body.search-open { overflow: hidden; }
.search-panel { width: min(46rem, 100%); max-height: 80vh; display: flex; flex-direction: column; background: var(--surface); color: var(--text); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); overflow: hidden; }
.search-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search-head input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font: inherit; font-size: 1.08rem; }
.search-close { border: 1px solid var(--line); background: var(--surface2); color: var(--muted); border-radius: 6px; padding: 2px 8px; font: inherit; font-size: .75rem; cursor: pointer; }
.search-res { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.search-res li a { display: block; padding: 9px 11px; border-radius: 9px; color: var(--text); text-decoration: none; }
.search-res li.on a, .search-res li a:hover { background: var(--surface2); }
.search-res li.on a { box-shadow: inset 3px 0 0 var(--orange); }
.sr-meta { display: flex; gap: 8px; align-items: center; font-size: .74rem; color: var(--muted); }
.sr-k { font-weight: 800; text-transform: uppercase; letter-spacing: .5px; font-size: .66rem; padding: 1px 6px; border-radius: 5px; background: var(--surface2); color: var(--link); }
.sr-k.sr-q111 { background: #fff0e6; color: #b5541c; } .sr-k.sr-term { background: #ebfbee; color: #2b8a3e; }
.sr-t { display: block; font-weight: 700; margin: 2px 0; line-height: 1.3; }
.sr-x { display: block; font-size: .84rem; color: var(--muted); line-height: 1.4; }
.search mark { background: #ffe066; color: #1b1f24; border-radius: 2px; padding: 0 1px; }
.search-vide { padding: 14px; color: var(--muted); }
.search-hint { margin: 0; padding: 8px 14px; font-size: .76rem; color: var(--muted); border-top: 1px solid var(--line); }
.search-hint kbd { font: .72rem ui-monospace, monospace; border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
@media (max-width: 760px) { .search { padding: 0; } .search-panel { max-height: 100vh; height: 100%; border-radius: 0; } }
/* dans un cas pas à pas, le tableau tient dans sa colonne (pas de largeur minimale) */
.fiche .case .table-scroll table, .fiche .grid2 .table-scroll table, .fiche .glance .table-scroll table { min-width: 0; }

/* ---------------------------------------------------------------- Apprendre */
.app { max-width: 46rem; margin: 0 auto; }
.app-load, .avert { color: var(--muted); }
.avert { background: #fff4e6; color: #5c2b00; padding: 10px 14px; border-radius: 10px; max-width: 46rem; margin: 0 auto 12px; }
.app h1 { font-size: 1.5rem; margin: 0 0 8px; } .app h2 { font-size: 1.08rem; margin: 18px 0 8px; }
.panneau { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin: 14px 0; box-shadow: var(--shadow); }
.petit { font-size: .85rem; color: var(--muted); } .centre { text-align: center; } .petit-lien { font-size: .8rem; color: #cfe0ff; margin-left: auto; }
.btn { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 9px 14px; font: inherit; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: var(--blue); }
.btn.big { padding: 14px 16px; } .btn.big b { font-size: 1.05rem; } .btn.big span { font-size: .84rem; color: var(--muted); }
.btn.primaire { background: var(--orange); border-color: var(--orange); color: #fff; } .btn.primaire span { color: #ffe8d6; }
.btn.alerte { border-color: var(--red); } .btn.alerte b { color: var(--red); }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn kbd, .note kbd { font: .7rem ui-monospace, monospace; opacity: .75; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; margin-left: 6px; }
.choix-examen { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.tdb-haut { background: linear-gradient(120deg, var(--navy) 0%, var(--navy2) 75%, var(--orange) 150%); color: #fff; border-radius: 16px; padding: 18px 18px 14px; box-shadow: var(--shadow); }
.compte { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.compte .cr { font-size: 2rem; font-weight: 900; letter-spacing: .5px; color: var(--ball); }
.compte .cl { opacity: .9; }
.tuiles-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 10px; }
.ts { background: rgba(255, 255, 255, .1); border-radius: 10px; padding: 8px 10px; }
.ts b { display: block; font-size: 1.45rem; line-height: 1.1; } .ts span { font-size: .76rem; opacity: .85; }
.panneau .ts, .bilan .ts { background: var(--surface2); }
.ts.su b { color: var(--green); } .ts.hesite b { color: #e67700; } .ts.rate b { color: var(--red); }
.conseil { margin: 8px 0 0; font-size: .92rem; }
.jauge { height: 8px; border-radius: 6px; background: rgba(127, 140, 160, .25); overflow: hidden; }
.jauge span { display: block; height: 100%; background: var(--green); border-radius: 6px; transition: width .3s; }
.jauge.grande { height: 10px; background: rgba(255, 255, 255, .18); } .jauge.grande span { background: var(--ball); }
.jauge.seance { margin: 6px 0 14px; } .jauge.seance span { background: var(--orange); }
.actions { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; margin: 14px 0; }
.ligne-stat { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; }
.ligne-stat:last-child { border-bottom: 0; }
.ligne-stat:hover .ls-nom { color: var(--link); }
.ligne-stat .jauge { grid-column: 1 / -1; height: 6px; }
.ls-nom { font-weight: 600; font-size: .93rem; } .ls-chiffres { font-size: .8rem; color: var(--muted); text-align: right; }
.message { min-height: 1.2em; color: var(--green); font-weight: 600; }
/* séance */
.seance-haut { display: flex; align-items: center; gap: 12px; }
.seance-titre { font-weight: 800; } .seance-compte { margin-left: auto; color: var(--muted); font-size: .85rem; }
.quitter { text-decoration: none; color: var(--muted); font-size: 1.1rem; padding: 2px 6px; border-radius: 6px; }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); }
.carte .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tag { font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 6px; background: var(--surface2); color: var(--muted); }
.tag-rdj { background: #e7f1ff; color: #1c6dd0; } .tag-rs { background: #f3f0ff; color: #7048e8; } .tag-ra { background: #fff0f0; color: #c92a2a; } .tag-tableaux { background: #ebfbee; color: #2b8a3e; }
.tag-new { background: #fff4e6; color: #b5541c; } .tag-ko { background: #fff0f0; color: #c92a2a; } .tag-conf { background: #fff4e6; color: #e8590c; }
.carte .q { font-size: 1.2rem; line-height: 1.45; margin: 4px 0 14px; }
.consigne { color: var(--muted); font-size: .88rem; margin: 6px 0 10px; }
.reveler { align-items: center; flex-direction: row; }
.choix { display: grid; gap: 8px; } .choix.vf { grid-template-columns: 1fr 1fr; }
.opt { display: flex; gap: 10px; align-items: flex-start; text-align: left; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); border-radius: 12px; padding: 11px 13px; font: inherit; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--blue); }
.opt .k { flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--surface2); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: .8rem; }
.opt.bonne { border-color: var(--green); background: rgba(43, 138, 62, .12); } .opt.bonne .k { background: var(--green); color: #fff; }
.opt.fausse { border-color: var(--red); background: rgba(201, 42, 42, .1); } .opt.fausse .k { background: var(--red); color: #fff; }
.opt:disabled { cursor: default; }
.reponse { margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.reponse h3 { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .6px; color: var(--green); }
.reponse .texte p, .reponse .texte li { margin: 3px 0; }
.pourquoi { margin-top: 10px; background: var(--surface2); border-left: 4px solid var(--lilac); padding: 8px 12px; border-radius: 8px; }
.pourquoi p { display: inline; margin: 0; }
.ref { font-size: .82rem; color: var(--muted); margin: 10px 0 0; }
.notes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.notes[hidden] { display: none; }
.notes .consigne { flex: 1 0 100%; margin: 0; }
.notes .note { flex: 1 1 0; min-width: 0; }
.note { border: 0; border-radius: 12px; padding: 13px 8px; font: inherit; font-weight: 800; color: #fff; cursor: pointer; }
.note.rate { background: var(--red); } .note.hesite { background: #e67700; } .note.su { background: var(--green); }
.bilan h1 { margin-bottom: 4px; }
@media (max-width: 760px) {
  .tuiles-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions { grid-template-columns: 1fr; }
  .carte { padding: 14px; } .carte .q { font-size: 1.08rem; }
  .compte .cr { font-size: 1.6rem; }
}

/* bouton « Me tester » en bas des pages de cours */
.cta-test { max-width: 62rem; margin: 18px auto 0; display: flex; align-items: center; gap: 14px; justify-content: space-between; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--orange); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.cta-test > div { flex: 1 1 18rem; color: var(--text); }

/* S6 · lexique */
.fiche .term { padding: 9px 12px; margin: 6px 0; border: 1px solid #e3e8ef; border-left: 4px solid #1c6dd0; border-radius: 8px; background: #fbfcfe; }
.fiche .term p { margin: 3px 0; max-width: none; }
.fiche .term:target { outline: 3px solid #e8590c; }

/* exercices de tableaux et examen blanc (lots 7 et 8) */
.actions-2 { grid-template-columns: 1fr 1fr; }
.onglets { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.onglet { border: 1px solid var(--line); background: var(--surface2); color: var(--text); border-radius: 18px; padding: 5px 12px; font: inherit; font-size: .86rem; cursor: pointer; }
.onglet.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.enonce { background: var(--surface2); border-left: 4px solid var(--orange); border-radius: 8px; padding: 6px 14px; margin: 10px 0; }
.champs { display: grid; gap: 8px; margin: 10px 0; }
.champ { display: grid; grid-template-columns: minmax(0, 1fr) 8rem; gap: 4px 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; }
.champ .lib { font-weight: 600; font-size: .92rem; }
.champ input, .champ select, .app select, .app input[type=date] { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); width: 100%; }
.app label select { width: auto; }
.champ .expl { grid-column: 1 / -1; font-size: .84rem; color: var(--muted); }
.champ.ok { border-color: var(--green); background: rgba(43, 138, 62, .07); } .champ.ok .expl { color: var(--green); }
.champ.ko { border-color: var(--red); background: rgba(201, 42, 42, .06); } .champ.ko .expl { color: var(--red); }
.chrono { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; } .chrono.fin { color: var(--red); }
.chrono + .seance-compte { margin-left: 12px; }
.opt.choisi { border-color: var(--blue); background: rgba(28, 109, 208, .1); } .opt.choisi .k { background: var(--blue); color: #fff; }
.nav-examen { display: flex; justify-content: space-between; margin-top: 12px; }
.corr-q { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 10px 0; }
.corr-q.ok { border-color: var(--green); } .corr-q.ko { border-color: var(--red); }
.corr-q .cq { margin: 0 0 6px; } .corr-q .juge { margin: 8px 0 0; }
@media (max-width: 760px) { .actions-2 { grid-template-columns: 1fr; } .champ { grid-template-columns: minmax(0, 1fr) 6rem; } }

/* ---------------------------------------------------------------- lisibilité des schémas (demande du 20/11) */
.fiche { max-width: 70rem; }
.pager, .cta-test, .foot-site { max-width: 70rem; }
.fiche .diag .cap, .fiche .diag .ttl { font-size: .95rem; line-height: 1.45; }
.fiche .diag svg { cursor: zoom-in; }
@media (min-width: 761px) {
  /* cas pas à pas : le schéma prend un peu plus de la moitié de la largeur */
  .fiche .case, .fiche .case.wide { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .fiche svg.br { max-height: 760px; }
  .fiche svg.pyr { max-height: 420px; }
  /* recommandations : colonne du schéma élargie */
  .fiche .reco { grid-template-columns: 34px minmax(0, 1fr) minmax(260px, 40%); }
  /* grilles de schémas : jamais plus étroites que 300 px par schéma */
  .fiche .grid3:has(.diag), .fiche .grid2:has(.diag), .fiche .pair, .fiche .fig2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; }
}
/* visionneuse plein écran */
.zoom { position: fixed; inset: 0; z-index: 90; background: rgba(5, 12, 24, .82); display: flex; flex-direction: column; align-items: center; padding: 12px; overflow: auto; }
.zoom[hidden] { display: none; }
.zoom-barre { width: 100%; max-width: 1500px; display: flex; justify-content: space-between; align-items: center; color: #fff; margin-bottom: 8px; gap: 10px; }
.zoom-barre .t { font-weight: 700; }
.zoom-barre button { border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; cursor: pointer; }
.zoom-cadre { background: #fff; border-radius: 10px; padding: 14px; width: min(1500px, 100%); }
.zoom-cadre svg { width: 100% !important; height: auto !important; max-height: none !important; display: block; }
.zoom-cadre .cap { color: #33415c; margin-top: 8px; font-size: 1rem; }
@media (max-width: 760px) {
  .zoom { padding: 6px; } .zoom-cadre { padding: 6px; width: auto; min-width: 100%; }
  .zoom-cadre svg { width: 900px !important; max-width: none; }   /* sur téléphone : on fait défiler un grand schéma */
}
.diag-indice { display: none; }
@media (hover: none) { .fiche .diag { position: relative; } .fiche .diag .diag-indice { display: block; position: absolute; right: 6px; bottom: 6px; background: rgba(11,37,69,.75); color: #fff; font-size: .72rem; border-radius: 6px; padding: 1px 6px; pointer-events: none; } }
/* les tableaux portent une hauteur maximale écrite dans le SVG (héritée des fiches A4) : on la lève à l'écran */
@media (min-width: 761px) { .fiche svg.br, .fiche svg.fg, .fiche svg.pyr { max-height: 640px !important; } }
@media (max-width: 760px) { .fiche svg.br, .fiche svg.fg, .fiche svg.pyr { max-height: 520px !important; } }
.fiche .diag .cap, .fiche .reco .diag .cap, .fiche .pair .diag .cap { font-size: .95rem !important; line-height: 1.45; }
.fiche .diag { font-size: .95rem; }

/* sommaire de droite un peu plus grand (demande du 20/11) */
:root { --toc-w: 16.5rem; }
.toc { font-size: .92rem; }
.toc li.h3 a { font-size: .86rem; }
.toc li a { padding-top: 4px; padding-bottom: 4px; }

/* sélecteur Cours / Apprendre : interrupteur à deux positions, centré dans la barre (demande du 20/11) */
.top nav {
  position: absolute; left: 50%; transform: translateX(-50%); margin: 0;
  display: inline-flex; gap: 0; padding: 3px; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .35);
}
.top nav a {
  min-width: 7.5rem; text-align: center; padding: 6px 18px; border-radius: 999px;
  color: #cfdbec; opacity: 1; font-weight: 700; letter-spacing: .2px;
  transition: background .2s, color .2s, box-shadow .2s;
}
.top nav a:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.top nav a[aria-current="page"], .top nav a[aria-current="page"]:hover {
  background: var(--orange); color: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
@media (max-width: 1100px) { .searchbtn { min-width: 0; } .searchbtn .lbl { display: none; } }
