:root {
  color-scheme: light;
  --font-body: 'Satoshi', 'Segoe UI', sans-serif;
  --font-display: 'General Sans', 'Satoshi', sans-serif;
  --text-xs: clamp(.75rem, .731rem + .08vw, .8125rem);
  --text-sm: clamp(.875rem, .848rem + .12vw, .9375rem);
  --text-base: clamp(1rem, .968rem + .13vw, 1.0625rem);
  --text-lg: clamp(1.125rem, 1.03rem + .4vw, 1.375rem);
  --text-xl: clamp(1.75rem, 1.45rem + 1.25vw, 2.25rem);
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.25rem;
  --s6: 1.5rem; --s7: 1.75rem; --s8: 2rem; --s10: 2.5rem;
  --ink: oklch(26% .043 322);
  --muted: oklch(45% .028 314);
  --primary: oklch(39% .081 318);
  --primary-hover: oklch(32% .072 318);
  --header: oklch(26% .048 321);
  --lavender: oklch(95% .019 318);
  --active-border: oklch(80% .049 315);
  --canvas: oklch(97.6% .009 55);
  --white: oklch(100% 0 0);
  --border: oklch(90% .013 320);
  --line: oklch(92% .009 325);
  --paper: oklch(98% .015 17);
  --grid-fine: oklch(92% .034 15);
  --grid-major: oklch(84% .057 15);
  --amber-ink: oklch(39% .073 64);
  --amber-wash: oklch(96.5% .026 77);
  --amber-line: oklch(87% .057 76);
  --amber-mark: oklch(49% .110 65);
  --mint: oklch(86% .079 166);
  --radius: .875rem;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 0; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: var(--font-body); font-size: var(--text-base); line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button { cursor: pointer; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible + .switch-track { outline: 2px solid var(--primary); outline-offset: 3px; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
svg { display: block; }
.icons { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.icon { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.shell { max-width: 1440px; padding-inline: clamp(var(--s4), 3.5vw, var(--s10)); margin-inline: auto; }
.topbar { color: var(--white); background: var(--header); }
.top-inner { min-height: 65px; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.wordmark { color: var(--mint); font: 600 var(--text-lg)/1 var(--font-display); white-space: nowrap; letter-spacing: -.035em; }
.wordmark span { color: var(--white); }
.demo-label { min-height: 31px; display: flex; align-items: center; gap: var(--s2); padding: var(--s1) var(--s3); border-radius: 40px; border: 1px solid oklch(53% .041 320); font-size: var(--text-xs); font-weight: 700; }
.demo-label span { width: 6px; height: 6px; background: var(--mint); border-radius: 100%; }
.page-title { padding-block: var(--s8) var(--s5); }
.eyebrow { color: var(--primary); font-size: var(--text-xs); line-height: 1.32; font-weight: 900; letter-spacing: .105em; }
h1 { font: 600 var(--text-xl)/1.14 var(--font-display); letter-spacing: -.045em; margin-block: var(--s2); }
h2 { font: 700 var(--text-lg)/1.25 var(--font-body); letter-spacing: -.03em; margin-top: var(--s2); }
h3 { font-size: var(--text-base); line-height: 1.32; font-weight: 900; letter-spacing: -.012em; }
.intro { color: var(--muted); }
.context { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s3) var(--s5); border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); padding: var(--s3) var(--s4); margin-bottom: var(--s5); }
.context-heading p + p { color: var(--muted); font-size: var(--text-sm); margin-top: var(--s1); }
.segments { display: flex; flex-wrap: wrap; gap: var(--s1); padding: var(--s1); background: var(--canvas); border: 1px solid var(--line); border-radius: .625rem; }
.segments button { border: 1px solid transparent; background: transparent; min-height: 42px; padding: var(--s2) var(--s3); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); white-space: nowrap; font-weight: 700; font-size: var(--text-sm); border-radius: .45rem; }
.segments button .icon { width: 17px; height: 17px; }
.segments button:hover, .case-list button:hover { background: var(--canvas); color: var(--ink); }
.segments button[aria-pressed="true"] { background: var(--white); color: var(--primary); border-color: var(--active-border); }

.primary { display: flex; justify-content: flex-start; align-items: center; gap: var(--s2); width: 100%; min-height: 48px; text-align: left; border: 1px solid transparent; border-radius: .55rem; background: var(--primary); color: var(--white); padding: var(--s2) var(--s3); font-size: var(--text-sm); line-height: 1.3; font-weight: 900; }
.primary:hover { background: var(--primary-hover); }
.primary .end { margin-left: auto; }
.safety { display: flex; gap: var(--s2); align-items: flex-start; margin-block: var(--s5) var(--s7); color: var(--muted); font-size: var(--text-xs); }
.safety strong { color: var(--ink); font-weight: 900; }
.safety .icon { width: 16px; height: 16px; color: var(--amber-mark); }
dl > div { padding-block: var(--s2); border-bottom: 1px solid var(--line); }
dt { color: var(--muted); font-size: var(--text-xs); line-height: 1.3; font-weight: 900; }
dd { color: var(--ink); font-size: var(--text-sm); line-height: 1.36; margin-top: var(--s1); overflow-wrap: anywhere; }
.secondary { display: inline-flex; justify-content: center; align-items: center; gap: var(--s2); min-height: 44px; padding: var(--s2) var(--s3); color: var(--primary); background: var(--white); border: 1px solid var(--active-border); border-radius: .55rem; font-size: var(--text-sm); line-height: 1.28; font-weight: 900; text-align: center; }
.secondary:hover { background: var(--lavender); }
.secondary:disabled { cursor: default; color: var(--muted); border-color: var(--line); background: var(--canvas); opacity: .73; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.panel { min-width: 0; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s5); }

:root {
  --red: oklch(52% .19 25); --red-wash: oklch(96% .03 25); --red-line: oklch(85% .08 25); --red-ink: oklch(38% .13 25);
  --orange: oklch(62% .16 50); --orange-wash: oklch(96.5% .035 60); --orange-line: oklch(86% .08 60); --orange-ink: oklch(42% .11 50);
  --yellow: oklch(72% .14 85); --yellow-wash: oklch(97.5% .035 95); --yellow-line: oklch(89% .07 95); --yellow-ink: oklch(42% .08 80);
  --green: oklch(58% .12 160); --green-wash: oklch(96.5% .03 165); --green-line: oklch(87% .06 165); --green-ink: oklch(38% .08 160);
}
select, textarea { font: inherit; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.hero-actions .primary { width: auto; }
.example-picker select, .settings select, .form input, textarea { min-height: 44px; border: 1px solid var(--active-border); border-radius: .55rem; background: var(--white); color: var(--ink); padding: var(--s2) var(--s3); font-size: var(--text-sm); }
.example-picker select { color: var(--primary); font-weight: 900; cursor: pointer; }
.layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--s4); align-items: start; }
.doc { grid-row: span 2; }
.results { min-width: 0; }
.doc-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.analyse-btn { width: auto; }
.analyse-btn:disabled { opacity: .5; cursor: default; }
.status { margin-top: var(--s3); color: var(--primary); font-size: var(--text-sm); font-weight: 700; }
.status[data-kind="error"] { background: var(--orange-wash); color: var(--orange-ink); padding: var(--s2) var(--s3); border-left: 3px solid var(--orange); border-radius: .3rem; }
.status[data-kind="busy"]::before { content: ''; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -1px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.empty { margin-top: var(--s4); display: grid; justify-items: center; gap: var(--s3); padding: clamp(var(--s6), 5vw, 4rem) var(--s4); text-align: center; background: var(--canvas); border: 1px dashed var(--active-border); border-radius: .75rem; background-image: radial-gradient(ellipse at center top, var(--lavender), transparent 64%); }
.empty p { max-width: 44ch; font-size: var(--text-sm); color: var(--muted); }
.empty-icon { display: grid; place-items: center; width: 61px; height: 61px; background: var(--white); color: var(--primary); border: 1px solid var(--border); border-radius: .9rem; }
.empty-icon .icon { width: 31px; height: 31px; }
#viewer { margin-top: var(--s3); }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); align-items: center; background: var(--canvas); border: 1px solid var(--border); border-radius: .55rem .55rem 0 0; padding: var(--s2); }
.tools { display: flex; gap: var(--s1); align-items: center; }
.tool { width: 44px; padding-inline: 0; }
.tool[aria-pressed="true"] { background: var(--primary); color: var(--white); border-color: var(--primary); }
.toolbar output { min-width: 46px; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 700; font-size: var(--text-xs); }
.small { min-height: 38px; padding: var(--s1) var(--s3); font-size: var(--text-xs); }
.flip { transform: rotate(180deg); }
.crop-hint { font-size: var(--text-xs); color: var(--primary); background: var(--lavender); padding: var(--s2) var(--s3); }
.viewport { background: var(--lavender); overflow: auto; max-height: min(70vh, 640px); min-height: 140px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 .55rem .55rem; padding: var(--s3); overscroll-behavior: contain; }
.sheet { position: relative; margin-inline: auto; }
.sheet canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.sheet canvas.base { background: var(--white); box-shadow: 0 2px 9px oklch(23% .035 321 / .12); }
.sheet canvas.overlay { touch-action: auto; }
.sheet.cropping canvas.overlay { touch-action: none; cursor: crosshair; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) var(--s3); margin-top: var(--s2); color: var(--muted); font-size: var(--text-xs); }
.lg { display: inline-block; width: 14px; height: 10px; border-radius: 2px; margin-right: -6px; }
.lg-strip { border: 2px solid oklch(55% .12 250); }
.lg-beat { background: oklch(55% .12 250); width: 3px; height: 12px; }
.lg-abn { background: var(--red); width: 3px; height: 12px; }
.settings { margin-top: var(--s4); border: 1px solid var(--line); border-radius: .55rem; padding: var(--s2) var(--s3); }
.settings summary { cursor: pointer; font-weight: 900; font-size: var(--text-sm); color: var(--primary); min-height: 32px; display: flex; align-items: center; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s3); }
.settings label, .form label { display: grid; gap: var(--s1); font-size: var(--text-xs); font-weight: 900; color: var(--muted); }
.privacy { display: flex; gap: var(--s2); align-items: flex-start; background: var(--lavender); color: var(--primary); padding: var(--s3); border-radius: .55rem; margin-top: var(--s4); font-size: var(--text-xs); }

.alert { display: flex; gap: var(--s3); align-items: flex-start; margin-top: var(--s4); padding: var(--s4); border-radius: .7rem; border: 1px solid; }
.alert-badge { flex: 0 0 auto; padding: 4px 10px; border-radius: 30px; color: var(--white); font-size: var(--text-xs); font-weight: 900; letter-spacing: .06em; }
.alert h3 { font-size: var(--text-lg); line-height: 1.25; }
.alert p { margin-top: var(--s1); font-size: var(--text-sm); font-weight: 700; }
.alert ul { margin: var(--s2) 0 0; padding-left: 1.1rem; font-size: var(--text-sm); }
.alert li + li { margin-top: 2px; }
[data-level="urgent"].alert { background: var(--red-wash); border-color: var(--red-line); color: var(--red-ink); }
[data-level="urgent"] .alert-badge, .chip[data-level="urgent"] { background: var(--red); }
[data-level="signaler"].alert { background: var(--orange-wash); border-color: var(--orange-line); color: var(--orange-ink); }
[data-level="signaler"] .alert-badge, .chip[data-level="signaler"] { background: var(--orange); }
[data-level="surveiller"].alert { background: var(--yellow-wash); border-color: var(--yellow-line); color: var(--yellow-ink); }
[data-level="surveiller"] .alert-badge, .chip[data-level="surveiller"] { background: var(--yellow); color: oklch(25% .05 80); }
[data-level="info"].alert { background: var(--green-wash); border-color: var(--green-line); color: var(--green-ink); }
[data-level="info"] .alert-badge, .chip[data-level="info"] { background: var(--green); }
.alert[data-level="urgent"] { animation: pulse 1.6s ease-in-out 3; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px oklch(60% .19 25 / .18); } }

.measures { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s2); margin-top: var(--s4); }
.measure { border: 1px solid var(--line); border-radius: .55rem; padding: var(--s2) var(--s3); background: var(--white); }
.measure small { display: block; color: var(--muted); font-size: var(--text-xs); font-weight: 900; }
.measure strong { display: block; font: 600 1.3rem/1.2 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.measure span { display: block; color: var(--muted); font-size: 11px; }
.measure[data-flag="abn"] { border-color: var(--orange-line); background: var(--orange-wash); }
.measure[data-flag="abn"] strong { color: var(--orange-ink); }
.measure[data-flag="crit"] { border-color: var(--red-line); background: var(--red-wash); }
.measure[data-flag="crit"] strong { color: var(--red-ink); }
.measure[data-flag="na"] strong { color: var(--muted); }

.strip { margin-top: var(--s4); border: 1px solid var(--grid-major); border-radius: .55rem; overflow: hidden; background: var(--paper); }
.strip-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); padding: var(--s2) var(--s3); font-size: var(--text-xs); color: var(--muted); border-bottom: 1px solid var(--grid-major); background: color-mix(in oklab, var(--paper), var(--white) 42%); }
.strip-head span:first-child { color: var(--ink); font-weight: 900; }
.strip-scroll { overflow-x: auto; }
#strip-svg { display: block; height: 150px; min-width: 100%; }
.strip figcaption { padding: var(--s2) var(--s3); font-size: var(--text-xs); color: var(--muted); border-top: 1px solid var(--grid-major); background: var(--white); }
.k-p { color: oklch(50% .13 250); } .k-n { color: var(--primary); } .k-a { color: var(--red); }

.report { margin-top: var(--s4); padding: var(--s3) var(--s4); border-left: 3px solid var(--primary); background: var(--lavender); border-radius: .3rem .55rem .55rem .3rem; }
.report-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.report p { margin-top: var(--s2); font-size: var(--text-sm); }
.section-title { margin-top: var(--s5); }
.section-sub { color: var(--muted); font-size: var(--text-xs); margin-top: 2px; }
.findings { display: grid; gap: var(--s2); margin-top: var(--s2); }
.finding { border: 1px solid var(--line); border-radius: .6rem; background: var(--white); overflow: hidden; }
.finding summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: var(--s2); align-items: start; padding: var(--s3); }
.finding summary::-webkit-details-marker { display: none; }
.finding summary .chev { color: var(--primary); transition: transform .2s; margin-top: 3px; }
.finding[open] summary .chev { transform: rotate(90deg); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 20px; color: var(--white); font-size: 10px; font-weight: 900; letter-spacing: .05em; white-space: nowrap; margin-top: 2px; }
.finding h4 { margin: 0; font-size: var(--text-sm); font-weight: 900; line-height: 1.3; }
.finding .detail { margin: 2px 0 0; font-size: var(--text-xs); color: var(--muted); font-variant-numeric: tabular-nums; }
.finding .body { padding: 0 var(--s3) var(--s3); font-size: var(--text-sm); display: grid; gap: var(--s2); }
.finding .body h5 { margin: 0; font-size: var(--text-xs); font-weight: 900; color: var(--primary); letter-spacing: .06em; text-transform: uppercase; }
.finding .body ul { margin: 2px 0 0; padding-left: 1.1rem; }
.finding .body p { margin: 2px 0 0; }
.finding .todo { background: var(--canvas); border-radius: .45rem; padding: var(--s2) var(--s3); }
.finding[data-level="urgent"] { border-color: var(--red-line); }
.finding[data-level="signaler"] { border-color: var(--orange-line); }
.quality { margin-top: var(--s4); font-size: var(--text-xs); color: var(--muted); border-top: 1px solid var(--line); padding-top: var(--s3); display: grid; gap: var(--s1); }
.quality strong { color: var(--ink); }
.meter { height: 6px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--green); }
.meter[data-q="moyenne"] i { background: var(--orange); }
.meter[data-q="faible"] i { background: var(--red); }

.handoff .sub { color: var(--muted); font-size: var(--text-sm); margin-top: var(--s1); }
.handoff .segments { margin-top: var(--s3); }
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2); margin-top: var(--s3); }
.form .wide { grid-column: 1 / -1; }
.form input { width: 100%; }
textarea { width: 100%; margin-top: var(--s3); resize: vertical; line-height: 1.45; background: var(--canvas); white-space: pre-wrap; }
.handoff .primary { margin-top: var(--s2); }
.note { color: var(--muted); font-size: var(--text-xs); margin-top: var(--s2); text-align: center; }
.normals { margin-top: var(--s4); border-top: 1px solid var(--line); padding-top: var(--s3); }
.normals summary { cursor: pointer; display: flex; gap: var(--s2); align-items: center; font-weight: 900; font-size: var(--text-sm); color: var(--primary); min-height: 36px; }

@media (max-width: 980px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .doc { grid-row: auto; }
}
@media (max-width: 560px) {
  .panel { padding: var(--s4); }
  .hero-actions > * { flex: 1 1 100%; }
  .hero-actions .primary, .hero-actions .secondary { justify-content: center; }
  .example-picker select { width: 100%; }
  .measures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-grid, .form { grid-template-columns: minmax(0, 1fr); }
  .page-title { padding-block: var(--s5) var(--s4); }
  .top-inner { min-height: 56px; }
  .demo-label { font-size: 10px; }
  .alert { flex-direction: column; gap: var(--s2); }
  #strip-svg { min-width: 680px; }
}

.top-right { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; justify-content: flex-end; }
.install { display: inline-flex; align-items: center; gap: var(--s1); min-height: 34px; padding: var(--s1) var(--s3); border-radius: 40px; border: 0; background: var(--mint); color: var(--header); font-size: var(--text-xs); font-weight: 900; }
.install .icon { width: 16px; height: 16px; }
.offline { font-size: var(--text-xs); font-weight: 900; color: var(--header); background: var(--yellow); padding: 3px 10px; border-radius: 30px; }
.toast { position: fixed; left: 50%; bottom: max(16px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: var(--s3); max-width: calc(100% - 32px); background: var(--header); color: var(--white); padding: var(--s2) var(--s2) var(--s2) var(--s4); border-radius: 40px; box-shadow: 0 10px 30px oklch(18% .03 320 / .3); font-size: var(--text-sm); font-weight: 700; }
.toast button { border: 0; border-radius: 30px; background: var(--mint); color: var(--header); font-weight: 900; min-height: 38px; padding: 0 var(--s3); }
.steps { padding-left: 1.2rem; display: grid; gap: var(--s3); font-size: var(--text-sm); margin: var(--s3) 0; }
.icon.inline { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; }
.topbar { padding-top: env(safe-area-inset-top); }
@media (max-width: 560px) { .demo-label { display: none; } }
dialog { border: 1px solid var(--border); border-radius: var(--radius); padding: var(--s6); width: min(530px, calc(100% - var(--s8))); max-height: calc(100% - var(--s8)); background: var(--white); color: var(--ink); box-shadow: 0 20px 75px oklch(18% .03 320 / .22); }
dialog::backdrop { background: oklch(20% .04 320 / .55); }
.dialog-header { display: flex; justify-content: space-between; gap: var(--s4); align-items: flex-start; margin-bottom: var(--s2); }
.close { display: grid; place-items: center; height: 44px; width: 44px; border: 1px solid var(--border); border-radius: .5rem; color: var(--ink); background: var(--white); }
.close:hover { background: var(--lavender); }
.dialog-note { color: var(--muted); font-size: var(--text-xs); padding-top: var(--s3); }

/* ---------- navigation ---------- */
.top-inner { gap: var(--s3); }
.nav { display: flex; gap: 2px; background: oklch(100% 0 0 / .08); padding: 3px; border-radius: 40px; margin-right: auto; margin-left: var(--s3); }
.nav-tab { color: oklch(100% 0 0 / .78); text-decoration: none; font-weight: 900; font-size: var(--text-sm); padding: 6px 14px; border-radius: 30px; min-height: 34px; display: inline-flex; align-items: center; }
.nav-tab[aria-current="true"] { background: var(--white); color: var(--header); }
.settings input { min-height: 44px; border: 1px solid var(--active-border); border-radius: .55rem; background: var(--white); color: var(--ink); padding: var(--s2) var(--s3); font: inherit; font-size: 16px; }
.settings-note { font-size: var(--text-xs); color: var(--muted); margin-top: var(--s2); }

/* ---------- cours ---------- */
.learn { max-width: 820px; margin-inline: auto; padding-block: var(--s6) var(--s4); }
.learn-head h1, .chapter h1 { font: 700 clamp(2rem, 5vw, 2.8rem)/1.08 var(--font-display); letter-spacing: -.02em; text-wrap: balance; }
.learn-head .intro { margin-top: var(--s3); color: var(--muted); max-width: 62ch; }
.progress { display: grid; gap: var(--s1); margin-top: var(--s4); font-size: var(--text-xs); color: var(--muted); font-weight: 700; }
.chapters { list-style: none; padding: 0; margin: var(--s5) 0 0; display: grid; gap: var(--s2); }
.chapter-card { display: grid; grid-template-columns: 44px 1fr auto; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); background: var(--white); border: 1px solid var(--line); border-radius: .75rem; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.chapter-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.chapter-card .num { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--lavender); color: var(--primary); font: 700 1.05rem var(--font-display); }
.chapter-card.done .num { background: var(--green); color: var(--white); }
.chapter-card strong { display: block; font-size: var(--text-base); }
.chapter-card small { display: block; color: var(--muted); font-size: var(--text-xs); margin-top: 2px; }
.chapter-card .time { color: var(--muted); font-size: var(--text-xs); white-space: nowrap; }
.crumb { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--s2); font-size: var(--text-sm); color: var(--muted); }
.crumb a { color: var(--primary); font-weight: 900; text-decoration: none; }
.chapter { margin-top: var(--s4); }
.chapter .goal { margin-top: var(--s3); padding: var(--s3) var(--s4); background: var(--lavender); border-radius: .55rem; color: var(--primary); }
.lesson { margin-top: var(--s6); }
.lesson h2, .subtle h2, .quiz h2, .sources h2 { font: 600 1.3rem/1.25 var(--font-display); letter-spacing: -.01em; margin-bottom: var(--s2); }
.lesson p, .lesson li { font-size: 1rem; line-height: 1.6; max-width: 68ch; }
.lesson p + p, .lesson ul, .lesson ol { margin-top: var(--s2); }
.lesson ul, .lesson ol { padding-left: 1.2rem; display: grid; gap: 6px; }
.lesson-fig { margin: var(--s3) 0; background: var(--white); border: 1px solid var(--line); border-radius: .75rem; padding: var(--s3); }
.lesson-fig svg { display: block; width: 100%; max-width: 560px; height: auto; margin-inline: auto; }
.note-us { font-size: var(--text-sm) !important; color: var(--orange-ink); background: var(--orange-wash); padding: var(--s2) var(--s3); border-radius: .45rem; }
table.mini { width: 100%; border-collapse: collapse; margin-top: var(--s3); font-size: var(--text-sm); background: var(--white); border-radius: .55rem; overflow: hidden; }
table.mini th, table.mini td { text-align: left; padding: var(--s2) var(--s3); border-bottom: 1px solid var(--line); vertical-align: top; }
table.mini th { background: var(--canvas); font-size: var(--text-xs); color: var(--muted); }
.subtle { margin-top: var(--s6); padding: var(--s4) var(--s5); border-radius: .8rem; background: var(--header); color: var(--white); }
.subtle h2 { color: var(--mint); }
.subtle ul { padding-left: 1.1rem; display: grid; gap: var(--s2); margin: 0; }
.subtle li { line-height: 1.55; }
.subtle b { color: var(--mint); }
.red-list li::marker { color: var(--red); }
.quiz { margin-top: var(--s6); display: grid; gap: var(--s3); }
.quiz .q { border: 1px solid var(--line); border-radius: .7rem; padding: var(--s3) var(--s4); background: var(--white); display: grid; gap: var(--s2); margin: 0; }
.quiz legend { font-weight: 900; padding: 0; float: left; width: 100%; margin-bottom: var(--s1); }
.opt { text-align: left; min-height: 44px; padding: var(--s2) var(--s3); border: 1px solid var(--active-border); border-radius: .5rem; background: var(--canvas); color: var(--ink); font: inherit; cursor: pointer; }
.opt:hover:not(:disabled) { border-color: var(--primary); }
.opt.ok { background: var(--green-wash); border-color: var(--green); color: var(--green-ink); font-weight: 900; }
.opt.ko { background: var(--red-wash); border-color: var(--red); color: var(--red-ink); }
.opt:disabled { cursor: default; }
.why { font-size: var(--text-sm); background: var(--canvas); padding: var(--s2) var(--s3); border-radius: .45rem; }
.score { font-weight: 900; color: var(--primary); }
.sources { margin-top: var(--s6); font-size: var(--text-sm); }
.sources ul { padding-left: 1.1rem; display: grid; gap: 4px; }
.sources a { color: var(--primary); overflow-wrap: anywhere; }
.pager { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s6); flex-wrap: wrap; }
.pager a { width: auto; text-decoration: none; max-width: 100%; }
.learn-more { display: inline-flex; gap: 4px; align-items: center; color: var(--primary); font-weight: 900; font-size: var(--text-sm); text-decoration: none; }
.subtil { background: var(--header); color: var(--white); border-radius: .45rem; padding: var(--s2) var(--s3); }
.subtil h5 { color: var(--mint) !important; }
@media (max-width: 560px) {
  .nav { margin-left: 0; }
  .nav-tab { padding: 6px 10px; }
  .chapter-card { grid-template-columns: 36px 1fr; }
  .chapter-card .time { display: none; }
  .subtle { padding: var(--s4); }
  .wordmark { font-size: 1rem; }
}

/* ---------- scanner en direct ---------- */
body.live-open { overflow: hidden; }
.live { position: fixed; inset: 0; z-index: 80; background: #000; color: #fff; }
.live video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.live-frame { position: absolute; inset: 12% 4% 22%; pointer-events: none; }
.live-frame span { position: absolute; width: 38px; height: 38px; border: 4px solid #fff; transition: border-color .2s; }
.live-frame span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 10px 0 0 0; }
.live-frame span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 10px 0 0; }
.live-frame span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 10px; }
.live-frame span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 10px 0; }
.live[data-state="lock"] .live-frame span { border-color: var(--mint); }
.live[data-state="shot"]::after { content: ''; position: absolute; inset: 0; background: #fff; animation: flash .25s ease-out; }
@keyframes flash { from { opacity: .9; } to { opacity: 0; } }
.live-top { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 14px; right: 14px; display: flex; justify-content: space-between; }
.live-btn { min-width: 48px; min-height: 48px; border-radius: 30px; border: 0; background: rgba(0,0,0,.45); color: #fff; font: inherit; font-weight: 900; display: grid; place-items: center; backdrop-filter: blur(6px); }
.live-btn.wide { padding: 0 16px; font-size: var(--text-sm); }
.live-btn[aria-pressed="true"] { background: var(--yellow); color: #000; }
.live-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 16px 16px max(22px, env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0,0,0,.75) 35%); display: grid; gap: 14px; justify-items: center; }
.live-bottom p { text-align: center; font-weight: 700; max-width: 40ch; min-height: 2.6em; text-shadow: 0 1px 3px #000; }
.live[data-state="lock"] .live-bottom p { color: var(--mint); }
.live-actions { width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; }
.live-actions .wide { justify-self: start; }
.live-shoot { width: 72px; height: 72px; border-radius: 50%; border: 5px solid #fff; background: rgba(255,255,255,.25); }
.live-shoot:active { background: #fff; }
.live-hint { justify-self: end; font-size: var(--text-xs); opacity: .8; }

.live[data-state="error"] .live-bottom p { color: #ffd8a8; }
.live[data-state="error"] .live-shoot, .live[data-state="error"] .live-hint { visibility: hidden; }

.live-film { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.live-scanline { position: absolute; left: 6%; right: 6%; height: 3px; top: 15%; background: linear-gradient(90deg, transparent, #93c5fd, transparent); box-shadow: 0 0 14px #60a5fa; opacity: 0; pointer-events: none; }
.live[data-state="frozen"] .live-scanline { opacity: 1; animation: scanline .9s ease-in-out infinite alternate; }
@keyframes scanline { from { top: 15%; } to { top: 75%; } }
.live[data-state="frozen"] .live-shoot, .live[data-state="frozen"] .live-hint { visibility: hidden; }
.live[data-state="frozen"] .live-frame span { border-color: #60a5fa; }
.live[data-state="frozen"] .live-bottom p { color: #93c5fd; }
.live[data-state="lock"] .live-frame span { border-color: #60a5fa; }
.live[data-state="lock"] .live-bottom p { color: #93c5fd; }
@media (prefers-reduced-motion: reduce) { .live[data-state="frozen"] .live-scanline { animation: none; top: 45%; } }

/* ---------- accueil ---------- */
.wordmark { text-decoration: none; color: inherit; }
.home { max-width: 860px; margin-inline: auto; padding-block: var(--s6) var(--s5); }
.home-hero { position: relative; padding: var(--s5) 0 var(--s4); }
.home-trace { position: absolute; inset: 0 0 auto; width: 100%; height: 120px; opacity: .16; }
.home-trace path { fill: none; stroke: var(--primary); stroke-width: 3; stroke-linejoin: round; stroke-dasharray: 1400; stroke-dashoffset: 1400; animation: draw 2.4s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .home-trace path { animation: none; stroke-dashoffset: 0; } }
.home-hero h1 { position: relative; font: 700 clamp(2.1rem, 6vw, 3.2rem)/1.05 var(--font-display); letter-spacing: -.025em; text-wrap: balance; }
.home-hero .eyebrow, .home-hero .intro { position: relative; }
.home-hero .intro { margin-top: var(--s3); color: var(--muted); font-size: 1.05rem; }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); margin-top: var(--s4); }
.choice { display: grid; grid-template-rows: auto 1fr auto; gap: var(--s3); padding: var(--s5); border-radius: 1.1rem; text-decoration: none; color: var(--white); min-height: 250px; position: relative; overflow: hidden; transition: transform .18s, box-shadow .18s; box-shadow: 0 10px 28px oklch(23% .05 320 / .18); }
.choice:hover, .choice:focus-visible { transform: translateY(-3px); box-shadow: 0 16px 34px oklch(23% .05 320 / .26); }
.choice-scan { background: linear-gradient(150deg, var(--header), oklch(38% .09 300)); }
.choice-learn { background: linear-gradient(150deg, oklch(42% .1 175), oklch(32% .07 200)); }
.choice-icon { display: grid; place-items: center; width: 58px; height: 58px; border-radius: 16px; background: oklch(100% 0 0 / .14); }
.choice-icon .icon { width: 30px; height: 30px; color: var(--mint); }
.choice-text strong { display: block; font: 700 1.55rem/1.15 var(--font-display); letter-spacing: -.01em; }
.choice-text small { display: block; margin-top: var(--s2); font-size: .95rem; line-height: 1.5; color: oklch(100% 0 0 / .82); }
.choice-text em { display: block; margin-top: var(--s2); font-style: normal; font-size: var(--text-xs); font-weight: 900; color: var(--mint); }
.choice-go { justify-self: end; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--white); color: var(--header); }
.home-quick { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s4); }
.home-quick > * { width: auto; text-decoration: none; }
.home-note { display: flex; gap: var(--s2); align-items: center; margin-top: var(--s4); color: var(--muted); font-size: var(--text-xs); }
body[data-view="home"] .safety { display: none; }
@media (max-width: 640px) {
  .choices { grid-template-columns: minmax(0, 1fr); }
  .choice { min-height: 0; grid-template-columns: auto 1fr auto; grid-template-rows: auto; align-items: center; padding: var(--s4); }
  .choice-text strong { font-size: 1.25rem; }
  .choice-text small { font-size: .88rem; }
  .choice-go { width: 38px; height: 38px; }
  .home-quick > * { flex: 1 1 100%; justify-content: center; }
}

/* ---------- Atlas ---------- */
.lesson-fig.small svg { max-width: 300px; }
.lesson-fig .credit, .atlas-credit { font-size: var(--text-xs); color: var(--muted); text-align: center; margin-top: var(--s1); }
.atlas-index { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s4) 0; }
.atlas-index a { font-size: var(--text-xs); font-weight: 900; color: var(--primary); background: var(--lavender); padding: 6px 10px; border-radius: 999px; text-decoration: none; }
.atlas-card { margin-top: var(--s5); background: var(--white); border: 1px solid var(--line); border-radius: .9rem; padding: var(--s4); scroll-margin-top: 80px; }
.atlas-card h3 { font: 600 1.15rem/1.25 var(--font-display); margin-bottom: var(--s3); }
.atlas-grid { display: grid; grid-template-columns: minmax(130px, 34%) 1fr; gap: var(--s3); align-items: start; }
.atlas-heart svg { width: 100%; height: auto; display: block; }
.atlas-heart .zone { font-size: var(--text-xs); font-weight: 900; color: var(--orange-ink); text-align: center; margin-top: 4px; line-height: 1.3; }
.atlas-leads { display: grid; gap: 6px; }
.ls { margin: 0; background: #fff6f6; border-radius: .4rem; overflow: hidden; }
.ls svg { display: block; width: 100%; height: auto; }
.atlas-text { display: grid; gap: var(--s2); margin-top: var(--s3); }
.atlas-text dt { font-size: var(--text-xs); font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.atlas-text dd { margin: 2px 0 0; line-height: 1.5; }
.atlas-text .trap { background: var(--orange-wash); border-radius: .5rem; padding: var(--s2) var(--s3); }
.atlas-text .trap dt { color: var(--orange-ink); }
.card-heart { width: 150px; justify-self: center; margin: 0; }
.card-heart figcaption { font-size: 11px; font-weight: 900; color: var(--orange-ink); text-align: center; line-height: 1.25; }
.card-heart svg { width: 100%; height: auto; display: block; }
@media (max-width: 520px) { .atlas-grid { grid-template-columns: 1fr; } .atlas-heart { max-width: 240px; margin-inline: auto; } }

.credit-line { font-size: var(--text-xs); color: var(--muted); margin-top: var(--s2); }
.credit-line a { color: inherit; }
