/* Design « manuel de référence » : blanc, encre, gris froids, un seul accent (bleu marine).
   Les noms --gold / --teal / --rose sont conservés par compatibilité avec le
   balisage existant, mais désignent désormais des rôles sémantiques :
   --gold = info (violet sourd), --teal = positif (vert), --rose = alerte (rouge). */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --sans: 'Public Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: var(--sans);
  --label: var(--sans);
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --r: 2px;

  --bg: #ffffff;
  --surface: #f3f5f8;
  --surface2: #e7eaf0;
  --border: #d5d9e0;
  --rule: #1c1f24;
  --text: #1c1f24;
  --muted: #565e6c;

  --accent: #1a3768;
  --accent-dim: rgba(26,55,104,0.07);
  --teal: #2d5a45;
  --teal-dim: rgba(45,90,69,0.09);
  --gold: #5a4a8c;
  --gold-dim: rgba(90,74,140,0.08);
  --rose: #9c2a1f;
  --rose-dim: rgba(156,42,31,0.07);

  --question-bg: transparent;
  --question-border: var(--rule);
  --nav-bg: var(--bg);
  --token-text-color: #565e6c;
  --token-hash-color: #9c2a1f;
  --token-star-color: #6b4a8a;
  --token-dash-color: #2d5a45;
  --vf-exp-bg: var(--surface);
  --theme-button-hover: var(--surface2);
  --theme-button-text: var(--text);
  --badge-false-bg: rgba(156,42,31,0.10);
  --badge-nuance-bg: rgba(90,74,140,0.10);
  --ctx-bar-gpt4: #1c1f24;
  --ctx-bar-claude: #9c2a1f;
  --ctx-bar-gemini: #1f4e9c;
  --sovereignty-rose-border: rgba(156,42,31,0.28);
  --sovereignty-gold-border: rgba(90,74,140,0.28);
  --sovereignty-teal-border: rgba(45,90,69,0.28);
  --logo-blend: multiply;
  --logo-filter: none;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #14171c;
  --surface: #1c2027;
  --surface2: #262b34;
  --border: #323843;
  --rule: #e6e8ec;
  --text: #e6e8ec;
  --muted: #a3aab6;

  --accent: #9db8e6;
  --accent-dim: rgba(157,184,230,0.10);
  --teal: #86bda1;
  --teal-dim: rgba(134,189,161,0.10);
  --gold: #b8a8e6;
  --gold-dim: rgba(184,168,230,0.10);
  --rose: #e07b6a;
  --rose-dim: rgba(224,123,106,0.10);

  --token-text-color: #a3aab6;
  --token-hash-color: #e07b6a;
  --token-star-color: #b79ad6;
  --token-dash-color: #86bda1;
  --badge-false-bg: rgba(224,123,106,0.16);
  --badge-nuance-bg: rgba(184,168,230,0.16);
  --ctx-bar-gpt4: #e6e8ec;
  --ctx-bar-claude: #e07b6a;
  --ctx-bar-gemini: #7ea3de;
  --sovereignty-rose-border: rgba(224,123,106,0.35);
  --sovereignty-gold-border: rgba(184,168,230,0.35);
  --sovereignty-teal-border: rgba(134,189,161,0.35);
  --logo-blend: screen;
  --logo-filter: invert(1) hue-rotate(180deg);
  color-scheme: dark;
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--sans);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  overflow-x: hidden;
  padding-left: 240px;
}

/* Composants « interface » en sans-serif, le texte courant reste en serif */
.card, .compare-table, .question-block, .myth-item, .sovereignty-box, .model-flow,
.orch-tool, .orch-detail, .rag-step, .format-box, .example-block, .md-pane,
.context-visual, .tl-item, button, input, select, textarea, nav { font-family: var(--sans); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ── NAVIGATION LATÉRALE (sommaire) ── */
nav {
  position: fixed; top: 0; left: 0; z-index: 100;
  height: 100vh; width: 240px;
  background: var(--nav-bg);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1.25rem;
  display: flex; flex-direction: column; gap: 1.25rem;
  overflow-y: auto;
}
.logo-academie {
  height: 40px; width: auto; display: block; flex-shrink: 0; align-self: flex-start;
  mix-blend-mode: var(--logo-blend);
  filter: var(--logo-filter);
}
.nav-brand {
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.35;
  color: var(--text);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.nav-links { display: flex; flex-direction: column; gap: 0; flex: 1; }
.nav-link {
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--muted);
  padding: 0.4rem 0 0.4rem 0.75rem;
  border-left: 2px solid transparent;
  text-decoration: none;
  transition: color 0.15s;
  display: block;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); font-weight: 600; border-left-color: var(--accent); }
.theme-toggle {
  margin-top: auto;
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 0.5rem;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--theme-button-text);
  border-radius: var(--r);
  padding: 0.45rem 0.8rem;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}
.theme-toggle:hover { background: var(--theme-button-hover); border-color: var(--text); }
.theme-toggle + .style-toggle { margin-top: -0.6rem; }
.style-toggle[aria-pressed="true"] { background: var(--surface2); border-color: var(--text); font-weight: 600; }
.theme-toggle-icon { font-size: 0.9rem; line-height: 1; }

/* ── EN-TÊTE DE FORMATION ── */
.hero {
  padding: 4.5rem 3rem 3.5rem;
  border-bottom: 1px solid var(--rule);
}
.hero-layout {
  max-width: 920px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: start;
  gap: 2.5rem;
}
.hero-copy { min-width: 0; }
.hero-logo {
  width: 100%; max-width: 150px; height: auto; display: block;
  mix-blend-mode: var(--logo-blend);
  filter: var(--logo-filter);
}
.hero-eyebrow {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1rem;
}
.hero-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 1.5rem;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-desc {
  max-width: 60ch;
  font-size: 1.15rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}
.hero-meta {
  max-width: 60ch;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 2rem;
}
.hero-pills {
  display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.hero-pill {
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.hero-pill:hover { color: var(--text); border-bottom-color: var(--accent); }

/* ── SECTIONS ── */
section {
  max-width: 920px;
  margin: 0 auto;
  padding: 3.5rem 3rem;
  border-bottom: 1px solid var(--border);
}

.section-label {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.6rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.section-label::before { content: attr(data-n); color: var(--muted); }

.section-title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(1.6rem, 3.2vw, 2.1rem);
  line-height: 1.2;
  margin-bottom: 1rem;
}

.section-intro {
  font-size: 1rem;
  max-width: 62ch;
  line-height: 1.7;
  margin-bottom: 2.5rem;
}

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: ''; position: absolute;
  left: 0.35rem; top: 0.5rem; bottom: 0;
  width: 1px; background: var(--border);
}
.tl-item {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 1rem;
}
.tl-item::before {
  content: ''; position: absolute;
  left: -2.2rem; top: 0.45rem;
  width: 0.55rem; height: 0.55rem;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
}
.tl-year {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.3rem;
}
.tl-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}
.tl-body { font-size: 0.9rem; color: var(--muted); max-width: 600px; line-height: 1.75; }

/* ── CARDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}
.card {
  background: var(--surface);
  padding: 1.5rem 1.5rem 1.6rem;
  border-top: 2px solid var(--rule);
}
.card:hover { background: var(--surface2); }
.card-icon { display: none; }
.card-tag {
  font-family: var(--label);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.card-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}
.card-body { font-size: 0.88rem; color: var(--muted); line-height: 1.75; }

/* ── ORCHESTRATOR DIAGRAM ── */
.orchestrator-wrap {
  position: relative;
  margin: 3rem 0;
  min-height: 520px;
  display: flex; align-items: center; justify-content: center;
}

.orch-center {
  position: relative; z-index: 10;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  flex-shrink: 0;
}
.orch-center-label {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1;
}
.orch-center-sub {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.3rem;
}

.orch-tools {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 900px;
  position: relative;
}

.orch-connector {
  display: contents;
}

.orch-tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.2rem;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}
.orch-tool:hover, .orch-tool.active {
  border-color: var(--teal);
  background: var(--teal-dim);
}
.orch-tool-icon { display: none; }
.orch-tool-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}
.orch-tool-desc { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

.orch-layout {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 1.5rem;
  align-items: center;
  width: 100%;
  max-width: 1000px;
}

.orch-left, .orch-right {
  display: flex; flex-direction: column; gap: 0.75rem;
}

.orch-detail {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--teal-dim);
  border: 1px solid var(--teal);
  border-radius: var(--r);
  display: none;
}
.orch-detail.visible { display: block; }
.orch-detail-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  color: var(--teal);
}
.orch-detail-body { font-size: 0.9rem; color: var(--muted); line-height: 1.75; }
.orch-detail-example {
  margin-top: 0.8rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border-left: 2px solid var(--teal);
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--text);
  line-height: 1.6;
}

/* ── RAG ── */
.rag-flow {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 2rem 0;
  overflow-x: auto;
}
.rag-step {
  flex: 1; min-width: 140px;
  background: var(--surface);
  padding: 1.5rem 1rem;
  text-align: center;
  border: 1px solid var(--border);
  border-right: none;
  position: relative;
}
.rag-step:last-child { border-right: 1px solid var(--border); }
.rag-step::after {
  content: '→';
  position: absolute;
  right: -0.85rem; top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 1rem;
  z-index: 1;
}
.rag-step:last-child::after { display: none; }
.rag-step-num {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.rag-step-label {
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}
.rag-step-body { font-size: 0.8rem; color: var(--muted); line-height: 1.5; }

/* ── MARKDOWN DEMO ── */
.md-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  margin: 2rem 0;
}
.md-pane { background: var(--surface); padding: 1.5rem; }
.md-pane-label {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.md-raw {
  font-family: var(--label);
  font-size: 0.82rem;
  color: var(--token-text-color);
  line-height: 1.8;
  white-space: pre-wrap;
}
.md-raw .token-hash { color: var(--token-hash-color); }
.md-raw .token-star { color: var(--token-star-color); }
.md-raw .token-dash { color: var(--token-dash-color); }
.md-raw .token-text { color: var(--token-text-color); }

.md-rendered h2 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid var(--border);
}
.md-rendered p { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.8rem; line-height: 1.7; }
.md-rendered strong { color: var(--text); font-weight: 600; }
.md-rendered ul { padding-left: 1.2rem; margin-bottom: 0.8rem; }
.md-rendered li { font-size: 0.9rem; color: var(--muted); margin-bottom: 0.3rem; line-height: 1.6; }

.format-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 2rem 0;
}
.format-box {
  padding: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.format-box.native { border-color: var(--teal); background: var(--teal-dim); }
.format-box.foreign { border-color: var(--rose); background: var(--rose-dim); }
.format-box-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.format-box-list {
  list-style: none;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 2;
}
.format-box-list li::before { content: '— '; color: var(--muted); }

/* ── QUESTIONS INTERACTIVES ── */
.question-block {
  background: transparent;
  border-top: 1px solid var(--rule);
  padding: 1.25rem 0 0.5rem;
  margin: 2.5rem 0 3rem;
  position: relative;
}
.question-block::before {
  content: 'Question';
  display: block;
  font-family: var(--label);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.q-text {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.2rem;
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

/* QCM */
.qcm-options { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }
.qcm-option {
  appearance: none;
  display: flex; align-items: flex-start; gap: 0.8rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.qcm-option:hover { border-color: var(--text); background: var(--surface); }
.qcm-option.selected { border-color: var(--text); background: var(--surface2); }
.qcm-option.correct { border-color: var(--teal); border-left-width: 4px; background: var(--teal-dim); }
.qcm-option.wrong { border-color: var(--rose); border-left-width: 4px; background: var(--rose-dim); }
.qcm-option.disabled { pointer-events: none; }
.qcm-letter {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--muted);
  flex-shrink: 0;
  padding-top: 0.1rem;
}
.qcm-label { font-size: 0.95rem; line-height: 1.5; }

/* ESTIMATION */
.estim-reveal-btn {
  font-family: var(--label);
  font-size: 0.8rem;
  background: transparent;
  border: 1px solid var(--teal);
  color: var(--teal);
  padding: 0.7rem 1.4rem;
  border-radius: var(--r);
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 1rem;
}
.estim-reveal-btn:hover { background: var(--teal); color: var(--bg); }

.estim-answer {
  display: none;
  flex-direction: column;
  gap: 0.8rem;
}
.estim-answer.visible { display: flex; }
.estim-big {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 3rem;
  color: var(--accent);
  line-height: 1;
}
.estim-detail { font-size: 0.88rem; color: var(--muted); line-height: 1.7; }

/* EXPLICATION */
.q-explanation {
  display: none;
  margin-top: 1rem;
  padding: 1rem 1.2rem;
  border-left: 2px solid var(--teal);
  background: var(--vf-exp-bg);
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.75;
}
.q-explanation.visible { display: block; }
.q-explanation strong { color: var(--text); }

/* ── IDÉES REÇUES ── */
.myth-list { display: flex; flex-direction: column; gap: 0.5rem; }
.myth-item {
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}
.myth-header {
  display: flex; align-items: center; gap: 1rem;
  padding: 1.3rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s;
}
.myth-header:hover { background: var(--surface2); }
.myth-badge {
  font-family: var(--label);
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: var(--r);
  flex-shrink: 0;
}
.myth-badge.false { background: var(--badge-false-bg); color: var(--rose); border: 1px solid var(--rose); }
.myth-badge.nuance { background: var(--badge-nuance-bg); color: var(--accent); border: 1px solid var(--accent); }
.myth-q { font-family: var(--serif); font-weight: 600; font-size: 1.05rem; flex: 1; line-height: 1.4; }
.myth-toggle { color: var(--muted); font-size: 1.1rem; transition: transform 0.3s; flex-shrink: 0; }
.myth-item.open .myth-toggle { transform: rotate(45deg); }
.myth-body {
  max-height: 0; overflow: hidden;
  transition: max-height 0.5s cubic-bezier(0.4,0,0.2,1);
}
.myth-item.open .myth-body { max-height: 800px; }
.myth-inner {
  padding: 0 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
}
.myth-verdict {
  font-weight: 600; font-size: 0.9rem;
  margin-bottom: 0.7rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.myth-text { font-size: 0.88rem; color: var(--muted); line-height: 1.8; max-width: 700px; }
.myth-note {
  margin-top: 1rem;
  padding: 0.8rem 1rem;
  background: var(--surface2);
  border-left: 2px solid var(--accent);
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.65;
}

/* ── CONTEXT WINDOW ── */
.context-visual {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}
.ctx-bar-label {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
}
.ctx-bar-wrap {
  display: flex; align-items: center; gap: 1rem;
}
.ctx-bar {
  flex: 1; height: 20px; border-radius: var(--r);
  background: var(--surface2);
  overflow: hidden; position: relative;
}
.ctx-bar-fill {
  height: 100%; border-radius: var(--r);
  transition: width 1s ease;
}
.ctx-bar-val {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
}

/* ── FOOTER ── */
footer {
  padding: 2.5rem 3rem;
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--muted);
}

/* ── ANIMATIONS ── */

/* ── EXTRACTION HTML/CSS ── */
.logo-academie {
  height: 42px;
  width: auto;
  display: block;
  flex-shrink: 0;
  align-self: flex-start;
}

.inline-code {
  font-family: var(--label);
  font-size: 0.8em;
}

.section-gap-xs { margin-top: 0.8rem; }
.section-gap-md { margin-bottom: 2rem; }
.section-gap-lg { margin-bottom: 2.5rem; }
.section-gap-top { margin-top: 3rem; }
.section-stack { margin: 2.5rem 0; }
.section-stack-title { margin: 2.5rem 0 1rem; }

.subsection-title,
.subsection-title-gold {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.subsection-title-gold {
  font-size: 1.3rem;
  color: var(--accent);
}

.subsection-title-tight {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1rem;
}

.subsection-title-agentic {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 1.2rem;
}

.subsection-title-gold-tight {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 1rem;
  color: var(--accent);
}

.subsection-intro {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 640px;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.subsection-intro-wide {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 680px;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.subsection-note {
  font-size: 0.83rem;
  color: var(--muted);
  margin: 0.8rem 0 2rem;
  font-style: italic;
}

.text-strong { color: var(--text); }

.text-link {
  color: var(--teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link:hover { color: var(--accent); }

.helper-text {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.ctx-inline-note {
  color: var(--rose);
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.ctx-bar-fill-gpt4 {
  width: 12.8%;
  background: var(--ctx-bar-gpt4);
}

.ctx-bar-fill-claude {
  width: 100%;
  background: var(--ctx-bar-claude);
}

.ctx-bar-fill-gemini {
  width: 100%;
  background: var(--ctx-bar-gemini);
}

.model-flow {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  margin-bottom: 2rem;
}

.model-flow-title {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.model-flow-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.model-flow-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.6rem 1rem;
  background: var(--surface2);
  border-radius: var(--r);
}

.model-flow-row-agent {
  background: var(--teal-dim);
  border: 1px solid var(--sovereignty-teal-border);
}

.model-flow-input {
  font-size: 0.85rem;
  color: var(--muted);
}

.model-flow-arrow {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--accent);
  text-align: center;
}

.model-flow-arrow-agent { color: var(--teal); }

.model-flow-output { font-size: 0.85rem; }

.model-flow-note {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 1rem;
  font-style: italic;
}

.orch-center-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.orch-center-hint {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.compare-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
}

.compare-table-spacious { margin-bottom: 2.5rem; }

.compare-table-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface2);
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--muted);
  gap: 0;
}

.compare-table-head > * {
  padding: 0.7rem 1.5rem;
  display: flex;
  align-items: center;
  text-align: left;
  min-width: 0;
}

.compare-table-head > *:not(:last-child) {
  border-right: 1px solid var(--border);
}

.compare-table-head-bordered {
  border-bottom: 1px solid var(--border);
}

.compare-table-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.compare-table-cell {
  padding: 1.2rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--muted);
}

.compare-table-cell-left {
  border-right: 1px solid var(--border);
}

.compare-table-cell-compact {
  padding: 1rem 1.5rem;
}

.compare-table-cell-last-row {
  border-bottom: none;
}

.compare-table-anatomy {
}

.compare-table-anatomy .compare-table-head > :nth-child(1) { color: var(--gold); }
.compare-table-anatomy .compare-table-head > :nth-child(2) { color: var(--teal); }
.compare-table-anatomy .compare-table-head > :nth-child(3) { color: var(--rose); }
.compare-table-anatomy .compare-table-cell:nth-child(3n + 1) { font-weight: 500; color: var(--text); }

.example-block {
  margin: 0 0 3rem;
  padding: 1.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.example-title {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.example-label {
  display: inline-flex;
  align-items: center;
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--teal);
  margin-bottom: 0.8rem;
}

.prompt-box,
.result-box {
  margin-bottom: 1.25rem;
  padding: 1.1rem 1.2rem;
  border-radius: var(--r);
}

.prompt-box {
  background: var(--surface2);
  border: 1px solid var(--border);
}

.result-box {
  background: var(--teal-dim);
  border: 1px solid var(--sovereignty-teal-border);
}

.prompt-box pre,
.result-box pre {
  margin: 0;
  white-space: pre-wrap;
  font-family: var(--label);
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--text);
}

.result-box p,
.result-box ul,
.result-box ol {
  margin: 0 0 0.8rem;
  font-size: 0.9rem;
  line-height: 1.75;
}

.result-box p:last-child,
.result-box ul:last-child,
.result-box ol:last-child {
  margin-bottom: 0;
}

.result-box ul,
.result-box ol {
  padding-left: 1.2rem;
}

.result-box blockquote {
  margin: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--accent);
  color: var(--text);
}

.example-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-style: italic;
}

.sovereignty-box {
  margin: 2.5rem 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
}

.sovereignty-title {
  font-family: var(--label);
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 1.2rem;
}

.sovereignty-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sovereignty-row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.8rem 1rem;
  border-radius: 0;
  border-left: 3px solid var(--border);
  background: transparent;
}

.sovereignty-row-rose { border-left-color: var(--rose); background: var(--rose-dim); }
.sovereignty-row-gold { border-left-color: var(--gold); background: var(--gold-dim); }
.sovereignty-row-teal { border-left-color: var(--teal); background: var(--teal-dim); }
.sovereignty-row-teal-strong { border-left-color: var(--teal); background: var(--teal-dim); }

.sovereignty-label {
  font-family: var(--label);
  font-size: 0.85rem;
  font-weight: 600;
}

.sovereignty-label-rose { color: var(--rose); }
.sovereignty-label-gold { color: var(--gold); }
.sovereignty-label-teal { color: var(--teal); }

.sovereignty-body {
  font-size: 0.82rem;
  color: var(--muted);
}

/* ── VARIANTE « RISQUES » : fiches de synthèse ── */
.formation-risques .section-intro { max-width: 62ch; }

.formation-risques .example-block {
  margin: 0 0 3rem;
  padding: 1.5rem 0 0;
  background: transparent;
  border: none;
  border-top: 1px solid var(--rule);
  border-radius: 0;
}

.formation-risques .risk-preamble {
  display: flex; align-items: baseline; gap: 0.8rem;
  margin-bottom: 0.5rem;
}
.formation-risques .risk-icon { display: none; }
.formation-risques .risk-tag {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent);
}
.formation-risques .example-title {
  margin-bottom: 1.25rem;
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  line-height: 1.2;
}

.formation-risques .sovereignty-box {
  margin: 0; padding: 0;
  background: transparent; border: none; border-radius: 0;
}
.formation-risques .sovereignty-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}
.formation-risques .sovereignty-row {
  grid-template-columns: 1fr;
  gap: 0.4rem;
  align-items: start;
  padding: 1.1rem 0;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
}
.formation-risques .sovereignty-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}
.formation-risques .sovereignty-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
}
/* « En une phrase » : énoncé en tête, en serif */
.formation-risques .sovereignty-row:first-child .sovereignty-body {
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.6;
}
.formation-risques .sovereignty-row:first-child .sovereignty-label { color: var(--accent); }

@media (min-width: 1200px) {
  .formation-risques .sovereignty-list { grid-template-columns: repeat(3, 1fr); column-gap: 2rem; }
  .formation-risques .sovereignty-row:first-child { grid-column: 1 / -1; }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-layout { grid-template-columns: 1fr; gap: 1.5rem; }
  .hero-logo { max-width: 110px; }
}

@media (max-width: 700px) {
  body { padding-left: 0; padding-top: 3.9rem; font-size: 1rem; }
  nav {
    position: fixed; top: 0; left: 0; right: 0;
    height: auto; width: 100%;
    flex-direction: row; align-items: center; gap: 0.75rem;
    padding: 0.55rem 0.8rem;
    border-right: none; border-bottom: 1px solid var(--border);
    overflow: visible;
  }
  .logo-academie { height: 30px; }
  .nav-brand { display: none; }
  .nav-links { flex-direction: row; flex: 1; gap: 0.1rem; overflow-x: auto; overflow-y: hidden; min-width: 0; }
  .nav-link { padding: 0.4rem 0.6rem; white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; }
  .nav-link.active { border-bottom-color: var(--accent); }
  .theme-toggle { margin: 0 0 0 auto; padding: 0.45rem; min-width: 2.2rem; justify-content: center; gap: 0; }
  .theme-toggle-label { display: none; }
  section { scroll-margin-top: 4.8rem; }
  .hero { padding: 2.5rem 1.25rem 2rem; }
  section { padding: 2.5rem 1.25rem; }
  footer { padding: 2rem 1.25rem; flex-direction: column; gap: 0.8rem; text-align: center; }
  .md-split, .format-compare { grid-template-columns: 1fr; }
  .orch-layout { grid-template-columns: 1fr; }
  .compare-table-head { font-size: 0.8rem; }
  .compare-table-head > * { padding: 0.5rem 0.75rem; }
  .compare-table-cell { padding: 0.75rem; font-size: 0.8rem; }
  .compare-table-cell-compact { padding: 0.6rem 0.75rem; }
  .sovereignty-row { grid-template-columns: 1fr; }
  .rag-flow { flex-direction: column; }
  .rag-step { border-right: 1px solid var(--border); border-bottom: none; }
  .rag-step::after { content: '↓'; right: auto; left: 50%; bottom: -1rem; top: auto; transform: translateX(-50%); }
  .rag-step:last-child { border-bottom: 1px solid var(--border); }
}

/* Icônes décoratives héritées du balisage : masquées (le texte porte le sens) */
.lex-flip-icon, .lex-icon, .risk-icon { display: none; }
@media (min-width: 701px) { .theme-toggle-icon { display: none; } }

/* ── STYLE « CONTRASTE FORT » (option) : aplats, bordures épaisses, ombres dures ── */
html[data-style="contrast"] {
  --sans: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 0px;
  --bg: #ffffff;
  --surface: #f2f2f2;
  --surface2: #e4e4e4;
  --border: #000000;
  --rule: #000000;
  --text: #000000;
  --muted: #262626;
  --accent: #16276b;
  --accent-dim: rgba(22,39,107,0.10);
  --teal: #0b5d3b;
  --teal-dim: rgba(11,93,59,0.12);
  --gold: #4b2a9c;
  --gold-dim: rgba(75,42,156,0.10);
  --rose: #c4161c;
  --rose-dim: rgba(196,22,28,0.10);
  --hl: #f2c230;
  --hero-bg: #16276b;
  --nav-bg: #ffffff;
  --vf-exp-bg: #f2f2f2;
  --sovereignty-rose-border: #000000;
  --sovereignty-gold-border: #000000;
  --sovereignty-teal-border: #000000;
  --token-text-color: #262626;
  --logo-blend: normal;
  --logo-filter: none;
}
html[data-style="contrast"][data-theme="dark"] {
  --bg: #000000;
  --surface: #111111;
  --surface2: #222222;
  --border: #ffffff;
  --rule: #ffffff;
  --text: #ffffff;
  --muted: #e0e0e0;
  --accent: #9db8ff;
  --accent-dim: rgba(157,184,255,0.14);
  --teal: #5fe0a8;
  --teal-dim: rgba(95,224,168,0.14);
  --gold: #c8b0ff;
  --gold-dim: rgba(200,176,255,0.14);
  --rose: #ff7b80;
  --rose-dim: rgba(255,123,128,0.14);
  --nav-bg: #000000;
  --vf-exp-bg: #111111;
  --token-text-color: #e0e0e0;
  --logo-blend: normal;
  --logo-filter: none;
}
html[data-style="contrast"] body { font-weight: 500; }
html[data-style="contrast"] :focus-visible { outline: 3px solid var(--text); outline-offset: 2px; box-shadow: 0 0 0 6px var(--hl); }

/* navigation */
html[data-style="contrast"] nav { border-right: 3px solid var(--rule); }
html[data-style="contrast"] .logo-academie { background: #fff; padding: 2px; }
html[data-style="contrast"] .nav-brand { font-weight: 900; font-size: 1.05rem; border-bottom: 3px solid var(--rule); }
html[data-style="contrast"] .nav-link { font-weight: 600; border: 2px solid transparent; padding: 0.35rem 0.6rem; }
html[data-style="contrast"] .nav-link:hover { border-color: var(--rule); }
html[data-style="contrast"] .nav-link.active { background: var(--rule); color: var(--bg); border-color: var(--rule); }
html[data-style="contrast"] .theme-toggle { border: 2px solid var(--rule); font-weight: 700; }
html[data-style="contrast"] .style-toggle[aria-pressed="true"] { background: var(--hl); color: #000; border-color: var(--rule); }

/* en-tête de formation */
html[data-style="contrast"] .hero { background: var(--hero-bg); color: #fff; border-bottom: 3px solid var(--rule); }
html[data-style="contrast"] .hero-logo { background: #fff; padding: 0.5rem; border: 3px solid #fff; mix-blend-mode: normal; filter: none; }
html[data-style="contrast"] .hero-eyebrow { color: var(--hl); font-weight: 800; }
html[data-style="contrast"] .hero-title { font-weight: 900; letter-spacing: -0.035em; line-height: 1; color: #fff; }
html[data-style="contrast"] .hero-title em { background: var(--hl); color: #000; padding: 0 0.12em; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
html[data-style="contrast"] .hero-desc, html[data-style="contrast"] .hero-meta { color: #e6e9f7; }
html[data-style="contrast"] .hero-pills { border-top: 2px solid #fff; }
html[data-style="contrast"] .hero-pill { color: #fff; font-weight: 600; }
html[data-style="contrast"] .hero-pill:hover { color: #fff; border-bottom-color: var(--hl); }

/* sections */
html[data-style="contrast"] section { border-bottom: 3px solid var(--rule); }
html[data-style="contrast"] .section-label { display: inline-flex; background: var(--hl); color: #000; border: 2px solid #000; padding: 0.15rem 0.6rem; font-weight: 800; }
html[data-style="contrast"] .section-label::before { color: #000; }
html[data-style="contrast"] .section-title { font-weight: 900; letter-spacing: -0.025em; }
html[data-style="contrast"] .section-intro, html[data-style="contrast"] .subsection-intro { color: var(--text); }

/* blocs */
html[data-style="contrast"] .card-grid { gap: 2px; background: var(--rule); border: 2px solid var(--rule); }
html[data-style="contrast"] .card { border-top: none; }
html[data-style="contrast"] .card:hover { background: var(--hl); color: #000; }
html[data-style="contrast"] .card:hover .card-body, html[data-style="contrast"] .card:hover .card-tag { color: #000; }
html[data-style="contrast"] .card-tag { font-weight: 800; }
html[data-style="contrast"] .card-title { font-weight: 800; }
html[data-style="contrast"] .myth-item,
html[data-style="contrast"] .compare-table,
html[data-style="contrast"] .example-block,
html[data-style="contrast"] .sovereignty-box,
html[data-style="contrast"] .model-flow,
html[data-style="contrast"] .format-box,
html[data-style="contrast"] .md-split,
html[data-style="contrast"] .context-visual,
html[data-style="contrast"] .orch-tool,
html[data-style="contrast"] .orch-detail,
html[data-style="contrast"] .rag-step { border: 2px solid var(--rule); }
html[data-style="contrast"] .orch-tool:hover, html[data-style="contrast"] .orch-tool.active { background: var(--hl); color: #000; border-color: var(--rule); }
html[data-style="contrast"] .orch-tool:hover .orch-tool-desc, html[data-style="contrast"] .orch-tool.active .orch-tool-desc { color: #000; }
html[data-style="contrast"] .orch-center { border-width: 3px; }
html[data-style="contrast"] .myth-header:hover { background: var(--hl); color: #000; }
html[data-style="contrast"] .myth-badge { border-width: 2px; font-weight: 800; }
html[data-style="contrast"] .sovereignty-row { border-left-width: 6px; }
html[data-style="contrast"] .compare-table-head { border-bottom: 2px solid var(--rule); font-weight: 800; color: var(--text); }
html[data-style="contrast"] .md-split { background: var(--rule); gap: 2px; }

/* questions */
html[data-style="contrast"] .question-block { border: 2px solid var(--rule); background: var(--bg); padding: 0 1.25rem 1.25rem; margin: 2rem 0 2.5rem; }
html[data-style="contrast"] .question-block::before { margin: 0 -1.25rem 1.1rem; padding: 0.45rem 1.25rem; background: var(--rule); color: var(--bg); font-weight: 700; }
html[data-style="contrast"] .q-text { font-weight: 800; }
html[data-style="contrast"] .qcm-option { border: 2px solid var(--rule); font-weight: 500; }
html[data-style="contrast"] .qcm-option:hover { background: var(--hl); color: #000; border-color: var(--rule); }
html[data-style="contrast"] .qcm-option.selected { background: var(--rule); color: var(--bg); }
html[data-style="contrast"] .qcm-option.correct { background: var(--teal); color: #fff; border: 2px solid var(--rule); }
html[data-style="contrast"] .qcm-option.wrong { background: var(--rose); color: #fff; border: 2px solid var(--rule); }
html[data-style="contrast"] .qcm-option .qcm-letter { color: inherit; font-weight: 800; }
html[data-style="contrast"] .q-explanation { border-left: 6px solid var(--rule); color: var(--text); }
html[data-style="contrast"] .estim-reveal-btn { border: 2px solid var(--rule); color: var(--text); font-weight: 800; background: var(--bg); }
html[data-style="contrast"] .estim-reveal-btn:hover { background: var(--hl); color: #000; }

html[data-style="contrast"] footer { border-top: 3px solid var(--rule); color: var(--text); font-weight: 600; }

@media (max-width: 700px) {
  html[data-style="contrast"] nav { border-right: none; border-bottom: 3px solid var(--rule); }
  html[data-style="contrast"] .nav-link { padding: 0.35rem 0.5rem; }
  .theme-toggle + .style-toggle { margin-top: 0; margin-left: 0; font-size: 0.75rem; padding: 0.4rem 0.5rem; }
}

/* ── VEILLE : journal (formations/veille) et encart des pages de formation ── */
.veille-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.5rem 0 0.8rem; }
.veille-filter {
  appearance: none;
  font: inherit; font-size: 0.85rem;
  color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: var(--r);
  padding: 0.35rem 0.85rem; cursor: pointer;
}
.veille-filter:hover { border-color: var(--text); }
.veille-filter.is-active { background: var(--rule); border-color: var(--rule); color: var(--bg); }
.veille-count { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.5rem; }
.veille-year {
  font-size: 1rem; font-weight: 700; color: var(--accent);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.4rem; margin: 2.2rem 0 0.4rem;
}
.veille-entry { padding: 1.2rem 0; border-bottom: 1px solid var(--border); scroll-margin-top: 1.5rem; }
.veille-entry:target { background: var(--accent-dim); padding-left: 0.8rem; padding-right: 0.8rem; }
.veille-entry-date { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); }
.veille-entry h3 { font-size: 1.08rem; line-height: 1.35; margin: 0.3rem 0 0.2rem; }
.veille-entry h3 a { color: var(--text); text-decoration: none; }
.veille-entry h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.veille-entry p { color: var(--muted); font-size: 0.92rem; max-width: 70ch; margin-top: 0.4rem; }
.veille-entry .veille-meta { font-size: 0.8rem; }
.veille-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.veille-chip {
  display: inline-block;
  font-size: 0.72rem; font-weight: 600; line-height: 1.4;
  padding: 0.1rem 0.5rem;
  border: 1px solid var(--border); border-radius: var(--r);
  color: var(--muted);
}
.veille-chip.is-done { color: var(--teal); border-color: var(--sovereignty-teal-border); background: var(--teal-dim); }
.veille-chip.is-todo { color: var(--rose); border-color: var(--sovereignty-rose-border); background: var(--rose-dim); }
.veille-chip.is-check { color: var(--gold); border-color: var(--sovereignty-gold-border); background: var(--gold-dim); }
.veille-impact, .veille-list { list-style: none; display: grid; gap: 0.45rem; margin-top: 0.8rem; font-size: 0.88rem; }
.veille-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.7rem; }
.veille-where { font-size: 0.8rem; color: var(--muted); }
.veille-status { font-size: 0.92rem; color: var(--muted); margin-top: 0.8rem; max-width: 70ch; }
.veille-status.is-stale { color: var(--text); border-left: 3px solid var(--rose); padding-left: 0.8rem; }
.veille-more { margin-top: 1rem; font-size: 0.9rem; }
.veille-empty { color: var(--muted); font-size: 0.92rem; margin-top: 1rem; }
.veille-table-wrap { overflow-x: auto; margin-top: 1.2rem; }
.veille-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.veille-table th, .veille-table td { text-align: left; padding: 0.65rem 0.8rem 0.65rem 0; border-bottom: 1px solid var(--border); vertical-align: baseline; }
.veille-table thead th { font-size: 0.78rem; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--rule); }
.veille-table tbody th { font-weight: 600; }
@media (max-width: 700px) {
  .veille-entry:target { padding-left: 0; padding-right: 0; }
}
