/* Feuille de style unique du site « Penser en mandarin » (source : py/site.css, copiée en style.css par py/web_commun.py).
   Une modification ici ne demande d'envoyer que style.css : les pages HTML ne contiennent plus de CSS.
   Plan : 1 variables · 2 base · 3 en-tête · 4 boutons · 5 accueil · 6 chapitre · 7 pages de texte · 8 pied · 9 adaptations · 10 mode sombre */

/* ---------- 1. variables ---------- */
@font-face { font-family:"Montserrat"; src:url("fonts/Montserrat-ExtraBold.woff2") format("woff2"); font-weight:800; font-style:normal; font-display:swap; }
@font-face { font-family:"Quicksand"; src:url("fonts/Quicksand.woff2") format("woff2"); font-weight:300 700; font-style:normal; font-display:swap; }
:root {
  --hero:#f9d440; --jaune:#f9d440; --rouge:#b3261e; --rouge-texte:#b3261e; --rouge-clair:#ff8a80;
  --encre:#1b1b1b; --fond:#fbf7ea; --carte:#fff; --gris:#5a5640; --filet:#e4dcc0;
  --titre:"Montserrat","Segoe UI",system-ui,sans-serif; --texte:"Quicksand","Segoe UI",system-ui,sans-serif;
  --kai:KaiTi,"Kaiti SC",STKaiti,"Noto Serif SC",serif;
  --cjk:"Noto Sans SC","Microsoft YaHei","PingFang SC","Hiragino Sans GB",sans-serif;
  --c:clamp(56px,8.6vw,118px);
  /* échelle typographique : les tailles des titres se règlent ici */
  --t-corps:17px;
  --t-h1-accueil:clamp(28px,3.6vw,48px);
  --t-h1-chapitre:clamp(24px,3.2vw,38px);
  --t-h2-accueil:clamp(24px,2.8vw,36px);
  --t-h2-chapitre:clamp(20px,2.4vw,26px);
  --t-h2-page:clamp(20px,2.2vw,24px);
  --t-h2-suite:clamp(24px,3vw,34px);
}

/* ---------- 2. base ---------- */
* { box-sizing:border-box; }
html { scroll-behavior:smooth; overflow-x:clip; -webkit-text-size-adjust:100%; text-size-adjust:100%; }
body { margin:0; overflow-x:clip; font-family:var(--texte); font-size:var(--t-corps); line-height:1.55; color:var(--encre); background:var(--fond); }
a { color:inherit; }
button { font-family:inherit; }
:focus-visible { outline:3px solid var(--encre); outline-offset:3px; }
.cadre { width:min(1180px, 100% - 48px); margin-inline:auto; }
.etroit { width:min(860px, 100% - 48px); margin-inline:auto; }
.sr-seul { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }

/* ---------- 3. en-tête (identique sur toutes les pages) ---------- */
.hero { background:var(--hero); }
.hero :focus-visible { outline-color:#1b1b1b; }
.barre { position:relative; display:flex; align-items:center; justify-content:space-between; gap:24px; padding:24px 0; }
.marque { position:relative; display:flex; align-items:center; gap:20px; text-decoration:none; color:#1b1b1b; }
.mini { display:flex; flex:none; }
.mini i { position:relative; isolation:isolate; display:flex; align-items:center; justify-content:center; width:46px; height:46px; margin-left:-2px; border:2px solid var(--rouge); color:var(--rouge); font:normal 28px/1 var(--kai); }
.mini i:before, .mini i:after { content:""; position:absolute; z-index:-1; border:0 dashed rgba(179,38,30,.55); }
.mini i:before { left:0; right:0; top:50%; border-top-width:1px; }
.mini i:after { top:0; bottom:0; left:50%; border-left-width:1px; }
.titre-site { font-family:var(--titre); font-weight:800; font-size:clamp(26px,2.6vw,34px); line-height:1.1; white-space:nowrap; }
.barre nav { display:flex; align-items:center; gap:30px; font-weight:600; font-size:19px; line-height:1.1; color:#1b1b1b; }
.barre nav a { text-decoration:none; padding:4px 0; border-bottom:2px solid transparent; }
.barre nav a:hover, .barre nav a[aria-current] { border-bottom-color:var(--rouge); }
.burger { display:none; width:46px; height:46px; padding:0; border:2px solid #1b1b1b; border-radius:12px; background:transparent; cursor:pointer; flex:none; }
.burger span { display:block; width:22px; height:2px; margin:5px auto; background:#1b1b1b; transition:transform .2s, opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform:translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity:0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform:translateY(-7px) rotate(-45deg); }

/* ---------- 4. boutons ---------- */
.btn, .bouton, a.telecharger { display:inline-block; text-decoration:none; font:700 18px/1.25 var(--texte); padding:14px 22px; border-radius:14px; border:2.5px solid var(--rouge); cursor:pointer; transition:transform .12s ease; }
.btn:active, .bouton:active, a.telecharger:active { transform:scale(.97); }
.btn.plein, .bouton, a.telecharger { background:var(--rouge); color:#fff !important; }
.btn.plein:hover, .bouton:hover, a.telecharger:hover { background:var(--encre); border-color:var(--encre); }
.btn.vide { background:transparent; color:var(--encre); border-color:var(--encre); }
.btn.vide:hover { background:var(--encre); color:var(--jaune); }
.actions { display:flex; flex-wrap:wrap; gap:14px 18px; margin-top:34px; }

/* ---------- 5. accueil ---------- */
.p-accueil .hero { padding-bottom:clamp(48px,7vw,96px); }
.p-accueil .hero .grille { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.1fr); gap:clamp(32px,5vw,72px); align-items:center; padding-top:clamp(24px,4vw,56px); }
.p-accueil h1 { font-family:var(--titre); font-weight:800; font-size:var(--t-h1-accueil); line-height:1.08; letter-spacing:-.015em; margin:0; text-wrap:balance; }
.chapo { font-size:clamp(19px,1.7vw,23px); margin:26px 0 0; max-width:34em; font-weight:500; }

/* la phrase qui se retourne */
.atelier { display:flex; flex-direction:column; align-items:center; }
.p-accueil .phrase { position:relative; display:flex; gap:calc(var(--c) * .32); justify-content:center; padding:10px 0 6px; }
.grp { display:flex; flex-direction:column; align-items:center; will-change:transform; }
.cases { display:flex; }
.cases span { position:relative; width:var(--c); height:var(--c); margin-left:-2px; border:2.5px solid var(--rouge); display:flex; align-items:center; justify-content:center; font-family:var(--kai); font-size:calc(var(--c) * .6); line-height:1; color:var(--rouge); }
.cases span:before, .cases span:after { content:""; position:absolute; border:0 dashed rgba(179,38,30,.5); }
.cases span:before { left:0; right:0; top:50%; border-top-width:1.5px; }
.cases span:after { top:0; bottom:0; left:50%; border-left-width:1.5px; }
.cases b { position:relative; z-index:1; font-weight:400; }
.cro { align-self:stretch; height:10px; margin:8px 3px 0; border:2px solid var(--encre); border-top:0; }
.nom { font-weight:700; font-size:clamp(17px,1.6vw,21px); margin-top:6px; }
.gl { font-size:clamp(15px,1.3vw,17px); color:var(--gris); font-weight:500; }
.barre-faux { position:absolute; left:0; right:0; top:calc(var(--c) * .5 + 10px); height:6px; background:var(--encre); border-radius:3px; transform:scaleX(0) rotate(-1.5deg); transform-origin:left; transition:transform .35s ease .35s; pointer-events:none; }
.p-accueil .phrase.faux .barre-faux { transform:scaleX(1) rotate(-1.5deg); }
.retourner { margin-top:26px; font:700 18px/1 var(--texte); background:var(--encre); color:var(--jaune); border:0; border-radius:14px; padding:16px 24px; cursor:pointer; }
.retourner:hover { background:var(--rouge); color:#fff; }
.legende { margin:18px 0 0; min-height:4.6em; text-align:center; max-width:30em; font-weight:500; }

/* le livre */
.livre { padding:clamp(56px,8vw,112px) 0; }
.livre .grille { display:grid; grid-template-columns:minmax(0,340px) minmax(0,1fr); gap:clamp(32px,6vw,88px); align-items:start; }
.couv { display:flex; flex-direction:column; align-items:center; gap:22px; }
.couv .grande { display:block; width:100%; }
.couv .grande img { display:block; width:100%; height:auto; border-radius:3px; box-shadow:0 16px 40px rgba(60,50,0,.28); }
.couv .amazon { display:block; line-height:0; }
.couv .amazon img { width:150px; height:auto; border:0; }
.p-accueil h2 { margin:0; font-family:var(--titre); font-weight:800; font-size:var(--t-h2-accueil); line-height:1.1; letter-spacing:-.01em; text-wrap:balance; }
.livre p { max-width:36em; }
.livre .lead { font-size:22px; margin:24px 0 0; }
.faits { margin:30px 0 0; padding:0; list-style:none; max-width:36em; }
.faits li { padding:12px 0 12px 34px; border-top:1px solid var(--filet); position:relative; }
.faits li:last-child { border-bottom:1px solid var(--filet); }
.faits li:before { content:""; position:absolute; left:0; top:20px; width:16px; height:16px; border:2px solid var(--rouge-texte); }
.achat { display:flex; flex-wrap:wrap; gap:14px 18px; margin-top:34px; }

/* l'essai : bande rouge */
.essai, .suite { background:var(--rouge); color:#fff; }
.essai { padding:clamp(56px,8vw,112px) 0; }
.essai .grille { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.05fr); gap:clamp(32px,6vw,88px); align-items:center; }
.essai p { max-width:34em; font-size:21px; }
.essai .btn, .suite .btn { border-color:#fff; color:#fff; }
.essai .btn.plein, .suite .btn.plein { background:var(--jaune); border-color:var(--jaune); color:#1b1b1b !important; }
.essai .btn.plein:hover, .suite .btn.plein:hover { background:#fff; border-color:#fff; }
.essai .btn.vide, .suite .btn.vide { background:transparent; color:#fff; }
.essai .btn.vide:hover, .suite .btn.vide:hover { background:#fff; color:var(--rouge); }
.essai .grille > div:first-child { container-type:inline-size; }
.essai .actions { display:inline-grid; grid-auto-flow:column; grid-auto-columns:1fr; gap:14px 18px; }
.essai .actions .btn { text-align:center; white-space:nowrap; }
@container (max-width:500px) { .essai .actions { display:grid; grid-auto-flow:row; grid-auto-columns:auto; } }
.exemple { position:relative; background:#fff; color:#1b1b1b; padding:30px 34px 28px; border-radius:6px; text-align:left; width:100%; border:0; font:inherit; cursor:pointer; display:block; }
.exemple:focus-visible { outline-color:var(--jaune); }
.exemple .zh { display:block; font-size:clamp(40px,5vw,66px); line-height:1.15; }
.exemple .py, .exemple .fr { display:block; max-height:0; opacity:0; overflow:hidden; transition:max-height .3s ease, opacity .3s ease; }
.exemple .py { color:#5a5640; font-size:23px; }
.exemple .fr { color:#b3261e; font-size:26px; font-weight:600; }
.exemple.ouvert .py { max-height:50px; opacity:1; margin-top:8px; }
.exemple.ouvert .fr { max-height:50px; opacity:1; margin-top:2px; }
.exemple .astuce { display:block; margin-top:14px; font-size:16px; color:#5a5640; }
.exemple.ouvert .astuce { display:none; }
.voix { display:flex; gap:12px; margin-top:16px; flex-wrap:wrap; }
.voix button { font:700 20px/1 var(--texte); padding:15px 22px; border-radius:14px; border:2.5px solid var(--jaune); cursor:pointer; background:transparent; color:#fff; }
.voix button:first-child { background:var(--jaune); color:#1b1b1b; }
.voix button[aria-pressed="true"] { box-shadow:0 0 0 4px rgba(255,255,255,.85); }
.voix small { align-self:center; color:rgba(255,255,255,.92); font-size:16px; }

/* le sommaire */
.sommaire { padding:clamp(56px,8vw,112px) 0; }
.sommaire .intro { max-width:40em; margin:18px 0 0; }
.parties { margin-top:44px; }
.partie { display:grid; grid-template-columns:minmax(0,.9fr) minmax(0,1.5fr); gap:12px 40px; padding:26px 0; border-top:3px solid var(--rouge-texte); }
.partie h3 { margin:0; font-family:var(--titre); font-weight:800; font-size:24px; line-height:1.2; }
.partie h3 span { display:block; color:var(--rouge-texte); font-size:18px; margin-bottom:4px; }
.partie ul { list-style:none; margin:0; padding:0; }
.partie li a { display:flex; gap:16px; padding:7px 0; text-decoration:none; border-bottom:1px solid var(--filet); }
.partie li a:hover .t { text-decoration:underline; }
.partie .n { flex:0 0 2em; font-weight:700; color:var(--rouge-texte); text-align:right; }
.partie li.bientot { display:flex; gap:16px; padding:7px 0; border-bottom:1px solid var(--filet); color:var(--gris); }
.libre { margin-left:auto; flex:0 0 auto; background:var(--jaune); color:#1b1b1b; font-size:14px; font-weight:700; padding:2px 10px; border-radius:10px; align-self:center; }

/* ---------- 6. chapitre ---------- */
.retour { display:inline-block; margin:30px 0 0; font-size:17px; }
h1.chapitre { display:flex; align-items:center; gap:clamp(16px,2.4vw,28px); margin:18px 0 0; font-family:var(--titre); font-weight:800; font-size:var(--t-h1-chapitre); line-height:1.12; letter-spacing:-.01em; text-wrap:balance; word-break:keep-all; }
.carre { position:relative; isolation:isolate; flex:none; display:flex; align-items:center; justify-content:center; width:clamp(64px,9vw,96px); aspect-ratio:1; border:2.5px solid var(--rouge-texte); color:var(--rouge-texte); font:800 clamp(28px,4vw,42px)/1 var(--titre); }
.carre:before, .carre:after { content:""; position:absolute; z-index:-1; border:0 dashed rgba(179,38,30,.5); }
.carre:before { left:0; right:0; top:50%; border-top-width:1.5px; }
.carre:after { top:0; bottom:0; left:50%; border-left-width:1.5px; }
p.avertissement { margin:22px 0 0; padding:12px 16px; border-left:5px solid var(--rouge-texte); background:var(--carte); font-size:18px; }
.reglages { position:sticky; top:0; z-index:5; display:flex; flex-wrap:wrap; align-items:center; gap:4px 26px; margin:28px 0 0; padding:14px 0; background:var(--fond); border-bottom:1px solid var(--filet); }
.reglages label { display:flex; align-items:center; gap:9px; padding:6px 2px; font-size:19px; cursor:pointer; }
.reglages input { width:22px; height:22px; margin:0; accent-color:var(--rouge-texte); cursor:pointer; }
.reglages .astuce { flex:1 1 280px; margin:0; font-size:16px; color:var(--gris); }
.astuce-mobile { display:none; margin:14px 0 0; font-size:16px; color:var(--gris); }
.p-chapitre h2 { margin:52px 0 6px; padding-top:16px; border-top:3px solid var(--rouge-texte); font-family:var(--titre); font-weight:800; font-size:var(--t-h2-chapitre); line-height:1.18; letter-spacing:-.005em; word-break:keep-all; }
.p-chapitre .phrase { display:flex; align-items:center; gap:18px; margin:12px 0; padding:18px 22px; background:var(--carte); border:1.5px solid var(--filet); border-radius:6px; }
.texte { flex:1; min-width:0; cursor:pointer; min-height:48px; }
.p-chapitre .zh { font-size:clamp(30px,4.2vw,42px); line-height:1.25; font-family:var(--cjk); }
.p-chapitre .py { color:var(--gris); font-size:clamp(18px,2vw,20px); margin-top:2px; }
.p-chapitre .fr { color:var(--rouge-texte); font-size:clamp(19px,2.2vw,22px); font-weight:600; margin-top:2px; }
.sons { display:flex; gap:10px; flex:none; }
button.play { appearance:none; position:relative; min-width:84px; height:56px; padding:0 18px; border-radius:14px; border:2.5px solid var(--rouge); background:var(--rouge); color:#fff; font:700 19px/1 var(--texte); cursor:pointer; transition:transform .12s; }
button.play.h { background:transparent; color:var(--encre); }
button.play:active { transform:scale(.96); }
button.play.joue { box-shadow:0 0 0 4px rgba(249,212,64,.95); }
body.sans-zh .phrase:not(.revele) .zh, body.sans-pinyin .phrase:not(.revele) .py, body.sans-fr .phrase:not(.revele) .fr { display:none; }
body.sans-zh.sans-pinyin.sans-fr .phrase:not(.revele) .texte::before { content:"Touchez pour afficher"; color:var(--gris); font-size:18px; line-height:48px; }
section.anki { margin-top:8px; }
section.anki p { max-width:36em; }
section.anki ol { list-style:none; counter-reset:etape; margin:18px 0; padding:0; }
section.anki li { counter-increment:etape; display:flex; gap:16px; align-items:baseline; padding:12px 0; border-top:1px solid var(--filet); max-width:36em; }
section.anki li:last-child { border-bottom:1px solid var(--filet); }
section.anki li:before { content:counter(etape); flex:none; width:2em; font:800 22px/1 var(--titre); color:var(--rouge-texte); }
a.telecharger { margin:8px 0 6px; padding:15px 24px; }
.suite { margin-top:72px; padding:clamp(44px,6vw,80px) 0; }
.suite h2 { margin:0; padding:0; border:0; font-family:var(--titre); font-weight:800; font-size:var(--t-h2-suite); line-height:1.15; }
.suite p { max-width:32em; margin:16px 0 0; font-size:21px; }
.suite .actions { margin-top:30px; }
.suite :focus-visible { outline-color:#fff; }
.avis-lecteur { margin:60px 0 0; text-align:center; }
.avis-lecteur a { display:inline-block; }
.avis-lecteur img { height:82px; width:auto; max-width:100%; border:0; }

/* ---------- 7. pages de texte (Anki, contact, accès, mentions légales, 404) ---------- */
.p-page main { width:min(780px, 100% - 48px); margin-inline:auto; padding:8px 0 24px; }
.p-page .intro { margin:30px 0 0; font-size:17px; }
.p-page .corps { margin-top:8px; }
.p-page h2 { margin:44px 0 8px; padding-top:16px; border-top:3px solid var(--rouge-texte); font-family:var(--titre); font-weight:800; font-size:var(--t-h2-page); line-height:1.2; }
.p-page .corps > h2:first-child { margin-top:20px; }
.p-page p, .p-page li { max-width:40em; }
.p-page .corps p, .p-page .corps li { margin:10px 0; }
.p-page .corps ul, .p-page .corps ol { padding-left:24px; list-style:revert; }
.p-page .corps a { color:var(--encre); }
.p-page .corps a.bouton { color:#fff; }
.p-page code { font-family:Consolas,monospace; font-size:16px; background:var(--carte); padding:1px 6px; border-radius:4px; }
.p-page .petit { font-size:15px; color:var(--gris); }
.p-page .installer { text-align:center; margin:18px 0 6px; }
.p-page .installer p { margin:0; max-width:none; }
.p-page .installer p.petit { margin-top:8px; }
.p-page .capture { display:block; width:100%; height:auto; border-radius:6px; border:1.5px solid var(--filet); background:var(--carte); margin:14px 0 4px; }
.p-page .capture.petite { max-width:520px; }
.p-page .corps p:has(> .capture) { max-width:none; margin:14px 0 4px; }
.p-page input[type=text] { font:inherit; font-size:20px; padding:12px 14px; width:100%; max-width:340px; background:var(--carte); color:var(--encre); border:2.5px solid var(--filet); border-radius:12px; text-transform:uppercase; }
.p-page input[type=text]:focus-visible { outline:3px solid var(--encre); outline-offset:2px; }
.p-page button.bouton { font:700 18px/1.25 var(--texte); }
.apercu { background:var(--carte); border:1.5px solid var(--filet); border-radius:6px; padding:14px 18px; margin:14px 0 4px; max-width:440px; }
.apercu .regl { display:flex; gap:18px; flex-wrap:wrap; padding:2px 0 8px; font-size:17px; border-bottom:1px solid var(--filet); }
.apercu .regl label { display:flex; gap:8px; align-items:center; }
.apercu .regl input { width:20px; height:20px; accent-color:var(--rouge-texte); margin:0; pointer-events:none; }
.apercu .astuce { color:var(--gris); font-size:15px; margin:8px 0 10px; }
.apercu .t { font:800 19px/1.25 var(--titre); margin:0 0 10px; padding-bottom:6px; border-bottom:3px solid var(--rouge-texte); }
.apercu .zh { font-size:30px; line-height:1.3; font-family:var(--cjk); }
.apercu .py { color:var(--gris); font-size:19px; margin-top:2px; }
.apercu .fr { color:var(--rouge-texte); font-size:20px; font-weight:600; margin-top:2px; }
.apercu .sons { display:flex; gap:10px; margin-top:12px; }
.apercu .sons span { flex:1; text-align:center; height:48px; line-height:43px; border-radius:14px; font-weight:700; font-size:16px; border:2.5px solid var(--rouge); }
.apercu .sons span:first-child { background:var(--rouge); color:#fff; }

/* ---------- 8. pied ---------- */
footer { margin-top:56px; background:#1b1b1b; color:#f3efe2; padding:44px 0 56px; font-size:16px; }
.p-accueil footer, .p-chapitre footer { margin-top:0; }
footer .cadre { display:flex; flex-wrap:wrap; gap:18px 48px; justify-content:space-between; }
footer a { color:var(--jaune); }
footer p { margin:0 0 8px; max-width:36em; }
footer .liens { display:flex; gap:24px; flex-wrap:wrap; }

/* ---------- 9. adaptations ---------- */
@media (max-width:1099px) {
  .barre { flex-wrap:wrap; padding:16px 0 14px; gap:0; }
  .marque { flex:1 1 0; min-width:0; max-width:360px; display:block; container-type:inline-size; }
  .mini { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); }
  .mini i { width:auto; height:auto; aspect-ratio:1; margin-left:0; font-size:12cqw; color:rgba(179,38,30,.28); }
  .mini i + i { border-left-width:0; }
  .titre-site { position:absolute; inset:0; z-index:2; display:flex; align-items:center; justify-content:center; font-size:min(8cqw,30px);
    text-shadow:0 0 5px var(--hero), 0 0 10px var(--hero), 0 0 14px var(--hero); }
  .burger { display:block; margin-left:12px; flex:none; }
  .barre nav { display:none; flex-basis:100%; flex-direction:column; align-items:stretch; gap:0; margin-top:14px; font-size:18px; border-top:2px solid #1b1b1b; }
  .barre.ouvert nav { display:flex; }
  .barre nav a { padding:14px 2px; border-bottom:1px solid rgba(27,27,27,.25); }
  .barre nav a[aria-current] { border-bottom-color:var(--rouge); }
}
@media (max-width:860px) {
  :root { --t-corps:16.5px; --c:clamp(38px,14.5vw,96px); }
  .cadre, .etroit, .p-page main { width:min(1180px, 100% - 40px); }
  .p-accueil .hero .grille, .livre .grille, .essai .grille, .partie { grid-template-columns:minmax(0,1fr); }
  .p-accueil .hero .grille { gap:40px; padding-top:12px; }
  .atelier, .p-accueil .hero .grille > div { min-width:0; max-width:100%; }
  .livre .couv { max-width:240px; margin-inline:auto; }
  .livre .grille { gap:36px; }
  .essai .grille { gap:32px; }
  .partie { padding:20px 0; gap:10px; }
}
@media (max-width:640px) {
  .retour { margin-top:22px; }
  .reglages { gap:0 20px; padding:10px 0; margin-top:22px; }
  .reglages .astuce { display:none; }
  .astuce-mobile { display:block; }
  .p-chapitre h2 { margin-top:40px; }
  .p-chapitre .phrase { flex-direction:column; align-items:stretch; gap:14px; padding:16px 16px 14px; }
  button.play { flex:1; height:56px; }
  .suite { margin-top:56px; }
  .suite .actions { flex-direction:column; align-items:stretch; }
  .btn, a.telecharger, .bouton { text-align:center; }
  a.telecharger { display:block; }
  footer .cadre { flex-direction:column; }
  footer .liens { gap:4px 22px; }
  footer .liens a { padding:10px 0; }
}
@media (max-width:560px) {
  .chapo { margin-top:18px; }
  .actions { flex-direction:column; align-items:stretch; margin-top:26px; gap:12px; }
  .btn { padding:16px 18px; }
  .essai .actions { display:grid; grid-auto-flow:row; grid-auto-columns:auto; }
  .p-accueil .phrase { gap:calc(var(--c) * .25); }
  .grp .nom { font-size:16px; }
  .retourner { width:100%; }
  .legende { min-height:5.8em; font-size:17px; }
  .livre .lead { font-size:19px; }
  .achat { flex-direction:column; align-items:stretch; }
  .essai p { font-size:18px; }
  .exemple { padding:22px 20px 20px; }
  .exemple .zh { font-size:38px; }
  .exemple .py { font-size:20px; }
  .exemple .fr { font-size:19px; }
  .exemple.ouvert .py, .exemple.ouvert .fr { max-height:80px; }
  .voix { gap:10px; }
  .voix button { flex:1; padding:16px 12px; }
  .voix small { flex-basis:100%; }
  .partie h3 { font-size:21px; }
  .partie li a { padding:11px 0; gap:12px; flex-wrap:wrap; }
  .partie .n { flex-basis:1.6em; }
  .partie .t { flex:1 1 0; min-width:0; }
}
@media (prefers-reduced-motion:reduce) { * { transition:none !important; scroll-behavior:auto !important; } }

/* ---------- 10. mode sombre ---------- */
@media (prefers-color-scheme: dark) {
  :root { --hero:#221f16; --fond:#16140e; --carte:#221f16; --encre:#f3efe2; --gris:#a8a28d; --filet:#3a3626; --rouge-texte:#ff8a80; }
  .marque, .barre nav { color:#f3efe2; }
  .burger { border-color:#f3efe2; } .burger span { background:#f3efe2; }
  .barre nav { border-top-color:#f3efe2; }
  .hero :focus-visible { outline-color:#f3efe2; }
  .mini i, .cases span { border-color:var(--rouge-clair); color:var(--rouge-clair); }
  .mini i:before, .mini i:after, .cases span:before, .cases span:after { border-color:rgba(255,138,128,.5); }
  .barre nav a:hover, .barre nav a[aria-current] { border-bottom-color:var(--rouge-clair); }
  .btn.plein, .bouton, a.telecharger { background:var(--jaune); border-color:var(--jaune); color:#1b1b1b !important; }
  .btn.plein:hover, .bouton:hover, a.telecharger:hover { background:#fff; border-color:#fff; }
  .btn.vide:hover { background:var(--encre); color:#16140e; }
  .retourner { background:var(--jaune); color:#1b1b1b; }
  .retourner:hover { background:var(--rouge-clair); }
  .faits li:before { border-color:var(--rouge-clair); }
  .couv .grande img { box-shadow:0 16px 40px rgba(0,0,0,.6); }
  .essai, .suite { background:#7d1a14; }
  .essai .btn.vide:hover, .suite .btn.vide:hover { color:#7d1a14; }
  .libre { background:var(--jaune); color:#1b1b1b; }
  button.play { background:var(--jaune); border-color:var(--jaune); color:#1b1b1b; }
  button.play.h { background:transparent; color:#f3efe2; border-color:var(--jaune); }
  button.play.joue { box-shadow:0 0 0 4px rgba(255,255,255,.85); }
  .apercu .sons span { border-color:var(--jaune); }
  .apercu .sons span:first-child { background:var(--jaune); color:#1b1b1b; }
  footer { background:#0e0d09; }
}
@media (prefers-color-scheme: dark) and (max-width:1099px) { .mini i { color:rgba(255,138,128,.3); } }
