/* =============================================================================
   UQO — Notes de cours interactives — feuille de style
   Palette assortie à uqo-notes.sty (Fira Sans, bleu UQO, or, bleu nuit)
   ============================================================================= */

:root {
  --navy: #091a33;
  --navy-2: #0f2a52;
  --bleu: #003e7e;
  --bleu-clair: #2976bb;
  --or: #cca424;
  --or-fonce: #9e7d1c;
  --gris: #606670;
  --gris-clair: #d0d5dc;
  --gris-pale: #e7ebf0;
  --vert: #107c4e;
  --rouge: #b22a20;
  --bg: #ffffff;
  --bg-clair: #f2f6fa;
  --bg-2: #f7f9fc;
  --ink: #262b34;
  --ink-2: #4b5260;
  --link: #003e7e;
  --card: #ffffff;
  --border: #dde3ea;
  --shadow: 0 1px 2px rgba(9, 26, 51, .06), 0 8px 24px -12px rgba(9, 26, 51, .18);
  --shadow-sm: 0 1px 2px rgba(9, 26, 51, .08);
  --radius: 10px;
  --radius-sm: 6px;
  --text-w: 70ch;
  --margin-w: 260px;
  --margin-gap: 40px;
  --topbar-h: 60px;
  --font: "Fira Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "Fira Code", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs: 17px;
  --lh: 1.65;
  color-scheme: light;
}

[data-theme="dark"] {
  --navy: #060f1f;
  --navy-2: #0c1e3a;
  --bleu: #6fa8e6;
  --bleu-clair: #8cbdf0;
  --or: #e0bb47;
  --or-fonce: #cfa933;
  --gris: #a2a9b6;
  --gris-clair: #3a4352;
  --gris-pale: #2b333f;
  --vert: #4fbf8f;
  --rouge: #f07a70;
  --bg: #0f1420;
  --bg-clair: #161d2b;
  --bg-2: #131927;
  --ink: #e6eaf1;
  --ink-2: #b8c0cc;
  --link: #8cbdf0;
  --card: #171e2d;
  --border: #283142;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

[data-fs="s"] { --fs: 15.5px; }
[data-fs="l"] { --fs: 19px; }
[data-fs="xl"] { --fs: 21px; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--topbar-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs);
  line-height: var(--lh);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd { font-family: var(--mono); font-size: .9em; }
code { background: var(--bg-clair); padding: .1em .35em; border-radius: 4px; }
kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 .4em; background: var(--card); font-size: .8em; }
hr.sep { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gris-clair) 20%, var(--gris-clair) 80%, transparent); margin: 2.2rem auto; position: relative; max-width: 60%; }
hr.sep::after { content: ""; position: absolute; left: 50%; top: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--or); transform: translateX(-50%); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--or); color: var(--navy); padding: .5rem 1rem; border-radius: 6px; z-index: 1000; font-weight: 600; }
.skip:focus { left: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* couleurs sémantiques */
.c-bleu { color: var(--bleu); }
.c-bleu-clair { color: var(--bleu-clair); }
.c-or { color: var(--or-fonce); }
[data-theme="dark"] .c-or { color: var(--or); }
.c-gris { color: var(--gris); }
.c-gris-clair { color: var(--gris-clair); }
.c-vert { color: var(--vert); }
.c-rouge { color: var(--rouge); }
.c-navy { color: var(--navy); }
[data-theme="dark"] .c-navy { color: var(--ink); }
.c-white { color: inherit; }
.upper { text-transform: uppercase; }
.sc { font-variant: small-caps; }
.num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* =============================================================================
   Barre supérieure
   ============================================================================= */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy);
  color: #fff;
  border-bottom: 2px solid var(--or);
}
.topbar-inner {
  max-width: 1400px; margin: 0 auto; padding: 0 20px;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 18px;
}
.brand { display: flex; align-items: baseline; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand-code { font-weight: 800; letter-spacing: .04em; color: var(--or); font-size: 1.05rem; }
.brand-title { font-size: .92rem; opacity: .9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: flex; gap: 2px; margin-left: auto; align-items: center; }
.topnav > a, .topnav > .dd > button {
  color: #fff; text-decoration: none; font-size: .9rem; font-weight: 500; padding: 8px 11px; border-radius: 6px; background: none; border: 0; cursor: pointer; font-family: inherit; opacity: .9;
  display: inline-flex; align-items: center; gap: 6px;
}
.topnav > a:hover, .topnav > .dd > button:hover, .topnav > a[aria-current="page"] { background: rgba(255, 255, 255, .1); opacity: 1; }
.topnav > a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--or); }
.dd { position: relative; }
.dd-menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 520px;
  background: var(--card); color: var(--ink); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 10px; display: none; grid-template-columns: 1fr 1fr; gap: 2px 14px; z-index: 200;
}
.dd.open .dd-menu { display: grid; }
.dd-menu a { display: flex; gap: 10px; align-items: baseline; padding: 6px 8px; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: .88rem; line-height: 1.3; }
.dd-menu a:hover { background: var(--bg-clair); }
.dd-menu .dd-part { grid-column: 1 / -1; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); margin: 8px 8px 2px; font-weight: 600; }
.dd-menu .dd-part:first-child { margin-top: 0; }
.pastille { flex: 0 0 auto; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--bleu); color: #fff; font-size: .72rem; font-weight: 700; }
[data-theme="dark"] .pastille { background: var(--bleu-clair); color: var(--navy); }
.pastille.done { background: var(--vert); }
.topbar-actions { display: flex; gap: 4px; align-items: center; }
.icon-btn {
  appearance: none; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); color: #fff; width: 38px; height: 38px; border-radius: 8px; cursor: pointer; display: inline-grid; place-items: center;
}
.icon-btn:hover { background: rgba(255, 255, 255, .16); }
.icon-btn svg { width: 19px; height: 19px; }
.search-btn { width: auto; padding: 0 12px; gap: 8px; font-family: inherit; font-size: .85rem; display: inline-flex; align-items: center; white-space: nowrap; }
.search-btn kbd { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .2); color: #fff; }
.menu-btn { display: none; }
.readbar { height: 3px; background: rgba(255, 255, 255, .08); }
.readbar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--or), #f1d67a); transition: width .1s linear; }

@media (max-width: 980px) {
  .topnav { display: none; position: absolute; top: var(--topbar-h); left: 0; right: 0; background: var(--navy); flex-direction: column; align-items: stretch; padding: 10px 14px 16px; border-bottom: 2px solid var(--or); gap: 4px; }
  .topnav.open { display: flex; }
  .topnav > a, .topnav > .dd > button { padding: 12px 14px; font-size: 1rem; }
  .dd-menu { position: static; min-width: 0; grid-template-columns: 1fr; background: rgba(255, 255, 255, .06); color: #fff; border-color: rgba(255, 255, 255, .12); }
  .dd-menu a { color: #fff; }
  .dd-menu a:hover { background: rgba(255, 255, 255, .1); }
  .dd-menu .dd-part { color: var(--or); }
  .menu-btn { display: inline-grid; }
  .brand-title { display: none; }
  .search-btn span { display: none; }
  .search-btn kbd { display: none; }
  .search-btn { width: 38px; padding: 0; }
}

/* =============================================================================
   Pied de page
   ============================================================================= */
.site-footer { margin-top: 80px; background: var(--navy); color: rgba(255, 255, 255, .78); border-top: 3px solid var(--or); font-size: .9rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 40px 20px 30px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.footer-inner h4 { color: #fff; margin: 0 0 10px; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.footer-inner a { color: rgba(255, 255, 255, .85); text-decoration: none; display: block; padding: 3px 0; }
.footer-inner a:hover { color: var(--or); }
.footer-brand .brand-code { font-size: 1.4rem; }
.footer-legal { border-top: 1px solid rgba(255, 255, 255, .1); }
.footer-legal div { max-width: 1200px; margin: 0 auto; padding: 14px 20px; font-size: .78rem; color: rgba(255, 255, 255, .6); display: flex; gap: 20px; flex-wrap: wrap; justify-content: space-between; }
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-inner { grid-template-columns: 1fr; } }

/* =============================================================================
   Mise en page générique
   ============================================================================= */
.page { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.page-head { padding: 44px 0 20px; }
.page-head h1 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); margin: 0 0 6px; color: var(--bleu); line-height: 1.15; }
.page-head .lead { color: var(--ink-2); font-size: 1.08rem; max-width: 72ch; margin: 0; }
.eyebrow { font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; color: var(--or-fonce); font-weight: 700; display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
[data-theme="dark"] .eyebrow { color: var(--or); }
.eyebrow::before { content: ""; width: 26px; height: 3px; background: var(--or); border-radius: 2px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.card h3 { margin: 0 0 8px; font-size: 1.05rem; color: var(--bleu); }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: .92rem; text-decoration: none; cursor: pointer; border: 1px solid transparent; font-family: inherit; line-height: 1.2;
  background: var(--bleu); color: #fff; transition: transform .08s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); text-decoration: none; }
.btn svg { width: 17px; height: 17px; }
.btn-or { background: var(--or); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--bleu); border-color: var(--border); }
[data-theme="dark"] .btn { background: var(--bleu-clair); color: var(--navy); }
[data-theme="dark"] .btn-ghost { background: transparent; color: var(--bleu-clair); }
.btn-sm { padding: 6px 11px; font-size: .82rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: var(--bg-clair); color: var(--ink-2); border: 1px solid var(--border); white-space: nowrap; }
.chip svg { width: 13px; height: 13px; }
.chip-or { background: rgba(204, 164, 36, .15); color: var(--or-fonce); border-color: rgba(204, 164, 36, .35); }
[data-theme="dark"] .chip-or { color: var(--or); }
.chip-vert { background: rgba(16, 124, 78, .12); color: var(--vert); border-color: rgba(16, 124, 78, .3); }
.chip-rouge { background: rgba(178, 42, 32, .1); color: var(--rouge); border-color: rgba(178, 42, 32, .3); }
.chip-bleu { background: rgba(41, 118, 187, .12); color: var(--bleu-clair); border-color: rgba(41, 118, 187, .3); }

/* =============================================================================
   Accueil
   ============================================================================= */
.hero {
  position: relative; overflow: hidden;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(41, 118, 187, .35), transparent 60%), linear-gradient(160deg, var(--navy) 0%, #0d2549 60%, #0f2f5c 100%);
  color: #fff;
  border-bottom: 4px solid var(--or);
}
.hero-inner { max-width: 1200px; margin: 0 auto; padding: 72px 20px 60px; position: relative; z-index: 1; display: grid; grid-template-columns: 1.3fr .9fr; gap: 40px; align-items: center; }
.hero .eyebrow { color: var(--or); }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3.6rem); line-height: 1.08; margin: 0 0 18px; font-weight: 800; letter-spacing: -.01em; }
.hero h1 .code { display: block; font-size: .42em; letter-spacing: .12em; color: var(--or); font-weight: 700; margin-bottom: 10px; }
.hero .lead { font-size: 1.12rem; color: rgba(255, 255, 255, .82); max-width: 62ch; margin: 0 0 26px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-cta .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.hero-deco { position: absolute; inset: 0; pointer-events: none; }
.hero-deco circle { fill: none; stroke: rgba(41, 118, 187, .35); stroke-width: 1.2; }
.hero-deco .gold { stroke: rgba(204, 164, 36, .6); }
.hero-deco .dot { fill: var(--or); stroke: none; }
.hero-deco text { fill: rgba(255, 255, 255, .07); font-weight: 800; font-family: var(--font); }
.hero-card { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 22px 24px; backdrop-filter: blur(6px); }
.hero-card h3 { margin: 0 0 12px; font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--or); }
.hero-card .resume-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 6px; }
.hero-card .muted { color: rgba(255, 255, 255, .7); font-size: .9rem; }
.hero-card .bar { height: 6px; background: rgba(255, 255, 255, .15); border-radius: 3px; margin: 14px 0; overflow: hidden; }
.hero-card .bar i { display: block; height: 100%; background: var(--or); width: 0; border-radius: 3px; }
.hero-card .btn { margin-top: 6px; }
.hero-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 34px; }
.stat { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); border-radius: 10px; padding: 12px 14px; }
.stat b { display: block; font-size: 1.5rem; font-weight: 800; color: #fff; line-height: 1.1; }
.stat span { font-size: .78rem; color: rgba(255, 255, 255, .7); text-transform: uppercase; letter-spacing: .06em; }
@media (max-width: 900px) { .hero-inner { grid-template-columns: 1fr; padding: 48px 20px 40px; } .hero-stats { grid-template-columns: 1fr 1fr; } }

.section { padding: 48px 0 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.7rem; color: var(--bleu); }
.section-head p { margin: 4px 0 0; color: var(--ink-2); }

.part-title { display: flex; align-items: center; gap: 14px; margin: 30px 0 14px; color: var(--ink-2); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.part-title::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.part-title .roman { color: var(--or-fonce); }
.seances { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.seance-card { position: relative; display: flex; flex-direction: column; gap: 10px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 18px 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease; }
.seance-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--bleu-clair); text-decoration: none; }
.seance-card .sc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.seance-card .sc-num { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--or-fonce); font-weight: 700; }
[data-theme="dark"] .seance-card .sc-num { color: var(--or); }
.seance-card h3 { margin: 0; font-size: 1.05rem; line-height: 1.3; color: var(--bleu); }
.seance-card .sc-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: .76rem; color: var(--gris); margin-top: auto; }
.seance-card .sc-meta span { display: inline-flex; gap: 4px; align-items: center; }
.seance-card .sc-events { display: flex; gap: 6px; flex-wrap: wrap; }
.ring { --p: 0; width: 34px; height: 34px; border-radius: 50%; background: conic-gradient(var(--vert) calc(var(--p) * 1%), var(--gris-pale) 0); display: grid; place-items: center; flex: 0 0 auto; }
.ring::after { content: ""; width: 26px; height: 26px; border-radius: 50%; background: var(--card); }
.ring[data-done="1"] { background: var(--vert); }
.ring[data-done="1"]::after { content: "✓"; color: var(--vert); font-weight: 800; font-size: .85rem; display: grid; place-items: center; }

.eval-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.eval-table th, .eval-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.eval-table th { background: var(--bleu); color: #fff; font-weight: 600; }
.eval-table tr:nth-child(even) td { background: var(--bg-2); }
.eval-table td.al-c { text-align: center; }
.eval-table .total td { font-weight: 700; border-top: 2px solid var(--or); }

.feature { display: flex; gap: 14px; align-items: flex-start; }
.feature .f-icon { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--bg-clair); color: var(--bleu); }
.feature .f-icon svg { width: 22px; height: 22px; }
.feature h3 { margin: 0 0 4px; font-size: 1rem; }
.feature p { margin: 0; color: var(--ink-2); font-size: .92rem; }

/* =============================================================================
   Page de séance (chapitre)
   ============================================================================= */
.ch-hero { position: relative; overflow: hidden; background: linear-gradient(150deg, var(--navy), #0f2a52 70%, #103565); color: #fff; border-bottom: 4px solid var(--or); }
.ch-hero-inner { max-width: 1400px; margin: 0 auto; padding: 44px 20px 34px; position: relative; z-index: 1; }
.ch-hero .eyebrow { color: var(--or); }
.ch-hero h1 { font-size: clamp(1.7rem, 3.4vw, 2.7rem); line-height: 1.12; margin: 0 0 16px; max-width: 26ch; font-weight: 800; }
.ch-hero .ch-sub { color: rgba(255, 255, 255, .75); font-size: .95rem; margin-bottom: 18px; }
.ch-hero .ch-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.ch-hero .chip { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .14); }
.ch-hero .ch-tools { display: flex; gap: 10px; flex-wrap: wrap; }
.ch-hero .ch-tools .btn-ghost { color: #fff; border-color: rgba(255, 255, 255, .28); }
.ch-hero .ch-tools .btn-ghost[aria-pressed="true"] { background: var(--or); color: var(--navy); border-color: var(--or); }
.ch-hero .watermark { position: absolute; right: 20px; bottom: -30px; font-size: clamp(6rem, 14vw, 13rem); font-weight: 900; color: rgba(255, 255, 255, .06); line-height: 1; pointer-events: none; letter-spacing: -.04em; }
.ch-hero .deco { position: absolute; inset: 0; pointer-events: none; }
.ch-hero .deco circle { fill: none; stroke: rgba(41, 118, 187, .32); stroke-width: 1.2; }
.ch-hero .deco .gold { stroke: rgba(204, 164, 36, .6); }

.ch-layout { max-width: 1400px; margin: 0 auto; padding: 30px 20px 0; display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 44px; align-items: start; }
.ch-toc { position: sticky; top: calc(var(--topbar-h) + 3px + 18px); max-height: calc(100vh - var(--topbar-h) - 40px); overflow: auto; font-size: .86rem; padding-right: 6px; scrollbar-width: thin; }
.ch-toc h4 { margin: 0 0 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gris); }
.ch-toc ol { list-style: none; margin: 0 0 14px; padding: 0; border-left: 2px solid var(--border); }
.ch-toc li a { display: block; padding: 5px 0 5px 12px; color: var(--ink-2); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; line-height: 1.35; }
.ch-toc li.lvl3 a { padding-left: 24px; font-size: .8rem; color: var(--gris); }
.ch-toc li a:hover { color: var(--bleu); }
.ch-toc li a.active { color: var(--bleu); border-left-color: var(--or); font-weight: 600; }
.ch-toc .toc-num { color: var(--or-fonce); font-weight: 600; margin-right: 6px; font-size: .78em; }
.ch-toc .toc-extra a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; color: var(--ink-2); text-decoration: none; }
.ch-toc .toc-extra a:hover { background: var(--bg-clair); color: var(--bleu); }
.ch-toc .toc-extra svg { width: 15px; height: 15px; color: var(--or-fonce); }
.ch-toc .toc-progress { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--gris); margin: 10px 0 16px; }
.ch-toc .toc-progress .bar { flex: 1; height: 5px; background: var(--gris-pale); border-radius: 3px; overflow: hidden; }
.ch-toc .toc-progress .bar i { display: block; height: 100%; width: 0; background: var(--vert); }

.ch-body { min-width: 0; }
.prose { width: 100%; max-width: calc(var(--text-w) + var(--margin-w) + var(--margin-gap)); }
.prose > *, .prose .box, .prose .table-wrap, .prose figure, .prose .center, .prose .eq, .prose ul, .prose ol, .prose details, .prose section { max-width: var(--text-w); }
.prose > h2, .prose > h3, .prose > h4 { max-width: var(--text-w); }
.prose p { margin: 0 0 1.05em; hyphens: auto; -webkit-hyphens: auto; }
.prose ul, .prose ol { padding-left: 1.5em; margin: .4em 0 1em; }
.prose li { margin: .3em 0; }
.prose ul > li::marker { color: var(--bleu); }
.prose ol.enum { list-style: none; counter-reset: enum; padding-left: 2em; }
.prose ol.enum > li { counter-increment: enum; position: relative; }
.prose ol.enum > li::before { content: counter(enum); position: absolute; left: -2em; top: .28em; width: 1.45em; height: 1.45em; border-radius: 50%; background: var(--bleu); color: #fff; font-size: .72em; font-weight: 700; display: grid; place-items: center; }
[data-theme="dark"] .prose ol.enum > li::before { background: var(--bleu-clair); color: var(--navy); }
.prose li.labeled { list-style: none; display: grid; grid-template-columns: auto 1fr; gap: 8px; margin-left: -1em; }
.prose li.labeled .li-label { font-weight: 700; color: var(--bleu-clair); }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }
.prose .motcle { color: var(--bleu); font-weight: 700; border-bottom: 1px dotted var(--bleu-clair); cursor: help; }
.prose .cite, .cite { font-size: .92em; color: var(--bleu); text-decoration: none; }
.prose .citation { color: var(--ink-2); }
.prose .xref { font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--bleu-clair); }
.prose .xref-missing { color: var(--rouge); }
.prose sup { line-height: 0; }

/* titres */
.prose h2.h-section { font-size: 1.62rem; color: var(--bleu); margin: 2.6em 0 .7em; line-height: 1.2; position: relative; padding-bottom: .35em; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.prose h2.h-section::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: linear-gradient(90deg, var(--or) 0 40px, var(--gris-clair) 40px); }
.prose h3.h-subsection { font-size: 1.24rem; color: var(--bleu-clair); margin: 2em 0 .5em; line-height: 1.25; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.prose h4.h-subsubsection { font-size: 1.05rem; color: var(--gris); margin: 1.6em 0 .4em; scroll-margin-top: calc(var(--topbar-h) + 20px); }
.prose h5.para-title { font-size: 1rem; margin: 1.2em 0 .3em; color: var(--ink); }
.h-num { color: var(--or-fonce); font-weight: 700; margin-right: .5em; font-variant-numeric: tabular-nums; }
[data-theme="dark"] .h-num { color: var(--or); }
.h-anchor { opacity: 0; margin-left: .4em; font-weight: 400; text-decoration: none; color: var(--gris); font-size: .8em; }
h2:hover .h-anchor, h3:hover .h-anchor, h4:hover .h-anchor { opacity: 1; }
.prose h2 + p, .prose h3 + p { margin-top: 0; }

/* boîtes pédagogiques */
.box { position: relative; border-radius: var(--radius-sm); margin: 1.4em 0; padding: 14px 18px 12px 18px; border-left: 4px solid var(--gris); background: var(--bg-clair); break-inside: avoid; }
.box-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 700; color: var(--gris); font-size: .95rem; }
.box-head .box-title { font-weight: 600; color: var(--ink-2); }
.box-icon { width: 18px; height: 18px; display: inline-grid; place-items: center; flex: 0 0 auto; }
.box-icon svg { width: 18px; height: 18px; }
.box-anchor { margin-left: auto; opacity: 0; color: var(--gris); text-decoration: none; font-weight: 400; }
.box:hover .box-anchor { opacity: .7; }
.box-body > :last-child { margin-bottom: 0; }
.box-body p:last-child { margin-bottom: 0; }
.box-def { border-left-color: var(--bleu); background: rgba(0, 62, 126, .06); }
.box-def .box-head { color: var(--bleu); }
.box-form { border-left-color: var(--or); background: rgba(9, 26, 51, .05); border-top: 1px solid rgba(204, 164, 36, .5); }
.box-form .box-head { color: var(--navy); }
[data-theme="dark"] .box-form .box-head { color: var(--or); }
.box-form .box-icon { color: var(--or-fonce); }
.box-ex { border-left-color: var(--vert); background: rgba(16, 124, 78, .07); }
.box-ex .box-head { color: var(--vert); }
.box-exo { border-left-color: var(--bleu-clair); background: rgba(41, 118, 187, .08); }
.box-exo .box-head { color: var(--bleu-clair); }
.box-att { border-left-color: var(--rouge); background: rgba(178, 42, 32, .06); }
.box-att .box-head { color: var(--rouge); }
.box-terrain { border-left-color: var(--or); background: rgba(204, 164, 36, .1); }
.box-terrain .box-head { color: var(--or-fonce); }
[data-theme="dark"] .box-terrain .box-head { color: var(--or); }
.box-rem { border-left-color: var(--gris); background: var(--bg-clair); }
.box-qc { border-left-color: var(--bleu-clair); background: rgba(41, 118, 187, .08); }
.box-qc .box-head { color: var(--bleu-clair); }
.box-ret { border-left: 0; background: var(--navy); color: #fff; padding: 18px 20px 16px; border-bottom: 3px solid var(--or); border-radius: var(--radius-sm); }
.box-ret .box-head { color: var(--or); }
.box-ret a, .box-ret .motcle, .box-ret .c-bleu, .box-ret .xref { color: #fff; }
.box-ret .c-rouge { color: #ffb3ad; }
.box-ret .c-vert { color: #8fe0bb; }
.box-ret .c-or { color: var(--or); }
.box-ret .katex { color: #fff; }
.box-ret code { background: rgba(255, 255, 255, .1); }
.box-obj { border: 1px solid var(--border); border-top: 3px solid var(--or); background: var(--card); border-left-width: 1px; border-radius: var(--radius); padding: 18px 20px; }
.box-obj .box-head { color: var(--bleu); font-size: 1.05rem; }
.box-obj .box-icon { color: var(--or-fonce); }
.box-obj ul { list-style: none; padding: 0; margin: 0; }
.box-obj li.obj { margin: 0; }
.box-obj li.obj label { display: flex; gap: 12px; align-items: flex-start; padding: 7px 8px; border-radius: 6px; cursor: pointer; }
.box-obj li.obj label:hover { background: var(--bg-clair); }
.box-obj input.obj-cb { margin-top: .35em; width: 17px; height: 17px; accent-color: var(--vert); flex: 0 0 auto; }
.box-obj input.obj-cb:checked + .obj-text { color: var(--gris); text-decoration: line-through; text-decoration-color: var(--gris-clair); }
.obj-progress { margin-left: auto; font-size: .78rem; font-weight: 600; color: var(--gris); }
.box-synth { border: 0; border-top: 3px solid var(--or); background: var(--bg-clair); border-radius: var(--radius); padding: 20px 22px; margin-top: 2.5em; }
.box-synth .box-head { color: var(--bleu); font-size: 1.15rem; }
.box-synth .box-icon { color: var(--or-fonce); }
.box-synth ul { padding-left: 1.3em; }
.box-synth li { margin: .5em 0; }
.box-sol { border-left: 4px solid var(--gris-clair); background: var(--bg-2); margin-top: -0.6em; padding: 0; }
.box-sol summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 18px; font-weight: 700; color: var(--gris); user-select: none; }
.box-sol summary::-webkit-details-marker { display: none; }
.box-sol summary .sol-hint { margin-left: auto; font-size: .76rem; font-weight: 500; color: var(--gris); background: var(--card); border: 1px solid var(--border); padding: 2px 8px; border-radius: 999px; }
.box-sol[open] summary .sol-hint { display: none; }
.box-sol[open] summary { border-bottom: 1px dashed var(--border); }
.box-sol .box-body { padding: 12px 18px 14px; font-size: .95em; }
.box-sol .box-icon { color: var(--vert); }

/* équations */
.eq { margin: 1em 0 1.2em; overflow-x: auto; overflow-y: hidden; padding: 4px 2px; }
.eq .katex-display { margin: 0; }
.katex { font-size: 1.06em; }
.katex-display > .katex { white-space: normal; }
.math-error { color: var(--rouge); }

/* tableaux */
.table-wrap { overflow-x: auto; margin: 1.2em 0; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92em; line-height: 1.4; }
table.tbl th, table.tbl td { padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
table.tbl thead th { background: var(--bleu); color: #fff; font-weight: 600; position: sticky; top: 0; }
table.tbl tbody tr:nth-child(even) td { background: var(--bg-2); }
table.tbl tbody tr:last-child td { border-bottom: 0; }
table.tbl tr.rule-above td, table.tbl tr.rule-above th { border-top: 2px solid var(--or); }
table.tbl tbody th { background: var(--bleu); color: #fff; }
table.tbl .al-r { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl .al-c { text-align: center; }
.center { text-align: center; }
.center .table-wrap { text-align: left; }
figure { margin: 1.6em 0; }
figure.float-table figcaption { margin-bottom: .5em; }
figure.float-figure figcaption { margin-top: .6em; }
figcaption { font-size: .88em; color: var(--ink-2); line-height: 1.4; }
.fig-label { font-weight: 700; color: var(--bleu); margin-right: .4em; }
.tikz { text-align: center; margin: 1em 0; }
.tikz img { max-width: 100%; height: auto; background: #fff; border-radius: 6px; padding: 8px; border: 1px solid var(--border); }
[data-theme="dark"] .tikz img { background: #f5f7fa; }

/* notes marginales (Tufte) */
.sn-toggle { cursor: pointer; color: var(--or-fonce); font-size: .7em; vertical-align: super; margin-left: 2px; user-select: none; }
[data-theme="dark"] .sn-toggle { color: var(--or); }
.sn-toggle .sn-num { font-size: .95em; color: var(--bleu); font-weight: 700; }
.sn-cb { display: none; }
.sidenote { font-size: .8rem; line-height: 1.45; color: var(--gris); position: relative; }
.sidenote .sn-term { color: var(--bleu); display: block; }
.sidenote .sn-date { color: var(--or-fonce); }
.sidenote .sn-num { color: var(--bleu); font-weight: 700; }
@media (min-width: 1280px) {
  .sidenote { float: right; clear: right; width: var(--margin-w); margin-right: calc(-1 * (var(--margin-w) + var(--margin-gap))); margin-top: .1em; margin-bottom: .9em; padding-top: 6px; border-top: 2px solid var(--or); }
  .sn-toggle { display: none; }
  .prose .box .sidenote, .prose figure .sidenote, .prose .table-wrap .sidenote, .prose li .sidenote { float: none; width: auto; margin: .5em 0; display: block; border-top: 0; padding: 6px 10px; background: rgba(204, 164, 36, .12); border-radius: 4px; }
}
@media (max-width: 1279px) {
  .sidenote { display: none; margin: .6em 0; padding: 8px 12px; background: rgba(204, 164, 36, .12); border-left: 3px solid var(--or); border-radius: 4px; }
  .sn-cb:checked ~ .sidenote { display: block; }
  .prose p .sidenote, .prose li .sidenote { display: none; }
  .prose p .sn-cb:checked ~ .sidenote, .prose li .sn-cb:checked ~ .sidenote { display: block; }
}
/* mode révision : n'afficher que l'ossature */
body.revision .prose > p, body.revision .prose .box-ex, body.revision .prose .box-exo, body.revision .prose .box-sol, body.revision .prose .box-rem, body.revision .prose .box-terrain, body.revision .prose figure, body.revision .prose .center, body.revision .prose > .eq, body.revision .prose > ul, body.revision .prose > ol, body.revision .prose .table-wrap { display: none; }
body.revision .prose .box-def, body.revision .prose .box-form, body.revision .prose .box-att, body.revision .prose .box-ret, body.revision .prose .box-qc, body.revision .prose .box-synth, body.revision .prose .box-obj { display: block; }
body.revision .prose h2.h-section, body.revision .prose h3.h-subsection { display: block; }
body.revision .prose h4, body.revision .prose h5 { display: none; }
body.revision .sidenote { float: none; display: block; width: auto; margin: .6em 0 .6em 0; padding: 8px 12px; background: rgba(204, 164, 36, .12); border-left: 3px solid var(--or); border-top: 0; border-radius: 4px; }
body.revision .prose p:has(.sidenote) { display: block; font-size: 0; margin: 0; }
body.revision .prose p:has(.sidenote) .sidenote { font-size: .85rem; }
body.revision .sn-toggle { display: none; }
body.revision .revision-banner { display: flex; }
.revision-banner { display: none; align-items: center; gap: 10px; background: rgba(204, 164, 36, .18); border: 1px solid rgba(204, 164, 36, .5); color: var(--ink); padding: 10px 14px; border-radius: 8px; margin-bottom: 20px; font-size: .9rem; }
.revision-banner svg { width: 18px; height: 18px; color: var(--or-fonce); }
.revision-banner button { margin-left: auto; }

/* pagination et quiz de chapitre */
.ch-pager { max-width: 1400px; margin: 40px auto 0; padding: 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ch-pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: var(--card); }
.ch-pager a:hover { border-color: var(--bleu-clair); box-shadow: var(--shadow); }
.ch-pager a.next { text-align: right; align-items: flex-end; }
.ch-pager small { color: var(--gris); text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; font-weight: 700; }
.ch-pager b { color: var(--bleu); }
.ch-pager .spacer { visibility: hidden; }
@media (max-width: 600px) { .ch-pager { grid-template-columns: 1fr; } .ch-pager a.next { text-align: left; align-items: flex-start; } }
.ch-quiz { max-width: 1400px; margin: 50px auto 0; padding: 0 20px; }
.ch-quiz-inner { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); padding: 24px 26px; border-top: 4px solid var(--or); }

@media (max-width: 1100px) {
  .ch-layout { grid-template-columns: 1fr; gap: 20px; }
  .ch-toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; background: var(--card); }
  .ch-toc ol { max-height: 220px; overflow: auto; }
}

/* =============================================================================
   Quiz
   ============================================================================= */
.quiz { --q-accent: var(--bleu); }
.quiz-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.quiz-head h2, .quiz-head h3 { margin: 0; color: var(--bleu); font-size: 1.3rem; }
.quiz-head .quiz-score { margin-left: auto; font-size: .85rem; color: var(--gris); display: flex; gap: 10px; align-items: center; }
.quiz-progress { height: 6px; background: var(--gris-pale); border-radius: 3px; overflow: hidden; margin-bottom: 18px; }
.quiz-progress i { display: block; height: 100%; width: 0; background: var(--or); transition: width .3s ease; }
.q-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; background: var(--bg-2); }
.q-num { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--or-fonce); font-weight: 700; }
.q-text { font-size: 1.08rem; font-weight: 600; margin: 6px 0 14px; line-height: 1.4; }
.q-choices { display: grid; gap: 8px; }
.q-choice { display: flex; gap: 12px; align-items: flex-start; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); cursor: pointer; text-align: left; font: inherit; color: var(--ink); line-height: 1.4; transition: border-color .12s ease, background .12s ease; }
.q-choice:hover:not(:disabled) { border-color: var(--bleu-clair); background: var(--bg-clair); }
.q-choice .q-letter { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--gris-pale); font-weight: 700; font-size: .8rem; color: var(--ink-2); }
.q-choice.correct { border-color: var(--vert); background: rgba(16, 124, 78, .1); }
.q-choice.correct .q-letter { background: var(--vert); color: #fff; }
.q-choice.wrong { border-color: var(--rouge); background: rgba(178, 42, 32, .08); }
.q-choice.wrong .q-letter { background: var(--rouge); color: #fff; }
.q-choice:disabled { cursor: default; }
.q-feedback { margin-top: 14px; padding: 12px 14px; border-radius: 8px; font-size: .95rem; display: none; border-left: 4px solid var(--gris); background: var(--card); }
.q-feedback.show { display: block; }
.q-feedback.ok { border-left-color: var(--vert); }
.q-feedback.ko { border-left-color: var(--rouge); }
.q-feedback b { display: block; margin-bottom: 4px; }
.q-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; align-items: center; }
.q-actions .q-link { margin-left: auto; font-size: .85rem; }
.quiz-result { text-align: center; padding: 20px 10px; }
.quiz-result .big { font-size: 3rem; font-weight: 800; color: var(--bleu); line-height: 1; margin: 6px 0; }
.quiz-result p { color: var(--ink-2); }
.quiz-result .verdict { font-size: 1.15rem; font-weight: 700; margin: 8px 0 16px; }
.quiz-review { margin-top: 24px; text-align: left; display: grid; gap: 8px; }
.quiz-review .qr { padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border); font-size: .9rem; display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.quiz-review .qr.ok { border-left: 4px solid var(--vert); }
.quiz-review .qr.ko { border-left: 4px solid var(--rouge); }
.quiz-select { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 20px 0; }
.quiz-select button { text-align: left; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); font: inherit; color: var(--ink); cursor: pointer; display: grid; gap: 4px; }
.quiz-select button:hover { border-color: var(--bleu-clair); box-shadow: var(--shadow); }
.quiz-select b { color: var(--bleu); }
.quiz-select small { color: var(--gris); }
.quiz-select .best { font-size: .78rem; color: var(--vert); font-weight: 600; }
.quiz-select button.exam { background: var(--navy); color: #fff; border-color: var(--navy); }
.quiz-select button.exam b { color: var(--or); }
.quiz-select button.exam small { color: rgba(255, 255, 255, .7); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--rouge); }

/* =============================================================================
   Fiches (flashcards)
   ============================================================================= */
.fc-toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 18px 0; }
.fc-toolbar select, .fc-toolbar input, .select, .input { font: inherit; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--card); color: var(--ink); }
.fc-stats { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0 18px; }
.fc-stage { perspective: 1400px; max-width: 760px; margin: 0 auto; }
.fc-card { position: relative; min-height: 300px; transform-style: preserve-3d; transition: transform .5s cubic-bezier(.2, .7, .2, 1); cursor: pointer; }
.fc-card.flipped { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; border-radius: 16px; padding: 30px 34px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); border: 1px solid var(--border); overflow: auto; }
.fc-front { background: linear-gradient(160deg, var(--navy), #0f2f5c); color: #fff; }
.fc-front .fc-kind { color: var(--or); }
.fc-front .fc-q { font-size: 1.6rem; font-weight: 700; margin: auto 0; line-height: 1.25; }
.fc-back { background: var(--card); color: var(--ink); transform: rotateY(180deg); }
.fc-kind { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 700; color: var(--or-fonce); margin-bottom: 8px; display: flex; gap: 10px; }
.fc-kind .fc-ch { margin-left: auto; opacity: .8; }
.fc-a { font-size: 1rem; line-height: 1.55; }
.fc-a p:first-child { margin-top: 0; }
.fc-hint { margin-top: auto; font-size: .78rem; opacity: .7; padding-top: 12px; }
.fc-actions { display: flex; gap: 10px; justify-content: center; margin: 18px 0; flex-wrap: wrap; }
.fc-actions .btn-ko { background: var(--rouge); color: #fff; }
.fc-actions .btn-ok { background: var(--vert); color: #fff; }
.fc-nav { display: flex; justify-content: space-between; align-items: center; color: var(--gris); font-size: .9rem; max-width: 760px; margin: 0 auto; }
.fc-empty { text-align: center; padding: 40px; color: var(--gris); }

/* =============================================================================
   Glossaire
   ============================================================================= */
.gl-letters { display: flex; gap: 4px; flex-wrap: wrap; margin: 16px 0 24px; position: sticky; top: calc(var(--topbar-h) + 8px); background: var(--bg); padding: 8px 0; z-index: 5; }
.gl-letters a { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; text-decoration: none; font-weight: 700; font-size: .85rem; color: var(--bleu); border: 1px solid var(--border); background: var(--card); }
.gl-letters a:hover { background: var(--bleu); color: #fff; }
.gl-letters a.off { opacity: .35; pointer-events: none; }
.gl-search { width: 100%; max-width: 520px; font-size: 1.05rem; padding: 12px 16px; }
.gl-letter { font-size: 2.4rem; color: var(--or); font-weight: 800; margin: 36px 0 8px; border-bottom: 2px solid var(--gris-clair); line-height: 1.2; }
.gl-entry { padding: 14px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: 20px; }
.gl-entry h3 { margin: 0; font-size: 1.05rem; color: var(--bleu); }
.gl-entry .gl-def { margin: 0; color: var(--ink); }
.gl-entry .gl-def p { margin: 0 0 .5em; }
.gl-entry.hidden, .gl-letter.hidden { display: none; }
.gl-count { color: var(--gris); font-size: .9rem; }
.gl-entry mark, .search-hit mark { background: rgba(204, 164, 36, .35); color: inherit; padding: 0 2px; border-radius: 2px; }
@media (max-width: 640px) { .gl-entry { grid-template-columns: 1fr; gap: 6px; } }

/* infobulle glossaire */
.tip { position: absolute; z-index: 300; max-width: 340px; background: var(--card); color: var(--ink); border: 1px solid var(--border); border-left: 4px solid var(--bleu); border-radius: 8px; padding: 12px 14px; box-shadow: var(--shadow); font-size: .86rem; line-height: 1.45; }
.tip b { color: var(--bleu); display: block; margin-bottom: 4px; }
.tip a { display: inline-block; margin-top: 6px; font-size: .8rem; }
.tip p { margin: 0; }

/* =============================================================================
   Aide-mémoire / formules
   ============================================================================= */
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; align-items: start; }
.two-col .side { position: sticky; top: calc(var(--topbar-h) + 20px); font-size: .86rem; max-height: calc(100vh - var(--topbar-h) - 40px); overflow: auto; }
.two-col .side h4 { margin: 0 0 8px; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gris); }
.two-col .side ol { list-style: none; padding: 0; margin: 0 0 20px; border-left: 2px solid var(--border); }
.two-col .side li a { display: block; padding: 5px 12px; color: var(--ink-2); text-decoration: none; }
.two-col .side li a:hover, .two-col .side li a.active { color: var(--bleu); }
.two-col .side li.lvl3 a { padding-left: 22px; font-size: .8rem; }
.two-col .side .toc-extra a { display: block; padding: 5px 0; color: var(--ink-2); text-decoration: none; }
.two-col .side .toc-extra a:hover { color: var(--bleu); }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } .two-col .side { position: static; max-height: none; } }
.form-index { columns: 2; column-gap: 24px; font-size: .92rem; }
.form-index li { break-inside: avoid; margin: 4px 0; }
.form-index .fi-ch { font-weight: 700; color: var(--or-fonce); margin-right: 6px; }
@media (max-width: 700px) { .form-index { columns: 1; } }

/* =============================================================================
   Outils (calculateurs)
   ============================================================================= */
.tools-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 26px; }
.tools-nav a { text-decoration: none; }
.tool { border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); margin: 0 0 26px; box-shadow: var(--shadow-sm); overflow: hidden; }
.tool-head { padding: 16px 22px; background: var(--bg-clair); border-bottom: 1px solid var(--border); display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.tool-head h2 { margin: 0; font-size: 1.2rem; color: var(--bleu); }
.tool-head .chip { margin-left: auto; }
.tool-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.tool-inputs { padding: 18px 22px; display: grid; gap: 12px; border-right: 1px solid var(--border); align-content: start; }
.tool-inputs label { display: grid; gap: 4px; font-size: .86rem; color: var(--ink-2); }
.tool-inputs input, .tool-inputs select { font: inherit; font-size: 1rem; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--ink); width: 100%; }
.tool-inputs .unit { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.tool-inputs .unit span { font-size: .85rem; color: var(--gris); }
.tool-inputs .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tool-inputs .group-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--gris); font-weight: 700; margin-top: 6px; }
.tool-out { padding: 18px 22px; background: var(--bg-2); display: grid; gap: 6px; align-content: start; }
.tool-out .desc { color: var(--ink-2); font-size: .92rem; margin: 0 0 8px; }
.tool-out .formula { font-size: .95rem; margin: 0 0 10px; overflow-x: auto; }
.tool-out .res { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .95rem; align-items: baseline; }
.tool-out .res:last-child { border-bottom: 0; }
.tool-out .res b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.tool-out .res.main { font-size: 1.15rem; padding: 12px 0; border-top: 2px solid var(--or); border-bottom: 0; margin-top: 8px; }
.tool-out .res.main b { color: var(--bleu); font-size: 1.35rem; }
.tool-out .res.warn b { color: var(--rouge); }
.tool-out .res.good b { color: var(--vert); }
.tool-out .note { font-size: .82rem; color: var(--gris); margin-top: 8px; }
.tool-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: 8px; }
.tool-table th, .tool-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: right; }
.tool-table th:first-child, .tool-table td:first-child { text-align: left; }
.tool-table th { color: var(--gris); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
@media (max-width: 800px) { .tool-body { grid-template-columns: 1fr; } .tool-inputs { border-right: 0; border-bottom: 1px solid var(--border); } }

/* =============================================================================
   Recherche
   ============================================================================= */
.search-modal { position: fixed; inset: 0; z-index: 500; background: rgba(9, 26, 51, .55); backdrop-filter: blur(3px); display: none; align-items: flex-start; justify-content: center; padding: 8vh 16px; }
.search-modal.open { display: flex; }
.search-box { width: 100%; max-width: 760px; background: var(--card); border-radius: 14px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .5); overflow: hidden; border: 1px solid var(--border); max-height: 80vh; display: flex; flex-direction: column; }
.search-box input { width: 100%; border: 0; border-bottom: 1px solid var(--border); padding: 18px 20px; font: inherit; font-size: 1.15rem; background: transparent; color: var(--ink); outline: none; }
.search-results { overflow: auto; padding: 8px; }
.search-hit { display: block; padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.search-hit:hover, .search-hit.active { background: var(--bg-clair); }
.search-hit .sh-title { font-weight: 600; color: var(--bleu); font-size: .92rem; display: flex; gap: 8px; align-items: center; }
.search-hit .sh-kind { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; padding: 1px 6px; border-radius: 4px; background: var(--gris-pale); color: var(--ink-2); }
.search-hit .sh-snippet { font-size: .85rem; color: var(--ink-2); margin-top: 2px; line-height: 1.4; }
.search-hit .sh-where { font-size: .75rem; color: var(--gris); margin-top: 2px; }
.search-foot { display: flex; gap: 14px; padding: 8px 16px; border-top: 1px solid var(--border); font-size: .75rem; color: var(--gris); }
.search-empty { padding: 30px; text-align: center; color: var(--gris); }
.search-page .search-results { padding: 0; }
.search-page .search-hit { border: 1px solid var(--border); margin-bottom: 8px; }

/* =============================================================================
   Ressources, diapositives, bibliographie
   ============================================================================= */
.res-table { width: 100%; border-collapse: collapse; }
.res-table th, .res-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.res-table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--gris); }
.res-table .size { color: var(--gris); font-size: .85rem; white-space: nowrap; }
.file-icon { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; font-size: .68rem; font-weight: 800; color: #fff; margin-right: 10px; vertical-align: middle; }
.file-pdf { background: #b22a20; }
.file-xlsx { background: #217346; }
.slide-viewer { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-clair); margin: 14px 0 30px; }
.slide-viewer iframe { width: 100%; height: min(72vh, 720px); border: 0; display: block; background: #525659; }
.slide-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.slide-tabs button { font: inherit; font-size: .85rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); color: var(--ink); cursor: pointer; }
.slide-tabs button[aria-selected="true"] { background: var(--bleu); color: #fff; border-color: var(--bleu); }
.bib-list { list-style: none; padding: 0; margin: 20px 0; }
.bib-list li { padding: 12px 0 12px 0; border-bottom: 1px solid var(--border); line-height: 1.5; }
.bib-list li:target { background: rgba(204, 164, 36, .15); padding-left: 10px; border-left: 3px solid var(--or); }
.bib-auth { font-weight: 600; }
.bib-cited { font-size: .8rem; color: var(--gris); display: block; margin-top: 2px; }
.bib-url { word-break: break-all; font-size: .9em; }
.bib-urldate { color: var(--gris); font-size: .85em; }

/* =============================================================================
   Impression
   ============================================================================= */
@media print {
  .topbar, .site-footer, .ch-toc, .ch-pager, .ch-quiz, .ch-tools, .search-modal, .h-anchor, .box-anchor, .sn-toggle, .readbar { display: none !important; }
  .ch-layout { display: block; padding: 0; }
  .prose, .prose > * { max-width: none; }
  .sidenote { display: block !important; float: none; width: auto; margin: .4em 0; padding: 4px 8px; background: #f3f3f3; border-left: 2px solid #999; }
  .box-sol { display: block; }
  .box-sol .box-body { display: block; }
  details > summary { list-style: none; }
  details:not([open]) > .box-body { display: block; }
  .ch-hero { background: #fff !important; color: #000; border-bottom: 2px solid #000; }
  .ch-hero .eyebrow, .ch-hero h1 { color: #000; }
  .box-ret { background: #eee; color: #000; }
  .box-ret .box-head { color: #000; }
  a { color: inherit; text-decoration: none; }
  body { font-size: 11pt; }
}
