/* Preuve publique — feuille unique, mobile d'abord, sans dépendance externe */
:root {
  color-scheme: light;
  --bg: #fcfcfb;
  --surface: #ffffff;
  --surface-2: #f3f2ef;
  --line: #e2e0da;
  --text: #16150f;
  --text-2: #52514e;
  --text-3: #6f6d67;
  --accent: #1f5fae;        /* liens, boutons : 6,1:1 sur fond clair */
  --series-1: #2a78d6;      /* marques de données (validé, palette de référence) */
  --neg: #6f6d67;           /* valeur négative : même forme, teinte neutre + signe */
  --focus: #1f5fae;
  --radius: 10px;
  --gutter: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --line: #34332f;
    --text: #f4f3ee; --text-2: #c3c2b7; --text-3: #9a988f;
    --accent: #7eb1f0; --series-1: #3987e5; --neg: #9a988f; --focus: #7eb1f0;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121211; --surface: #1a1a19; --surface-2: #232321; --line: #34332f;
  --text: #f4f3ee; --text-2: #c3c2b7; --text-3: #9a988f;
  --accent: #7eb1f0; --series-1: #3987e5; --neg: #9a988f; --focus: #7eb1f0;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 var(--font);
}
a { color: var(--accent); text-underline-offset: 2px; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 880px; margin: 0 auto; padding: 0 var(--gutter); }
section { padding: 20px 0; border-top: 1px solid var(--line); }
@media (min-width: 720px) { section { padding: 28px 0; } }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 4px; letter-spacing: -0.01em; }
h2 { font-size: 1.25rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 18px 0 8px; }
p { margin: 0 0 10px; }
.muted { color: var(--text-2); }
.small { font-size: 0.875rem; }
.tag { display: inline-block; font-size: 0.75rem; font-weight: 600; letter-spacing: 0.02em;
       padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); }

/* 1. Bandeau */
header.bandeau { padding: 20px 0 16px; }
.role { font-weight: 600; color: var(--text-2); margin-bottom: 4px; }
.accroche { font-size: 1.0625rem; margin: 6px 0 6px; font-weight: 500; }
.contact-ligne { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 0.9375rem; }
.parcours { list-style: none; padding: 0; margin: 8px 0 8px; display: grid; gap: 2px; }
.parcours li { font-size: 0.875rem; color: var(--text-2); }
.parcours b { font-weight: 600; }
.perso { margin-top: 14px; padding: 10px 12px; background: var(--surface-2); border-radius: var(--radius); }

/* 2. Offre */
.offres { display: grid; gap: 12px; }
@media (min-width: 640px) { .offres { grid-template-columns: 1fr 1fr; } }
.carte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.carte p { font-size: 0.9375rem; }
.carte h3 { margin-top: 0; }

/* 3. Analyse */
.choix { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.choix button {
  font: inherit; font-size: 0.9375rem; padding: 8px 12px; min-height: 40px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
}
.choix button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.fiche-tete { margin-bottom: 10px; }
.graphes { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) { .graphes { grid-template-columns: repeat(3, 1fr); } }
.graphe { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 10px 6px; position: relative; display: flex; flex-direction: column; }
.graphe svg { margin-top: auto; }
.graphe h4 { font-size: 0.8125rem; font-weight: 600; margin: 0 0 2px; color: var(--text); }
.graphe .formule { font-size: 0.6875rem; color: var(--text-3); margin: 0 0 4px; line-height: 1.35; }
.graphe svg { display: block; width: 100%; height: auto; overflow: visible; }
.graphe .np { font-size: 0.75rem; fill: var(--text-3); }
svg .axe { stroke: var(--line); stroke-width: 1; }
svg .val { font-size: 11px; fill: var(--text); font-weight: 600; }
svg .an { font-size: 10px; fill: var(--text-2); }
svg .barre { fill: var(--series-1); }
svg .barre.neg { fill: var(--neg); }
svg .cible { fill: transparent; cursor: pointer; }
.bulle {
  position: absolute; z-index: 5; pointer-events: none; max-width: 240px;
  background: var(--text); color: var(--bg); font-size: 0.75rem; line-height: 1.4;
  padding: 8px 10px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.bulle[hidden] { display: none; }
.lecture { display: grid; gap: 12px; margin-top: 16px; }
@media (min-width: 720px) { .lecture { grid-template-columns: 1fr 1fr; } }
.lecture ul, .questions { margin: 0; padding-left: 20px; }
.lecture li, .questions li { margin-bottom: 6px; }
.questions-bloc { margin-top: 12px; background: var(--surface-2); border-radius: var(--radius); padding: 14px 16px; }
details { margin-top: 14px; }
summary { cursor: pointer; font-weight: 600; min-height: 32px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; white-space: normal; }
thead th { color: var(--text-2); font-weight: 600; }
td.np { color: var(--text-3); font-style: italic; }
.sources li { font-size: 0.8125rem; margin-bottom: 4px; }

/* 4. Journal */
.journal { display: grid; gap: 10px; }
.entree { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.entree h3 { margin: 0 0 6px; font-size: 0.9375rem; }
.entree dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 0.875rem; }
.entree dt { color: var(--text-2); }
.entree dd { margin: 0; }

footer { padding: 28px 0 40px; border-top: 1px solid var(--line); font-size: 0.875rem; color: var(--text-2); }
.bouton {
  display: inline-block; padding: 10px 16px; min-height: 44px; border-radius: 999px;
  background: var(--accent); color: var(--bg); text-decoration: none; font-weight: 600;
}
@media (forced-colors: active) { svg .barre { fill: CanvasText; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
